diff options
author | Nicolas Ferre <nicolas.ferre@atmel.com> | 2014-09-15 12:15:54 -0400 |
---|---|---|
committer | Nicolas Ferre <nicolas.ferre@atmel.com> | 2014-09-22 05:39:05 -0400 |
commit | 2dc850b62e5b727a5413b60197cdddf92ab4f1a2 (patch) | |
tree | 6a5436ba54c8d2124a7b9ea16e18b7517b42bfe7 /arch | |
parent | bcc5fd49a0fda5abc22057f65b318788ccb5d2ad (diff) |
ARM: at91: introduce basic SAMA5D4 support
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/Kconfig.debug | 4 | ||||
-rw-r--r-- | arch/arm/mach-at91/Kconfig | 18 | ||||
-rw-r--r-- | arch/arm/mach-at91/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-at91/include/mach/cpu.h | 9 | ||||
-rw-r--r-- | arch/arm/mach-at91/include/mach/sama5d4.h | 33 | ||||
-rw-r--r-- | arch/arm/mach-at91/sama5d4.c | 36 | ||||
-rw-r--r-- | arch/arm/mach-at91/soc.h | 5 |
7 files changed, 106 insertions, 0 deletions
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index b11ad54f8d17..7b44db208f10 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug | |||
@@ -101,6 +101,10 @@ choice | |||
101 | bool "Kernel low-level debugging on 9263 and 9g45" | 101 | bool "Kernel low-level debugging on 9263 and 9g45" |
102 | depends on HAVE_AT91_DBGU1 | 102 | depends on HAVE_AT91_DBGU1 |
103 | 103 | ||
104 | config AT91_DEBUG_LL_DBGU2 | ||
105 | bool "Kernel low-level debugging on sama5d4" | ||
106 | depends on HAVE_AT91_DBGU2 | ||
107 | |||
104 | config DEBUG_BCM2835 | 108 | config DEBUG_BCM2835 |
105 | bool "Kernel low-level debugging on BCM2835 PL011 UART" | 109 | bool "Kernel low-level debugging on BCM2835 PL011 UART" |
106 | depends on ARCH_BCM2835 | 110 | depends on ARCH_BCM2835 |
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig index 321210cc3be7..807b22dadcb6 100644 --- a/arch/arm/mach-at91/Kconfig +++ b/arch/arm/mach-at91/Kconfig | |||
@@ -12,6 +12,9 @@ config HAVE_AT91_DBGU0 | |||
12 | config HAVE_AT91_DBGU1 | 12 | config HAVE_AT91_DBGU1 |
13 | bool | 13 | bool |
14 | 14 | ||
15 | config HAVE_AT91_DBGU2 | ||
16 | bool | ||
17 | |||
15 | config AT91_USE_OLD_CLK | 18 | config AT91_USE_OLD_CLK |
16 | bool | 19 | bool |
17 | 20 | ||
@@ -106,6 +109,21 @@ config SOC_SAMA5D3 | |||
106 | help | 109 | help |
107 | Select this if you are using one of Atmel's SAMA5D3 family SoC. | 110 | Select this if you are using one of Atmel's SAMA5D3 family SoC. |
108 | This support covers SAMA5D31, SAMA5D33, SAMA5D34, SAMA5D35, SAMA5D36. | 111 | This support covers SAMA5D31, SAMA5D33, SAMA5D34, SAMA5D35, SAMA5D36. |
112 | |||
113 | config SOC_SAMA5D4 | ||
114 | bool "SAMA5D4 family" | ||
115 | select SOC_SAMA5 | ||
116 | select HAVE_AT91_DBGU2 | ||
117 | select CLKSRC_MMIO | ||
118 | select CACHE_L2X0 | ||
119 | select CACHE_PL310 | ||
120 | select HAVE_FB_ATMEL | ||
121 | select HAVE_AT91_UTMI | ||
122 | select HAVE_AT91_SMD | ||
123 | select HAVE_AT91_USB_CLK | ||
124 | select HAVE_AT91_H32MX | ||
125 | help | ||
126 | Select this if you are using one of Atmel's SAMA5D4 family SoC. | ||
109 | endif | 127 | endif |
110 | 128 | ||
111 | if SOC_SAM_V4_V5 | 129 | if SOC_SAM_V4_V5 |
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile index c677f9688ffe..3e9f01ca142a 100644 --- a/arch/arm/mach-at91/Makefile +++ b/arch/arm/mach-at91/Makefile | |||
@@ -23,6 +23,7 @@ obj-$(CONFIG_SOC_AT91SAM9N12) += at91sam9n12.o | |||
23 | obj-$(CONFIG_SOC_AT91SAM9X5) += at91sam9x5.o | 23 | obj-$(CONFIG_SOC_AT91SAM9X5) += at91sam9x5.o |
24 | obj-$(CONFIG_SOC_AT91SAM9RL) += at91sam9rl.o | 24 | obj-$(CONFIG_SOC_AT91SAM9RL) += at91sam9rl.o |
25 | obj-$(CONFIG_SOC_SAMA5D3) += sama5d3.o | 25 | obj-$(CONFIG_SOC_SAMA5D3) += sama5d3.o |
26 | obj-$(CONFIG_SOC_SAMA5D4) += sama5d4.o | ||
26 | 27 | ||
27 | obj-$(CONFIG_ARCH_AT91RM9200) += at91rm9200_devices.o | 28 | obj-$(CONFIG_ARCH_AT91RM9200) += at91rm9200_devices.o |
28 | obj-$(CONFIG_ARCH_AT91SAM9260) += at91sam9260_devices.o | 29 | obj-$(CONFIG_ARCH_AT91SAM9260) += at91sam9260_devices.o |
diff --git a/arch/arm/mach-at91/include/mach/cpu.h b/arch/arm/mach-at91/include/mach/cpu.h index 86c71debab5b..d77572e8cb15 100644 --- a/arch/arm/mach-at91/include/mach/cpu.h +++ b/arch/arm/mach-at91/include/mach/cpu.h | |||
@@ -86,6 +86,9 @@ enum at91_soc_type { | |||
86 | /* SAMA5D3 */ | 86 | /* SAMA5D3 */ |
87 | AT91_SOC_SAMA5D3, | 87 | AT91_SOC_SAMA5D3, |
88 | 88 | ||
89 | /* SAMA5D4 */ | ||
90 | AT91_SOC_SAMA5D4, | ||
91 | |||
89 | /* Unknown type */ | 92 | /* Unknown type */ |
90 | AT91_SOC_UNKNOWN, | 93 | AT91_SOC_UNKNOWN, |
91 | }; | 94 | }; |
@@ -211,6 +214,12 @@ static inline int at91_soc_is_detected(void) | |||
211 | #define cpu_is_sama5d3() (0) | 214 | #define cpu_is_sama5d3() (0) |
212 | #endif | 215 | #endif |
213 | 216 | ||
217 | #ifdef CONFIG_SOC_SAMA5D4 | ||
218 | #define cpu_is_sama5d4() (at91_soc_initdata.type == AT91_SOC_SAMA5D4) | ||
219 | #else | ||
220 | #define cpu_is_sama5d4() (0) | ||
221 | #endif | ||
222 | |||
214 | /* | 223 | /* |
215 | * Since this is ARM, we will never run on any AVR32 CPU. But these | 224 | * Since this is ARM, we will never run on any AVR32 CPU. But these |
216 | * definitions may reduce clutter in common drivers. | 225 | * definitions may reduce clutter in common drivers. |
diff --git a/arch/arm/mach-at91/include/mach/sama5d4.h b/arch/arm/mach-at91/include/mach/sama5d4.h new file mode 100644 index 000000000000..f256a45d9854 --- /dev/null +++ b/arch/arm/mach-at91/include/mach/sama5d4.h | |||
@@ -0,0 +1,33 @@ | |||
1 | /* | ||
2 | * Chip-specific header file for the SAMA5D4 family | ||
3 | * | ||
4 | * Copyright (C) 2013 Atmel Corporation, | ||
5 | * Nicolas Ferre <nicolas.ferre@atmel.com> | ||
6 | * | ||
7 | * Common definitions. | ||
8 | * Based on SAMA5D4 datasheet. | ||
9 | * | ||
10 | * Licensed under GPLv2 or later. | ||
11 | */ | ||
12 | |||
13 | #ifndef SAMA5D4_H | ||
14 | #define SAMA5D4_H | ||
15 | |||
16 | /* | ||
17 | * User Peripheral physical base addresses. | ||
18 | */ | ||
19 | #define SAMA5D4_BASE_USART3 0xfc00c000 /* (USART3 non-secure) Base Address */ | ||
20 | #define SAMA5D4_BASE_PMC 0xf0018000 /* (PMC) Base Address */ | ||
21 | #define SAMA5D4_BASE_MPDDRC 0xf0010000 /* (MPDDRC) Base Address */ | ||
22 | #define SAMA5D4_BASE_PIOD 0xfc068000 /* (PIOD) Base Address */ | ||
23 | |||
24 | /* Some other peripherals */ | ||
25 | #define SAMA5D4_BASE_SYS2 SAMA5D4_BASE_PIOD | ||
26 | |||
27 | /* | ||
28 | * Internal Memory. | ||
29 | */ | ||
30 | #define SAMA5D4_NS_SRAM_BASE 0x00210000 /* Internal SRAM base address Non-Secure */ | ||
31 | #define SAMA5D4_NS_SRAM_SIZE (64 * SZ_1K) /* Internal SRAM size Non-Secure part (64Kb) */ | ||
32 | |||
33 | #endif | ||
diff --git a/arch/arm/mach-at91/sama5d4.c b/arch/arm/mach-at91/sama5d4.c new file mode 100644 index 000000000000..f81f11ed8deb --- /dev/null +++ b/arch/arm/mach-at91/sama5d4.c | |||
@@ -0,0 +1,36 @@ | |||
1 | /* | ||
2 | * Chip-specific setup code for the SAMA5D4 family | ||
3 | * | ||
4 | * Copyright (C) 2013 Atmel Corporation, | ||
5 | * Nicolas Ferre <nicolas.ferre@atmel.com> | ||
6 | * | ||
7 | * Licensed under GPLv2 or later. | ||
8 | */ | ||
9 | |||
10 | #include <linux/module.h> | ||
11 | #include <linux/dma-mapping.h> | ||
12 | #include <linux/clk/at91_pmc.h> | ||
13 | |||
14 | #include <asm/irq.h> | ||
15 | #include <asm/mach/arch.h> | ||
16 | #include <asm/mach/map.h> | ||
17 | #include <mach/sama5d4.h> | ||
18 | #include <mach/cpu.h> | ||
19 | #include <mach/hardware.h> | ||
20 | |||
21 | #include "soc.h" | ||
22 | #include "generic.h" | ||
23 | #include "sam9_smc.h" | ||
24 | |||
25 | /* -------------------------------------------------------------------- | ||
26 | * Processor initialization | ||
27 | * -------------------------------------------------------------------- */ | ||
28 | |||
29 | static void __init sama5d4_map_io(void) | ||
30 | { | ||
31 | at91_init_sram(0, SAMA5D4_NS_SRAM_BASE, SAMA5D4_NS_SRAM_SIZE); | ||
32 | } | ||
33 | |||
34 | AT91_SOC_START(sama5d4) | ||
35 | .map_io = sama5d4_map_io, | ||
36 | AT91_SOC_END | ||
diff --git a/arch/arm/mach-at91/soc.h b/arch/arm/mach-at91/soc.h index a1e1482c6da8..8ecaee67f953 100644 --- a/arch/arm/mach-at91/soc.h +++ b/arch/arm/mach-at91/soc.h | |||
@@ -24,6 +24,7 @@ extern struct at91_init_soc at91sam9rl_soc; | |||
24 | extern struct at91_init_soc at91sam9x5_soc; | 24 | extern struct at91_init_soc at91sam9x5_soc; |
25 | extern struct at91_init_soc at91sam9n12_soc; | 25 | extern struct at91_init_soc at91sam9n12_soc; |
26 | extern struct at91_init_soc sama5d3_soc; | 26 | extern struct at91_init_soc sama5d3_soc; |
27 | extern struct at91_init_soc sama5d4_soc; | ||
27 | 28 | ||
28 | #define AT91_SOC_START(_name) \ | 29 | #define AT91_SOC_START(_name) \ |
29 | struct at91_init_soc __initdata _name##_soc \ | 30 | struct at91_init_soc __initdata _name##_soc \ |
@@ -74,3 +75,7 @@ static inline int at91_soc_is_enabled(void) | |||
74 | #if !defined(CONFIG_SOC_SAMA5D3) | 75 | #if !defined(CONFIG_SOC_SAMA5D3) |
75 | #define sama5d3_soc at91_boot_soc | 76 | #define sama5d3_soc at91_boot_soc |
76 | #endif | 77 | #endif |
78 | |||
79 | #if !defined(CONFIG_SOC_SAMA5D4) | ||
80 | #define sama5d4_soc at91_boot_soc | ||
81 | #endif | ||