diff options
Diffstat (limited to 'arch/arm/mach-at91/at91cap9_devices.c')
-rw-r--r-- | arch/arm/mach-at91/at91cap9_devices.c | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/arch/arm/mach-at91/at91cap9_devices.c b/arch/arm/mach-at91/at91cap9_devices.c index 5ebd4273d353..9eca2209cde6 100644 --- a/arch/arm/mach-at91/at91cap9_devices.c +++ b/arch/arm/mach-at91/at91cap9_devices.c | |||
@@ -13,6 +13,7 @@ | |||
13 | */ | 13 | */ |
14 | #include <asm/mach/arch.h> | 14 | #include <asm/mach/arch.h> |
15 | #include <asm/mach/map.h> | 15 | #include <asm/mach/map.h> |
16 | #include <asm/mach/irq.h> | ||
16 | 17 | ||
17 | #include <linux/dma-mapping.h> | 18 | #include <linux/dma-mapping.h> |
18 | #include <linux/platform_device.h> | 19 | #include <linux/platform_device.h> |
@@ -21,6 +22,7 @@ | |||
21 | #include <video/atmel_lcdc.h> | 22 | #include <video/atmel_lcdc.h> |
22 | 23 | ||
23 | #include <mach/board.h> | 24 | #include <mach/board.h> |
25 | #include <mach/cpu.h> | ||
24 | #include <mach/gpio.h> | 26 | #include <mach/gpio.h> |
25 | #include <mach/at91cap9.h> | 27 | #include <mach/at91cap9.h> |
26 | #include <mach/at91cap9_matrix.h> | 28 | #include <mach/at91cap9_matrix.h> |
@@ -69,6 +71,9 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) | |||
69 | if (!data) | 71 | if (!data) |
70 | return; | 72 | return; |
71 | 73 | ||
74 | if (cpu_is_at91cap9_revB()) | ||
75 | set_irq_type(AT91CAP9_ID_UHP, IRQ_TYPE_LEVEL_HIGH); | ||
76 | |||
72 | /* Enable VBus control for UHP ports */ | 77 | /* Enable VBus control for UHP ports */ |
73 | for (i = 0; i < data->ports; i++) { | 78 | for (i = 0; i < data->ports; i++) { |
74 | if (data->vbus_pin[i]) | 79 | if (data->vbus_pin[i]) |
@@ -151,8 +156,13 @@ static struct platform_device at91_usba_udc_device = { | |||
151 | 156 | ||
152 | void __init at91_add_device_usba(struct usba_platform_data *data) | 157 | void __init at91_add_device_usba(struct usba_platform_data *data) |
153 | { | 158 | { |
154 | at91_sys_write(AT91_MATRIX_UDPHS, AT91_MATRIX_SELECT_UDPHS | | 159 | if (cpu_is_at91cap9_revB()) { |
155 | AT91_MATRIX_UDPHS_BYPASS_LOCK); | 160 | set_irq_type(AT91CAP9_ID_UDPHS, IRQ_TYPE_LEVEL_HIGH); |
161 | at91_sys_write(AT91_MATRIX_UDPHS, AT91_MATRIX_SELECT_UDPHS | | ||
162 | AT91_MATRIX_UDPHS_BYPASS_LOCK); | ||
163 | } | ||
164 | else | ||
165 | at91_sys_write(AT91_MATRIX_UDPHS, AT91_MATRIX_SELECT_UDPHS); | ||
156 | 166 | ||
157 | /* | 167 | /* |
158 | * Invalid pins are 0 on AT91, but the usba driver is shared | 168 | * Invalid pins are 0 on AT91, but the usba driver is shared |
@@ -406,28 +416,13 @@ static struct platform_device at91cap9_nand_device = { | |||
406 | 416 | ||
407 | void __init at91_add_device_nand(struct atmel_nand_data *data) | 417 | void __init at91_add_device_nand(struct atmel_nand_data *data) |
408 | { | 418 | { |
409 | unsigned long csa, mode; | 419 | unsigned long csa; |
410 | 420 | ||
411 | if (!data) | 421 | if (!data) |
412 | return; | 422 | return; |
413 | 423 | ||
414 | csa = at91_sys_read(AT91_MATRIX_EBICSA); | 424 | 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); | 425 | 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 | 426 | ||
432 | /* enable pin */ | 427 | /* enable pin */ |
433 | if (data->enable_pin) | 428 | if (data->enable_pin) |
@@ -865,6 +860,9 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) | |||
865 | if (!data) | 860 | if (!data) |
866 | return; | 861 | return; |
867 | 862 | ||
863 | if (cpu_is_at91cap9_revB()) | ||
864 | set_irq_type(AT91CAP9_ID_LCDC, IRQ_TYPE_LEVEL_HIGH); | ||
865 | |||
868 | at91_set_A_periph(AT91_PIN_PC1, 0); /* LCDHSYNC */ | 866 | at91_set_A_periph(AT91_PIN_PC1, 0); /* LCDHSYNC */ |
869 | at91_set_A_periph(AT91_PIN_PC2, 0); /* LCDDOTCK */ | 867 | at91_set_A_periph(AT91_PIN_PC2, 0); /* LCDDOTCK */ |
870 | at91_set_A_periph(AT91_PIN_PC3, 0); /* LCDDEN */ | 868 | at91_set_A_periph(AT91_PIN_PC3, 0); /* LCDDEN */ |