diff options
author | Andrew Victor <linux@maxim.org.za> | 2008-10-06 15:01:00 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-12-01 12:18:10 -0500 |
commit | 461d3b4dcf2b3b92f819b668d16b36a87046fd98 (patch) | |
tree | b4a2f88b992997a5c7d7771f6e9c4376e6489d44 | |
parent | 6781002bec5237ee8ac1e1daeb0ba976e780a884 (diff) |
[ARM] 5288/1: [AT91] Remove SMC configuration from devices.c files
In at91_add_device_nand(), do not configure the Static Memory
controller with specific timing values.
The *_devices.c files are board independent, and the SMC timing values
are specific to the NAND devices that are installed on the board.
The board-specific files are now responsible for configuring the
Static Memory controller (if the don't want to leave it up to a
bootloader).
Signed-off-by: Andrew Victor <linux@maxim.org.za>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | arch/arm/mach-at91/at91cap9_devices.c | 19 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9260_devices.c | 38 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9261_devices.c | 17 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9263_devices.c | 17 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9rl_devices.c | 11 |
5 files changed, 5 insertions, 97 deletions
diff --git a/arch/arm/mach-at91/at91cap9_devices.c b/arch/arm/mach-at91/at91cap9_devices.c index 5ebd4273d353..3a36182c50cc 100644 --- a/arch/arm/mach-at91/at91cap9_devices.c +++ b/arch/arm/mach-at91/at91cap9_devices.c | |||
@@ -406,28 +406,13 @@ static struct platform_device at91cap9_nand_device = { | |||
406 | 406 | ||
407 | void __init at91_add_device_nand(struct atmel_nand_data *data) | 407 | void __init at91_add_device_nand(struct atmel_nand_data *data) |
408 | { | 408 | { |
409 | unsigned long csa, mode; | 409 | unsigned long csa; |
410 | 410 | ||
411 | if (!data) | 411 | if (!data) |
412 | return; | 412 | return; |
413 | 413 | ||
414 | csa = at91_sys_read(AT91_MATRIX_EBICSA); | 414 | csa = at91_sys_read(AT91_MATRIX_EBICSA); |
415 | at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA | AT91_MATRIX_EBI_VDDIOMSEL_3_3V); | 415 | at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA); |
416 | |||
417 | /* set the bus interface characteristics */ | ||
418 | at91_sys_write(AT91_SMC_SETUP(3), AT91_SMC_NWESETUP_(2) | AT91_SMC_NCS_WRSETUP_(1) | ||
419 | | AT91_SMC_NRDSETUP_(2) | AT91_SMC_NCS_RDSETUP_(1)); | ||
420 | |||
421 | at91_sys_write(AT91_SMC_PULSE(3), AT91_SMC_NWEPULSE_(4) | AT91_SMC_NCS_WRPULSE_(6) | ||
422 | | AT91_SMC_NRDPULSE_(4) | AT91_SMC_NCS_RDPULSE_(6)); | ||
423 | |||
424 | at91_sys_write(AT91_SMC_CYCLE(3), AT91_SMC_NWECYCLE_(8) | AT91_SMC_NRDCYCLE_(8)); | ||
425 | |||
426 | if (data->bus_width_16) | ||
427 | mode = AT91_SMC_DBW_16; | ||
428 | else | ||
429 | mode = AT91_SMC_DBW_8; | ||
430 | at91_sys_write(AT91_SMC_MODE(3), mode | AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_TDF_(1)); | ||
431 | 416 | ||
432 | /* enable pin */ | 417 | /* enable pin */ |
433 | if (data->enable_pin) | 418 | if (data->enable_pin) |
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c index 7774d17dde74..fdde1ea21b07 100644 --- a/arch/arm/mach-at91/at91sam9260_devices.c +++ b/arch/arm/mach-at91/at91sam9260_devices.c | |||
@@ -313,7 +313,7 @@ static struct platform_device at91sam9260_nand_device = { | |||
313 | 313 | ||
314 | void __init at91_add_device_nand(struct atmel_nand_data *data) | 314 | void __init at91_add_device_nand(struct atmel_nand_data *data) |
315 | { | 315 | { |
316 | unsigned long csa, mode; | 316 | unsigned long csa; |
317 | 317 | ||
318 | if (!data) | 318 | if (!data) |
319 | return; | 319 | return; |
@@ -321,42 +321,6 @@ void __init at91_add_device_nand(struct atmel_nand_data *data) | |||
321 | csa = at91_sys_read(AT91_MATRIX_EBICSA); | 321 | csa = at91_sys_read(AT91_MATRIX_EBICSA); |
322 | at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA); | 322 | at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA); |
323 | 323 | ||
324 | if (cpu_is_at91sam9260()) { | ||
325 | /* Timing for sam9260 */ | ||
326 | /* set the bus interface characteristics */ | ||
327 | at91_sys_write(AT91_SMC_SETUP(3), AT91_SMC_NWESETUP_(1) | AT91_SMC_NCS_WRSETUP_(0) | ||
328 | | AT91_SMC_NRDSETUP_(1) | AT91_SMC_NCS_RDSETUP_(0)); | ||
329 | |||
330 | at91_sys_write(AT91_SMC_PULSE(3), AT91_SMC_NWEPULSE_(3) | AT91_SMC_NCS_WRPULSE_(3) | ||
331 | | AT91_SMC_NRDPULSE_(3) | AT91_SMC_NCS_RDPULSE_(3)); | ||
332 | |||
333 | at91_sys_write(AT91_SMC_CYCLE(3), AT91_SMC_NWECYCLE_(5) | AT91_SMC_NRDCYCLE_(5)); | ||
334 | |||
335 | if (data->bus_width_16) | ||
336 | mode = AT91_SMC_DBW_16; | ||
337 | else | ||
338 | mode = AT91_SMC_DBW_8; | ||
339 | at91_sys_write(AT91_SMC_MODE(3), mode | AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_TDF_(2)); | ||
340 | } | ||
341 | |||
342 | if (cpu_is_at91sam9g20()) { | ||
343 | /* Timing for sam9g20 */ | ||
344 | /* set the bus interface characteristics */ | ||
345 | at91_sys_write(AT91_SMC_SETUP(3), AT91_SMC_NWESETUP_(2) | AT91_SMC_NCS_WRSETUP_(0) | ||
346 | | AT91_SMC_NRDSETUP_(2) | AT91_SMC_NCS_RDSETUP_(0)); | ||
347 | |||
348 | at91_sys_write(AT91_SMC_PULSE(3), AT91_SMC_NWEPULSE_(4) | AT91_SMC_NCS_WRPULSE_(4) | ||
349 | | AT91_SMC_NRDPULSE_(4) | AT91_SMC_NCS_RDPULSE_(4)); | ||
350 | |||
351 | at91_sys_write(AT91_SMC_CYCLE(3), AT91_SMC_NWECYCLE_(7) | AT91_SMC_NRDCYCLE_(7)); | ||
352 | |||
353 | if (data->bus_width_16) | ||
354 | mode = AT91_SMC_DBW_16; | ||
355 | else | ||
356 | mode = AT91_SMC_DBW_8; | ||
357 | at91_sys_write(AT91_SMC_MODE(3), mode | AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_TDF_(3)); | ||
358 | } | ||
359 | |||
360 | /* enable pin */ | 324 | /* enable pin */ |
361 | if (data->enable_pin) | 325 | if (data->enable_pin) |
362 | at91_set_gpio_output(data->enable_pin, 1); | 326 | at91_set_gpio_output(data->enable_pin, 1); |
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c index 6b89172310c7..17289756f80f 100644 --- a/arch/arm/mach-at91/at91sam9261_devices.c +++ b/arch/arm/mach-at91/at91sam9261_devices.c | |||
@@ -223,7 +223,7 @@ static struct platform_device atmel_nand_device = { | |||
223 | 223 | ||
224 | void __init at91_add_device_nand(struct atmel_nand_data *data) | 224 | void __init at91_add_device_nand(struct atmel_nand_data *data) |
225 | { | 225 | { |
226 | unsigned long csa, mode; | 226 | unsigned long csa; |
227 | 227 | ||
228 | if (!data) | 228 | if (!data) |
229 | return; | 229 | return; |
@@ -231,21 +231,6 @@ void __init at91_add_device_nand(struct atmel_nand_data *data) | |||
231 | csa = at91_sys_read(AT91_MATRIX_EBICSA); | 231 | csa = at91_sys_read(AT91_MATRIX_EBICSA); |
232 | at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA); | 232 | at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA); |
233 | 233 | ||
234 | /* set the bus interface characteristics */ | ||
235 | at91_sys_write(AT91_SMC_SETUP(3), AT91_SMC_NWESETUP_(1) | AT91_SMC_NCS_WRSETUP_(0) | ||
236 | | AT91_SMC_NRDSETUP_(1) | AT91_SMC_NCS_RDSETUP_(0)); | ||
237 | |||
238 | at91_sys_write(AT91_SMC_PULSE(3), AT91_SMC_NWEPULSE_(3) | AT91_SMC_NCS_WRPULSE_(3) | ||
239 | | AT91_SMC_NRDPULSE_(3) | AT91_SMC_NCS_RDPULSE_(3)); | ||
240 | |||
241 | at91_sys_write(AT91_SMC_CYCLE(3), AT91_SMC_NWECYCLE_(5) | AT91_SMC_NRDCYCLE_(5)); | ||
242 | |||
243 | if (data->bus_width_16) | ||
244 | mode = AT91_SMC_DBW_16; | ||
245 | else | ||
246 | mode = AT91_SMC_DBW_8; | ||
247 | at91_sys_write(AT91_SMC_MODE(3), mode | AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_TDF_(2)); | ||
248 | |||
249 | /* enable pin */ | 234 | /* enable pin */ |
250 | if (data->enable_pin) | 235 | if (data->enable_pin) |
251 | at91_set_gpio_output(data->enable_pin, 1); | 236 | at91_set_gpio_output(data->enable_pin, 1); |
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c index 8b884083f76d..b753cb879d8e 100644 --- a/arch/arm/mach-at91/at91sam9263_devices.c +++ b/arch/arm/mach-at91/at91sam9263_devices.c | |||
@@ -382,7 +382,7 @@ static struct platform_device at91sam9263_nand_device = { | |||
382 | 382 | ||
383 | void __init at91_add_device_nand(struct atmel_nand_data *data) | 383 | void __init at91_add_device_nand(struct atmel_nand_data *data) |
384 | { | 384 | { |
385 | unsigned long csa, mode; | 385 | unsigned long csa; |
386 | 386 | ||
387 | if (!data) | 387 | if (!data) |
388 | return; | 388 | return; |
@@ -390,21 +390,6 @@ void __init at91_add_device_nand(struct atmel_nand_data *data) | |||
390 | csa = at91_sys_read(AT91_MATRIX_EBI0CSA); | 390 | csa = at91_sys_read(AT91_MATRIX_EBI0CSA); |
391 | at91_sys_write(AT91_MATRIX_EBI0CSA, csa | AT91_MATRIX_EBI0_CS3A_SMC_SMARTMEDIA); | 391 | at91_sys_write(AT91_MATRIX_EBI0CSA, csa | AT91_MATRIX_EBI0_CS3A_SMC_SMARTMEDIA); |
392 | 392 | ||
393 | /* set the bus interface characteristics */ | ||
394 | at91_sys_write(AT91_SMC_SETUP(3), AT91_SMC_NWESETUP_(1) | AT91_SMC_NCS_WRSETUP_(0) | ||
395 | | AT91_SMC_NRDSETUP_(1) | AT91_SMC_NCS_RDSETUP_(0)); | ||
396 | |||
397 | at91_sys_write(AT91_SMC_PULSE(3), AT91_SMC_NWEPULSE_(3) | AT91_SMC_NCS_WRPULSE_(3) | ||
398 | | AT91_SMC_NRDPULSE_(3) | AT91_SMC_NCS_RDPULSE_(3)); | ||
399 | |||
400 | at91_sys_write(AT91_SMC_CYCLE(3), AT91_SMC_NWECYCLE_(5) | AT91_SMC_NRDCYCLE_(5)); | ||
401 | |||
402 | if (data->bus_width_16) | ||
403 | mode = AT91_SMC_DBW_16; | ||
404 | else | ||
405 | mode = AT91_SMC_DBW_8; | ||
406 | at91_sys_write(AT91_SMC_MODE(3), mode | AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_TDF_(2)); | ||
407 | |||
408 | /* enable pin */ | 393 | /* enable pin */ |
409 | if (data->enable_pin) | 394 | if (data->enable_pin) |
410 | at91_set_gpio_output(data->enable_pin, 1); | 395 | at91_set_gpio_output(data->enable_pin, 1); |
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c index 87deb1e1b529..145324f4ec56 100644 --- a/arch/arm/mach-at91/at91sam9rl_devices.c +++ b/arch/arm/mach-at91/at91sam9rl_devices.c | |||
@@ -232,17 +232,6 @@ void __init at91_add_device_nand(struct atmel_nand_data *data) | |||
232 | csa = at91_sys_read(AT91_MATRIX_EBICSA); | 232 | csa = at91_sys_read(AT91_MATRIX_EBICSA); |
233 | at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA); | 233 | at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA); |
234 | 234 | ||
235 | /* set the bus interface characteristics */ | ||
236 | at91_sys_write(AT91_SMC_SETUP(3), AT91_SMC_NWESETUP_(1) | AT91_SMC_NCS_WRSETUP_(0) | ||
237 | | AT91_SMC_NRDSETUP_(1) | AT91_SMC_NCS_RDSETUP_(0)); | ||
238 | |||
239 | at91_sys_write(AT91_SMC_PULSE(3), AT91_SMC_NWEPULSE_(3) | AT91_SMC_NCS_WRPULSE_(3) | ||
240 | | AT91_SMC_NRDPULSE_(3) | AT91_SMC_NCS_RDPULSE_(3)); | ||
241 | |||
242 | at91_sys_write(AT91_SMC_CYCLE(3), AT91_SMC_NWECYCLE_(5) | AT91_SMC_NRDCYCLE_(5)); | ||
243 | |||
244 | at91_sys_write(AT91_SMC_MODE(3), AT91_SMC_DBW_8 | AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_TDF_(2)); | ||
245 | |||
246 | /* enable pin */ | 235 | /* enable pin */ |
247 | if (data->enable_pin) | 236 | if (data->enable_pin) |
248 | at91_set_gpio_output(data->enable_pin, 1); | 237 | at91_set_gpio_output(data->enable_pin, 1); |