Commit fa48f84a8cc722ca48b32fa0c338b6c3b358717d

Authored by Mike Frysinger
1 parent 985895bd8d

Blackfin: unify memory map headers

Many aspects of the Blackfin memory map is exactly the same across all
variants.  Rather than copy and paste all of these duplicated values in
each header, unify all of these into the common Blackfin memory map header
file.  In the process, push down BF561 SMP specific stuff to the BF561
specific header to keep the noise down.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

Showing 16 changed files with 145 additions and 350 deletions Side-by-side Diff

arch/blackfin/include/asm/blackfin.h
... ... @@ -86,6 +86,7 @@
86 86  
87 87 #endif /* __ASSEMBLY__ */
88 88  
  89 +#include <asm/mem_map.h>
89 90 #include <mach/blackfin.h>
90 91 #include <asm/bfin-global.h>
91 92  
arch/blackfin/include/asm/mem_map.h
1 1 /*
2   - * mem_map.h
3   - * Common header file for blackfin family of processors.
  2 + * Common Blackfin memory map
4 3 *
  4 + * Copyright 2004-2009 Analog Devices Inc.
  5 + * Licensed under the GPL-2 or later.
5 6 */
6 7  
7   -#ifndef _MEM_MAP_H_
8   -#define _MEM_MAP_H_
  8 +#ifndef __BFIN_MEM_MAP_H__
  9 +#define __BFIN_MEM_MAP_H__
9 10  
10 11 #include <mach/mem_map.h>
11 12  
12   -#ifndef __ASSEMBLY__
  13 +/* Every Blackfin so far has MMRs like this */
  14 +#ifndef COREMMR_BASE
  15 +# define COREMMR_BASE 0xFFE00000
  16 +#endif
  17 +#ifndef SYSMMR_BASE
  18 +# define SYSMMR_BASE 0xFFC00000
  19 +#endif
13 20  
14   -#ifdef CONFIG_SMP
15   -static inline ulong get_l1_scratch_start_cpu(int cpu)
16   -{
17   - return (cpu) ? COREB_L1_SCRATCH_START : COREA_L1_SCRATCH_START;
18   -}
19   -static inline ulong get_l1_code_start_cpu(int cpu)
20   -{
21   - return (cpu) ? COREB_L1_CODE_START : COREA_L1_CODE_START;
22   -}
23   -static inline ulong get_l1_data_a_start_cpu(int cpu)
24   -{
25   - return (cpu) ? COREB_L1_DATA_A_START : COREA_L1_DATA_A_START;
26   -}
27   -static inline ulong get_l1_data_b_start_cpu(int cpu)
28   -{
29   - return (cpu) ? COREB_L1_DATA_B_START : COREA_L1_DATA_B_START;
30   -}
  21 +/* Every Blackfin so far has on-chip Scratch Pad SRAM like this */
  22 +#ifndef L1_SCRATCH_START
  23 +# define L1_SCRATCH_START 0xFFB00000
  24 +# define L1_SCRATCH_LENGTH 0x1000
  25 +#endif
31 26  
32   -static inline ulong get_l1_scratch_start(void)
33   -{
34   - return get_l1_scratch_start_cpu(blackfin_core_id());
35   -}
36   -static inline ulong get_l1_code_start(void)
37   -{
38   - return get_l1_code_start_cpu(blackfin_core_id());
39   -}
40   -static inline ulong get_l1_data_a_start(void)
41   -{
42   - return get_l1_data_a_start_cpu(blackfin_core_id());
43   -}
44   -static inline ulong get_l1_data_b_start(void)
45   -{
46   - return get_l1_data_b_start_cpu(blackfin_core_id());
47   -}
  27 +/* Most parts lack on-chip L2 SRAM */
  28 +#ifndef L2_START
  29 +# define L2_START 0
  30 +# define L2_LENGTH 0
  31 +#endif
48 32  
49   -#else /* !CONFIG_SMP */
  33 +/* Most parts lack on-chip L1 ROM */
  34 +#ifndef L1_ROM_START
  35 +# define L1_ROM_START 0
  36 +# define L1_ROM_LENGTH 0
  37 +#endif
