diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-22 12:32:42 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-22 12:32:42 -0400 |
commit | 9f639269ed1522c7d69c54cc8b80ab8ee53fcb10 (patch) | |
tree | bf3e38862b6e4e4c416a6e075b614f2c4befe3e9 /arch/arm/mach-at91 | |
parent | b324c67d4800e59171f48d9ddab6cbfb59110482 (diff) | |
parent | 0804dcb2afdcf014947ee98264041765f580d43f (diff) |
Merge tag 'soc' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull support for new arm SoCs from Olof Johansson:
"Three new system-on-chip models are supported: the st-ericsson u9540
in ux500, the sam9n12 in at91 and the emma ev2 in shmobile.
Emma is a little bit special because it is completely unrelated to the
classic shmobile models, but the new Renesas rmobile SoCs are a
combination of things from both Emma and shmobile, so it was decided
to have them all live in one directory.
This also contains updates to existing shmobile soc code as well as
some related board changes due to dependencies."
* tag 'soc' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (23 commits)
mach-shmobile: Use DT_MACHINE for KZM9D V3
mach-shmobile: Emma Mobile EV2 DT support V3
mach-shmobile: KZM9D board Ethernet support V3
mach-shmobile: Emma Mobile EV2 GPIO support V3
mach-shmobile: Emma Mobile EV2 SMP support V3
mach-shmobile: KZM9D board support V3
mach-shmobile: Emma Mobile EV2 SoC base support V3
gpio: Emma Mobile GPIO driver V2
ARM: mach-shmobile: sh73a0: fixup PINT/IRQ16-IRQ31 irq number conflict
ARM: mach-shmobile: clock-r8a7740: use followparent_recalc on usb24s
ARM: mach-shmobile: clock-r8a7740: add MMCIF clock
ARM: mach-shmobile: clock-r8a7740: add SDHI clock
ARM: mach-shmobile: clock-r8a7740: add USB clock
ARM: mach-shmobile: clock-r8a7740: add FSI clock
ARM: mach-shmobile: r8a7740: cleanup I2C workaround method
ARM: mach-shmobile: r8a7740: add gpio_irq support
ARM: mach-shmobile: sh7372: Add FSI DMAEngine support
ARM / mach-shmobile: Use preset_lpj with calibrate_delay()
ARM: ux500: ioremap differences for DB9540
ARM: ux500: core U9540 support
...
Diffstat (limited to 'arch/arm/mach-at91')
-rw-r--r-- | arch/arm/mach-at91/Kconfig | 8 | ||||
-rw-r--r-- | arch/arm/mach-at91/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-at91/Makefile.boot | 2 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9n12.c | 233 | ||||
-rw-r--r-- | arch/arm/mach-at91/clock.c | 15 | ||||
-rw-r--r-- | arch/arm/mach-at91/include/mach/at91sam9n12.h | 60 | ||||
-rw-r--r-- | arch/arm/mach-at91/include/mach/at91sam9n12_matrix.h | 53 | ||||
-rw-r--r-- | arch/arm/mach-at91/include/mach/cpu.h | 10 | ||||
-rw-r--r-- | arch/arm/mach-at91/include/mach/hardware.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-at91/setup.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-at91/soc.h | 5 |
11 files changed, 389 insertions, 5 deletions
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig index 98a42f3472d5..19505c0a3f01 100644 --- a/arch/arm/mach-at91/Kconfig +++ b/arch/arm/mach-at91/Kconfig | |||
@@ -91,6 +91,14 @@ config SOC_AT91SAM9X5 | |||
91 | This support covers AT91SAM9G15, AT91SAM9G25, AT91SAM9X25, AT91SAM9G35 | 91 | This support covers AT91SAM9G15, AT91SAM9G25, AT91SAM9X25, AT91SAM9G35 |
92 | and AT91SAM9X35. | 92 | and AT91SAM9X35. |
93 | 93 | ||
94 | config SOC_AT91SAM9N12 | ||
95 | bool "AT91SAM9N12 family" | ||
96 | select SOC_AT91SAM9 | ||
97 | select HAVE_AT91_DBGU0 | ||
98 | select HAVE_FB_ATMEL | ||
99 | help | ||
100 | Select this if you are using Atmel's AT91SAM9N12 SoC. | ||
101 | |||
94 | choice | 102 | choice |
95 | prompt "Atmel AT91 Processor Devices for non DT boards" | 103 | prompt "Atmel AT91 Processor Devices for non DT boards" |
96 | 104 | ||
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile index 79d0f60af0b2..3bb7a51efc9d 100644 --- a/arch/arm/mach-at91/Makefile +++ b/arch/arm/mach-at91/Makefile | |||
@@ -18,6 +18,7 @@ obj-$(CONFIG_SOC_AT91SAM9260) += at91sam9260.o | |||
18 | obj-$(CONFIG_SOC_AT91SAM9261) += at91sam9261.o | 18 | obj-$(CONFIG_SOC_AT91SAM9261) += at91sam9261.o |
19 | obj-$(CONFIG_SOC_AT91SAM9263) += at91sam9263.o | 19 | obj-$(CONFIG_SOC_AT91SAM9263) += at91sam9263.o |
20 | obj-$(CONFIG_SOC_AT91SAM9G45) += at91sam9g45.o | 20 | obj-$(CONFIG_SOC_AT91SAM9G45) += at91sam9g45.o |
21 | obj-$(CONFIG_SOC_AT91SAM9N12) += at91sam9n12.o | ||
21 | obj-$(CONFIG_SOC_AT91SAM9X5) += at91sam9x5.o | 22 | obj-$(CONFIG_SOC_AT91SAM9X5) += at91sam9x5.o |
22 | obj-$(CONFIG_SOC_AT91SAM9RL) += at91sam9rl.o | 23 | obj-$(CONFIG_SOC_AT91SAM9RL) += at91sam9rl.o |
23 | 24 | ||
diff --git a/arch/arm/mach-at91/Makefile.boot b/arch/arm/mach-at91/Makefile.boot index c03417ddbf0c..9e84fe4f2aaa 100644 --- a/arch/arm/mach-at91/Makefile.boot +++ b/arch/arm/mach-at91/Makefile.boot | |||
@@ -30,5 +30,7 @@ dtb-$(CONFIG_MACH_AT91SAM_DT) += tny_a9g20.dtb | |||
30 | dtb-$(CONFIG_MACH_AT91SAM_DT) += usb_a9g20.dtb | 30 | dtb-$(CONFIG_MACH_AT91SAM_DT) += usb_a9g20.dtb |
31 | # sam9g45 | 31 | # sam9g45 |
32 | dtb-$(CONFIG_MACH_AT91SAM_DT) += at91sam9m10g45ek.dtb | 32 | dtb-$(CONFIG_MACH_AT91SAM_DT) += at91sam9m10g45ek.dtb |
33 | # sam9n12 | ||
34 | dtb-$(CONFIG_MACH_AT91SAM_DT) += at91sam9n12ek.dtb | ||
33 | # sam9x5 | 35 | # sam9x5 |
34 | dtb-$(CONFIG_MACH_AT91SAM_DT) += at91sam9g25ek.dtb | 36 | dtb-$(CONFIG_MACH_AT91SAM_DT) += at91sam9g25ek.dtb |
diff --git a/arch/arm/mach-at91/at91sam9n12.c b/arch/arm/mach-at91/at91sam9n12.c new file mode 100644 index 000000000000..08494664ab78 --- /dev/null +++ b/arch/arm/mach-at91/at91sam9n12.c | |||
@@ -0,0 +1,233 @@ | |||
1 | /* | ||
2 | * SoC specific setup code for the AT91SAM9N12 | ||
3 | * | ||
4 | * Copyright (C) 2012 Atmel Corporation. | ||
5 | * | ||
6 | * Licensed under GPLv2 or later. | ||
7 | */ | ||
8 | |||
9 | #include <linux/module.h> | ||
10 | #include <linux/dma-mapping.h> | ||
11 | |||
12 | #include <asm/irq.h> | ||
13 | #include <asm/mach/arch.h> | ||
14 | #include <asm/mach/map.h> | ||
15 | #include <mach/at91sam9n12.h> | ||
16 | #include <mach/at91_pmc.h> | ||
17 | #include <mach/cpu.h> | ||
18 | #include <mach/board.h> | ||
19 | |||
20 | #include "soc.h" | ||
21 | #include "generic.h" | ||
22 | #include "clock.h" | ||
23 | #include "sam9_smc.h" | ||
24 | |||
25 | /* -------------------------------------------------------------------- | ||
26 | * Clocks | ||
27 | * -------------------------------------------------------------------- */ | ||
28 | |||
29 | /* | ||
30 | * The peripheral clocks. | ||
31 | */ | ||
32 | static struct clk pioAB_clk = { | ||
33 | .name = "pioAB_clk", | ||
34 | .pmc_mask = 1 << AT91SAM9N12_ID_PIOAB, | ||
35 | .type = CLK_TYPE_PERIPHERAL, | ||
36 | }; | ||
37 | static struct clk pioCD_clk = { | ||
38 | .name = "pioCD_clk", | ||
39 | .pmc_mask = 1 << AT91SAM9N12_ID_PIOCD, | ||
40 | .type = CLK_TYPE_PERIPHERAL, | ||
41 | }; | ||
42 | static struct clk usart0_clk = { | ||
43 | .name = "usart0_clk", | ||
44 | .pmc_mask = 1 << AT91SAM9N12_ID_USART0, | ||
45 | .type = CLK_TYPE_PERIPHERAL, | ||
46 | }; | ||
47 | static struct clk usart1_clk = { | ||
48 | .name = "usart1_clk", | ||
49 | .pmc_mask = 1 << AT91SAM9N12_ID_USART1, | ||
50 | .type = CLK_TYPE_PERIPHERAL, | ||
51 | }; | ||
52 | static struct clk usart2_clk = { | ||
53 | .name = "usart2_clk", | ||
54 | .pmc_mask = 1 << AT91SAM9N12_ID_USART2, | ||
55 | .type = CLK_TYPE_PERIPHERAL, | ||
56 | }; | ||
57 | static struct clk usart3_clk = { | ||
58 | .name = "usart3_clk", | ||
59 | .pmc_mask = 1 << AT91SAM9N12_ID_USART3, | ||
60 | .type = CLK_TYPE_PERIPHERAL, | ||
61 | }; | ||
62 | static struct clk twi0_clk = { | ||
63 | .name = "twi0_clk", | ||
64 | .pmc_mask = 1 << AT91SAM9N12_ID_TWI0, | ||
65 | .type = CLK_TYPE_PERIPHERAL, | ||
66 | }; | ||
67 | static struct clk twi1_clk = { | ||
68 | .name = "twi1_clk", | ||
69 | .pmc_mask = 1 << AT91SAM9N12_ID_TWI1, | ||
70 | .type = CLK_TYPE_PERIPHERAL, | ||
71 | }; | ||
72 | static struct clk mmc_clk = { | ||
73 | .name = "mci_clk", | ||
74 | .pmc_mask = 1 << AT91SAM9N12_ID_MCI, | ||
75 | .type = CLK_TYPE_PERIPHERAL, | ||
76 | }; | ||
77 | static struct clk spi0_clk = { | ||
78 | .name = "spi0_clk", | ||
79 | .pmc_mask = 1 << AT91SAM9N12_ID_SPI0, | ||
80 | .type = CLK_TYPE_PERIPHERAL, | ||
81 | }; | ||
82 | static struct clk spi1_clk = { | ||
83 | .name = "spi1_clk", | ||
84 | .pmc_mask = 1 << AT91SAM9N12_ID_SPI1, | ||
85 | .type = CLK_TYPE_PERIPHERAL, | ||
86 | }; | ||
87 | static struct clk uart0_clk = { | ||
88 | .name = "uart0_clk", | ||
89 | .pmc_mask = 1 << AT91SAM9N12_ID_UART0, | ||
90 | .type = CLK_TYPE_PERIPHERAL, | ||
91 | }; | ||
92 | static struct clk uart1_clk = { | ||
93 | .name = "uart1_clk", | ||
94 | .pmc_mask = 1 << AT91SAM9N12_ID_UART1, | ||
95 | .type = CLK_TYPE_PERIPHERAL, | ||
96 | }; | ||
97 | static struct clk tcb_clk = { | ||
98 | .name = "tcb_clk", | ||
99 | .pmc_mask = 1 << AT91SAM9N12_ID_TCB, | ||
100 | .type = CLK_TYPE_PERIPHERAL, | ||
101 | }; | ||
102 | static struct clk pwm_clk = { | ||
103 | .name = "pwm_clk", | ||
104 | .pmc_mask = 1 << AT91SAM9N12_ID_PWM, | ||
105 | .type = CLK_TYPE_PERIPHERAL, | ||
106 | }; | ||
107 | static struct clk adc_clk = { | ||
108 | .name = "adc_clk", | ||
109 | .pmc_mask = 1 << AT91SAM9N12_ID_ADC, | ||
110 | .type = CLK_TYPE_PERIPHERAL, | ||
111 | }; | ||
112 | static struct clk dma_clk = { | ||
113 | .name = "dma_clk", | ||
114 | .pmc_mask = 1 << AT91SAM9N12_ID_DMA, | ||
115 | .type = CLK_TYPE_PERIPHERAL, | ||
116 | }; | ||
117 | static struct clk uhp_clk = { | ||
118 | .name = "uhp", | ||
119 | .pmc_mask = 1 << AT91SAM9N12_ID_UHP, | ||
120 | .type = CLK_TYPE_PERIPHERAL, | ||
121 | }; | ||
122 | static struct clk udp_clk = { | ||
123 | .name = "udp_clk", | ||
124 | .pmc_mask = 1 << AT91SAM9N12_ID_UDP, | ||
125 | .type = CLK_TYPE_PERIPHERAL, | ||
126 | }; | ||
127 | static struct clk lcdc_clk = { | ||
128 | .name = "lcdc_clk", | ||
129 | .pmc_mask = 1 << AT91SAM9N12_ID_LCDC, | ||
130 | .type = CLK_TYPE_PERIPHERAL, | ||
131 | }; | ||
132 | static struct clk ssc_clk = { | ||
133 | .name = "ssc_clk", | ||
134 | .pmc_mask = 1 << AT91SAM9N12_ID_SSC, | ||
135 | .type = CLK_TYPE_PERIPHERAL, | ||
136 | }; | ||
137 | |||
138 | static struct clk *periph_clocks[] __initdata = { | ||
139 | &pioAB_clk, | ||
140 | &pioCD_clk, | ||
141 | &usart0_clk, | ||
142 | &usart1_clk, | ||
143 | &usart2_clk, | ||
144 | &usart3_clk, | ||
145 | &twi0_clk, | ||
146 | &twi1_clk, | ||
147 | &mmc_clk, | ||
148 | &spi0_clk, | ||
149 | &spi1_clk, | ||
150 | &lcdc_clk, | ||
151 | &uart0_clk, | ||
152 | &uart1_clk, | ||
153 | &tcb_clk, | ||
154 | &pwm_clk, | ||
155 | &adc_clk, | ||
156 | &dma_clk, | ||
157 | &uhp_clk, | ||
158 | &udp_clk, | ||
159 | &ssc_clk, | ||
160 | }; | ||
161 | |||
162 | static struct clk_lookup periph_clocks_lookups[] = { | ||
163 | /* lookup table for DT entries */ | ||
164 | CLKDEV_CON_DEV_ID("usart", "fffff200.serial", &mck), | ||
165 | CLKDEV_CON_DEV_ID("usart", "f801c000.serial", &usart0_clk), | ||
166 | CLKDEV_CON_DEV_ID("usart", "f8020000.serial", &usart1_clk), | ||
167 | CLKDEV_CON_DEV_ID("usart", "f8024000.serial", &usart2_clk), | ||
168 | CLKDEV_CON_DEV_ID("usart", "f8028000.serial", &usart3_clk), | ||
169 | CLKDEV_CON_DEV_ID("t0_clk", "f8008000.timer", &tcb_clk), | ||
170 | CLKDEV_CON_DEV_ID("t0_clk", "f800c000.timer", &tcb_clk), | ||
171 | CLKDEV_CON_DEV_ID("dma_clk", "ffffec00.dma-controller", &dma_clk), | ||
172 | CLKDEV_CON_ID("pioA", &pioAB_clk), | ||
173 | CLKDEV_CON_ID("pioB", &pioAB_clk), | ||
174 | CLKDEV_CON_ID("pioC", &pioCD_clk), | ||
175 | CLKDEV_CON_ID("pioD", &pioCD_clk), | ||
176 | /* additional fake clock for macb_hclk */ | ||
177 | CLKDEV_CON_DEV_ID("hclk", "500000.ohci", &uhp_clk), | ||
178 | CLKDEV_CON_DEV_ID("ohci_clk", "500000.ohci", &uhp_clk), | ||
179 | }; | ||
180 | |||
181 | /* | ||
182 | * The two programmable clocks. | ||
183 | * You must configure pin multiplexing to bring these signals out. | ||
184 | */ | ||
185 | static struct clk pck0 = { | ||
186 | .name = "pck0", | ||
187 | .pmc_mask = AT91_PMC_PCK0, | ||
188 | .type = CLK_TYPE_PROGRAMMABLE, | ||
189 | .id = 0, | ||
190 | }; | ||
191 | static struct clk pck1 = { | ||
192 | .name = "pck1", | ||
193 | .pmc_mask = AT91_PMC_PCK1, | ||
194 | .type = CLK_TYPE_PROGRAMMABLE, | ||
195 | .id = 1, | ||
196 | }; | ||
197 | |||
198 | static void __init at91sam9n12_register_clocks(void) | ||
199 | { | ||
200 | int i; | ||
201 | |||
202 | for (i = 0; i < ARRAY_SIZE(periph_clocks); i++) | ||
203 | clk_register(periph_clocks[i]); | ||
204 | clk_register(&pck0); | ||
205 | clk_register(&pck1); | ||
206 | |||
207 | clkdev_add_table(periph_clocks_lookups, | ||
208 | ARRAY_SIZE(periph_clocks_lookups)); | ||
209 | |||
210 | } | ||
211 | |||
212 | /* -------------------------------------------------------------------- | ||
213 | * AT91SAM9N12 processor initialization | ||
214 | * -------------------------------------------------------------------- */ | ||
215 | |||
216 | static void __init at91sam9n12_map_io(void) | ||
217 | { | ||
218 | at91_init_sram(0, AT91SAM9N12_SRAM_BASE, AT91SAM9N12_SRAM_SIZE); | ||
219 | } | ||
220 | |||
221 | void __init at91sam9n12_initialize(void) | ||
222 | { | ||
223 | at91_extern_irq = (1 << AT91SAM9N12_ID_IRQ0); | ||
224 | |||
225 | /* Register GPIO subsystem (using DT) */ | ||
226 | at91_gpio_init(NULL, 0); | ||
227 | } | ||
228 | |||
229 | struct at91_init_soc __initdata at91sam9n12_soc = { | ||
230 | .map_io = at91sam9n12_map_io, | ||
231 | .register_clocks = at91sam9n12_register_clocks, | ||
232 | .init = at91sam9n12_initialize, | ||
233 | }; | ||
diff --git a/arch/arm/mach-at91/clock.c b/arch/arm/mach-at91/clock.c index 6b692824c988..de2ec6b8fea7 100644 --- a/arch/arm/mach-at91/clock.c +++ b/arch/arm/mach-at91/clock.c | |||
@@ -58,13 +58,15 @@ EXPORT_SYMBOL_GPL(at91_pmc_base); | |||
58 | 58 | ||
59 | #define cpu_has_800M_plla() ( cpu_is_at91sam9g20() \ | 59 | #define cpu_has_800M_plla() ( cpu_is_at91sam9g20() \ |
60 | || cpu_is_at91sam9g45() \ | 60 | || cpu_is_at91sam9g45() \ |
61 | || cpu_is_at91sam9x5()) | 61 | || cpu_is_at91sam9x5() \ |
62 | || cpu_is_at91sam9n12()) | ||
62 | 63 | ||
63 | #define cpu_has_300M_plla() (cpu_is_at91sam9g10()) | 64 | #define cpu_has_300M_plla() (cpu_is_at91sam9g10()) |
64 | 65 | ||
65 | #define cpu_has_pllb() (!(cpu_is_at91sam9rl() \ | 66 | #define cpu_has_pllb() (!(cpu_is_at91sam9rl() \ |
66 | || cpu_is_at91sam9g45() \ | 67 | || cpu_is_at91sam9g45() \ |
67 | || cpu_is_at91sam9x5())) | 68 | || cpu_is_at91sam9x5() \ |
69 | || cpu_is_at91sam9n12())) | ||
68 | 70 | ||
69 | #define cpu_has_upll() (cpu_is_at91sam9g45() \ | 71 | #define cpu_has_upll() (cpu_is_at91sam9g45() \ |
70 | || cpu_is_at91sam9x5()) | 72 | || cpu_is_at91sam9x5()) |
@@ -78,12 +80,15 @@ EXPORT_SYMBOL_GPL(at91_pmc_base); | |||
78 | || cpu_is_at91sam9x5())) | 80 | || cpu_is_at91sam9x5())) |
79 | 81 | ||
80 | #define cpu_has_plladiv2() (cpu_is_at91sam9g45() \ | 82 | #define cpu_has_plladiv2() (cpu_is_at91sam9g45() \ |
81 | || cpu_is_at91sam9x5()) | 83 | || cpu_is_at91sam9x5() \ |
84 | || cpu_is_at91sam9n12()) | ||
82 | 85 | ||
83 | #define cpu_has_mdiv3() (cpu_is_at91sam9g45() \ | 86 | #define cpu_has_mdiv3() (cpu_is_at91sam9g45() \ |
84 | || cpu_is_at91sam9x5()) | 87 | || cpu_is_at91sam9x5() \ |
88 | || cpu_is_at91sam9n12()) | ||
85 | 89 | ||
86 | #define cpu_has_alt_prescaler() (cpu_is_at91sam9x5()) | 90 | #define cpu_has_alt_prescaler() (cpu_is_at91sam9x5() \ |
91 | || cpu_is_at91sam9n12()) | ||
87 | 92 | ||
88 | static LIST_HEAD(clocks); | 93 | static LIST_HEAD(clocks); |
89 | static DEFINE_SPINLOCK(clk_lock); | 94 | static DEFINE_SPINLOCK(clk_lock); |
diff --git a/arch/arm/mach-at91/include/mach/at91sam9n12.h b/arch/arm/mach-at91/include/mach/at91sam9n12.h new file mode 100644 index 000000000000..d374b87c0459 --- /dev/null +++ b/arch/arm/mach-at91/include/mach/at91sam9n12.h | |||
@@ -0,0 +1,60 @@ | |||
1 | /* | ||
2 | * SoC specific header file for the AT91SAM9N12 | ||
3 | * | ||
4 | * Copyright (C) 2012 Atmel Corporation | ||
5 | * | ||
6 | * Common definitions, based on AT91SAM9N12 SoC datasheet | ||
7 | * | ||
8 | * Licensed under GPLv2 or later | ||
9 | */ | ||
10 | |||
11 | #ifndef _AT91SAM9N12_H_ | ||
12 | #define _AT91SAM9N12_H_ | ||
13 | |||
14 | /* | ||
15 | * Peripheral identifiers/interrupts. | ||
16 | */ | ||
17 | #define AT91SAM9N12_ID_PIOAB 2 /* Parallel I/O Controller A and B */ | ||
18 | #define AT91SAM9N12_ID_PIOCD 3 /* Parallel I/O Controller C and D */ | ||
19 | #define AT91SAM9N12_ID_FUSE 4 /* FUSE Controller */ | ||
20 | #define AT91SAM9N12_ID_USART0 5 /* USART 0 */ | ||
21 | #define AT91SAM9N12_ID_USART1 6 /* USART 1 */ | ||
22 | #define AT91SAM9N12_ID_USART2 7 /* USART 2 */ | ||
23 | #define AT91SAM9N12_ID_USART3 8 /* USART 3 */ | ||
24 | #define AT91SAM9N12_ID_TWI0 9 /* Two-Wire Interface 0 */ | ||
25 | #define AT91SAM9N12_ID_TWI1 10 /* Two-Wire Interface 1 */ | ||
26 | #define AT91SAM9N12_ID_MCI 12 /* High Speed Multimedia Card Interface */ | ||
27 | #define AT91SAM9N12_ID_SPI0 13 /* Serial Peripheral Interface 0 */ | ||
28 | #define AT91SAM9N12_ID_SPI1 14 /* Serial Peripheral Interface 1 */ | ||
29 | #define AT91SAM9N12_ID_UART0 15 /* UART 0 */ | ||
30 | #define AT91SAM9N12_ID_UART1 16 /* UART 1 */ | ||
31 | #define AT91SAM9N12_ID_TCB 17 /* Timer Counter 0, 1, 2, 3, 4 and 5 */ | ||
32 | #define AT91SAM9N12_ID_PWM 18 /* Pulse Width Modulation Controller */ | ||
33 | #define AT91SAM9N12_ID_ADC 19 /* ADC Controller */ | ||
34 | #define AT91SAM9N12_ID_DMA 20 /* DMA Controller */ | ||
35 | #define AT91SAM9N12_ID_UHP 22 /* USB Host High Speed */ | ||
36 | #define AT91SAM9N12_ID_UDP 23 /* USB Device High Speed */ | ||
37 | #define AT91SAM9N12_ID_LCDC 25 /* LCD Controller */ | ||
38 | #define AT91SAM9N12_ID_ISI 25 /* Image Sensor Interface */ | ||
39 | #define AT91SAM9N12_ID_SSC 28 /* Synchronous Serial Controller */ | ||
40 | #define AT91SAM9N12_ID_TRNG 30 /* TRNG */ | ||
41 | #define AT91SAM9N12_ID_IRQ0 31 /* Advanced Interrupt Controller */ | ||
42 | |||
43 | /* | ||
44 | * User Peripheral physical base addresses. | ||
45 | */ | ||
46 | #define AT91SAM9N12_BASE_USART0 0xf801c000 | ||
47 | #define AT91SAM9N12_BASE_USART1 0xf8020000 | ||
48 | #define AT91SAM9N12_BASE_USART2 0xf8024000 | ||
49 | #define AT91SAM9N12_BASE_USART3 0xf8028000 | ||
50 | |||
51 | /* | ||
52 | * Internal Memory. | ||
53 | */ | ||
54 | #define AT91SAM9N12_SRAM_BASE 0x00300000 /* Internal SRAM base address */ | ||
55 | #define AT91SAM9N12_SRAM_SIZE SZ_32K /* Internal SRAM size (32Kb) */ | ||
56 | |||
57 | #define AT91SAM9N12_ROM_BASE 0x00100000 /* Internal ROM base address */ | ||
58 | #define AT91SAM9N12_ROM_SIZE SZ_128K /* Internal ROM size (128Kb) */ | ||
59 | |||
60 | #endif | ||
diff --git a/arch/arm/mach-at91/include/mach/at91sam9n12_matrix.h b/arch/arm/mach-at91/include/mach/at91sam9n12_matrix.h new file mode 100644 index 000000000000..40060cd62fa9 --- /dev/null +++ b/arch/arm/mach-at91/include/mach/at91sam9n12_matrix.h | |||
@@ -0,0 +1,53 @@ | |||
1 | /* | ||
2 | * Matrix-centric header file for the AT91SAM9N12 | ||
3 | * | ||
4 | * Copyright (C) 2012 Atmel Corporation. | ||
5 | * | ||
6 | * Only EBI related registers. | ||
7 | * Write Protect register definitions may be useful. | ||
8 | * | ||
9 | * Licensed under GPLv2 or later. | ||
10 | */ | ||
11 | |||
12 | #ifndef _AT91SAM9N12_MATRIX_H_ | ||
13 | #define _AT91SAM9N12_MATRIX_H_ | ||
14 | |||
15 | #define AT91_MATRIX_EBICSA (AT91_MATRIX + 0x118) /* EBI Chip Select Assignment Register */ | ||
16 | #define AT91_MATRIX_EBI_CS1A (1 << 1) /* Chip Select 1 Assignment */ | ||
17 | #define AT91_MATRIX_EBI_CS1A_SMC (0 << 1) | ||
18 | #define AT91_MATRIX_EBI_CS1A_SDRAMC (1 << 1) | ||
19 | #define AT91_MATRIX_EBI_CS3A (1 << 3) /* Chip Select 3 Assignment */ | ||
20 | #define AT91_MATRIX_EBI_CS3A_SMC (0 << 3) | ||
21 | #define AT91_MATRIX_EBI_CS3A_SMC_NANDFLASH (1 << 3) | ||
22 | #define AT91_MATRIX_EBI_DBPUC (1 << 8) /* Data Bus Pull-up Configuration */ | ||
23 | #define AT91_MATRIX_EBI_DBPU_ON (0 << 8) | ||
24 | #define AT91_MATRIX_EBI_DBPU_OFF (1 << 8) | ||
25 | #define AT91_MATRIX_EBI_VDDIOMSEL (1 << 16) /* Memory voltage selection */ | ||
26 | #define AT91_MATRIX_EBI_VDDIOMSEL_1_8V (0 << 16) | ||
27 | #define AT91_MATRIX_EBI_VDDIOMSEL_3_3V (1 << 16) | ||
28 | #define AT91_MATRIX_EBI_EBI_IOSR (1 << 17) /* EBI I/O slew rate selection */ | ||
29 | #define AT91_MATRIX_EBI_EBI_IOSR_REDUCED (0 << 17) | ||
30 | #define AT91_MATRIX_EBI_EBI_IOSR_NORMAL (1 << 17) | ||
31 | #define AT91_MATRIX_EBI_DDR_IOSR (1 << 18) /* DDR2 dedicated port I/O slew rate selection */ | ||
32 | #define AT91_MATRIX_EBI_DDR_IOSR_REDUCED (0 << 18) | ||
33 | #define AT91_MATRIX_EBI_DDR_IOSR_NORMAL (1 << 18) | ||
34 | #define AT91_MATRIX_NFD0_SELECT (1 << 24) /* NAND Flash Data Bus Selection */ | ||
35 | #define AT91_MATRIX_NFD0_ON_D0 (0 << 24) | ||
36 | #define AT91_MATRIX_NFD0_ON_D16 (1 << 24) | ||
37 | #define AT91_MATRIX_DDR_MP_EN (1 << 25) /* DDR Multi-port Enable */ | ||
38 | #define AT91_MATRIX_MP_OFF (0 << 25) | ||
39 | #define AT91_MATRIX_MP_ON (1 << 25) | ||
40 | |||
41 | #define AT91_MATRIX_WPMR (AT91_MATRIX + 0x1E4) /* Write Protect Mode Register */ | ||
42 | #define AT91_MATRIX_WPMR_WPEN (1 << 0) /* Write Protect ENable */ | ||
43 | #define AT91_MATRIX_WPMR_WP_WPDIS (0 << 0) | ||
44 | #define AT91_MATRIX_WPMR_WP_WPEN (1 << 0) | ||
45 | #define AT91_MATRIX_WPMR_WPKEY (0xFFFFFF << 8) /* Write Protect KEY */ | ||
46 | |||
47 | #define AT91_MATRIX_WPSR (AT91_MATRIX + 0x1E8) /* Write Protect Status Register */ | ||
48 | #define AT91_MATRIX_WPSR_WPVS (1 << 0) /* Write Protect Violation Status */ | ||
49 | #define AT91_MATRIX_WPSR_NO_WPV (0 << 0) | ||
50 | #define AT91_MATRIX_WPSR_WPV (1 << 0) | ||
51 | #define AT91_MATRIX_WPSR_WPVSRC (0xFFFF << 8) /* Write Protect Violation Source */ | ||
52 | |||
53 | #endif | ||
diff --git a/arch/arm/mach-at91/include/mach/cpu.h b/arch/arm/mach-at91/include/mach/cpu.h index 73d2fd209ce4..b6504c19d55c 100644 --- a/arch/arm/mach-at91/include/mach/cpu.h +++ b/arch/arm/mach-at91/include/mach/cpu.h | |||
@@ -25,6 +25,7 @@ | |||
25 | #define ARCH_ID_AT91SAM9G45MRL 0x819b05a2 /* aka 9G45-ES2 & non ES lots */ | 25 | #define ARCH_ID_AT91SAM9G45MRL 0x819b05a2 /* aka 9G45-ES2 & non ES lots */ |
26 | #define ARCH_ID_AT91SAM9G45ES 0x819b05a1 /* 9G45-ES (Engineering Sample) */ | 26 | #define ARCH_ID_AT91SAM9G45ES 0x819b05a1 /* 9G45-ES (Engineering Sample) */ |
27 | #define ARCH_ID_AT91SAM9X5 0x819a05a0 | 27 | #define ARCH_ID_AT91SAM9X5 0x819a05a0 |
28 | #define ARCH_ID_AT91SAM9N12 0x819a07a0 | ||
28 | 29 | ||
29 | #define ARCH_ID_AT91SAM9XE128 0x329973a0 | 30 | #define ARCH_ID_AT91SAM9XE128 0x329973a0 |
30 | #define ARCH_ID_AT91SAM9XE256 0x329a93a0 | 31 | #define ARCH_ID_AT91SAM9XE256 0x329a93a0 |
@@ -71,6 +72,9 @@ enum at91_soc_type { | |||
71 | /* SAM9X5 */ | 72 | /* SAM9X5 */ |
72 | AT91_SOC_SAM9X5, | 73 | AT91_SOC_SAM9X5, |
73 | 74 | ||
75 | /* SAM9N12 */ | ||
76 | AT91_SOC_SAM9N12, | ||
77 | |||
74 | /* Unknown type */ | 78 | /* Unknown type */ |
75 | AT91_SOC_NONE | 79 | AT91_SOC_NONE |
76 | }; | 80 | }; |
@@ -177,6 +181,12 @@ static inline int at91_soc_is_detected(void) | |||
177 | #define cpu_is_at91sam9x25() (0) | 181 | #define cpu_is_at91sam9x25() (0) |
178 | #endif | 182 | #endif |
179 | 183 | ||
184 | #ifdef CONFIG_SOC_AT91SAM9N12 | ||
185 | #define cpu_is_at91sam9n12() (at91_soc_initdata.type == AT91_SOC_SAM9N12) | ||
186 | #else | ||
187 | #define cpu_is_at91sam9n12() (0) | ||
188 | #endif | ||
189 | |||
180 | /* | 190 | /* |
181 | * Since this is ARM, we will never run on any AVR32 CPU. But these | 191 | * Since this is ARM, we will never run on any AVR32 CPU. But these |
182 | * definitions may reduce clutter in common drivers. | 192 | * definitions may reduce clutter in common drivers. |
diff --git a/arch/arm/mach-at91/include/mach/hardware.h b/arch/arm/mach-at91/include/mach/hardware.h index ef5786299c60..09242b67d277 100644 --- a/arch/arm/mach-at91/include/mach/hardware.h +++ b/arch/arm/mach-at91/include/mach/hardware.h | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <mach/at91sam9rl.h> | 32 | #include <mach/at91sam9rl.h> |
33 | #include <mach/at91sam9g45.h> | 33 | #include <mach/at91sam9g45.h> |
34 | #include <mach/at91sam9x5.h> | 34 | #include <mach/at91sam9x5.h> |
35 | #include <mach/at91sam9n12.h> | ||
35 | 36 | ||
36 | /* | 37 | /* |
37 | * On all at91 except rm9200 and x40 have the System Controller starts | 38 | * On all at91 except rm9200 and x40 have the System Controller starts |
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c index f44a2e7272e3..944bffb08991 100644 --- a/arch/arm/mach-at91/setup.c +++ b/arch/arm/mach-at91/setup.c | |||
@@ -143,6 +143,11 @@ static void __init soc_detect(u32 dbgu_base) | |||
143 | at91_soc_initdata.type = AT91_SOC_SAM9X5; | 143 | at91_soc_initdata.type = AT91_SOC_SAM9X5; |
144 | at91_boot_soc = at91sam9x5_soc; | 144 | at91_boot_soc = at91sam9x5_soc; |
145 | break; | 145 | break; |
146 | |||
147 | case ARCH_ID_AT91SAM9N12: | ||
148 | at91_soc_initdata.type = AT91_SOC_SAM9N12; | ||
149 | at91_boot_soc = at91sam9n12_soc; | ||
150 | break; | ||
146 | } | 151 | } |
147 | 152 | ||
148 | /* at91sam9g10 */ | 153 | /* at91sam9g10 */ |
@@ -210,6 +215,7 @@ static const char *soc_name[] = { | |||
210 | [AT91_SOC_SAM9G45] = "at91sam9g45", | 215 | [AT91_SOC_SAM9G45] = "at91sam9g45", |
211 | [AT91_SOC_SAM9RL] = "at91sam9rl", | 216 | [AT91_SOC_SAM9RL] = "at91sam9rl", |
212 | [AT91_SOC_SAM9X5] = "at91sam9x5", | 217 | [AT91_SOC_SAM9X5] = "at91sam9x5", |
218 | [AT91_SOC_SAM9N12] = "at91sam9n12", | ||
213 | [AT91_SOC_NONE] = "Unknown" | 219 | [AT91_SOC_NONE] = "Unknown" |
214 | }; | 220 | }; |
215 | 221 | ||
diff --git a/arch/arm/mach-at91/soc.h b/arch/arm/mach-at91/soc.h index 683dddfd8b13..a9cfeb153719 100644 --- a/arch/arm/mach-at91/soc.h +++ b/arch/arm/mach-at91/soc.h | |||
@@ -20,6 +20,7 @@ extern struct at91_init_soc at91sam9263_soc; | |||
20 | extern struct at91_init_soc at91sam9g45_soc; | 20 | extern struct at91_init_soc at91sam9g45_soc; |
21 | extern struct at91_init_soc at91sam9rl_soc; | 21 | extern struct at91_init_soc at91sam9rl_soc; |
22 | extern struct at91_init_soc at91sam9x5_soc; | 22 | extern struct at91_init_soc at91sam9x5_soc; |
23 | extern struct at91_init_soc at91sam9n12_soc; | ||
23 | 24 | ||
24 | static inline int at91_soc_is_enabled(void) | 25 | static inline int at91_soc_is_enabled(void) |
25 | { | 26 | { |
@@ -53,3 +54,7 @@ static inline int at91_soc_is_enabled(void) | |||
53 | #if !defined(CONFIG_SOC_AT91SAM9X5) | 54 | #if !defined(CONFIG_SOC_AT91SAM9X5) |
54 | #define at91sam9x5_soc at91_boot_soc | 55 | #define at91sam9x5_soc at91_boot_soc |
55 | #endif | 56 | #endif |
57 | |||
58 | #if !defined(CONFIG_SOC_AT91SAM9N12) | ||
59 | #define at91sam9n12_soc at91_boot_soc | ||
60 | #endif | ||