diff options
Diffstat (limited to 'arch/arm/mach-at91/include/mach')
-rw-r--r-- | arch/arm/mach-at91/include/mach/at91_dbgu.h | 27 | ||||
-rw-r--r-- | arch/arm/mach-at91/include/mach/at91_wdt.h | 37 | ||||
-rw-r--r-- | arch/arm/mach-at91/include/mach/at91cap9.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-at91/include/mach/at91rm9200.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-at91/include/mach/at91sam9260.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-at91/include/mach/at91sam9261.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-at91/include/mach/at91sam9263.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-at91/include/mach/at91sam9g45.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-at91/include/mach/at91sam9rl.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-at91/include/mach/clkdev.h | 7 | ||||
-rw-r--r-- | arch/arm/mach-at91/include/mach/cpu.h | 159 | ||||
-rw-r--r-- | arch/arm/mach-at91/include/mach/debug-macro.S | 14 | ||||
-rw-r--r-- | arch/arm/mach-at91/include/mach/hardware.h | 14 | ||||
-rw-r--r-- | arch/arm/mach-at91/include/mach/io.h | 11 |
14 files changed, 135 insertions, 141 deletions
diff --git a/arch/arm/mach-at91/include/mach/at91_dbgu.h b/arch/arm/mach-at91/include/mach/at91_dbgu.h index 6dcaa7716871..dbfe455a4c41 100644 --- a/arch/arm/mach-at91/include/mach/at91_dbgu.h +++ b/arch/arm/mach-at91/include/mach/at91_dbgu.h | |||
@@ -16,22 +16,25 @@ | |||
16 | #ifndef AT91_DBGU_H | 16 | #ifndef AT91_DBGU_H |
17 | #define AT91_DBGU_H | 17 | #define AT91_DBGU_H |
18 | 18 | ||
19 | #define dbgu_readl(dbgu, field) \ | ||
20 | __raw_readl(AT91_VA_BASE_SYS + dbgu + AT91_DBGU_ ## field) | ||
21 | |||
19 | #ifdef AT91_DBGU | 22 | #ifdef AT91_DBGU |
20 | #define AT91_DBGU_CR (AT91_DBGU + 0x00) /* Control Register */ | 23 | #define AT91_DBGU_CR (0x00) /* Control Register */ |
21 | #define AT91_DBGU_MR (AT91_DBGU + 0x04) /* Mode Register */ | 24 | #define AT91_DBGU_MR (0x04) /* Mode Register */ |
22 | #define AT91_DBGU_IER (AT91_DBGU + 0x08) /* Interrupt Enable Register */ | 25 | #define AT91_DBGU_IER (0x08) /* Interrupt Enable Register */ |
23 | #define AT91_DBGU_TXRDY (1 << 1) /* Transmitter Ready */ | 26 | #define AT91_DBGU_TXRDY (1 << 1) /* Transmitter Ready */ |
24 | #define AT91_DBGU_TXEMPTY (1 << 9) /* Transmitter Empty */ | 27 | #define AT91_DBGU_TXEMPTY (1 << 9) /* Transmitter Empty */ |
25 | #define AT91_DBGU_IDR (AT91_DBGU + 0x0c) /* Interrupt Disable Register */ | 28 | #define AT91_DBGU_IDR (0x0c) /* Interrupt Disable Register */ |
26 | #define AT91_DBGU_IMR (AT91_DBGU + 0x10) /* Interrupt Mask Register */ | 29 | #define AT91_DBGU_IMR (0x10) /* Interrupt Mask Register */ |
27 | #define AT91_DBGU_SR (AT91_DBGU + 0x14) /* Status Register */ | 30 | #define AT91_DBGU_SR (0x14) /* Status Register */ |
28 | #define AT91_DBGU_RHR (AT91_DBGU + 0x18) /* Receiver Holding Register */ | 31 | #define AT91_DBGU_RHR (0x18) /* Receiver Holding Register */ |
29 | #define AT91_DBGU_THR (AT91_DBGU + 0x1c) /* Transmitter Holding Register */ | 32 | #define AT91_DBGU_THR (0x1c) /* Transmitter Holding Register */ |
30 | #define AT91_DBGU_BRGR (AT91_DBGU + 0x20) /* Baud Rate Generator Register */ | 33 | #define AT91_DBGU_BRGR (0x20) /* Baud Rate Generator Register */ |
31 | 34 | ||
32 | #define AT91_DBGU_CIDR (AT91_DBGU + 0x40) /* Chip ID Register */ | 35 | #define AT91_DBGU_CIDR (0x40) /* Chip ID Register */ |
33 | #define AT91_DBGU_EXID (AT91_DBGU + 0x44) /* Chip ID Extension Register */ | 36 | #define AT91_DBGU_EXID (0x44) /* Chip ID Extension Register */ |
34 | #define AT91_DBGU_FNR (AT91_DBGU + 0x48) /* Force NTRST Register [SAM9 only] */ | 37 | #define AT91_DBGU_FNR (0x48) /* Force NTRST Register [SAM9 only] */ |
35 | #define AT91_DBGU_FNTRST (1 << 0) /* Force NTRST */ | 38 | #define AT91_DBGU_FNTRST (1 << 0) /* Force NTRST */ |
36 | 39 | ||
37 | #endif /* AT91_DBGU */ | 40 | #endif /* AT91_DBGU */ |
diff --git a/arch/arm/mach-at91/include/mach/at91_wdt.h b/arch/arm/mach-at91/include/mach/at91_wdt.h deleted file mode 100644 index fecc2e9f0ca8..000000000000 --- a/arch/arm/mach-at91/include/mach/at91_wdt.h +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-at91/include/mach/at91_wdt.h | ||
3 | * | ||
4 | * Copyright (C) 2007 Andrew Victor | ||
5 | * Copyright (C) 2007 Atmel Corporation. | ||
6 | * | ||
7 | * Watchdog Timer (WDT) - System peripherals regsters. | ||
8 | * Based on AT91SAM9261 datasheet revision D. | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License as published by | ||
12 | * the Free Software Foundation; either version 2 of the License, or | ||
13 | * (at your option) any later version. | ||
14 | */ | ||
15 | |||
16 | #ifndef AT91_WDT_H | ||
17 | #define AT91_WDT_H | ||
18 | |||
19 | #define AT91_WDT_CR (AT91_WDT + 0x00) /* Watchdog Control Register */ | ||
20 | #define AT91_WDT_WDRSTT (1 << 0) /* Restart */ | ||
21 | #define AT91_WDT_KEY (0xa5 << 24) /* KEY Password */ | ||
22 | |||
23 | #define AT91_WDT_MR (AT91_WDT + 0x04) /* Watchdog Mode Register */ | ||
24 | #define AT91_WDT_WDV (0xfff << 0) /* Counter Value */ | ||
25 | #define AT91_WDT_WDFIEN (1 << 12) /* Fault Interrupt Enable */ | ||
26 | #define AT91_WDT_WDRSTEN (1 << 13) /* Reset Processor */ | ||
27 | #define AT91_WDT_WDRPROC (1 << 14) /* Timer Restart */ | ||
28 | #define AT91_WDT_WDDIS (1 << 15) /* Watchdog Disable */ | ||
29 | #define AT91_WDT_WDD (0xfff << 16) /* Delta Value */ | ||
30 | #define AT91_WDT_WDDBGHLT (1 << 28) /* Debug Halt */ | ||
31 | #define AT91_WDT_WDIDLEHLT (1 << 29) /* Idle Halt */ | ||
32 | |||
33 | #define AT91_WDT_SR (AT91_WDT + 0x08) /* Watchdog Status Register */ | ||
34 | #define AT91_WDT_WDUNF (1 << 0) /* Watchdog Underflow */ | ||
35 | #define AT91_WDT_WDERR (1 << 1) /* Watchdog Error */ | ||
36 | |||
37 | #endif | ||
diff --git a/arch/arm/mach-at91/include/mach/at91cap9.h b/arch/arm/mach-at91/include/mach/at91cap9.h index 665993849a7b..c5df1e8f1955 100644 --- a/arch/arm/mach-at91/include/mach/at91cap9.h +++ b/arch/arm/mach-at91/include/mach/at91cap9.h | |||
@@ -75,7 +75,6 @@ | |||
75 | #define AT91CAP9_BASE_EMAC 0xfffbc000 | 75 | #define AT91CAP9_BASE_EMAC 0xfffbc000 |
76 | #define AT91CAP9_BASE_ADC 0xfffc0000 | 76 | #define AT91CAP9_BASE_ADC 0xfffc0000 |
77 | #define AT91CAP9_BASE_ISI 0xfffc4000 | 77 | #define AT91CAP9_BASE_ISI 0xfffc4000 |
78 | #define AT91_BASE_SYS 0xffffe200 | ||
79 | 78 | ||
80 | /* | 79 | /* |
81 | * System Peripherals (offset from AT91_BASE_SYS) | 80 | * System Peripherals (offset from AT91_BASE_SYS) |
diff --git a/arch/arm/mach-at91/include/mach/at91rm9200.h b/arch/arm/mach-at91/include/mach/at91rm9200.h index 99e0f8d02d7b..e4037b500302 100644 --- a/arch/arm/mach-at91/include/mach/at91rm9200.h +++ b/arch/arm/mach-at91/include/mach/at91rm9200.h | |||
@@ -74,7 +74,6 @@ | |||
74 | #define AT91RM9200_BASE_SSC1 0xfffd4000 | 74 | #define AT91RM9200_BASE_SSC1 0xfffd4000 |
75 | #define AT91RM9200_BASE_SSC2 0xfffd8000 | 75 | #define AT91RM9200_BASE_SSC2 0xfffd8000 |
76 | #define AT91RM9200_BASE_SPI 0xfffe0000 | 76 | #define AT91RM9200_BASE_SPI 0xfffe0000 |
77 | #define AT91_BASE_SYS 0xfffff000 | ||
78 | 77 | ||
79 | 78 | ||
80 | /* | 79 | /* |
diff --git a/arch/arm/mach-at91/include/mach/at91sam9260.h b/arch/arm/mach-at91/include/mach/at91sam9260.h index 8b6bf835cd73..9a791165913f 100644 --- a/arch/arm/mach-at91/include/mach/at91sam9260.h +++ b/arch/arm/mach-at91/include/mach/at91sam9260.h | |||
@@ -76,7 +76,6 @@ | |||
76 | #define AT91SAM9260_BASE_TC4 0xfffdc040 | 76 | #define AT91SAM9260_BASE_TC4 0xfffdc040 |
77 | #define AT91SAM9260_BASE_TC5 0xfffdc080 | 77 | #define AT91SAM9260_BASE_TC5 0xfffdc080 |
78 | #define AT91SAM9260_BASE_ADC 0xfffe0000 | 78 | #define AT91SAM9260_BASE_ADC 0xfffe0000 |
79 | #define AT91_BASE_SYS 0xffffe800 | ||
80 | 79 | ||
81 | /* | 80 | /* |
82 | * System Peripherals (offset from AT91_BASE_SYS) | 81 | * System Peripherals (offset from AT91_BASE_SYS) |
diff --git a/arch/arm/mach-at91/include/mach/at91sam9261.h b/arch/arm/mach-at91/include/mach/at91sam9261.h index eafbddaf523c..ce596204cefa 100644 --- a/arch/arm/mach-at91/include/mach/at91sam9261.h +++ b/arch/arm/mach-at91/include/mach/at91sam9261.h | |||
@@ -60,7 +60,6 @@ | |||
60 | #define AT91SAM9261_BASE_SSC2 0xfffc4000 | 60 | #define AT91SAM9261_BASE_SSC2 0xfffc4000 |
61 | #define AT91SAM9261_BASE_SPI0 0xfffc8000 | 61 | #define AT91SAM9261_BASE_SPI0 0xfffc8000 |
62 | #define AT91SAM9261_BASE_SPI1 0xfffcc000 | 62 | #define AT91SAM9261_BASE_SPI1 0xfffcc000 |
63 | #define AT91_BASE_SYS 0xffffea00 | ||
64 | 63 | ||
65 | 64 | ||
66 | /* | 65 | /* |
diff --git a/arch/arm/mach-at91/include/mach/at91sam9263.h b/arch/arm/mach-at91/include/mach/at91sam9263.h index e2d348213a7b..f1b92961a2b1 100644 --- a/arch/arm/mach-at91/include/mach/at91sam9263.h +++ b/arch/arm/mach-at91/include/mach/at91sam9263.h | |||
@@ -70,7 +70,6 @@ | |||
70 | #define AT91SAM9263_BASE_EMAC 0xfffbc000 | 70 | #define AT91SAM9263_BASE_EMAC 0xfffbc000 |
71 | #define AT91SAM9263_BASE_ISI 0xfffc4000 | 71 | #define AT91SAM9263_BASE_ISI 0xfffc4000 |
72 | #define AT91SAM9263_BASE_2DGE 0xfffc8000 | 72 | #define AT91SAM9263_BASE_2DGE 0xfffc8000 |
73 | #define AT91_BASE_SYS 0xffffe000 | ||
74 | 73 | ||
75 | /* | 74 | /* |
76 | * System Peripherals (offset from AT91_BASE_SYS) | 75 | * System Peripherals (offset from AT91_BASE_SYS) |
diff --git a/arch/arm/mach-at91/include/mach/at91sam9g45.h b/arch/arm/mach-at91/include/mach/at91sam9g45.h index 659304aa73d9..2c611b9a0138 100644 --- a/arch/arm/mach-at91/include/mach/at91sam9g45.h +++ b/arch/arm/mach-at91/include/mach/at91sam9g45.h | |||
@@ -82,7 +82,6 @@ | |||
82 | #define AT91SAM9G45_BASE_TC3 0xfffd4000 | 82 | #define AT91SAM9G45_BASE_TC3 0xfffd4000 |
83 | #define AT91SAM9G45_BASE_TC4 0xfffd4040 | 83 | #define AT91SAM9G45_BASE_TC4 0xfffd4040 |
84 | #define AT91SAM9G45_BASE_TC5 0xfffd4080 | 84 | #define AT91SAM9G45_BASE_TC5 0xfffd4080 |
85 | #define AT91_BASE_SYS 0xffffe200 | ||
86 | 85 | ||
87 | /* | 86 | /* |
88 | * System Peripherals (offset from AT91_BASE_SYS) | 87 | * System Peripherals (offset from AT91_BASE_SYS) |
diff --git a/arch/arm/mach-at91/include/mach/at91sam9rl.h b/arch/arm/mach-at91/include/mach/at91sam9rl.h index 41dbbe61055c..1aabacd315d4 100644 --- a/arch/arm/mach-at91/include/mach/at91sam9rl.h +++ b/arch/arm/mach-at91/include/mach/at91sam9rl.h | |||
@@ -64,7 +64,6 @@ | |||
64 | #define AT91SAM9RL_BASE_TSC 0xfffd0000 | 64 | #define AT91SAM9RL_BASE_TSC 0xfffd0000 |
65 | #define AT91SAM9RL_BASE_UDPHS 0xfffd4000 | 65 | #define AT91SAM9RL_BASE_UDPHS 0xfffd4000 |
66 | #define AT91SAM9RL_BASE_AC97C 0xfffd8000 | 66 | #define AT91SAM9RL_BASE_AC97C 0xfffd8000 |
67 | #define AT91_BASE_SYS 0xffffc000 | ||
68 | 67 | ||
69 | 68 | ||
70 | /* | 69 | /* |
diff --git a/arch/arm/mach-at91/include/mach/clkdev.h b/arch/arm/mach-at91/include/mach/clkdev.h deleted file mode 100644 index 04b37a89801c..000000000000 --- a/arch/arm/mach-at91/include/mach/clkdev.h +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | #ifndef __ASM_MACH_CLKDEV_H | ||
2 | #define __ASM_MACH_CLKDEV_H | ||
3 | |||
4 | #define __clk_get(clk) ({ 1; }) | ||
5 | #define __clk_put(clk) do { } while (0) | ||
6 | |||
7 | #endif | ||
diff --git a/arch/arm/mach-at91/include/mach/cpu.h b/arch/arm/mach-at91/include/mach/cpu.h index df966c2bc2d4..f6ce936dba2b 100644 --- a/arch/arm/mach-at91/include/mach/cpu.h +++ b/arch/arm/mach-at91/include/mach/cpu.h | |||
@@ -1,7 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * arch/arm/mach-at91/include/mach/cpu.h | 2 | * arch/arm/mach-at91/include/mach/cpu.h |
3 | * | 3 | * |
4 | * Copyright (C) 2006 SAN People | 4 | * Copyright (C) 2006 SAN People |
5 | * Copyright (C) 2011 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | ||
5 | * | 6 | * |
6 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 8 | * it under the terms of the GNU General Public License as published by |
@@ -10,12 +11,8 @@ | |||
10 | * | 11 | * |
11 | */ | 12 | */ |
12 | 13 | ||
13 | #ifndef __ASM_ARCH_CPU_H | 14 | #ifndef __MACH_CPU_H__ |
14 | #define __ASM_ARCH_CPU_H | 15 | #define __MACH_CPU_H__ |
15 | |||
16 | #include <mach/hardware.h> | ||
17 | #include <mach/at91_dbgu.h> | ||
18 | |||
19 | 16 | ||
20 | #define ARCH_ID_AT91RM9200 0x09290780 | 17 | #define ARCH_ID_AT91RM9200 0x09290780 |
21 | #define ARCH_ID_AT91SAM9260 0x019803a0 | 18 | #define ARCH_ID_AT91SAM9260 0x019803a0 |
@@ -39,16 +36,6 @@ | |||
39 | #define ARCH_ID_AT91M40807 0x14080745 | 36 | #define ARCH_ID_AT91M40807 0x14080745 |
40 | #define ARCH_ID_AT91R40008 0x44000840 | 37 | #define ARCH_ID_AT91R40008 0x44000840 |
41 | 38 | ||
42 | static inline unsigned long at91_cpu_identify(void) | ||
43 | { | ||
44 | return (at91_sys_read(AT91_DBGU_CIDR) & ~AT91_CIDR_VERSION); | ||
45 | } | ||
46 | |||
47 | static inline unsigned long at91_cpu_fully_identify(void) | ||
48 | { | ||
49 | return at91_sys_read(AT91_DBGU_CIDR); | ||
50 | } | ||
51 | |||
52 | #define ARCH_EXID_AT91SAM9M11 0x00000001 | 39 | #define ARCH_EXID_AT91SAM9M11 0x00000001 |
53 | #define ARCH_EXID_AT91SAM9M10 0x00000002 | 40 | #define ARCH_EXID_AT91SAM9M10 0x00000002 |
54 | #define ARCH_EXID_AT91SAM9G46 0x00000003 | 41 | #define ARCH_EXID_AT91SAM9G46 0x00000003 |
@@ -60,40 +47,80 @@ static inline unsigned long at91_cpu_fully_identify(void) | |||
60 | #define ARCH_EXID_AT91SAM9G25 0x00000003 | 47 | #define ARCH_EXID_AT91SAM9G25 0x00000003 |
61 | #define ARCH_EXID_AT91SAM9X25 0x00000004 | 48 | #define ARCH_EXID_AT91SAM9X25 0x00000004 |
62 | 49 | ||
63 | static inline unsigned long at91_exid_identify(void) | ||
64 | { | ||
65 | return at91_sys_read(AT91_DBGU_EXID); | ||
66 | } | ||
67 | |||
68 | |||
69 | #define ARCH_FAMILY_AT91X92 0x09200000 | 50 | #define ARCH_FAMILY_AT91X92 0x09200000 |
70 | #define ARCH_FAMILY_AT91SAM9 0x01900000 | 51 | #define ARCH_FAMILY_AT91SAM9 0x01900000 |
71 | #define ARCH_FAMILY_AT91SAM9XE 0x02900000 | 52 | #define ARCH_FAMILY_AT91SAM9XE 0x02900000 |
72 | 53 | ||
73 | static inline unsigned long at91_arch_identify(void) | 54 | /* PMC revision */ |
74 | { | ||
75 | return (at91_sys_read(AT91_DBGU_CIDR) & AT91_CIDR_ARCH); | ||
76 | } | ||
77 | |||
78 | #ifdef CONFIG_ARCH_AT91CAP9 | ||
79 | #include <mach/at91_pmc.h> | ||
80 | |||
81 | #define ARCH_REVISION_CAP9_B 0x399 | 55 | #define ARCH_REVISION_CAP9_B 0x399 |
82 | #define ARCH_REVISION_CAP9_C 0x601 | 56 | #define ARCH_REVISION_CAP9_C 0x601 |
83 | 57 | ||
84 | static inline unsigned long at91cap9_rev_identify(void) | 58 | /* RM9200 type */ |
59 | #define ARCH_REVISON_9200_BGA (0 << 0) | ||
60 | #define ARCH_REVISON_9200_PQFP (1 << 0) | ||
61 | |||
62 | enum at91_soc_type { | ||
63 | /* 920T */ | ||
64 | AT91_SOC_RM9200, | ||
65 | |||
66 | /* CAP */ | ||
67 | AT91_SOC_CAP9, | ||
68 | |||
69 | /* SAM92xx */ | ||
70 | AT91_SOC_SAM9260, AT91_SOC_SAM9261, AT91_SOC_SAM9263, | ||
71 | |||
72 | /* SAM9Gxx */ | ||
73 | AT91_SOC_SAM9G10, AT91_SOC_SAM9G20, AT91_SOC_SAM9G45, | ||
74 | |||
75 | /* SAM9RL */ | ||
76 | AT91_SOC_SAM9RL, | ||
77 | |||
78 | /* SAM9X5 */ | ||
79 | AT91_SOC_SAM9X5, | ||
80 | |||
81 | /* Unknown type */ | ||
82 | AT91_SOC_NONE | ||
83 | }; | ||
84 | |||
85 | enum at91_soc_subtype { | ||
86 | /* RM9200 */ | ||
87 | AT91_SOC_RM9200_BGA, AT91_SOC_RM9200_PQFP, | ||
88 | |||
89 | /* CAP9 */ | ||
90 | AT91_SOC_CAP9_REV_B, AT91_SOC_CAP9_REV_C, | ||
91 | |||
92 | /* SAM9260 */ | ||
93 | AT91_SOC_SAM9XE, | ||
94 | |||
95 | /* SAM9G45 */ | ||
96 | AT91_SOC_SAM9G45ES, AT91_SOC_SAM9M10, AT91_SOC_SAM9G46, AT91_SOC_SAM9M11, | ||
97 | |||
98 | /* SAM9X5 */ | ||
99 | AT91_SOC_SAM9G15, AT91_SOC_SAM9G35, AT91_SOC_SAM9X35, | ||
100 | AT91_SOC_SAM9G25, AT91_SOC_SAM9X25, | ||
101 | |||
102 | /* Unknown subtype */ | ||
103 | AT91_SOC_SUBTYPE_NONE | ||
104 | }; | ||
105 | |||
106 | struct at91_socinfo { | ||
107 | unsigned int type, subtype; | ||
108 | unsigned int cidr, exid; | ||
109 | }; | ||
110 | |||
111 | extern struct at91_socinfo at91_soc_initdata; | ||
112 | const char *at91_get_soc_type(struct at91_socinfo *c); | ||
113 | const char *at91_get_soc_subtype(struct at91_socinfo *c); | ||
114 | |||
115 | static inline int at91_soc_is_detected(void) | ||
85 | { | 116 | { |
86 | return (at91_sys_read(AT91_PMC_VER)); | 117 | return at91_soc_initdata.type != AT91_SOC_NONE; |
87 | } | 118 | } |
88 | #endif | ||
89 | 119 | ||
90 | #ifdef CONFIG_ARCH_AT91RM9200 | 120 | #ifdef CONFIG_ARCH_AT91RM9200 |
91 | extern int rm9200_type; | 121 | #define cpu_is_at91rm9200() (at91_soc_initdata.type == AT91_SOC_RM9200) |
92 | #define ARCH_REVISON_9200_BGA (0 << 0) | 122 | #define cpu_is_at91rm9200_bga() (at91_soc_initdata.subtype == AT91_SOC_RM9200_BGA) |
93 | #define ARCH_REVISON_9200_PQFP (1 << 0) | 123 | #define cpu_is_at91rm9200_pqfp() (at91_soc_initdata.subtype == AT91_SOC_RM9200_PQFP) |
94 | #define cpu_is_at91rm9200() (at91_cpu_identify() == ARCH_ID_AT91RM9200) | ||
95 | #define cpu_is_at91rm9200_bga() (!cpu_is_at91rm9200_pqfp()) | ||
96 | #define cpu_is_at91rm9200_pqfp() (cpu_is_at91rm9200() && rm9200_type & ARCH_REVISON_9200_PQFP) | ||
97 | #else | 124 | #else |
98 | #define cpu_is_at91rm9200() (0) | 125 | #define cpu_is_at91rm9200() (0) |
99 | #define cpu_is_at91rm9200_bga() (0) | 126 | #define cpu_is_at91rm9200_bga() (0) |
@@ -101,52 +128,49 @@ extern int rm9200_type; | |||
101 | #endif | 128 | #endif |
102 | 129 | ||
103 | #ifdef CONFIG_ARCH_AT91SAM9260 | 130 | #ifdef CONFIG_ARCH_AT91SAM9260 |
104 | #define cpu_is_at91sam9xe() (at91_arch_identify() == ARCH_FAMILY_AT91SAM9XE) | 131 | #define cpu_is_at91sam9xe() (at91_soc_initdata.subtype == AT91_SOC_SAM9XE) |
105 | #define cpu_is_at91sam9260() ((at91_cpu_identify() == ARCH_ID_AT91SAM9260) || cpu_is_at91sam9xe()) | 132 | #define cpu_is_at91sam9260() (at91_soc_initdata.type == AT91_SOC_SAM9260) |
106 | #else | 133 | #else |
107 | #define cpu_is_at91sam9xe() (0) | 134 | #define cpu_is_at91sam9xe() (0) |
108 | #define cpu_is_at91sam9260() (0) | 135 | #define cpu_is_at91sam9260() (0) |
109 | #endif | 136 | #endif |
110 | 137 | ||
111 | #ifdef CONFIG_ARCH_AT91SAM9G20 | 138 | #ifdef CONFIG_ARCH_AT91SAM9G20 |
112 | #define cpu_is_at91sam9g20() (at91_cpu_identify() == ARCH_ID_AT91SAM9G20) | 139 | #define cpu_is_at91sam9g20() (at91_soc_initdata.type == AT91_SOC_SAM9G20) |
113 | #else | 140 | #else |
114 | #define cpu_is_at91sam9g20() (0) | 141 | #define cpu_is_at91sam9g20() (0) |
115 | #endif | 142 | #endif |
116 | 143 | ||
117 | #ifdef CONFIG_ARCH_AT91SAM9261 | 144 | #ifdef CONFIG_ARCH_AT91SAM9261 |
118 | #define cpu_is_at91sam9261() (at91_cpu_identify() == ARCH_ID_AT91SAM9261) | 145 | #define cpu_is_at91sam9261() (at91_soc_initdata.type == AT91_SOC_SAM9261) |
119 | #else | 146 | #else |
120 | #define cpu_is_at91sam9261() (0) | 147 | #define cpu_is_at91sam9261() (0) |
121 | #endif | 148 | #endif |
122 | 149 | ||
123 | #ifdef CONFIG_ARCH_AT91SAM9G10 | 150 | #ifdef CONFIG_ARCH_AT91SAM9G10 |
124 | #define cpu_is_at91sam9g10() ((at91_cpu_identify() & ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) | 151 | #define cpu_is_at91sam9g10() (at91_soc_initdata.type == AT91_SOC_SAM9G10) |
125 | #else | 152 | #else |
126 | #define cpu_is_at91sam9g10() (0) | 153 | #define cpu_is_at91sam9g10() (0) |
127 | #endif | 154 | #endif |
128 | 155 | ||
129 | #ifdef CONFIG_ARCH_AT91SAM9263 | 156 | #ifdef CONFIG_ARCH_AT91SAM9263 |
130 | #define cpu_is_at91sam9263() (at91_cpu_identify() == ARCH_ID_AT91SAM9263) | 157 | #define cpu_is_at91sam9263() (at91_soc_initdata.type == AT91_SOC_SAM9263) |
131 | #else | 158 | #else |
132 | #define cpu_is_at91sam9263() (0) | 159 | #define cpu_is_at91sam9263() (0) |
133 | #endif | 160 | #endif |
134 | 161 | ||
135 | #ifdef CONFIG_ARCH_AT91SAM9RL | 162 | #ifdef CONFIG_ARCH_AT91SAM9RL |
136 | #define cpu_is_at91sam9rl() (at91_cpu_identify() == ARCH_ID_AT91SAM9RL64) | 163 | #define cpu_is_at91sam9rl() (at91_soc_initdata.type == AT91_SOC_SAM9RL) |
137 | #else | 164 | #else |
138 | #define cpu_is_at91sam9rl() (0) | 165 | #define cpu_is_at91sam9rl() (0) |
139 | #endif | 166 | #endif |
140 | 167 | ||
141 | #ifdef CONFIG_ARCH_AT91SAM9G45 | 168 | #ifdef CONFIG_ARCH_AT91SAM9G45 |
142 | #define cpu_is_at91sam9g45() (at91_cpu_identify() == ARCH_ID_AT91SAM9G45) | 169 | #define cpu_is_at91sam9g45() (at91_soc_initdata.type == AT91_SOC_SAM9G45) |
143 | #define cpu_is_at91sam9g45es() (at91_cpu_fully_identify() == ARCH_ID_AT91SAM9G45ES) | 170 | #define cpu_is_at91sam9g45es() (at91_soc_initdata.subtype == AT91_SOC_SAM9G45ES) |
144 | #define cpu_is_at91sam9m10() (cpu_is_at91sam9g45() && \ | 171 | #define cpu_is_at91sam9m10() (at91_soc_initdata.subtype == AT91_SOC_SAM9M10) |
145 | (at91_exid_identify() == ARCH_EXID_AT91SAM9M10)) | 172 | #define cpu_is_at91sam9g46() (at91_soc_initdata.subtype == AT91_SOC_SAM9G46) |
146 | #define cpu_is_at91sam9m46() (cpu_is_at91sam9g45() && \ | 173 | #define cpu_is_at91sam9m11() (at91_soc_initdata.subtype == AT91_SOC_SAM9M11) |
147 | (at91_exid_identify() == ARCH_EXID_AT91SAM9G46)) | ||
148 | #define cpu_is_at91sam9m11() (cpu_is_at91sam9g45() && \ | ||
149 | (at91_exid_identify() == ARCH_EXID_AT91SAM9M11)) | ||
150 | #else | 174 | #else |
151 | #define cpu_is_at91sam9g45() (0) | 175 | #define cpu_is_at91sam9g45() (0) |
152 | #define cpu_is_at91sam9g45es() (0) | 176 | #define cpu_is_at91sam9g45es() (0) |
@@ -156,17 +180,12 @@ extern int rm9200_type; | |||
156 | #endif | 180 | #endif |
157 | 181 | ||
158 | #ifdef CONFIG_ARCH_AT91SAM9X5 | 182 | #ifdef CONFIG_ARCH_AT91SAM9X5 |
159 | #define cpu_is_at91sam9x5() (at91_cpu_identify() == ARCH_ID_AT91SAM9X5) | 183 | #define cpu_is_at91sam9x5() (at91_soc_initdata.type == AT91_SOC_SAM9X5) |
160 | #define cpu_is_at91sam9g15() (cpu_is_at91sam9x5() && \ | 184 | #define cpu_is_at91sam9g15() (at91_soc_initdata.subtype == AT91_SOC_SAM9G15) |
161 | (at91_exid_identify() == ARCH_EXID_AT91SAM9G15)) | 185 | #define cpu_is_at91sam9g35() (at91_soc_initdata.subtype == AT91_SOC_SAM9G35) |
162 | #define cpu_is_at91sam9g35() (cpu_is_at91sam9x5() && \ | 186 | #define cpu_is_at91sam9x35() (at91_soc_initdata.subtype == AT91_SOC_SAM9X35) |
163 | (at91_exid_identify() == ARCH_EXID_AT91SAM9G35)) | 187 | #define cpu_is_at91sam9g25() (at91_soc_initdata.subtype == AT91_SOC_SAM9G25) |
164 | #define cpu_is_at91sam9x35() (cpu_is_at91sam9x5() && \ | 188 | #define cpu_is_at91sam9x25() (at91_soc_initdata.subtype == AT91_SOC_SAM9X25) |
165 | (at91_exid_identify() == ARCH_EXID_AT91SAM9X35)) | ||
166 | #define cpu_is_at91sam9g25() (cpu_is_at91sam9x5() && \ | ||
167 | (at91_exid_identify() == ARCH_EXID_AT91SAM9G25)) | ||
168 | #define cpu_is_at91sam9x25() (cpu_is_at91sam9x5() && \ | ||
169 | (at91_exid_identify() == ARCH_EXID_AT91SAM9X25)) | ||
170 | #else | 189 | #else |
171 | #define cpu_is_at91sam9x5() (0) | 190 | #define cpu_is_at91sam9x5() (0) |
172 | #define cpu_is_at91sam9g15() (0) | 191 | #define cpu_is_at91sam9g15() (0) |
@@ -177,9 +196,9 @@ extern int rm9200_type; | |||
177 | #endif | 196 | #endif |
178 | 197 | ||
179 | #ifdef CONFIG_ARCH_AT91CAP9 | 198 | #ifdef CONFIG_ARCH_AT91CAP9 |
180 | #define cpu_is_at91cap9() (at91_cpu_identify() == ARCH_ID_AT91CAP9) | 199 | #define cpu_is_at91cap9() (at91_soc_initdata.type == AT91_SOC_CAP9) |
181 | #define cpu_is_at91cap9_revB() (at91cap9_rev_identify() == ARCH_REVISION_CAP9_B) | 200 | #define cpu_is_at91cap9_revB() (at91_soc_initdata.subtype == AT91_SOC_CAP9_REV_B) |
182 | #define cpu_is_at91cap9_revC() (at91cap9_rev_identify() == ARCH_REVISION_CAP9_C) | 201 | #define cpu_is_at91cap9_revC() (at91_soc_initdata.subtype == AT91_SOC_CAP9_REV_C) |
183 | #else | 202 | #else |
184 | #define cpu_is_at91cap9() (0) | 203 | #define cpu_is_at91cap9() (0) |
185 | #define cpu_is_at91cap9_revB() (0) | 204 | #define cpu_is_at91cap9_revB() (0) |
@@ -192,4 +211,4 @@ extern int rm9200_type; | |||
192 | */ | 211 | */ |
193 | #define cpu_is_at32ap7000() (0) | 212 | #define cpu_is_at32ap7000() (0) |
194 | 213 | ||
195 | #endif | 214 | #endif /* __MACH_CPU_H__ */ |
diff --git a/arch/arm/mach-at91/include/mach/debug-macro.S b/arch/arm/mach-at91/include/mach/debug-macro.S index 0f959faf74a9..bc1e0b2e2f4f 100644 --- a/arch/arm/mach-at91/include/mach/debug-macro.S +++ b/arch/arm/mach-at91/include/mach/debug-macro.S | |||
@@ -15,23 +15,23 @@ | |||
15 | #include <mach/at91_dbgu.h> | 15 | #include <mach/at91_dbgu.h> |
16 | 16 | ||
17 | .macro addruart, rp, rv | 17 | .macro addruart, rp, rv |
18 | ldr \rp, =(AT91_BASE_SYS + AT91_DBGU) @ System peripherals (phys address) | 18 | ldr \rp, =(AT91_BASE_SYS + AT91_DBGU) @ System peripherals (phys address) |
19 | ldr \rv, =(AT91_VA_BASE_SYS + AT91_DBGU) @ System peripherals (virt address) | 19 | ldr \rv, =(AT91_VA_BASE_SYS + AT91_DBGU) @ System peripherals (virt address) |
20 | .endm | 20 | .endm |
21 | 21 | ||
22 | .macro senduart,rd,rx | 22 | .macro senduart,rd,rx |
23 | strb \rd, [\rx, #(AT91_DBGU_THR - AT91_DBGU)] @ Write to Transmitter Holding Register | 23 | strb \rd, [\rx, #(AT91_DBGU_THR)] @ Write to Transmitter Holding Register |
24 | .endm | 24 | .endm |
25 | 25 | ||
26 | .macro waituart,rd,rx | 26 | .macro waituart,rd,rx |
27 | 1001: ldr \rd, [\rx, #(AT91_DBGU_SR - AT91_DBGU)] @ Read Status Register | 27 | 1001: ldr \rd, [\rx, #(AT91_DBGU_SR)] @ Read Status Register |
28 | tst \rd, #AT91_DBGU_TXRDY @ DBGU_TXRDY = 1 when ready to transmit | 28 | tst \rd, #AT91_DBGU_TXRDY @ DBGU_TXRDY = 1 when ready to transmit |
29 | beq 1001b | 29 | beq 1001b |
30 | .endm | 30 | .endm |
31 | 31 | ||
32 | .macro busyuart,rd,rx | 32 | .macro busyuart,rd,rx |
33 | 1001: ldr \rd, [\rx, #(AT91_DBGU_SR - AT91_DBGU)] @ Read Status Register | 33 | 1001: ldr \rd, [\rx, #(AT91_DBGU_SR)] @ Read Status Register |
34 | tst \rd, #AT91_DBGU_TXEMPTY @ DBGU_TXEMPTY = 1 when transmission complete | 34 | tst \rd, #AT91_DBGU_TXEMPTY @ DBGU_TXEMPTY = 1 when transmission complete |
35 | beq 1001b | 35 | beq 1001b |
36 | .endm | 36 | .endm |
37 | 37 | ||
diff --git a/arch/arm/mach-at91/include/mach/hardware.h b/arch/arm/mach-at91/include/mach/hardware.h index 1008b9fb5074..483478d8be6b 100644 --- a/arch/arm/mach-at91/include/mach/hardware.h +++ b/arch/arm/mach-at91/include/mach/hardware.h | |||
@@ -36,6 +36,20 @@ | |||
36 | #error "Unsupported AT91 processor" | 36 | #error "Unsupported AT91 processor" |
37 | #endif | 37 | #endif |
38 | 38 | ||
39 | #if !defined(CONFIG_ARCH_AT91X40) | ||
40 | /* | ||
41 | * On all at91 except rm9200 and x40 have the System Controller starts | ||
42 | * at address 0xffffc000 and has a size of 16KiB. | ||
43 | * | ||
44 | * On rm9200 it's start at 0xfffe4000 of 111KiB with non reserved data starting | ||
45 | * at 0xfffff000 | ||
46 | * | ||
47 | * Removes the individual definitions of AT91_BASE_SYS and | ||
48 | * replaces them with a common version at base 0xfffffc000 and size 16KiB | ||
49 | * and map the same memory space | ||
50 | */ | ||
51 | #define AT91_BASE_SYS 0xffffc000 | ||
52 | #endif | ||
39 | 53 | ||
40 | /* | 54 | /* |
41 | * Peripheral identifiers/interrupts. | 55 | * Peripheral identifiers/interrupts. |
diff --git a/arch/arm/mach-at91/include/mach/io.h b/arch/arm/mach-at91/include/mach/io.h index 0b0cccc46e68..4298e7806c76 100644 --- a/arch/arm/mach-at91/include/mach/io.h +++ b/arch/arm/mach-at91/include/mach/io.h | |||
@@ -21,14 +21,23 @@ | |||
21 | #ifndef __ASM_ARCH_IO_H | 21 | #ifndef __ASM_ARCH_IO_H |
22 | #define __ASM_ARCH_IO_H | 22 | #define __ASM_ARCH_IO_H |
23 | 23 | ||
24 | #include <mach/hardware.h> | ||
25 | |||
24 | #define IO_SPACE_LIMIT 0xFFFFFFFF | 26 | #define IO_SPACE_LIMIT 0xFFFFFFFF |
25 | 27 | ||
26 | #define __io(a) __typesafe_io(a) | 28 | #define __io(a) __typesafe_io(a) |
27 | #define __mem_pci(a) (a) | 29 | #define __mem_pci(a) (a) |
28 | 30 | ||
29 | |||
30 | #ifndef __ASSEMBLY__ | 31 | #ifndef __ASSEMBLY__ |
31 | 32 | ||
33 | #ifndef CONFIG_ARCH_AT91X40 | ||
34 | #define __arch_ioremap at91_ioremap | ||
35 | #define __arch_iounmap at91_iounmap | ||
36 | #endif | ||
37 | |||
38 | void __iomem *at91_ioremap(unsigned long phys, size_t size, unsigned int type); | ||
39 | void at91_iounmap(volatile void __iomem *addr); | ||
40 | |||
32 | static inline unsigned int at91_sys_read(unsigned int reg_offset) | 41 | static inline unsigned int at91_sys_read(unsigned int reg_offset) |
33 | { | 42 | { |
34 | void __iomem *addr = (void __iomem *)AT91_VA_BASE_SYS; | 43 | void __iomem *addr = (void __iomem *)AT91_VA_BASE_SYS; |