50 38  
51   -static inline ulong get_l1_scratch_start_cpu(int cpu)
  39 +/* Allow wonky SMP ports to override this */
  40 +#ifndef GET_PDA_SAFE
  41 +# define GET_PDA_SAFE(preg) \
  42 + preg.l = _cpu_pda; \
  43 + preg.h = _cpu_pda;
  44 +# define GET_PDA(preg, dreg) GET_PDA_SAFE(preg)
  45 +
  46 +# ifndef __ASSEMBLY__
  47 +
  48 +static inline unsigned long get_l1_scratch_start_cpu(int cpu)
52 49 {
53 50 return L1_SCRATCH_START;
54 51 }
55   -static inline ulong get_l1_code_start_cpu(int cpu)
  52 +static inline unsigned long get_l1_code_start_cpu(int cpu)
56 53 {
57 54 return L1_CODE_START;
58 55 }
59   -static inline ulong get_l1_data_a_start_cpu(int cpu)
  56 +static inline unsigned long get_l1_data_a_start_cpu(int cpu)
60 57 {
61 58 return L1_DATA_A_START;
62 59 }
63   -static inline ulong get_l1_data_b_start_cpu(int cpu)
  60 +static inline unsigned long get_l1_data_b_start_cpu(int cpu)
64 61 {
65 62 return L1_DATA_B_START;
66 63 }
67   -static inline ulong get_l1_scratch_start(void)
  64 +static inline unsigned long get_l1_scratch_start(void)
68 65 {
69 66 return get_l1_scratch_start_cpu(0);
70 67 }
71   -static inline ulong get_l1_code_start(void)
  68 +static inline unsigned long get_l1_code_start(void)
72 69 {
73 70 return get_l1_code_start_cpu(0);
74 71 }
75   -static inline ulong get_l1_data_a_start(void)
  72 +static inline unsigned long get_l1_data_a_start(void)
76 73 {
77 74 return get_l1_data_a_start_cpu(0);
78 75 }
79   -static inline ulong get_l1_data_b_start(void)
  76 +static inline unsigned long get_l1_data_b_start(void)
80 77 {
81 78 return get_l1_data_b_start_cpu(0);
82 79 }
83 80  
84   -#endif /* CONFIG_SMP */
85   -#endif /* __ASSEMBLY__ */
  81 +# endif /* __ASSEMBLY__ */
  82 +#endif /* !GET_PDA_SAFE */
86 83  
87   -#endif /* _MEM_MAP_H_ */
  84 +#endif
arch/blackfin/mach-bf518/include/mach/blackfin.h
... ... @@ -33,7 +33,6 @@
33 33 #define _MACH_BLACKFIN_H_
34 34  
35 35 #include "bf518.h"
36   -#include "mem_map.h"
37 36 #include "defBF512.h"
38 37 #include "anomaly.h"
39 38  
arch/blackfin/mach-bf518/include/mach/mem_map.h
1 1 /*
2   - * file: include/asm-blackfin/mach-bf518/mem_map.h
3   - * based on: include/asm-blackfin/mach-bf527/mem_map.h
4   - * author: Bryan Wu <cooloney@kernel.org>
  2 + * BF51x memory map
5 3 *
6   - * created:
7   - * description:
8   - * Memory MAP Common header file for blackfin BF518/6/4/2 of processors.
9   - * rev:
10   - *
11   - * modified:
12   - *
13   - * bugs: enter bugs at http://blackfin.uclinux.org/
14   - *
15   - * this program is free software; you can redistribute it and/or modify
16   - * it under the terms of the gnu general public license as published by
17   - * the free software foundation; either version 2, or (at your option)
18   - * any later version.
19   - *
20   - * this program is distributed in the hope that it will be useful,
21   - * but without any warranty; without even the implied warranty of
22   - * merchantability or fitness for a particular purpose. see the
23   - * gnu general public license for more details.
24   - *
25   - * you should have received a copy of the gnu general public license
26   - * along with this program; see the file copying.
27   - * if not, write to the free software foundation,
28   - * 59 temple place - suite 330, boston, ma 02111-1307, usa.
  4 + * Copyright 2004-2009 Analog Devices Inc.
  5 + * Licensed under the GPL-2 or later.
29 6 */
30 7  
31   -#ifndef _MEM_MAP_518_H_
32   -#define _MEM_MAP_518_H_
  8 +#ifndef __BFIN_MACH_MEM_MAP_H__
  9 +#define __BFIN_MACH_MEM_MAP_H__
