aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-at91')
-rw-r--r--arch/arm/mach-at91/at91cap9.c2
-rw-r--r--arch/arm/mach-at91/at91rm9200.c1
-rw-r--r--arch/arm/mach-at91/at91sam9260.c2
-rw-r--r--arch/arm/mach-at91/at91sam9261.c2
-rw-r--r--arch/arm/mach-at91/at91sam9263.c3
-rw-r--r--arch/arm/mach-at91/at91sam9g45.c2
-rw-r--r--arch/arm/mach-at91/at91sam9rl.c2
-rw-r--r--arch/arm/mach-at91/board-cam60.c2
-rw-r--r--arch/arm/mach-at91/board-cap9adk.c4
-rw-r--r--arch/arm/mach-at91/board-cpu9krea.c4
-rw-r--r--arch/arm/mach-at91/board-dt.c2
-rw-r--r--arch/arm/mach-at91/board-neocore926.c2
-rw-r--r--arch/arm/mach-at91/board-pcontrol-g20.c4
-rw-r--r--arch/arm/mach-at91/board-qil-a9260.c2
-rw-r--r--arch/arm/mach-at91/board-sam9-l9260.c2
-rw-r--r--arch/arm/mach-at91/board-sam9260ek.c2
-rw-r--r--arch/arm/mach-at91/board-sam9261ek.c4
-rw-r--r--arch/arm/mach-at91/board-sam9263ek.c2
-rw-r--r--arch/arm/mach-at91/board-sam9g20ek.c2
-rw-r--r--arch/arm/mach-at91/board-sam9m10g45ek.c2
-rw-r--r--arch/arm/mach-at91/board-sam9rlek.c2
-rw-r--r--arch/arm/mach-at91/board-snapper9260.c2
-rw-r--r--arch/arm/mach-at91/board-stamp9g20.c2
-rw-r--r--arch/arm/mach-at91/board-usb-a926x.c4
-rw-r--r--arch/arm/mach-at91/include/mach/at91cap9.h2
-rw-r--r--arch/arm/mach-at91/include/mach/at91sam9260.h2
-rw-r--r--arch/arm/mach-at91/include/mach/at91sam9261.h2
-rw-r--r--arch/arm/mach-at91/include/mach/at91sam9263.h4
-rw-r--r--arch/arm/mach-at91/include/mach/at91sam9_smc.h17
-rw-r--r--arch/arm/mach-at91/include/mach/at91sam9g45.h2
-rw-r--r--arch/arm/mach-at91/include/mach/at91sam9rl.h2
-rw-r--r--arch/arm/mach-at91/sam9_smc.c62
-rw-r--r--arch/arm/mach-at91/sam9_smc.h3
33 files changed, 92 insertions, 62 deletions
diff --git a/arch/arm/mach-at91/at91cap9.c b/arch/arm/mach-at91/at91cap9.c
index abfe36858a01..1ea931274bac 100644
--- a/arch/arm/mach-at91/at91cap9.c
+++ b/arch/arm/mach-at91/at91cap9.c
@@ -28,6 +28,7 @@
28#include "soc.h" 28#include "soc.h"
29#include "generic.h" 29#include "generic.h"
30#include "clock.h" 30#include "clock.h"
31#include "sam9_smc.h"
31 32
32/* -------------------------------------------------------------------- 33/* --------------------------------------------------------------------
33 * Clocks 34 * Clocks
@@ -336,6 +337,7 @@ static void __init at91cap9_map_io(void)
336static void __init at91cap9_ioremap_registers(void) 337static void __init at91cap9_ioremap_registers(void)
337{ 338{
338 at91sam926x_ioremap_pit(AT91CAP9_BASE_PIT); 339 at91sam926x_ioremap_pit(AT91CAP9_BASE_PIT);
340 at91sam9_ioremap_smc(0, AT91CAP9_BASE_SMC);
339} 341}
340 342
341static void __init at91cap9_initialize(void) 343static void __init at91cap9_initialize(void)
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index c67d50c9ea20..c06c14fecba4 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -23,6 +23,7 @@
23#include "soc.h" 23#include "soc.h"
24#include "generic.h" 24#include "generic.h"
25#include "clock.h" 25#include "clock.h"
26#include "sam9_smc.h"
26 27
27static struct map_desc at91rm9200_io_desc[] __initdata = { 28static struct map_desc at91rm9200_io_desc[] __initdata = {
28 { 29 {
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
index 0030d5f16ed8..fc1f734b80ce 100644
--- a/arch/arm/mach-at91/at91sam9260.c
+++ b/arch/arm/mach-at91/at91sam9260.c
@@ -26,6 +26,7 @@
26#include "soc.h" 26#include "soc.h"
27#include "generic.h" 27#include "generic.h"
28#include "clock.h" 28#include "clock.h"
29#include "sam9_smc.h"
29 30
30/* -------------------------------------------------------------------- 31/* --------------------------------------------------------------------
31 * Clocks 32 * Clocks
@@ -328,6 +329,7 @@ static void __init at91sam9260_map_io(void)
328static void __init at91sam9260_ioremap_registers(void) 329static void __init at91sam9260_ioremap_registers(void)
329{ 330{
330 at91sam926x_ioremap_pit(AT91SAM9260_BASE_PIT); 331 at91sam926x_ioremap_pit(AT91SAM9260_BASE_PIT);
332 at91sam9_ioremap_smc(0, AT91SAM9260_BASE_SMC);
331} 333}
332 334
333static void __init at91sam9260_initialize(void) 335static void __init at91sam9260_initialize(void)
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index 348d5ae4dee2..804181aedd9e 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -25,6 +25,7 @@
25#include "soc.h" 25#include "soc.h"
26#include "generic.h" 26#include "generic.h"
27#include "clock.h" 27#include "clock.h"
28#include "sam9_smc.h"
28 29
29/* -------------------------------------------------------------------- 30/* --------------------------------------------------------------------
30 * Clocks 31 * Clocks
@@ -288,6 +289,7 @@ static void __init at91sam9261_map_io(void)
288static void __init at91sam9261_ioremap_registers(void) 289static void __init at91sam9261_ioremap_registers(void)
289{ 290{
290 at91sam926x_ioremap_pit(AT91SAM9261_BASE_PIT); 291 at91sam926x_ioremap_pit(AT91SAM9261_BASE_PIT);
292 at91sam9_ioremap_smc(0, AT91SAM9261_BASE_SMC);
291} 293}
292 294
293static void __init at91sam9261_initialize(void) 295static void __init at91sam9261_initialize(void)
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
index 09ccf734c7d7..b8f49962e87f 100644
--- a/arch/arm/mach-at91/at91sam9263.c
+++ b/arch/arm/mach-at91/at91sam9263.c
@@ -24,6 +24,7 @@
24#include "soc.h" 24#include "soc.h"
25#include "generic.h" 25#include "generic.h"
26#include "clock.h" 26#include "clock.h"
27#include "sam9_smc.h"
27 28
28/* -------------------------------------------------------------------- 29/* --------------------------------------------------------------------
29 * Clocks 30 * Clocks
@@ -306,6 +307,8 @@ static void __init at91sam9263_map_io(void)
306static void __init at91sam9263_ioremap_registers(void) 307static void __init at91sam9263_ioremap_registers(void)
307{ 308{
308 at91sam926x_ioremap_pit(AT91SAM9263_BASE_PIT); 309 at91sam926x_ioremap_pit(AT91SAM9263_BASE_PIT);
310 at91sam9_ioremap_smc(0, AT91SAM9263_BASE_SMC0);
311 at91sam9_ioremap_smc(1, AT91SAM9263_BASE_SMC1);
309} 312}
310 313
311static void __init at91sam9263_initialize(void) 314static void __init at91sam9263_initialize(void)
diff --git a/arch/arm/mach-at91/at91sam9g45.c b/arch/arm/mach-at91/at91sam9g45.c
index aa8b4414f3ed..ce3233f22ed1 100644
--- a/arch/arm/mach-at91/at91sam9g45.c
+++ b/arch/arm/mach-at91/at91sam9g45.c
@@ -26,6 +26,7 @@
26#include "soc.h" 26#include "soc.h"
27#include "generic.h" 27#include "generic.h"
28#include "clock.h" 28#include "clock.h"
29#include "sam9_smc.h"
29 30
30/* -------------------------------------------------------------------- 31/* --------------------------------------------------------------------
31 * Clocks 32 * Clocks
@@ -341,6 +342,7 @@ static void __init at91sam9g45_map_io(void)
341static void __init at91sam9g45_ioremap_registers(void) 342static void __init at91sam9g45_ioremap_registers(void)
342{ 343{
343 at91sam926x_ioremap_pit(AT91SAM9G45_BASE_PIT); 344 at91sam926x_ioremap_pit(AT91SAM9G45_BASE_PIT);
345 at91sam9_ioremap_smc(0, AT91SAM9G45_BASE_SMC);
344} 346}
345 347
346static void __init at91sam9g45_initialize(void) 348static void __init at91sam9g45_initialize(void)
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
index 291fc9983cc3..1bcccd705296 100644
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ b/arch/arm/mach-at91/at91sam9rl.c
@@ -25,6 +25,7 @@
25#include "soc.h" 25#include "soc.h"
26#include "generic.h" 26#include "generic.h"
27#include "clock.h" 27#include "clock.h"
28#include "sam9_smc.h"
28 29
29/* -------------------------------------------------------------------- 30/* --------------------------------------------------------------------
30 * Clocks 31 * Clocks
@@ -293,6 +294,7 @@ static void __init at91sam9rl_map_io(void)
293static void __init at91sam9rl_ioremap_registers(void) 294static void __init at91sam9rl_ioremap_registers(void)
294{ 295{
295 at91sam926x_ioremap_pit(AT91SAM9RL_BASE_PIT); 296 at91sam926x_ioremap_pit(AT91SAM9RL_BASE_PIT);
297 at91sam9_ioremap_smc(0, AT91SAM9RL_BASE_SMC);
296} 298}
297 299
298static void __init at91sam9rl_initialize(void) 300static void __init at91sam9rl_initialize(void)
diff --git a/arch/arm/mach-at91/board-cam60.c b/arch/arm/mach-at91/board-cam60.c
index f90cfb32bad2..02ded92de5b7 100644
--- a/arch/arm/mach-at91/board-cam60.c
+++ b/arch/arm/mach-at91/board-cam60.c
@@ -163,7 +163,7 @@ static struct sam9_smc_config __initdata cam60_nand_smc_config = {
163static void __init cam60_add_device_nand(void) 163static void __init cam60_add_device_nand(void)
164{ 164{
165 /* configure chip-select 3 (NAND) */ 165 /* configure chip-select 3 (NAND) */
166 sam9_smc_configure(3, &cam60_nand_smc_config); 166 sam9_smc_configure(0, 3, &cam60_nand_smc_config);
167 167
168 at91_add_device_nand(&cam60_nand_data); 168 at91_add_device_nand(&cam60_nand_data);
169} 169}
diff --git a/arch/arm/mach-at91/board-cap9adk.c b/arch/arm/mach-at91/board-cap9adk.c
index 5dffd3be62d2..da2616f20e10 100644
--- a/arch/arm/mach-at91/board-cap9adk.c
+++ b/arch/arm/mach-at91/board-cap9adk.c
@@ -212,7 +212,7 @@ static void __init cap9adk_add_device_nand(void)
212 cap9adk_nand_smc_config.mode |= AT91_SMC_DBW_8; 212 cap9adk_nand_smc_config.mode |= AT91_SMC_DBW_8;
213 213
214 /* configure chip-select 3 (NAND) */ 214 /* configure chip-select 3 (NAND) */
215 sam9_smc_configure(3, &cap9adk_nand_smc_config); 215 sam9_smc_configure(0, 3, &cap9adk_nand_smc_config);
216 216
217 at91_add_device_nand(&cap9adk_nand_data); 217 at91_add_device_nand(&cap9adk_nand_data);
218} 218}
@@ -282,7 +282,7 @@ static __init void cap9adk_add_device_nor(void)
282 at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_EBI_VDDIOMSEL_3_3V); 282 at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_EBI_VDDIOMSEL_3_3V);
283 283
284 /* configure chip-select 0 (NOR) */ 284 /* configure chip-select 0 (NOR) */
285 sam9_smc_configure(0, &cap9adk_nor_smc_config); 285 sam9_smc_configure(0, 0, &cap9adk_nor_smc_config);
286 286
287 platform_device_register(&cap9adk_nor_flash); 287 platform_device_register(&cap9adk_nor_flash);
288} 288}
diff --git a/arch/arm/mach-at91/board-cpu9krea.c b/arch/arm/mach-at91/board-cpu9krea.c
index fc885a4ce243..7dd752e32e2a 100644
--- a/arch/arm/mach-at91/board-cpu9krea.c
+++ b/arch/arm/mach-at91/board-cpu9krea.c
@@ -156,7 +156,7 @@ static struct sam9_smc_config __initdata cpu9krea_nand_smc_config = {
156 156
157static void __init cpu9krea_add_device_nand(void) 157static void __init cpu9krea_add_device_nand(void)
158{ 158{
159 sam9_smc_configure(3, &cpu9krea_nand_smc_config); 159 sam9_smc_configure(0, 3, &cpu9krea_nand_smc_config);
160 at91_add_device_nand(&cpu9krea_nand_data); 160 at91_add_device_nand(&cpu9krea_nand_data);
161} 161}
162 162
@@ -238,7 +238,7 @@ static __init void cpu9krea_add_device_nor(void)
238 at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_VDDIOMSEL_3_3V); 238 at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_VDDIOMSEL_3_3V);
239 239
240 /* configure chip-select 0 (NOR) */ 240 /* configure chip-select 0 (NOR) */
241 sam9_smc_configure(0, &cpu9krea_nor_smc_config); 241 sam9_smc_configure(0, 0, &cpu9krea_nor_smc_config);
242 242
243 platform_device_register(&cpu9krea_nor_flash); 243 platform_device_register(&cpu9krea_nor_flash);
244} 244}
diff --git a/arch/arm/mach-at91/board-dt.c b/arch/arm/mach-at91/board-dt.c
index 0b7d32778210..41d84d9a2316 100644
--- a/arch/arm/mach-at91/board-dt.c
+++ b/arch/arm/mach-at91/board-dt.c
@@ -82,7 +82,7 @@ static void __init ek_add_device_nand(void)
82 ek_nand_smc_config.mode |= AT91_SMC_DBW_8; 82 ek_nand_smc_config.mode |= AT91_SMC_DBW_8;
83 83
84 /* configure chip-select 3 (NAND) */ 84 /* configure chip-select 3 (NAND) */
85 sam9_smc_configure(3, &ek_nand_smc_config); 85 sam9_smc_configure(0, 3, &ek_nand_smc_config);
86 86
87 at91_add_device_nand(&ek_nand_data); 87 at91_add_device_nand(&ek_nand_data);
88} 88}
diff --git a/arch/arm/mach-at91/board-neocore926.c b/arch/arm/mach-at91/board-neocore926.c
index ef816c17dc61..a9b9adc78c1d 100644
--- a/arch/arm/mach-at91/board-neocore926.c
+++ b/arch/arm/mach-at91/board-neocore926.c
@@ -213,7 +213,7 @@ static struct sam9_smc_config __initdata neocore926_nand_smc_config = {
213static void __init neocore926_add_device_nand(void) 213static void __init neocore926_add_device_nand(void)
214{ 214{
215 /* configure chip-select 3 (NAND) */ 215 /* configure chip-select 3 (NAND) */
216 sam9_smc_configure(3, &neocore926_nand_smc_config); 216 sam9_smc_configure(0, 3, &neocore926_nand_smc_config);
217 217
218 at91_add_device_nand(&neocore926_nand_data); 218 at91_add_device_nand(&neocore926_nand_data);
219} 219}
diff --git a/arch/arm/mach-at91/board-pcontrol-g20.c b/arch/arm/mach-at91/board-pcontrol-g20.c
index 49e3f699b48e..0e3c632d30eb 100644
--- a/arch/arm/mach-at91/board-pcontrol-g20.c
+++ b/arch/arm/mach-at91/board-pcontrol-g20.c
@@ -96,9 +96,9 @@ static struct sam9_smc_config __initdata pcontrol_smc_config[2] = { {
96static void __init add_device_pcontrol(void) 96static void __init add_device_pcontrol(void)
97{ 97{
98 /* configure chip-select 4 (IO compatible to 8051 X4 ) */ 98 /* configure chip-select 4 (IO compatible to 8051 X4 ) */
99 sam9_smc_configure(4, &pcontrol_smc_config[0]); 99 sam9_smc_configure(0, 4, &pcontrol_smc_config[0]);
100 /* configure chip-select 7 (FerroRAM 256KiBx16bit MR2A16A D4 ) */ 100 /* configure chip-select 7 (FerroRAM 256KiBx16bit MR2A16A D4 ) */
101 sam9_smc_configure(7, &pcontrol_smc_config[1]); 101 sam9_smc_configure(0, 7, &pcontrol_smc_config[1]);
102} 102}
103 103
104 104
diff --git a/arch/arm/mach-at91/board-qil-a9260.c b/arch/arm/mach-at91/board-qil-a9260.c
index 07421bdb88ea..89d44c037291 100644
--- a/arch/arm/mach-at91/board-qil-a9260.c
+++ b/arch/arm/mach-at91/board-qil-a9260.c
@@ -161,7 +161,7 @@ static struct sam9_smc_config __initdata ek_nand_smc_config = {
161static void __init ek_add_device_nand(void) 161static void __init ek_add_device_nand(void)
162{ 162{
163 /* configure chip-select 3 (NAND) */ 163 /* configure chip-select 3 (NAND) */
164 sam9_smc_configure(3, &ek_nand_smc_config); 164 sam9_smc_configure(0, 3, &ek_nand_smc_config);
165 165
166 at91_add_device_nand(&ek_nand_data); 166 at91_add_device_nand(&ek_nand_data);
167} 167}
diff --git a/arch/arm/mach-at91/board-sam9-l9260.c b/arch/arm/mach-at91/board-sam9-l9260.c
index 072d53af98d9..e0283c57f467 100644
--- a/arch/arm/mach-at91/board-sam9-l9260.c
+++ b/arch/arm/mach-at91/board-sam9-l9260.c
@@ -162,7 +162,7 @@ static struct sam9_smc_config __initdata ek_nand_smc_config = {
162static void __init ek_add_device_nand(void) 162static void __init ek_add_device_nand(void)
163{ 163{
164 /* configure chip-select 3 (NAND) */ 164 /* configure chip-select 3 (NAND) */
165 sam9_smc_configure(3, &ek_nand_smc_config); 165 sam9_smc_configure(0, 3, &ek_nand_smc_config);
166 166
167 at91_add_device_nand(&ek_nand_data); 167 at91_add_device_nand(&ek_nand_data);
168} 168}
diff --git a/arch/arm/mach-at91/board-sam9260ek.c b/arch/arm/mach-at91/board-sam9260ek.c
index 4f10181a0782..00db0f8e34b6 100644
--- a/arch/arm/mach-at91/board-sam9260ek.c
+++ b/arch/arm/mach-at91/board-sam9260ek.c
@@ -211,7 +211,7 @@ static void __init ek_add_device_nand(void)
211 ek_nand_smc_config.mode |= AT91_SMC_DBW_8; 211 ek_nand_smc_config.mode |= AT91_SMC_DBW_8;
212 212
213 /* configure chip-select 3 (NAND) */ 213 /* configure chip-select 3 (NAND) */
214 sam9_smc_configure(3, &ek_nand_smc_config); 214 sam9_smc_configure(0, 3, &ek_nand_smc_config);
215 215
216 at91_add_device_nand(&ek_nand_data); 216 at91_add_device_nand(&ek_nand_data);
217} 217}
diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c
index b005b738e8ff..a879b3398f38 100644
--- a/arch/arm/mach-at91/board-sam9261ek.c
+++ b/arch/arm/mach-at91/board-sam9261ek.c
@@ -131,7 +131,7 @@ static struct sam9_smc_config __initdata dm9000_smc_config = {
131static void __init ek_add_device_dm9000(void) 131static void __init ek_add_device_dm9000(void)
132{ 132{
133 /* Configure chip-select 2 (DM9000) */ 133 /* Configure chip-select 2 (DM9000) */
134 sam9_smc_configure(2, &dm9000_smc_config); 134 sam9_smc_configure(0, 2, &dm9000_smc_config);
135 135
136 /* Configure Reset signal as output */ 136 /* Configure Reset signal as output */
137 at91_set_gpio_output(AT91_PIN_PC10, 0); 137 at91_set_gpio_output(AT91_PIN_PC10, 0);
@@ -217,7 +217,7 @@ static void __init ek_add_device_nand(void)
217 ek_nand_smc_config.mode |= AT91_SMC_DBW_8; 217 ek_nand_smc_config.mode |= AT91_SMC_DBW_8;
218 218
219 /* configure chip-select 3 (NAND) */ 219 /* configure chip-select 3 (NAND) */
220 sam9_smc_configure(3, &ek_nand_smc_config); 220 sam9_smc_configure(0, 3, &ek_nand_smc_config);
221 221
222 at91_add_device_nand(&ek_nand_data); 222 at91_add_device_nand(&ek_nand_data);
223} 223}
diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c
index bccdcf23caa1..7b25ca10d9d5 100644
--- a/arch/arm/mach-at91/board-sam9263ek.c
+++ b/arch/arm/mach-at91/board-sam9263ek.c
@@ -218,7 +218,7 @@ static void __init ek_add_device_nand(void)
218 ek_nand_smc_config.mode |= AT91_SMC_DBW_8; 218 ek_nand_smc_config.mode |= AT91_SMC_DBW_8;
219 219
220 /* configure chip-select 3 (NAND) */ 220 /* configure chip-select 3 (NAND) */
221 sam9_smc_configure(3, &ek_nand_smc_config); 221 sam9_smc_configure(0, 3, &ek_nand_smc_config);
222 222
223 at91_add_device_nand(&ek_nand_data); 223 at91_add_device_nand(&ek_nand_data);
224} 224}
diff --git a/arch/arm/mach-at91/board-sam9g20ek.c b/arch/arm/mach-at91/board-sam9g20ek.c
index 64fc75c9d0ac..0579f069d97b 100644
--- a/arch/arm/mach-at91/board-sam9g20ek.c
+++ b/arch/arm/mach-at91/board-sam9g20ek.c
@@ -195,7 +195,7 @@ static void __init ek_add_device_nand(void)
195 ek_nand_smc_config.mode |= AT91_SMC_DBW_8; 195 ek_nand_smc_config.mode |= AT91_SMC_DBW_8;
196 196
197 /* configure chip-select 3 (NAND) */ 197 /* configure chip-select 3 (NAND) */
198 sam9_smc_configure(3, &ek_nand_smc_config); 198 sam9_smc_configure(0, 3, &ek_nand_smc_config);
199 199
200 at91_add_device_nand(&ek_nand_data); 200 at91_add_device_nand(&ek_nand_data);
201} 201}
diff --git a/arch/arm/mach-at91/board-sam9m10g45ek.c b/arch/arm/mach-at91/board-sam9m10g45ek.c
index 92de9127923a..3e0d5a91f782 100644
--- a/arch/arm/mach-at91/board-sam9m10g45ek.c
+++ b/arch/arm/mach-at91/board-sam9m10g45ek.c
@@ -175,7 +175,7 @@ static void __init ek_add_device_nand(void)
175 ek_nand_smc_config.mode |= AT91_SMC_DBW_8; 175 ek_nand_smc_config.mode |= AT91_SMC_DBW_8;
176 176
177 /* configure chip-select 3 (NAND) */ 177 /* configure chip-select 3 (NAND) */
178 sam9_smc_configure(3, &ek_nand_smc_config); 178 sam9_smc_configure(0, 3, &ek_nand_smc_config);
179 179
180 at91_add_device_nand(&ek_nand_data); 180 at91_add_device_nand(&ek_nand_data);
181} 181}
diff --git a/arch/arm/mach-at91/board-sam9rlek.c b/arch/arm/mach-at91/board-sam9rlek.c
index b2b748239f36..c561edac25b9 100644
--- a/arch/arm/mach-at91/board-sam9rlek.c
+++ b/arch/arm/mach-at91/board-sam9rlek.c
@@ -119,7 +119,7 @@ static struct sam9_smc_config __initdata ek_nand_smc_config = {
119static void __init ek_add_device_nand(void) 119static void __init ek_add_device_nand(void)
120{ 120{
121 /* configure chip-select 3 (NAND) */ 121 /* configure chip-select 3 (NAND) */
122 sam9_smc_configure(3, &ek_nand_smc_config); 122 sam9_smc_configure(0, 3, &ek_nand_smc_config);
123 123
124 at91_add_device_nand(&ek_nand_data); 124 at91_add_device_nand(&ek_nand_data);
125} 125}
diff --git a/arch/arm/mach-at91/board-snapper9260.c b/arch/arm/mach-at91/board-snapper9260.c
index 0df01c6e2d0c..645d8336468e 100644
--- a/arch/arm/mach-at91/board-snapper9260.c
+++ b/arch/arm/mach-at91/board-snapper9260.c
@@ -149,7 +149,7 @@ static struct i2c_board_info __initdata snapper9260_i2c_devices[] = {
149static void __init snapper9260_add_device_nand(void) 149static void __init snapper9260_add_device_nand(void)
150{ 150{
151 at91_set_A_periph(AT91_PIN_PC14, 0); 151 at91_set_A_periph(AT91_PIN_PC14, 0);
152 sam9_smc_configure(3, &snapper9260_nand_smc_config); 152 sam9_smc_configure(0, 3, &snapper9260_nand_smc_config);
153 at91_add_device_nand(&snapper9260_nand_data); 153 at91_add_device_nand(&snapper9260_nand_data);
154} 154}
155 155
diff --git a/arch/arm/mach-at91/board-stamp9g20.c b/arch/arm/mach-at91/board-stamp9g20.c
index 936e5fd7f406..f94ac865da53 100644
--- a/arch/arm/mach-at91/board-stamp9g20.c
+++ b/arch/arm/mach-at91/board-stamp9g20.c
@@ -108,7 +108,7 @@ static struct sam9_smc_config __initdata nand_smc_config = {
108static void __init add_device_nand(void) 108static void __init add_device_nand(void)
109{ 109{
110 /* configure chip-select 3 (NAND) */ 110 /* configure chip-select 3 (NAND) */
111 sam9_smc_configure(3, &nand_smc_config); 111 sam9_smc_configure(0, 3, &nand_smc_config);
112 112
113 at91_add_device_nand(&nand_data); 113 at91_add_device_nand(&nand_data);
114} 114}
diff --git a/arch/arm/mach-at91/board-usb-a926x.c b/arch/arm/mach-at91/board-usb-a926x.c
index 0a20bab21f99..6f893cf4d336 100644
--- a/arch/arm/mach-at91/board-usb-a926x.c
+++ b/arch/arm/mach-at91/board-usb-a926x.c
@@ -245,9 +245,9 @@ static void __init ek_add_device_nand(void)
245 245
246 /* configure chip-select 3 (NAND) */ 246 /* configure chip-select 3 (NAND) */
247 if (machine_is_usb_a9g20()) 247 if (machine_is_usb_a9g20())
248 sam9_smc_configure(3, &usb_a9g20_nand_smc_config); 248 sam9_smc_configure(0, 3, &usb_a9g20_nand_smc_config);
249 else 249 else
250 sam9_smc_configure(3, &usb_a9260_nand_smc_config); 250 sam9_smc_configure(0, 3, &usb_a9260_nand_smc_config);
251 251
252 at91_add_device_nand(&ek_nand_data); 252 at91_add_device_nand(&ek_nand_data);
253} 253}
diff --git a/arch/arm/mach-at91/include/mach/at91cap9.h b/arch/arm/mach-at91/include/mach/at91cap9.h
index ad8d298cf8ba..d7d0b685668f 100644
--- a/arch/arm/mach-at91/include/mach/at91cap9.h
+++ b/arch/arm/mach-at91/include/mach/at91cap9.h
@@ -81,7 +81,6 @@
81 */ 81 */
82#define AT91_BCRAMC (0xffffe400 - AT91_BASE_SYS) 82#define AT91_BCRAMC (0xffffe400 - AT91_BASE_SYS)
83#define AT91_DDRSDRC0 (0xffffe600 - AT91_BASE_SYS) 83#define AT91_DDRSDRC0 (0xffffe600 - AT91_BASE_SYS)
84#define AT91_SMC (0xffffe800 - AT91_BASE_SYS)
85#define AT91_MATRIX (0xffffea00 - AT91_BASE_SYS) 84#define AT91_MATRIX (0xffffea00 - AT91_BASE_SYS)
86#define AT91_CCFG (0xffffeb10 - AT91_BASE_SYS) 85#define AT91_CCFG (0xffffeb10 - AT91_BASE_SYS)
87#define AT91_DBGU (0xffffee00 - AT91_BASE_SYS) 86#define AT91_DBGU (0xffffee00 - AT91_BASE_SYS)
@@ -96,6 +95,7 @@
96 95
97#define AT91CAP9_BASE_ECC 0xffffe200 96#define AT91CAP9_BASE_ECC 0xffffe200
98#define AT91CAP9_BASE_DMA 0xffffec00 97#define AT91CAP9_BASE_DMA 0xffffec00
98#define AT91CAP9_BASE_SMC 0xffffe800
99#define AT91CAP9_BASE_PIOA 0xfffff200 99#define AT91CAP9_BASE_PIOA 0xfffff200
100#define AT91CAP9_BASE_PIOB 0xfffff400 100#define AT91CAP9_BASE_PIOB 0xfffff400
101#define AT91CAP9_BASE_PIOC 0xfffff600 101#define AT91CAP9_BASE_PIOC 0xfffff600
diff --git a/arch/arm/mach-at91/include/mach/at91sam9260.h b/arch/arm/mach-at91/include/mach/at91sam9260.h
index b8c85dc4abce..e55ab6abcdbf 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9260.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9260.h
@@ -81,7 +81,6 @@
81 * System Peripherals (offset from AT91_BASE_SYS) 81 * System Peripherals (offset from AT91_BASE_SYS)
82 */ 82 */
83#define AT91_SDRAMC0 (0xffffea00 - AT91_BASE_SYS) 83#define AT91_SDRAMC0 (0xffffea00 - AT91_BASE_SYS)
84#define AT91_SMC (0xffffec00 - AT91_BASE_SYS)
85#define AT91_MATRIX (0xffffee00 - AT91_BASE_SYS) 84#define AT91_MATRIX (0xffffee00 - AT91_BASE_SYS)
86#define AT91_CCFG (0xffffef10 - AT91_BASE_SYS) 85#define AT91_CCFG (0xffffef10 - AT91_BASE_SYS)
87#define AT91_AIC (0xfffff000 - AT91_BASE_SYS) 86#define AT91_AIC (0xfffff000 - AT91_BASE_SYS)
@@ -93,6 +92,7 @@
93#define AT91_GPBR (0xfffffd50 - AT91_BASE_SYS) 92#define AT91_GPBR (0xfffffd50 - AT91_BASE_SYS)
94 93
95#define AT91SAM9260_BASE_ECC 0xffffe800 94#define AT91SAM9260_BASE_ECC 0xffffe800
95#define AT91SAM9260_BASE_SMC 0xffffec00
96#define AT91SAM9260_BASE_PIOA 0xfffff400 96#define AT91SAM9260_BASE_PIOA 0xfffff400
97#define AT91SAM9260_BASE_PIOB 0xfffff600 97#define AT91SAM9260_BASE_PIOB 0xfffff600
98#define AT91SAM9260_BASE_PIOC 0xfffff800 98#define AT91SAM9260_BASE_PIOC 0xfffff800
diff --git a/arch/arm/mach-at91/include/mach/at91sam9261.h b/arch/arm/mach-at91/include/mach/at91sam9261.h
index 0dccaff5212e..1ea2d6b06c81 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9261.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9261.h
@@ -66,7 +66,6 @@
66 * System Peripherals (offset from AT91_BASE_SYS) 66 * System Peripherals (offset from AT91_BASE_SYS)
67 */ 67 */
68#define AT91_SDRAMC0 (0xffffea00 - AT91_BASE_SYS) 68#define AT91_SDRAMC0 (0xffffea00 - AT91_BASE_SYS)
69#define AT91_SMC (0xffffec00 - AT91_BASE_SYS)
70#define AT91_MATRIX (0xffffee00 - AT91_BASE_SYS) 69#define AT91_MATRIX (0xffffee00 - AT91_BASE_SYS)
71#define AT91_AIC (0xfffff000 - AT91_BASE_SYS) 70#define AT91_AIC (0xfffff000 - AT91_BASE_SYS)
72#define AT91_DBGU (0xfffff200 - AT91_BASE_SYS) 71#define AT91_DBGU (0xfffff200 - AT91_BASE_SYS)
@@ -76,6 +75,7 @@
76#define AT91_WDT (0xfffffd40 - AT91_BASE_SYS) 75#define AT91_WDT (0xfffffd40 - AT91_BASE_SYS)
77#define AT91_GPBR (0xfffffd50 - AT91_BASE_SYS) 76#define AT91_GPBR (0xfffffd50 - AT91_BASE_SYS)
78 77
78#define AT91SAM9261_BASE_SMC 0xffffec00
79#define AT91SAM9261_BASE_PIOA 0xfffff400 79#define AT91SAM9261_BASE_PIOA 0xfffff400
80#define AT91SAM9261_BASE_PIOB 0xfffff600 80#define AT91SAM9261_BASE_PIOB 0xfffff600
81#define AT91SAM9261_BASE_PIOC 0xfffff800 81#define AT91SAM9261_BASE_PIOC 0xfffff800
diff --git a/arch/arm/mach-at91/include/mach/at91sam9263.h b/arch/arm/mach-at91/include/mach/at91sam9263.h
index 735408e6d2e6..b827ff7974b2 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9263.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9263.h
@@ -75,9 +75,7 @@
75 * System Peripherals (offset from AT91_BASE_SYS) 75 * System Peripherals (offset from AT91_BASE_SYS)
76 */ 76 */
77#define AT91_SDRAMC0 (0xffffe200 - AT91_BASE_SYS) 77#define AT91_SDRAMC0 (0xffffe200 - AT91_BASE_SYS)
78#define AT91_SMC0 (0xffffe400 - AT91_BASE_SYS)
79#define AT91_SDRAMC1 (0xffffe800 - AT91_BASE_SYS) 78#define AT91_SDRAMC1 (0xffffe800 - AT91_BASE_SYS)
80#define AT91_SMC1 (0xffffea00 - AT91_BASE_SYS)
81#define AT91_MATRIX (0xffffec00 - AT91_BASE_SYS) 79#define AT91_MATRIX (0xffffec00 - AT91_BASE_SYS)
82#define AT91_CCFG (0xffffed10 - AT91_BASE_SYS) 80#define AT91_CCFG (0xffffed10 - AT91_BASE_SYS)
83#define AT91_DBGU (0xffffee00 - AT91_BASE_SYS) 81#define AT91_DBGU (0xffffee00 - AT91_BASE_SYS)
@@ -89,7 +87,9 @@
89#define AT91_GPBR (0xfffffd60 - AT91_BASE_SYS) 87#define AT91_GPBR (0xfffffd60 - AT91_BASE_SYS)
90 88
91#define AT91SAM9263_BASE_ECC0 0xffffe000 89#define AT91SAM9263_BASE_ECC0 0xffffe000
90#define AT91SAM9263_BASE_SMC0 0xffffe400
92#define AT91SAM9263_BASE_ECC1 0xffffe600 91#define AT91SAM9263_BASE_ECC1 0xffffe600
92#define AT91SAM9263_BASE_SMC1 0xffffea00
93#define AT91SAM9263_BASE_PIOA 0xfffff200 93#define AT91SAM9263_BASE_PIOA 0xfffff200
94#define AT91SAM9263_BASE_PIOB 0xfffff400 94#define AT91SAM9263_BASE_PIOB 0xfffff400
95#define AT91SAM9263_BASE_PIOC 0xfffff600 95#define AT91SAM9263_BASE_PIOC 0xfffff600
diff --git a/arch/arm/mach-at91/include/mach/at91sam9_smc.h b/arch/arm/mach-at91/include/mach/at91sam9_smc.h
index 57de6207e57e..eb18a70fa647 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9_smc.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9_smc.h
@@ -16,7 +16,9 @@
16#ifndef AT91SAM9_SMC_H 16#ifndef AT91SAM9_SMC_H
17#define AT91SAM9_SMC_H 17#define AT91SAM9_SMC_H
18 18
19#define AT91_SMC_SETUP(n) (AT91_SMC + 0x00 + ((n)*0x10)) /* Setup Register for CS n */ 19#include <mach/cpu.h>
20
21#define AT91_SMC_SETUP 0x00 /* Setup Register for CS n */
20#define AT91_SMC_NWESETUP (0x3f << 0) /* NWE Setup Length */ 22#define AT91_SMC_NWESETUP (0x3f << 0) /* NWE Setup Length */
21#define AT91_SMC_NWESETUP_(x) ((x) << 0) 23#define AT91_SMC_NWESETUP_(x) ((x) << 0)
22#define AT91_SMC_NCS_WRSETUP (0x3f << 8) /* NCS Setup Length in Write Access */ 24#define AT91_SMC_NCS_WRSETUP (0x3f << 8) /* NCS Setup Length in Write Access */
@@ -26,7 +28,7 @@
26#define AT91_SMC_NCS_RDSETUP (0x3f << 24) /* NCS Setup Length in Read Access */ 28#define AT91_SMC_NCS_RDSETUP (0x3f << 24) /* NCS Setup Length in Read Access */
27#define AT91_SMC_NCS_RDSETUP_(x) ((x) << 24) 29#define AT91_SMC_NCS_RDSETUP_(x) ((x) << 24)
28 30
29#define AT91_SMC_PULSE(n) (AT91_SMC + 0x04 + ((n)*0x10)) /* Pulse Register for CS n */ 31#define AT91_SMC_PULSE 0x04 /* Pulse Register for CS n */
30#define AT91_SMC_NWEPULSE (0x7f << 0) /* NWE Pulse Length */ 32#define AT91_SMC_NWEPULSE (0x7f << 0) /* NWE Pulse Length */
31#define AT91_SMC_NWEPULSE_(x) ((x) << 0) 33#define AT91_SMC_NWEPULSE_(x) ((x) << 0)
32#define AT91_SMC_NCS_WRPULSE (0x7f << 8) /* NCS Pulse Length in Write Access */ 34#define AT91_SMC_NCS_WRPULSE (0x7f << 8) /* NCS Pulse Length in Write Access */
@@ -36,13 +38,13 @@
36#define AT91_SMC_NCS_RDPULSE (0x7f << 24) /* NCS Pulse Length in Read Access */ 38#define AT91_SMC_NCS_RDPULSE (0x7f << 24) /* NCS Pulse Length in Read Access */
37#define AT91_SMC_NCS_RDPULSE_(x)((x) << 24) 39#define AT91_SMC_NCS_RDPULSE_(x)((x) << 24)
38 40
39#define AT91_SMC_CYCLE(n) (AT91_SMC + 0x08 + ((n)*0x10)) /* Cycle Register for CS n */ 41#define AT91_SMC_CYCLE 0x08 /* Cycle Register for CS n */
40#define AT91_SMC_NWECYCLE (0x1ff << 0 ) /* Total Write Cycle Length */ 42#define AT91_SMC_NWECYCLE (0x1ff << 0 ) /* Total Write Cycle Length */
41#define AT91_SMC_NWECYCLE_(x) ((x) << 0) 43#define AT91_SMC_NWECYCLE_(x) ((x) << 0)
42#define AT91_SMC_NRDCYCLE (0x1ff << 16) /* Total Read Cycle Length */ 44#define AT91_SMC_NRDCYCLE (0x1ff << 16) /* Total Read Cycle Length */
43#define AT91_SMC_NRDCYCLE_(x) ((x) << 16) 45#define AT91_SMC_NRDCYCLE_(x) ((x) << 16)
44 46
45#define AT91_SMC_MODE(n) (AT91_SMC + 0x0c + ((n)*0x10)) /* Mode Register for CS n */ 47#define AT91_SMC_MODE 0x0c /* Mode Register for CS n */
46#define AT91_SMC_READMODE (1 << 0) /* Read Mode */ 48#define AT91_SMC_READMODE (1 << 0) /* Read Mode */
47#define AT91_SMC_WRITEMODE (1 << 1) /* Write Mode */ 49#define AT91_SMC_WRITEMODE (1 << 1) /* Write Mode */
48#define AT91_SMC_EXNWMODE (3 << 4) /* NWAIT Mode */ 50#define AT91_SMC_EXNWMODE (3 << 4) /* NWAIT Mode */
@@ -66,11 +68,4 @@
66#define AT91_SMC_PS_16 (2 << 28) 68#define AT91_SMC_PS_16 (2 << 28)
67#define AT91_SMC_PS_32 (3 << 28) 69#define AT91_SMC_PS_32 (3 << 28)
68 70
69#if defined(AT91_SMC1) /* The AT91SAM9263 has 2 Static Memory contollers */
70#define AT91_SMC1_SETUP(n) (AT91_SMC1 + 0x00 + ((n)*0x10)) /* Setup Register for CS n */
71#define AT91_SMC1_PULSE(n) (AT91_SMC1 + 0x04 + ((n)*0x10)) /* Pulse Register for CS n */
72#define AT91_SMC1_CYCLE(n) (AT91_SMC1 + 0x08 + ((n)*0x10)) /* Cycle Register for CS n */
73#define AT91_SMC1_MODE(n) (AT91_SMC1 + 0x0c + ((n)*0x10)) /* Mode Register for CS n */
74#endif
75
76#endif 71#endif
diff --git a/arch/arm/mach-at91/include/mach/at91sam9g45.h b/arch/arm/mach-at91/include/mach/at91sam9g45.h
index ba609f3872fd..ac051d427e6b 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9g45.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9g45.h
@@ -88,7 +88,6 @@
88 */ 88 */
89#define AT91_DDRSDRC1 (0xffffe400 - AT91_BASE_SYS) 89#define AT91_DDRSDRC1 (0xffffe400 - AT91_BASE_SYS)
90#define AT91_DDRSDRC0 (0xffffe600 - AT91_BASE_SYS) 90#define AT91_DDRSDRC0 (0xffffe600 - AT91_BASE_SYS)
91#define AT91_SMC (0xffffe800 - AT91_BASE_SYS)
92#define AT91_MATRIX (0xffffea00 - AT91_BASE_SYS) 91#define AT91_MATRIX (0xffffea00 - AT91_BASE_SYS)
93#define AT91_DBGU (0xffffee00 - AT91_BASE_SYS) 92#define AT91_DBGU (0xffffee00 - AT91_BASE_SYS)
94#define AT91_AIC (0xfffff000 - AT91_BASE_SYS) 93#define AT91_AIC (0xfffff000 - AT91_BASE_SYS)
@@ -101,6 +100,7 @@
101 100
102#define AT91SAM9G45_BASE_ECC 0xffffe200 101#define AT91SAM9G45_BASE_ECC 0xffffe200
103#define AT91SAM9G45_BASE_DMA 0xffffec00 102#define AT91SAM9G45_BASE_DMA 0xffffec00
103#define AT91SAM9G45_BASE_SMC 0xffffe800
104#define AT91SAM9G45_BASE_PIOA 0xfffff200 104#define AT91SAM9G45_BASE_PIOA 0xfffff200
105#define AT91SAM9G45_BASE_PIOB 0xfffff400 105#define AT91SAM9G45_BASE_PIOB 0xfffff400
106#define AT91SAM9G45_BASE_PIOC 0xfffff600 106#define AT91SAM9G45_BASE_PIOC 0xfffff600
diff --git a/arch/arm/mach-at91/include/mach/at91sam9rl.h b/arch/arm/mach-at91/include/mach/at91sam9rl.h
index bab09a745d2b..846139ddf06a 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9rl.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9rl.h
@@ -70,7 +70,6 @@
70 * System Peripherals (offset from AT91_BASE_SYS) 70 * System Peripherals (offset from AT91_BASE_SYS)
71 */ 71 */
72#define AT91_SDRAMC0 (0xffffea00 - AT91_BASE_SYS) 72#define AT91_SDRAMC0 (0xffffea00 - AT91_BASE_SYS)
73#define AT91_SMC (0xffffec00 - AT91_BASE_SYS)
74#define AT91_MATRIX (0xffffee00 - AT91_BASE_SYS) 73#define AT91_MATRIX (0xffffee00 - AT91_BASE_SYS)
75#define AT91_CCFG (0xffffef10 - AT91_BASE_SYS) 74#define AT91_CCFG (0xffffef10 - AT91_BASE_SYS)
76#define AT91_AIC (0xfffff000 - AT91_BASE_SYS) 75#define AT91_AIC (0xfffff000 - AT91_BASE_SYS)
@@ -85,6 +84,7 @@
85 84
86#define AT91SAM9RL_BASE_DMA 0xffffe600 85#define AT91SAM9RL_BASE_DMA 0xffffe600
87#define AT91SAM9RL_BASE_ECC 0xffffe800 86#define AT91SAM9RL_BASE_ECC 0xffffe800
87#define AT91SAM9RL_BASE_SMC 0xffffec00
88#define AT91SAM9RL_BASE_PIOA 0xfffff400 88#define AT91SAM9RL_BASE_PIOA 0xfffff400
89#define AT91SAM9RL_BASE_PIOB 0xfffff600 89#define AT91SAM9RL_BASE_PIOB 0xfffff600
90#define AT91SAM9RL_BASE_PIOC 0xfffff800 90#define AT91SAM9RL_BASE_PIOC 0xfffff800
diff --git a/arch/arm/mach-at91/sam9_smc.c b/arch/arm/mach-at91/sam9_smc.c
index 5eab6aa621d0..8294783b679d 100644
--- a/arch/arm/mach-at91/sam9_smc.c
+++ b/arch/arm/mach-at91/sam9_smc.c
@@ -10,38 +10,58 @@
10 10
11#include <linux/module.h> 11#include <linux/module.h>
12#include <linux/io.h> 12#include <linux/io.h>
13#include <linux/of.h>
14#include <linux/of_address.h>
13 15
14#include <mach/at91sam9_smc.h> 16#include <mach/at91sam9_smc.h>
15 17
16#include "sam9_smc.h" 18#include "sam9_smc.h"
17 19
18void __init sam9_smc_configure(int cs, struct sam9_smc_config* config) 20
21#define AT91_SMC_CS(id, n) (smc_base_addr[id] + ((n) * 0x10))
22
23static void __iomem *smc_base_addr[2];
24
25static void __init sam9_smc_cs_configure(void __iomem *base, struct sam9_smc_config* config)
19{ 26{
27
20 /* Setup register */ 28 /* Setup register */
21 at91_sys_write(AT91_SMC_SETUP(cs), 29 __raw_writel(AT91_SMC_NWESETUP_(config->nwe_setup)
22 AT91_SMC_NWESETUP_(config->nwe_setup) 30 | AT91_SMC_NCS_WRSETUP_(config->ncs_write_setup)
23 | AT91_SMC_NCS_WRSETUP_(config->ncs_write_setup) 31 | AT91_SMC_NRDSETUP_(config->nrd_setup)
24 | AT91_SMC_NRDSETUP_(config->nrd_setup) 32 | AT91_SMC_NCS_RDSETUP_(config->ncs_read_setup),
25 | AT91_SMC_NCS_RDSETUP_(config->ncs_read_setup) 33 base + AT91_SMC_SETUP);
26 );
27 34
28 /* Pulse register */ 35 /* Pulse register */
29 at91_sys_write(AT91_SMC_PULSE(cs), 36 __raw_writel(AT91_SMC_NWEPULSE_(config->nwe_pulse)
30 AT91_SMC_NWEPULSE_(config->nwe_pulse) 37 | AT91_SMC_NCS_WRPULSE_(config->ncs_write_pulse)
31 | AT91_SMC_NCS_WRPULSE_(config->ncs_write_pulse) 38 | AT91_SMC_NRDPULSE_(config->nrd_pulse)
32 | AT91_SMC_NRDPULSE_(config->nrd_pulse) 39 | AT91_SMC_NCS_RDPULSE_(config->ncs_read_pulse),
33 | AT91_SMC_NCS_RDPULSE_(config->ncs_read_pulse) 40 base + AT91_SMC_PULSE);
34 );
35 41
36 /* Cycle register */ 42 /* Cycle register */
37 at91_sys_write(AT91_SMC_CYCLE(cs), 43 __raw_writel(AT91_SMC_NWECYCLE_(config->write_cycle)
38 AT91_SMC_NWECYCLE_(config->write_cycle) 44 | AT91_SMC_NRDCYCLE_(config->read_cycle),
39 | AT91_SMC_NRDCYCLE_(config->read_cycle) 45 base + AT91_SMC_CYCLE);
40 );
41 46
42 /* Mode register */ 47 /* Mode register */
43 at91_sys_write(AT91_SMC_MODE(cs), 48 __raw_writel(config->mode
44 config->mode 49 | AT91_SMC_TDF_(config->tdf_cycles),
45 | AT91_SMC_TDF_(config->tdf_cycles) 50 base + AT91_SMC_MODE);
46 ); 51}
52
53void __init sam9_smc_configure(int id, int cs, struct sam9_smc_config* config)
54{
55 sam9_smc_cs_configure(AT91_SMC_CS(id, cs), config);
56}
57
58void __init at91sam9_ioremap_smc(int id, u32 addr)
59{
60 if (id > 1) {
61 pr_warn("%s: id > 2\n", __func__);
62 return;
63 }
64 smc_base_addr[id] = ioremap(addr, 512);
65 if (!smc_base_addr[id])
66 pr_warn("Impossible to ioremap smc.%d 0x%x\n", id, addr);
47} 67}
diff --git a/arch/arm/mach-at91/sam9_smc.h b/arch/arm/mach-at91/sam9_smc.h
index bf72cfb3455b..039c5ce17aec 100644
--- a/arch/arm/mach-at91/sam9_smc.h
+++ b/arch/arm/mach-at91/sam9_smc.h
@@ -30,4 +30,5 @@ struct sam9_smc_config {
30 u8 tdf_cycles:4; 30 u8 tdf_cycles:4;
31}; 31};
32 32
33extern void __init sam9_smc_configure(int cs, struct sam9_smc_config* config); 33extern void __init sam9_smc_configure(int id, int cs, struct sam9_smc_config* config);
34extern void __init at91sam9_ioremap_smc(int id, u32 addr);