diff options
author | Andrew Victor <andrew@sanpeople.com> | 2007-02-15 02:17:38 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2007-02-15 10:33:31 -0500 |
commit | f7eee89b2a4b4c233acde621005a814da0eb46d6 (patch) | |
tree | 25474085888884aab2a2a9338dfb0de327d15475 | |
parent | 69b2e99cf57ab8121d575a04a050314ac9c8f7e1 (diff) |
[ARM] 4192/1: AT91: Support for AT91SAM9XE processors.
Add support for the Atmel AT91SAM9XE range of processors. These are
basically AT91SAM9260's with different amounts of internal SRAM and
Flash.
We make use of the existing AT91SAM9260 support, but just perform
run-time detection of the size of the internal SRAM.
Original patch from Nicolas Ferre.
Signed-off-by: Andrew Victor <andrew@sanpeople.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | arch/arm/mach-at91/Kconfig | 17 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9260.c | 42 | ||||
-rw-r--r-- | include/asm-arm/arch-at91/at91_dbgu.h | 14 | ||||
-rw-r--r-- | include/asm-arm/arch-at91/at91sam9260.h | 4 | ||||
-rw-r--r-- | include/asm-arm/arch-at91/cpu.h | 17 |
5 files changed, 87 insertions, 7 deletions
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig index 9313888d77c9..bf0d96272e3a 100644 --- a/arch/arm/mach-at91/Kconfig +++ b/arch/arm/mach-at91/Kconfig | |||
@@ -9,7 +9,7 @@ config ARCH_AT91RM9200 | |||
9 | bool "AT91RM9200" | 9 | bool "AT91RM9200" |
10 | 10 | ||
11 | config ARCH_AT91SAM9260 | 11 | config ARCH_AT91SAM9260 |
12 | bool "AT91SAM9260" | 12 | bool "AT91SAM9260 or AT91SAM9XE" |
13 | 13 | ||
14 | config ARCH_AT91SAM9261 | 14 | config ARCH_AT91SAM9261 |
15 | bool "AT91SAM9261" | 15 | bool "AT91SAM9261" |
@@ -93,13 +93,22 @@ endif | |||
93 | 93 | ||
94 | if ARCH_AT91SAM9260 | 94 | if ARCH_AT91SAM9260 |
95 | 95 | ||
96 | comment "AT91SAM9260 Board Type" | 96 | comment "AT91SAM9260 Variants" |
97 | |||
98 | config ARCH_AT91SAM9260_SAM9XE | ||
99 | bool "AT91SAM9XE" | ||
100 | depends on ARCH_AT91SAM9260 | ||
101 | help | ||
102 | Select this if you are using Atmel's AT91SAM9XE System-on-Chip. | ||
103 | They are basicaly AT91SAM9260s with various sizes of embedded Flash. | ||
104 | |||
105 | comment "AT91SAM9260 / AT91SAM9XE Board Type" | ||
97 | 106 | ||
98 | config MACH_AT91SAM9260EK | 107 | config MACH_AT91SAM9260EK |
99 | bool "Atmel AT91SAM9260-EK Evaluation Kit" | 108 | bool "Atmel AT91SAM9260-EK / AT91SAM9XE Evaluation Kit" |
100 | depends on ARCH_AT91SAM9260 | 109 | depends on ARCH_AT91SAM9260 |
101 | help | 110 | help |
102 | Select this if you are using Atmel's AT91SAM9260-EK Evaluation Kit. | 111 | Select this if you are using Atmel's AT91SAM9260-EK or AT91SAM9XE Evaluation Kit |
103 | <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3933> | 112 | <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3933> |
104 | 113 | ||
105 | endif | 114 | endif |
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c index 86e3a4c46550..003c27c2ef65 100644 --- a/arch/arm/mach-at91/at91sam9260.c +++ b/arch/arm/mach-at91/at91sam9260.c | |||
@@ -14,6 +14,7 @@ | |||
14 | 14 | ||
15 | #include <asm/mach/arch.h> | 15 | #include <asm/mach/arch.h> |
16 | #include <asm/mach/map.h> | 16 | #include <asm/mach/map.h> |
17 | #include <asm/arch/cpu.h> | ||
17 | #include <asm/arch/at91sam9260.h> | 18 | #include <asm/arch/at91sam9260.h> |
18 | #include <asm/arch/at91_pmc.h> | 19 | #include <asm/arch/at91_pmc.h> |
19 | #include <asm/arch/at91_rstc.h> | 20 | #include <asm/arch/at91_rstc.h> |
@@ -27,7 +28,11 @@ static struct map_desc at91sam9260_io_desc[] __initdata = { | |||
27 | .pfn = __phys_to_pfn(AT91_BASE_SYS), | 28 | .pfn = __phys_to_pfn(AT91_BASE_SYS), |
28 | .length = SZ_16K, | 29 | .length = SZ_16K, |
29 | .type = MT_DEVICE, | 30 | .type = MT_DEVICE, |
30 | }, { | 31 | } |
32 | }; | ||
33 | |||
34 | static struct map_desc at91sam9260_sram_desc[] __initdata = { | ||
35 | { | ||
31 | .virtual = AT91_IO_VIRT_BASE - AT91SAM9260_SRAM0_SIZE, | 36 | .virtual = AT91_IO_VIRT_BASE - AT91SAM9260_SRAM0_SIZE, |
32 | .pfn = __phys_to_pfn(AT91SAM9260_SRAM0_BASE), | 37 | .pfn = __phys_to_pfn(AT91SAM9260_SRAM0_BASE), |
33 | .length = AT91SAM9260_SRAM0_SIZE, | 38 | .length = AT91SAM9260_SRAM0_SIZE, |
@@ -37,7 +42,14 @@ static struct map_desc at91sam9260_io_desc[] __initdata = { | |||
37 | .pfn = __phys_to_pfn(AT91SAM9260_SRAM1_BASE), | 42 | .pfn = __phys_to_pfn(AT91SAM9260_SRAM1_BASE), |
38 | .length = AT91SAM9260_SRAM1_SIZE, | 43 | .length = AT91SAM9260_SRAM1_SIZE, |
39 | .type = MT_DEVICE, | 44 | .type = MT_DEVICE, |
40 | }, | 45 | } |
46 | }; | ||
47 | |||
48 | static struct map_desc at91sam9xe_sram_desc[] __initdata = { | ||
49 | { | ||
50 | .pfn = __phys_to_pfn(AT91SAM9XE_SRAM_BASE), | ||
51 | .type = MT_DEVICE, | ||
52 | } | ||
41 | }; | 53 | }; |
42 | 54 | ||
43 | /* -------------------------------------------------------------------- | 55 | /* -------------------------------------------------------------------- |
@@ -255,11 +267,37 @@ static void at91sam9260_reset(void) | |||
255 | * AT91SAM9260 processor initialization | 267 | * AT91SAM9260 processor initialization |
256 | * -------------------------------------------------------------------- */ | 268 | * -------------------------------------------------------------------- */ |
257 | 269 | ||
270 | static void __init at91sam9xe_initialize(void) | ||
271 | { | ||
272 | unsigned long cidr, sram_size; | ||
273 | |||
274 | cidr = at91_sys_read(AT91_DBGU_CIDR); | ||
275 | |||
276 | switch (cidr & AT91_CIDR_SRAMSIZ) { | ||
277 | case AT91_CIDR_SRAMSIZ_32K: | ||
278 | sram_size = 2 * SZ_16K; | ||
279 | break; | ||
280 | case AT91_CIDR_SRAMSIZ_16K: | ||
281 | default: | ||
282 | sram_size = SZ_16K; | ||
283 | } | ||
284 | |||
285 | at91sam9xe_sram_desc->virtual = AT91_IO_VIRT_BASE - sram_size; | ||
286 | at91sam9xe_sram_desc->length = sram_size; | ||
287 | |||
288 | iotable_init(at91sam9xe_sram_desc, ARRAY_SIZE(at91sam9xe_sram_desc)); | ||
289 | } | ||
290 | |||
258 | void __init at91sam9260_initialize(unsigned long main_clock) | 291 | void __init at91sam9260_initialize(unsigned long main_clock) |
259 | { | 292 | { |
260 | /* Map peripherals */ | 293 | /* Map peripherals */ |
261 | iotable_init(at91sam9260_io_desc, ARRAY_SIZE(at91sam9260_io_desc)); | 294 | iotable_init(at91sam9260_io_desc, ARRAY_SIZE(at91sam9260_io_desc)); |
262 | 295 | ||
296 | if (cpu_is_at91sam9xe()) | ||
297 | at91sam9xe_initialize(); | ||
298 | else | ||
299 | iotable_init(at91sam9260_sram_desc, ARRAY_SIZE(at91sam9260_sram_desc)); | ||
300 | |||
263 | at91_arch_reset = at91sam9260_reset; | 301 | at91_arch_reset = at91sam9260_reset; |
264 | at91_extern_irq = (1 << AT91SAM9260_ID_IRQ0) | (1 << AT91SAM9260_ID_IRQ1) | 302 | at91_extern_irq = (1 << AT91SAM9260_ID_IRQ0) | (1 << AT91SAM9260_ID_IRQ1) |
265 | | (1 << AT91SAM9260_ID_IRQ2); | 303 | | (1 << AT91SAM9260_ID_IRQ2); |
diff --git a/include/asm-arm/arch-at91/at91_dbgu.h b/include/asm-arm/arch-at91/at91_dbgu.h index 1002a808ad91..b0369e176f7b 100644 --- a/include/asm-arm/arch-at91/at91_dbgu.h +++ b/include/asm-arm/arch-at91/at91_dbgu.h | |||
@@ -35,6 +35,20 @@ | |||
35 | #define AT91_CIDR_NVPSIZ (0xf << 8) /* Nonvolatile Program Memory Size */ | 35 | #define AT91_CIDR_NVPSIZ (0xf << 8) /* Nonvolatile Program Memory Size */ |
36 | #define AT91_CIDR_NVPSIZ2 (0xf << 12) /* Second Nonvolatile Program Memory Size */ | 36 | #define AT91_CIDR_NVPSIZ2 (0xf << 12) /* Second Nonvolatile Program Memory Size */ |
37 | #define AT91_CIDR_SRAMSIZ (0xf << 16) /* Internal SRAM Size */ | 37 | #define AT91_CIDR_SRAMSIZ (0xf << 16) /* Internal SRAM Size */ |
38 | #define AT91_CIDR_SRAMSIZ_1K (1 << 16) | ||
39 | #define AT91_CIDR_SRAMSIZ_2K (2 << 16) | ||
40 | #define AT91_CIDR_SRAMSIZ_112K (4 << 16) | ||
41 | #define AT91_CIDR_SRAMSIZ_4K (5 << 16) | ||
42 | #define AT91_CIDR_SRAMSIZ_80K (6 << 16) | ||
43 | #define AT91_CIDR_SRAMSIZ_160K (7 << 16) | ||
44 | #define AT91_CIDR_SRAMSIZ_8K (8 << 16) | ||
45 | #define AT91_CIDR_SRAMSIZ_16K (9 << 16) | ||
46 | #define AT91_CIDR_SRAMSIZ_32K (10 << 16) | ||
47 | #define AT91_CIDR_SRAMSIZ_64K (11 << 16) | ||
48 | #define AT91_CIDR_SRAMSIZ_128K (12 << 16) | ||
49 | #define AT91_CIDR_SRAMSIZ_256K (13 << 16) | ||
50 | #define AT91_CIDR_SRAMSIZ_96K (14 << 16) | ||
51 | #define AT91_CIDR_SRAMSIZ_512K (15 << 16) | ||
38 | #define AT91_CIDR_ARCH (0xff << 20) /* Architecture Identifier */ | 52 | #define AT91_CIDR_ARCH (0xff << 20) /* Architecture Identifier */ |
39 | #define AT91_CIDR_NVPTYP (7 << 28) /* Nonvolatile Program Memory Type */ | 53 | #define AT91_CIDR_NVPTYP (7 << 28) /* Nonvolatile Program Memory Type */ |
40 | #define AT91_CIDR_EXT (1 << 31) /* Extension Flag */ | 54 | #define AT91_CIDR_EXT (1 << 31) /* Extension Flag */ |
diff --git a/include/asm-arm/arch-at91/at91sam9260.h b/include/asm-arm/arch-at91/at91sam9260.h index 73d93ae9243e..2cadebc36af7 100644 --- a/include/asm-arm/arch-at91/at91sam9260.h +++ b/include/asm-arm/arch-at91/at91sam9260.h | |||
@@ -113,6 +113,10 @@ | |||
113 | 113 | ||
114 | #define AT91SAM9260_UHP_BASE 0x00500000 /* USB Host controller */ | 114 | #define AT91SAM9260_UHP_BASE 0x00500000 /* USB Host controller */ |
115 | 115 | ||
116 | #define AT91SAM9XE_FLASH_BASE 0x00200000 /* Internal FLASH base address */ | ||
117 | #define AT91SAM9XE_SRAM_BASE 0x00300000 /* Internal SRAM base address */ | ||
118 | |||
119 | |||
116 | #if 0 | 120 | #if 0 |
117 | /* | 121 | /* |
118 | * PIO pin definitions (peripheral A/B multiplexing). | 122 | * PIO pin definitions (peripheral A/B multiplexing). |
diff --git a/include/asm-arm/arch-at91/cpu.h b/include/asm-arm/arch-at91/cpu.h index 9efde0dad249..d464ca58cdbc 100644 --- a/include/asm-arm/arch-at91/cpu.h +++ b/include/asm-arm/arch-at91/cpu.h | |||
@@ -22,6 +22,9 @@ | |||
22 | #define ARCH_ID_AT91SAM9261 0x019703a0 | 22 | #define ARCH_ID_AT91SAM9261 0x019703a0 |
23 | #define ARCH_ID_AT91SAM9263 0x019607a0 | 23 | #define ARCH_ID_AT91SAM9263 0x019607a0 |
24 | 24 | ||
25 | #define ARCH_ID_AT91SAM9XE128 0x329973a0 | ||
26 | #define ARCH_ID_AT91SAM9XE256 0x329a93a0 | ||
27 | #define ARCH_ID_AT91SAM9XE512 0x329aa3a0 | ||
25 | 28 | ||
26 | static inline unsigned long at91_cpu_identify(void) | 29 | static inline unsigned long at91_cpu_identify(void) |
27 | { | 30 | { |
@@ -29,6 +32,16 @@ static inline unsigned long at91_cpu_identify(void) | |||
29 | } | 32 | } |
30 | 33 | ||
31 | 34 | ||
35 | #define ARCH_FAMILY_AT91X92 0x09200000 | ||
36 | #define ARCH_FAMILY_AT91SAM9 0x01900000 | ||
37 | #define ARCH_FAMILY_AT91SAM9XE 0x02900000 | ||
38 | |||
39 | static inline unsigned long at91_arch_identify(void) | ||
40 | { | ||
41 | return (at91_sys_read(AT91_DBGU_CIDR) & AT91_CIDR_ARCH); | ||
42 | } | ||
43 | |||
44 | |||
32 | #ifdef CONFIG_ARCH_AT91RM9200 | 45 | #ifdef CONFIG_ARCH_AT91RM9200 |
33 | #define cpu_is_at91rm9200() (at91_cpu_identify() == ARCH_ID_AT91RM9200) | 46 | #define cpu_is_at91rm9200() (at91_cpu_identify() == ARCH_ID_AT91RM9200) |
34 | #else | 47 | #else |
@@ -36,8 +49,10 @@ static inline unsigned long at91_cpu_identify(void) | |||
36 | #endif | 49 | #endif |
37 | 50 | ||
38 | #ifdef CONFIG_ARCH_AT91SAM9260 | 51 | #ifdef CONFIG_ARCH_AT91SAM9260 |
39 | #define cpu_is_at91sam9260() (at91_cpu_identify() == ARCH_ID_AT91SAM9260) | 52 | #define cpu_is_at91sam9xe() (at91_arch_identify() == ARCH_FAMILY_AT91SAM9XE) |
53 | #define cpu_is_at91sam9260() ((at91_cpu_identify() == ARCH_ID_AT91SAM9260) || cpu_is_at91sam9xe()) | ||
40 | #else | 54 | #else |
55 | #define cpu_is_at91sam9xe() (0) | ||
41 | #define cpu_is_at91sam9260() (0) | 56 | #define cpu_is_at91sam9260() (0) |
42 | #endif | 57 | #endif |
43 | 58 | ||