33 10  
34   -#define COREMMR_BASE 0xFFE00000 /* Core MMRs */
35   -#define SYSMMR_BASE 0xFFC00000 /* System MMRs */
  11 +#ifndef __BFIN_MEM_MAP_H__
  12 +# error "do not include mach/mem_map.h directly -- use asm/mem_map.h"
  13 +#endif
36 14  
37 15 /* Async Memory Banks */
38 16 #define ASYNC_BANK3_BASE 0x20300000 /* Async Bank 3 */
... ... @@ -89,21 +67,5 @@
89 67 #define BFIN_DSUPBANKS 0
90 68 #endif /*CONFIG_BFIN_DCACHE */
91 69  
92   -/* Level 2 Memory - none */
93   -
94   -#define L2_START 0
95   -#define L2_LENGTH 0
96   -
97   -/* Scratch Pad Memory */
98   -
99   -#define L1_SCRATCH_START 0xFFB00000
100   -#define L1_SCRATCH_LENGTH 0x1000
101   -
102   -#define GET_PDA_SAFE(preg) \
103   - preg.l = _cpu_pda; \
104   - preg.h = _cpu_pda;
105   -
106   -#define GET_PDA(preg, dreg) GET_PDA_SAFE(preg)
107   -
108   -#endif /* _MEM_MAP_518_H_ */
  70 +#endif
arch/blackfin/mach-bf527/include/mach/blackfin.h
... ... @@ -33,7 +33,6 @@
33 33 #define _MACH_BLACKFIN_H_
34 34  
35 35 #include "bf527.h"
36   -#include "mem_map.h"
37 36 #include "defBF522.h"
38 37 #include "anomaly.h"
39 38  
arch/blackfin/mach-bf527/include/mach/mem_map.h
1 1 /*
2   - * file: include/asm-blackfin/mach-bf527/mem_map.h
3   - * based on: include/asm-blackfin/mach-bf537/mem_map.h
4   - * author: Michael Hennerich (michael.hennerich@analog.com)
  2 + * BF52x memory map
5 3 *
6   - * created:
7   - * description:
8   - * Memory MAP Common header file for blackfin BF527/5/2 of processors.
9   - * rev:
10   - *
11   - * modified:
12   - *
13   - * bugs: enter bugs at http://blackfin.uclinux.org/
14   - *
15   - * this program is free software; you can redistribute it and/or modify
16   - * it under the terms of the gnu general public license as published by
17   - * the free software foundation; either version 2, or (at your option)
18   - * any later version.
19   - *
20   - * this program is distributed in the hope that it will be useful,
21   - * but without any warranty; without even the implied warranty of
22   - * merchantability or fitness for a particular purpose. see the
23   - * gnu general public license for more details.
24   - *
25   - * you should have received a copy of the gnu general public license
26   - * along with this program; see the file copying.
27   - * if not, write to the free software foundation,
28   - * 59 temple place - suite 330, boston, ma 02111-1307, usa.
  4 + * Copyright 2004-2009 Analog Devices Inc.
  5 + * Licensed under the GPL-2 or later.
29 6 */
30 7  
31   -#ifndef _MEM_MAP_527_H_
32   -#define _MEM_MAP_527_H_
  8 +#ifndef __BFIN_MACH_MEM_MAP_H__
  9 +#define __BFIN_MACH_MEM_MAP_H__
33 10  
34   -#define COREMMR_BASE 0xFFE00000 /* Core MMRs */
35   -#define SYSMMR_BASE 0xFFC00000 /* System MMRs */
  11 +#ifndef __BFIN_MEM_MAP_H__
  12 +# error "do not include mach/mem_map.h directly -- use asm/mem_map.h"
  13 +#endif
