aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-06-17 11:25:06 -0400
committerMike Frysinger <vapier@gentoo.org>2009-06-22 21:16:07 -0400
commitfa48f84a8cc722ca48b32fa0c338b6c3b358717d (patch)
treeaa2d2d5f1ec674b2d4c70b506ef9cd0249715e14
parent985895bd8d1e41079b41da32cdc57876a4a74126 (diff)
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>
-rw-r--r--arch/blackfin/include/asm/blackfin.h1
-rw-r--r--arch/blackfin/include/asm/mem_map.h97
-rw-r--r--arch/blackfin/mach-bf518/include/mach/blackfin.h1
-rw-r--r--arch/blackfin/mach-bf518/include/mach/mem_map.h56
-rw-r--r--arch/blackfin/mach-bf527/include/mach/blackfin.h1
-rw-r--r--arch/blackfin/mach-bf527/include/mach/mem_map.h56
-rw-r--r--arch/blackfin/mach-bf533/include/mach/blackfin.h1
-rw-r--r--arch/blackfin/mach-bf533/include/mach/mem_map.h56
-rw-r--r--arch/blackfin/mach-bf537/include/mach/blackfin.h1
-rw-r--r--arch/blackfin/mach-bf537/include/mach/mem_map.h56
-rw-r--r--arch/blackfin/mach-bf538/include/mach/blackfin.h1
-rw-r--r--arch/blackfin/mach-bf538/include/mach/mem_map.h57
-rw-r--r--arch/blackfin/mach-bf548/include/mach/blackfin.h1
-rw-r--r--arch/blackfin/mach-bf548/include/mach/mem_map.h51
-rw-r--r--arch/blackfin/mach-bf561/include/mach/blackfin.h1
-rw-r--r--arch/blackfin/mach-bf561/include/mach/mem_map.h58
16 files changed, 145 insertions, 350 deletions
diff --git a/arch/blackfin/include/asm/blackfin.h b/arch/blackfin/include/asm/blackfin.h
index 8bb2cb139756..4d4439583396 100644
--- a/arch/blackfin/include/asm/blackfin.h
+++ b/arch/blackfin/include/asm/blackfin.h
@@ -86,6 +86,7 @@ static inline void CSYNC(void)
86 86
87#endif /* __ASSEMBLY__ */ 87#endif /* __ASSEMBLY__ */
88 88
89#include <asm/mem_map.h>
89#include <mach/blackfin.h> 90#include <mach/blackfin.h>
90#include <asm/bfin-global.h> 91#include <asm/bfin-global.h>
91 92
diff --git a/arch/blackfin/include/asm/mem_map.h b/arch/blackfin/include/asm/mem_map.h
index e92b31051bb7..5e21627c9ba2 100644
--- a/arch/blackfin/include/asm/mem_map.h
+++ b/arch/blackfin/include/asm/mem_map.h
@@ -1,87 +1,84 @@
1/* 1/*
2 * mem_map.h 2 * Common Blackfin memory map
3 * Common header file for blackfin family of processors.
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#ifndef __BFIN_MEM_MAP_H__
8#define _MEM_MAP_H_ 9#define __BFIN_MEM_MAP_H__
9 10
10#include <mach/mem_map.h> 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 21/* Every Blackfin so far has on-chip Scratch Pad SRAM like this */
15static inline ulong get_l1_scratch_start_cpu(int cpu) 22#ifndef L1_SCRATCH_START
16{ 23# define L1_SCRATCH_START 0xFFB00000
17 return (cpu) ? COREB_L1_SCRATCH_START : COREA_L1_SCRATCH_START; 24# define L1_SCRATCH_LENGTH 0x1000
18} 25#endif
19static inline ulong get_l1_code_start_cpu(int cpu)
20{
21 return (cpu) ? COREB_L1_CODE_START : COREA_L1_CODE_START;
22}
23static 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}
27static 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}
31 26
32static inline ulong get_l1_scratch_start(void) 27/* Most parts lack on-chip L2 SRAM */
33{ 28#ifndef L2_START
34 return get_l1_scratch_start_cpu(blackfin_core_id()); 29# define L2_START 0
35} 30# define L2_LENGTH 0
36static inline ulong get_l1_code_start(void) 31#endif
37{ 32
38 return get_l1_code_start_cpu(blackfin_core_id()); 33/* Most parts lack on-chip L1 ROM */
39} 34#ifndef L1_ROM_START
40static inline ulong get_l1_data_a_start(void) 35# define L1_ROM_START 0
41{ 36# define L1_ROM_LENGTH 0
42 return get_l1_data_a_start_cpu(blackfin_core_id()); 37#endif
43} 38
44static inline ulong get_l1_data_b_start(void) 39/* Allow wonky SMP ports to override this */
45{ 40#ifndef GET_PDA_SAFE
46 return get_l1_data_b_start_cpu(blackfin_core_id()); 41# define GET_PDA_SAFE(preg) \
47} 42 preg.l = _cpu_pda; \
43 preg.h = _cpu_pda;
44# define GET_PDA(preg, dreg) GET_PDA_SAFE(preg)
48 45
49#else /* !CONFIG_SMP */ 46# ifndef __ASSEMBLY__
50 47
51static inline ulong get_l1_scratch_start_cpu(int cpu) 48static inline unsigned long get_l1_scratch_start_cpu(int cpu)
52{ 49{
53 return L1_SCRATCH_START; 50 return L1_SCRATCH_START;
54} 51}
55static inline ulong get_l1_code_start_cpu(int cpu) 52static inline unsigned long get_l1_code_start_cpu(int cpu)
56{ 53{
57 return L1_CODE_START; 54 return L1_CODE_START;
58} 55}
59static inline ulong get_l1_data_a_start_cpu(int cpu) 56static inline unsigned long get_l1_data_a_start_cpu(int cpu)
60{ 57{
61 return L1_DATA_A_START; 58 return L1_DATA_A_START;
62} 59}
63static inline ulong get_l1_data_b_start_cpu(int cpu) 60static inline unsigned long get_l1_data_b_start_cpu(int cpu)
64{ 61{
65 return L1_DATA_B_START; 62 return L1_DATA_B_START;
66} 63}
67static inline ulong get_l1_scratch_start(void) 64static inline unsigned long get_l1_scratch_start(void)
68{ 65{
69 return get_l1_scratch_start_cpu(0); 66 return get_l1_scratch_start_cpu(0);
70} 67}
71static inline ulong get_l1_code_start(void) 68static inline unsigned long get_l1_code_start(void)
72{ 69{
73 return get_l1_code_start_cpu(0); 70 return get_l1_code_start_cpu(0);
74} 71}
75static inline ulong get_l1_data_a_start(void) 72static inline unsigned long get_l1_data_a_start(void)
76{ 73{
77 return get_l1_data_a_start_cpu(0); 74 return get_l1_data_a_start_cpu(0);
78} 75}
79static inline ulong get_l1_data_b_start(void) 76static inline unsigned long get_l1_data_b_start(void)
80{ 77{
81 return get_l1_data_b_start_cpu(0); 78 return get_l1_data_b_start_cpu(0);
82} 79}
83 80
84#endif /* CONFIG_SMP */ 81# endif /* __ASSEMBLY__ */
85#endif /* __ASSEMBLY__ */ 82#endif /* !GET_PDA_SAFE */
86 83
87#endif /* _MEM_MAP_H_ */ 84#endif
diff --git a/arch/blackfin/mach-bf518/include/mach/blackfin.h b/arch/blackfin/mach-bf518/include/mach/blackfin.h
index 267bb7c8bfb5..e8e14c2769ed 100644
--- a/arch/blackfin/mach-bf518/include/mach/blackfin.h
+++ b/arch/blackfin/mach-bf518/include/mach/blackfin.h
@@ -33,7 +33,6 @@
33#define _MACH_BLACKFIN_H_ 33#define _MACH_BLACKFIN_H_
34 34
35#include "bf518.h" 35#include "bf518.h"
36#include "mem_map.h"
37#include "defBF512.h" 36#include "defBF512.h"
38#include "anomaly.h" 37#include "anomaly.h"
39 38
diff --git a/arch/blackfin/mach-bf518/include/mach/mem_map.h b/arch/blackfin/mach-bf518/include/mach/mem_map.h
index 62bcc781bfaa..3c6777cb3532 100644
--- a/arch/blackfin/mach-bf518/include/mach/mem_map.h
+++ b/arch/blackfin/mach-bf518/include/mach/mem_map.h
@@ -1,38 +1,16 @@
1/* 1/*
2 * file: include/asm-blackfin/mach-bf518/mem_map.h 2 * BF51x memory map
3 * based on: include/asm-blackfin/mach-bf527/mem_map.h
4 * author: Bryan Wu <cooloney@kernel.org>
5 * 3 *
6 * created: 4 * Copyright 2004-2009 Analog Devices Inc.
7 * description: 5 * Licensed under the GPL-2 or later.
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.
29 */ 6 */
30 7
31#ifndef _MEM_MAP_518_H_ 8#ifndef __BFIN_MACH_MEM_MAP_H__
32#define _MEM_MAP_518_H_ 9#define __BFIN_MACH_MEM_MAP_H__
33 10
34#define COREMMR_BASE 0xFFE00000 /* Core MMRs */ 11#ifndef __BFIN_MEM_MAP_H__
35#define SYSMMR_BASE 0xFFC00000 /* System MMRs */ 12# error "do not include mach/mem_map.h directly -- use asm/mem_map.h"
13#endif
36 14
37/* Async Memory Banks */ 15/* Async Memory Banks */
38#define ASYNC_BANK3_BASE 0x20300000 /* Async Bank 3 */ 16#define ASYNC_BANK3_BASE 0x20300000 /* Async Bank 3 */
@@ -89,20 +67,4 @@
89#define BFIN_DSUPBANKS 0 67#define BFIN_DSUPBANKS 0
90#endif /*CONFIG_BFIN_DCACHE */ 68#endif /*CONFIG_BFIN_DCACHE */
91 69
92/* Level 2 Memory - none */ 70#endif
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_ */
diff --git a/arch/blackfin/mach-bf527/include/mach/blackfin.h b/arch/blackfin/mach-bf527/include/mach/blackfin.h
index 417abcd61f4d..03665a8e16be 100644
--- a/arch/blackfin/mach-bf527/include/mach/blackfin.h
+++ b/arch/blackfin/mach-bf527/include/mach/blackfin.h
@@ -33,7 +33,6 @@
33#define _MACH_BLACKFIN_H_ 33#define _MACH_BLACKFIN_H_
34 34
35#include "bf527.h" 35#include "bf527.h"
36#include "mem_map.h"
37#include "defBF522.h" 36#include "defBF522.h"
38#include "anomaly.h" 37#include "anomaly.h"
39 38
diff --git a/arch/blackfin/mach-bf527/include/mach/mem_map.h b/arch/blackfin/mach-bf527/include/mach/mem_map.h
index 019e0017ad81..d96e894afd2c 100644
--- a/arch/blackfin/mach-bf527/include/mach/mem_map.h
+++ b/arch/blackfin/mach-bf527/include/mach/mem_map.h
@@ -1,38 +1,16 @@
1/* 1/*
2 * file: include/asm-blackfin/mach-bf527/mem_map.h 2 * BF52x memory map
3 * based on: include/asm-blackfin/mach-bf537/mem_map.h
4 * author: Michael Hennerich (michael.hennerich@analog.com)
5 * 3 *
6 * created: 4 * Copyright 2004-2009 Analog Devices Inc.
7 * description: 5 * Licensed under the GPL-2 or later.
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.
29 */ 6 */
30 7
31#ifndef _MEM_MAP_527_H_ 8#ifndef __BFIN_MACH_MEM_MAP_H__
32#define _MEM_MAP_527_H_ 9#define __BFIN_MACH_MEM_MAP_H__
33 10
34#define COREMMR_BASE 0xFFE00000 /* Core MMRs */ 11#ifndef __BFIN_MEM_MAP_H__
35#define SYSMMR_BASE 0xFFC00000 /* System MMRs */ 12# error "do not include mach/mem_map.h directly -- use asm/mem_map.h"
13#endif
36 14
37/* Async Memory Banks */ 15/* Async Memory Banks */
38#define ASYNC_BANK3_BASE 0x20300000 /* Async Bank 3 */ 16#define ASYNC_BANK3_BASE 0x20300000 /* Async Bank 3 */
@@ -89,20 +67,4 @@
89#define BFIN_DSUPBANKS 0 67#define BFIN_DSUPBANKS 0
90#endif /*CONFIG_BFIN_DCACHE */ 68#endif /*CONFIG_BFIN_DCACHE */
91 69
92/* Level 2 Memory - none */ 70#endif
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_ */
diff --git a/arch/blackfin/mach-bf533/include/mach/blackfin.h b/arch/blackfin/mach-bf533/include/mach/blackfin.h
index 045184f81a29..39aa175f19f5 100644
--- a/arch/blackfin/mach-bf533/include/mach/blackfin.h
+++ b/arch/blackfin/mach-bf533/include/mach/blackfin.h
@@ -34,7 +34,6 @@
34#define BF533_FAMILY 34#define BF533_FAMILY
35 35
36#include "bf533.h" 36#include "bf533.h"
37#include "mem_map.h"
38#include "defBF532.h" 37#include "defBF532.h"
39#include "anomaly.h" 38#include "anomaly.h"
40 39
diff --git a/arch/blackfin/mach-bf533/include/mach/mem_map.h b/arch/blackfin/mach-bf533/include/mach/mem_map.h
index fc33b7cb9937..197af1a398ac 100644
--- a/arch/blackfin/mach-bf533/include/mach/mem_map.h
+++ b/arch/blackfin/mach-bf533/include/mach/mem_map.h
@@ -1,38 +1,16 @@
1/* 1/*
2 * File: include/asm-blackfin/mach-bf533/mem_map.h 2 * BF533 memory map
3 * Based on:
4 * Author:
5 * 3 *
6 * Created: 4 * Copyright 2004-2009 Analog Devices Inc.
7 * Description: 5 * Licensed under the GPL-2 or later.
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.
29 */ 6 */
30 7
31#ifndef _MEM_MAP_533_H_ 8#ifndef __BFIN_MACH_MEM_MAP_H__
32#define _MEM_MAP_533_H_ 9#define __BFIN_MACH_MEM_MAP_H__
33 10
34#define COREMMR_BASE 0xFFE00000 /* Core MMRs */ 11#ifndef __BFIN_MEM_MAP_H__
35#define SYSMMR_BASE 0xFFC00000 /* System MMRs */ 12# error "do not include mach/mem_map.h directly -- use asm/mem_map.h"
13#endif
36 14
37/* Async Memory Banks */ 15/* Async Memory Banks */
38#define ASYNC_BANK3_BASE 0x20300000 /* Async Bank 3 */ 16#define ASYNC_BANK3_BASE 0x20300000 /* Async Bank 3 */
@@ -158,20 +136,4 @@
158 136
159#endif 137#endif
160 138
161/* Level 2 Memory - none */ 139#endif
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_ */
diff --git a/arch/blackfin/mach-bf537/include/mach/blackfin.h b/arch/blackfin/mach-bf537/include/mach/blackfin.h
index 7d6069c886f1..f5e5015ad831 100644
--- a/arch/blackfin/mach-bf537/include/mach/blackfin.h
+++ b/arch/blackfin/mach-bf537/include/mach/blackfin.h
@@ -35,7 +35,6 @@
35#define BF537_FAMILY 35#define BF537_FAMILY
36 36
37#include "bf537.h" 37#include "bf537.h"
38#include "mem_map.h"
39#include "defBF534.h" 38#include "defBF534.h"
40#include "anomaly.h" 39#include "anomaly.h"
41 40
diff --git a/arch/blackfin/mach-bf537/include/mach/mem_map.h b/arch/blackfin/mach-bf537/include/mach/mem_map.h
index f9010c4b4bf3..942f08de306b 100644
--- a/arch/blackfin/mach-bf537/include/mach/mem_map.h
+++ b/arch/blackfin/mach-bf537/include/mach/mem_map.h
@@ -1,38 +1,16 @@
1/* 1/*
2 * file: include/asm-blackfin/mach-bf537/mem_map.h 2 * BF537 memory map
3 * based on:
4 * author:
5 * 3 *
6 * created: 4 * Copyright 2004-2009 Analog Devices Inc.
7 * description: 5 * Licensed under the GPL-2 or later.
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.
29 */ 6 */
30 7
31#ifndef _MEM_MAP_537_H_ 8#ifndef __BFIN_MACH_MEM_MAP_H__
32#define _MEM_MAP_537_H_ 9#define __BFIN_MACH_MEM_MAP_H__
33 10
34#define COREMMR_BASE 0xFFE00000 /* Core MMRs */ 11#ifndef __BFIN_MEM_MAP_H__
35#define SYSMMR_BASE 0xFFC00000 /* System MMRs */ 12# error "do not include mach/mem_map.h directly -- use asm/mem_map.h"
13#endif
36 14
37/* Async Memory Banks */ 15/* Async Memory Banks */
38#define ASYNC_BANK3_BASE 0x20300000 /* Async Bank 3 */ 16#define ASYNC_BANK3_BASE 0x20300000 /* Async Bank 3 */
@@ -166,20 +144,4 @@
166 144
167#endif 145#endif
168 146
169/* Level 2 Memory - none */ 147#endif
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_ */
diff --git a/arch/blackfin/mach-bf538/include/mach/blackfin.h b/arch/blackfin/mach-bf538/include/mach/blackfin.h
index 6f628353dde3..9496196ac164 100644
--- a/arch/blackfin/mach-bf538/include/mach/blackfin.h
+++ b/arch/blackfin/mach-bf538/include/mach/blackfin.h
@@ -35,7 +35,6 @@
35#define BF538_FAMILY 35#define BF538_FAMILY
36 36
37#include "bf538.h" 37#include "bf538.h"
38#include "mem_map.h"
39#include "defBF539.h" 38#include "defBF539.h"
40#include "anomaly.h" 39#include "anomaly.h"
41 40
diff --git a/arch/blackfin/mach-bf538/include/mach/mem_map.h b/arch/blackfin/mach-bf538/include/mach/mem_map.h
index 76811966690e..aff00f453e9e 100644
--- a/arch/blackfin/mach-bf538/include/mach/mem_map.h
+++ b/arch/blackfin/mach-bf538/include/mach/mem_map.h
@@ -1,38 +1,16 @@
1/* 1/*
2 * File: include/asm-blackfin/mach-bf538/mem_map.h 2 * BF538 memory map
3 * Based on:
4 * Author:
5 * 3 *
6 * Created: 4 * Copyright 2004-2009 Analog Devices Inc.
7 * Description: 5 * Licensed under the GPL-2 or later.
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.
29 */ 6 */
30 7
31#ifndef _MEM_MAP_538_H_ 8#ifndef __BFIN_MACH_MEM_MAP_H__
32#define _MEM_MAP_538_H_ 9#define __BFIN_MACH_MEM_MAP_H__
33 10
34#define COREMMR_BASE 0xFFE00000 /* Core MMRs */ 11#ifndef __BFIN_MEM_MAP_H__
35#define SYSMMR_BASE 0xFFC00000 /* System MMRs */ 12# error "do not include mach/mem_map.h directly -- use asm/mem_map.h"
13#endif
36 14
37/* Async Memory Banks */ 15/* Async Memory Banks */
38#define ASYNC_BANK3_BASE 0x20300000 /* Async Bank 3 */ 16#define ASYNC_BANK3_BASE 0x20300000 /* Async Bank 3 */
@@ -93,21 +71,4 @@
93#define BFIN_DSUPBANKS 0 71#define BFIN_DSUPBANKS 0
94#endif /*CONFIG_BFIN_DCACHE*/ 72#endif /*CONFIG_BFIN_DCACHE*/
95 73
96 74#endif
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_ */
diff --git a/arch/blackfin/mach-bf548/include/mach/blackfin.h b/arch/blackfin/mach-bf548/include/mach/blackfin.h
index cf6c1500222a..6b97396d817f 100644
--- a/arch/blackfin/mach-bf548/include/mach/blackfin.h
+++ b/arch/blackfin/mach-bf548/include/mach/blackfin.h
@@ -33,7 +33,6 @@
33#define _MACH_BLACKFIN_H_ 33#define _MACH_BLACKFIN_H_
34 34
35#include "bf548.h" 35#include "bf548.h"
36#include "mem_map.h"
37#include "anomaly.h" 36#include "anomaly.h"
38 37
39#ifdef CONFIG_BF542 38#ifdef CONFIG_BF542
diff --git a/arch/blackfin/mach-bf548/include/mach/mem_map.h b/arch/blackfin/mach-bf548/include/mach/mem_map.h
index 70b9c1194024..caac2dfb41eb 100644
--- a/arch/blackfin/mach-bf548/include/mach/mem_map.h
+++ b/arch/blackfin/mach-bf548/include/mach/mem_map.h
@@ -1,38 +1,16 @@
1/* 1/*
2 * file: include/asm-blackfin/mach-bf548/mem_map.h 2 * BF548 memory map
3 * based on:
4 * author:
5 * 3 *
6 * created: 4 * Copyright 2004-2009 Analog Devices Inc.
7 * description: 5 * Licensed under the GPL-2 or later.
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.
29 */ 6 */
30 7
31#ifndef _MEM_MAP_548_H_ 8#ifndef __BFIN_MACH_MEM_MAP_H__
32#define _MEM_MAP_548_H_ 9#define __BFIN_MACH_MEM_MAP_H__
33 10
34#define COREMMR_BASE 0xFFE00000 /* Core MMRs */ 11#ifndef __BFIN_MEM_MAP_H__
35#define SYSMMR_BASE 0xFFC00000 /* System MMRs */ 12# error "do not include mach/mem_map.h directly -- use asm/mem_map.h"
13#endif
36 14
37/* Async Memory Banks */ 15/* Async Memory Banks */
38#define ASYNC_BANK3_BASE 0x2C000000 /* Async Bank 3 */ 16#define ASYNC_BANK3_BASE 0x2C000000 /* Async Bank 3 */
@@ -103,15 +81,4 @@
103# define L2_LENGTH 0x20000 81# define L2_LENGTH 0x20000
104#endif 82#endif
105 83
106/* Scratch Pad Memory */ 84#endif
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_ */
diff --git a/arch/blackfin/mach-bf561/include/mach/blackfin.h b/arch/blackfin/mach-bf561/include/mach/blackfin.h
index f79f6626b7ec..8be31358ef88 100644
--- a/arch/blackfin/mach-bf561/include/mach/blackfin.h
+++ b/arch/blackfin/mach-bf561/include/mach/blackfin.h
@@ -34,7 +34,6 @@
34#define BF561_FAMILY 34#define BF561_FAMILY
35 35
36#include "bf561.h" 36#include "bf561.h"
37#include "mem_map.h"
38#include "defBF561.h" 37#include "defBF561.h"
39#include "anomaly.h" 38#include "anomaly.h"
40 39
diff --git a/arch/blackfin/mach-bf561/include/mach/mem_map.h b/arch/blackfin/mach-bf561/include/mach/mem_map.h
index 419dffdc96eb..a63e15c86d90 100644
--- a/arch/blackfin/mach-bf561/include/mach/mem_map.h
+++ b/arch/blackfin/mach-bf561/include/mach/mem_map.h
@@ -1,13 +1,16 @@
1/* 1/*
2 * Memory MAP 2 * BF561 memory map
3 * Common header file for blackfin BF561 of processors. 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_ 8#ifndef __BFIN_MACH_MEM_MAP_H__
7#define _MEM_MAP_561_H_ 9#define __BFIN_MACH_MEM_MAP_H__
8 10
9#define COREMMR_BASE 0xFFE00000 /* Core MMRs */ 11#ifndef __BFIN_MEM_MAP_H__
10#define SYSMMR_BASE 0xFFC00000 /* System MMRs */ 12# error "do not include mach/mem_map.h directly -- use asm/mem_map.h"
13#endif
11 14
12/* Async Memory Banks */ 15/* Async Memory Banks */
13#define ASYNC_BANK3_BASE 0x2C000000 /* Async Bank 3 */ 16#define ASYNC_BANK3_BASE 0x2C000000 /* Async Bank 3 */
@@ -82,9 +85,6 @@
82#define COREA_L1_SCRATCH_START 0xFFB00000 85#define COREA_L1_SCRATCH_START 0xFFB00000
83#define COREB_L1_SCRATCH_START 0xFF700000 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#ifdef __ASSEMBLY__ 88#ifdef __ASSEMBLY__
89 89
90/* 90/*
@@ -155,14 +155,42 @@
155 dreg = ROT dreg BY -1; \ 155 dreg = ROT dreg BY -1; \
156 dreg = CC; 156 dreg = CC;
157 157
158#else 158static inline unsigned long get_l1_scratch_start_cpu(int cpu)
159#define GET_PDA_SAFE(preg) \ 159{
160 preg.l = _cpu_pda; \ 160 return cpu ? COREB_L1_SCRATCH_START : COREA_L1_SCRATCH_START;
161 preg.h = _cpu_pda; 161}
162static inline unsigned long get_l1_code_start_cpu(int cpu)
163{
164 return cpu ? COREB_L1_CODE_START : COREA_L1_CODE_START;
165}
166static 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}
170static 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}
174
175static inline unsigned long get_l1_scratch_start(void)
176{
177 return get_l1_scratch_start_cpu(blackfin_core_id());
178}
179static inline unsigned long get_l1_code_start(void)
180{
181 return get_l1_code_start_cpu(blackfin_core_id());
182}
183static inline unsigned long get_l1_data_a_start(void)
184{
185 return get_l1_data_a_start_cpu(blackfin_core_id());
186}
187static inline unsigned long get_l1_data_b_start(void)
188{
189 return get_l1_data_b_start_cpu(blackfin_core_id());
190}
162 191
163#define GET_PDA(preg, dreg) GET_PDA_SAFE(preg)
164#endif /* CONFIG_SMP */ 192#endif /* CONFIG_SMP */
165 193
166#endif /* __ASSEMBLY__ */ 194#endif /* __ASSEMBLY__ */
167 195
168#endif /* _MEM_MAP_533_H_ */ 196#endif