diff options
author | Stelian Pop <stelian@popies.net> | 2008-10-22 08:52:08 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-12-01 12:22:07 -0500 |
commit | 7be90a6ba996e43902fc89704b60a57fd4659a63 (patch) | |
tree | 6f6b1b0d0c08d91455d850bdac01086ea38c355f /arch/arm/mach-at91/at91cap9_devices.c | |
parent | ffc63b7d30370e23d7e052df2c1c2c4526464ba6 (diff) |
[ARM] 5319/1: AT91: support AT91CAP9 revC CPUs
The AT91CAP9 revC CPU has a few differences over the previous,
revB CPU which was distributed in small quantities only (revA was
an internal Atmel product only).
This patch adds the detection routines to recognize the different
AT91CAP9 revisions (based on the PMC subsystem version number), and
uses them to:
- activate a workaround for the external interrupts levels
(on revB CPUs)
- set the UDPHS_BYPASS bit (on revB CPUs)
- set AT91_GPBR register address to the correct offset
(0xfffffd50 on revB, 0xfffffd60 on revC)
For debugging usage, the CPU revision can be found in /proc/cpuinfo
on the 'Revision' line.
This patch is extracted from Andrew Victor's -at91 patch (2.6.27-at91.patch)
where it has been tested for the last 6 months.
Signed-off-by: Stelian Pop <stelian@popies.net>
Signed-off-by: Andrew Victor <linux@maxim.org.za>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-at91/at91cap9_devices.c')
-rw-r--r-- | arch/arm/mach-at91/at91cap9_devices.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/arch/arm/mach-at91/at91cap9_devices.c b/arch/arm/mach-at91/at91cap9_devices.c index 3a36182c50cc..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 |
@@ -850,6 +860,9 @@ void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) | |||
850 | if (!data) | 860 | if (!data) |
851 | return; | 861 | return; |
852 | 862 | ||
863 | if (cpu_is_at91cap9_revB()) | ||
864 | set_irq_type(AT91CAP9_ID_LCDC, IRQ_TYPE_LEVEL_HIGH); | ||
865 | |||
853 | at91_set_A_periph(AT91_PIN_PC1, 0); /* LCDHSYNC */ | 866 | at91_set_A_periph(AT91_PIN_PC1, 0); /* LCDHSYNC */ |
854 | at91_set_A_periph(AT91_PIN_PC2, 0); /* LCDDOTCK */ | 867 | at91_set_A_periph(AT91_PIN_PC2, 0); /* LCDDOTCK */ |
855 | at91_set_A_periph(AT91_PIN_PC3, 0); /* LCDDEN */ | 868 | at91_set_A_periph(AT91_PIN_PC3, 0); /* LCDDEN */ |