36 14  
37 15 /* Async Memory Banks */
38 16 #define ASYNC_BANK3_BASE 0x20300000 /* Async Bank 3 */
... ... @@ -89,21 +67,5 @@
89 67 #define BFIN_DSUPBANKS 0
90 68 #endif /*CONFIG_BFIN_DCACHE */
91 69  
92   -/* Level 2 Memory - none */
93   -
94   -#define L2_START 0
95   -#define L2_LENGTH 0
96   -
97   -/* Scratch Pad Memory */
98   -
99   -#define L1_SCRATCH_START 0xFFB00000
100   -#define L1_SCRATCH_LENGTH 0x1000
101   -
102   -#define GET_PDA_SAFE(preg) \
103   - preg.l = _cpu_pda; \
104   - preg.h = _cpu_pda;
105   -
106   -#define GET_PDA(preg, dreg) GET_PDA_SAFE(preg)
107   -
108   -#endif /* _MEM_MAP_527_H_ */
  70 +#endif
arch/blackfin/mach-bf533/include/mach/blackfin.h
... ... @@ -34,7 +34,6 @@
34 34 #define BF533_FAMILY
35 35  
36 36 #include "bf533.h"
37   -#include "mem_map.h"
38 37 #include "defBF532.h"
39 38 #include "anomaly.h"
40 39  
arch/blackfin/mach-bf533/include/mach/mem_map.h
1 1 /*
2   - * File: include/asm-blackfin/mach-bf533/mem_map.h
3   - * Based on:
4   - * Author:
  2 + * BF533 memory map
5 3 *
6   - * Created:
7   - * Description:
8   - *
9   - * Rev:
10   - *
11   - * Modified:
12   - *
13   - * Bugs: Enter bugs at http://blackfin.uclinux.org/
14   - *
15   - * This program is free software; you can redistribute it and/or modify
16   - * it under the terms of the GNU General Public License as published by
17   - * the Free Software Foundation; either version 2, or (at your option)
18   - * any later version.
19   - *
20   - * This program is distributed in the hope that it will be useful,
21   - * but WITHOUT ANY WARRANTY; without even the implied warranty of
22   - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23   - * GNU General Public License for more details.
24   - *
25   - * You should have received a copy of the GNU General Public License
26   - * along with this program; see the file COPYING.
27   - * If not, write to the Free Software Foundation,
28   - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  4 + * Copyright 2004-2009 Analog Devices Inc.
  5 + * Licensed under the GPL-2 or later.
29 6 */
30 7  
31   -#ifndef _MEM_MAP_533_H_
32   -#define _MEM_MAP_533_H_
  8 +#ifndef __BFIN_MACH_MEM_MAP_H__
  9 +#define __BFIN_MACH_MEM_MAP_H__
33 10  
34   -#define COREMMR_BASE 0xFFE00000 /* Core MMRs */
35   -#define SYSMMR_BASE 0xFFC00000 /* System MMRs */
  11 +#ifndef __BFIN_MEM_MAP_H__
  12 +# error "do not include mach/mem_map.h directly -- use asm/mem_map.h"
  13 +#endif
36 14  
37 15 /* Async Memory Banks */
38 16 #define ASYNC_BANK3_BASE 0x20300000 /* Async Bank 3 */
... ... @@ -158,21 +136,5 @@
158 136  
159 137 #endif
160 138  
161   -/* Level 2 Memory - none */
162   -
163   -#define L2_START 0
164   -#define L2_LENGTH 0
165   -
166   -/* Scratch Pad Memory */
167   -
168   -#define L1_SCRATCH_START 0xFFB00000
169   -#define L1_SCRATCH_LENGTH 0x1000
170   -
171   -#define GET_PDA_SAFE(preg) \
172   - preg.l = _cpu_pda; \
173   - preg.h = _cpu_pda;
174   -
175   -#define GET_PDA(preg, dreg) GET_PDA_SAFE(preg)
176   -
177   -#endif /* _MEM_MAP_533_H_ */
  139 +#endif
