diff options
Diffstat (limited to 'arch/arm/mach-at91/at91sam9260_devices.c')
-rw-r--r-- | arch/arm/mach-at91/at91sam9260_devices.c | 44 |
1 files changed, 33 insertions, 11 deletions
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c index 393a32aefce5..86cba4ac29b1 100644 --- a/arch/arm/mach-at91/at91sam9260_devices.c +++ b/arch/arm/mach-at91/at91sam9260_devices.c | |||
@@ -18,6 +18,7 @@ | |||
18 | 18 | ||
19 | #include <asm/arch/board.h> | 19 | #include <asm/arch/board.h> |
20 | #include <asm/arch/gpio.h> | 20 | #include <asm/arch/gpio.h> |
21 | #include <asm/arch/cpu.h> | ||
21 | #include <asm/arch/at91sam9260.h> | 22 | #include <asm/arch/at91sam9260.h> |
22 | #include <asm/arch/at91sam9260_matrix.h> | 23 | #include <asm/arch/at91sam9260_matrix.h> |
23 | #include <asm/arch/at91sam9_smc.h> | 24 | #include <asm/arch/at91sam9_smc.h> |
@@ -320,20 +321,41 @@ void __init at91_add_device_nand(struct at91_nand_data *data) | |||
320 | csa = at91_sys_read(AT91_MATRIX_EBICSA); | 321 | csa = at91_sys_read(AT91_MATRIX_EBICSA); |
321 | 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); |
322 | 323 | ||
323 | /* set the bus interface characteristics */ | 324 | if (cpu_is_at91sam9260()) { |
324 | at91_sys_write(AT91_SMC_SETUP(3), AT91_SMC_NWESETUP_(0) | AT91_SMC_NCS_WRSETUP_(0) | 325 | /* Timing for sam9260 */ |
325 | | AT91_SMC_NRDSETUP_(0) | AT91_SMC_NCS_RDSETUP_(0)); | 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)); | ||
326 | 329 | ||
327 | at91_sys_write(AT91_SMC_PULSE(3), AT91_SMC_NWEPULSE_(3) | AT91_SMC_NCS_WRPULSE_(3) | 330 | at91_sys_write(AT91_SMC_PULSE(3), AT91_SMC_NWEPULSE_(3) | AT91_SMC_NCS_WRPULSE_(3) |
328 | | AT91_SMC_NRDPULSE_(3) | AT91_SMC_NCS_RDPULSE_(3)); | 331 | | AT91_SMC_NRDPULSE_(3) | AT91_SMC_NCS_RDPULSE_(3)); |
329 | 332 | ||
330 | at91_sys_write(AT91_SMC_CYCLE(3), AT91_SMC_NWECYCLE_(5) | AT91_SMC_NRDCYCLE_(5)); | 333 | at91_sys_write(AT91_SMC_CYCLE(3), AT91_SMC_NWECYCLE_(5) | AT91_SMC_NRDCYCLE_(5)); |
331 | 334 | ||
332 | if (data->bus_width_16) | 335 | if (data->bus_width_16) |
333 | mode = AT91_SMC_DBW_16; | 336 | mode = AT91_SMC_DBW_16; |
334 | else | 337 | else |
335 | mode = AT91_SMC_DBW_8; | 338 | mode = AT91_SMC_DBW_8; |
336 | at91_sys_write(AT91_SMC_MODE(3), mode | AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_TDF_(2)); | 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 | } | ||
337 | 359 | ||
338 | /* enable pin */ | 360 | /* enable pin */ |
339 | if (data->enable_pin) | 361 | if (data->enable_pin) |