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/include | |
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/include')
-rw-r--r-- | arch/arm/mach-at91/include/mach/at91_pmc.h | 7 | ||||
-rw-r--r-- | arch/arm/mach-at91/include/mach/at91cap9.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-at91/include/mach/cpu.h | 15 |
3 files changed, 25 insertions, 1 deletions
diff --git a/arch/arm/mach-at91/include/mach/at91_pmc.h b/arch/arm/mach-at91/include/mach/at91_pmc.h index 2e3f2894b704..9561e33b8a9a 100644 --- a/arch/arm/mach-at91/include/mach/at91_pmc.h +++ b/arch/arm/mach-at91/include/mach/at91_pmc.h | |||
@@ -23,6 +23,7 @@ | |||
23 | #define AT91_PMC_PCK (1 << 0) /* Processor Clock */ | 23 | #define AT91_PMC_PCK (1 << 0) /* Processor Clock */ |
24 | #define AT91RM9200_PMC_UDP (1 << 1) /* USB Devcice Port Clock [AT91RM9200 only] */ | 24 | #define AT91RM9200_PMC_UDP (1 << 1) /* USB Devcice Port Clock [AT91RM9200 only] */ |
25 | #define AT91RM9200_PMC_MCKUDP (1 << 2) /* USB Device Port Master Clock Automatic Disable on Suspend [AT91RM9200 only] */ | 25 | #define AT91RM9200_PMC_MCKUDP (1 << 2) /* USB Device Port Master Clock Automatic Disable on Suspend [AT91RM9200 only] */ |
26 | #define AT91CAP9_PMC_DDR (1 << 2) /* DDR Clock [AT91CAP9 revC only] */ | ||
26 | #define AT91RM9200_PMC_UHP (1 << 4) /* USB Host Port Clock [AT91RM9200 only] */ | 27 | #define AT91RM9200_PMC_UHP (1 << 4) /* USB Host Port Clock [AT91RM9200 only] */ |
27 | #define AT91SAM926x_PMC_UHP (1 << 6) /* USB Host Port Clock [AT91SAM926x only] */ | 28 | #define AT91SAM926x_PMC_UHP (1 << 6) /* USB Host Port Clock [AT91SAM926x only] */ |
28 | #define AT91CAP9_PMC_UHP (1 << 6) /* USB Host Port Clock [AT91CAP9 only] */ | 29 | #define AT91CAP9_PMC_UHP (1 << 6) /* USB Host Port Clock [AT91CAP9 only] */ |
@@ -102,10 +103,16 @@ | |||
102 | #define AT91_PMC_LOCKB (1 << 2) /* PLLB Lock */ | 103 | #define AT91_PMC_LOCKB (1 << 2) /* PLLB Lock */ |
103 | #define AT91_PMC_MCKRDY (1 << 3) /* Master Clock */ | 104 | #define AT91_PMC_MCKRDY (1 << 3) /* Master Clock */ |
104 | #define AT91_PMC_LOCKU (1 << 6) /* UPLL Lock [AT91CAP9 only] */ | 105 | #define AT91_PMC_LOCKU (1 << 6) /* UPLL Lock [AT91CAP9 only] */ |
106 | #define AT91_PMC_OSCSEL (1 << 7) /* Slow Clock Oscillator [AT91CAP9 revC only] */ | ||
105 | #define AT91_PMC_PCK0RDY (1 << 8) /* Programmable Clock 0 */ | 107 | #define AT91_PMC_PCK0RDY (1 << 8) /* Programmable Clock 0 */ |
106 | #define AT91_PMC_PCK1RDY (1 << 9) /* Programmable Clock 1 */ | 108 | #define AT91_PMC_PCK1RDY (1 << 9) /* Programmable Clock 1 */ |
107 | #define AT91_PMC_PCK2RDY (1 << 10) /* Programmable Clock 2 */ | 109 | #define AT91_PMC_PCK2RDY (1 << 10) /* Programmable Clock 2 */ |
108 | #define AT91_PMC_PCK3RDY (1 << 11) /* Programmable Clock 3 */ | 110 | #define AT91_PMC_PCK3RDY (1 << 11) /* Programmable Clock 3 */ |
109 | #define AT91_PMC_IMR (AT91_PMC + 0x6c) /* Interrupt Mask Register */ | 111 | #define AT91_PMC_IMR (AT91_PMC + 0x6c) /* Interrupt Mask Register */ |
110 | 112 | ||
113 | #define AT91_PMC_PROT (AT91_PMC + 0xe4) /* Protect Register [AT91CAP9 revC only] */ | ||
114 | #define AT91_PMC_PROTKEY 0x504d4301 /* Activation Code */ | ||
115 | |||
116 | #define AT91_PMC_VER (AT91_PMC + 0xfc) /* PMC Module Version [AT91CAP9 only] */ | ||
117 | |||
111 | #endif | 118 | #endif |
diff --git a/arch/arm/mach-at91/include/mach/at91cap9.h b/arch/arm/mach-at91/include/mach/at91cap9.h index 4a4b64135a92..d8c1ededaa75 100644 --- a/arch/arm/mach-at91/include/mach/at91cap9.h +++ b/arch/arm/mach-at91/include/mach/at91cap9.h | |||
@@ -101,7 +101,9 @@ | |||
101 | #define AT91_RTT (0xfffffd20 - AT91_BASE_SYS) | 101 | #define AT91_RTT (0xfffffd20 - AT91_BASE_SYS) |
102 | #define AT91_PIT (0xfffffd30 - AT91_BASE_SYS) | 102 | #define AT91_PIT (0xfffffd30 - AT91_BASE_SYS) |
103 | #define AT91_WDT (0xfffffd40 - AT91_BASE_SYS) | 103 | #define AT91_WDT (0xfffffd40 - AT91_BASE_SYS) |
104 | #define AT91_GPBR (0xfffffd50 - AT91_BASE_SYS) | 104 | #define AT91_GPBR (cpu_is_at91cap9_revB() ? \ |
105 | (0xfffffd50 - AT91_BASE_SYS) : \ | ||
106 | (0xfffffd60 - AT91_BASE_SYS)) | ||
105 | 107 | ||
106 | #define AT91_USART0 AT91CAP9_BASE_US0 | 108 | #define AT91_USART0 AT91CAP9_BASE_US0 |
107 | #define AT91_USART1 AT91CAP9_BASE_US1 | 109 | #define AT91_USART1 AT91CAP9_BASE_US1 |
diff --git a/arch/arm/mach-at91/include/mach/cpu.h b/arch/arm/mach-at91/include/mach/cpu.h index dbfd9f73f80b..c554c3e4d553 100644 --- a/arch/arm/mach-at91/include/mach/cpu.h +++ b/arch/arm/mach-at91/include/mach/cpu.h | |||
@@ -49,6 +49,17 @@ static inline unsigned long at91_arch_identify(void) | |||
49 | return (at91_sys_read(AT91_DBGU_CIDR) & AT91_CIDR_ARCH); | 49 | return (at91_sys_read(AT91_DBGU_CIDR) & AT91_CIDR_ARCH); |
50 | } | 50 | } |
51 | 51 | ||
52 | #ifdef CONFIG_ARCH_AT91CAP9 | ||
53 | #include <mach/at91_pmc.h> | ||
54 | |||
55 | #define ARCH_REVISION_CAP9_B 0x399 | ||
56 | #define ARCH_REVISION_CAP9_C 0x601 | ||
57 | |||
58 | static inline unsigned long at91cap9_rev_identify(void) | ||
59 | { | ||
60 | return (at91_sys_read(AT91_PMC_VER)); | ||
61 | } | ||
62 | #endif | ||
52 | 63 | ||
53 | #ifdef CONFIG_ARCH_AT91RM9200 | 64 | #ifdef CONFIG_ARCH_AT91RM9200 |
54 | #define cpu_is_at91rm9200() (at91_cpu_identify() == ARCH_ID_AT91RM9200) | 65 | #define cpu_is_at91rm9200() (at91_cpu_identify() == ARCH_ID_AT91RM9200) |
@@ -90,8 +101,12 @@ static inline unsigned long at91_arch_identify(void) | |||
90 | 101 | ||
91 | #ifdef CONFIG_ARCH_AT91CAP9 | 102 | #ifdef CONFIG_ARCH_AT91CAP9 |
92 | #define cpu_is_at91cap9() (at91_cpu_identify() == ARCH_ID_AT91CAP9) | 103 | #define cpu_is_at91cap9() (at91_cpu_identify() == ARCH_ID_AT91CAP9) |
104 | #define cpu_is_at91cap9_revB() (at91cap9_rev_identify() == ARCH_REVISION_CAP9_B) | ||
105 | #define cpu_is_at91cap9_revC() (at91cap9_rev_identify() == ARCH_REVISION_CAP9_C) | ||
93 | #else | 106 | #else |
94 | #define cpu_is_at91cap9() (0) | 107 | #define cpu_is_at91cap9() (0) |
108 | #define cpu_is_at91cap9_revB() (0) | ||
109 | #define cpu_is_at91cap9_revC() (0) | ||
95 | #endif | 110 | #endif |
96 | 111 | ||
97 | /* | 112 | /* |