arch/blackfin/mach-bf537/include/mach/blackfin.h
... ... @@ -35,7 +35,6 @@
35 35 #define BF537_FAMILY
36 36  
37 37 #include "bf537.h"
38   -#include "mem_map.h"
39 38 #include "defBF534.h"
40 39 #include "anomaly.h"
41 40  
arch/blackfin/mach-bf537/include/mach/mem_map.h
1 1 /*
2   - * file: include/asm-blackfin/mach-bf537/mem_map.h
3   - * based on:
4   - * author:
  2 + * BF537 memory map
5 3 *
6   - * created:
7   - * description:
8   - * Memory MAP Common header file for blackfin BF537/6/4 of processors.
9   - * rev:
10   - *
11   - * modified:
12   - *
13   - * bugs: enter bugs at http://blackfin.uclinux.org/
14   - *
15   - * this program is free software; you can redistribute it and/or modify
16   - * it under the terms of the gnu general public license as published by
17   - * the free software foundation; either version 2, or (at your option)
18   - * any later version.
19   - *
20   - * this program is distributed in the hope that it will be useful,
21   - * but without any warranty; without even the implied warranty of
22   - * merchantability or fitness for a particular purpose. see the
23   - * gnu general public license for more details.
24   - *
25   - * you should have received a copy of the gnu general public license
26   - * along with this program; see the file copying.
27   - * if not, write to the free software foundation,
28   - * 59 temple place - suite 330, boston, ma 02111-1307, usa.
  4 + * Copyright 2004-2009 Analog Devices Inc.
  5 + * Licensed under the GPL-2 or later.
29 6 */
30 7  
31   -#ifndef _MEM_MAP_537_H_
32   -#define _MEM_MAP_537_H_
  8 +#ifndef __BFIN_MACH_MEM_MAP_H__
  9 +#define __BFIN_MACH_MEM_MAP_H__
33 10  
34   -#define COREMMR_BASE 0xFFE00000 /* Core MMRs */
35   -#define SYSMMR_BASE 0xFFC00000 /* System MMRs */
  11 +#ifndef __BFIN_MEM_MAP_H__
  12 +# error "do not include mach/mem_map.h directly -- use asm/mem_map.h"
  13 +#endif
36 14  
37 15 /* Async Memory Banks */
38 16 #define ASYNC_BANK3_BASE 0x20300000 /* Async Bank 3 */
... ... @@ -166,21 +144,5 @@
166 144  
167 145 #endif
168 146  
169   -/* Level 2 Memory - none */
170   -
171   -#define L2_START 0
172   -#define L2_LENGTH 0
173   -
174   -/* Scratch Pad Memory */
175   -
176   -#define L1_SCRATCH_START 0xFFB00000
177   -#define L1_SCRATCH_LENGTH 0x1000
178   -
179   -#define GET_PDA_SAFE(preg) \
180   - preg.l = _cpu_pda; \
181   - preg.h = _cpu_pda;
182   -
183   -#define GET_PDA(preg, dreg) GET_PDA_SAFE(preg)
184   -
185   -#endif /* _MEM_MAP_537_H_ */
  147 +#endif
arch/blackfin/mach-bf538/include/mach/blackfin.h
... ... @@ -35,7 +35,6 @@
35 35 #define BF538_FAMILY
36 36  
37 37 #include "bf538.h"
38   -#include "mem_map.h"
39 38 #include "defBF539.h"
40 39 #include "anomaly.h"
41 40  
arch/blackfin/mach-bf538/include/mach/mem_map.h
1 1 /*
2   - * File: include/asm-blackfin/mach-bf538/mem_map.h
3   - * Based on:
4   - * Author:
  2 + * BF538 memory map
5 3 *
6   - * Created:
7   - * Description:
8   - *
9   - * Rev:
10   - *
11   - * Modified:
12   - *
13   - * Bugs: Enter bugs at http://blackfin.uclinux.org/
14   - *
15   - * This program is free software; you can redistribute it and/or modify
16   - * it under the terms of the GNU General Public License as published by
17   - * the Free Software Foundation; either version 2, or (at your option)
18   - * any later version.
19   - *
20   - * This program is distributed in the hope that it will be useful,
21   - * but WITHOUT ANY WARRANTY; without even the implied warranty of
22   - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23   - * GNU General Public License for more details.
24   - *
25   - * You should have received a copy of the GNU General Public License
26   - * along with this program; see the file COPYING.
27   - * If not, write to the Free Software Foundation,
28   - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  4 + * Copyright 2004-2009 Analog Devices Inc.
  5 + * Licensed under the GPL-2 or later.
29 6 */
30 7  
31   -#ifndef _MEM_MAP_538_H_
32   -#define _MEM_MAP_538_H_
  8 +#ifndef __BFIN_MACH_MEM_MAP_H__
  9 +#define __BFIN_MACH_MEM_MAP_H__
33 10  
34   -#define COREMMR_BASE 0xFFE00000 /* Core MMRs */
35   -#define SYSMMR_BASE 0xFFC00000 /* System MMRs */
  11 +#ifndef __BFIN_MEM_MAP_H__
  12 +# error "do not include mach/mem_map.h directly -- use asm/mem_map.h"
  13 +#endif
36 14  
37 15 /* Async Memory Banks */
38 16 #define ASYNC_BANK3_BASE 0x20300000 /* Async Bank 3 */
... ... @@ -93,22 +71,5 @@
93 71 #define BFIN_DSUPBANKS 0
94 72 #endif /*CONFIG_BFIN_DCACHE*/
95 73  
96   -
97   -/* Level 2 Memory - none */
98   -
99   -#define L2_START 0
100   -#define L2_LENGTH 0
101   -
102   -/* Scratch Pad Memory */
103   -
104   -#define L1_SCRATCH_START 0xFFB00000
105   -#define L1_SCRATCH_LENGTH 0x1000
106   -
107   -#define GET_PDA_SAFE(preg) \
108   - preg.l = _cpu_pda; \
109   - preg.h = _cpu_pda;
110   -
111   -#define GET_PDA(preg, dreg) GET_PDA_SAFE(preg)
112   -
113   -#endif /* _MEM_MAP_538_H_ */
  74 +#endif
arch/blackfin/mach-bf548/include/mach/blackfin.h
... ... @@ -33,7 +33,6 @@
33 33 #define _MACH_BLACKFIN_H_
34 34  
35 35 #include "bf548.h"
36   -#include "mem_map.h"
37 36 #include "anomaly.h"
38 37  
39 38 #ifdef CONFIG_BF542
arch/blackfin/mach-bf548/include/mach/mem_map.h
1 1 /*
2   - * file: include/asm-blackfin/mach-bf548/mem_map.h
3   - * based on:
4   - * author:
  2 + * BF548 memory map
5 3 *
6   - * created:
7   - * description:
8   - * Memory MAP Common header file for blackfin BF537/6/4 of processors.
9   - * rev:
10   - *
11   - * modified:
12   - *
13   - * bugs: enter bugs at http://blackfin.uclinux.org/
14   - *
15   - * this program is free software; you can redistribute it and/or modify
16   - * it under the terms of the gnu general public license as published by
17   - * the free software foundation; either version 2, or (at your option)
18   - * any later version.
19   - *
20   - * this program is distributed in the hope that it will be useful,
21   - * but without any warranty; without even the implied warranty of
22   - * merchantability or fitness for a particular purpose. see the
23   - * gnu general public license for more details.
24   - *
25   - * you should have received a copy of the gnu general public license
26   - * along with this program; see the file copying.
27   - * if not, write to the free software foundation,
28   - * 59 temple place - suite 330, boston, ma 02111-1307, usa.
  4 + * Copyright 2004-2009 Analog Devices Inc.
  5 + * Licensed under the GPL-2 or later.
29 6 */
30 7  
31   -#ifndef _MEM_MAP_548_H_
32   -#define _MEM_MAP_548_H_
  8 +#ifndef __BFIN_MACH_MEM_MAP_H__
  9 +#define __BFIN_MACH_MEM_MAP_H__
33 10  
34   -#define COREMMR_BASE 0xFFE00000 /* Core MMRs */
35   -#define SYSMMR_BASE 0xFFC00000 /* System MMRs */
  11 +#ifndef __BFIN_MEM_MAP_H__
  12 +# error "do not include mach/mem_map.h directly -- use asm/mem_map.h"
  13 +#endif
36 14  
37 15 /* Async Memory Banks */
38 16 #define ASYNC_BANK3_BASE 0x2C000000 /* Async Bank 3 */
... ... @@ -103,16 +81,5 @@
103 81 # define L2_LENGTH 0x20000
104 82 #endif
105 83  
106   -/* Scratch Pad Memory */
107   -
108   -#define L1_SCRATCH_START 0xFFB00000
109   -#define L1_SCRATCH_LENGTH 0x1000
110   -
111   -#define GET_PDA_SAFE(preg) \
112   - preg.l = _cpu_pda; \
113   - preg.h = _cpu_pda;
114   -
115   -#define GET_PDA(preg, dreg) GET_PDA_SAFE(preg)
116   -
117   -#endif/* _MEM_MAP_548_H_ */
  84 +#endif
arch/blackfin/mach-bf561/include/mach/blackfin.h
... ... @@ -34,7 +34,6 @@
34 34 #define BF561_FAMILY
35 35  
36 36 #include "bf561.h"
37   -#include "mem_map.h"
38 37 #include "defBF561.h"
39 38 #include "anomaly.h"
40 39  
arch/blackfin/mach-bf561/include/mach/mem_map.h
1 1 /*
2   - * Memory MAP
3   - * Common header file for blackfin BF561 of processors.
  2 + * BF561 memory map
  3 + *
  4 + * Copyright 2004-2009 Analog Devices Inc.
  5 + * Licensed under the GPL-2 or later.
4 6 */
5 7  
6   -#ifndef _MEM_MAP_561_H_
7   -#define _MEM_MAP_561_H_
  8 +#ifndef __BFIN_MACH_MEM_MAP_H__
  9 +#define __BFIN_MACH_MEM_MAP_H__
8 10  
9   -#define COREMMR_BASE 0xFFE00000 /* Core MMRs */
10   -#define SYSMMR_BASE 0xFFC00000 /* System MMRs */
  11 +#ifndef __BFIN_MEM_MAP_H__
  12 +# error "do not include mach/mem_map.h directly -- use asm/mem_map.h"
  13 +#endif
11 14  
12 15 /* Async Memory Banks */
13 16 #define ASYNC_BANK3_BASE 0x2C000000 /* Async Bank 3 */
... ... @@ -82,9 +85,6 @@
82 85 #define COREA_L1_SCRATCH_START 0xFFB00000
83 86 #define COREB_L1_SCRATCH_START 0xFF700000
84 87  
85   -#define L1_SCRATCH_START COREA_L1_SCRATCH_START
86   -#define L1_SCRATCH_LENGTH 0x1000
87   -
88 88 #ifdef __ASSEMBLY__
89 89  
90 90 /*
91 91  
92 92  
... ... @@ -155,15 +155,43 @@
155 155 dreg = ROT dreg BY -1; \
156 156 dreg = CC;
157 157  
158   -#else
159   -#define GET_PDA_SAFE(preg) \
160   - preg.l = _cpu_pda; \
161   - preg.h = _cpu_pda;
  158 +static inline unsigned long get_l1_scratch_start_cpu(int cpu)
  159 +{
  160 + return cpu ? COREB_L1_SCRATCH_START : COREA_L1_SCRATCH_START;
  161 +}
  162 +static inline unsigned long get_l1_code_start_cpu(int cpu)
  163 +{
  164 + return cpu ? COREB_L1_CODE_START : COREA_L1_CODE_START;
  165 +}
  166 +static inline unsigned long get_l1_data_a_start_cpu(int cpu)
  167 +{
  168 + return cpu ? COREB_L1_DATA_A_START : COREA_L1_DATA_A_START;
  169 +}
  170 +static inline unsigned long get_l1_data_b_start_cpu(int cpu)
  171 +{
  172 + return cpu ? COREB_L1_DATA_B_START : COREA_L1_DATA_B_START;
  173 +}
162 174  
163   -#define GET_PDA(preg, dreg) GET_PDA_SAFE(preg)
  175 +static inline unsigned long get_l1_scratch_start(void)
  176 +{
  177 + return get_l1_scratch_start_cpu(blackfin_core_id());
  178 +}
  179 +static inline unsigned long get_l1_code_start(void)
  180 +{
  181 + return get_l1_code_start_cpu(blackfin_core_id());
  182 +}
  183 +static inline unsigned long get_l1_data_a_start(void)
  184 +{
  185 + return get_l1_data_a_start_cpu(blackfin_core_id());
  186 +}
  187 +static inline unsigned long get_l1_data_b_start(void)
  188 +{
  189 + return get_l1_data_b_start_cpu(blackfin_core_id());
  190 +}
  191 +
164 192 #endif /* CONFIG_SMP */
165 193  
166 194 #endif /* __ASSEMBLY__ */
167 195  
168   -#endif /* _MEM_MAP_533_H_ */
  196 +#endif