diff options
Diffstat (limited to 'include/asm-arm')
161 files changed, 3835 insertions, 705 deletions
diff --git a/include/asm-arm/arch-aaec2000/aaec2000.h b/include/asm-arm/arch-aaec2000/aaec2000.h index 0e9b7e18af05..002227924b9f 100644 --- a/include/asm-arm/arch-aaec2000/aaec2000.h +++ b/include/asm-arm/arch-aaec2000/aaec2000.h | |||
@@ -17,6 +17,16 @@ | |||
17 | #error You must include hardware.h not this file | 17 | #error You must include hardware.h not this file |
18 | #endif /* __ASM_ARCH_HARDWARE_H */ | 18 | #endif /* __ASM_ARCH_HARDWARE_H */ |
19 | 19 | ||
20 | /* Chip selects */ | ||
21 | #define AAEC_CS0 0x00000000 | ||
22 | #define AAEC_CS1 0x10000000 | ||
23 | #define AAEC_CS2 0x20000000 | ||
24 | #define AAEC_CS3 0x30000000 | ||
25 | |||
26 | /* Flash */ | ||
27 | #define AAEC_FLASH_BASE AAEC_CS0 | ||
28 | #define AAEC_FLASH_SIZE SZ_64M | ||
29 | |||
20 | /* Interrupt controller */ | 30 | /* Interrupt controller */ |
21 | #define IRQ_BASE __REG(0x80000500) | 31 | #define IRQ_BASE __REG(0x80000500) |
22 | #define IRQ_INTSR __REG(0x80000500) /* Int Status Register */ | 32 | #define IRQ_INTSR __REG(0x80000500) /* Int Status Register */ |
@@ -148,4 +158,50 @@ | |||
148 | #define POWER_STFCLR __REG(0x8000041c) /* NbFlg, RSTFlg, PFFlg, CLDFlg Clear */ | 158 | #define POWER_STFCLR __REG(0x8000041c) /* NbFlg, RSTFlg, PFFlg, CLDFlg Clear */ |
149 | #define POWER_CLKSET __REG(0x80000420) /* Clock Speed Control */ | 159 | #define POWER_CLKSET __REG(0x80000420) /* Clock Speed Control */ |
150 | 160 | ||
161 | /* GPIO Registers */ | ||
162 | #define AAEC_GPIO_PHYS 0x80000e00 | ||
163 | |||
164 | #define AAEC_GPIO_PADR __REG(AAEC_GPIO_PHYS + 0x00) | ||
165 | #define AAEC_GPIO_PBDR __REG(AAEC_GPIO_PHYS + 0x04) | ||
166 | #define AAEC_GPIO_PCDR __REG(AAEC_GPIO_PHYS + 0x08) | ||
167 | #define AAEC_GPIO_PDDR __REG(AAEC_GPIO_PHYS + 0x0c) | ||
168 | #define AAEC_GPIO_PADDR __REG(AAEC_GPIO_PHYS + 0x10) | ||
169 | #define AAEC_GPIO_PBDDR __REG(AAEC_GPIO_PHYS + 0x14) | ||
170 | #define AAEC_GPIO_PCDDR __REG(AAEC_GPIO_PHYS + 0x18) | ||
171 | #define AAEC_GPIO_PDDDR __REG(AAEC_GPIO_PHYS + 0x1c) | ||
172 | #define AAEC_GPIO_PEDR __REG(AAEC_GPIO_PHYS + 0x20) | ||
173 | #define AAEC_GPIO_PEDDR __REG(AAEC_GPIO_PHYS + 0x24) | ||
174 | #define AAEC_GPIO_KSCAN __REG(AAEC_GPIO_PHYS + 0x28) | ||
175 | #define AAEC_GPIO_PINMUX __REG(AAEC_GPIO_PHYS + 0x2c) | ||
176 | #define AAEC_GPIO_PFDR __REG(AAEC_GPIO_PHYS + 0x30) | ||
177 | #define AAEC_GPIO_PFDDR __REG(AAEC_GPIO_PHYS + 0x34) | ||
178 | #define AAEC_GPIO_PGDR __REG(AAEC_GPIO_PHYS + 0x38) | ||
179 | #define AAEC_GPIO_PGDDR __REG(AAEC_GPIO_PHYS + 0x3c) | ||
180 | #define AAEC_GPIO_PHDR __REG(AAEC_GPIO_PHYS + 0x40) | ||
181 | #define AAEC_GPIO_PHDDR __REG(AAEC_GPIO_PHYS + 0x44) | ||
182 | #define AAEC_GPIO_RAZ __REG(AAEC_GPIO_PHYS + 0x48) | ||
183 | #define AAEC_GPIO_INTTYPE1 __REG(AAEC_GPIO_PHYS + 0x4c) | ||
184 | #define AAEC_GPIO_INTTYPE2 __REG(AAEC_GPIO_PHYS + 0x50) | ||
185 | #define AAEC_GPIO_FEOI __REG(AAEC_GPIO_PHYS + 0x54) | ||
186 | #define AAEC_GPIO_INTEN __REG(AAEC_GPIO_PHYS + 0x58) | ||
187 | #define AAEC_GPIO_INTSTATUS __REG(AAEC_GPIO_PHYS + 0x5c) | ||
188 | #define AAEC_GPIO_RAWINTSTATUS __REG(AAEC_GPIO_PHYS + 0x60) | ||
189 | #define AAEC_GPIO_DB __REG(AAEC_GPIO_PHYS + 0x64) | ||
190 | #define AAEC_GPIO_PAPINDR __REG(AAEC_GPIO_PHYS + 0x68) | ||
191 | #define AAEC_GPIO_PBPINDR __REG(AAEC_GPIO_PHYS + 0x6c) | ||
192 | #define AAEC_GPIO_PCPINDR __REG(AAEC_GPIO_PHYS + 0x70) | ||
193 | #define AAEC_GPIO_PDPINDR __REG(AAEC_GPIO_PHYS + 0x74) | ||
194 | #define AAEC_GPIO_PEPINDR __REG(AAEC_GPIO_PHYS + 0x78) | ||
195 | #define AAEC_GPIO_PFPINDR __REG(AAEC_GPIO_PHYS + 0x7c) | ||
196 | #define AAEC_GPIO_PGPINDR __REG(AAEC_GPIO_PHYS + 0x80) | ||
197 | #define AAEC_GPIO_PHPINDR __REG(AAEC_GPIO_PHYS + 0x84) | ||
198 | |||
199 | #define AAEC_GPIO_PINMUX_PE0CON (1 << 0) | ||
200 | #define AAEC_GPIO_PINMUX_PD0CON (1 << 1) | ||
201 | #define AAEC_GPIO_PINMUX_CODECON (1 << 2) | ||
202 | #define AAEC_GPIO_PINMUX_UART3CON (1 << 3) | ||
203 | |||
204 | /* LCD Controller */ | ||
205 | #define AAEC_CLCD_PHYS 0x80003000 | ||
206 | |||
151 | #endif /* __ARM_ARCH_AAEC2000_H */ | 207 | #endif /* __ARM_ARCH_AAEC2000_H */ |
diff --git a/include/asm-arm/arch-aaec2000/aaed2000.h b/include/asm-arm/arch-aaec2000/aaed2000.h new file mode 100644 index 000000000000..bc76d2badb91 --- /dev/null +++ b/include/asm-arm/arch-aaec2000/aaed2000.h | |||
@@ -0,0 +1,40 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-aaec2000/aaed2000.h | ||
3 | * | ||
4 | * AAED-2000 specific bits definition | ||
5 | * | ||
6 | * Copyright (c) 2005 Nicolas Bellido Y Ortega | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #ifndef __ASM_ARCH_AAED2000_H | ||
14 | #define __ASM_ARCH_AAED2000_H | ||
15 | |||
16 | /* External GPIOs. */ | ||
17 | |||
18 | #define EXT_GPIO_PBASE AAEC_CS3 | ||
19 | #define EXT_GPIO_VBASE 0xf8100000 | ||
20 | #define EXT_GPIO_LENGTH 0x00001000 | ||
21 | |||
22 | #define __ext_gpio_p2v(x) ((x) - EXT_GPIO_PBASE + EXT_GPIO_VBASE) | ||
23 | #define __ext_gpio_v2p(x) ((x) + EXT_GPIO_PBASE - EXT_GPIO_VBASE) | ||
24 | |||
25 | #define __EXT_GPIO_REG(x) (*((volatile u32 *)__ext_gpio_p2v(x))) | ||
26 | #define __EXT_GPIO_PREG(x) (__ext_gpio_v2p((u32)&(x))) | ||
27 | |||
28 | #define AAED_EXT_GPIO __EXT_GPIO_REG(EXT_GPIO_PBASE) | ||
29 | |||
30 | #define AAED_EGPIO_KBD_SCAN 0x00003fff /* Keyboard scan data */ | ||
31 | #define AAED_EGPIO_PWR_INT 0x00008fff /* Smart battery charger interrupt */ | ||
32 | #define AAED_EGPIO_SWITCHED 0x000f0000 /* DIP Switches */ | ||
33 | #define AAED_EGPIO_USB_VBUS 0x00400000 /* USB Vbus sense */ | ||
34 | #define AAED_EGPIO_LCD_PWR_EN 0x02000000 /* LCD and backlight PWR enable */ | ||
35 | #define AAED_EGPIO_nLED0 0x20000000 /* LED 0 */ | ||
36 | #define AAED_EGPIO_nLED1 0x20000000 /* LED 1 */ | ||
37 | #define AAED_EGPIO_nLED2 0x20000000 /* LED 2 */ | ||
38 | |||
39 | |||
40 | #endif /* __ARM_ARCH_AAED2000_H */ | ||
diff --git a/include/asm-arm/arch-aaec2000/hardware.h b/include/asm-arm/arch-aaec2000/hardware.h index 4c37219e030e..153506fd06ed 100644 --- a/include/asm-arm/arch-aaec2000/hardware.h +++ b/include/asm-arm/arch-aaec2000/hardware.h | |||
@@ -11,7 +11,8 @@ | |||
11 | #ifndef __ASM_ARCH_HARDWARE_H | 11 | #ifndef __ASM_ARCH_HARDWARE_H |
12 | #define __ASM_ARCH_HARDWARE_H | 12 | #define __ASM_ARCH_HARDWARE_H |
13 | 13 | ||
14 | #include <linux/config.h> | 14 | #include <asm/sizes.h> |
15 | #include <asm/arch/aaec2000.h> | ||
15 | 16 | ||
16 | /* The kernel is loaded at physical address 0xf8000000. | 17 | /* The kernel is loaded at physical address 0xf8000000. |
17 | * We map the IO space a bit after | 18 | * We map the IO space a bit after |
diff --git a/include/asm-arm/arch-aaec2000/io.h b/include/asm-arm/arch-aaec2000/io.h index c58a8d10425a..8d67907fd4f0 100644 --- a/include/asm-arm/arch-aaec2000/io.h +++ b/include/asm-arm/arch-aaec2000/io.h | |||
@@ -6,6 +6,8 @@ | |||
6 | #ifndef __ASM_ARM_ARCH_IO_H | 6 | #ifndef __ASM_ARM_ARCH_IO_H |
7 | #define __ASM_ARM_ARCH_IO_H | 7 | #define __ASM_ARM_ARCH_IO_H |
8 | 8 | ||
9 | #include <asm/hardware.h> | ||
10 | |||
9 | #define IO_SPACE_LIMIT 0xffffffff | 11 | #define IO_SPACE_LIMIT 0xffffffff |
10 | 12 | ||
11 | /* | 13 | /* |
diff --git a/include/asm-arm/arch-aaec2000/memory.h b/include/asm-arm/arch-aaec2000/memory.h index 79c90813bc3e..d8209f8911d6 100644 --- a/include/asm-arm/arch-aaec2000/memory.h +++ b/include/asm-arm/arch-aaec2000/memory.h | |||
@@ -13,7 +13,7 @@ | |||
13 | 13 | ||
14 | #include <linux/config.h> | 14 | #include <linux/config.h> |
15 | 15 | ||
16 | #define PHYS_OFFSET (0xf0000000UL) | 16 | #define PHYS_OFFSET UL(0xf0000000) |
17 | 17 | ||
18 | #define __virt_to_bus(x) __virt_to_phys(x) | 18 | #define __virt_to_bus(x) __virt_to_phys(x) |
19 | #define __bus_to_virt(x) __phys_to_virt(x) | 19 | #define __bus_to_virt(x) __phys_to_virt(x) |
diff --git a/include/asm-arm/arch-cl7500/io.h b/include/asm-arm/arch-cl7500/io.h index f0113bc75630..89a33287f4fe 100644 --- a/include/asm-arm/arch-cl7500/io.h +++ b/include/asm-arm/arch-cl7500/io.h | |||
@@ -10,6 +10,8 @@ | |||
10 | #ifndef __ASM_ARM_ARCH_IO_H | 10 | #ifndef __ASM_ARM_ARCH_IO_H |
11 | #define __ASM_ARM_ARCH_IO_H | 11 | #define __ASM_ARM_ARCH_IO_H |
12 | 12 | ||
13 | #include <asm/hardware.h> | ||
14 | |||
13 | #define IO_SPACE_LIMIT 0xffffffff | 15 | #define IO_SPACE_LIMIT 0xffffffff |
14 | 16 | ||
15 | /* | 17 | /* |
diff --git a/include/asm-arm/arch-cl7500/memory.h b/include/asm-arm/arch-cl7500/memory.h index 9776bba8e585..34f40a6cec30 100644 --- a/include/asm-arm/arch-cl7500/memory.h +++ b/include/asm-arm/arch-cl7500/memory.h | |||
@@ -17,7 +17,7 @@ | |||
17 | /* | 17 | /* |
18 | * Physical DRAM offset. | 18 | * Physical DRAM offset. |
19 | */ | 19 | */ |
20 | #define PHYS_OFFSET (0x10000000UL) | 20 | #define PHYS_OFFSET UL(0x10000000) |
21 | 21 | ||
22 | /* | 22 | /* |
23 | * These are exactly the same on the RiscPC as the | 23 | * These are exactly the same on the RiscPC as the |
diff --git a/include/asm-arm/arch-clps711x/io.h b/include/asm-arm/arch-clps711x/io.h index 14d7e8da5453..62613b0e2d96 100644 --- a/include/asm-arm/arch-clps711x/io.h +++ b/include/asm-arm/arch-clps711x/io.h | |||
@@ -20,6 +20,8 @@ | |||
20 | #ifndef __ASM_ARM_ARCH_IO_H | 20 | #ifndef __ASM_ARM_ARCH_IO_H |
21 | #define __ASM_ARM_ARCH_IO_H | 21 | #define __ASM_ARM_ARCH_IO_H |
22 | 22 | ||
23 | #include <asm/hardware.h> | ||
24 | |||
23 | #define IO_SPACE_LIMIT 0xffffffff | 25 | #define IO_SPACE_LIMIT 0xffffffff |
24 | 26 | ||
25 | #define __io(a) ((void __iomem *)(a)) | 27 | #define __io(a) ((void __iomem *)(a)) |
diff --git a/include/asm-arm/arch-clps711x/memory.h b/include/asm-arm/arch-clps711x/memory.h index bd978947db42..61d8717406ce 100644 --- a/include/asm-arm/arch-clps711x/memory.h +++ b/include/asm-arm/arch-clps711x/memory.h | |||
@@ -25,7 +25,7 @@ | |||
25 | /* | 25 | /* |
26 | * Physical DRAM offset. | 26 | * Physical DRAM offset. |
27 | */ | 27 | */ |
28 | #define PHYS_OFFSET (0xc0000000UL) | 28 | #define PHYS_OFFSET UL(0xc0000000) |
29 | 29 | ||
30 | /* | 30 | /* |
31 | * Virtual view <-> DMA view memory address translations | 31 | * Virtual view <-> DMA view memory address translations |
diff --git a/include/asm-arm/arch-clps711x/uncompress.h b/include/asm-arm/arch-clps711x/uncompress.h index 7d0ab791b16c..9fc4bcfa1681 100644 --- a/include/asm-arm/arch-clps711x/uncompress.h +++ b/include/asm-arm/arch-clps711x/uncompress.h | |||
@@ -19,7 +19,7 @@ | |||
19 | */ | 19 | */ |
20 | #include <linux/config.h> | 20 | #include <linux/config.h> |
21 | #include <asm/arch/io.h> | 21 | #include <asm/arch/io.h> |
22 | #include <asm/arch/hardware.h> | 22 | #include <asm/hardware.h> |
23 | #include <asm/hardware/clps7111.h> | 23 | #include <asm/hardware/clps7111.h> |
24 | 24 | ||
25 | #undef CLPS7111_BASE | 25 | #undef CLPS7111_BASE |
diff --git a/include/asm-arm/arch-ebsa110/io.h b/include/asm-arm/arch-ebsa110/io.h index 68e04c0bb3f7..ae048441c9ed 100644 --- a/include/asm-arm/arch-ebsa110/io.h +++ b/include/asm-arm/arch-ebsa110/io.h | |||
@@ -64,7 +64,7 @@ void __writel(u32 val, void __iomem *addr); | |||
64 | #define writew(v,b) __writew(v,b) | 64 | #define writew(v,b) __writew(v,b) |
65 | #define writel(v,b) __writel(v,b) | 65 | #define writel(v,b) __writel(v,b) |
66 | 66 | ||
67 | #define __arch_ioremap(cookie,sz,c,a) ((void __iomem *)(cookie)) | 67 | #define __arch_ioremap(cookie,sz,c) ((void __iomem *)(cookie)) |
68 | #define __arch_iounmap(cookie) do { } while (0) | 68 | #define __arch_iounmap(cookie) do { } while (0) |
69 | 69 | ||
70 | extern void insb(unsigned int port, void *buf, int sz); | 70 | extern void insb(unsigned int port, void *buf, int sz); |
diff --git a/include/asm-arm/arch-ebsa110/memory.h b/include/asm-arm/arch-ebsa110/memory.h index 5a9493e12275..02f144520c10 100644 --- a/include/asm-arm/arch-ebsa110/memory.h +++ b/include/asm-arm/arch-ebsa110/memory.h | |||
@@ -19,7 +19,7 @@ | |||
19 | /* | 19 | /* |
20 | * Physical DRAM offset. | 20 | * Physical DRAM offset. |
21 | */ | 21 | */ |
22 | #define PHYS_OFFSET (0x00000000UL) | 22 | #define PHYS_OFFSET UL(0x00000000) |
23 | 23 | ||
24 | /* | 24 | /* |
25 | * We keep this 1:1 so that we don't interfere | 25 | * We keep this 1:1 so that we don't interfere |
diff --git a/include/asm-arm/arch-ebsa285/io.h b/include/asm-arm/arch-ebsa285/io.h index 70576b17f922..776f9d377057 100644 --- a/include/asm-arm/arch-ebsa285/io.h +++ b/include/asm-arm/arch-ebsa285/io.h | |||
@@ -14,6 +14,8 @@ | |||
14 | #ifndef __ASM_ARM_ARCH_IO_H | 14 | #ifndef __ASM_ARM_ARCH_IO_H |
15 | #define __ASM_ARM_ARCH_IO_H | 15 | #define __ASM_ARM_ARCH_IO_H |
16 | 16 | ||
17 | #include <asm/hardware.h> | ||
18 | |||
17 | #define IO_SPACE_LIMIT 0xffff | 19 | #define IO_SPACE_LIMIT 0xffff |
18 | 20 | ||
19 | /* | 21 | /* |
diff --git a/include/asm-arm/arch-ebsa285/memory.h b/include/asm-arm/arch-ebsa285/memory.h index d0466f9987d3..09e335cd687d 100644 --- a/include/asm-arm/arch-ebsa285/memory.h +++ b/include/asm-arm/arch-ebsa285/memory.h | |||
@@ -46,14 +46,14 @@ extern unsigned long __bus_to_virt(unsigned long); | |||
46 | #if defined(CONFIG_ARCH_FOOTBRIDGE) | 46 | #if defined(CONFIG_ARCH_FOOTBRIDGE) |
47 | 47 | ||
48 | /* Task size and page offset at 3GB */ | 48 | /* Task size and page offset at 3GB */ |
49 | #define TASK_SIZE (0xbf000000UL) | 49 | #define TASK_SIZE UL(0xbf000000) |
50 | #define PAGE_OFFSET (0xc0000000UL) | 50 | #define PAGE_OFFSET UL(0xc0000000) |
51 | 51 | ||
52 | #elif defined(CONFIG_ARCH_CO285) | 52 | #elif defined(CONFIG_ARCH_CO285) |
53 | 53 | ||
54 | /* Task size and page offset at 1.5GB */ | 54 | /* Task size and page offset at 1.5GB */ |
55 | #define TASK_SIZE (0x5f000000UL) | 55 | #define TASK_SIZE UL(0x5f000000) |
56 | #define PAGE_OFFSET (0x60000000UL) | 56 | #define PAGE_OFFSET UL(0x60000000) |
57 | 57 | ||
58 | #else | 58 | #else |
59 | 59 | ||
@@ -64,7 +64,7 @@ extern unsigned long __bus_to_virt(unsigned long); | |||
64 | /* | 64 | /* |
65 | * Physical DRAM offset. | 65 | * Physical DRAM offset. |
66 | */ | 66 | */ |
67 | #define PHYS_OFFSET (0x00000000UL) | 67 | #define PHYS_OFFSET UL(0x00000000) |
68 | 68 | ||
69 | /* | 69 | /* |
70 | * This decides where the kernel will search for a free chunk of vm | 70 | * This decides where the kernel will search for a free chunk of vm |
diff --git a/include/asm-arm/arch-epxa10db/io.h b/include/asm-arm/arch-epxa10db/io.h index 1f0afa257621..9fe100c9d6be 100644 --- a/include/asm-arm/arch-epxa10db/io.h +++ b/include/asm-arm/arch-epxa10db/io.h | |||
@@ -20,6 +20,8 @@ | |||
20 | #ifndef __ASM_ARM_ARCH_IO_H | 20 | #ifndef __ASM_ARM_ARCH_IO_H |
21 | #define __ASM_ARM_ARCH_IO_H | 21 | #define __ASM_ARM_ARCH_IO_H |
22 | 22 | ||
23 | #include <asm/hardware.h> | ||
24 | |||
23 | #define IO_SPACE_LIMIT 0xffff | 25 | #define IO_SPACE_LIMIT 0xffff |
24 | 26 | ||
25 | 27 | ||
diff --git a/include/asm-arm/arch-epxa10db/memory.h b/include/asm-arm/arch-epxa10db/memory.h index 3f86bf7f67f0..999541b6a9f5 100644 --- a/include/asm-arm/arch-epxa10db/memory.h +++ b/include/asm-arm/arch-epxa10db/memory.h | |||
@@ -23,7 +23,7 @@ | |||
23 | /* | 23 | /* |
24 | * Physical DRAM offset. | 24 | * Physical DRAM offset. |
25 | */ | 25 | */ |
26 | #define PHYS_OFFSET (0x00000000UL) | 26 | #define PHYS_OFFSET UL(0x00000000) |
27 | 27 | ||
28 | /* | 28 | /* |
29 | * Virtual view <-> DMA view memory address translations | 29 | * Virtual view <-> DMA view memory address translations |
diff --git a/include/asm-arm/arch-epxa10db/uncompress.h b/include/asm-arm/arch-epxa10db/uncompress.h index d33ad6a93749..fdfe0e6848f8 100644 --- a/include/asm-arm/arch-epxa10db/uncompress.h +++ b/include/asm-arm/arch-epxa10db/uncompress.h | |||
@@ -19,7 +19,7 @@ | |||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
20 | */ | 20 | */ |
21 | #include "asm/arch/platform.h" | 21 | #include "asm/arch/platform.h" |
22 | #include "asm/arch/hardware.h" | 22 | #include "asm/hardware.h" |
23 | #define UART00_TYPE (volatile unsigned int*) | 23 | #define UART00_TYPE (volatile unsigned int*) |
24 | #include "asm/arch/uart00.h" | 24 | #include "asm/arch/uart00.h" |
25 | 25 | ||
diff --git a/include/asm-arm/arch-h720x/io.h b/include/asm-arm/arch-h720x/io.h index 68814828c9a7..d3ccfd8172b7 100644 --- a/include/asm-arm/arch-h720x/io.h +++ b/include/asm-arm/arch-h720x/io.h | |||
@@ -14,7 +14,7 @@ | |||
14 | #ifndef __ASM_ARM_ARCH_IO_H | 14 | #ifndef __ASM_ARM_ARCH_IO_H |
15 | #define __ASM_ARM_ARCH_IO_H | 15 | #define __ASM_ARM_ARCH_IO_H |
16 | 16 | ||
17 | #include <asm/arch/hardware.h> | 17 | #include <asm/hardware.h> |
18 | 18 | ||
19 | #define IO_SPACE_LIMIT 0xffffffff | 19 | #define IO_SPACE_LIMIT 0xffffffff |
20 | 20 | ||
diff --git a/include/asm-arm/arch-h720x/memory.h b/include/asm-arm/arch-h720x/memory.h index 5633447af268..4a1bfd78a0fe 100644 --- a/include/asm-arm/arch-h720x/memory.h +++ b/include/asm-arm/arch-h720x/memory.h | |||
@@ -11,7 +11,7 @@ | |||
11 | * Page offset: | 11 | * Page offset: |
12 | * ( 0xc0000000UL ) | 12 | * ( 0xc0000000UL ) |
13 | */ | 13 | */ |
14 | #define PHYS_OFFSET (0x40000000UL) | 14 | #define PHYS_OFFSET UL(0x40000000) |
15 | 15 | ||
16 | /* | 16 | /* |
17 | * Virtual view <-> DMA view memory address translations | 17 | * Virtual view <-> DMA view memory address translations |
diff --git a/include/asm-arm/arch-h720x/system.h b/include/asm-arm/arch-h720x/system.h index 0b025e227ec2..09eda84592ff 100644 --- a/include/asm-arm/arch-h720x/system.h +++ b/include/asm-arm/arch-h720x/system.h | |||
@@ -17,9 +17,11 @@ | |||
17 | static void arch_idle(void) | 17 | static void arch_idle(void) |
18 | { | 18 | { |
19 | CPU_REG (PMU_BASE, PMU_MODE) = PMU_MODE_IDLE; | 19 | CPU_REG (PMU_BASE, PMU_MODE) = PMU_MODE_IDLE; |
20 | __asm__ __volatile__( | 20 | nop(); |
21 | "mov r0, r0\n\t" | 21 | nop(); |
22 | "mov r0, r0"); | 22 | CPU_REG (PMU_BASE, PMU_MODE) = PMU_MODE_RUN; |
23 | nop(); | ||
24 | nop(); | ||
23 | } | 25 | } |
24 | 26 | ||
25 | 27 | ||
diff --git a/include/asm-arm/arch-h720x/uncompress.h b/include/asm-arm/arch-h720x/uncompress.h index 2fffacf85a01..9535764bcc71 100644 --- a/include/asm-arm/arch-h720x/uncompress.h +++ b/include/asm-arm/arch-h720x/uncompress.h | |||
@@ -7,7 +7,7 @@ | |||
7 | #ifndef __ASM_ARCH_UNCOMPRESS_H | 7 | #ifndef __ASM_ARCH_UNCOMPRESS_H |
8 | #define __ASM_ARCH_UNCOMPRESS_H | 8 | #define __ASM_ARCH_UNCOMPRESS_H |
9 | 9 | ||
10 | #include <asm/arch/hardware.h> | 10 | #include <asm/hardware.h> |
11 | 11 | ||
12 | #define LSR 0x14 | 12 | #define LSR 0x14 |
13 | #define TEMPTY 0x40 | 13 | #define TEMPTY 0x40 |
diff --git a/include/asm-arm/arch-imx/imx-regs.h b/include/asm-arm/arch-imx/imx-regs.h index 93b840e8fa60..a6912b3d8671 100644 --- a/include/asm-arm/arch-imx/imx-regs.h +++ b/include/asm-arm/arch-imx/imx-regs.h | |||
@@ -76,6 +76,7 @@ | |||
76 | #define GPIO_PIN_MASK 0x1f | 76 | #define GPIO_PIN_MASK 0x1f |
77 | #define GPIO_PORT_MASK (0x3 << 5) | 77 | #define GPIO_PORT_MASK (0x3 << 5) |
78 | 78 | ||
79 | #define GPIO_PORT_SHIFT 5 | ||
79 | #define GPIO_PORTA (0<<5) | 80 | #define GPIO_PORTA (0<<5) |
80 | #define GPIO_PORTB (1<<5) | 81 | #define GPIO_PORTB (1<<5) |
81 | #define GPIO_PORTC (2<<5) | 82 | #define GPIO_PORTC (2<<5) |
@@ -88,24 +89,37 @@ | |||
88 | #define GPIO_PF (0<<9) | 89 | #define GPIO_PF (0<<9) |
89 | #define GPIO_AF (1<<9) | 90 | #define GPIO_AF (1<<9) |
90 | 91 | ||
92 | #define GPIO_OCR_SHIFT 10 | ||
91 | #define GPIO_OCR_MASK (3<<10) | 93 | #define GPIO_OCR_MASK (3<<10) |
92 | #define GPIO_AIN (0<<10) | 94 | #define GPIO_AIN (0<<10) |
93 | #define GPIO_BIN (1<<10) | 95 | #define GPIO_BIN (1<<10) |
94 | #define GPIO_CIN (2<<10) | 96 | #define GPIO_CIN (2<<10) |
95 | #define GPIO_GPIO (3<<10) | 97 | #define GPIO_DR (3<<10) |
96 | 98 | ||
97 | #define GPIO_AOUT (1<<12) | 99 | #define GPIO_AOUT_SHIFT 12 |
98 | #define GPIO_BOUT (1<<13) | 100 | #define GPIO_AOUT_MASK (3<<12) |
101 | #define GPIO_AOUT (0<<12) | ||
102 | #define GPIO_AOUT_ISR (1<<12) | ||
103 | #define GPIO_AOUT_0 (2<<12) | ||
104 | #define GPIO_AOUT_1 (3<<12) | ||
105 | |||
106 | #define GPIO_BOUT_SHIFT 14 | ||
107 | #define GPIO_BOUT_MASK (3<<14) | ||
108 | #define GPIO_BOUT (0<<14) | ||
109 | #define GPIO_BOUT_ISR (1<<14) | ||
110 | #define GPIO_BOUT_0 (2<<14) | ||
111 | #define GPIO_BOUT_1 (3<<14) | ||
112 | |||
113 | #define GPIO_GIUS (1<<16) | ||
99 | 114 | ||
100 | /* assignements for GPIO alternate/primary functions */ | 115 | /* assignements for GPIO alternate/primary functions */ |
101 | 116 | ||
102 | /* FIXME: This list is not completed. The correct directions are | 117 | /* FIXME: This list is not completed. The correct directions are |
103 | * missing on some (many) pins | 118 | * missing on some (many) pins |
104 | */ | 119 | */ |
105 | #define PA0_PF_A24 ( GPIO_PORTA | GPIO_PF | 0 ) | 120 | #define PA0_AIN_SPI2_CLK ( GPIO_GIUS | GPIO_PORTA | GPIO_OUT | 0 ) |
106 | #define PA0_AIN_SPI2_CLK ( GPIO_PORTA | GPIO_OUT | GPIO_AIN | 0 ) | ||
107 | #define PA0_AF_ETMTRACESYNC ( GPIO_PORTA | GPIO_AF | 0 ) | 121 | #define PA0_AF_ETMTRACESYNC ( GPIO_PORTA | GPIO_AF | 0 ) |
108 | #define PA1_AOUT_SPI2_RXD ( GPIO_PORTA | GPIO_IN | GPIO_AOUT | 1 ) | 122 | #define PA1_AOUT_SPI2_RXD ( GPIO_GIUS | GPIO_PORTA | GPIO_IN | 1 ) |
109 | #define PA1_PF_TIN ( GPIO_PORTA | GPIO_PF | 1 ) | 123 | #define PA1_PF_TIN ( GPIO_PORTA | GPIO_PF | 1 ) |
110 | #define PA2_PF_PWM0 ( GPIO_PORTA | GPIO_OUT | GPIO_PF | 2 ) | 124 | #define PA2_PF_PWM0 ( GPIO_PORTA | GPIO_OUT | GPIO_PF | 2 ) |
111 | #define PA3_PF_CSI_MCLK ( GPIO_PORTA | GPIO_PF | 3 ) | 125 | #define PA3_PF_CSI_MCLK ( GPIO_PORTA | GPIO_PF | 3 ) |
@@ -123,7 +137,7 @@ | |||
123 | #define PA15_PF_I2C_SDA ( GPIO_PORTA | GPIO_OUT | GPIO_PF | 15 ) | 137 | #define PA15_PF_I2C_SDA ( GPIO_PORTA | GPIO_OUT | GPIO_PF | 15 ) |
124 | #define PA16_PF_I2C_SCL ( GPIO_PORTA | GPIO_OUT | GPIO_PF | 16 ) | 138 | #define PA16_PF_I2C_SCL ( GPIO_PORTA | GPIO_OUT | GPIO_PF | 16 ) |
125 | #define PA17_AF_ETMTRACEPKT4 ( GPIO_PORTA | GPIO_AF | 17 ) | 139 | #define PA17_AF_ETMTRACEPKT4 ( GPIO_PORTA | GPIO_AF | 17 ) |
126 | #define PA17_AIN_SPI2_SS ( GPIO_PORTA | GPIO_AIN | 17 ) | 140 | #define PA17_AIN_SPI2_SS ( GPIO_GIUS | GPIO_PORTA | GPIO_OUT | 17 ) |
127 | #define PA18_AF_ETMTRACEPKT5 ( GPIO_PORTA | GPIO_AF | 18 ) | 141 | #define PA18_AF_ETMTRACEPKT5 ( GPIO_PORTA | GPIO_AF | 18 ) |
128 | #define PA19_AF_ETMTRACEPKT6 ( GPIO_PORTA | GPIO_AF | 19 ) | 142 | #define PA19_AF_ETMTRACEPKT6 ( GPIO_PORTA | GPIO_AF | 19 ) |
129 | #define PA20_AF_ETMTRACEPKT7 ( GPIO_PORTA | GPIO_AF | 20 ) | 143 | #define PA20_AF_ETMTRACEPKT7 ( GPIO_PORTA | GPIO_AF | 20 ) |
@@ -191,19 +205,27 @@ | |||
191 | #define PC15_PF_SPI1_SS ( GPIO_PORTC | GPIO_PF | 15 ) | 205 | #define PC15_PF_SPI1_SS ( GPIO_PORTC | GPIO_PF | 15 ) |
192 | #define PC16_PF_SPI1_MISO ( GPIO_PORTC | GPIO_PF | 16 ) | 206 | #define PC16_PF_SPI1_MISO ( GPIO_PORTC | GPIO_PF | 16 ) |
193 | #define PC17_PF_SPI1_MOSI ( GPIO_PORTC | GPIO_PF | 17 ) | 207 | #define PC17_PF_SPI1_MOSI ( GPIO_PORTC | GPIO_PF | 17 ) |
208 | #define PC24_BIN_UART3_RI ( GPIO_GIUS | GPIO_PORTC | GPIO_OUT | GPIO_BIN | 24 ) | ||
209 | #define PC25_BIN_UART3_DSR ( GPIO_GIUS | GPIO_PORTC | GPIO_OUT | GPIO_BIN | 25 ) | ||
210 | #define PC26_AOUT_UART3_DTR ( GPIO_GIUS | GPIO_PORTC | GPIO_IN | 26 ) | ||
211 | #define PC27_BIN_UART3_DCD ( GPIO_GIUS | GPIO_PORTC | GPIO_OUT | GPIO_BIN | 27 ) | ||
212 | #define PC28_BIN_UART3_CTS ( GPIO_GIUS | GPIO_PORTC | GPIO_OUT | GPIO_BIN | 28 ) | ||
213 | #define PC29_AOUT_UART3_RTS ( GPIO_GIUS | GPIO_PORTC | GPIO_IN | 29 ) | ||
214 | #define PC30_BIN_UART3_TX ( GPIO_GIUS | GPIO_PORTC | GPIO_BIN | 30 ) | ||
215 | #define PC31_AOUT_UART3_RX ( GPIO_GIUS | GPIO_PORTC | GPIO_IN | 31) | ||
194 | #define PD6_PF_LSCLK ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 6 ) | 216 | #define PD6_PF_LSCLK ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 6 ) |
195 | #define PD7_PF_REV ( GPIO_PORTD | GPIO_PF | 7 ) | 217 | #define PD7_PF_REV ( GPIO_PORTD | GPIO_PF | 7 ) |
196 | #define PD7_AF_UART2_DTR ( GPIO_PORTD | GPIO_IN | GPIO_AF | 7 ) | 218 | #define PD7_AF_UART2_DTR ( GPIO_GIUS | GPIO_PORTD | GPIO_IN | GPIO_AF | 7 ) |
197 | #define PD7_AIN_SPI2_SCLK ( GPIO_PORTD | GPIO_AIN | 7 ) | 219 | #define PD7_AIN_SPI2_SCLK ( GPIO_GIUS | GPIO_PORTD | GPIO_AIN | 7 ) |
198 | #define PD8_PF_CLS ( GPIO_PORTD | GPIO_PF | 8 ) | 220 | #define PD8_PF_CLS ( GPIO_PORTD | GPIO_PF | 8 ) |
199 | #define PD8_AF_UART2_DCD ( GPIO_PORTD | GPIO_OUT | GPIO_AF | 8 ) | 221 | #define PD8_AF_UART2_DCD ( GPIO_PORTD | GPIO_OUT | GPIO_AF | 8 ) |
200 | #define PD8_AIN_SPI2_SS ( GPIO_PORTD | GPIO_AIN | 8 ) | 222 | #define PD8_AIN_SPI2_SS ( GPIO_GIUS | GPIO_PORTD | GPIO_AIN | 8 ) |
201 | #define PD9_PF_PS ( GPIO_PORTD | GPIO_PF | 9 ) | 223 | #define PD9_PF_PS ( GPIO_PORTD | GPIO_PF | 9 ) |
202 | #define PD9_AF_UART2_RI ( GPIO_PORTD | GPIO_OUT | GPIO_AF | 9 ) | 224 | #define PD9_AF_UART2_RI ( GPIO_PORTD | GPIO_OUT | GPIO_AF | 9 ) |
203 | #define PD9_AOUT_SPI2_RXD ( GPIO_PORTD | GPIO_IN | GPIO_AOUT | 9 ) | 225 | #define PD9_AOUT_SPI2_RXD ( GPIO_GIUS | GPIO_PORTD | GPIO_IN | 9 ) |
204 | #define PD10_PF_SPL_SPR ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 10 ) | 226 | #define PD10_PF_SPL_SPR ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 10 ) |
205 | #define PD10_AF_UART2_DSR ( GPIO_PORTD | GPIO_OUT | GPIO_AF | 10 ) | 227 | #define PD10_AF_UART2_DSR ( GPIO_PORTD | GPIO_OUT | GPIO_AF | 10 ) |
206 | #define PD10_AIN_SPI2_TXD ( GPIO_PORTD | GPIO_OUT | GPIO_AIN | 10 ) | 228 | #define PD10_AIN_SPI2_TXD ( GPIO_GIUS | GPIO_PORTD | GPIO_OUT | 10 ) |
207 | #define PD11_PF_CONTRAST ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 11 ) | 229 | #define PD11_PF_CONTRAST ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 11 ) |
208 | #define PD12_PF_ACD_OE ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 12 ) | 230 | #define PD12_PF_ACD_OE ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 12 ) |
209 | #define PD13_PF_LP_HSYNC ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 13 ) | 231 | #define PD13_PF_LP_HSYNC ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 13 ) |
@@ -225,7 +247,7 @@ | |||
225 | #define PD29_PF_LD14 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 29 ) | 247 | #define PD29_PF_LD14 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 29 ) |
226 | #define PD30_PF_LD15 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 30 ) | 248 | #define PD30_PF_LD15 ( GPIO_PORTD | GPIO_OUT | GPIO_PF | 30 ) |
227 | #define PD31_PF_TMR2OUT ( GPIO_PORTD | GPIO_PF | 31 ) | 249 | #define PD31_PF_TMR2OUT ( GPIO_PORTD | GPIO_PF | 31 ) |
228 | #define PD31_BIN_SPI2_TXD ( GPIO_PORTD | GPIO_BIN | 31 ) | 250 | #define PD31_BIN_SPI2_TXD ( GPIO_GIUS | GPIO_PORTD | GPIO_BIN | 31 ) |
229 | 251 | ||
230 | /* | 252 | /* |
231 | * PWM controller | 253 | * PWM controller |
diff --git a/include/asm-arm/arch-imx/io.h b/include/asm-arm/arch-imx/io.h index 28a4cca6a4cb..b191cdd05576 100644 --- a/include/asm-arm/arch-imx/io.h +++ b/include/asm-arm/arch-imx/io.h | |||
@@ -20,6 +20,8 @@ | |||
20 | #ifndef __ASM_ARM_ARCH_IO_H | 20 | #ifndef __ASM_ARM_ARCH_IO_H |
21 | #define __ASM_ARM_ARCH_IO_H | 21 | #define __ASM_ARM_ARCH_IO_H |
22 | 22 | ||
23 | #include <asm/hardware.h> | ||
24 | |||
23 | #define IO_SPACE_LIMIT 0xffffffff | 25 | #define IO_SPACE_LIMIT 0xffffffff |
24 | 26 | ||
25 | #define __io(a) ((void __iomem *)(a)) | 27 | #define __io(a) ((void __iomem *)(a)) |
diff --git a/include/asm-arm/arch-imx/irqs.h b/include/asm-arm/arch-imx/irqs.h index 238197cfb9d9..f195542898e0 100644 --- a/include/asm-arm/arch-imx/irqs.h +++ b/include/asm-arm/arch-imx/irqs.h | |||
@@ -23,7 +23,7 @@ | |||
23 | #define __ARM_IRQS_H__ | 23 | #define __ARM_IRQS_H__ |
24 | 24 | ||
25 | /* Use the imx definitions */ | 25 | /* Use the imx definitions */ |
26 | #include <asm/arch/hardware.h> | 26 | #include <asm/hardware.h> |
27 | 27 | ||
28 | /* | 28 | /* |
29 | * IMX Interrupt numbers | 29 | * IMX Interrupt numbers |
diff --git a/include/asm-arm/arch-imx/memory.h b/include/asm-arm/arch-imx/memory.h index 116a91fa14f1..d09ae32cd2f4 100644 --- a/include/asm-arm/arch-imx/memory.h +++ b/include/asm-arm/arch-imx/memory.h | |||
@@ -21,7 +21,7 @@ | |||
21 | #ifndef __ASM_ARCH_MMU_H | 21 | #ifndef __ASM_ARCH_MMU_H |
22 | #define __ASM_ARCH_MMU_H | 22 | #define __ASM_ARCH_MMU_H |
23 | 23 | ||
24 | #define PHYS_OFFSET (0x08000000UL) | 24 | #define PHYS_OFFSET UL(0x08000000) |
25 | 25 | ||
26 | /* | 26 | /* |
27 | * Virtual view <-> DMA view memory address translations | 27 | * Virtual view <-> DMA view memory address translations |
diff --git a/include/asm-arm/arch-imx/timex.h b/include/asm-arm/arch-imx/timex.h index d65ab3cd5d5d..8c91674706b1 100644 --- a/include/asm-arm/arch-imx/timex.h +++ b/include/asm-arm/arch-imx/timex.h | |||
@@ -21,7 +21,7 @@ | |||
21 | #ifndef __ASM_ARCH_TIMEX_H | 21 | #ifndef __ASM_ARCH_TIMEX_H |
22 | #define __ASM_ARCH_TIMEX_H | 22 | #define __ASM_ARCH_TIMEX_H |
23 | 23 | ||
24 | #include <asm/arch/hardware.h> | 24 | #include <asm/hardware.h> |
25 | #define CLOCK_TICK_RATE (CLK32) | 25 | #define CLOCK_TICK_RATE (CLK32) |
26 | 26 | ||
27 | #endif | 27 | #endif |
diff --git a/include/asm-arm/arch-integrator/hardware.h b/include/asm-arm/arch-integrator/hardware.h index be2716eeaa02..6f0947bc500d 100644 --- a/include/asm-arm/arch-integrator/hardware.h +++ b/include/asm-arm/arch-integrator/hardware.h | |||
@@ -33,15 +33,6 @@ | |||
33 | #define IO_SIZE 0x0B000000 // How much? | 33 | #define IO_SIZE 0x0B000000 // How much? |
34 | #define IO_START INTEGRATOR_HDR_BASE // PA of IO | 34 | #define IO_START INTEGRATOR_HDR_BASE // PA of IO |
35 | 35 | ||
36 | /* | ||
37 | * Similar to above, but for PCI addresses (memory, IO, Config and the | ||
38 | * V3 chip itself). WARNING: this has to mirror definitions in platform.h | ||
39 | */ | ||
40 | #define PCI_MEMORY_VADDR 0xe8000000 | ||
41 | #define PCI_CONFIG_VADDR 0xec000000 | ||
42 | #define PCI_V3_VADDR 0xed000000 | ||
43 | #define PCI_IO_VADDR 0xee000000 | ||
44 | |||
45 | #define PCIO_BASE PCI_IO_VADDR | 36 | #define PCIO_BASE PCI_IO_VADDR |
46 | #define PCIMEM_BASE PCI_MEMORY_VADDR | 37 | #define PCIMEM_BASE PCI_MEMORY_VADDR |
47 | 38 | ||
diff --git a/include/asm-arm/arch-integrator/io.h b/include/asm-arm/arch-integrator/io.h index fbea8be67d26..31f2deab51b0 100644 --- a/include/asm-arm/arch-integrator/io.h +++ b/include/asm-arm/arch-integrator/io.h | |||
@@ -22,6 +22,14 @@ | |||
22 | 22 | ||
23 | #define IO_SPACE_LIMIT 0xffff | 23 | #define IO_SPACE_LIMIT 0xffff |
24 | 24 | ||
25 | /* | ||
26 | * WARNING: this has to mirror definitions in platform.h | ||
27 | */ | ||
28 | #define PCI_MEMORY_VADDR 0xe8000000 | ||
29 | #define PCI_CONFIG_VADDR 0xec000000 | ||
30 | #define PCI_V3_VADDR 0xed000000 | ||
31 | #define PCI_IO_VADDR 0xee000000 | ||
32 | |||
25 | #define __io(a) ((void __iomem *)(PCI_IO_VADDR + (a))) | 33 | #define __io(a) ((void __iomem *)(PCI_IO_VADDR + (a))) |
26 | #define __mem_pci(a) (a) | 34 | #define __mem_pci(a) (a) |
27 | #define __mem_isa(a) ((a) + PCI_MEMORY_VADDR) | 35 | #define __mem_isa(a) ((a) + PCI_MEMORY_VADDR) |
diff --git a/include/asm-arm/arch-integrator/memory.h b/include/asm-arm/arch-integrator/memory.h index 2087ea7d28a9..1ab56d783e7c 100644 --- a/include/asm-arm/arch-integrator/memory.h +++ b/include/asm-arm/arch-integrator/memory.h | |||
@@ -23,8 +23,8 @@ | |||
23 | /* | 23 | /* |
24 | * Physical DRAM offset. | 24 | * Physical DRAM offset. |
25 | */ | 25 | */ |
26 | #define PHYS_OFFSET (0x00000000UL) | 26 | #define PHYS_OFFSET UL(0x00000000) |
27 | #define BUS_OFFSET (0x80000000UL) | 27 | #define BUS_OFFSET UL(0x80000000) |
28 | 28 | ||
29 | /* | 29 | /* |
30 | * Virtual view <-> DMA view memory address translations | 30 | * Virtual view <-> DMA view memory address translations |
diff --git a/include/asm-arm/arch-integrator/smp.h b/include/asm-arm/arch-integrator/smp.h index 0ec7093f7c37..da6981efdc39 100644 --- a/include/asm-arm/arch-integrator/smp.h +++ b/include/asm-arm/arch-integrator/smp.h | |||
@@ -3,7 +3,7 @@ | |||
3 | 3 | ||
4 | #include <linux/config.h> | 4 | #include <linux/config.h> |
5 | 5 | ||
6 | #include <asm/arch/hardware.h> | 6 | #include <asm/hardware.h> |
7 | #include <asm/io.h> | 7 | #include <asm/io.h> |
8 | 8 | ||
9 | #define hard_smp_processor_id() \ | 9 | #define hard_smp_processor_id() \ |
diff --git a/include/asm-arm/arch-iop3xx/io.h b/include/asm-arm/arch-iop3xx/io.h index 2761dfd8694d..f39046a6ab14 100644 --- a/include/asm-arm/arch-iop3xx/io.h +++ b/include/asm-arm/arch-iop3xx/io.h | |||
@@ -11,6 +11,8 @@ | |||
11 | #ifndef __ASM_ARM_ARCH_IO_H | 11 | #ifndef __ASM_ARM_ARCH_IO_H |
12 | #define __ASM_ARM_ARCH_IO_H | 12 | #define __ASM_ARM_ARCH_IO_H |
13 | 13 | ||
14 | #include <asm/hardware.h> | ||
15 | |||
14 | #define IO_SPACE_LIMIT 0xffffffff | 16 | #define IO_SPACE_LIMIT 0xffffffff |
15 | 17 | ||
16 | #define __io(p) ((void __iomem *)(p)) | 18 | #define __io(p) ((void __iomem *)(p)) |
diff --git a/include/asm-arm/arch-iop3xx/iop321.h b/include/asm-arm/arch-iop3xx/iop321.h index 200621ff3690..f8df778a356f 100644 --- a/include/asm-arm/arch-iop3xx/iop321.h +++ b/include/asm-arm/arch-iop3xx/iop321.h | |||
@@ -40,7 +40,7 @@ | |||
40 | #define IOP321_PCI_UPPER_IO_BA (IOP321_PCI_LOWER_IO_BA + IOP321_PCI_IO_WINDOW_SIZE - 1) | 40 | #define IOP321_PCI_UPPER_IO_BA (IOP321_PCI_LOWER_IO_BA + IOP321_PCI_IO_WINDOW_SIZE - 1) |
41 | #define IOP321_PCI_IO_OFFSET (IOP321_PCI_LOWER_IO_VA - IOP321_PCI_LOWER_IO_BA) | 41 | #define IOP321_PCI_IO_OFFSET (IOP321_PCI_LOWER_IO_VA - IOP321_PCI_LOWER_IO_BA) |
42 | 42 | ||
43 | //#define IOP321_PCI_MEM_WINDOW_SIZE (~*IOP321_IALR1 + 1) | 43 | /* #define IOP321_PCI_MEM_WINDOW_SIZE (~*IOP321_IALR1 + 1) */ |
44 | #define IOP321_PCI_MEM_WINDOW_SIZE 0x04000000 /* 64M outbound window */ | 44 | #define IOP321_PCI_MEM_WINDOW_SIZE 0x04000000 /* 64M outbound window */ |
45 | #define IOP321_PCI_LOWER_MEM_PA 0x80000000 | 45 | #define IOP321_PCI_LOWER_MEM_PA 0x80000000 |
46 | #define IOP321_PCI_LOWER_MEM_BA (*IOP321_OMWTVR0) | 46 | #define IOP321_PCI_LOWER_MEM_BA (*IOP321_OMWTVR0) |
diff --git a/include/asm-arm/arch-iop3xx/iop331.h b/include/asm-arm/arch-iop3xx/iop331.h index 96adffd8bad2..fbf0cc11bdd9 100644 --- a/include/asm-arm/arch-iop3xx/iop331.h +++ b/include/asm-arm/arch-iop3xx/iop331.h | |||
@@ -42,7 +42,7 @@ | |||
42 | 42 | ||
43 | /* this can be 128M if OMWTVR1 is set */ | 43 | /* this can be 128M if OMWTVR1 is set */ |
44 | #define IOP331_PCI_MEM_WINDOW_SIZE 0x04000000 /* 64M outbound window */ | 44 | #define IOP331_PCI_MEM_WINDOW_SIZE 0x04000000 /* 64M outbound window */ |
45 | //#define IOP331_PCI_MEM_WINDOW_SIZE (~*IOP331_IALR1 + 1) | 45 | /* #define IOP331_PCI_MEM_WINDOW_SIZE (~*IOP331_IALR1 + 1) */ |
46 | #define IOP331_PCI_LOWER_MEM_PA 0x80000000 | 46 | #define IOP331_PCI_LOWER_MEM_PA 0x80000000 |
47 | #define IOP331_PCI_LOWER_MEM_BA (*IOP331_OMWTVR0) | 47 | #define IOP331_PCI_LOWER_MEM_BA (*IOP331_OMWTVR0) |
48 | #define IOP331_PCI_UPPER_MEM_PA (IOP331_PCI_LOWER_MEM_PA + IOP331_PCI_MEM_WINDOW_SIZE - 1) | 48 | #define IOP331_PCI_UPPER_MEM_PA (IOP331_PCI_LOWER_MEM_PA + IOP331_PCI_MEM_WINDOW_SIZE - 1) |
diff --git a/include/asm-arm/arch-iop3xx/memory.h b/include/asm-arm/arch-iop3xx/memory.h index 45351f5cd904..bc62f4b13235 100644 --- a/include/asm-arm/arch-iop3xx/memory.h +++ b/include/asm-arm/arch-iop3xx/memory.h | |||
@@ -12,9 +12,9 @@ | |||
12 | * Physical DRAM offset. | 12 | * Physical DRAM offset. |
13 | */ | 13 | */ |
14 | #ifndef CONFIG_ARCH_IOP331 | 14 | #ifndef CONFIG_ARCH_IOP331 |
15 | #define PHYS_OFFSET (0xa0000000UL) | 15 | #define PHYS_OFFSET UL(0xa0000000) |
16 | #else | 16 | #else |
17 | #define PHYS_OFFSET (0x00000000UL) | 17 | #define PHYS_OFFSET UL(0x00000000) |
18 | #endif | 18 | #endif |
19 | 19 | ||
20 | /* | 20 | /* |
diff --git a/include/asm-arm/arch-iop3xx/timex.h b/include/asm-arm/arch-iop3xx/timex.h index d4187fe9a85a..472badb451c4 100644 --- a/include/asm-arm/arch-iop3xx/timex.h +++ b/include/asm-arm/arch-iop3xx/timex.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * IOP3xx architecture timex specifications | 4 | * IOP3xx architecture timex specifications |
5 | */ | 5 | */ |
6 | #include <linux/config.h> | 6 | #include <linux/config.h> |
7 | 7 | #include <asm/hardware.h> | |
8 | 8 | ||
9 | #if defined(CONFIG_ARCH_IQ80321) || defined(CONFIG_ARCH_IQ31244) | 9 | #if defined(CONFIG_ARCH_IQ80321) || defined(CONFIG_ARCH_IQ31244) |
10 | 10 | ||
diff --git a/include/asm-arm/arch-ixp2000/enp2611.h b/include/asm-arm/arch-ixp2000/enp2611.h index 31ae88674968..95128d9f5026 100644 --- a/include/asm-arm/arch-ixp2000/enp2611.h +++ b/include/asm-arm/arch-ixp2000/enp2611.h | |||
@@ -21,8 +21,20 @@ | |||
21 | #ifndef __ENP2611_H | 21 | #ifndef __ENP2611_H |
22 | #define __ENP2611_H | 22 | #define __ENP2611_H |
23 | 23 | ||
24 | #define ENP2611_GPIO_SCL 0x07 | 24 | #define ENP2611_CALEB_PHYS_BASE 0xc5000000 |
25 | #define ENP2611_GPIO_SDA 0x06 | 25 | #define ENP2611_CALEB_VIRT_BASE 0xfe000000 |
26 | #define ENP2611_CALEB_SIZE 0x00100000 | ||
27 | |||
28 | #define ENP2611_PM3386_0_PHYS_BASE 0xc6000000 | ||
29 | #define ENP2611_PM3386_0_VIRT_BASE 0xfe100000 | ||
30 | #define ENP2611_PM3386_0_SIZE 0x00100000 | ||
31 | |||
32 | #define ENP2611_PM3386_1_PHYS_BASE 0xc6400000 | ||
33 | #define ENP2611_PM3386_1_VIRT_BASE 0xfe200000 | ||
34 | #define ENP2611_PM3386_1_SIZE 0x00100000 | ||
35 | |||
36 | #define ENP2611_GPIO_SCL 7 | ||
37 | #define ENP2611_GPIO_SDA 6 | ||
26 | 38 | ||
27 | 39 | ||
28 | #endif | 40 | #endif |
diff --git a/include/asm-arm/arch-ixp2000/io.h b/include/asm-arm/arch-ixp2000/io.h index 3241cd6f0778..7fbcdf9931ee 100644 --- a/include/asm-arm/arch-ixp2000/io.h +++ b/include/asm-arm/arch-ixp2000/io.h | |||
@@ -15,6 +15,8 @@ | |||
15 | #ifndef __ASM_ARM_ARCH_IO_H | 15 | #ifndef __ASM_ARM_ARCH_IO_H |
16 | #define __ASM_ARM_ARCH_IO_H | 16 | #define __ASM_ARM_ARCH_IO_H |
17 | 17 | ||
18 | #include <asm/hardware.h> | ||
19 | |||
18 | #define IO_SPACE_LIMIT 0xffffffff | 20 | #define IO_SPACE_LIMIT 0xffffffff |
19 | #define __mem_pci(a) (a) | 21 | #define __mem_pci(a) (a) |
20 | 22 | ||
diff --git a/include/asm-arm/arch-ixp2000/irqs.h b/include/asm-arm/arch-ixp2000/irqs.h index 0deb96c12adb..62f09c7ff420 100644 --- a/include/asm-arm/arch-ixp2000/irqs.h +++ b/include/asm-arm/arch-ixp2000/irqs.h | |||
@@ -67,12 +67,45 @@ | |||
67 | #define IRQ_IXP2000_PCIA 40 | 67 | #define IRQ_IXP2000_PCIA 40 |
68 | #define IRQ_IXP2000_PCIB 41 | 68 | #define IRQ_IXP2000_PCIB 41 |
69 | 69 | ||
70 | #define NR_IXP2000_IRQS 42 | 70 | /* Int sources from IRQ_ERROR_STATUS */ |
71 | #define IRQ_IXP2000_DRAM0_MIN_ERR 42 | ||
72 | #define IRQ_IXP2000_DRAM0_MAJ_ERR 43 | ||
73 | #define IRQ_IXP2000_DRAM1_MIN_ERR 44 | ||
74 | #define IRQ_IXP2000_DRAM1_MAJ_ERR 45 | ||
75 | #define IRQ_IXP2000_DRAM2_MIN_ERR 46 | ||
76 | #define IRQ_IXP2000_DRAM2_MAJ_ERR 47 | ||
77 | /* 48-57 reserved */ | ||
78 | #define IRQ_IXP2000_SRAM0_ERR 58 | ||
79 | #define IRQ_IXP2000_SRAM1_ERR 59 | ||
80 | #define IRQ_IXP2000_SRAM2_ERR 60 | ||
81 | #define IRQ_IXP2000_SRAM3_ERR 61 | ||
82 | /* 62-65 reserved */ | ||
83 | #define IRQ_IXP2000_MEDIA_ERR 66 | ||
84 | #define IRQ_IXP2000_PCI_ERR 67 | ||
85 | #define IRQ_IXP2000_SP_INT 68 | ||
86 | |||
87 | #define NR_IXP2000_IRQS 69 | ||
71 | 88 | ||
72 | #define IXP2000_BOARD_IRQ(x) (NR_IXP2000_IRQS + (x)) | 89 | #define IXP2000_BOARD_IRQ(x) (NR_IXP2000_IRQS + (x)) |
73 | 90 | ||
74 | #define IXP2000_BOARD_IRQ_MASK(irq) (1 << (irq - NR_IXP2000_IRQS)) | 91 | #define IXP2000_BOARD_IRQ_MASK(irq) (1 << (irq - NR_IXP2000_IRQS)) |
75 | 92 | ||
93 | #define IXP2000_ERR_IRQ_MASK(irq) ( 1 << (irq - IRQ_IXP2000_DRAM0_MIN_ERR)) | ||
94 | #define IXP2000_VALID_ERR_IRQ_MASK (\ | ||
95 | IXP2000_ERR_IRQ_MASK(IRQ_IXP2000_DRAM0_MIN_ERR) | \ | ||
96 | IXP2000_ERR_IRQ_MASK(IRQ_IXP2000_DRAM0_MAJ_ERR) | \ | ||
97 | IXP2000_ERR_IRQ_MASK(IRQ_IXP2000_DRAM1_MIN_ERR) | \ | ||
98 | IXP2000_ERR_IRQ_MASK(IRQ_IXP2000_DRAM1_MAJ_ERR) | \ | ||
99 | IXP2000_ERR_IRQ_MASK(IRQ_IXP2000_DRAM2_MIN_ERR) | \ | ||
100 | IXP2000_ERR_IRQ_MASK(IRQ_IXP2000_DRAM2_MAJ_ERR) | \ | ||
101 | IXP2000_ERR_IRQ_MASK(IRQ_IXP2000_SRAM0_ERR) | \ | ||
102 | IXP2000_ERR_IRQ_MASK(IRQ_IXP2000_SRAM1_ERR) | \ | ||
103 | IXP2000_ERR_IRQ_MASK(IRQ_IXP2000_SRAM2_ERR) | \ | ||
104 | IXP2000_ERR_IRQ_MASK(IRQ_IXP2000_SRAM3_ERR) | \ | ||
105 | IXP2000_ERR_IRQ_MASK(IRQ_IXP2000_MEDIA_ERR) | \ | ||
106 | IXP2000_ERR_IRQ_MASK(IRQ_IXP2000_PCI_ERR) | \ | ||
107 | IXP2000_ERR_IRQ_MASK(IRQ_IXP2000_SP_INT) ) | ||
108 | |||
76 | /* | 109 | /* |
77 | * This allows for all the on-chip sources plus up to 32 CPLD based | 110 | * This allows for all the on-chip sources plus up to 32 CPLD based |
78 | * IRQs. Should be more than enough. | 111 | * IRQs. Should be more than enough. |
diff --git a/include/asm-arm/arch-ixp2000/ixdp2x01.h b/include/asm-arm/arch-ixp2000/ixdp2x01.h index b768009c3a51..c6d51426e98f 100644 --- a/include/asm-arm/arch-ixp2000/ixdp2x01.h +++ b/include/asm-arm/arch-ixp2000/ixdp2x01.h | |||
@@ -22,7 +22,7 @@ | |||
22 | #define IXDP2X01_CPLD_REGION_SIZE 0x00100000 | 22 | #define IXDP2X01_CPLD_REGION_SIZE 0x00100000 |
23 | 23 | ||
24 | #define IXDP2X01_CPLD_VIRT_REG(reg) (volatile unsigned long*)(IXDP2X01_VIRT_CPLD_BASE | reg) | 24 | #define IXDP2X01_CPLD_VIRT_REG(reg) (volatile unsigned long*)(IXDP2X01_VIRT_CPLD_BASE | reg) |
25 | #define IXDP2X01_CPLD_PHYS_REG(reg) (volatile u32*)(IXDP2X01_PHYS_CPLD_BASE | reg) | 25 | #define IXDP2X01_CPLD_PHYS_REG(reg) (IXDP2X01_PHYS_CPLD_BASE | reg) |
26 | 26 | ||
27 | #define IXDP2X01_UART1_VIRT_BASE IXDP2X01_CPLD_VIRT_REG(0x40) | 27 | #define IXDP2X01_UART1_VIRT_BASE IXDP2X01_CPLD_VIRT_REG(0x40) |
28 | #define IXDP2X01_UART1_PHYS_BASE IXDP2X01_CPLD_PHYS_REG(0x40) | 28 | #define IXDP2X01_UART1_PHYS_BASE IXDP2X01_CPLD_PHYS_REG(0x40) |
diff --git a/include/asm-arm/arch-ixp2000/ixp2000-regs.h b/include/asm-arm/arch-ixp2000/ixp2000-regs.h index 32aece069869..fc5ac6aec4f2 100644 --- a/include/asm-arm/arch-ixp2000/ixp2000-regs.h +++ b/include/asm-arm/arch-ixp2000/ixp2000-regs.h | |||
@@ -59,14 +59,15 @@ | |||
59 | #define IXP2000_CAP_SIZE 0x00100000 | 59 | #define IXP2000_CAP_SIZE 0x00100000 |
60 | 60 | ||
61 | /* | 61 | /* |
62 | * Addresses for specific on-chip peripherals | 62 | * Addresses for specific on-chip peripherals. |
63 | */ | 63 | */ |
64 | #define IXP2000_SLOWPORT_CSR_VIRT_BASE 0xfef80000 | 64 | #define IXP2000_SLOWPORT_CSR_VIRT_BASE 0xfef80000 |
65 | #define IXP2000_GLOBAL_REG_VIRT_BASE 0xfef04000 | 65 | #define IXP2000_GLOBAL_REG_VIRT_BASE 0xfef04000 |
66 | #define IXP2000_UART_PHYS_BASE 0xc0030000 | 66 | #define IXP2000_UART_PHYS_BASE 0xc0030000 |
67 | #define IXP2000_UART_VIRT_BASE 0xfef30000 | 67 | #define IXP2000_UART_VIRT_BASE 0xfef30000 |
68 | #define IXP2000_TIMER_VIRT_BASE 0xfef20000 | 68 | #define IXP2000_TIMER_VIRT_BASE 0xfef20000 |
69 | #define IXP2000_GPIO_VIRT_BASE 0Xfef10000 | 69 | #define IXP2000_UENGINE_CSR_VIRT_BASE 0xfef18000 |
70 | #define IXP2000_GPIO_VIRT_BASE 0xfef10000 | ||
70 | 71 | ||
71 | /* | 72 | /* |
72 | * Devices outside of the 0xc0000000 -> 0xc0100000 range. The virtual | 73 | * Devices outside of the 0xc0000000 -> 0xc0100000 range. The virtual |
@@ -252,7 +253,7 @@ | |||
252 | #define IXP2000_PCI_XSCALE_INT_ENABLE IXP2000_PCI_CSR(0x15C) | 253 | #define IXP2000_PCI_XSCALE_INT_ENABLE IXP2000_PCI_CSR(0x15C) |
253 | 254 | ||
254 | #define IXP2000_PCICNTL_PNR (1<<17) /* PCI not Reset bit of PCI_CONTROL */ | 255 | #define IXP2000_PCICNTL_PNR (1<<17) /* PCI not Reset bit of PCI_CONTROL */ |
255 | #define IXP2000_PCICNTL_PCF (1<<28) /* PCI Centrolfunction bit */ | 256 | #define IXP2000_PCICNTL_PCF (1<<28) /* PCI Central function bit */ |
256 | #define IXP2000_XSCALE_INT (1<<1) /* Interrupt from XScale to PCI */ | 257 | #define IXP2000_XSCALE_INT (1<<1) /* Interrupt from XScale to PCI */ |
257 | 258 | ||
258 | /* These are from the IRQ register in the PCI ISR register */ | 259 | /* These are from the IRQ register in the PCI ISR register */ |
@@ -392,4 +393,47 @@ | |||
392 | #define WDT_RESET_ENABLE 0x01000000 | 393 | #define WDT_RESET_ENABLE 0x01000000 |
393 | 394 | ||
394 | 395 | ||
396 | /* | ||
397 | * MSF registers. The IXP2400 and IXP2800 have somewhat different MSF | ||
398 | * units, but the registers that differ between the two don't overlap, | ||
399 | * so we can have one register list for both. | ||
400 | */ | ||
401 | #define IXP2000_MSF_REG(x) ((volatile unsigned long*)(IXP2000_MSF_VIRT_BASE + (x))) | ||
402 | #define IXP2000_MSF_RX_CONTROL IXP2000_MSF_REG(0x0000) | ||
403 | #define IXP2000_MSF_TX_CONTROL IXP2000_MSF_REG(0x0004) | ||
404 | #define IXP2000_MSF_INTERRUPT_STATUS IXP2000_MSF_REG(0x0008) | ||
405 | #define IXP2000_MSF_INTERRUPT_ENABLE IXP2000_MSF_REG(0x000c) | ||
406 | #define IXP2000_MSF_CSIX_TYPE_MAP IXP2000_MSF_REG(0x0010) | ||
407 | #define IXP2000_MSF_FC_EGRESS_STATUS IXP2000_MSF_REG(0x0014) | ||
408 | #define IXP2000_MSF_FC_INGRESS_STATUS IXP2000_MSF_REG(0x0018) | ||
409 | #define IXP2000_MSF_HWM_CONTROL IXP2000_MSF_REG(0x0024) | ||
410 | #define IXP2000_MSF_FC_STATUS_OVERRIDE IXP2000_MSF_REG(0x0028) | ||
411 | #define IXP2000_MSF_CLOCK_CONTROL IXP2000_MSF_REG(0x002c) | ||
412 | #define IXP2000_MSF_RX_PORT_MAP IXP2000_MSF_REG(0x0040) | ||
413 | #define IXP2000_MSF_RBUF_ELEMENT_DONE IXP2000_MSF_REG(0x0044) | ||
414 | #define IXP2000_MSF_RX_MPHY_POLL_LIMIT IXP2000_MSF_REG(0x0048) | ||
415 | #define IXP2000_MSF_RX_CALENDAR_LENGTH IXP2000_MSF_REG(0x0048) | ||
416 | #define IXP2000_MSF_RX_THREAD_FREELIST_TIMEOUT_0 IXP2000_MSF_REG(0x0050) | ||
417 | #define IXP2000_MSF_RX_THREAD_FREELIST_TIMEOUT_1 IXP2000_MSF_REG(0x0054) | ||
418 | #define IXP2000_MSF_RX_THREAD_FREELIST_TIMEOUT_2 IXP2000_MSF_REG(0x0058) | ||
419 | #define IXP2000_MSF_TX_SEQUENCE_0 IXP2000_MSF_REG(0x0060) | ||
420 | #define IXP2000_MSF_TX_SEQUENCE_1 IXP2000_MSF_REG(0x0064) | ||
421 | #define IXP2000_MSF_TX_SEQUENCE_2 IXP2000_MSF_REG(0x0068) | ||
422 | #define IXP2000_MSF_TX_MPHY_POLL_LIMIT IXP2000_MSF_REG(0x0070) | ||
423 | #define IXP2000_MSF_TX_CALENDAR_LENGTH IXP2000_MSF_REG(0x0070) | ||
424 | #define IXP2000_MSF_RX_UP_CONTROL_0 IXP2000_MSF_REG(0x0080) | ||
425 | #define IXP2000_MSF_RX_UP_CONTROL_1 IXP2000_MSF_REG(0x0084) | ||
426 | #define IXP2000_MSF_RX_UP_CONTROL_2 IXP2000_MSF_REG(0x0088) | ||
427 | #define IXP2000_MSF_RX_UP_CONTROL_3 IXP2000_MSF_REG(0x008c) | ||
428 | #define IXP2000_MSF_TX_UP_CONTROL_0 IXP2000_MSF_REG(0x0090) | ||
429 | #define IXP2000_MSF_TX_UP_CONTROL_1 IXP2000_MSF_REG(0x0094) | ||
430 | #define IXP2000_MSF_TX_UP_CONTROL_2 IXP2000_MSF_REG(0x0098) | ||
431 | #define IXP2000_MSF_TX_UP_CONTROL_3 IXP2000_MSF_REG(0x009c) | ||
432 | #define IXP2000_MSF_TRAIN_DATA IXP2000_MSF_REG(0x00a0) | ||
433 | #define IXP2000_MSF_TRAIN_CALENDAR IXP2000_MSF_REG(0x00a4) | ||
434 | #define IXP2000_MSF_TRAIN_FLOW_CONTROL IXP2000_MSF_REG(0x00a8) | ||
435 | #define IXP2000_MSF_TX_CALENDAR_0 IXP2000_MSF_REG(0x1000) | ||
436 | #define IXP2000_MSF_RX_PORT_CALENDAR_STATUS IXP2000_MSF_REG(0x1400) | ||
437 | |||
438 | |||
395 | #endif /* _IXP2000_H_ */ | 439 | #endif /* _IXP2000_H_ */ |
diff --git a/include/asm-arm/arch-ixp2000/memory.h b/include/asm-arm/arch-ixp2000/memory.h index d0f415c6dae9..21e1de51e3f6 100644 --- a/include/asm-arm/arch-ixp2000/memory.h +++ b/include/asm-arm/arch-ixp2000/memory.h | |||
@@ -13,7 +13,7 @@ | |||
13 | #ifndef __ASM_ARCH_MEMORY_H | 13 | #ifndef __ASM_ARCH_MEMORY_H |
14 | #define __ASM_ARCH_MEMORY_H | 14 | #define __ASM_ARCH_MEMORY_H |
15 | 15 | ||
16 | #define PHYS_OFFSET (0x00000000UL) | 16 | #define PHYS_OFFSET UL(0x00000000) |
17 | 17 | ||
18 | /* | 18 | /* |
19 | * Virtual view <-> DMA view memory address translations | 19 | * Virtual view <-> DMA view memory address translations |
diff --git a/include/asm-arm/arch-ixp2000/platform.h b/include/asm-arm/arch-ixp2000/platform.h index abdcf51bd283..a66317ab2071 100644 --- a/include/asm-arm/arch-ixp2000/platform.h +++ b/include/asm-arm/arch-ixp2000/platform.h | |||
@@ -15,40 +15,40 @@ | |||
15 | 15 | ||
16 | #ifndef __ASSEMBLY__ | 16 | #ifndef __ASSEMBLY__ |
17 | 17 | ||
18 | static inline unsigned long ixp2000_reg_read(volatile void *reg) | ||
19 | { | ||
20 | return *((volatile unsigned long *)reg); | ||
21 | } | ||
22 | |||
23 | static inline void ixp2000_reg_write(volatile void *reg, unsigned long val) | ||
24 | { | ||
25 | *((volatile unsigned long *)reg) = val; | ||
26 | } | ||
27 | |||
18 | /* | 28 | /* |
19 | * The IXP2400 B0 silicon contains an erratum (#66) that causes writes | 29 | * On the IXP2400, we can't use XCB=000 due to chip bugs. We use |
20 | * to on-chip I/O register to not complete fully. What this means is | 30 | * XCB=101 instead, but that makes all I/O accesses bufferable. This |
21 | * that if you have a write to on-chip I/O followed by a back-to-back | 31 | * is not a problem in general, but we do have to be slightly more |
22 | * read or write, the first write will happen twice. OR...if it's | 32 | * careful because I/O writes are no longer automatically flushed out |
23 | * not a back-to-back transaction, the read or write will generate | 33 | * of the write buffer. |
24 | * incorrect data. | ||
25 | * | ||
26 | * The official work around for this is to set the on-chip I/O regions | ||
27 | * as XCB=101 and then force a read-back from the register. | ||
28 | * | 34 | * |
35 | * In cases where we want to make sure that a write has been flushed | ||
36 | * out of the write buffer before we proceed, for example when masking | ||
37 | * a device interrupt before re-enabling IRQs in CPSR, we can use this | ||
38 | * function, ixp2000_reg_wrb, which performs a write, a readback, and | ||
39 | * issues a dummy instruction dependent on the value of the readback | ||
40 | * (mov rX, rX) to make sure that the readback has completed before we | ||
41 | * continue. | ||
29 | */ | 42 | */ |
30 | #if defined(CONFIG_ARCH_ENP2611) || defined(CONFIG_ARCH_IXDP2400) || defined(CONFIG_ARCH_IXDP2401) | 43 | static inline void ixp2000_reg_wrb(volatile void *reg, unsigned long val) |
31 | |||
32 | #include <asm/system.h> /* Pickup local_irq_ functions */ | ||
33 | |||
34 | static inline void ixp2000_reg_write(volatile void *reg, unsigned long val) | ||
35 | { | 44 | { |
36 | unsigned long dummy; | 45 | unsigned long dummy; |
37 | unsigned long flags; | ||
38 | 46 | ||
39 | local_irq_save(flags); | ||
40 | *((volatile unsigned long *)reg) = val; | 47 | *((volatile unsigned long *)reg) = val; |
41 | barrier(); | 48 | |
42 | dummy = *((volatile unsigned long *)reg); | 49 | dummy = *((volatile unsigned long *)reg); |
43 | local_irq_restore(flags); | 50 | __asm__ __volatile__("mov %0, %0" : "+r" (dummy)); |
44 | } | ||
45 | #else | ||
46 | static inline void ixp2000_reg_write(volatile void *reg, unsigned long val) | ||
47 | { | ||
48 | *((volatile unsigned long *)reg) = val; | ||
49 | } | 51 | } |
50 | #endif /* IXDP2400 || IXDP2401 */ | ||
51 | #define ixp2000_reg_read(reg) (*((volatile unsigned long *)reg)) | ||
52 | 52 | ||
53 | /* | 53 | /* |
54 | * Boards may multiplex different devices on the 2nd channel of | 54 | * Boards may multiplex different devices on the 2nd channel of |
diff --git a/include/asm-arm/arch-ixp2000/system.h b/include/asm-arm/arch-ixp2000/system.h index 4f489cc0dfa5..ddbbb34b5f95 100644 --- a/include/asm-arm/arch-ixp2000/system.h +++ b/include/asm-arm/arch-ixp2000/system.h | |||
@@ -26,29 +26,24 @@ static inline void arch_reset(char mode) | |||
26 | * RedBoot bank. | 26 | * RedBoot bank. |
27 | */ | 27 | */ |
28 | if (machine_is_ixdp2401()) { | 28 | if (machine_is_ixdp2401()) { |
29 | *IXDP2X01_CPLD_FLASH_REG = ((0 >> IXDP2X01_FLASH_WINDOW_BITS) | 29 | ixp2000_reg_write(IXDP2X01_CPLD_FLASH_REG, |
30 | | IXDP2X01_CPLD_FLASH_INTERN); | 30 | ((0 >> IXDP2X01_FLASH_WINDOW_BITS) |
31 | *IXDP2X01_CPLD_RESET_REG = 0xffffffff; | 31 | | IXDP2X01_CPLD_FLASH_INTERN)); |
32 | ixp2000_reg_wrb(IXDP2X01_CPLD_RESET_REG, 0xffffffff); | ||
32 | } | 33 | } |
33 | 34 | ||
34 | /* | 35 | /* |
35 | * On IXDP2801 we need to write this magic sequence to the CPLD | 36 | * On IXDP2801 we need to write this magic sequence to the CPLD |
36 | * to cause a complete reset of the CPU and all external devices | 37 | * to cause a complete reset of the CPU and all external devices |
37 | * and moves the flash bank register back to 0. | 38 | * and move the flash bank register back to 0. |
38 | */ | 39 | */ |
39 | if (machine_is_ixdp2801()) { | 40 | if (machine_is_ixdp2801()) { |
40 | unsigned long reset_reg = *IXDP2X01_CPLD_RESET_REG; | 41 | unsigned long reset_reg = *IXDP2X01_CPLD_RESET_REG; |
42 | |||
41 | reset_reg = 0x55AA0000 | (reset_reg & 0x0000FFFF); | 43 | reset_reg = 0x55AA0000 | (reset_reg & 0x0000FFFF); |
42 | *IXDP2X01_CPLD_RESET_REG = reset_reg; | 44 | ixp2000_reg_write(IXDP2X01_CPLD_RESET_REG, reset_reg); |
43 | mb(); | 45 | ixp2000_reg_wrb(IXDP2X01_CPLD_RESET_REG, 0x80000000); |
44 | *IXDP2X01_CPLD_RESET_REG = 0x80000000; | ||
45 | } | 46 | } |
46 | 47 | ||
47 | /* | 48 | ixp2000_reg_wrb(IXP2000_RESET0, RSTALL); |
48 | * We do a reset all if we are PCI master. We could be a slave and we | ||
49 | * don't want to do anything funky on the PCI bus. | ||
50 | */ | ||
51 | if (*IXP2000_STRAP_OPTIONS & CFG_PCI_BOOT_HOST) { | ||
52 | *(IXP2000_RESET0) |= (RSTALL); | ||
53 | } | ||
54 | } | 49 | } |
diff --git a/include/asm-arm/arch-ixp2000/uengine.h b/include/asm-arm/arch-ixp2000/uengine.h new file mode 100644 index 000000000000..b442d65c6593 --- /dev/null +++ b/include/asm-arm/arch-ixp2000/uengine.h | |||
@@ -0,0 +1,62 @@ | |||
1 | /* | ||
2 | * Generic library functions for the microengines found on the Intel | ||
3 | * IXP2000 series of network processors. | ||
4 | * | ||
5 | * Copyright (C) 2004, 2005 Lennert Buytenhek <buytenh@wantstofly.org> | ||
6 | * Dedicated to Marija Kulikova. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU Lesser General Public License as | ||
10 | * published by the Free Software Foundation; either version 2.1 of the | ||
11 | * License, or (at your option) any later version. | ||
12 | */ | ||
13 | |||
14 | #ifndef __IXP2000_UENGINE_H | ||
15 | #define __IXP2000_UENGINE_H | ||
16 | |||
17 | extern u32 ixp2000_uengine_mask; | ||
18 | |||
19 | struct ixp2000_uengine_code | ||
20 | { | ||
21 | u32 cpu_model_bitmask; | ||
22 | u8 cpu_min_revision; | ||
23 | u8 cpu_max_revision; | ||
24 | |||
25 | u32 uengine_parameters; | ||
26 | |||
27 | struct ixp2000_reg_value { | ||
28 | int reg; | ||
29 | u32 value; | ||
30 | } *initial_reg_values; | ||
31 | |||
32 | int num_insns; | ||
33 | u8 *insns; | ||
34 | }; | ||
35 | |||
36 | u32 ixp2000_uengine_csr_read(int uengine, int offset); | ||
37 | void ixp2000_uengine_csr_write(int uengine, int offset, u32 value); | ||
38 | void ixp2000_uengine_reset(u32 uengine_mask); | ||
39 | void ixp2000_uengine_set_mode(int uengine, u32 mode); | ||
40 | void ixp2000_uengine_load_microcode(int uengine, u8 *ucode, int insns); | ||
41 | void ixp2000_uengine_init_context(int uengine, int context, int pc); | ||
42 | void ixp2000_uengine_start_contexts(int uengine, u8 ctx_mask); | ||
43 | void ixp2000_uengine_stop_contexts(int uengine, u8 ctx_mask); | ||
44 | int ixp2000_uengine_load(int uengine, struct ixp2000_uengine_code *c); | ||
45 | |||
46 | #define IXP2000_UENGINE_8_CONTEXTS 0x00000000 | ||
47 | #define IXP2000_UENGINE_4_CONTEXTS 0x80000000 | ||
48 | #define IXP2000_UENGINE_PRN_UPDATE_EVERY 0x40000000 | ||
49 | #define IXP2000_UENGINE_PRN_UPDATE_ON_ACCESS 0x00000000 | ||
50 | #define IXP2000_UENGINE_NN_FROM_SELF 0x00100000 | ||
51 | #define IXP2000_UENGINE_NN_FROM_PREVIOUS 0x00000000 | ||
52 | #define IXP2000_UENGINE_ASSERT_EMPTY_AT_3 0x000c0000 | ||
53 | #define IXP2000_UENGINE_ASSERT_EMPTY_AT_2 0x00080000 | ||
54 | #define IXP2000_UENGINE_ASSERT_EMPTY_AT_1 0x00040000 | ||
55 | #define IXP2000_UENGINE_ASSERT_EMPTY_AT_0 0x00000000 | ||
56 | #define IXP2000_UENGINE_LM_ADDR1_GLOBAL 0x00020000 | ||
57 | #define IXP2000_UENGINE_LM_ADDR1_PER_CONTEXT 0x00000000 | ||
58 | #define IXP2000_UENGINE_LM_ADDR0_GLOBAL 0x00010000 | ||
59 | #define IXP2000_UENGINE_LM_ADDR0_PER_CONTEXT 0x00000000 | ||
60 | |||
61 | |||
62 | #endif | ||
diff --git a/include/asm-arm/arch-ixp4xx/entry-macro.S b/include/asm-arm/arch-ixp4xx/entry-macro.S index 455da64832de..323b0bc4a39c 100644 --- a/include/asm-arm/arch-ixp4xx/entry-macro.S +++ b/include/asm-arm/arch-ixp4xx/entry-macro.S | |||
@@ -15,25 +15,26 @@ | |||
15 | ldr \irqstat, =(IXP4XX_INTC_BASE_VIRT+IXP4XX_ICIP_OFFSET) | 15 | ldr \irqstat, =(IXP4XX_INTC_BASE_VIRT+IXP4XX_ICIP_OFFSET) |
16 | ldr \irqstat, [\irqstat] @ get interrupts | 16 | ldr \irqstat, [\irqstat] @ get interrupts |
17 | cmp \irqstat, #0 | 17 | cmp \irqstat, #0 |
18 | beq 1001f | 18 | beq 1001f @ upper IRQ? |
19 | clz \irqnr, \irqstat | 19 | clz \irqnr, \irqstat |
20 | mov \base, #31 | 20 | mov \base, #31 |
21 | subs \irqnr, \base, \irqnr | 21 | sub \irqnr, \base, \irqnr |
22 | b 1002f @ lower IRQ being | ||
23 | @ handled | ||
22 | 24 | ||
23 | 1001: | 25 | 1001: |
24 | /* | 26 | /* |
25 | * IXP465 has an upper IRQ status register | 27 | * IXP465 has an upper IRQ status register |
26 | */ | 28 | */ |
27 | #if defined(CONFIG_CPU_IXP46X) | 29 | #if defined(CONFIG_CPU_IXP46X) |
28 | bne 1002f | ||
29 | ldr \irqstat, =(IXP4XX_INTC_BASE_VIRT+IXP4XX_ICIP2_OFFSET) | 30 | ldr \irqstat, =(IXP4XX_INTC_BASE_VIRT+IXP4XX_ICIP2_OFFSET) |
30 | ldr \irqstat, [\irqstat] @ get upper interrupts | 31 | ldr \irqstat, [\irqstat] @ get upper interrupts |
31 | mov \irqnr, #63 | 32 | mov \irqnr, #63 |
32 | clz \irqstat, \irqstat | 33 | clz \irqstat, \irqstat |
33 | cmp \irqstat, #32 | 34 | cmp \irqstat, #32 |
34 | subne \irqnr, \irqnr, \irqstat | 35 | subne \irqnr, \irqnr, \irqstat |
35 | 1002: | ||
36 | #endif | 36 | #endif |
37 | 1002: | ||
37 | .endm | 38 | .endm |
38 | 39 | ||
39 | 40 | ||
diff --git a/include/asm-arm/arch-ixp4xx/hardware.h b/include/asm-arm/arch-ixp4xx/hardware.h index 4ac964b9078a..cfb413c845f7 100644 --- a/include/asm-arm/arch-ixp4xx/hardware.h +++ b/include/asm-arm/arch-ixp4xx/hardware.h | |||
@@ -27,7 +27,7 @@ | |||
27 | 27 | ||
28 | #define pcibios_assign_all_busses() 1 | 28 | #define pcibios_assign_all_busses() 1 |
29 | 29 | ||
30 | #if defined(CONFIG_CPU_IXP465) && !defined(__ASSEMBLY__) | 30 | #if defined(CONFIG_CPU_IXP46X) && !defined(__ASSEMBLY__) |
31 | extern unsigned int processor_id; | 31 | extern unsigned int processor_id; |
32 | #define cpu_is_ixp465() ((processor_id & 0xffffffc0) == 0x69054200) | 32 | #define cpu_is_ixp465() ((processor_id & 0xffffffc0) == 0x69054200) |
33 | #else | 33 | #else |
@@ -44,5 +44,6 @@ extern unsigned int processor_id; | |||
44 | #include "ixdp425.h" | 44 | #include "ixdp425.h" |
45 | #include "coyote.h" | 45 | #include "coyote.h" |
46 | #include "prpmc1100.h" | 46 | #include "prpmc1100.h" |
47 | #include "nslu2.h" | ||
47 | 48 | ||
48 | #endif /* _ASM_ARCH_HARDWARE_H */ | 49 | #endif /* _ASM_ARCH_HARDWARE_H */ |
diff --git a/include/asm-arm/arch-ixp4xx/io.h b/include/asm-arm/arch-ixp4xx/io.h index e350dcb544e8..942b622455bc 100644 --- a/include/asm-arm/arch-ixp4xx/io.h +++ b/include/asm-arm/arch-ixp4xx/io.h | |||
@@ -59,11 +59,10 @@ extern int ixp4xx_pci_write(u32 addr, u32 cmd, u32 data); | |||
59 | * fallback to the default. | 59 | * fallback to the default. |
60 | */ | 60 | */ |
61 | static inline void __iomem * | 61 | static inline void __iomem * |
62 | __ixp4xx_ioremap(unsigned long addr, size_t size, unsigned long flags, unsigned long align) | 62 | __ixp4xx_ioremap(unsigned long addr, size_t size, unsigned long flags) |
63 | { | 63 | { |
64 | extern void __iomem * __ioremap(unsigned long, size_t, unsigned long, unsigned long); | ||
65 | if((addr < 0x48000000) || (addr > 0x4fffffff)) | 64 | if((addr < 0x48000000) || (addr > 0x4fffffff)) |
66 | return __ioremap(addr, size, flags, align); | 65 | return __ioremap(addr, size, flags); |
67 | 66 | ||
68 | return (void *)addr; | 67 | return (void *)addr; |
69 | } | 68 | } |
@@ -71,18 +70,16 @@ __ixp4xx_ioremap(unsigned long addr, size_t size, unsigned long flags, unsigned | |||
71 | static inline void | 70 | static inline void |
72 | __ixp4xx_iounmap(void __iomem *addr) | 71 | __ixp4xx_iounmap(void __iomem *addr) |
73 | { | 72 | { |
74 | extern void __iounmap(void __iomem *addr); | ||
75 | |||
76 | if ((u32)addr >= VMALLOC_START) | 73 | if ((u32)addr >= VMALLOC_START) |
77 | __iounmap(addr); | 74 | __iounmap(addr); |
78 | } | 75 | } |
79 | 76 | ||
80 | #define __arch_ioremap(a, s, f, x) __ixp4xx_ioremap(a, s, f, x) | 77 | #define __arch_ioremap(a, s, f) __ixp4xx_ioremap(a, s, f) |
81 | #define __arch_iounmap(a) __ixp4xx_iounmap(a) | 78 | #define __arch_iounmap(a) __ixp4xx_iounmap(a) |
82 | 79 | ||
83 | #define writeb(p, v) __ixp4xx_writeb(p, v) | 80 | #define writeb(v, p) __ixp4xx_writeb(v, p) |
84 | #define writew(p, v) __ixp4xx_writew(p, v) | 81 | #define writew(v, p) __ixp4xx_writew(v, p) |
85 | #define writel(p, v) __ixp4xx_writel(p, v) | 82 | #define writel(v, p) __ixp4xx_writel(v, p) |
86 | 83 | ||
87 | #define writesb(p, v, l) __ixp4xx_writesb(p, v, l) | 84 | #define writesb(p, v, l) __ixp4xx_writesb(p, v, l) |
88 | #define writesw(p, v, l) __ixp4xx_writesw(p, v, l) | 85 | #define writesw(p, v, l) __ixp4xx_writesw(p, v, l) |
@@ -97,8 +94,9 @@ __ixp4xx_iounmap(void __iomem *addr) | |||
97 | #define readsl(p, v, l) __ixp4xx_readsl(p, v, l) | 94 | #define readsl(p, v, l) __ixp4xx_readsl(p, v, l) |
98 | 95 | ||
99 | static inline void | 96 | static inline void |
100 | __ixp4xx_writeb(u8 value, u32 addr) | 97 | __ixp4xx_writeb(u8 value, volatile void __iomem *p) |
101 | { | 98 | { |
99 | u32 addr = (u32)p; | ||
102 | u32 n, byte_enables, data; | 100 | u32 n, byte_enables, data; |
103 | 101 | ||
104 | if (addr >= VMALLOC_START) { | 102 | if (addr >= VMALLOC_START) { |
@@ -113,15 +111,16 @@ __ixp4xx_writeb(u8 value, u32 addr) | |||
113 | } | 111 | } |
114 | 112 | ||
115 | static inline void | 113 | static inline void |
116 | __ixp4xx_writesb(u32 bus_addr, u8 *vaddr, int count) | 114 | __ixp4xx_writesb(volatile void __iomem *bus_addr, const u8 *vaddr, int count) |
117 | { | 115 | { |
118 | while (count--) | 116 | while (count--) |
119 | writeb(*vaddr++, bus_addr); | 117 | writeb(*vaddr++, bus_addr); |
120 | } | 118 | } |
121 | 119 | ||
122 | static inline void | 120 | static inline void |
123 | __ixp4xx_writew(u16 value, u32 addr) | 121 | __ixp4xx_writew(u16 value, volatile void __iomem *p) |
124 | { | 122 | { |
123 | u32 addr = (u32)p; | ||
125 | u32 n, byte_enables, data; | 124 | u32 n, byte_enables, data; |
126 | 125 | ||
127 | if (addr >= VMALLOC_START) { | 126 | if (addr >= VMALLOC_START) { |
@@ -136,15 +135,16 @@ __ixp4xx_writew(u16 value, u32 addr) | |||
136 | } | 135 | } |
137 | 136 | ||
138 | static inline void | 137 | static inline void |
139 | __ixp4xx_writesw(u32 bus_addr, u16 *vaddr, int count) | 138 | __ixp4xx_writesw(volatile void __iomem *bus_addr, const u16 *vaddr, int count) |
140 | { | 139 | { |
141 | while (count--) | 140 | while (count--) |
142 | writew(*vaddr++, bus_addr); | 141 | writew(*vaddr++, bus_addr); |
143 | } | 142 | } |
144 | 143 | ||
145 | static inline void | 144 | static inline void |
146 | __ixp4xx_writel(u32 value, u32 addr) | 145 | __ixp4xx_writel(u32 value, volatile void __iomem *p) |
147 | { | 146 | { |
147 | u32 addr = (u32)p; | ||
148 | if (addr >= VMALLOC_START) { | 148 | if (addr >= VMALLOC_START) { |
149 | __raw_writel(value, addr); | 149 | __raw_writel(value, addr); |
150 | return; | 150 | return; |
@@ -154,15 +154,16 @@ __ixp4xx_writel(u32 value, u32 addr) | |||
154 | } | 154 | } |
155 | 155 | ||
156 | static inline void | 156 | static inline void |
157 | __ixp4xx_writesl(u32 bus_addr, u32 *vaddr, int count) | 157 | __ixp4xx_writesl(volatile void __iomem *bus_addr, const u32 *vaddr, int count) |
158 | { | 158 | { |
159 | while (count--) | 159 | while (count--) |
160 | writel(*vaddr++, bus_addr); | 160 | writel(*vaddr++, bus_addr); |
161 | } | 161 | } |
162 | 162 | ||
163 | static inline unsigned char | 163 | static inline unsigned char |
164 | __ixp4xx_readb(u32 addr) | 164 | __ixp4xx_readb(const volatile void __iomem *p) |
165 | { | 165 | { |
166 | u32 addr = (u32)p; | ||
166 | u32 n, byte_enables, data; | 167 | u32 n, byte_enables, data; |
167 | 168 | ||
168 | if (addr >= VMALLOC_START) | 169 | if (addr >= VMALLOC_START) |
@@ -177,15 +178,16 @@ __ixp4xx_readb(u32 addr) | |||
177 | } | 178 | } |
178 | 179 | ||
179 | static inline void | 180 | static inline void |
180 | __ixp4xx_readsb(u32 bus_addr, u8 *vaddr, u32 count) | 181 | __ixp4xx_readsb(const volatile void __iomem *bus_addr, u8 *vaddr, u32 count) |
181 | { | 182 | { |
182 | while (count--) | 183 | while (count--) |
183 | *vaddr++ = readb(bus_addr); | 184 | *vaddr++ = readb(bus_addr); |
184 | } | 185 | } |
185 | 186 | ||
186 | static inline unsigned short | 187 | static inline unsigned short |
187 | __ixp4xx_readw(u32 addr) | 188 | __ixp4xx_readw(const volatile void __iomem *p) |
188 | { | 189 | { |
190 | u32 addr = (u32)p; | ||
189 | u32 n, byte_enables, data; | 191 | u32 n, byte_enables, data; |
190 | 192 | ||
191 | if (addr >= VMALLOC_START) | 193 | if (addr >= VMALLOC_START) |
@@ -200,15 +202,16 @@ __ixp4xx_readw(u32 addr) | |||
200 | } | 202 | } |
201 | 203 | ||
202 | static inline void | 204 | static inline void |
203 | __ixp4xx_readsw(u32 bus_addr, u16 *vaddr, u32 count) | 205 | __ixp4xx_readsw(const volatile void __iomem *bus_addr, u16 *vaddr, u32 count) |
204 | { | 206 | { |
205 | while (count--) | 207 | while (count--) |
206 | *vaddr++ = readw(bus_addr); | 208 | *vaddr++ = readw(bus_addr); |
207 | } | 209 | } |
208 | 210 | ||
209 | static inline unsigned long | 211 | static inline unsigned long |
210 | __ixp4xx_readl(u32 addr) | 212 | __ixp4xx_readl(const volatile void __iomem *p) |
211 | { | 213 | { |
214 | u32 addr = (u32)p; | ||
212 | u32 data; | 215 | u32 data; |
213 | 216 | ||
214 | if (addr >= VMALLOC_START) | 217 | if (addr >= VMALLOC_START) |
@@ -221,7 +224,7 @@ __ixp4xx_readl(u32 addr) | |||
221 | } | 224 | } |
222 | 225 | ||
223 | static inline void | 226 | static inline void |
224 | __ixp4xx_readsl(u32 bus_addr, u32 *vaddr, u32 count) | 227 | __ixp4xx_readsl(const volatile void __iomem *bus_addr, u32 *vaddr, u32 count) |
225 | { | 228 | { |
226 | while (count--) | 229 | while (count--) |
227 | *vaddr++ = readl(bus_addr); | 230 | *vaddr++ = readl(bus_addr); |
@@ -239,7 +242,7 @@ __ixp4xx_readsl(u32 bus_addr, u32 *vaddr, u32 count) | |||
239 | eth_copy_and_sum((s),__mem_pci(c),(l),(b)) | 242 | eth_copy_and_sum((s),__mem_pci(c),(l),(b)) |
240 | 243 | ||
241 | static inline int | 244 | static inline int |
242 | check_signature(unsigned long bus_addr, const unsigned char *signature, | 245 | check_signature(const unsigned char __iomem *bus_addr, const unsigned char *signature, |
243 | int length) | 246 | int length) |
244 | { | 247 | { |
245 | int retval = 0; | 248 | int retval = 0; |
@@ -389,7 +392,7 @@ __ixp4xx_insl(u32 io_addr, u32 *vaddr, u32 count) | |||
389 | #define __is_io_address(p) (((unsigned long)p >= PIO_OFFSET) && \ | 392 | #define __is_io_address(p) (((unsigned long)p >= PIO_OFFSET) && \ |
390 | ((unsigned long)p <= (PIO_MASK + PIO_OFFSET))) | 393 | ((unsigned long)p <= (PIO_MASK + PIO_OFFSET))) |
391 | static inline unsigned int | 394 | static inline unsigned int |
392 | __ixp4xx_ioread8(void __iomem *addr) | 395 | __ixp4xx_ioread8(const void __iomem *addr) |
393 | { | 396 | { |
394 | unsigned long port = (unsigned long __force)addr; | 397 | unsigned long port = (unsigned long __force)addr; |
395 | if (__is_io_address(port)) | 398 | if (__is_io_address(port)) |
@@ -398,12 +401,12 @@ __ixp4xx_ioread8(void __iomem *addr) | |||
398 | #ifndef CONFIG_IXP4XX_INDIRECT_PCI | 401 | #ifndef CONFIG_IXP4XX_INDIRECT_PCI |
399 | return (unsigned int)__raw_readb(port); | 402 | return (unsigned int)__raw_readb(port); |
400 | #else | 403 | #else |
401 | return (unsigned int)__ixp4xx_readb(port); | 404 | return (unsigned int)__ixp4xx_readb(addr); |
402 | #endif | 405 | #endif |
403 | } | 406 | } |
404 | 407 | ||
405 | static inline void | 408 | static inline void |
406 | __ixp4xx_ioread8_rep(void __iomem *addr, void *vaddr, u32 count) | 409 | __ixp4xx_ioread8_rep(const void __iomem *addr, void *vaddr, u32 count) |
407 | { | 410 | { |
408 | unsigned long port = (unsigned long __force)addr; | 411 | unsigned long port = (unsigned long __force)addr; |
409 | if (__is_io_address(port)) | 412 | if (__is_io_address(port)) |
@@ -412,12 +415,12 @@ __ixp4xx_ioread8_rep(void __iomem *addr, void *vaddr, u32 count) | |||
412 | #ifndef CONFIG_IXP4XX_INDIRECT_PCI | 415 | #ifndef CONFIG_IXP4XX_INDIRECT_PCI |
413 | __raw_readsb(addr, vaddr, count); | 416 | __raw_readsb(addr, vaddr, count); |
414 | #else | 417 | #else |
415 | __ixp4xx_readsb(port, vaddr, count); | 418 | __ixp4xx_readsb(addr, vaddr, count); |
416 | #endif | 419 | #endif |
417 | } | 420 | } |
418 | 421 | ||
419 | static inline unsigned int | 422 | static inline unsigned int |
420 | __ixp4xx_ioread16(void __iomem *addr) | 423 | __ixp4xx_ioread16(const void __iomem *addr) |
421 | { | 424 | { |
422 | unsigned long port = (unsigned long __force)addr; | 425 | unsigned long port = (unsigned long __force)addr; |
423 | if (__is_io_address(port)) | 426 | if (__is_io_address(port)) |
@@ -426,12 +429,12 @@ __ixp4xx_ioread16(void __iomem *addr) | |||
426 | #ifndef CONFIG_IXP4XX_INDIRECT_PCI | 429 | #ifndef CONFIG_IXP4XX_INDIRECT_PCI |
427 | return le16_to_cpu(__raw_readw((u32)port)); | 430 | return le16_to_cpu(__raw_readw((u32)port)); |
428 | #else | 431 | #else |
429 | return (unsigned int)__ixp4xx_readw((u32)port); | 432 | return (unsigned int)__ixp4xx_readw(addr); |
430 | #endif | 433 | #endif |
431 | } | 434 | } |
432 | 435 | ||
433 | static inline void | 436 | static inline void |
434 | __ixp4xx_ioread16_rep(void __iomem *addr, void *vaddr, u32 count) | 437 | __ixp4xx_ioread16_rep(const void __iomem *addr, void *vaddr, u32 count) |
435 | { | 438 | { |
436 | unsigned long port = (unsigned long __force)addr; | 439 | unsigned long port = (unsigned long __force)addr; |
437 | if (__is_io_address(port)) | 440 | if (__is_io_address(port)) |
@@ -440,12 +443,12 @@ __ixp4xx_ioread16_rep(void __iomem *addr, void *vaddr, u32 count) | |||
440 | #ifndef CONFIG_IXP4XX_INDIRECT_PCI | 443 | #ifndef CONFIG_IXP4XX_INDIRECT_PCI |
441 | __raw_readsw(addr, vaddr, count); | 444 | __raw_readsw(addr, vaddr, count); |
442 | #else | 445 | #else |
443 | __ixp4xx_readsw(port, vaddr, count); | 446 | __ixp4xx_readsw(addr, vaddr, count); |
444 | #endif | 447 | #endif |
445 | } | 448 | } |
446 | 449 | ||
447 | static inline unsigned int | 450 | static inline unsigned int |
448 | __ixp4xx_ioread32(void __iomem *addr) | 451 | __ixp4xx_ioread32(const void __iomem *addr) |
449 | { | 452 | { |
450 | unsigned long port = (unsigned long __force)addr; | 453 | unsigned long port = (unsigned long __force)addr; |
451 | if (__is_io_address(port)) | 454 | if (__is_io_address(port)) |
@@ -454,13 +457,13 @@ __ixp4xx_ioread32(void __iomem *addr) | |||
454 | #ifndef CONFIG_IXP4XX_INDIRECT_PCI | 457 | #ifndef CONFIG_IXP4XX_INDIRECT_PCI |
455 | return le32_to_cpu(__raw_readl((u32)port)); | 458 | return le32_to_cpu(__raw_readl((u32)port)); |
456 | #else | 459 | #else |
457 | return (unsigned int)__ixp4xx_readl((u32)port); | 460 | return (unsigned int)__ixp4xx_readl(addr); |
458 | #endif | 461 | #endif |
459 | } | 462 | } |
460 | } | 463 | } |
461 | 464 | ||
462 | static inline void | 465 | static inline void |
463 | __ixp4xx_ioread32_rep(void __iomem *addr, void *vaddr, u32 count) | 466 | __ixp4xx_ioread32_rep(const void __iomem *addr, void *vaddr, u32 count) |
464 | { | 467 | { |
465 | unsigned long port = (unsigned long __force)addr; | 468 | unsigned long port = (unsigned long __force)addr; |
466 | if (__is_io_address(port)) | 469 | if (__is_io_address(port)) |
@@ -469,7 +472,7 @@ __ixp4xx_ioread32_rep(void __iomem *addr, void *vaddr, u32 count) | |||
469 | #ifndef CONFIG_IXP4XX_INDIRECT_PCI | 472 | #ifndef CONFIG_IXP4XX_INDIRECT_PCI |
470 | __raw_readsl(addr, vaddr, count); | 473 | __raw_readsl(addr, vaddr, count); |
471 | #else | 474 | #else |
472 | __ixp4xx_readsl(port, vaddr, count); | 475 | __ixp4xx_readsl(addr, vaddr, count); |
473 | #endif | 476 | #endif |
474 | } | 477 | } |
475 | 478 | ||
@@ -483,7 +486,7 @@ __ixp4xx_iowrite8(u8 value, void __iomem *addr) | |||
483 | #ifndef CONFIG_IXP4XX_INDIRECT_PCI | 486 | #ifndef CONFIG_IXP4XX_INDIRECT_PCI |
484 | __raw_writeb(value, port); | 487 | __raw_writeb(value, port); |
485 | #else | 488 | #else |
486 | __ixp4xx_writeb(value, port); | 489 | __ixp4xx_writeb(value, addr); |
487 | #endif | 490 | #endif |
488 | } | 491 | } |
489 | 492 | ||
@@ -497,7 +500,7 @@ __ixp4xx_iowrite8_rep(void __iomem *addr, const void *vaddr, u32 count) | |||
497 | #ifndef CONFIG_IXP4XX_INDIRECT_PCI | 500 | #ifndef CONFIG_IXP4XX_INDIRECT_PCI |
498 | __raw_writesb(addr, vaddr, count); | 501 | __raw_writesb(addr, vaddr, count); |
499 | #else | 502 | #else |
500 | __ixp4xx_writesb(port, vaddr, count); | 503 | __ixp4xx_writesb(addr, vaddr, count); |
501 | #endif | 504 | #endif |
502 | } | 505 | } |
503 | 506 | ||
@@ -511,7 +514,7 @@ __ixp4xx_iowrite16(u16 value, void __iomem *addr) | |||
511 | #ifndef CONFIG_IXP4XX_INDIRECT_PCI | 514 | #ifndef CONFIG_IXP4XX_INDIRECT_PCI |
512 | __raw_writew(cpu_to_le16(value), addr); | 515 | __raw_writew(cpu_to_le16(value), addr); |
513 | #else | 516 | #else |
514 | __ixp4xx_writew(value, port); | 517 | __ixp4xx_writew(value, addr); |
515 | #endif | 518 | #endif |
516 | } | 519 | } |
517 | 520 | ||
@@ -525,7 +528,7 @@ __ixp4xx_iowrite16_rep(void __iomem *addr, const void *vaddr, u32 count) | |||
525 | #ifndef CONFIG_IXP4XX_INDIRECT_PCI | 528 | #ifndef CONFIG_IXP4XX_INDIRECT_PCI |
526 | __raw_writesw(addr, vaddr, count); | 529 | __raw_writesw(addr, vaddr, count); |
527 | #else | 530 | #else |
528 | __ixp4xx_writesw(port, vaddr, count); | 531 | __ixp4xx_writesw(addr, vaddr, count); |
529 | #endif | 532 | #endif |
530 | } | 533 | } |
531 | 534 | ||
@@ -539,7 +542,7 @@ __ixp4xx_iowrite32(u32 value, void __iomem *addr) | |||
539 | #ifndef CONFIG_IXP4XX_INDIRECT_PCI | 542 | #ifndef CONFIG_IXP4XX_INDIRECT_PCI |
540 | __raw_writel(cpu_to_le32(value), port); | 543 | __raw_writel(cpu_to_le32(value), port); |
541 | #else | 544 | #else |
542 | __ixp4xx_writel(value, port); | 545 | __ixp4xx_writel(value, addr); |
543 | #endif | 546 | #endif |
544 | } | 547 | } |
545 | 548 | ||
@@ -553,7 +556,7 @@ __ixp4xx_iowrite32_rep(void __iomem *addr, const void *vaddr, u32 count) | |||
553 | #ifndef CONFIG_IXP4XX_INDIRECT_PCI | 556 | #ifndef CONFIG_IXP4XX_INDIRECT_PCI |
554 | __raw_writesl(addr, vaddr, count); | 557 | __raw_writesl(addr, vaddr, count); |
555 | #else | 558 | #else |
556 | __ixp4xx_writesl(port, vaddr, count); | 559 | __ixp4xx_writesl(addr, vaddr, count); |
557 | #endif | 560 | #endif |
558 | } | 561 | } |
559 | 562 | ||
diff --git a/include/asm-arm/arch-ixp4xx/irqs.h b/include/asm-arm/arch-ixp4xx/irqs.h index ca808281c7f9..2cf4930372bc 100644 --- a/include/asm-arm/arch-ixp4xx/irqs.h +++ b/include/asm-arm/arch-ixp4xx/irqs.h | |||
@@ -93,4 +93,11 @@ | |||
93 | #define IRQ_COYOTE_PCI_SLOT1 IRQ_IXP4XX_GPIO11 | 93 | #define IRQ_COYOTE_PCI_SLOT1 IRQ_IXP4XX_GPIO11 |
94 | #define IRQ_COYOTE_IDE IRQ_IXP4XX_GPIO5 | 94 | #define IRQ_COYOTE_IDE IRQ_IXP4XX_GPIO5 |
95 | 95 | ||
96 | /* | ||
97 | * NSLU2 board IRQs | ||
98 | */ | ||
99 | #define IRQ_NSLU2_PCI_INTA IRQ_IXP4XX_GPIO11 | ||
100 | #define IRQ_NSLU2_PCI_INTB IRQ_IXP4XX_GPIO10 | ||
101 | #define IRQ_NSLU2_PCI_INTC IRQ_IXP4XX_GPIO9 | ||
102 | |||
96 | #endif | 103 | #endif |
diff --git a/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h b/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h index 004696a95bdb..9444958bec1e 100644 --- a/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h +++ b/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h | |||
@@ -36,38 +36,39 @@ | |||
36 | * | 36 | * |
37 | * 0x6000000 0x00004000 ioremap'd QMgr | 37 | * 0x6000000 0x00004000 ioremap'd QMgr |
38 | * | 38 | * |
39 | * 0xC0000000 0x00001000 0xffbfe000 PCI CFG | 39 | * 0xC0000000 0x00001000 0xffbff000 PCI CFG |
40 | * | 40 | * |
41 | * 0xC4000000 0x00001000 0xffbfd000 EXP CFG | 41 | * 0xC4000000 0x00001000 0xffbfe000 EXP CFG |
42 | * | 42 | * |
43 | * 0xC8000000 0x0000C000 0xffbf2000 On-Chip Peripherals | 43 | * 0xC8000000 0x00013000 0xffbeb000 On-Chip Peripherals |
44 | */ | 44 | */ |
45 | 45 | ||
46 | /* | 46 | /* |
47 | * Queue Manager | 47 | * Queue Manager |
48 | */ | 48 | */ |
49 | #define IXP4XX_QMGR_BASE_PHYS (0x60000000) | 49 | #define IXP4XX_QMGR_BASE_PHYS (0x60000000) |
50 | #define IXP4XX_QMGR_REGION_SIZE (0x00004000) | ||
50 | 51 | ||
51 | /* | 52 | /* |
52 | * Expansion BUS Configuration registers | 53 | * Expansion BUS Configuration registers |
53 | */ | 54 | */ |
54 | #define IXP4XX_EXP_CFG_BASE_PHYS (0xC4000000) | 55 | #define IXP4XX_EXP_CFG_BASE_PHYS (0xC4000000) |
55 | #define IXP4XX_EXP_CFG_BASE_VIRT (0xFFBFD000) | 56 | #define IXP4XX_EXP_CFG_BASE_VIRT (0xFFBFE000) |
56 | #define IXP4XX_EXP_CFG_REGION_SIZE (0x00001000) | 57 | #define IXP4XX_EXP_CFG_REGION_SIZE (0x00001000) |
57 | 58 | ||
58 | /* | 59 | /* |
59 | * PCI Config registers | 60 | * PCI Config registers |
60 | */ | 61 | */ |
61 | #define IXP4XX_PCI_CFG_BASE_PHYS (0xC0000000) | 62 | #define IXP4XX_PCI_CFG_BASE_PHYS (0xC0000000) |
62 | #define IXP4XX_PCI_CFG_BASE_VIRT (0xFFBFE000) | 63 | #define IXP4XX_PCI_CFG_BASE_VIRT (0xFFBFF000) |
63 | #define IXP4XX_PCI_CFG_REGION_SIZE (0x00001000) | 64 | #define IXP4XX_PCI_CFG_REGION_SIZE (0x00001000) |
64 | 65 | ||
65 | /* | 66 | /* |
66 | * Peripheral space | 67 | * Peripheral space |
67 | */ | 68 | */ |
68 | #define IXP4XX_PERIPHERAL_BASE_PHYS (0xC8000000) | 69 | #define IXP4XX_PERIPHERAL_BASE_PHYS (0xC8000000) |
69 | #define IXP4XX_PERIPHERAL_BASE_VIRT (0xFFBF2000) | 70 | #define IXP4XX_PERIPHERAL_BASE_VIRT (0xFFBEB000) |
70 | #define IXP4XX_PERIPHERAL_REGION_SIZE (0x0000C000) | 71 | #define IXP4XX_PERIPHERAL_REGION_SIZE (0x00013000) |
71 | 72 | ||
72 | /* | 73 | /* |
73 | * Debug UART | 74 | * Debug UART |
@@ -115,25 +116,48 @@ | |||
115 | /* | 116 | /* |
116 | * Peripheral Space Register Region Base Addresses | 117 | * Peripheral Space Register Region Base Addresses |
117 | */ | 118 | */ |
118 | #define IXP4XX_UART1_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x0000) | 119 | #define IXP4XX_UART1_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x0000) |
119 | #define IXP4XX_UART2_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x1000) | 120 | #define IXP4XX_UART2_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x1000) |
120 | #define IXP4XX_PMU_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x2000) | 121 | #define IXP4XX_PMU_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x2000) |
121 | #define IXP4XX_INTC_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x3000) | 122 | #define IXP4XX_INTC_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x3000) |
122 | #define IXP4XX_GPIO_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x4000) | 123 | #define IXP4XX_GPIO_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x4000) |
123 | #define IXP4XX_TIMER_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x5000) | 124 | #define IXP4XX_TIMER_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x5000) |
124 | #define IXP4XX_EthA_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x9000) | 125 | #define IXP4XX_NPEA_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x6000) |
125 | #define IXP4XX_EthB_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0xA000) | 126 | #define IXP4XX_NPEB_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x7000) |
126 | #define IXP4XX_USB_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0xB000) | 127 | #define IXP4XX_NPEC_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x8000) |
127 | 128 | #define IXP4XX_EthB_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x9000) | |
128 | #define IXP4XX_UART1_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x0000) | 129 | #define IXP4XX_EthC_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0xA000) |
129 | #define IXP4XX_UART2_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x1000) | 130 | #define IXP4XX_USB_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0xB000) |
130 | #define IXP4XX_PMU_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x2000) | 131 | /* ixp46X only */ |
131 | #define IXP4XX_INTC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x3000) | 132 | #define IXP4XX_EthA_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0xC000) |
132 | #define IXP4XX_GPIO_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x4000) | 133 | #define IXP4XX_EthB1_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0xD000) |
133 | #define IXP4XX_TIMER_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x5000) | 134 | #define IXP4XX_EthB2_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0xE000) |
134 | #define IXP4XX_EthA_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x9000) | 135 | #define IXP4XX_EthB3_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0xF000) |
135 | #define IXP4XX_EthB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xA000) | 136 | #define IXP4XX_TIMESYNC_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x10000) |
136 | #define IXP4XX_USB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xB000) | 137 | #define IXP4XX_I2C_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x11000) |
138 | #define IXP4XX_SSP_BASE_PHYS (IXP4XX_PERIPHERAL_BASE_PHYS + 0x12000) | ||
139 | |||
140 | |||
141 | #define IXP4XX_UART1_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x0000) | ||
142 | #define IXP4XX_UART2_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x1000) | ||
143 | #define IXP4XX_PMU_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x2000) | ||
144 | #define IXP4XX_INTC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x3000) | ||
145 | #define IXP4XX_GPIO_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x4000) | ||
146 | #define IXP4XX_TIMER_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x5000) | ||
147 | #define IXP4XX_NPEA_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_PHYS + 0x6000) | ||
148 | #define IXP4XX_NPEB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_PHYS + 0x7000) | ||
149 | #define IXP4XX_NPEC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_PHYS + 0x8000) | ||
150 | #define IXP4XX_EthB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x9000) | ||
151 | #define IXP4XX_EthC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xA000) | ||
152 | #define IXP4XX_USB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xB000) | ||
153 | /* ixp46X only */ | ||
154 | #define IXP4XX_EthA_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xC000) | ||
155 | #define IXP4XX_EthB1_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xD000) | ||
156 | #define IXP4XX_EthB2_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xE000) | ||
157 | #define IXP4XX_EthB3_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xF000) | ||
158 | #define IXP4XX_TIMESYNC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x10000) | ||
159 | #define IXP4XX_I2C_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x11000) | ||
160 | #define IXP4XX_SSP_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x12000) | ||
137 | 161 | ||
138 | /* | 162 | /* |
139 | * Constants to make it easy to access Interrupt Controller registers | 163 | * Constants to make it easy to access Interrupt Controller registers |
diff --git a/include/asm-arm/arch-ixp4xx/memory.h b/include/asm-arm/arch-ixp4xx/memory.h index d348548b592b..e024d0a1a669 100644 --- a/include/asm-arm/arch-ixp4xx/memory.h +++ b/include/asm-arm/arch-ixp4xx/memory.h | |||
@@ -12,7 +12,7 @@ | |||
12 | /* | 12 | /* |
13 | * Physical DRAM offset. | 13 | * Physical DRAM offset. |
14 | */ | 14 | */ |
15 | #define PHYS_OFFSET (0x00000000UL) | 15 | #define PHYS_OFFSET UL(0x00000000) |
16 | 16 | ||
17 | #ifndef __ASSEMBLY__ | 17 | #ifndef __ASSEMBLY__ |
18 | 18 | ||
diff --git a/include/asm-arm/arch-ixp4xx/nslu2.h b/include/asm-arm/arch-ixp4xx/nslu2.h new file mode 100644 index 000000000000..b8b347a559c7 --- /dev/null +++ b/include/asm-arm/arch-ixp4xx/nslu2.h | |||
@@ -0,0 +1,96 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-ixp4xx/nslu2.h | ||
3 | * | ||
4 | * NSLU2 platform specific definitions | ||
5 | * | ||
6 | * Author: Mark Rakes <mrakes AT mac.com> | ||
7 | * Maintainers: http://www.nslu2-linux.org | ||
8 | * | ||
9 | * based on ixdp425.h: | ||
10 | * Copyright 2004 (c) MontaVista, Software, Inc. | ||
11 | * | ||
12 | * This file is licensed under the terms of the GNU General Public | ||
13 | * License version 2. This program is licensed "as is" without any | ||
14 | * warranty of any kind, whether express or implied. | ||
15 | */ | ||
16 | |||
17 | #ifndef __ASM_ARCH_HARDWARE_H__ | ||
18 | #error "Do not include this directly, instead #include <asm/hardware.h>" | ||
19 | #endif | ||
20 | |||
21 | #define NSLU2_FLASH_BASE IXP4XX_EXP_BUS_CS0_BASE_PHYS | ||
22 | #define NSLU2_FLASH_SIZE IXP4XX_EXP_BUS_CSX_REGION_SIZE | ||
23 | |||
24 | #define NSLU2_SDA_PIN 7 | ||
25 | #define NSLU2_SCL_PIN 6 | ||
26 | |||
27 | /* | ||
28 | * NSLU2 PCI IRQs | ||
29 | */ | ||
30 | #define NSLU2_PCI_MAX_DEV 3 | ||
31 | #define NSLU2_PCI_IRQ_LINES 3 | ||
32 | |||
33 | |||
34 | /* PCI controller GPIO to IRQ pin mappings */ | ||
35 | #define NSLU2_PCI_INTA_PIN 11 | ||
36 | #define NSLU2_PCI_INTB_PIN 10 | ||
37 | #define NSLU2_PCI_INTC_PIN 9 | ||
38 | #define NSLU2_PCI_INTD_PIN 8 | ||
39 | |||
40 | |||
41 | /* NSLU2 Timer */ | ||
42 | #define NSLU2_FREQ 66000000 | ||
43 | #define NSLU2_CLOCK_TICK_RATE (((NSLU2_FREQ / HZ & ~IXP4XX_OST_RELOAD_MASK) + 1) * HZ) | ||
44 | #define NSLU2_CLOCK_TICKS_PER_USEC ((NSLU2_CLOCK_TICK_RATE + USEC_PER_SEC/2) / USEC_PER_SEC) | ||
45 | |||
46 | /* GPIO */ | ||
47 | |||
48 | #define NSLU2_GPIO0 0 | ||
49 | #define NSLU2_GPIO1 1 | ||
50 | #define NSLU2_GPIO2 2 | ||
51 | #define NSLU2_GPIO3 3 | ||
52 | #define NSLU2_GPIO4 4 | ||
53 | #define NSLU2_GPIO5 5 | ||
54 | #define NSLU2_GPIO6 6 | ||
55 | #define NSLU2_GPIO7 7 | ||
56 | #define NSLU2_GPIO8 8 | ||
57 | #define NSLU2_GPIO9 9 | ||
58 | #define NSLU2_GPIO10 10 | ||
59 | #define NSLU2_GPIO11 11 | ||
60 | #define NSLU2_GPIO12 12 | ||
61 | #define NSLU2_GPIO13 13 | ||
62 | #define NSLU2_GPIO14 14 | ||
63 | #define NSLU2_GPIO15 15 | ||
64 | |||
65 | /* Buttons */ | ||
66 | |||
67 | #define NSLU2_PB_GPIO NSLU2_GPIO5 | ||
68 | #define NSLU2_PO_GPIO NSLU2_GPIO8 /* power off */ | ||
69 | #define NSLU2_RB_GPIO NSLU2_GPIO12 | ||
70 | |||
71 | #define NSLU2_PB_IRQ IRQ_IXP4XX_GPIO5 | ||
72 | #define NSLU2_RB_IRQ IRQ_IXP4XX_GPIO12 | ||
73 | |||
74 | #define NSLU2_PB_BM (1L << NSLU2_PB_GPIO) | ||
75 | #define NSLU2_PO_BM (1L << NSLU2_PO_GPIO) | ||
76 | #define NSLU2_RB_BM (1L << NSLU2_RB_GPIO) | ||
77 | |||
78 | /* Buzzer */ | ||
79 | |||
80 | #define NSLU2_GPIO_BUZZ 4 | ||
81 | #define NSLU2_BZ_BM (1L << NSLU2_GPIO_BUZZ) | ||
82 | /* LEDs */ | ||
83 | |||
84 | #define NSLU2_LED_RED NSLU2_GPIO0 | ||
85 | #define NSLU2_LED_GRN NSLU2_GPIO1 | ||
86 | |||
87 | #define NSLU2_LED_RED_BM (1L << NSLU2_LED_RED) | ||
88 | #define NSLU2_LED_GRN_BM (1L << NSLU2_LED_GRN) | ||
89 | |||
90 | #define NSLU2_LED_DISK1 NSLU2_GPIO2 | ||
91 | #define NSLU2_LED_DISK2 NSLU2_GPIO3 | ||
92 | |||
93 | #define NSLU2_LED_DISK1_BM (1L << NSLU2_GPIO2) | ||
94 | #define NSLU2_LED_DISK2_BM (1L << NSLU2_GPIO3) | ||
95 | |||
96 | |||
diff --git a/include/asm-arm/arch-ixp4xx/platform.h b/include/asm-arm/arch-ixp4xx/platform.h index d13ee7f78c70..f14ed63590c3 100644 --- a/include/asm-arm/arch-ixp4xx/platform.h +++ b/include/asm-arm/arch-ixp4xx/platform.h | |||
@@ -93,7 +93,7 @@ extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys); | |||
93 | 93 | ||
94 | static inline void gpio_line_config(u8 line, u32 direction) | 94 | static inline void gpio_line_config(u8 line, u32 direction) |
95 | { | 95 | { |
96 | if (direction == IXP4XX_GPIO_OUT) | 96 | if (direction == IXP4XX_GPIO_IN) |
97 | *IXP4XX_GPIO_GPOER |= (1 << line); | 97 | *IXP4XX_GPIO_GPOER |= (1 << line); |
98 | else | 98 | else |
99 | *IXP4XX_GPIO_GPOER &= ~(1 << line); | 99 | *IXP4XX_GPIO_GPOER &= ~(1 << line); |
diff --git a/include/asm-arm/arch-l7200/aux_reg.h b/include/asm-arm/arch-l7200/aux_reg.h index 762cbc76c501..5b4396de16a0 100644 --- a/include/asm-arm/arch-l7200/aux_reg.h +++ b/include/asm-arm/arch-l7200/aux_reg.h | |||
@@ -9,7 +9,7 @@ | |||
9 | #ifndef _ASM_ARCH_AUXREG_H | 9 | #ifndef _ASM_ARCH_AUXREG_H |
10 | #define _ASM_ARCH_AUXREG_H | 10 | #define _ASM_ARCH_AUXREG_H |
11 | 11 | ||
12 | #include <asm/arch/hardware.h> | 12 | #include <asm/hardware.h> |
13 | 13 | ||
14 | #define l7200aux_reg *((volatile unsigned int *) (AUX_BASE)) | 14 | #define l7200aux_reg *((volatile unsigned int *) (AUX_BASE)) |
15 | 15 | ||
diff --git a/include/asm-arm/arch-l7200/gp_timers.h b/include/asm-arm/arch-l7200/gp_timers.h index 6f20962df248..9c4804d13578 100644 --- a/include/asm-arm/arch-l7200/gp_timers.h +++ b/include/asm-arm/arch-l7200/gp_timers.h | |||
@@ -10,7 +10,7 @@ | |||
10 | #ifndef _ASM_ARCH_GPTIMERS_H | 10 | #ifndef _ASM_ARCH_GPTIMERS_H |
11 | #define _ASM_ARCH_GPTIMERS_H | 11 | #define _ASM_ARCH_GPTIMERS_H |
12 | 12 | ||
13 | #include <asm/arch/hardware.h> | 13 | #include <asm/hardware.h> |
14 | 14 | ||
15 | /* | 15 | /* |
16 | * Layout of L7200 general purpose timer registers | 16 | * Layout of L7200 general purpose timer registers |
diff --git a/include/asm-arm/arch-l7200/io.h b/include/asm-arm/arch-l7200/io.h index fc012a39e2cb..cab8ad0adf09 100644 --- a/include/asm-arm/arch-l7200/io.h +++ b/include/asm-arm/arch-l7200/io.h | |||
@@ -10,7 +10,7 @@ | |||
10 | #ifndef __ASM_ARM_ARCH_IO_H | 10 | #ifndef __ASM_ARM_ARCH_IO_H |
11 | #define __ASM_ARM_ARCH_IO_H | 11 | #define __ASM_ARM_ARCH_IO_H |
12 | 12 | ||
13 | #include <asm/arch/hardware.h> | 13 | #include <asm/hardware.h> |
14 | 14 | ||
15 | #define IO_SPACE_LIMIT 0xffffffff | 15 | #define IO_SPACE_LIMIT 0xffffffff |
16 | 16 | ||
diff --git a/include/asm-arm/arch-l7200/memory.h b/include/asm-arm/arch-l7200/memory.h index c5b9608cb137..9e50a171f78a 100644 --- a/include/asm-arm/arch-l7200/memory.h +++ b/include/asm-arm/arch-l7200/memory.h | |||
@@ -15,7 +15,7 @@ | |||
15 | /* | 15 | /* |
16 | * Physical DRAM offset on the L7200 SDB. | 16 | * Physical DRAM offset on the L7200 SDB. |
17 | */ | 17 | */ |
18 | #define PHYS_OFFSET (0xf0000000UL) | 18 | #define PHYS_OFFSET UL(0xf0000000) |
19 | 19 | ||
20 | #define __virt_to_bus(x) __virt_to_phys(x) | 20 | #define __virt_to_bus(x) __virt_to_phys(x) |
21 | #define __bus_to_virt(x) __phys_to_virt(x) | 21 | #define __bus_to_virt(x) __phys_to_virt(x) |
diff --git a/include/asm-arm/arch-lh7a40x/io.h b/include/asm-arm/arch-lh7a40x/io.h index c13bdd9add92..bbcd4335f441 100644 --- a/include/asm-arm/arch-lh7a40x/io.h +++ b/include/asm-arm/arch-lh7a40x/io.h | |||
@@ -11,6 +11,8 @@ | |||
11 | #ifndef __ASM_ARCH_IO_H | 11 | #ifndef __ASM_ARCH_IO_H |
12 | #define __ASM_ARCH_IO_H | 12 | #define __ASM_ARCH_IO_H |
13 | 13 | ||
14 | #include <asm/hardware.h> | ||
15 | |||
14 | #define IO_SPACE_LIMIT 0xffffffff | 16 | #define IO_SPACE_LIMIT 0xffffffff |
15 | 17 | ||
16 | /* No ISA or PCI bus on this machine. */ | 18 | /* No ISA or PCI bus on this machine. */ |
diff --git a/include/asm-arm/arch-lh7a40x/memory.h b/include/asm-arm/arch-lh7a40x/memory.h index c650e6feb9d5..c92bcb837629 100644 --- a/include/asm-arm/arch-lh7a40x/memory.h +++ b/include/asm-arm/arch-lh7a40x/memory.h | |||
@@ -17,7 +17,7 @@ | |||
17 | /* | 17 | /* |
18 | * Physical DRAM offset. | 18 | * Physical DRAM offset. |
19 | */ | 19 | */ |
20 | #define PHYS_OFFSET (0xc0000000UL) | 20 | #define PHYS_OFFSET UL(0xc0000000) |
21 | 21 | ||
22 | /* | 22 | /* |
23 | * Virtual view <-> DMA view memory address translations | 23 | * Virtual view <-> DMA view memory address translations |
diff --git a/include/asm-arm/arch-omap/board-h4.h b/include/asm-arm/arch-omap/board-h4.h index d64ee9211eed..33ea29a41654 100644 --- a/include/asm-arm/arch-omap/board-h4.h +++ b/include/asm-arm/arch-omap/board-h4.h | |||
@@ -34,5 +34,11 @@ | |||
34 | #define OMAP24XX_ETHR_START 0x08000300 | 34 | #define OMAP24XX_ETHR_START 0x08000300 |
35 | #define OMAP24XX_ETHR_GPIO_IRQ 92 | 35 | #define OMAP24XX_ETHR_GPIO_IRQ 92 |
36 | 36 | ||
37 | #define H4_CS0_BASE 0x04000000 | ||
38 | |||
39 | #define H4_CS0_BASE 0x04000000 | ||
40 | |||
41 | #define H4_CS0_BASE 0x04000000 | ||
42 | |||
37 | #endif /* __ASM_ARCH_OMAP_H4_H */ | 43 | #endif /* __ASM_ARCH_OMAP_H4_H */ |
38 | 44 | ||
diff --git a/include/asm-arm/arch-omap/board-innovator.h b/include/asm-arm/arch-omap/board-innovator.h index 79574e0ed13d..b3cf33441f6e 100644 --- a/include/asm-arm/arch-omap/board-innovator.h +++ b/include/asm-arm/arch-omap/board-innovator.h | |||
@@ -26,7 +26,7 @@ | |||
26 | #ifndef __ASM_ARCH_OMAP_INNOVATOR_H | 26 | #ifndef __ASM_ARCH_OMAP_INNOVATOR_H |
27 | #define __ASM_ARCH_OMAP_INNOVATOR_H | 27 | #define __ASM_ARCH_OMAP_INNOVATOR_H |
28 | 28 | ||
29 | #if defined (CONFIG_ARCH_OMAP1510) | 29 | #if defined (CONFIG_ARCH_OMAP15XX) |
30 | 30 | ||
31 | #ifndef OMAP_SDRAM_DEVICE | 31 | #ifndef OMAP_SDRAM_DEVICE |
32 | #define OMAP_SDRAM_DEVICE D256M_1X16_4B | 32 | #define OMAP_SDRAM_DEVICE D256M_1X16_4B |
@@ -44,7 +44,7 @@ void fpga_write(unsigned char val, int reg); | |||
44 | unsigned char fpga_read(int reg); | 44 | unsigned char fpga_read(int reg); |
45 | #endif | 45 | #endif |
46 | 46 | ||
47 | #endif /* CONFIG_ARCH_OMAP1510 */ | 47 | #endif /* CONFIG_ARCH_OMAP15XX */ |
48 | 48 | ||
49 | #if defined (CONFIG_ARCH_OMAP16XX) | 49 | #if defined (CONFIG_ARCH_OMAP16XX) |
50 | 50 | ||
diff --git a/include/asm-arm/arch-omap/clock.h b/include/asm-arm/arch-omap/clock.h new file mode 100644 index 000000000000..740c297eb11c --- /dev/null +++ b/include/asm-arm/arch-omap/clock.h | |||
@@ -0,0 +1,91 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-omap/clock.h | ||
3 | * | ||
4 | * Copyright (C) 2004 - 2005 Nokia corporation | ||
5 | * Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com> | ||
6 | * Based on clocks.h by Tony Lindgren, Gordon McNutt and RidgeRun, Inc | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #ifndef __ARCH_ARM_OMAP_CLOCK_H | ||
14 | #define __ARCH_ARM_OMAP_CLOCK_H | ||
15 | |||
16 | struct module; | ||
17 | |||
18 | struct clk { | ||
19 | struct list_head node; | ||
20 | struct module *owner; | ||
21 | const char *name; | ||
22 | struct clk *parent; | ||
23 | unsigned long rate; | ||
24 | __u32 flags; | ||
25 | void __iomem *enable_reg; | ||
26 | __u8 enable_bit; | ||
27 | __u8 rate_offset; | ||
28 | __u8 src_offset; | ||
29 | __s8 usecount; | ||
30 | void (*recalc)(struct clk *); | ||
31 | int (*set_rate)(struct clk *, unsigned long); | ||
32 | long (*round_rate)(struct clk *, unsigned long); | ||
33 | void (*init)(struct clk *); | ||
34 | int (*enable)(struct clk *); | ||
35 | void (*disable)(struct clk *); | ||
36 | }; | ||
37 | |||
38 | struct clk_functions { | ||
39 | int (*clk_enable)(struct clk *clk); | ||
40 | void (*clk_disable)(struct clk *clk); | ||
41 | int (*clk_use)(struct clk *clk); | ||
42 | void (*clk_unuse)(struct clk *clk); | ||
43 | long (*clk_round_rate)(struct clk *clk, unsigned long rate); | ||
44 | int (*clk_set_rate)(struct clk *clk, unsigned long rate); | ||
45 | int (*clk_set_parent)(struct clk *clk, struct clk *parent); | ||
46 | struct clk * (*clk_get_parent)(struct clk *clk); | ||
47 | void (*clk_allow_idle)(struct clk *clk); | ||
48 | void (*clk_deny_idle)(struct clk *clk); | ||
49 | }; | ||
50 | |||
51 | extern unsigned int mpurate; | ||
52 | extern struct list_head clocks; | ||
53 | extern spinlock_t clockfw_lock; | ||
54 | |||
55 | extern int clk_init(struct clk_functions * custom_clocks); | ||
56 | extern int clk_register(struct clk *clk); | ||
57 | extern void clk_unregister(struct clk *clk); | ||
58 | extern void propagate_rate(struct clk *clk); | ||
59 | extern void followparent_recalc(struct clk * clk); | ||
60 | extern void clk_allow_idle(struct clk *clk); | ||
61 | extern void clk_deny_idle(struct clk *clk); | ||
62 | |||
63 | /* Clock flags */ | ||
64 | #define RATE_CKCTL (1 << 0) /* Main fixed ratio clocks */ | ||
65 | #define RATE_FIXED (1 << 1) /* Fixed clock rate */ | ||
66 | #define RATE_PROPAGATES (1 << 2) /* Program children too */ | ||
67 | #define VIRTUAL_CLOCK (1 << 3) /* Composite clock from table */ | ||
68 | #define ALWAYS_ENABLED (1 << 4) /* Clock cannot be disabled */ | ||
69 | #define ENABLE_REG_32BIT (1 << 5) /* Use 32-bit access */ | ||
70 | #define VIRTUAL_IO_ADDRESS (1 << 6) /* Clock in virtual address */ | ||
71 | #define CLOCK_IDLE_CONTROL (1 << 7) | ||
72 | #define CLOCK_NO_IDLE_PARENT (1 << 8) | ||
73 | #define DELAYED_APP (1 << 9) /* Delay application of clock */ | ||
74 | #define CONFIG_PARTICIPANT (1 << 10) /* Fundamental clock */ | ||
75 | #define CM_MPU_SEL1 (1 << 11) /* Domain divider/source */ | ||
76 | #define CM_DSP_SEL1 (1 << 12) | ||
77 | #define CM_GFX_SEL1 (1 << 13) | ||
78 | #define CM_MODEM_SEL1 (1 << 14) | ||
79 | #define CM_CORE_SEL1 (1 << 15) /* Sets divider for many */ | ||
80 | #define CM_CORE_SEL2 (1 << 16) /* sets parent for GPT */ | ||
81 | #define CM_WKUP_SEL1 (1 << 17) | ||
82 | #define CM_PLL_SEL1 (1 << 18) | ||
83 | #define CM_PLL_SEL2 (1 << 19) | ||
84 | #define CM_SYSCLKOUT_SEL1 (1 << 20) | ||
85 | #define CLOCK_IN_OMAP730 (1 << 21) | ||
86 | #define CLOCK_IN_OMAP1510 (1 << 22) | ||
87 | #define CLOCK_IN_OMAP16XX (1 << 23) | ||
88 | #define CLOCK_IN_OMAP242X (1 << 24) | ||
89 | #define CLOCK_IN_OMAP243X (1 << 25) | ||
90 | |||
91 | #endif | ||
diff --git a/include/asm-arm/arch-omap/common.h b/include/asm-arm/arch-omap/common.h index 2a676b4f13b5..08d58abd8218 100644 --- a/include/asm-arm/arch-omap/common.h +++ b/include/asm-arm/arch-omap/common.h | |||
@@ -31,6 +31,6 @@ struct sys_timer; | |||
31 | 31 | ||
32 | extern void omap_map_common_io(void); | 32 | extern void omap_map_common_io(void); |
33 | extern struct sys_timer omap_timer; | 33 | extern struct sys_timer omap_timer; |
34 | extern void omap_serial_init(int ports[]); | 34 | extern void omap_serial_init(void); |
35 | 35 | ||
36 | #endif /* __ARCH_ARM_MACH_OMAP_COMMON_H */ | 36 | #endif /* __ARCH_ARM_MACH_OMAP_COMMON_H */ |
diff --git a/include/asm-arm/arch-omap/cpu.h b/include/asm-arm/arch-omap/cpu.h index 1119e2b53e72..ec7eb675d922 100644 --- a/include/asm-arm/arch-omap/cpu.h +++ b/include/asm-arm/arch-omap/cpu.h | |||
@@ -28,12 +28,7 @@ | |||
28 | 28 | ||
29 | extern unsigned int system_rev; | 29 | extern unsigned int system_rev; |
30 | 30 | ||
31 | #define OMAP_DIE_ID_0 0xfffe1800 | 31 | #define omap2_cpu_rev() ((system_rev >> 8) & 0x0f) |
32 | #define OMAP_DIE_ID_1 0xfffe1804 | ||
33 | #define OMAP_PRODUCTION_ID_0 0xfffe2000 | ||
34 | #define OMAP_PRODUCTION_ID_1 0xfffe2004 | ||
35 | #define OMAP32_ID_0 0xfffed400 | ||
36 | #define OMAP32_ID_1 0xfffed404 | ||
37 | 32 | ||
38 | /* | 33 | /* |
39 | * Test if multicore OMAP support is needed | 34 | * Test if multicore OMAP support is needed |
@@ -50,7 +45,7 @@ extern unsigned int system_rev; | |||
50 | # define OMAP_NAME omap730 | 45 | # define OMAP_NAME omap730 |
51 | # endif | 46 | # endif |
52 | #endif | 47 | #endif |
53 | #ifdef CONFIG_ARCH_OMAP1510 | 48 | #ifdef CONFIG_ARCH_OMAP15XX |
54 | # ifdef OMAP_NAME | 49 | # ifdef OMAP_NAME |
55 | # undef MULTI_OMAP1 | 50 | # undef MULTI_OMAP1 |
56 | # define MULTI_OMAP1 | 51 | # define MULTI_OMAP1 |
@@ -79,9 +74,11 @@ extern unsigned int system_rev; | |||
79 | * Macros to group OMAP into cpu classes. | 74 | * Macros to group OMAP into cpu classes. |
80 | * These can be used in most places. | 75 | * These can be used in most places. |
81 | * cpu_is_omap7xx(): True for OMAP730 | 76 | * cpu_is_omap7xx(): True for OMAP730 |
82 | * cpu_is_omap15xx(): True for OMAP1510 and OMAP5910 | 77 | * cpu_is_omap15xx(): True for OMAP1510, OMAP5910 and OMAP310 |
83 | * cpu_is_omap16xx(): True for OMAP1610, OMAP5912 and OMAP1710 | 78 | * cpu_is_omap16xx(): True for OMAP1610, OMAP5912 and OMAP1710 |
84 | * cpu_is_omap24xx(): True for OMAP2420 | 79 | * cpu_is_omap24xx(): True for OMAP2420, OMAP2422, OMAP2423, OMAP2430 |
80 | * cpu_is_omap242x(): True for OMAP2420, OMAP2422, OMAP2423 | ||
81 | * cpu_is_omap243x(): True for OMAP2430 | ||
85 | */ | 82 | */ |
86 | #define GET_OMAP_CLASS (system_rev & 0xff) | 83 | #define GET_OMAP_CLASS (system_rev & 0xff) |
87 | 84 | ||
@@ -91,22 +88,35 @@ static inline int is_omap ##class (void) \ | |||
91 | return (GET_OMAP_CLASS == (id)) ? 1 : 0; \ | 88 | return (GET_OMAP_CLASS == (id)) ? 1 : 0; \ |
92 | } | 89 | } |
93 | 90 | ||
91 | #define GET_OMAP_SUBCLASS ((system_rev >> 20) & 0x0fff) | ||
92 | |||
93 | #define IS_OMAP_SUBCLASS(subclass, id) \ | ||
94 | static inline int is_omap ##subclass (void) \ | ||
95 | { \ | ||
96 | return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0; \ | ||
97 | } | ||
98 | |||
94 | IS_OMAP_CLASS(7xx, 0x07) | 99 | IS_OMAP_CLASS(7xx, 0x07) |
95 | IS_OMAP_CLASS(15xx, 0x15) | 100 | IS_OMAP_CLASS(15xx, 0x15) |
96 | IS_OMAP_CLASS(16xx, 0x16) | 101 | IS_OMAP_CLASS(16xx, 0x16) |
97 | IS_OMAP_CLASS(24xx, 0x24) | 102 | IS_OMAP_CLASS(24xx, 0x24) |
98 | 103 | ||
104 | IS_OMAP_SUBCLASS(242x, 0x242) | ||
105 | IS_OMAP_SUBCLASS(243x, 0x243) | ||
106 | |||
99 | #define cpu_is_omap7xx() 0 | 107 | #define cpu_is_omap7xx() 0 |
100 | #define cpu_is_omap15xx() 0 | 108 | #define cpu_is_omap15xx() 0 |
101 | #define cpu_is_omap16xx() 0 | 109 | #define cpu_is_omap16xx() 0 |
102 | #define cpu_is_omap24xx() 0 | 110 | #define cpu_is_omap24xx() 0 |
111 | #define cpu_is_omap242x() 0 | ||
112 | #define cpu_is_omap243x() 0 | ||
103 | 113 | ||
104 | #if defined(MULTI_OMAP1) | 114 | #if defined(MULTI_OMAP1) |
105 | # if defined(CONFIG_ARCH_OMAP730) | 115 | # if defined(CONFIG_ARCH_OMAP730) |
106 | # undef cpu_is_omap7xx | 116 | # undef cpu_is_omap7xx |
107 | # define cpu_is_omap7xx() is_omap7xx() | 117 | # define cpu_is_omap7xx() is_omap7xx() |
108 | # endif | 118 | # endif |
109 | # if defined(CONFIG_ARCH_OMAP1510) | 119 | # if defined(CONFIG_ARCH_OMAP15XX) |
110 | # undef cpu_is_omap15xx | 120 | # undef cpu_is_omap15xx |
111 | # define cpu_is_omap15xx() is_omap15xx() | 121 | # define cpu_is_omap15xx() is_omap15xx() |
112 | # endif | 122 | # endif |
@@ -119,7 +129,7 @@ IS_OMAP_CLASS(24xx, 0x24) | |||
119 | # undef cpu_is_omap7xx | 129 | # undef cpu_is_omap7xx |
120 | # define cpu_is_omap7xx() 1 | 130 | # define cpu_is_omap7xx() 1 |
121 | # endif | 131 | # endif |
122 | # if defined(CONFIG_ARCH_OMAP1510) | 132 | # if defined(CONFIG_ARCH_OMAP15XX) |
123 | # undef cpu_is_omap15xx | 133 | # undef cpu_is_omap15xx |
124 | # define cpu_is_omap15xx() 1 | 134 | # define cpu_is_omap15xx() 1 |
125 | # endif | 135 | # endif |
@@ -129,13 +139,18 @@ IS_OMAP_CLASS(24xx, 0x24) | |||
129 | # endif | 139 | # endif |
130 | # if defined(CONFIG_ARCH_OMAP24XX) | 140 | # if defined(CONFIG_ARCH_OMAP24XX) |
131 | # undef cpu_is_omap24xx | 141 | # undef cpu_is_omap24xx |
142 | # undef cpu_is_omap242x | ||
143 | # undef cpu_is_omap243x | ||
132 | # define cpu_is_omap24xx() 1 | 144 | # define cpu_is_omap24xx() 1 |
145 | # define cpu_is_omap242x() is_omap242x() | ||
146 | # define cpu_is_omap243x() is_omap243x() | ||
133 | # endif | 147 | # endif |
134 | #endif | 148 | #endif |
135 | 149 | ||
136 | /* | 150 | /* |
137 | * Macros to detect individual cpu types. | 151 | * Macros to detect individual cpu types. |
138 | * These are only rarely needed. | 152 | * These are only rarely needed. |
153 | * cpu_is_omap330(): True for OMAP330 | ||
139 | * cpu_is_omap730(): True for OMAP730 | 154 | * cpu_is_omap730(): True for OMAP730 |
140 | * cpu_is_omap1510(): True for OMAP1510 | 155 | * cpu_is_omap1510(): True for OMAP1510 |
141 | * cpu_is_omap1610(): True for OMAP1610 | 156 | * cpu_is_omap1610(): True for OMAP1610 |
@@ -144,6 +159,9 @@ IS_OMAP_CLASS(24xx, 0x24) | |||
144 | * cpu_is_omap1621(): True for OMAP1621 | 159 | * cpu_is_omap1621(): True for OMAP1621 |
145 | * cpu_is_omap1710(): True for OMAP1710 | 160 | * cpu_is_omap1710(): True for OMAP1710 |
146 | * cpu_is_omap2420(): True for OMAP2420 | 161 | * cpu_is_omap2420(): True for OMAP2420 |
162 | * cpu_is_omap2422(): True for OMAP2422 | ||
163 | * cpu_is_omap2423(): True for OMAP2423 | ||
164 | * cpu_is_omap2430(): True for OMAP2430 | ||
147 | */ | 165 | */ |
148 | #define GET_OMAP_TYPE ((system_rev >> 16) & 0xffff) | 166 | #define GET_OMAP_TYPE ((system_rev >> 16) & 0xffff) |
149 | 167 | ||
@@ -153,6 +171,7 @@ static inline int is_omap ##type (void) \ | |||
153 | return (GET_OMAP_TYPE == (id)) ? 1 : 0; \ | 171 | return (GET_OMAP_TYPE == (id)) ? 1 : 0; \ |
154 | } | 172 | } |
155 | 173 | ||
174 | IS_OMAP_TYPE(310, 0x0310) | ||
156 | IS_OMAP_TYPE(730, 0x0730) | 175 | IS_OMAP_TYPE(730, 0x0730) |
157 | IS_OMAP_TYPE(1510, 0x1510) | 176 | IS_OMAP_TYPE(1510, 0x1510) |
158 | IS_OMAP_TYPE(1610, 0x1610) | 177 | IS_OMAP_TYPE(1610, 0x1610) |
@@ -161,7 +180,11 @@ IS_OMAP_TYPE(5912, 0x1611) | |||
161 | IS_OMAP_TYPE(1621, 0x1621) | 180 | IS_OMAP_TYPE(1621, 0x1621) |
162 | IS_OMAP_TYPE(1710, 0x1710) | 181 | IS_OMAP_TYPE(1710, 0x1710) |
163 | IS_OMAP_TYPE(2420, 0x2420) | 182 | IS_OMAP_TYPE(2420, 0x2420) |
183 | IS_OMAP_TYPE(2422, 0x2422) | ||
184 | IS_OMAP_TYPE(2423, 0x2423) | ||
185 | IS_OMAP_TYPE(2430, 0x2430) | ||
164 | 186 | ||
187 | #define cpu_is_omap310() 0 | ||
165 | #define cpu_is_omap730() 0 | 188 | #define cpu_is_omap730() 0 |
166 | #define cpu_is_omap1510() 0 | 189 | #define cpu_is_omap1510() 0 |
167 | #define cpu_is_omap1610() 0 | 190 | #define cpu_is_omap1610() 0 |
@@ -170,31 +193,33 @@ IS_OMAP_TYPE(2420, 0x2420) | |||
170 | #define cpu_is_omap1621() 0 | 193 | #define cpu_is_omap1621() 0 |
171 | #define cpu_is_omap1710() 0 | 194 | #define cpu_is_omap1710() 0 |
172 | #define cpu_is_omap2420() 0 | 195 | #define cpu_is_omap2420() 0 |
196 | #define cpu_is_omap2422() 0 | ||
197 | #define cpu_is_omap2423() 0 | ||
198 | #define cpu_is_omap2430() 0 | ||
173 | 199 | ||
174 | #if defined(MULTI_OMAP1) | 200 | #if defined(MULTI_OMAP1) |
175 | # if defined(CONFIG_ARCH_OMAP730) | 201 | # if defined(CONFIG_ARCH_OMAP730) |
176 | # undef cpu_is_omap730 | 202 | # undef cpu_is_omap730 |
177 | # define cpu_is_omap730() is_omap730() | 203 | # define cpu_is_omap730() is_omap730() |
178 | # endif | 204 | # endif |
179 | # if defined(CONFIG_ARCH_OMAP1510) | ||
180 | # undef cpu_is_omap1510 | ||
181 | # define cpu_is_omap1510() is_omap1510() | ||
182 | # endif | ||
183 | #else | 205 | #else |
184 | # if defined(CONFIG_ARCH_OMAP730) | 206 | # if defined(CONFIG_ARCH_OMAP730) |
185 | # undef cpu_is_omap730 | 207 | # undef cpu_is_omap730 |
186 | # define cpu_is_omap730() 1 | 208 | # define cpu_is_omap730() 1 |
187 | # endif | 209 | # endif |
188 | # if defined(CONFIG_ARCH_OMAP1510) | ||
189 | # undef cpu_is_omap1510 | ||
190 | # define cpu_is_omap1510() 1 | ||
191 | # endif | ||
192 | #endif | 210 | #endif |
193 | 211 | ||
194 | /* | 212 | /* |
195 | * Whether we have MULTI_OMAP1 or not, we still need to distinguish | 213 | * Whether we have MULTI_OMAP1 or not, we still need to distinguish |
196 | * between 1611B/5912 and 1710. | 214 | * between 330 vs. 1510 and 1611B/5912 vs. 1710. |
197 | */ | 215 | */ |
216 | #if defined(CONFIG_ARCH_OMAP15XX) | ||
217 | # undef cpu_is_omap310 | ||
218 | # undef cpu_is_omap1510 | ||
219 | # define cpu_is_omap310() is_omap310() | ||
220 | # define cpu_is_omap1510() is_omap1510() | ||
221 | #endif | ||
222 | |||
198 | #if defined(CONFIG_ARCH_OMAP16XX) | 223 | #if defined(CONFIG_ARCH_OMAP16XX) |
199 | # undef cpu_is_omap1610 | 224 | # undef cpu_is_omap1610 |
200 | # undef cpu_is_omap1611 | 225 | # undef cpu_is_omap1611 |
@@ -208,9 +233,20 @@ IS_OMAP_TYPE(2420, 0x2420) | |||
208 | # define cpu_is_omap1710() is_omap1710() | 233 | # define cpu_is_omap1710() is_omap1710() |
209 | #endif | 234 | #endif |
210 | 235 | ||
211 | #if defined(CONFIG_ARCH_OMAP2420) | 236 | #if defined(CONFIG_ARCH_OMAP24XX) |
212 | # undef cpu_is_omap2420 | 237 | # undef cpu_is_omap2420 |
213 | # define cpu_is_omap2420() 1 | 238 | # undef cpu_is_omap2422 |
239 | # undef cpu_is_omap2423 | ||
240 | # undef cpu_is_omap2430 | ||
241 | # define cpu_is_omap2420() is_omap2420() | ||
242 | # define cpu_is_omap2422() is_omap2422() | ||
243 | # define cpu_is_omap2423() is_omap2423() | ||
244 | # define cpu_is_omap2430() is_omap2430() | ||
214 | #endif | 245 | #endif |
215 | 246 | ||
247 | /* Macros to detect if we have OMAP1 or OMAP2 */ | ||
248 | #define cpu_class_is_omap1() (cpu_is_omap730() || cpu_is_omap15xx() || \ | ||
249 | cpu_is_omap16xx()) | ||
250 | #define cpu_class_is_omap2() cpu_is_omap24xx() | ||
251 | |||
216 | #endif | 252 | #endif |
diff --git a/include/asm-arm/arch-omap/dma.h b/include/asm-arm/arch-omap/dma.h index 04ebef5c6e95..ccbcb580a5c1 100644 --- a/include/asm-arm/arch-omap/dma.h +++ b/include/asm-arm/arch-omap/dma.h | |||
@@ -22,9 +22,109 @@ | |||
22 | #define __ASM_ARCH_DMA_H | 22 | #define __ASM_ARCH_DMA_H |
23 | 23 | ||
24 | #define MAX_DMA_ADDRESS 0xffffffff | 24 | #define MAX_DMA_ADDRESS 0xffffffff |
25 | #define MAX_DMA_CHANNELS 0 | ||
26 | |||
27 | /* Hardware registers for omap1 */ | ||
28 | #define OMAP_DMA_BASE (0xfffed800) | ||
29 | #define OMAP_DMA_GCR (OMAP_DMA_BASE + 0x400) | ||
30 | #define OMAP_DMA_GSCR (OMAP_DMA_BASE + 0x404) | ||
31 | #define OMAP_DMA_GRST (OMAP_DMA_BASE + 0x408) | ||
32 | #define OMAP_DMA_HW_ID (OMAP_DMA_BASE + 0x442) | ||
33 | #define OMAP_DMA_PCH2_ID (OMAP_DMA_BASE + 0x444) | ||
34 | #define OMAP_DMA_PCH0_ID (OMAP_DMA_BASE + 0x446) | ||
35 | #define OMAP_DMA_PCH1_ID (OMAP_DMA_BASE + 0x448) | ||
36 | #define OMAP_DMA_PCHG_ID (OMAP_DMA_BASE + 0x44a) | ||
37 | #define OMAP_DMA_PCHD_ID (OMAP_DMA_BASE + 0x44c) | ||
38 | #define OMAP_DMA_CAPS_0_U (OMAP_DMA_BASE + 0x44e) | ||
39 | #define OMAP_DMA_CAPS_0_L (OMAP_DMA_BASE + 0x450) | ||
40 | #define OMAP_DMA_CAPS_1_U (OMAP_DMA_BASE + 0x452) | ||
41 | #define OMAP_DMA_CAPS_1_L (OMAP_DMA_BASE + 0x454) | ||
42 | #define OMAP_DMA_CAPS_2 (OMAP_DMA_BASE + 0x456) | ||
43 | #define OMAP_DMA_CAPS_3 (OMAP_DMA_BASE + 0x458) | ||
44 | #define OMAP_DMA_CAPS_4 (OMAP_DMA_BASE + 0x45a) | ||
45 | #define OMAP_DMA_PCH2_SR (OMAP_DMA_BASE + 0x460) | ||
46 | #define OMAP_DMA_PCH0_SR (OMAP_DMA_BASE + 0x480) | ||
47 | #define OMAP_DMA_PCH1_SR (OMAP_DMA_BASE + 0x482) | ||
48 | #define OMAP_DMA_PCHD_SR (OMAP_DMA_BASE + 0x4c0) | ||
49 | |||
50 | /* Hardware registers for omap2 */ | ||
51 | #define OMAP24XX_DMA_BASE (L4_24XX_BASE + 0x56000) | ||
52 | #define OMAP_DMA4_REVISION (OMAP24XX_DMA_BASE + 0x00) | ||
53 | #define OMAP_DMA4_GCR_REG (OMAP24XX_DMA_BASE + 0x78) | ||
54 | #define OMAP_DMA4_IRQSTATUS_L0 (OMAP24XX_DMA_BASE + 0x08) | ||
55 | #define OMAP_DMA4_IRQSTATUS_L1 (OMAP24XX_DMA_BASE + 0x0c) | ||
56 | #define OMAP_DMA4_IRQSTATUS_L2 (OMAP24XX_DMA_BASE + 0x10) | ||
57 | #define OMAP_DMA4_IRQSTATUS_L3 (OMAP24XX_DMA_BASE + 0x14) | ||
58 | #define OMAP_DMA4_IRQENABLE_L0 (OMAP24XX_DMA_BASE + 0x18) | ||
59 | #define OMAP_DMA4_IRQENABLE_L1 (OMAP24XX_DMA_BASE + 0x1c) | ||
60 | #define OMAP_DMA4_IRQENABLE_L2 (OMAP24XX_DMA_BASE + 0x20) | ||
61 | #define OMAP_DMA4_IRQENABLE_L3 (OMAP24XX_DMA_BASE + 0x24) | ||
62 | #define OMAP_DMA4_SYSSTATUS (OMAP24XX_DMA_BASE + 0x28) | ||
63 | #define OMAP_DMA4_CAPS_0 (OMAP24XX_DMA_BASE + 0x64) | ||
64 | #define OMAP_DMA4_CAPS_2 (OMAP24XX_DMA_BASE + 0x6c) | ||
65 | #define OMAP_DMA4_CAPS_3 (OMAP24XX_DMA_BASE + 0x70) | ||
66 | #define OMAP_DMA4_CAPS_4 (OMAP24XX_DMA_BASE + 0x74) | ||
67 | |||
68 | #ifdef CONFIG_ARCH_OMAP1 | ||
25 | 69 | ||
26 | #define OMAP_LOGICAL_DMA_CH_COUNT 17 | 70 | #define OMAP_LOGICAL_DMA_CH_COUNT 17 |
27 | 71 | ||
72 | /* Common channel specific registers for omap1 */ | ||
73 | #define OMAP_DMA_CSDP_REG(n) __REG16(OMAP_DMA_BASE + 0x40 * (n) + 0x00) | ||
74 | #define OMAP_DMA_CCR_REG(n) __REG16(OMAP_DMA_BASE + 0x40 * (n) + 0x02) | ||
75 | #define OMAP_DMA_CICR_REG(n) __REG16(OMAP_DMA_BASE + 0x40 * (n) + 0x04) | ||
76 | #define OMAP_DMA_CSR_REG(n) __REG16(OMAP_DMA_BASE + 0x40 * (n) + 0x06) | ||
77 | #define OMAP_DMA_CEN_REG(n) __REG16(OMAP_DMA_BASE + 0x40 * (n) + 0x10) | ||
78 | #define OMAP_DMA_CFN_REG(n) __REG16(OMAP_DMA_BASE + 0x40 * (n) + 0x12) | ||
79 | #define OMAP_DMA_CSFI_REG(n) __REG16(OMAP_DMA_BASE + 0x40 * (n) + 0x14) | ||
80 | #define OMAP_DMA_CSEI_REG(n) __REG16(OMAP_DMA_BASE + 0x40 * (n) + 0x16) | ||
81 | #define OMAP_DMA_CSAC_REG(n) __REG16(OMAP_DMA_BASE + 0x40 * (n) + 0x18) | ||
82 | #define OMAP_DMA_CDAC_REG(n) __REG16(OMAP_DMA_BASE + 0x40 * (n) + 0x1a) | ||
83 | #define OMAP_DMA_CDEI_REG(n) __REG16(OMAP_DMA_BASE + 0x40 * (n) + 0x1c) | ||
84 | #define OMAP_DMA_CDFI_REG(n) __REG16(OMAP_DMA_BASE + 0x40 * (n) + 0x1e) | ||
85 | #define OMAP_DMA_CLNK_CTRL_REG(n) __REG16(OMAP_DMA_BASE + 0x40 * (n) + 0x28) | ||
86 | |||
87 | #else | ||
88 | |||
89 | #define OMAP_LOGICAL_DMA_CH_COUNT 32 /* REVISIT: Is this 32 + 2? */ | ||
90 | |||
91 | /* Common channel specific registers for omap2 */ | ||
92 | #define OMAP_DMA_CCR_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0x80) | ||
93 | #define OMAP_DMA_CLNK_CTRL_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0x84) | ||
94 | #define OMAP_DMA_CICR_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0x88) | ||
95 | #define OMAP_DMA_CSR_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0x8c) | ||
96 | #define OMAP_DMA_CSDP_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0x90) | ||
97 | #define OMAP_DMA_CEN_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0x94) | ||
98 | #define OMAP_DMA_CFN_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0x98) | ||
99 | #define OMAP_DMA_CSEI_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0xa4) | ||
100 | #define OMAP_DMA_CSFI_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0xa8) | ||
101 | #define OMAP_DMA_CDEI_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0xac) | ||
102 | #define OMAP_DMA_CDFI_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0xb0) | ||
103 | #define OMAP_DMA_CSAC_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0xb4) | ||
104 | #define OMAP_DMA_CDAC_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0xb8) | ||
105 | |||
106 | #endif | ||
107 | |||
108 | /* Channel specific registers only on omap1 */ | ||
109 | #define OMAP1_DMA_CSSA_L_REG(n) __REG16(OMAP_DMA_BASE + 0x40 * (n) + 0x08) | ||
110 | #define OMAP1_DMA_CSSA_U_REG(n) __REG16(OMAP_DMA_BASE + 0x40 * (n) + 0x0a) | ||
111 | #define OMAP1_DMA_CDSA_L_REG(n) __REG16(OMAP_DMA_BASE + 0x40 * (n) + 0x0c) | ||
112 | #define OMAP1_DMA_CDSA_U_REG(n) __REG16(OMAP_DMA_BASE + 0x40 * (n) + 0x0e) | ||
113 | #define OMAP1_DMA_COLOR_L_REG(n) __REG16(OMAP_DMA_BASE + 0x40 * (n) + 0x20) | ||
114 | #define OMAP1_DMA_CCR2_REG(n) __REG16(OMAP_DMA_BASE + 0x40 * (n) + 0x24) | ||
115 | #define OMAP1_DMA_COLOR_U_REG(n) __REG16(OMAP_DMA_BASE + 0x40 * (n) + 0x22) | ||
116 | #define OMAP1_DMA_LCH_CTRL_REG(n) __REG16(OMAP_DMA_BASE + 0x40 * (n) + 0x2a) | ||
117 | |||
118 | /* Channel specific registers only on omap2 */ | ||
119 | #define OMAP2_DMA_CSSA_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0x9c) | ||
120 | #define OMAP2_DMA_CDSA_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0xa0) | ||
121 | #define OMAP2_DMA_CCEN_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0xbc) | ||
122 | #define OMAP2_DMA_CCFN_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0xc0) | ||
123 | #define OMAP2_DMA_COLOR_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0xc4) | ||
124 | |||
125 | /*----------------------------------------------------------------------------*/ | ||
126 | |||
127 | /* DMA channels for omap1 */ | ||
28 | #define OMAP_DMA_NO_DEVICE 0 | 128 | #define OMAP_DMA_NO_DEVICE 0 |
29 | #define OMAP_DMA_MCSI1_TX 1 | 129 | #define OMAP_DMA_MCSI1_TX 1 |
30 | #define OMAP_DMA_MCSI1_RX 2 | 130 | #define OMAP_DMA_MCSI1_RX 2 |
@@ -85,29 +185,72 @@ | |||
85 | #define OMAP_DMA_MMC2_RX 55 | 185 | #define OMAP_DMA_MMC2_RX 55 |
86 | #define OMAP_DMA_CRYPTO_DES_OUT 56 | 186 | #define OMAP_DMA_CRYPTO_DES_OUT 56 |
87 | 187 | ||
188 | /* DMA channels for 24xx */ | ||
189 | #define OMAP24XX_DMA_NO_DEVICE 0 | ||
190 | #define OMAP24XX_DMA_XTI_DMA 1 /* S_DMA_0 */ | ||
191 | #define OMAP24XX_DMA_EXT_NDMA_REQ0 2 /* S_DMA_1 */ | ||
192 | #define OMAP24XX_DMA_EXT_NDMA_REQ1 3 /* S_DMA_2 */ | ||
193 | #define OMAP24XX_DMA_GPMC 4 /* S_DMA_3 */ | ||
194 | #define OMAP24XX_DMA_GFX 5 /* S_DMA_4 */ | ||
195 | #define OMAP24XX_DMA_DSS 6 /* S_DMA_5 */ | ||
196 | #define OMAP24XX_DMA_VLYNQ_TX 7 /* S_DMA_6 */ | ||
197 | #define OMAP24XX_DMA_CWT 8 /* S_DMA_7 */ | ||
198 | #define OMAP24XX_DMA_AES_TX 9 /* S_DMA_8 */ | ||
199 | #define OMAP24XX_DMA_AES_RX 10 /* S_DMA_9 */ | ||
200 | #define OMAP24XX_DMA_DES_TX 11 /* S_DMA_10 */ | ||
201 | #define OMAP24XX_DMA_DES_RX 12 /* S_DMA_11 */ | ||
202 | #define OMAP24XX_DMA_SHA1MD5_RX 13 /* S_DMA_12 */ | ||
88 | 203 | ||
89 | #define OMAP_DMA_BASE (0xfffed800) | 204 | #define OMAP24XX_DMA_EAC_AC_RD 17 /* S_DMA_16 */ |
90 | #define OMAP_DMA_GCR (OMAP_DMA_BASE + 0x400) | 205 | #define OMAP24XX_DMA_EAC_AC_WR 18 /* S_DMA_17 */ |
91 | #define OMAP_DMA_GSCR (OMAP_DMA_BASE + 0x404) | 206 | #define OMAP24XX_DMA_EAC_MD_UL_RD 19 /* S_DMA_18 */ |
92 | #define OMAP_DMA_GRST (OMAP_DMA_BASE + 0x408) | 207 | #define OMAP24XX_DMA_EAC_MD_UL_WR 20 /* S_DMA_19 */ |
93 | #define OMAP_DMA_HW_ID (OMAP_DMA_BASE + 0x442) | 208 | #define OMAP24XX_DMA_EAC_MD_DL_RD 21 /* S_DMA_20 */ |
94 | #define OMAP_DMA_PCH2_ID (OMAP_DMA_BASE + 0x444) | 209 | #define OMAP24XX_DMA_EAC_MD_DL_WR 22 /* S_DMA_21 */ |
95 | #define OMAP_DMA_PCH0_ID (OMAP_DMA_BASE + 0x446) | 210 | #define OMAP24XX_DMA_EAC_BT_UL_RD 23 /* S_DMA_22 */ |
96 | #define OMAP_DMA_PCH1_ID (OMAP_DMA_BASE + 0x448) | 211 | #define OMAP24XX_DMA_EAC_BT_UL_WR 24 /* S_DMA_23 */ |
97 | #define OMAP_DMA_PCHG_ID (OMAP_DMA_BASE + 0x44a) | 212 | #define OMAP24XX_DMA_EAC_BT_DL_RD 25 /* S_DMA_24 */ |
98 | #define OMAP_DMA_PCHD_ID (OMAP_DMA_BASE + 0x44c) | 213 | #define OMAP24XX_DMA_EAC_BT_DL_WR 26 /* S_DMA_25 */ |
99 | #define OMAP_DMA_CAPS_0_U (OMAP_DMA_BASE + 0x44e) | 214 | #define OMAP24XX_DMA_I2C1_TX 27 /* S_DMA_26 */ |
100 | #define OMAP_DMA_CAPS_0_L (OMAP_DMA_BASE + 0x450) | 215 | #define OMAP24XX_DMA_I2C1_RX 28 /* S_DMA_27 */ |
101 | #define OMAP_DMA_CAPS_1_U (OMAP_DMA_BASE + 0x452) | 216 | #define OMAP24XX_DMA_I2C2_TX 29 /* S_DMA_28 */ |
102 | #define OMAP_DMA_CAPS_1_L (OMAP_DMA_BASE + 0x454) | 217 | #define OMAP24XX_DMA_I2C2_RX 30 /* S_DMA_29 */ |
103 | #define OMAP_DMA_CAPS_2 (OMAP_DMA_BASE + 0x456) | 218 | #define OMAP24XX_DMA_MCBSP1_TX 31 /* SDMA_30 */ |
104 | #define OMAP_DMA_CAPS_3 (OMAP_DMA_BASE + 0x458) | 219 | #define OMAP24XX_DMA_MCBSP1_RX 32 /* SDMA_31 */ |
105 | #define OMAP_DMA_CAPS_4 (OMAP_DMA_BASE + 0x45a) | 220 | #define OMAP24XX_DMA_MCBSP2_TX 33 /* SDMA_32 */ |
106 | #define OMAP_DMA_PCH2_SR (OMAP_DMA_BASE + 0x460) | 221 | #define OMAP24XX_DMA_MCBSP2_RX 34 /* SDMA_33 */ |
107 | #define OMAP_DMA_PCH0_SR (OMAP_DMA_BASE + 0x480) | 222 | #define OMAP24XX_DMA_SPI1_TX0 35 /* SDMA_34 */ |
108 | #define OMAP_DMA_PCH1_SR (OMAP_DMA_BASE + 0x482) | 223 | #define OMAP24XX_DMA_SPI1_RX0 36 /* SDMA_35 */ |
109 | #define OMAP_DMA_PCHD_SR (OMAP_DMA_BASE + 0x4c0) | 224 | #define OMAP24XX_DMA_SPI1_TX1 37 /* SDMA_36 */ |
225 | #define OMAP24XX_DMA_SPI1_RX1 38 /* SDMA_37 */ | ||
226 | #define OMAP24XX_DMA_SPI1_TX2 39 /* SDMA_38 */ | ||
227 | #define OMAP24XX_DMA_SPI1_RX2 40 /* SDMA_39 */ | ||
228 | #define OMAP24XX_DMA_SPI1_TX3 41 /* SDMA_40 */ | ||
229 | #define OMAP24XX_DMA_SPI1_RX3 42 /* SDMA_41 */ | ||
230 | #define OMAP24XX_DMA_SPI2_TX0 43 /* SDMA_42 */ | ||
231 | #define OMAP24XX_DMA_SPI2_RX0 44 /* SDMA_43 */ | ||
232 | #define OMAP24XX_DMA_SPI2_TX1 45 /* SDMA_44 */ | ||
233 | #define OMAP24XX_DMA_SPI2_RX1 46 /* SDMA_45 */ | ||
110 | 234 | ||
235 | #define OMAP24XX_DMA_UART1_TX 49 /* SDMA_48 */ | ||
236 | #define OMAP24XX_DMA_UART1_RX 50 /* SDMA_49 */ | ||
237 | #define OMAP24XX_DMA_UART2_TX 51 /* SDMA_50 */ | ||
238 | #define OMAP24XX_DMA_UART2_RX 52 /* SDMA_51 */ | ||
239 | #define OMAP24XX_DMA_UART3_TX 53 /* SDMA_52 */ | ||
240 | #define OMAP24XX_DMA_UART3_RX 54 /* SDMA_53 */ | ||
241 | #define OMAP24XX_DMA_USB_W2FC_TX0 55 /* SDMA_54 */ | ||
242 | #define OMAP24XX_DMA_USB_W2FC_RX0 56 /* SDMA_55 */ | ||
243 | #define OMAP24XX_DMA_USB_W2FC_TX1 57 /* SDMA_56 */ | ||
244 | #define OMAP24XX_DMA_USB_W2FC_RX1 58 /* SDMA_57 */ | ||
245 | #define OMAP24XX_DMA_USB_W2FC_TX2 59 /* SDMA_58 */ | ||
246 | #define OMAP24XX_DMA_USB_W2FC_RX2 60 /* SDMA_59 */ | ||
247 | #define OMAP24XX_DMA_MMC1_TX 61 /* SDMA_60 */ | ||
248 | #define OMAP24XX_DMA_MMC1_RX 62 /* SDMA_61 */ | ||
249 | #define OMAP24XX_DMA_MS 63 /* SDMA_62 */ | ||
250 | |||
251 | /*----------------------------------------------------------------------------*/ | ||
252 | |||
253 | /* Hardware registers for LCD DMA */ | ||
111 | #define OMAP1510_DMA_LCD_BASE (0xfffedb00) | 254 | #define OMAP1510_DMA_LCD_BASE (0xfffedb00) |
112 | #define OMAP1510_DMA_LCD_CTRL (OMAP1510_DMA_LCD_BASE + 0x00) | 255 | #define OMAP1510_DMA_LCD_CTRL (OMAP1510_DMA_LCD_BASE + 0x00) |
113 | #define OMAP1510_DMA_LCD_TOP_F1_L (OMAP1510_DMA_LCD_BASE + 0x02) | 256 | #define OMAP1510_DMA_LCD_TOP_F1_L (OMAP1510_DMA_LCD_BASE + 0x02) |
@@ -116,7 +259,7 @@ | |||
116 | #define OMAP1510_DMA_LCD_BOT_F1_U (OMAP1510_DMA_LCD_BASE + 0x08) | 259 | #define OMAP1510_DMA_LCD_BOT_F1_U (OMAP1510_DMA_LCD_BASE + 0x08) |
117 | 260 | ||
118 | #define OMAP1610_DMA_LCD_BASE (0xfffee300) | 261 | #define OMAP1610_DMA_LCD_BASE (0xfffee300) |
119 | #define OMAP1610_DMA_LCD_CSDP (OMAP1610_DMA_LCD_BASE + 0xc0) | 262 | #define OMAP1610_DMA_LCD_CSDP (OMAP1610_DMA_LCD_BASE + 0xc0) |
120 | #define OMAP1610_DMA_LCD_CCR (OMAP1610_DMA_LCD_BASE + 0xc2) | 263 | #define OMAP1610_DMA_LCD_CCR (OMAP1610_DMA_LCD_BASE + 0xc2) |
121 | #define OMAP1610_DMA_LCD_CTRL (OMAP1610_DMA_LCD_BASE + 0xc4) | 264 | #define OMAP1610_DMA_LCD_CTRL (OMAP1610_DMA_LCD_BASE + 0xc4) |
122 | #define OMAP1610_DMA_LCD_TOP_B1_L (OMAP1610_DMA_LCD_BASE + 0xc8) | 265 | #define OMAP1610_DMA_LCD_TOP_B1_L (OMAP1610_DMA_LCD_BASE + 0xc8) |
@@ -134,37 +277,18 @@ | |||
134 | #define OMAP1610_DMA_LCD_LCH_CTRL (OMAP1610_DMA_LCD_BASE + 0xea) | 277 | #define OMAP1610_DMA_LCD_LCH_CTRL (OMAP1610_DMA_LCD_BASE + 0xea) |
135 | #define OMAP1610_DMA_LCD_SRC_FI_B1_U (OMAP1610_DMA_LCD_BASE + 0xf4) | 278 | #define OMAP1610_DMA_LCD_SRC_FI_B1_U (OMAP1610_DMA_LCD_BASE + 0xf4) |
136 | 279 | ||
137 | 280 | #define OMAP_DMA_TOUT_IRQ (1 << 0) /* Only on omap1 */ | |
138 | /* Every LCh has its own set of the registers below */ | ||
139 | #define OMAP_DMA_CSDP(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x00) | ||
140 | #define OMAP_DMA_CCR(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x02) | ||
141 | #define OMAP_DMA_CICR(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x04) | ||
142 | #define OMAP_DMA_CSR(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x06) | ||
143 | #define OMAP_DMA_CSSA_L(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x08) | ||
144 | #define OMAP_DMA_CSSA_U(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x0a) | ||
145 | #define OMAP_DMA_CDSA_L(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x0c) | ||
146 | #define OMAP_DMA_CDSA_U(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x0e) | ||
147 | #define OMAP_DMA_CEN(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x10) | ||
148 | #define OMAP_DMA_CFN(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x12) | ||
149 | #define OMAP_DMA_CSFI(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x14) | ||
150 | #define OMAP_DMA_CSEI(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x16) | ||
151 | #define OMAP_DMA_CSAC(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x18) | ||
152 | #define OMAP_DMA_CDAC(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x1a) | ||
153 | #define OMAP_DMA_CDEI(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x1c) | ||
154 | #define OMAP_DMA_CDFI(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x1e) | ||
155 | #define OMAP_DMA_COLOR_L(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x20) | ||
156 | #define OMAP_DMA_COLOR_U(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x22) | ||
157 | #define OMAP_DMA_CCR2(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x24) | ||
158 | #define OMAP_DMA_CLNK_CTRL(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x28) | ||
159 | #define OMAP_DMA_LCH_CTRL(n) (OMAP_DMA_BASE + 0x40 * (n) + 0x2a) | ||
160 | |||
161 | #define OMAP_DMA_TOUT_IRQ (1 << 0) | ||
162 | #define OMAP_DMA_DROP_IRQ (1 << 1) | 281 | #define OMAP_DMA_DROP_IRQ (1 << 1) |
163 | #define OMAP_DMA_HALF_IRQ (1 << 2) | 282 | #define OMAP_DMA_HALF_IRQ (1 << 2) |
164 | #define OMAP_DMA_FRAME_IRQ (1 << 3) | 283 | #define OMAP_DMA_FRAME_IRQ (1 << 3) |
165 | #define OMAP_DMA_LAST_IRQ (1 << 4) | 284 | #define OMAP_DMA_LAST_IRQ (1 << 4) |
166 | #define OMAP_DMA_BLOCK_IRQ (1 << 5) | 285 | #define OMAP_DMA_BLOCK_IRQ (1 << 5) |
167 | #define OMAP_DMA_SYNC_IRQ (1 << 6) | 286 | #define OMAP1_DMA_SYNC_IRQ (1 << 6) |
287 | #define OMAP2_DMA_PKT_IRQ (1 << 7) | ||
288 | #define OMAP2_DMA_TRANS_ERR_IRQ (1 << 8) | ||
289 | #define OMAP2_DMA_SECURE_ERR_IRQ (1 << 9) | ||
290 | #define OMAP2_DMA_SUPERVISOR_ERR_IRQ (1 << 10) | ||
291 | #define OMAP2_DMA_MISALIGNED_ERR_IRQ (1 << 11) | ||
168 | 292 | ||
169 | #define OMAP_DMA_DATA_TYPE_S8 0x00 | 293 | #define OMAP_DMA_DATA_TYPE_S8 0x00 |
170 | #define OMAP_DMA_DATA_TYPE_S16 0x01 | 294 | #define OMAP_DMA_DATA_TYPE_S16 0x01 |
@@ -194,6 +318,7 @@ enum { | |||
194 | OMAP_LCD_DMA_B2_BOTTOM | 318 | OMAP_LCD_DMA_B2_BOTTOM |
195 | }; | 319 | }; |
196 | 320 | ||
321 | /* REVISIT: Check if BURST_4 is really 1 (or 2) */ | ||
197 | enum omap_dma_burst_mode { | 322 | enum omap_dma_burst_mode { |
198 | OMAP_DMA_DATA_BURST_DIS = 0, | 323 | OMAP_DMA_DATA_BURST_DIS = 0, |
199 | OMAP_DMA_DATA_BURST_4, | 324 | OMAP_DMA_DATA_BURST_4, |
@@ -206,6 +331,31 @@ enum omap_dma_color_mode { | |||
206 | OMAP_DMA_TRANSPARENT_COPY | 331 | OMAP_DMA_TRANSPARENT_COPY |
207 | }; | 332 | }; |
208 | 333 | ||
334 | struct omap_dma_channel_params { | ||
335 | int data_type; /* data type 8,16,32 */ | ||
336 | int elem_count; /* number of elements in a frame */ | ||
337 | int frame_count; /* number of frames in a element */ | ||
338 | |||
339 | int src_port; /* Only on OMAP1 REVISIT: Is this needed? */ | ||
340 | int src_amode; /* constant , post increment, indexed , double indexed */ | ||
341 | int src_start; /* source address : physical */ | ||
342 | int src_ei; /* source element index */ | ||
343 | int src_fi; /* source frame index */ | ||
344 | |||
345 | int dst_port; /* Only on OMAP1 REVISIT: Is this needed? */ | ||
346 | int dst_amode; /* constant , post increment, indexed , double indexed */ | ||
347 | int dst_start; /* source address : physical */ | ||
348 | int dst_ei; /* source element index */ | ||
349 | int dst_fi; /* source frame index */ | ||
350 | |||
351 | int trigger; /* trigger attached if the channel is synchronized */ | ||
352 | int sync_mode; /* sycn on element, frame , block or packet */ | ||
353 | int src_or_dst_synch; /* source synch(1) or destination synch(0) */ | ||
354 | |||
355 | int ie; /* interrupt enabled */ | ||
356 | }; | ||
357 | |||
358 | |||
209 | extern void omap_set_dma_priority(int dst_port, int priority); | 359 | extern void omap_set_dma_priority(int dst_port, int priority); |
210 | extern int omap_request_dma(int dev_id, const char *dev_name, | 360 | extern int omap_request_dma(int dev_id, const char *dev_name, |
211 | void (* callback)(int lch, u16 ch_status, void *data), | 361 | void (* callback)(int lch, u16 ch_status, void *data), |
@@ -217,24 +367,30 @@ extern void omap_start_dma(int lch); | |||
217 | extern void omap_stop_dma(int lch); | 367 | extern void omap_stop_dma(int lch); |
218 | extern void omap_set_dma_transfer_params(int lch, int data_type, | 368 | extern void omap_set_dma_transfer_params(int lch, int data_type, |
219 | int elem_count, int frame_count, | 369 | int elem_count, int frame_count, |
220 | int sync_mode); | 370 | int sync_mode, |
371 | int dma_trigger, int src_or_dst_synch); | ||
221 | extern void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode, | 372 | extern void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode, |
222 | u32 color); | 373 | u32 color); |
223 | 374 | ||
224 | extern void omap_set_dma_src_params(int lch, int src_port, int src_amode, | 375 | extern void omap_set_dma_src_params(int lch, int src_port, int src_amode, |
225 | unsigned long src_start); | 376 | unsigned long src_start, |
377 | int src_ei, int src_fi); | ||
226 | extern void omap_set_dma_src_index(int lch, int eidx, int fidx); | 378 | extern void omap_set_dma_src_index(int lch, int eidx, int fidx); |
227 | extern void omap_set_dma_src_data_pack(int lch, int enable); | 379 | extern void omap_set_dma_src_data_pack(int lch, int enable); |
228 | extern void omap_set_dma_src_burst_mode(int lch, | 380 | extern void omap_set_dma_src_burst_mode(int lch, |
229 | enum omap_dma_burst_mode burst_mode); | 381 | enum omap_dma_burst_mode burst_mode); |
230 | 382 | ||
231 | extern void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode, | 383 | extern void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode, |
232 | unsigned long dest_start); | 384 | unsigned long dest_start, |
385 | int dst_ei, int dst_fi); | ||
233 | extern void omap_set_dma_dest_index(int lch, int eidx, int fidx); | 386 | extern void omap_set_dma_dest_index(int lch, int eidx, int fidx); |
234 | extern void omap_set_dma_dest_data_pack(int lch, int enable); | 387 | extern void omap_set_dma_dest_data_pack(int lch, int enable); |
235 | extern void omap_set_dma_dest_burst_mode(int lch, | 388 | extern void omap_set_dma_dest_burst_mode(int lch, |
236 | enum omap_dma_burst_mode burst_mode); | 389 | enum omap_dma_burst_mode burst_mode); |
237 | 390 | ||
391 | extern void omap_set_dma_params(int lch, | ||
392 | struct omap_dma_channel_params * params); | ||
393 | |||
238 | extern void omap_dma_link_lch (int lch_head, int lch_queue); | 394 | extern void omap_dma_link_lch (int lch_head, int lch_queue); |
239 | extern void omap_dma_unlink_lch (int lch_head, int lch_queue); | 395 | extern void omap_dma_unlink_lch (int lch_head, int lch_queue); |
240 | 396 | ||
@@ -244,9 +400,6 @@ extern int omap_get_dma_src_addr_counter(int lch); | |||
244 | extern void omap_clear_dma(int lch); | 400 | extern void omap_clear_dma(int lch); |
245 | extern int omap_dma_running(void); | 401 | extern int omap_dma_running(void); |
246 | 402 | ||
247 | /* Returns 1 if the DMA module is in OMAP1510-compatible mode, 0 otherwise */ | ||
248 | extern int omap_dma_in_1510_mode(void); | ||
249 | |||
250 | /* LCD DMA functions */ | 403 | /* LCD DMA functions */ |
251 | extern int omap_request_lcd_dma(void (* callback)(u16 status, void *data), | 404 | extern int omap_request_lcd_dma(void (* callback)(u16 status, void *data), |
252 | void *data); | 405 | void *data); |
diff --git a/include/asm-arm/arch-omap/entry-macro.S b/include/asm-arm/arch-omap/entry-macro.S index 0d29b9c56a95..f8814a84910e 100644 --- a/include/asm-arm/arch-omap/entry-macro.S +++ b/include/asm-arm/arch-omap/entry-macro.S | |||
@@ -10,6 +10,20 @@ | |||
10 | 10 | ||
11 | #if defined(CONFIG_ARCH_OMAP1) | 11 | #if defined(CONFIG_ARCH_OMAP1) |
12 | 12 | ||
13 | #if defined(CONFIG_ARCH_OMAP730) && \ | ||
14 | (defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX)) | ||
15 | #error "FIXME: OMAP730 doesn't support multiple-OMAP" | ||
16 | #elif defined(CONFIG_ARCH_OMAP730) | ||
17 | #define INT_IH2_IRQ INT_730_IH2_IRQ | ||
18 | #elif defined(CONFIG_ARCH_OMAP15XX) | ||
19 | #define INT_IH2_IRQ INT_1510_IH2_IRQ | ||
20 | #elif defined(CONFIG_ARCH_OMAP16XX) | ||
21 | #define INT_IH2_IRQ INT_1610_IH2_IRQ | ||
22 | #else | ||
23 | #warning "IH2 IRQ defaulted" | ||
24 | #define INT_IH2_IRQ INT_1510_IH2_IRQ | ||
25 | #endif | ||
26 | |||
13 | .macro disable_fiq | 27 | .macro disable_fiq |
14 | .endm | 28 | .endm |
15 | 29 | ||
diff --git a/include/asm-arm/arch-omap/fpga.h b/include/asm-arm/arch-omap/fpga.h index 676807dc50e1..6a883e0bdbb8 100644 --- a/include/asm-arm/arch-omap/fpga.h +++ b/include/asm-arm/arch-omap/fpga.h | |||
@@ -19,7 +19,7 @@ | |||
19 | #ifndef __ASM_ARCH_OMAP_FPGA_H | 19 | #ifndef __ASM_ARCH_OMAP_FPGA_H |
20 | #define __ASM_ARCH_OMAP_FPGA_H | 20 | #define __ASM_ARCH_OMAP_FPGA_H |
21 | 21 | ||
22 | #if defined(CONFIG_MACH_OMAP_INNOVATOR) && defined(CONFIG_ARCH_OMAP1510) | 22 | #if defined(CONFIG_MACH_OMAP_INNOVATOR) && defined(CONFIG_ARCH_OMAP15XX) |
23 | extern void omap1510_fpga_init_irq(void); | 23 | extern void omap1510_fpga_init_irq(void); |
24 | #else | 24 | #else |
25 | #define omap1510_fpga_init_irq() (0) | 25 | #define omap1510_fpga_init_irq() (0) |
@@ -77,6 +77,8 @@ struct h2p2_dbg_fpga { | |||
77 | #define H2P2_DBG_FPGA_LOAD_METER_SIZE 11 | 77 | #define H2P2_DBG_FPGA_LOAD_METER_SIZE 11 |
78 | #define H2P2_DBG_FPGA_LOAD_METER_MASK ((1 << H2P2_DBG_FPGA_LOAD_METER_SIZE) - 1) | 78 | #define H2P2_DBG_FPGA_LOAD_METER_MASK ((1 << H2P2_DBG_FPGA_LOAD_METER_SIZE) - 1) |
79 | 79 | ||
80 | #define H2P2_DBG_FPGA_P2_LED_TIMER (1 << 0) | ||
81 | #define H2P2_DBG_FPGA_P2_LED_IDLE (1 << 1) | ||
80 | 82 | ||
81 | /* | 83 | /* |
82 | * --------------------------------------------------------------------------- | 84 | * --------------------------------------------------------------------------- |
diff --git a/include/asm-arm/arch-omap/gpio.h b/include/asm-arm/arch-omap/gpio.h index 74cb2b93b700..f486b72070ea 100644 --- a/include/asm-arm/arch-omap/gpio.h +++ b/include/asm-arm/arch-omap/gpio.h | |||
@@ -26,7 +26,7 @@ | |||
26 | #ifndef __ASM_ARCH_OMAP_GPIO_H | 26 | #ifndef __ASM_ARCH_OMAP_GPIO_H |
27 | #define __ASM_ARCH_OMAP_GPIO_H | 27 | #define __ASM_ARCH_OMAP_GPIO_H |
28 | 28 | ||
29 | #include <asm/arch/hardware.h> | 29 | #include <asm/hardware.h> |
30 | #include <asm/arch/irqs.h> | 30 | #include <asm/arch/irqs.h> |
31 | #include <asm/io.h> | 31 | #include <asm/io.h> |
32 | 32 | ||
@@ -67,7 +67,7 @@ | |||
67 | 67 | ||
68 | #define OMAP_GPIO_IRQ(nr) (OMAP_GPIO_IS_MPUIO(nr) ? \ | 68 | #define OMAP_GPIO_IRQ(nr) (OMAP_GPIO_IS_MPUIO(nr) ? \ |
69 | IH_MPUIO_BASE + ((nr) & 0x0f) : \ | 69 | IH_MPUIO_BASE + ((nr) & 0x0f) : \ |
70 | IH_GPIO_BASE + ((nr) & 0x3f)) | 70 | IH_GPIO_BASE + (nr)) |
71 | 71 | ||
72 | extern int omap_gpio_init(void); /* Call from board init only */ | 72 | extern int omap_gpio_init(void); /* Call from board init only */ |
73 | extern int omap_request_gpio(int gpio); | 73 | extern int omap_request_gpio(int gpio); |
diff --git a/include/asm-arm/arch-omap/hardware.h b/include/asm-arm/arch-omap/hardware.h index 60201e1dd6ad..5406b875c422 100644 --- a/include/asm-arm/arch-omap/hardware.h +++ b/include/asm-arm/arch-omap/hardware.h | |||
@@ -267,8 +267,6 @@ | |||
267 | #define OMAP_LPG2_LCR (OMAP_LPG2_BASE + 0x00) | 267 | #define OMAP_LPG2_LCR (OMAP_LPG2_BASE + 0x00) |
268 | #define OMAP_LPG2_PMR (OMAP_LPG2_BASE + 0x04) | 268 | #define OMAP_LPG2_PMR (OMAP_LPG2_BASE + 0x04) |
269 | 269 | ||
270 | #ifndef __ASSEMBLER__ | ||
271 | |||
272 | /* | 270 | /* |
273 | * --------------------------------------------------------------------------- | 271 | * --------------------------------------------------------------------------- |
274 | * Processor specific defines | 272 | * Processor specific defines |
@@ -277,13 +275,11 @@ | |||
277 | 275 | ||
278 | #include "omap730.h" | 276 | #include "omap730.h" |
279 | #include "omap1510.h" | 277 | #include "omap1510.h" |
280 | |||
281 | #ifdef CONFIG_ARCH_OMAP24XX | ||
282 | #include "omap24xx.h" | 278 | #include "omap24xx.h" |
283 | #endif | ||
284 | |||
285 | #include "omap16xx.h" | 279 | #include "omap16xx.h" |
286 | 280 | ||
281 | #ifndef __ASSEMBLER__ | ||
282 | |||
287 | /* | 283 | /* |
288 | * --------------------------------------------------------------------------- | 284 | * --------------------------------------------------------------------------- |
289 | * Board specific defines | 285 | * Board specific defines |
diff --git a/include/asm-arm/arch-omap/io.h b/include/asm-arm/arch-omap/io.h index 11fbf629bf75..f5bcc9a1aed6 100644 --- a/include/asm-arm/arch-omap/io.h +++ b/include/asm-arm/arch-omap/io.h | |||
@@ -34,6 +34,8 @@ | |||
34 | #ifndef __ASM_ARM_ARCH_IO_H | 34 | #ifndef __ASM_ARM_ARCH_IO_H |
35 | #define __ASM_ARM_ARCH_IO_H | 35 | #define __ASM_ARM_ARCH_IO_H |
36 | 36 | ||
37 | #include <asm/hardware.h> | ||
38 | |||
37 | #define IO_SPACE_LIMIT 0xffffffff | 39 | #define IO_SPACE_LIMIT 0xffffffff |
38 | 40 | ||
39 | /* | 41 | /* |
@@ -50,23 +52,33 @@ | |||
50 | * ---------------------------------------------------------------------------- | 52 | * ---------------------------------------------------------------------------- |
51 | */ | 53 | */ |
52 | 54 | ||
55 | #define PCIO_BASE 0 | ||
56 | |||
53 | #if defined(CONFIG_ARCH_OMAP1) | 57 | #if defined(CONFIG_ARCH_OMAP1) |
58 | |||
54 | #define IO_PHYS 0xFFFB0000 | 59 | #define IO_PHYS 0xFFFB0000 |
55 | #define IO_OFFSET -0x01000000 /* Virtual IO = 0xfefb0000 */ | 60 | #define IO_OFFSET 0x01000000 /* Virtual IO = 0xfefb0000 */ |
56 | #define IO_SIZE 0x40000 | 61 | #define IO_SIZE 0x40000 |
62 | #define IO_VIRT (IO_PHYS - IO_OFFSET) | ||
63 | #define IO_ADDRESS(pa) ((pa) - IO_OFFSET) | ||
64 | #define io_p2v(pa) ((pa) - IO_OFFSET) | ||
65 | #define io_v2p(va) ((va) + IO_OFFSET) | ||
57 | 66 | ||
58 | #elif defined(CONFIG_ARCH_OMAP2) | 67 | #elif defined(CONFIG_ARCH_OMAP2) |
59 | #define IO_PHYS 0x48000000 /* L4 peripherals; other stuff has to be mapped * | ||
60 | * manually. */ | ||
61 | #define IO_OFFSET 0x90000000 /* Virtual IO = 0xd8000000 */ | ||
62 | #define IO_SIZE 0x08000000 | ||
63 | #endif | ||
64 | 68 | ||
65 | #define IO_VIRT (IO_PHYS + IO_OFFSET) | 69 | /* We map both L3 and L4 on OMAP2 */ |
66 | #define IO_ADDRESS(x) ((x) + IO_OFFSET) | 70 | #define L3_24XX_PHYS L3_24XX_BASE /* 0x68000000 */ |
67 | #define PCIO_BASE 0 | 71 | #define L3_24XX_VIRT 0xf8000000 |
68 | #define io_p2v(x) ((x) + IO_OFFSET) | 72 | #define L3_24XX_SIZE SZ_1M /* 44kB of 128MB used, want 1MB sect */ |
69 | #define io_v2p(x) ((x) - IO_OFFSET) | 73 | #define L4_24XX_PHYS L4_24XX_BASE /* 0x48000000 */ |
74 | #define L4_24XX_VIRT 0xd8000000 | ||
75 | #define L4_24XX_SIZE SZ_1M /* 1MB of 128MB used, want 1MB sect */ | ||
76 | #define IO_OFFSET 0x90000000 | ||
77 | #define IO_ADDRESS(pa) ((pa) + IO_OFFSET) /* Works for L3 and L4 */ | ||
78 | #define io_p2v(pa) ((pa) + IO_OFFSET) /* Works for L3 and L4 */ | ||
79 | #define io_v2p(va) ((va) - IO_OFFSET) /* Works for L3 and L4 */ | ||
80 | |||
81 | #endif | ||
70 | 82 | ||
71 | #ifndef __ASSEMBLER__ | 83 | #ifndef __ASSEMBLER__ |
72 | 84 | ||
diff --git a/include/asm-arm/arch-omap/irqs.h b/include/asm-arm/arch-omap/irqs.h index 74e108ccac16..4ffce1d77759 100644 --- a/include/asm-arm/arch-omap/irqs.h +++ b/include/asm-arm/arch-omap/irqs.h | |||
@@ -22,8 +22,8 @@ | |||
22 | * are different. | 22 | * are different. |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #ifndef __ASM_ARCH_OMAP1510_IRQS_H | 25 | #ifndef __ASM_ARCH_OMAP15XX_IRQS_H |
26 | #define __ASM_ARCH_OMAP1510_IRQS_H | 26 | #define __ASM_ARCH_OMAP15XX_IRQS_H |
27 | 27 | ||
28 | /* | 28 | /* |
29 | * IRQ numbers for interrupt handler 1 | 29 | * IRQ numbers for interrupt handler 1 |
@@ -31,7 +31,6 @@ | |||
31 | * NOTE: See also the OMAP-1510 and 1610 specific IRQ numbers below | 31 | * NOTE: See also the OMAP-1510 and 1610 specific IRQ numbers below |
32 | * | 32 | * |
33 | */ | 33 | */ |
34 | #define INT_IH2_IRQ 0 | ||
35 | #define INT_CAMERA 1 | 34 | #define INT_CAMERA 1 |
36 | #define INT_FIQ 3 | 35 | #define INT_FIQ 3 |
37 | #define INT_RTDX 6 | 36 | #define INT_RTDX 6 |
@@ -60,6 +59,7 @@ | |||
60 | /* | 59 | /* |
61 | * OMAP-1510 specific IRQ numbers for interrupt handler 1 | 60 | * OMAP-1510 specific IRQ numbers for interrupt handler 1 |
62 | */ | 61 | */ |
62 | #define INT_1510_IH2_IRQ 0 | ||
63 | #define INT_1510_RES2 2 | 63 | #define INT_1510_RES2 2 |
64 | #define INT_1510_SPI_TX 4 | 64 | #define INT_1510_SPI_TX 4 |
65 | #define INT_1510_SPI_RX 5 | 65 | #define INT_1510_SPI_RX 5 |
@@ -71,6 +71,7 @@ | |||
71 | /* | 71 | /* |
72 | * OMAP-1610 specific IRQ numbers for interrupt handler 1 | 72 | * OMAP-1610 specific IRQ numbers for interrupt handler 1 |
73 | */ | 73 | */ |
74 | #define INT_1610_IH2_IRQ 0 | ||
74 | #define INT_1610_IH2_FIQ 2 | 75 | #define INT_1610_IH2_FIQ 2 |
75 | #define INT_1610_McBSP2_TX 4 | 76 | #define INT_1610_McBSP2_TX 4 |
76 | #define INT_1610_McBSP2_RX 5 | 77 | #define INT_1610_McBSP2_RX 5 |
@@ -231,6 +232,12 @@ | |||
231 | #define INT_730_DMA_CH15 (62 + IH2_BASE) | 232 | #define INT_730_DMA_CH15 (62 + IH2_BASE) |
232 | #define INT_730_NAND (63 + IH2_BASE) | 233 | #define INT_730_NAND (63 + IH2_BASE) |
233 | 234 | ||
235 | #define INT_24XX_SYS_NIRQ 7 | ||
236 | #define INT_24XX_SDMA_IRQ0 12 | ||
237 | #define INT_24XX_SDMA_IRQ1 13 | ||
238 | #define INT_24XX_SDMA_IRQ2 14 | ||
239 | #define INT_24XX_SDMA_IRQ3 15 | ||
240 | #define INT_24XX_DSS_IRQ 25 | ||
234 | #define INT_24XX_GPIO_BANK1 29 | 241 | #define INT_24XX_GPIO_BANK1 29 |
235 | #define INT_24XX_GPIO_BANK2 30 | 242 | #define INT_24XX_GPIO_BANK2 30 |
236 | #define INT_24XX_GPIO_BANK3 31 | 243 | #define INT_24XX_GPIO_BANK3 31 |
@@ -253,7 +260,7 @@ extern void omap_init_irq(void); | |||
253 | * The definition of NR_IRQS is in board-specific header file, which is | 260 | * The definition of NR_IRQS is in board-specific header file, which is |
254 | * included via hardware.h | 261 | * included via hardware.h |
255 | */ | 262 | */ |
256 | #include <asm/arch/hardware.h> | 263 | #include <asm/hardware.h> |
257 | 264 | ||
258 | #ifndef NR_IRQS | 265 | #ifndef NR_IRQS |
259 | #define NR_IRQS IH_BOARD_BASE | 266 | #define NR_IRQS IH_BOARD_BASE |
diff --git a/include/asm-arm/arch-omap/mcbsp.h b/include/asm-arm/arch-omap/mcbsp.h index 305bdeb16ab8..e79d98ab2ab6 100644 --- a/include/asm-arm/arch-omap/mcbsp.h +++ b/include/asm-arm/arch-omap/mcbsp.h | |||
@@ -24,7 +24,7 @@ | |||
24 | #ifndef __ASM_ARCH_OMAP_MCBSP_H | 24 | #ifndef __ASM_ARCH_OMAP_MCBSP_H |
25 | #define __ASM_ARCH_OMAP_MCBSP_H | 25 | #define __ASM_ARCH_OMAP_MCBSP_H |
26 | 26 | ||
27 | #include <asm/arch/hardware.h> | 27 | #include <asm/hardware.h> |
28 | 28 | ||
29 | #define OMAP730_MCBSP1_BASE 0xfffb1000 | 29 | #define OMAP730_MCBSP1_BASE 0xfffb1000 |
30 | #define OMAP730_MCBSP2_BASE 0xfffb1800 | 30 | #define OMAP730_MCBSP2_BASE 0xfffb1800 |
diff --git a/include/asm-arm/arch-omap/memory.h b/include/asm-arm/arch-omap/memory.h index ef32d61eec7a..df50dd53e1dd 100644 --- a/include/asm-arm/arch-omap/memory.h +++ b/include/asm-arm/arch-omap/memory.h | |||
@@ -37,9 +37,9 @@ | |||
37 | * Physical DRAM offset. | 37 | * Physical DRAM offset. |
38 | */ | 38 | */ |
39 | #if defined(CONFIG_ARCH_OMAP1) | 39 | #if defined(CONFIG_ARCH_OMAP1) |
40 | #define PHYS_OFFSET (0x10000000UL) | 40 | #define PHYS_OFFSET UL(0x10000000) |
41 | #elif defined(CONFIG_ARCH_OMAP2) | 41 | #elif defined(CONFIG_ARCH_OMAP2) |
42 | #define PHYS_OFFSET (0x80000000UL) | 42 | #define PHYS_OFFSET UL(0x80000000) |
43 | #endif | 43 | #endif |
44 | 44 | ||
45 | /* | 45 | /* |
@@ -61,12 +61,12 @@ | |||
61 | * Note that the is_lbus_device() test is not very efficient on 1510 | 61 | * Note that the is_lbus_device() test is not very efficient on 1510 |
62 | * because of the strncmp(). | 62 | * because of the strncmp(). |
63 | */ | 63 | */ |
64 | #ifdef CONFIG_ARCH_OMAP1510 | 64 | #ifdef CONFIG_ARCH_OMAP15XX |
65 | 65 | ||
66 | /* | 66 | /* |
67 | * OMAP-1510 Local Bus address offset | 67 | * OMAP-1510 Local Bus address offset |
68 | */ | 68 | */ |
69 | #define OMAP1510_LB_OFFSET (0x30000000UL) | 69 | #define OMAP1510_LB_OFFSET UL(0x30000000) |
70 | 70 | ||
71 | #define virt_to_lbus(x) ((x) - PAGE_OFFSET + OMAP1510_LB_OFFSET) | 71 | #define virt_to_lbus(x) ((x) - PAGE_OFFSET + OMAP1510_LB_OFFSET) |
72 | #define lbus_to_virt(x) ((x) - OMAP1510_LB_OFFSET + PAGE_OFFSET) | 72 | #define lbus_to_virt(x) ((x) - OMAP1510_LB_OFFSET + PAGE_OFFSET) |
@@ -84,7 +84,7 @@ | |||
84 | virt_to_lbus(addr) : \ | 84 | virt_to_lbus(addr) : \ |
85 | __virt_to_bus(addr);}) | 85 | __virt_to_bus(addr);}) |
86 | 86 | ||
87 | #endif /* CONFIG_ARCH_OMAP1510 */ | 87 | #endif /* CONFIG_ARCH_OMAP15XX */ |
88 | 88 | ||
89 | #endif | 89 | #endif |
90 | 90 | ||
diff --git a/include/asm-arm/arch-omap/menelaus.h b/include/asm-arm/arch-omap/menelaus.h new file mode 100644 index 000000000000..46be8b8d6346 --- /dev/null +++ b/include/asm-arm/arch-omap/menelaus.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-omap/menelaus.h | ||
3 | * | ||
4 | * Functions to access Menelaus power management chip | ||
5 | */ | ||
6 | |||
7 | #ifndef __ASM_ARCH_MENELAUS_H | ||
8 | #define __ASM_ARCH_MENELAUS_H | ||
9 | |||
10 | extern void menelaus_mmc_register(void (*callback)(u8 card_mask), | ||
11 | unsigned long data); | ||
12 | extern void menelaus_mmc_remove(void); | ||
13 | extern void menelaus_mmc_opendrain(int enable); | ||
14 | |||
15 | #if defined(CONFIG_ARCH_OMAP24XX) && defined(CONFIG_MENELAUS) | ||
16 | #define omap_has_menelaus() 1 | ||
17 | #else | ||
18 | #define omap_has_menelaus() 0 | ||
19 | #endif | ||
20 | |||
21 | #endif | ||
22 | |||
diff --git a/include/asm-arm/arch-omap/mux.h b/include/asm-arm/arch-omap/mux.h index 1b1ad4105349..13415a9aab06 100644 --- a/include/asm-arm/arch-omap/mux.h +++ b/include/asm-arm/arch-omap/mux.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * Table of the Omap register configurations for the FUNC_MUX and | 4 | * Table of the Omap register configurations for the FUNC_MUX and |
5 | * PULL_DWN combinations. | 5 | * PULL_DWN combinations. |
6 | * | 6 | * |
7 | * Copyright (C) 2003 Nokia Corporation | 7 | * Copyright (C) 2003 - 2005 Nokia Corporation |
8 | * | 8 | * |
9 | * Written by Tony Lindgren <tony.lindgren@nokia.com> | 9 | * Written by Tony Lindgren <tony.lindgren@nokia.com> |
10 | * | 10 | * |
@@ -58,6 +58,16 @@ | |||
58 | .pu_pd_reg = PU_PD_SEL_##reg, \ | 58 | .pu_pd_reg = PU_PD_SEL_##reg, \ |
59 | .pu_pd_val = status, | 59 | .pu_pd_val = status, |
60 | 60 | ||
61 | #define MUX_REG_730(reg, mode_offset, mode) .mux_reg_name = "OMAP730_IO_CONF_"#reg, \ | ||
62 | .mux_reg = OMAP730_IO_CONF_##reg, \ | ||
63 | .mask_offset = mode_offset, \ | ||
64 | .mask = mode, | ||
65 | |||
66 | #define PULL_REG_730(reg, bit, status) .pull_name = "OMAP730_IO_CONF_"#reg, \ | ||
67 | .pull_reg = OMAP730_IO_CONF_##reg, \ | ||
68 | .pull_bit = bit, \ | ||
69 | .pull_val = status, | ||
70 | |||
61 | #else | 71 | #else |
62 | 72 | ||
63 | #define MUX_REG(reg, mode_offset, mode) .mux_reg = FUNC_MUX_CTRL_##reg, \ | 73 | #define MUX_REG(reg, mode_offset, mode) .mux_reg = FUNC_MUX_CTRL_##reg, \ |
@@ -71,6 +81,15 @@ | |||
71 | #define PU_PD_REG(reg, status) .pu_pd_reg = PU_PD_SEL_##reg, \ | 81 | #define PU_PD_REG(reg, status) .pu_pd_reg = PU_PD_SEL_##reg, \ |
72 | .pu_pd_val = status, | 82 | .pu_pd_val = status, |
73 | 83 | ||
84 | #define MUX_REG_730(reg, mode_offset, mode) \ | ||
85 | .mux_reg = OMAP730_IO_CONF_##reg, \ | ||
86 | .mask_offset = mode_offset, \ | ||
87 | .mask = mode, | ||
88 | |||
89 | #define PULL_REG_730(reg, bit, status) .pull_reg = OMAP730_IO_CONF_##reg, \ | ||
90 | .pull_bit = bit, \ | ||
91 | .pull_val = status, | ||
92 | |||
74 | #endif /* CONFIG_OMAP_MUX_DEBUG */ | 93 | #endif /* CONFIG_OMAP_MUX_DEBUG */ |
75 | 94 | ||
76 | #define MUX_CFG(desc, mux_reg, mode_offset, mode, \ | 95 | #define MUX_CFG(desc, mux_reg, mode_offset, mode, \ |
@@ -84,13 +103,44 @@ | |||
84 | PU_PD_REG(pu_pd_reg, pu_pd_status) \ | 103 | PU_PD_REG(pu_pd_reg, pu_pd_status) \ |
85 | }, | 104 | }, |
86 | 105 | ||
106 | |||
107 | /* | ||
108 | * OMAP730 has a slightly different config for the pin mux. | ||
109 | * - config regs are the OMAP730_IO_CONF_x regs (see omap730.h) regs and | ||
110 | * not the FUNC_MUX_CTRL_x regs from hardware.h | ||
111 | * - for pull-up/down, only has one enable bit which is is in the same register | ||
112 | * as mux config | ||
113 | */ | ||
114 | #define MUX_CFG_730(desc, mux_reg, mode_offset, mode, \ | ||
115 | pull_reg, pull_bit, pull_status, \ | ||
116 | pu_pd_reg, pu_pd_status, debug_status)\ | ||
117 | { \ | ||
118 | .name = desc, \ | ||
119 | .debug = debug_status, \ | ||
120 | MUX_REG_730(mux_reg, mode_offset, mode) \ | ||
121 | PULL_REG_730(mux_reg, pull_bit, pull_status) \ | ||
122 | PU_PD_REG(pu_pd_reg, pu_pd_status) \ | ||
123 | }, | ||
124 | |||
125 | #define MUX_CFG_24XX(desc, reg_offset, mode, \ | ||
126 | pull_en, pull_mode, dbg) \ | ||
127 | { \ | ||
128 | .name = desc, \ | ||
129 | .debug = dbg, \ | ||
130 | .mux_reg = reg_offset, \ | ||
131 | .mask = mode, \ | ||
132 | .pull_val = pull_en, \ | ||
133 | .pu_pd_val = pull_mode, \ | ||
134 | }, | ||
135 | |||
136 | |||
87 | #define PULL_DISABLED 0 | 137 | #define PULL_DISABLED 0 |
88 | #define PULL_ENABLED 1 | 138 | #define PULL_ENABLED 1 |
89 | 139 | ||
90 | #define PULL_DOWN 0 | 140 | #define PULL_DOWN 0 |
91 | #define PULL_UP 1 | 141 | #define PULL_UP 1 |
92 | 142 | ||
93 | typedef struct { | 143 | struct pin_config { |
94 | char *name; | 144 | char *name; |
95 | unsigned char busy; | 145 | unsigned char busy; |
96 | unsigned char debug; | 146 | unsigned char debug; |
@@ -108,13 +158,23 @@ typedef struct { | |||
108 | const char *pu_pd_name; | 158 | const char *pu_pd_name; |
109 | const unsigned int pu_pd_reg; | 159 | const unsigned int pu_pd_reg; |
110 | const unsigned char pu_pd_val; | 160 | const unsigned char pu_pd_val; |
111 | } reg_cfg_set; | 161 | }; |
112 | 162 | ||
113 | /* | 163 | enum omap730_index { |
114 | * Lookup table for FUNC_MUX and PULL_DWN register combinations for each | 164 | /* OMAP 730 keyboard */ |
115 | * device. See also reg_cfg_table below for the register values. | 165 | E2_730_KBR0, |
116 | */ | 166 | J7_730_KBR1, |
117 | typedef enum { | 167 | E1_730_KBR2, |
168 | F3_730_KBR3, | ||
169 | D2_730_KBR4, | ||
170 | C2_730_KBC0, | ||
171 | D3_730_KBC1, | ||
172 | E4_730_KBC2, | ||
173 | F4_730_KBC3, | ||
174 | E3_730_KBC4, | ||
175 | }; | ||
176 | |||
177 | enum omap1xxx_index { | ||
118 | /* UART1 (BT_UART_GATING)*/ | 178 | /* UART1 (BT_UART_GATING)*/ |
119 | UART1_TX = 0, | 179 | UART1_TX = 0, |
120 | UART1_RTS, | 180 | UART1_RTS, |
@@ -331,245 +391,34 @@ typedef enum { | |||
331 | V10_1610_CF_IREQ, | 391 | V10_1610_CF_IREQ, |
332 | W10_1610_CF_RESET, | 392 | W10_1610_CF_RESET, |
333 | W11_1610_CF_CD1, | 393 | W11_1610_CF_CD1, |
334 | } reg_cfg_t; | 394 | }; |
335 | 395 | ||
336 | #if defined(__MUX_C__) && defined(CONFIG_OMAP_MUX) | 396 | enum omap24xx_index { |
397 | /* 24xx I2C */ | ||
398 | M19_24XX_I2C1_SCL, | ||
399 | L15_24XX_I2C1_SDA, | ||
400 | J15_24XX_I2C2_SCL, | ||
401 | H19_24XX_I2C2_SDA, | ||
337 | 402 | ||
338 | /* | 403 | /* 24xx Menelaus interrupt */ |
339 | * Table of various FUNC_MUX and PULL_DWN combinations for each device. | 404 | W19_24XX_SYS_NIRQ, |
340 | * See also reg_cfg_t above for the lookup table. | ||
341 | */ | ||
342 | static const reg_cfg_set __initdata_or_module | ||
343 | reg_cfg_table[] = { | ||
344 | /* | ||
345 | * description mux mode mux pull pull pull pu_pd pu dbg | ||
346 | * reg offset mode reg bit ena reg | ||
347 | */ | ||
348 | MUX_CFG("UART1_TX", 9, 21, 1, 2, 3, 0, NA, 0, 0) | ||
349 | MUX_CFG("UART1_RTS", 9, 12, 1, 2, 0, 0, NA, 0, 0) | ||
350 | |||
351 | /* UART2 (COM_UART_GATING), conflicts with USB2 */ | ||
352 | MUX_CFG("UART2_TX", C, 27, 1, 3, 3, 0, NA, 0, 0) | ||
353 | MUX_CFG("UART2_RX", C, 18, 0, 3, 1, 1, NA, 0, 0) | ||
354 | MUX_CFG("UART2_CTS", C, 21, 0, 3, 1, 1, NA, 0, 0) | ||
355 | MUX_CFG("UART2_RTS", C, 24, 1, 3, 2, 0, NA, 0, 0) | ||
356 | |||
357 | /* UART3 (GIGA_UART_GATING) */ | ||
358 | MUX_CFG("UART3_TX", 6, 0, 1, 0, 30, 0, NA, 0, 0) | ||
359 | MUX_CFG("UART3_RX", 6, 3, 0, 0, 31, 1, NA, 0, 0) | ||
360 | MUX_CFG("UART3_CTS", 5, 12, 2, 0, 24, 0, NA, 0, 0) | ||
361 | MUX_CFG("UART3_RTS", 5, 15, 2, 0, 25, 0, NA, 0, 0) | ||
362 | MUX_CFG("UART3_CLKREQ", 9, 27, 0, 2, 5, 0, NA, 0, 0) | ||
363 | MUX_CFG("UART3_BCLK", A, 0, 0, 2, 6, 0, NA, 0, 0) | ||
364 | MUX_CFG("Y15_1610_UART3_RTS", A, 0, 1, 2, 6, 0, NA, 0, 0) | ||
365 | |||
366 | /* PWT & PWL, conflicts with UART3 */ | ||
367 | MUX_CFG("PWT", 6, 0, 2, 0, 30, 0, NA, 0, 0) | ||
368 | MUX_CFG("PWL", 6, 3, 1, 0, 31, 1, NA, 0, 0) | ||
369 | |||
370 | /* USB internal master generic */ | ||
371 | MUX_CFG("R18_USB_VBUS", 7, 9, 2, 1, 11, 0, NA, 0, 1) | ||
372 | MUX_CFG("R18_1510_USB_GPIO0", 7, 9, 0, 1, 11, 1, NA, 0, 1) | ||
373 | /* works around erratum: W4_USB_PUEN and W4_USB_PUDIS are switched! */ | ||
374 | MUX_CFG("W4_USB_PUEN", D, 3, 3, 3, 5, 1, NA, 0, 1) | ||
375 | MUX_CFG("W4_USB_CLKO", D, 3, 1, 3, 5, 0, NA, 0, 1) | ||
376 | MUX_CFG("W4_USB_HIGHZ", D, 3, 4, 3, 5, 0, 3, 0, 1) | ||
377 | MUX_CFG("W4_GPIO58", D, 3, 7, 3, 5, 0, 3, 0, 1) | ||
378 | |||
379 | /* USB1 master */ | ||
380 | MUX_CFG("USB1_SUSP", 8, 27, 2, 1, 27, 0, NA, 0, 1) | ||
381 | MUX_CFG("USB1_SE0", 9, 0, 2, 1, 28, 0, NA, 0, 1) | ||
382 | MUX_CFG("W13_1610_USB1_SE0", 9, 0, 4, 1, 28, 0, NA, 0, 1) | ||
383 | MUX_CFG("USB1_TXEN", 9, 3, 2, 1, 29, 0, NA, 0, 1) | ||
384 | MUX_CFG("USB1_TXD", 9, 24, 1, 2, 4, 0, NA, 0, 1) | ||
385 | MUX_CFG("USB1_VP", A, 3, 1, 2, 7, 0, NA, 0, 1) | ||
386 | MUX_CFG("USB1_VM", A, 6, 1, 2, 8, 0, NA, 0, 1) | ||
387 | MUX_CFG("USB1_RCV", A, 9, 1, 2, 9, 0, NA, 0, 1) | ||
388 | MUX_CFG("USB1_SPEED", A, 12, 2, 2, 10, 0, NA, 0, 1) | ||
389 | MUX_CFG("R13_1610_USB1_SPEED", A, 12, 5, 2, 10, 0, NA, 0, 1) | ||
390 | MUX_CFG("R13_1710_USB1_SEO", A, 12, 5, 2, 10, 0, NA, 0, 1) | ||
391 | |||
392 | /* USB2 master */ | ||
393 | MUX_CFG("USB2_SUSP", B, 3, 1, 2, 17, 0, NA, 0, 1) | ||
394 | MUX_CFG("USB2_VP", B, 6, 1, 2, 18, 0, NA, 0, 1) | ||
395 | MUX_CFG("USB2_TXEN", B, 9, 1, 2, 19, 0, NA, 0, 1) | ||
396 | MUX_CFG("USB2_VM", C, 18, 1, 3, 0, 0, NA, 0, 1) | ||
397 | MUX_CFG("USB2_RCV", C, 21, 1, 3, 1, 0, NA, 0, 1) | ||
398 | MUX_CFG("USB2_SE0", C, 24, 2, 3, 2, 0, NA, 0, 1) | ||
399 | MUX_CFG("USB2_TXD", C, 27, 2, 3, 3, 0, NA, 0, 1) | ||
400 | |||
401 | /* OMAP-1510 GPIO */ | ||
402 | MUX_CFG("R18_1510_GPIO0", 7, 9, 0, 1, 11, 1, 0, 0, 1) | ||
403 | MUX_CFG("R19_1510_GPIO1", 7, 6, 0, 1, 10, 1, 0, 0, 1) | ||
404 | MUX_CFG("M14_1510_GPIO2", 7, 3, 0, 1, 9, 1, 0, 0, 1) | ||
405 | |||
406 | /* OMAP1610 GPIO */ | ||
407 | MUX_CFG("P18_1610_GPIO3", 7, 0, 0, 1, 8, 0, NA, 0, 1) | ||
408 | MUX_CFG("Y15_1610_GPIO17", A, 0, 7, 2, 6, 0, NA, 0, 1) | ||
409 | |||
410 | /* OMAP-1710 GPIO */ | ||
411 | MUX_CFG("R18_1710_GPIO0", 7, 9, 0, 1, 11, 1, 1, 1, 1) | ||
412 | MUX_CFG("V2_1710_GPIO10", F, 27, 1, 4, 3, 1, 4, 1, 1) | ||
413 | MUX_CFG("N21_1710_GPIO14", 6, 9, 0, 1, 1, 1, 1, 1, 1) | ||
414 | MUX_CFG("W15_1710_GPIO40", 9, 27, 7, 2, 5, 1, 2, 1, 1) | ||
415 | |||
416 | /* MPUIO */ | ||
417 | MUX_CFG("MPUIO2", 7, 18, 0, 1, 14, 1, NA, 0, 1) | ||
418 | MUX_CFG("N15_1610_MPUIO2", 7, 18, 0, 1, 14, 1, 1, 0, 1) | ||
419 | MUX_CFG("MPUIO4", 7, 15, 0, 1, 13, 1, NA, 0, 1) | ||
420 | MUX_CFG("MPUIO5", 7, 12, 0, 1, 12, 1, NA, 0, 1) | ||
421 | |||
422 | MUX_CFG("T20_1610_MPUIO5", 7, 12, 0, 1, 12, 0, 3, 0, 1) | ||
423 | MUX_CFG("W11_1610_MPUIO6", 10, 15, 2, 3, 8, 0, 3, 0, 1) | ||
424 | MUX_CFG("V10_1610_MPUIO7", A, 24, 2, 2, 14, 0, 2, 0, 1) | ||
425 | MUX_CFG("W11_1610_MPUIO9", 10, 15, 1, 3, 8, 0, 3, 0, 1) | ||
426 | MUX_CFG("V10_1610_MPUIO10", A, 24, 1, 2, 14, 0, 2, 0, 1) | ||
427 | MUX_CFG("W10_1610_MPUIO11", A, 18, 2, 2, 11, 0, 2, 0, 1) | ||
428 | MUX_CFG("E20_1610_MPUIO13", 3, 21, 1, 0, 7, 0, 0, 0, 1) | ||
429 | MUX_CFG("U20_1610_MPUIO14", 9, 6, 6, 0, 30, 0, 0, 0, 1) | ||
430 | MUX_CFG("E19_1610_MPUIO15", 3, 18, 1, 0, 6, 0, 0, 0, 1) | ||
431 | |||
432 | /* MCBSP2 */ | ||
433 | MUX_CFG("MCBSP2_CLKR", C, 6, 0, 2, 27, 1, NA, 0, 1) | ||
434 | MUX_CFG("MCBSP2_CLKX", C, 9, 0, 2, 29, 1, NA, 0, 1) | ||
435 | MUX_CFG("MCBSP2_DR", C, 0, 0, 2, 26, 1, NA, 0, 1) | ||
436 | MUX_CFG("MCBSP2_DX", C, 15, 0, 2, 31, 1, NA, 0, 1) | ||
437 | MUX_CFG("MCBSP2_FSR", C, 12, 0, 2, 30, 1, NA, 0, 1) | ||
438 | MUX_CFG("MCBSP2_FSX", C, 3, 0, 2, 27, 1, NA, 0, 1) | ||
439 | |||
440 | /* MCBSP3 NOTE: Mode must 1 for clock */ | ||
441 | MUX_CFG("MCBSP3_CLKX", 9, 3, 1, 1, 29, 0, NA, 0, 1) | ||
442 | |||
443 | /* Misc ballouts */ | ||
444 | MUX_CFG("BALLOUT_V8_ARMIO3", B, 18, 0, 2, 25, 1, NA, 0, 1) | ||
445 | MUX_CFG("N20_HDQ", 6, 18, 1, 1, 4, 0, 1, 4, 0) | ||
446 | |||
447 | /* OMAP-1610 MMC2 */ | ||
448 | MUX_CFG("W8_1610_MMC2_DAT0", B, 21, 6, 2, 23, 1, 2, 1, 1) | ||
449 | MUX_CFG("V8_1610_MMC2_DAT1", B, 27, 6, 2, 25, 1, 2, 1, 1) | ||
450 | MUX_CFG("W15_1610_MMC2_DAT2", 9, 12, 6, 2, 5, 1, 2, 1, 1) | ||
451 | MUX_CFG("R10_1610_MMC2_DAT3", B, 18, 6, 2, 22, 1, 2, 1, 1) | ||
452 | MUX_CFG("Y10_1610_MMC2_CLK", B, 3, 6, 2, 17, 0, 2, 0, 1) | ||
453 | MUX_CFG("Y8_1610_MMC2_CMD", B, 24, 6, 2, 24, 1, 2, 1, 1) | ||
454 | MUX_CFG("V9_1610_MMC2_CMDDIR", B, 12, 6, 2, 20, 0, 2, 1, 1) | ||
455 | MUX_CFG("V5_1610_MMC2_DATDIR0", B, 15, 6, 2, 21, 0, 2, 1, 1) | ||
456 | MUX_CFG("W19_1610_MMC2_DATDIR1", 8, 15, 6, 1, 23, 0, 1, 1, 1) | ||
457 | MUX_CFG("R18_1610_MMC2_CLKIN", 7, 9, 6, 1, 11, 0, 1, 11, 1) | ||
458 | |||
459 | /* OMAP-1610 External Trace Interface */ | ||
460 | MUX_CFG("M19_1610_ETM_PSTAT0", 5, 27, 1, 0, 29, 0, 0, 0, 1) | ||
461 | MUX_CFG("L15_1610_ETM_PSTAT1", 5, 24, 1, 0, 28, 0, 0, 0, 1) | ||
462 | MUX_CFG("L18_1610_ETM_PSTAT2", 5, 21, 1, 0, 27, 0, 0, 0, 1) | ||
463 | MUX_CFG("L19_1610_ETM_D0", 5, 18, 1, 0, 26, 0, 0, 0, 1) | ||
464 | MUX_CFG("J19_1610_ETM_D6", 5, 0, 1, 0, 20, 0, 0, 0, 1) | ||
465 | MUX_CFG("J18_1610_ETM_D7", 5, 27, 1, 0, 19, 0, 0, 0, 1) | ||
466 | |||
467 | /* OMAP16XX GPIO */ | ||
468 | MUX_CFG("P20_1610_GPIO4", 6, 27, 0, 1, 7, 0, 1, 1, 1) | ||
469 | MUX_CFG("V9_1610_GPIO7", B, 12, 1, 2, 20, 0, 2, 1, 1) | ||
470 | MUX_CFG("W8_1610_GPIO9", B, 21, 0, 2, 23, 0, 2, 1, 1) | ||
471 | MUX_CFG("N20_1610_GPIO11", 6, 18, 0, 1, 4, 0, 1, 1, 1) | ||
472 | MUX_CFG("N19_1610_GPIO13", 6, 12, 0, 1, 2, 0, 1, 1, 1) | ||
473 | MUX_CFG("P10_1610_GPIO22", C, 0, 7, 2, 26, 0, 2, 1, 1) | ||
474 | MUX_CFG("V5_1610_GPIO24", B, 15, 7, 2, 21, 0, 2, 1, 1) | ||
475 | MUX_CFG("AA20_1610_GPIO_41", 9, 9, 7, 1, 31, 0, 1, 1, 1) | ||
476 | MUX_CFG("W19_1610_GPIO48", 8, 15, 7, 1, 23, 1, 1, 0, 1) | ||
477 | MUX_CFG("M7_1610_GPIO62", 10, 0, 0, 4, 24, 0, 4, 0, 1) | ||
478 | MUX_CFG("V14_16XX_GPIO37", 9, 18, 7, 2, 2, 0, 2, 2, 0) | ||
479 | MUX_CFG("R9_16XX_GPIO18", C, 18, 7, 3, 0, 0, 3, 0, 0) | ||
480 | MUX_CFG("L14_16XX_GPIO49", 6, 3, 7, 0, 31, 0, 0, 31, 0) | ||
481 | |||
482 | /* OMAP-1610 uWire */ | ||
483 | MUX_CFG("V19_1610_UWIRE_SCLK", 8, 6, 0, 1, 20, 0, 1, 1, 1) | ||
484 | MUX_CFG("U18_1610_UWIRE_SDI", 8, 0, 0, 1, 18, 0, 1, 1, 1) | ||
485 | MUX_CFG("W21_1610_UWIRE_SDO", 8, 3, 0, 1, 19, 0, 1, 1, 1) | ||
486 | MUX_CFG("N14_1610_UWIRE_CS0", 8, 9, 1, 1, 21, 0, 1, 1, 1) | ||
487 | MUX_CFG("P15_1610_UWIRE_CS3", 8, 12, 1, 1, 22, 0, 1, 1, 1) | ||
488 | MUX_CFG("N15_1610_UWIRE_CS1", 7, 18, 2, 1, 14, 0, NA, 0, 1) | ||
489 | |||
490 | /* OMAP-1610 Flash */ | ||
491 | MUX_CFG("L3_1610_FLASH_CS2B_OE",10, 6, 1, NA, 0, 0, NA, 0, 1) | ||
492 | MUX_CFG("M8_1610_FLASH_CS2B_WE",10, 3, 1, NA, 0, 0, NA, 0, 1) | ||
493 | |||
494 | /* First MMC interface, same on 1510, 1610 and 1710 */ | ||
495 | MUX_CFG("MMC_CMD", A, 27, 0, 2, 15, 1, 2, 1, 1) | ||
496 | MUX_CFG("MMC_DAT1", A, 24, 0, 2, 14, 1, 2, 1, 1) | ||
497 | MUX_CFG("MMC_DAT2", A, 18, 0, 2, 12, 1, 2, 1, 1) | ||
498 | MUX_CFG("MMC_DAT0", B, 0, 0, 2, 16, 1, 2, 1, 1) | ||
499 | MUX_CFG("MMC_CLK", A, 21, 0, NA, 0, 0, NA, 0, 1) | ||
500 | MUX_CFG("MMC_DAT3", 10, 15, 0, 3, 8, 1, 3, 1, 1) | ||
501 | MUX_CFG("M15_1710_MMC_CLKI", 6, 21, 2, 0, 0, 0, NA, 0, 1) | ||
502 | MUX_CFG("P19_1710_MMC_CMDDIR", 6, 24, 6, 0, 0, 0, NA, 0, 1) | ||
503 | MUX_CFG("P20_1710_MMC_DATDIR0", 6, 27, 5, 0, 0, 0, NA, 0, 1) | ||
504 | |||
505 | /* OMAP-1610 USB0 alternate configuration */ | ||
506 | MUX_CFG("W9_USB0_TXEN", B, 9, 5, 2, 19, 0, 2, 0, 1) | ||
507 | MUX_CFG("AA9_USB0_VP", B, 6, 5, 2, 18, 0, 2, 0, 1) | ||
508 | MUX_CFG("Y5_USB0_RCV", C, 21, 5, 3, 1, 0, 1, 0, 1) | ||
509 | MUX_CFG("R9_USB0_VM", C, 18, 5, 3, 0, 0, 3, 0, 1) | ||
510 | MUX_CFG("V6_USB0_TXD", C, 27, 5, 3, 3, 0, 3, 0, 1) | ||
511 | MUX_CFG("W5_USB0_SE0", C, 24, 5, 3, 2, 0, 3, 0, 1) | ||
512 | MUX_CFG("V9_USB0_SPEED", B, 12, 5, 2, 20, 0, 2, 0, 1) | ||
513 | MUX_CFG("Y10_USB0_SUSP", B, 3, 5, 2, 17, 0, 2, 0, 1) | ||
514 | |||
515 | /* USB2 interface */ | ||
516 | MUX_CFG("W9_USB2_TXEN", B, 9, 1, NA, 0, 0, NA, 0, 1) | ||
517 | MUX_CFG("AA9_USB2_VP", B, 6, 1, NA, 0, 0, NA, 0, 1) | ||
518 | MUX_CFG("Y5_USB2_RCV", C, 21, 1, NA, 0, 0, NA, 0, 1) | ||
519 | MUX_CFG("R9_USB2_VM", C, 18, 1, NA, 0, 0, NA, 0, 1) | ||
520 | MUX_CFG("V6_USB2_TXD", C, 27, 2, NA, 0, 0, NA, 0, 1) | ||
521 | MUX_CFG("W5_USB2_SE0", C, 24, 2, NA, 0, 0, NA, 0, 1) | ||
522 | |||
523 | /* 16XX UART */ | ||
524 | MUX_CFG("R13_1610_UART1_TX", A, 12, 6, 2, 10, 0, 2, 10, 1) | ||
525 | MUX_CFG("V14_16XX_UART1_RX", 9, 18, 0, 2, 2, 0, 2, 2, 1) | ||
526 | MUX_CFG("R14_1610_UART1_CTS", 9, 15, 0, 2, 1, 0, 2, 1, 1) | ||
527 | MUX_CFG("AA15_1610_UART1_RTS", 9, 12, 1, 2, 0, 0, 2, 0, 1) | ||
528 | MUX_CFG("R9_16XX_UART2_RX", C, 18, 0, 3, 0, 0, 3, 0, 1) | ||
529 | MUX_CFG("L14_16XX_UART3_RX", 6, 3, 0, 0, 31, 0, 0, 31, 1) | ||
530 | |||
531 | /* I2C interface */ | ||
532 | MUX_CFG("I2C_SCL", 7, 24, 0, NA, 0, 0, NA, 0, 0) | ||
533 | MUX_CFG("I2C_SDA", 7, 27, 0, NA, 0, 0, NA, 0, 0) | ||
534 | |||
535 | /* Keypad */ | ||
536 | MUX_CFG("F18_1610_KBC0", 3, 15, 0, 0, 5, 1, 0, 0, 0) | ||
537 | MUX_CFG("D20_1610_KBC1", 3, 12, 0, 0, 4, 1, 0, 0, 0) | ||
538 | MUX_CFG("D19_1610_KBC2", 3, 9, 0, 0, 3, 1, 0, 0, 0) | ||
539 | MUX_CFG("E18_1610_KBC3", 3, 6, 0, 0, 2, 1, 0, 0, 0) | ||
540 | MUX_CFG("C21_1610_KBC4", 3, 3, 0, 0, 1, 1, 0, 0, 0) | ||
541 | MUX_CFG("G18_1610_KBR0", 4, 0, 0, 0, 10, 1, 0, 1, 0) | ||
542 | MUX_CFG("F19_1610_KBR1", 3, 27, 0, 0, 9, 1, 0, 1, 0) | ||
543 | MUX_CFG("H14_1610_KBR2", 3, 24, 0, 0, 8, 1, 0, 1, 0) | ||
544 | MUX_CFG("E20_1610_KBR3", 3, 21, 0, 0, 7, 1, 0, 1, 0) | ||
545 | MUX_CFG("E19_1610_KBR4", 3, 18, 0, 0, 6, 1, 0, 1, 0) | ||
546 | MUX_CFG("N19_1610_KBR5", 6, 12, 1, 1, 2, 1, 1, 1, 0) | ||
547 | |||
548 | /* Power management */ | ||
549 | MUX_CFG("T20_1610_LOW_PWR", 7, 12, 1, NA, 0, 0, NA, 0, 0) | ||
550 | |||
551 | /* MCLK Settings */ | ||
552 | MUX_CFG("V5_1710_MCLK_ON", B, 15, 0, NA, 0, 0, NA, 0, 0) | ||
553 | MUX_CFG("V5_1710_MCLK_OFF", B, 15, 6, NA, 0, 0, NA, 0, 0) | ||
554 | MUX_CFG("R10_1610_MCLK_ON", B, 18, 0, NA, 22, 0, NA, 1, 0) | ||
555 | MUX_CFG("R10_1610_MCLK_OFF", B, 18, 6, 2, 22, 1, 2, 1, 1) | ||
556 | |||
557 | /* CompactFlash controller, conflicts with MMC1 */ | ||
558 | MUX_CFG("P11_1610_CF_CD2", A, 27, 3, 2, 15, 1, 2, 1, 1) | ||
559 | MUX_CFG("R11_1610_CF_IOIS16", B, 0, 3, 2, 16, 1, 2, 1, 1) | ||
560 | MUX_CFG("V10_1610_CF_IREQ", A, 24, 3, 2, 14, 0, 2, 0, 1) | ||
561 | MUX_CFG("W10_1610_CF_RESET", A, 18, 3, 2, 12, 1, 2, 1, 1) | ||
562 | MUX_CFG("W11_1610_CF_CD1", 10, 15, 3, 3, 8, 1, 3, 1, 1) | ||
563 | }; | ||
564 | 405 | ||
565 | #endif /* __MUX_C__ */ | 406 | /* 24xx GPIO */ |
407 | Y20_24XX_GPIO60, | ||
408 | M15_24XX_GPIO92, | ||
409 | }; | ||
566 | 410 | ||
567 | #ifdef CONFIG_OMAP_MUX | 411 | #ifdef CONFIG_OMAP_MUX |
568 | /* setup pin muxing in Linux */ | 412 | /* setup pin muxing in Linux */ |
569 | extern int omap_cfg_reg(reg_cfg_t reg_cfg); | 413 | extern int omap1_mux_init(void); |
414 | extern int omap2_mux_init(void); | ||
415 | extern int omap_mux_register(struct pin_config * pins, unsigned long size); | ||
416 | extern int omap_cfg_reg(unsigned long reg_cfg); | ||
570 | #else | 417 | #else |
571 | /* boot loader does it all (no warnings from CONFIG_OMAP_MUX_WARNINGS) */ | 418 | /* boot loader does it all (no warnings from CONFIG_OMAP_MUX_WARNINGS) */ |
572 | static inline int omap_cfg_reg(reg_cfg_t reg_cfg) { return 0; } | 419 | static inline int omap1_mux_init(void) { return 0; } |
420 | static inline int omap2_mux_init(void) { return 0; } | ||
421 | static inline int omap_cfg_reg(unsigned long reg_cfg) { return 0; } | ||
573 | #endif | 422 | #endif |
574 | 423 | ||
575 | #endif | 424 | #endif |
diff --git a/include/asm-arm/arch-omap/omap1510.h b/include/asm-arm/arch-omap/omap1510.h index f086a3933906..c575d354850f 100644 --- a/include/asm-arm/arch-omap/omap1510.h +++ b/include/asm-arm/arch-omap/omap1510.h | |||
@@ -25,8 +25,8 @@ | |||
25 | * 675 Mass Ave, Cambridge, MA 02139, USA. | 25 | * 675 Mass Ave, Cambridge, MA 02139, USA. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | #ifndef __ASM_ARCH_OMAP1510_H | 28 | #ifndef __ASM_ARCH_OMAP15XX_H |
29 | #define __ASM_ARCH_OMAP1510_H | 29 | #define __ASM_ARCH_OMAP15XX_H |
30 | 30 | ||
31 | /* | 31 | /* |
32 | * ---------------------------------------------------------------------------- | 32 | * ---------------------------------------------------------------------------- |
@@ -44,5 +44,5 @@ | |||
44 | #define OMAP1510_DSPREG_SIZE SZ_128K | 44 | #define OMAP1510_DSPREG_SIZE SZ_128K |
45 | #define OMAP1510_DSPREG_START 0xE1000000 | 45 | #define OMAP1510_DSPREG_START 0xE1000000 |
46 | 46 | ||
47 | #endif /* __ASM_ARCH_OMAP1510_H */ | 47 | #endif /* __ASM_ARCH_OMAP15XX_H */ |
48 | 48 | ||
diff --git a/include/asm-arm/arch-omap/omap24xx.h b/include/asm-arm/arch-omap/omap24xx.h index a9105466a417..6e59805fa654 100644 --- a/include/asm-arm/arch-omap/omap24xx.h +++ b/include/asm-arm/arch-omap/omap24xx.h | |||
@@ -1,15 +1,24 @@ | |||
1 | #ifndef __ASM_ARCH_OMAP24XX_H | 1 | #ifndef __ASM_ARCH_OMAP24XX_H |
2 | #define __ASM_ARCH_OMAP24XX_H | 2 | #define __ASM_ARCH_OMAP24XX_H |
3 | 3 | ||
4 | #define OMAP24XX_L4_IO_BASE 0x48000000 | 4 | /* |
5 | * Please place only base defines here and put the rest in device | ||
6 | * specific headers. Note also that some of these defines are needed | ||
7 | * for omap1 to compile without adding ifdefs. | ||
8 | */ | ||
9 | |||
10 | #define L4_24XX_BASE 0x48000000 | ||
11 | #define L3_24XX_BASE 0x68000000 | ||
5 | 12 | ||
6 | /* interrupt controller */ | 13 | /* interrupt controller */ |
7 | #define OMAP24XX_IC_BASE (OMAP24XX_L4_IO_BASE + 0xfe000) | 14 | #define OMAP24XX_IC_BASE (L4_24XX_BASE + 0xfe000) |
8 | #define VA_IC_BASE IO_ADDRESS(OMAP24XX_IC_BASE) | 15 | #define VA_IC_BASE IO_ADDRESS(OMAP24XX_IC_BASE) |
9 | |||
10 | #define OMAP24XX_IVA_INTC_BASE 0x40000000 | 16 | #define OMAP24XX_IVA_INTC_BASE 0x40000000 |
11 | |||
12 | #define IRQ_SIR_IRQ 0x0040 | 17 | #define IRQ_SIR_IRQ 0x0040 |
13 | 18 | ||
19 | #define OMAP24XX_32KSYNCT_BASE (L4_24XX_BASE + 0x4000) | ||
20 | #define OMAP24XX_PRCM_BASE (L4_24XX_BASE + 0x8000) | ||
21 | #define OMAP24XX_SDRC_BASE (L3_24XX_BASE + 0x9000) | ||
22 | |||
14 | #endif /* __ASM_ARCH_OMAP24XX_H */ | 23 | #endif /* __ASM_ARCH_OMAP24XX_H */ |
15 | 24 | ||
diff --git a/include/asm-arm/arch-omap/omapfb.h b/include/asm-arm/arch-omap/omapfb.h new file mode 100644 index 000000000000..4ba2622cc142 --- /dev/null +++ b/include/asm-arm/arch-omap/omapfb.h | |||
@@ -0,0 +1,281 @@ | |||
1 | /* | ||
2 | * File: include/asm-arm/arch-omap/omapfb.h | ||
3 | * | ||
4 | * Framebuffer driver for TI OMAP boards | ||
5 | * | ||
6 | * Copyright (C) 2004 Nokia Corporation | ||
7 | * Author: Imre Deak <imre.deak@nokia.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify it | ||
10 | * under the terms of the GNU General Public License as published by the | ||
11 | * Free Software Foundation; either version 2 of the License, or (at your | ||
12 | * option) any later version. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, but | ||
15 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
17 | * General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License along | ||
20 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
21 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
22 | */ | ||
23 | |||
24 | #ifndef __OMAPFB_H | ||
25 | #define __OMAPFB_H | ||
26 | |||
27 | /* IOCTL commands. */ | ||
28 | |||
29 | #define OMAP_IOW(num, dtype) _IOW('O', num, dtype) | ||
30 | #define OMAP_IOR(num, dtype) _IOR('O', num, dtype) | ||
31 | #define OMAP_IOWR(num, dtype) _IOWR('O', num, dtype) | ||
32 | #define OMAP_IO(num) _IO('O', num) | ||
33 | |||
34 | #define OMAPFB_MIRROR OMAP_IOW(31, int) | ||
35 | #define OMAPFB_SYNC_GFX OMAP_IO(37) | ||
36 | #define OMAPFB_VSYNC OMAP_IO(38) | ||
37 | #define OMAPFB_SET_UPDATE_MODE OMAP_IOW(40, enum omapfb_update_mode) | ||
38 | #define OMAPFB_GET_CAPS OMAP_IOR(42, unsigned long) | ||
39 | #define OMAPFB_GET_UPDATE_MODE OMAP_IOW(43, enum omapfb_update_mode) | ||
40 | #define OMAPFB_LCD_TEST OMAP_IOW(45, int) | ||
41 | #define OMAPFB_CTRL_TEST OMAP_IOW(46, int) | ||
42 | #define OMAPFB_UPDATE_WINDOW OMAP_IOW(47, struct omapfb_update_window) | ||
43 | #define OMAPFB_SETUP_PLANE OMAP_IOW(48, struct omapfb_setup_plane) | ||
44 | #define OMAPFB_ENABLE_PLANE OMAP_IOW(49, struct omapfb_enable_plane) | ||
45 | #define OMAPFB_SET_COLOR_KEY OMAP_IOW(50, struct omapfb_color_key) | ||
46 | |||
47 | #define OMAPFB_CAPS_GENERIC_MASK 0x00000fff | ||
48 | #define OMAPFB_CAPS_LCDC_MASK 0x00fff000 | ||
49 | #define OMAPFB_CAPS_PANEL_MASK 0xff000000 | ||
50 | |||
51 | #define OMAPFB_CAPS_MANUAL_UPDATE 0x00001000 | ||
52 | #define OMAPFB_CAPS_SET_BACKLIGHT 0x01000000 | ||
53 | |||
54 | /* Values from DSP must map to lower 16-bits */ | ||
55 | #define OMAPFB_FORMAT_MASK 0x00ff | ||
56 | #define OMAPFB_FORMAT_FLAG_DOUBLE 0x0100 | ||
57 | |||
58 | enum omapfb_color_format { | ||
59 | OMAPFB_COLOR_RGB565 = 0, | ||
60 | OMAPFB_COLOR_YUV422, | ||
61 | OMAPFB_COLOR_YUV420, | ||
62 | OMAPFB_COLOR_CLUT_8BPP, | ||
63 | OMAPFB_COLOR_CLUT_4BPP, | ||
64 | OMAPFB_COLOR_CLUT_2BPP, | ||
65 | OMAPFB_COLOR_CLUT_1BPP, | ||
66 | }; | ||
67 | |||
68 | struct omapfb_update_window { | ||
69 | u32 x, y; | ||
70 | u32 width, height; | ||
71 | u32 format; | ||
72 | }; | ||
73 | |||
74 | enum omapfb_plane { | ||
75 | OMAPFB_PLANE_GFX = 0, | ||
76 | OMAPFB_PLANE_VID1, | ||
77 | OMAPFB_PLANE_VID2, | ||
78 | }; | ||
79 | |||
80 | enum omapfb_channel_out { | ||
81 | OMAPFB_CHANNEL_OUT_LCD = 0, | ||
82 | OMAPFB_CHANNEL_OUT_DIGIT, | ||
83 | }; | ||
84 | |||
85 | struct omapfb_setup_plane { | ||
86 | u8 plane; | ||
87 | u8 channel_out; | ||
88 | u32 offset; | ||
89 | u32 pos_x, pos_y; | ||
90 | u32 width, height; | ||
91 | u32 color_mode; | ||
92 | }; | ||
93 | |||
94 | struct omapfb_enable_plane { | ||
95 | u8 plane; | ||
96 | u8 enable; | ||
97 | }; | ||
98 | |||
99 | enum omapfb_color_key_type { | ||
100 | OMAPFB_COLOR_KEY_DISABLED = 0, | ||
101 | OMAPFB_COLOR_KEY_GFX_DST, | ||
102 | OMAPFB_COLOR_KEY_VID_SRC, | ||
103 | }; | ||
104 | |||
105 | struct omapfb_color_key { | ||
106 | u8 channel_out; | ||
107 | u32 background; | ||
108 | u32 trans_key; | ||
109 | u8 key_type; | ||
110 | }; | ||
111 | |||
112 | enum omapfb_update_mode { | ||
113 | OMAPFB_UPDATE_DISABLED = 0, | ||
114 | OMAPFB_AUTO_UPDATE, | ||
115 | OMAPFB_MANUAL_UPDATE | ||
116 | }; | ||
117 | |||
118 | #ifdef __KERNEL__ | ||
119 | |||
120 | #include <linux/completion.h> | ||
121 | #include <linux/interrupt.h> | ||
122 | #include <linux/fb.h> | ||
123 | |||
124 | #define OMAP_LCDC_INV_VSYNC 0x0001 | ||
125 | #define OMAP_LCDC_INV_HSYNC 0x0002 | ||
126 | #define OMAP_LCDC_INV_PIX_CLOCK 0x0004 | ||
127 | #define OMAP_LCDC_INV_OUTPUT_EN 0x0008 | ||
128 | #define OMAP_LCDC_HSVS_RISING_EDGE 0x0010 | ||
129 | #define OMAP_LCDC_HSVS_OPPOSITE 0x0020 | ||
130 | |||
131 | #define OMAP_LCDC_SIGNAL_MASK 0x003f | ||
132 | |||
133 | #define OMAP_LCDC_PANEL_TFT 0x0100 | ||
134 | |||
135 | #ifdef CONFIG_ARCH_OMAP1 | ||
136 | #define OMAPFB_PLANE_NUM 1 | ||
137 | #else | ||
138 | #define OMAPFB_PLANE_NUM 3 | ||
139 | #endif | ||
140 | |||
141 | struct omapfb_device; | ||
142 | |||
143 | struct lcd_panel { | ||
144 | const char *name; | ||
145 | int config; /* TFT/STN, signal inversion */ | ||
146 | int bpp; /* Pixel format in fb mem */ | ||
147 | int data_lines; /* Lines on LCD HW interface */ | ||
148 | |||
149 | int x_res, y_res; | ||
150 | int pixel_clock; /* In kHz */ | ||
151 | int hsw; /* Horizontal synchronization | ||
152 | pulse width */ | ||
153 | int hfp; /* Horizontal front porch */ | ||
154 | int hbp; /* Horizontal back porch */ | ||
155 | int vsw; /* Vertical synchronization | ||
156 | pulse width */ | ||
157 | int vfp; /* Vertical front porch */ | ||
158 | int vbp; /* Vertical back porch */ | ||
159 | int acb; /* ac-bias pin frequency */ | ||
160 | int pcd; /* pixel clock divider. | ||
161 | Obsolete use pixel_clock instead */ | ||
162 | |||
163 | int (*init) (struct omapfb_device *fbdev); | ||
164 | void (*cleanup) (void); | ||
165 | int (*enable) (void); | ||
166 | void (*disable) (void); | ||
167 | unsigned long (*get_caps) (void); | ||
168 | int (*set_bklight_level)(unsigned int level); | ||
169 | unsigned int (*get_bklight_level)(void); | ||
170 | unsigned int (*get_bklight_max) (void); | ||
171 | int (*run_test) (int test_num); | ||
172 | }; | ||
173 | |||
174 | struct omapfb_device; | ||
175 | |||
176 | struct extif_timings { | ||
177 | int cs_on_time; | ||
178 | int cs_off_time; | ||
179 | int we_on_time; | ||
180 | int we_off_time; | ||
181 | int re_on_time; | ||
182 | int re_off_time; | ||
183 | int we_cycle_time; | ||
184 | int re_cycle_time; | ||
185 | int cs_pulse_width; | ||
186 | int access_time; | ||
187 | }; | ||
188 | |||
189 | struct lcd_ctrl_extif { | ||
190 | int (*init) (void); | ||
191 | void (*cleanup) (void); | ||
192 | void (*set_timings) (const struct extif_timings *timings); | ||
193 | void (*write_command) (u32 cmd); | ||
194 | u32 (*read_data) (void); | ||
195 | void (*write_data) (u32 data); | ||
196 | void (*transfer_area) (int width, int height, | ||
197 | void (callback)(void * data), void *data); | ||
198 | }; | ||
199 | |||
200 | struct lcd_ctrl { | ||
201 | const char *name; | ||
202 | void *data; | ||
203 | |||
204 | int (*init) (struct omapfb_device *fbdev, | ||
205 | int ext_mode, int req_vram_size); | ||
206 | void (*cleanup) (void); | ||
207 | void (*get_vram_layout)(unsigned long *size, | ||
208 | void **virt_base, | ||
209 | dma_addr_t *phys_base); | ||
210 | unsigned long (*get_caps) (void); | ||
211 | int (*set_update_mode)(enum omapfb_update_mode mode); | ||
212 | enum omapfb_update_mode (*get_update_mode)(void); | ||
213 | int (*setup_plane) (int plane, int channel_out, | ||
214 | unsigned long offset, | ||
215 | int screen_width, | ||
216 | int pos_x, int pos_y, int width, | ||
217 | int height, int color_mode); | ||
218 | int (*enable_plane) (int plane, int enable); | ||
219 | int (*update_window) (struct omapfb_update_window *win, | ||
220 | void (*callback)(void *), | ||
221 | void *callback_data); | ||
222 | void (*sync) (void); | ||
223 | void (*suspend) (void); | ||
224 | void (*resume) (void); | ||
225 | int (*run_test) (int test_num); | ||
226 | int (*setcolreg) (u_int regno, u16 red, u16 green, | ||
227 | u16 blue, u16 transp, | ||
228 | int update_hw_mem); | ||
229 | int (*set_color_key) (struct omapfb_color_key *ck); | ||
230 | |||
231 | }; | ||
232 | |||
233 | enum omapfb_state { | ||
234 | OMAPFB_DISABLED = 0, | ||
235 | OMAPFB_SUSPENDED= 99, | ||
236 | OMAPFB_ACTIVE = 100 | ||
237 | }; | ||
238 | |||
239 | struct omapfb_device { | ||
240 | int state; | ||
241 | int ext_lcdc; /* Using external | ||
242 | LCD controller */ | ||
243 | struct semaphore rqueue_sema; | ||
244 | |||
245 | void *vram_virt_base; | ||
246 | dma_addr_t vram_phys_base; | ||
247 | unsigned long vram_size; | ||
248 | |||
249 | int color_mode; | ||
250 | int palette_size; | ||
251 | int mirror; | ||
252 | u32 pseudo_palette[17]; | ||
253 | |||
254 | struct lcd_panel *panel; /* LCD panel */ | ||
255 | struct lcd_ctrl *ctrl; /* LCD controller */ | ||
256 | struct lcd_ctrl *int_ctrl; /* internal LCD ctrl */ | ||
257 | struct lcd_ctrl_extif *ext_if; /* LCD ctrl external | ||
258 | interface */ | ||
259 | struct fb_info *fb_info; | ||
260 | |||
261 | struct device *dev; | ||
262 | }; | ||
263 | |||
264 | extern struct lcd_panel h3_panel; | ||
265 | extern struct lcd_panel h2_panel; | ||
266 | extern struct lcd_panel p2_panel; | ||
267 | extern struct lcd_panel osk_panel; | ||
268 | extern struct lcd_panel innovator1610_panel; | ||
269 | extern struct lcd_panel innovator1510_panel; | ||
270 | |||
271 | #ifdef CONFIG_ARCH_OMAP1 | ||
272 | extern struct lcd_ctrl omap1_lcd_ctrl; | ||
273 | #else | ||
274 | extern struct lcd_ctrl omap2_disp_ctrl; | ||
275 | #endif | ||
276 | |||
277 | extern void omapfb_write_first_pixel(struct omapfb_device *fbdev, u16 pixval); | ||
278 | |||
279 | #endif /* __KERNEL__ */ | ||
280 | |||
281 | #endif /* __OMAPFB_H */ | ||
diff --git a/include/asm-arm/arch-omap/pm.h b/include/asm-arm/arch-omap/pm.h index fbd742d0c499..7c790425e363 100644 --- a/include/asm-arm/arch-omap/pm.h +++ b/include/asm-arm/arch-omap/pm.h | |||
@@ -98,7 +98,14 @@ | |||
98 | #define OMAP1610_IDLECT3 0xfffece24 | 98 | #define OMAP1610_IDLECT3 0xfffece24 |
99 | #define OMAP1610_IDLE_LOOP_REQUEST 0x0400 | 99 | #define OMAP1610_IDLE_LOOP_REQUEST 0x0400 |
100 | 100 | ||
101 | #if !defined(CONFIG_ARCH_OMAP1510) && \ | 101 | #define OMAP730_IDLECT1_SLEEP_VAL 0x16c7 |
102 | #define OMAP730_IDLECT2_SLEEP_VAL 0x09c7 | ||
103 | #define OMAP730_IDLECT3_VAL 0x3f | ||
104 | #define OMAP730_IDLECT3 0xfffece24 | ||
105 | #define OMAP730_IDLE_LOOP_REQUEST 0x0C00 | ||
106 | |||
107 | #if !defined(CONFIG_ARCH_OMAP730) && \ | ||
108 | !defined(CONFIG_ARCH_OMAP15XX) && \ | ||
102 | !defined(CONFIG_ARCH_OMAP16XX) && \ | 109 | !defined(CONFIG_ARCH_OMAP16XX) && \ |
103 | !defined(CONFIG_ARCH_OMAP24XX) | 110 | !defined(CONFIG_ARCH_OMAP24XX) |
104 | #error "Power management for this processor not implemented yet" | 111 | #error "Power management for this processor not implemented yet" |
@@ -107,8 +114,10 @@ | |||
107 | #ifndef __ASSEMBLER__ | 114 | #ifndef __ASSEMBLER__ |
108 | extern void omap_pm_idle(void); | 115 | extern void omap_pm_idle(void); |
109 | extern void omap_pm_suspend(void); | 116 | extern void omap_pm_suspend(void); |
117 | extern void omap730_cpu_suspend(unsigned short, unsigned short); | ||
110 | extern void omap1510_cpu_suspend(unsigned short, unsigned short); | 118 | extern void omap1510_cpu_suspend(unsigned short, unsigned short); |
111 | extern void omap1610_cpu_suspend(unsigned short, unsigned short); | 119 | extern void omap1610_cpu_suspend(unsigned short, unsigned short); |
120 | extern void omap730_idle_loop_suspend(void); | ||
112 | extern void omap1510_idle_loop_suspend(void); | 121 | extern void omap1510_idle_loop_suspend(void); |
113 | extern void omap1610_idle_loop_suspend(void); | 122 | extern void omap1610_idle_loop_suspend(void); |
114 | 123 | ||
@@ -118,6 +127,8 @@ extern void omap_serial_wake_trigger(int enable); | |||
118 | #define omap_serial_wake_trigger(x) {} | 127 | #define omap_serial_wake_trigger(x) {} |
119 | #endif /* CONFIG_OMAP_SERIAL_WAKE */ | 128 | #endif /* CONFIG_OMAP_SERIAL_WAKE */ |
120 | 129 | ||
130 | extern unsigned int omap730_cpu_suspend_sz; | ||
131 | extern unsigned int omap730_idle_loop_suspend_sz; | ||
121 | extern unsigned int omap1510_cpu_suspend_sz; | 132 | extern unsigned int omap1510_cpu_suspend_sz; |
122 | extern unsigned int omap1510_idle_loop_suspend_sz; | 133 | extern unsigned int omap1510_idle_loop_suspend_sz; |
123 | extern unsigned int omap1610_cpu_suspend_sz; | 134 | extern unsigned int omap1610_cpu_suspend_sz; |
@@ -131,6 +142,10 @@ extern unsigned int omap1610_idle_loop_suspend_sz; | |||
131 | #define ULPD_RESTORE(x) omap_writew((ulpd_sleep_save[ULPD_SLEEP_SAVE_##x]), (x)) | 142 | #define ULPD_RESTORE(x) omap_writew((ulpd_sleep_save[ULPD_SLEEP_SAVE_##x]), (x)) |
132 | #define ULPD_SHOW(x) ulpd_sleep_save[ULPD_SLEEP_SAVE_##x] | 143 | #define ULPD_SHOW(x) ulpd_sleep_save[ULPD_SLEEP_SAVE_##x] |
133 | 144 | ||
145 | #define MPUI730_SAVE(x) mpui730_sleep_save[MPUI730_SLEEP_SAVE_##x] = omap_readl(x) | ||
146 | #define MPUI730_RESTORE(x) omap_writel((mpui730_sleep_save[MPUI730_SLEEP_SAVE_##x]), (x)) | ||
147 | #define MPUI730_SHOW(x) mpui730_sleep_save[MPUI730_SLEEP_SAVE_##x] | ||
148 | |||
134 | #define MPUI1510_SAVE(x) mpui1510_sleep_save[MPUI1510_SLEEP_SAVE_##x] = omap_readl(x) | 149 | #define MPUI1510_SAVE(x) mpui1510_sleep_save[MPUI1510_SLEEP_SAVE_##x] = omap_readl(x) |
135 | #define MPUI1510_RESTORE(x) omap_writel((mpui1510_sleep_save[MPUI1510_SLEEP_SAVE_##x]), (x)) | 150 | #define MPUI1510_RESTORE(x) omap_writel((mpui1510_sleep_save[MPUI1510_SLEEP_SAVE_##x]), (x)) |
136 | #define MPUI1510_SHOW(x) mpui1510_sleep_save[MPUI1510_SLEEP_SAVE_##x] | 151 | #define MPUI1510_SHOW(x) mpui1510_sleep_save[MPUI1510_SLEEP_SAVE_##x] |
@@ -188,13 +203,34 @@ enum mpui1510_save_state { | |||
188 | MPUI1510_SLEEP_SAVE_EMIFS_CONFIG, | 203 | MPUI1510_SLEEP_SAVE_EMIFS_CONFIG, |
189 | MPUI1510_SLEEP_SAVE_OMAP_IH1_MIR, | 204 | MPUI1510_SLEEP_SAVE_OMAP_IH1_MIR, |
190 | MPUI1510_SLEEP_SAVE_OMAP_IH2_MIR, | 205 | MPUI1510_SLEEP_SAVE_OMAP_IH2_MIR, |
191 | #if defined(CONFIG_ARCH_OMAP1510) | 206 | #if defined(CONFIG_ARCH_OMAP15XX) |
192 | MPUI1510_SLEEP_SAVE_SIZE | 207 | MPUI1510_SLEEP_SAVE_SIZE |
193 | #else | 208 | #else |
194 | MPUI1510_SLEEP_SAVE_SIZE = 0 | 209 | MPUI1510_SLEEP_SAVE_SIZE = 0 |
195 | #endif | 210 | #endif |
196 | }; | 211 | }; |
197 | 212 | ||
213 | enum mpui730_save_state { | ||
214 | MPUI730_SLEEP_SAVE_START = 0, | ||
215 | /* | ||
216 | * MPUI registers 32 bits | ||
217 | */ | ||
218 | MPUI730_SLEEP_SAVE_MPUI_CTRL, | ||
219 | MPUI730_SLEEP_SAVE_MPUI_DSP_BOOT_CONFIG, | ||
220 | MPUI730_SLEEP_SAVE_MPUI_DSP_API_CONFIG, | ||
221 | MPUI730_SLEEP_SAVE_MPUI_DSP_STATUS, | ||
222 | MPUI730_SLEEP_SAVE_EMIFF_SDRAM_CONFIG, | ||
223 | MPUI730_SLEEP_SAVE_EMIFS_CONFIG, | ||
224 | MPUI730_SLEEP_SAVE_OMAP_IH1_MIR, | ||
225 | MPUI730_SLEEP_SAVE_OMAP_IH2_0_MIR, | ||
226 | MPUI730_SLEEP_SAVE_OMAP_IH2_1_MIR, | ||
227 | #if defined(CONFIG_ARCH_OMAP730) | ||
228 | MPUI730_SLEEP_SAVE_SIZE | ||
229 | #else | ||
230 | MPUI730_SLEEP_SAVE_SIZE = 0 | ||
231 | #endif | ||
232 | }; | ||
233 | |||
198 | enum mpui1610_save_state { | 234 | enum mpui1610_save_state { |
199 | MPUI1610_SLEEP_SAVE_START = 0, | 235 | MPUI1610_SLEEP_SAVE_START = 0, |
200 | /* | 236 | /* |
diff --git a/include/asm-arm/arch-omap/prcm.h b/include/asm-arm/arch-omap/prcm.h new file mode 100644 index 000000000000..7b48a5cbb15f --- /dev/null +++ b/include/asm-arm/arch-omap/prcm.h | |||
@@ -0,0 +1,429 @@ | |||
1 | /* | ||
2 | * prcm.h - Access definations for use in OMAP24XX clock and power management | ||
3 | * | ||
4 | * Copyright (C) 2005 Texas Instruments, Inc. | ||
5 | * | ||
6 | * 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 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | |||
21 | #ifndef __ASM_ARM_ARCH_DPM_PRCM_H | ||
22 | #define __ASM_ARM_ARCH_DPM_PRCM_H | ||
23 | |||
24 | /* SET_PERFORMANCE_LEVEL PARAMETERS */ | ||
25 | #define PRCM_HALF_SPEED 1 | ||
26 | #define PRCM_FULL_SPEED 2 | ||
27 | |||
28 | #ifndef __ASSEMBLER__ | ||
29 | |||
30 | #define PRCM_REG32(offset) __REG32(OMAP24XX_PRCM_BASE + (offset)) | ||
31 | |||
32 | #define PRCM_REVISION PRCM_REG32(0x000) | ||
33 | #define PRCM_SYSCONFIG PRCM_REG32(0x010) | ||
34 | #define PRCM_IRQSTATUS_MPU PRCM_REG32(0x018) | ||
35 | #define PRCM_IRQENABLE_MPU PRCM_REG32(0x01C) | ||
36 | #define PRCM_VOLTCTRL PRCM_REG32(0x050) | ||
37 | #define PRCM_VOLTST PRCM_REG32(0x054) | ||
38 | #define PRCM_CLKSRC_CTRL PRCM_REG32(0x060) | ||
39 | #define PRCM_CLKOUT_CTRL PRCM_REG32(0x070) | ||
40 | #define PRCM_CLKEMUL_CTRL PRCM_REG32(0x078) | ||
41 | #define PRCM_CLKCFG_CTRL PRCM_REG32(0x080) | ||
42 | #define PRCM_CLKCFG_STATUS PRCM_REG32(0x084) | ||
43 | #define PRCM_VOLTSETUP PRCM_REG32(0x090) | ||
44 | #define PRCM_CLKSSETUP PRCM_REG32(0x094) | ||
45 | #define PRCM_POLCTRL PRCM_REG32(0x098) | ||
46 | |||
47 | /* GENERAL PURPOSE */ | ||
48 | #define GENERAL_PURPOSE1 PRCM_REG32(0x0B0) | ||
49 | #define GENERAL_PURPOSE2 PRCM_REG32(0x0B4) | ||
50 | #define GENERAL_PURPOSE3 PRCM_REG32(0x0B8) | ||
51 | #define GENERAL_PURPOSE4 PRCM_REG32(0x0BC) | ||
52 | #define GENERAL_PURPOSE5 PRCM_REG32(0x0C0) | ||
53 | #define GENERAL_PURPOSE6 PRCM_REG32(0x0C4) | ||
54 | #define GENERAL_PURPOSE7 PRCM_REG32(0x0C8) | ||
55 | #define GENERAL_PURPOSE8 PRCM_REG32(0x0CC) | ||
56 | #define GENERAL_PURPOSE9 PRCM_REG32(0x0D0) | ||
57 | #define GENERAL_PURPOSE10 PRCM_REG32(0x0D4) | ||
58 | #define GENERAL_PURPOSE11 PRCM_REG32(0x0D8) | ||
59 | #define GENERAL_PURPOSE12 PRCM_REG32(0x0DC) | ||
60 | #define GENERAL_PURPOSE13 PRCM_REG32(0x0E0) | ||
61 | #define GENERAL_PURPOSE14 PRCM_REG32(0x0E4) | ||
62 | #define GENERAL_PURPOSE15 PRCM_REG32(0x0E8) | ||
63 | #define GENERAL_PURPOSE16 PRCM_REG32(0x0EC) | ||
64 | #define GENERAL_PURPOSE17 PRCM_REG32(0x0F0) | ||
65 | #define GENERAL_PURPOSE18 PRCM_REG32(0x0F4) | ||
66 | #define GENERAL_PURPOSE19 PRCM_REG32(0x0F8) | ||
67 | #define GENERAL_PURPOSE20 PRCM_REG32(0x0FC) | ||
68 | |||
69 | /* MPU */ | ||
70 | #define CM_CLKSEL_MPU PRCM_REG32(0x140) | ||
71 | #define CM_CLKSTCTRL_MPU PRCM_REG32(0x148) | ||
72 | #define RM_RSTST_MPU PRCM_REG32(0x158) | ||
73 | #define PM_WKDEP_MPU PRCM_REG32(0x1C8) | ||
74 | #define PM_EVGENCTRL_MPU PRCM_REG32(0x1D4) | ||
75 | #define PM_EVEGENONTIM_MPU PRCM_REG32(0x1D8) | ||
76 | #define PM_EVEGENOFFTIM_MPU PRCM_REG32(0x1DC) | ||
77 | #define PM_PWSTCTRL_MPU PRCM_REG32(0x1E0) | ||
78 | #define PM_PWSTST_MPU PRCM_REG32(0x1E4) | ||
79 | |||
80 | /* CORE */ | ||
81 | #define CM_FCLKEN1_CORE PRCM_REG32(0x200) | ||
82 | #define CM_FCLKEN2_CORE PRCM_REG32(0x204) | ||
83 | #define CM_FCLKEN3_CORE PRCM_REG32(0x208) | ||
84 | #define CM_ICLKEN1_CORE PRCM_REG32(0x210) | ||
85 | #define CM_ICLKEN2_CORE PRCM_REG32(0x214) | ||
86 | #define CM_ICLKEN3_CORE PRCM_REG32(0x218) | ||
87 | #define CM_ICLKEN4_CORE PRCM_REG32(0x21C) | ||
88 | #define CM_IDLEST1_CORE PRCM_REG32(0x220) | ||
89 | #define CM_IDLEST2_CORE PRCM_REG32(0x224) | ||
90 | #define CM_IDLEST3_CORE PRCM_REG32(0x228) | ||
91 | #define CM_IDLEST4_CORE PRCM_REG32(0x22C) | ||
92 | #define CM_AUTOIDLE1_CORE PRCM_REG32(0x230) | ||
93 | #define CM_AUTOIDLE2_CORE PRCM_REG32(0x234) | ||
94 | #define CM_AUTOIDLE3_CORE PRCM_REG32(0x238) | ||
95 | #define CM_AUTOIDLE4_CORE PRCM_REG32(0x23C) | ||
96 | #define CM_CLKSEL1_CORE PRCM_REG32(0x240) | ||
97 | #define CM_CLKSEL2_CORE PRCM_REG32(0x244) | ||
98 | #define CM_CLKSTCTRL_CORE PRCM_REG32(0x248) | ||
99 | #define PM_WKEN1_CORE PRCM_REG32(0x2A0) | ||
100 | #define PM_WKEN2_CORE PRCM_REG32(0x2A4) | ||
101 | #define PM_WKST1_CORE PRCM_REG32(0x2B0) | ||
102 | #define PM_WKST2_CORE PRCM_REG32(0x2B4) | ||
103 | #define PM_WKDEP_CORE PRCM_REG32(0x2C8) | ||
104 | #define PM_PWSTCTRL_CORE PRCM_REG32(0x2E0) | ||
105 | #define PM_PWSTST_CORE PRCM_REG32(0x2E4) | ||
106 | |||
107 | /* GFX */ | ||
108 | #define CM_FCLKEN_GFX PRCM_REG32(0x300) | ||
109 | #define CM_ICLKEN_GFX PRCM_REG32(0x310) | ||
110 | #define CM_IDLEST_GFX PRCM_REG32(0x320) | ||
111 | #define CM_CLKSEL_GFX PRCM_REG32(0x340) | ||
112 | #define CM_CLKSTCTRL_GFX PRCM_REG32(0x348) | ||
113 | #define RM_RSTCTRL_GFX PRCM_REG32(0x350) | ||
114 | #define RM_RSTST_GFX PRCM_REG32(0x358) | ||
115 | #define PM_WKDEP_GFX PRCM_REG32(0x3C8) | ||
116 | #define PM_PWSTCTRL_GFX PRCM_REG32(0x3E0) | ||
117 | #define PM_PWSTST_GFX PRCM_REG32(0x3E4) | ||
118 | |||
119 | /* WAKE-UP */ | ||
120 | #define CM_FCLKEN_WKUP PRCM_REG32(0x400) | ||
121 | #define CM_ICLKEN_WKUP PRCM_REG32(0x410) | ||
122 | #define CM_IDLEST_WKUP PRCM_REG32(0x420) | ||
123 | #define CM_AUTOIDLE_WKUP PRCM_REG32(0x430) | ||
124 | #define CM_CLKSEL_WKUP PRCM_REG32(0x440) | ||
125 | #define RM_RSTCTRL_WKUP PRCM_REG32(0x450) | ||
126 | #define RM_RSTTIME_WKUP PRCM_REG32(0x454) | ||
127 | #define RM_RSTST_WKUP PRCM_REG32(0x458) | ||
128 | #define PM_WKEN_WKUP PRCM_REG32(0x4A0) | ||
129 | #define PM_WKST_WKUP PRCM_REG32(0x4B0) | ||
130 | |||
131 | /* CLOCKS */ | ||
132 | #define CM_CLKEN_PLL PRCM_REG32(0x500) | ||
133 | #define CM_IDLEST_CKGEN PRCM_REG32(0x520) | ||
134 | #define CM_AUTOIDLE_PLL PRCM_REG32(0x530) | ||
135 | #define CM_CLKSEL1_PLL PRCM_REG32(0x540) | ||
136 | #define CM_CLKSEL2_PLL PRCM_REG32(0x544) | ||
137 | |||
138 | /* DSP */ | ||
139 | #define CM_FCLKEN_DSP PRCM_REG32(0x800) | ||
140 | #define CM_ICLKEN_DSP PRCM_REG32(0x810) | ||
141 | #define CM_IDLEST_DSP PRCM_REG32(0x820) | ||
142 | #define CM_AUTOIDLE_DSP PRCM_REG32(0x830) | ||
143 | #define CM_CLKSEL_DSP PRCM_REG32(0x840) | ||
144 | #define CM_CLKSTCTRL_DSP PRCM_REG32(0x848) | ||
145 | #define RM_RSTCTRL_DSP PRCM_REG32(0x850) | ||
146 | #define RM_RSTST_DSP PRCM_REG32(0x858) | ||
147 | #define PM_WKEN_DSP PRCM_REG32(0x8A0) | ||
148 | #define PM_WKDEP_DSP PRCM_REG32(0x8C8) | ||
149 | #define PM_PWSTCTRL_DSP PRCM_REG32(0x8E0) | ||
150 | #define PM_PWSTST_DSP PRCM_REG32(0x8E4) | ||
151 | #define PRCM_IRQSTATUS_DSP PRCM_REG32(0x8F0) | ||
152 | #define PRCM_IRQENABLE_DSP PRCM_REG32(0x8F4) | ||
153 | |||
154 | /* IVA */ | ||
155 | #define PRCM_IRQSTATUS_IVA PRCM_REG32(0x8F8) | ||
156 | #define PRCM_IRQENABLE_IVA PRCM_REG32(0x8FC) | ||
157 | |||
158 | /* Modem on 2430 */ | ||
159 | #define CM_FCLKEN_MDM PRCM_REG32(0xC00) | ||
160 | #define CM_ICLKEN_MDM PRCM_REG32(0xC10) | ||
161 | #define CM_IDLEST_MDM PRCM_REG32(0xC20) | ||
162 | #define CM_CLKSEL_MDM PRCM_REG32(0xC40) | ||
163 | |||
164 | /* FIXME: Move to header for 2430 */ | ||
165 | #define DISP_BASE (OMAP24XX_L4_IO_BASE+0x50000) | ||
166 | #define DISP_REG32(offset) __REG32(DISP_BASE + (offset)) | ||
167 | |||
168 | #define OMAP24XX_GPMC_BASE (L3_24XX_BASE + 0xa000) | ||
169 | #define GPMC_BASE (OMAP24XX_GPMC_BASE) | ||
170 | #define GPMC_REG32(offset) __REG32(GPMC_BASE + (offset)) | ||
171 | |||
172 | #define GPT1_BASE (OMAP24XX_GPT1) | ||
173 | #define GPT1_REG32(offset) __REG32(GPT1_BASE + (offset)) | ||
174 | |||
175 | /* Misc sysconfig */ | ||
176 | #define DISPC_SYSCONFIG DISP_REG32(0x410) | ||
177 | #define SPI_BASE (OMAP24XX_L4_IO_BASE+0x98000) | ||
178 | #define MCSPI1_SYSCONFIG __REG32(SPI_BASE + 0x10) | ||
179 | #define MCSPI2_SYSCONFIG __REG32(SPI_BASE+0x2000 + 0x10) | ||
180 | |||
181 | //#define DSP_MMU_SYSCONFIG 0x5A000010 | ||
182 | #define CAMERA_MMU_SYSCONFIG __REG32(DISP_BASE+0x2C10) | ||
183 | //#define IVA_MMU_SYSCONFIG 0x5D000010 | ||
184 | //#define DSP_DMA_SYSCONFIG 0x00FCC02C | ||
185 | #define CAMERA_DMA_SYSCONFIG __REG32(DISP_BASE+0x282C) | ||
186 | #define SYSTEM_DMA_SYSCONFIG __REG32(DISP_BASE+0x602C) | ||
187 | #define GPMC_SYSCONFIG GPMC_REG32(0x010) | ||
188 | #define MAILBOXES_SYSCONFIG __REG32(OMAP24XX_L4_IO_BASE+0x94010) | ||
189 | #define UART1_SYSCONFIG __REG32(OMAP24XX_L4_IO_BASE+0x6A054) | ||
190 | #define UART2_SYSCONFIG __REG32(OMAP24XX_L4_IO_BASE+0x6C054) | ||
191 | #define UART3_SYSCONFIG __REG32(OMAP24XX_L4_IO_BASE+0x6E054) | ||
192 | //#define IVA_SYSCONFIG 0x5C060010 | ||
193 | #define SDRC_SYSCONFIG __REG32(OMAP24XX_SDRC_BASE+0x10) | ||
194 | #define SMS_SYSCONFIG __REG32(OMAP24XX_SMS_BASE+0x10) | ||
195 | #define SSI_SYSCONFIG __REG32(DISP_BASE+0x8010) | ||
196 | //#define VLYNQ_SYSCONFIG 0x67FFFE10 | ||
197 | |||
198 | /* rkw - good cannidates for PM_ to start what nm was trying */ | ||
199 | #define OMAP24XX_GPT2 (OMAP24XX_L4_IO_BASE+0x2A000) | ||
200 | #define OMAP24XX_GPT3 (OMAP24XX_L4_IO_BASE+0x78000) | ||
201 | #define OMAP24XX_GPT4 (OMAP24XX_L4_IO_BASE+0x7A000) | ||
202 | #define OMAP24XX_GPT5 (OMAP24XX_L4_IO_BASE+0x7C000) | ||
203 | #define OMAP24XX_GPT6 (OMAP24XX_L4_IO_BASE+0x7E000) | ||
204 | #define OMAP24XX_GPT7 (OMAP24XX_L4_IO_BASE+0x80000) | ||
205 | #define OMAP24XX_GPT8 (OMAP24XX_L4_IO_BASE+0x82000) | ||
206 | #define OMAP24XX_GPT9 (OMAP24XX_L4_IO_BASE+0x84000) | ||
207 | #define OMAP24XX_GPT10 (OMAP24XX_L4_IO_BASE+0x86000) | ||
208 | #define OMAP24XX_GPT11 (OMAP24XX_L4_IO_BASE+0x88000) | ||
209 | #define OMAP24XX_GPT12 (OMAP24XX_L4_IO_BASE+0x8A000) | ||
210 | |||
211 | #define GPTIMER1_SYSCONFIG GPT1_REG32(0x010) | ||
212 | #define GPTIMER2_SYSCONFIG __REG32(OMAP24XX_GPT2 + 0x10) | ||
213 | #define GPTIMER3_SYSCONFIG __REG32(OMAP24XX_GPT3 + 0x10) | ||
214 | #define GPTIMER4_SYSCONFIG __REG32(OMAP24XX_GPT4 + 0x10) | ||
215 | #define GPTIMER5_SYSCONFIG __REG32(OMAP24XX_GPT5 + 0x10) | ||
216 | #define GPTIMER6_SYSCONFIG __REG32(OMAP24XX_GPT6 + 0x10) | ||
217 | #define GPTIMER7_SYSCONFIG __REG32(OMAP24XX_GPT7 + 0x10) | ||
218 | #define GPTIMER8_SYSCONFIG __REG32(OMAP24XX_GPT8 + 0x10) | ||
219 | #define GPTIMER9_SYSCONFIG __REG32(OMAP24XX_GPT9 + 0x10) | ||
220 | #define GPTIMER10_SYSCONFIG __REG32(OMAP24XX_GPT10 + 0x10) | ||
221 | #define GPTIMER11_SYSCONFIG __REG32(OMAP24XX_GPT11 + 0x10) | ||
222 | #define GPTIMER12_SYSCONFIG __REG32(OMAP24XX_GPT12 + 0x10) | ||
223 | |||
224 | #define GPIOX_BASE(X) (OMAP24XX_GPIO_BASE+(0x2000*((X)-1))) | ||
225 | |||
226 | #define GPIO1_SYSCONFIG __REG32((GPIOX_BASE(1)+0x10)) | ||
227 | #define GPIO2_SYSCONFIG __REG32((GPIOX_BASE(2)+0x10)) | ||
228 | #define GPIO3_SYSCONFIG __REG32((GPIOX_BASE(3)+0x10)) | ||
229 | #define GPIO4_SYSCONFIG __REG32((GPIOX_BASE(4)+0x10)) | ||
230 | |||
231 | /* GP TIMER 1 */ | ||
232 | #define GPTIMER1_TISTAT GPT1_REG32(0x014) | ||
233 | #define GPTIMER1_TISR GPT1_REG32(0x018) | ||
234 | #define GPTIMER1_TIER GPT1_REG32(0x01C) | ||
235 | #define GPTIMER1_TWER GPT1_REG32(0x020) | ||
236 | #define GPTIMER1_TCLR GPT1_REG32(0x024) | ||
237 | #define GPTIMER1_TCRR GPT1_REG32(0x028) | ||
238 | #define GPTIMER1_TLDR GPT1_REG32(0x02C) | ||
239 | #define GPTIMER1_TTGR GPT1_REG32(0x030) | ||
240 | #define GPTIMER1_TWPS GPT1_REG32(0x034) | ||
241 | #define GPTIMER1_TMAR GPT1_REG32(0x038) | ||
242 | #define GPTIMER1_TCAR1 GPT1_REG32(0x03C) | ||
243 | #define GPTIMER1_TSICR GPT1_REG32(0x040) | ||
244 | #define GPTIMER1_TCAR2 GPT1_REG32(0x044) | ||
245 | |||
246 | /* rkw -- base fix up please... */ | ||
247 | #define GPTIMER3_TISR __REG32(OMAP24XX_L4_IO_BASE+0x78018) | ||
248 | |||
249 | /* SDRC */ | ||
250 | #define SDRC_DLLA_CTRL __REG32(OMAP24XX_SDRC_BASE+0x060) | ||
251 | #define SDRC_DLLA_STATUS __REG32(OMAP24XX_SDRC_BASE+0x064) | ||
252 | #define SDRC_DLLB_CTRL __REG32(OMAP24XX_SDRC_BASE+0x068) | ||
253 | #define SDRC_DLLB_STATUS __REG32(OMAP24XX_SDRC_BASE+0x06C) | ||
254 | #define SDRC_POWER __REG32(OMAP24XX_SDRC_BASE+0x070) | ||
255 | #define SDRC_MR_0 __REG32(OMAP24XX_SDRC_BASE+0x084) | ||
256 | |||
257 | /* GPIO 1 */ | ||
258 | #define GPIO1_BASE GPIOX_BASE(1) | ||
259 | #define GPIO1_REG32(offset) __REG32(GPIO1_BASE + (offset)) | ||
260 | #define GPIO1_IRQENABLE1 GPIO1_REG32(0x01C) | ||
261 | #define GPIO1_IRQSTATUS1 GPIO1_REG32(0x018) | ||
262 | #define GPIO1_IRQENABLE2 GPIO1_REG32(0x02C) | ||
263 | #define GPIO1_IRQSTATUS2 GPIO1_REG32(0x028) | ||
264 | #define GPIO1_WAKEUPENABLE GPIO1_REG32(0x020) | ||
265 | #define GPIO1_RISINGDETECT GPIO1_REG32(0x048) | ||
266 | #define GPIO1_DATAIN GPIO1_REG32(0x038) | ||
267 | #define GPIO1_OE GPIO1_REG32(0x034) | ||
268 | #define GPIO1_DATAOUT GPIO1_REG32(0x03C) | ||
269 | |||
270 | /* GPIO2 */ | ||
271 | #define GPIO2_BASE GPIOX_BASE(2) | ||
272 | #define GPIO2_REG32(offset) __REG32(GPIO2_BASE + (offset)) | ||
273 | #define GPIO2_IRQENABLE1 GPIO2_REG32(0x01C) | ||
274 | #define GPIO2_IRQSTATUS1 GPIO2_REG32(0x018) | ||
275 | #define GPIO2_IRQENABLE2 GPIO2_REG32(0x02C) | ||
276 | #define GPIO2_IRQSTATUS2 GPIO2_REG32(0x028) | ||
277 | #define GPIO2_WAKEUPENABLE GPIO2_REG32(0x020) | ||
278 | #define GPIO2_RISINGDETECT GPIO2_REG32(0x048) | ||
279 | #define GPIO2_DATAIN GPIO2_REG32(0x038) | ||
280 | #define GPIO2_OE GPIO2_REG32(0x034) | ||
281 | #define GPIO2_DATAOUT GPIO2_REG32(0x03C) | ||
282 | |||
283 | /* GPIO 3 */ | ||
284 | #define GPIO3_BASE GPIOX_BASE(3) | ||
285 | #define GPIO3_REG32(offset) __REG32(GPIO3_BASE + (offset)) | ||
286 | #define GPIO3_IRQENABLE1 GPIO3_REG32(0x01C) | ||
287 | #define GPIO3_IRQSTATUS1 GPIO3_REG32(0x018) | ||
288 | #define GPIO3_IRQENABLE2 GPIO3_REG32(0x02C) | ||
289 | #define GPIO3_IRQSTATUS2 GPIO3_REG32(0x028) | ||
290 | #define GPIO3_WAKEUPENABLE GPIO3_REG32(0x020) | ||
291 | #define GPIO3_RISINGDETECT GPIO3_REG32(0x048) | ||
292 | #define GPIO3_FALLINGDETECT GPIO3_REG32(0x04C) | ||
293 | #define GPIO3_DATAIN GPIO3_REG32(0x038) | ||
294 | #define GPIO3_OE GPIO3_REG32(0x034) | ||
295 | #define GPIO3_DATAOUT GPIO3_REG32(0x03C) | ||
296 | #define GPIO3_DEBOUNCENABLE GPIO3_REG32(0x050) | ||
297 | #define GPIO3_DEBOUNCINGTIME GPIO3_REG32(0x054) | ||
298 | |||
299 | /* GPIO 4 */ | ||
300 | #define GPIO4_BASE GPIOX_BASE(4) | ||
301 | #define GPIO4_REG32(offset) __REG32(GPIO4_BASE + (offset)) | ||
302 | #define GPIO4_IRQENABLE1 GPIO4_REG32(0x01C) | ||
303 | #define GPIO4_IRQSTATUS1 GPIO4_REG32(0x018) | ||
304 | #define GPIO4_IRQENABLE2 GPIO4_REG32(0x02C) | ||
305 | #define GPIO4_IRQSTATUS2 GPIO4_REG32(0x028) | ||
306 | #define GPIO4_WAKEUPENABLE GPIO4_REG32(0x020) | ||
307 | #define GPIO4_RISINGDETECT GPIO4_REG32(0x048) | ||
308 | #define GPIO4_FALLINGDETECT GPIO4_REG32(0x04C) | ||
309 | #define GPIO4_DATAIN GPIO4_REG32(0x038) | ||
310 | #define GPIO4_OE GPIO4_REG32(0x034) | ||
311 | #define GPIO4_DATAOUT GPIO4_REG32(0x03C) | ||
312 | #define GPIO4_DEBOUNCENABLE GPIO4_REG32(0x050) | ||
313 | #define GPIO4_DEBOUNCINGTIME GPIO4_REG32(0x054) | ||
314 | |||
315 | |||
316 | /* IO CONFIG */ | ||
317 | #define CONTROL_BASE (OMAP24XX_CTRL_BASE) | ||
318 | #define CONTROL_REG32(offset) __REG32(CONTROL_BASE + (offset)) | ||
319 | |||
320 | #define CONTROL_PADCONF_SPI1_NCS2 CONTROL_REG32(0x104) | ||
321 | #define CONTROL_PADCONF_SYS_XTALOUT CONTROL_REG32(0x134) | ||
322 | #define CONTROL_PADCONF_UART1_RX CONTROL_REG32(0x0C8) | ||
323 | #define CONTROL_PADCONF_MCBSP1_DX CONTROL_REG32(0x10C) | ||
324 | #define CONTROL_PADCONF_GPMC_NCS4 CONTROL_REG32(0x090) | ||
325 | #define CONTROL_PADCONF_DSS_D5 CONTROL_REG32(0x0B8) | ||
326 | #define CONTROL_PADCONF_DSS_D9 CONTROL_REG32(0x0BC) | ||
327 | #define CONTROL_PADCONF_DSS_D13 CONTROL_REG32(0x0C0) | ||
328 | #define CONTROL_PADCONF_DSS_VSYNC CONTROL_REG32(0x0CC) | ||
329 | |||
330 | /* CONTROL */ | ||
331 | #define CONTROL_DEVCONF CONTROL_REG32(0x274) | ||
332 | |||
333 | /* INTERRUPT CONTROLLER */ | ||
334 | #define INTC_BASE (OMAP24XX_L4_IO_BASE+0xfe000) | ||
335 | #define INTC_REG32(offset) __REG32(INTC_BASE + (offset)) | ||
336 | |||
337 | #define INTC1_U_BASE INTC_REG32(0x000) | ||
338 | #define INTC_MIR0 INTC_REG32(0x084) | ||
339 | #define INTC_MIR_SET0 INTC_REG32(0x08C) | ||
340 | #define INTC_MIR_CLEAR0 INTC_REG32(0x088) | ||
341 | #define INTC_ISR_CLEAR0 INTC_REG32(0x094) | ||
342 | #define INTC_MIR1 INTC_REG32(0x0A4) | ||
343 | #define INTC_MIR_SET1 INTC_REG32(0x0AC) | ||
344 | #define INTC_MIR_CLEAR1 INTC_REG32(0x0A8) | ||
345 | #define INTC_ISR_CLEAR1 INTC_REG32(0x0B4) | ||
346 | #define INTC_MIR2 INTC_REG32(0x0C4) | ||
347 | #define INTC_MIR_SET2 INTC_REG32(0x0CC) | ||
348 | #define INTC_MIR_CLEAR2 INTC_REG32(0x0C8) | ||
349 | #define INTC_ISR_CLEAR2 INTC_REG32(0x0D4) | ||
350 | #define INTC_SIR_IRQ INTC_REG32(0x040) | ||
351 | #define INTC_CONTROL INTC_REG32(0x048) | ||
352 | #define INTC_ILR11 INTC_REG32(0x12C) | ||
353 | #define INTC_ILR32 INTC_REG32(0x180) | ||
354 | #define INTC_ILR37 INTC_REG32(0x194) | ||
355 | #define INTC_SYSCONFIG INTC_REG32(0x010) | ||
356 | |||
357 | /* RAM FIREWALL */ | ||
358 | #define RAMFW_BASE (0x68005000) | ||
359 | #define RAMFW_REG32(offset) __REG32(RAMFW_BASE + (offset)) | ||
360 | |||
361 | #define RAMFW_REQINFOPERM0 RAMFW_REG32(0x048) | ||
362 | #define RAMFW_READPERM0 RAMFW_REG32(0x050) | ||
363 | #define RAMFW_WRITEPERM0 RAMFW_REG32(0x058) | ||
364 | |||
365 | /* GPMC CS1 FPGA ON USER INTERFACE MODULE */ | ||
366 | //#define DEBUG_BOARD_LED_REGISTER 0x04000014 | ||
367 | |||
368 | /* GPMC CS0 */ | ||
369 | #define GPMC_CONFIG1_0 GPMC_REG32(0x060) | ||
370 | #define GPMC_CONFIG2_0 GPMC_REG32(0x064) | ||
371 | #define GPMC_CONFIG3_0 GPMC_REG32(0x068) | ||
372 | #define GPMC_CONFIG4_0 GPMC_REG32(0x06C) | ||
373 | #define GPMC_CONFIG5_0 GPMC_REG32(0x070) | ||
374 | #define GPMC_CONFIG6_0 GPMC_REG32(0x074) | ||
375 | #define GPMC_CONFIG7_0 GPMC_REG32(0x078) | ||
376 | |||
377 | /* GPMC CS1 */ | ||
378 | #define GPMC_CONFIG1_1 GPMC_REG32(0x090) | ||
379 | #define GPMC_CONFIG2_1 GPMC_REG32(0x094) | ||
380 | #define GPMC_CONFIG3_1 GPMC_REG32(0x098) | ||
381 | #define GPMC_CONFIG4_1 GPMC_REG32(0x09C) | ||
382 | #define GPMC_CONFIG5_1 GPMC_REG32(0x0a0) | ||
383 | #define GPMC_CONFIG6_1 GPMC_REG32(0x0a4) | ||
384 | #define GPMC_CONFIG7_1 GPMC_REG32(0x0a8) | ||
385 | |||
386 | /* DSS */ | ||
387 | #define DSS_CONTROL DISP_REG32(0x040) | ||
388 | #define DISPC_CONTROL DISP_REG32(0x440) | ||
389 | #define DISPC_SYSSTATUS DISP_REG32(0x414) | ||
390 | #define DISPC_IRQSTATUS DISP_REG32(0x418) | ||
391 | #define DISPC_IRQENABLE DISP_REG32(0x41C) | ||
392 | #define DISPC_CONFIG DISP_REG32(0x444) | ||
393 | #define DISPC_DEFAULT_COLOR0 DISP_REG32(0x44C) | ||
394 | #define DISPC_DEFAULT_COLOR1 DISP_REG32(0x450) | ||
395 | #define DISPC_TRANS_COLOR0 DISP_REG32(0x454) | ||
396 | #define DISPC_TRANS_COLOR1 DISP_REG32(0x458) | ||
397 | #define DISPC_LINE_NUMBER DISP_REG32(0x460) | ||
398 | #define DISPC_TIMING_H DISP_REG32(0x464) | ||
399 | #define DISPC_TIMING_V DISP_REG32(0x468) | ||
400 | #define DISPC_POL_FREQ DISP_REG32(0x46C) | ||
401 | #define DISPC_DIVISOR DISP_REG32(0x470) | ||
402 | #define DISPC_SIZE_DIG DISP_REG32(0x478) | ||
403 | #define DISPC_SIZE_LCD DISP_REG32(0x47C) | ||
404 | #define DISPC_GFX_BA0 DISP_REG32(0x480) | ||
405 | #define DISPC_GFX_BA1 DISP_REG32(0x484) | ||
406 | #define DISPC_GFX_POSITION DISP_REG32(0x488) | ||
407 | #define DISPC_GFX_SIZE DISP_REG32(0x48C) | ||
408 | #define DISPC_GFX_ATTRIBUTES DISP_REG32(0x4A0) | ||
409 | #define DISPC_GFX_FIFO_THRESHOLD DISP_REG32(0x4A4) | ||
410 | #define DISPC_GFX_ROW_INC DISP_REG32(0x4AC) | ||
411 | #define DISPC_GFX_PIXEL_INC DISP_REG32(0x4B0) | ||
412 | #define DISPC_GFX_WINDOW_SKIP DISP_REG32(0x4B4) | ||
413 | #define DISPC_GFX_TABLE_BA DISP_REG32(0x4B8) | ||
414 | #define DISPC_DATA_CYCLE1 DISP_REG32(0x5D4) | ||
415 | #define DISPC_DATA_CYCLE2 DISP_REG32(0x5D8) | ||
416 | #define DISPC_DATA_CYCLE3 DISP_REG32(0x5DC) | ||
417 | |||
418 | /* Wake up define for board */ | ||
419 | #define GPIO97 (1 << 1) | ||
420 | #define GPIO88 (1 << 24) | ||
421 | |||
422 | #endif /* __ASSEMBLER__ */ | ||
423 | |||
424 | #endif | ||
425 | |||
426 | |||
427 | |||
428 | |||
429 | |||
diff --git a/include/asm-arm/arch-omap/sram.h b/include/asm-arm/arch-omap/sram.h new file mode 100644 index 000000000000..e72ccbf0fe06 --- /dev/null +++ b/include/asm-arm/arch-omap/sram.h | |||
@@ -0,0 +1,38 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-omap/sram.h | ||
3 | * | ||
4 | * Interface for functions that need to be run in internal SRAM | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __ARCH_ARM_OMAP_SRAM_H | ||
12 | #define __ARCH_ARM_OMAP_SRAM_H | ||
13 | |||
14 | extern void * omap_sram_push(void * start, unsigned long size); | ||
15 | extern void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl); | ||
16 | |||
17 | extern void omap2_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl, | ||
18 | u32 base_cs, u32 force_unlock); | ||
19 | extern void omap2_sram_reprogram_sdrc(u32 perf_level, u32 dll_val, | ||
20 | u32 mem_type); | ||
21 | extern u32 omap2_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass); | ||
22 | |||
23 | |||
24 | /* Do not use these */ | ||
25 | extern void sram_reprogram_clock(u32 ckctl, u32 dpllctl); | ||
26 | extern unsigned long sram_reprogram_clock_sz; | ||
27 | |||
28 | extern void sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl, | ||
29 | u32 base_cs, u32 force_unlock); | ||
30 | extern unsigned long sram_ddr_init_sz; | ||
31 | |||
32 | extern u32 sram_set_prcm(u32 dpll_ctrl_val, u32 sdrc_rfr_val, int bypass); | ||
33 | extern unsigned long sram_set_prcm_sz; | ||
34 | |||
35 | extern void sram_reprogram_sdrc(u32 perf_level, u32 dll_val, u32 mem_type); | ||
36 | extern unsigned long sram_reprogram_sdrc_sz; | ||
37 | |||
38 | #endif | ||
diff --git a/include/asm-arm/arch-omap/system.h b/include/asm-arm/arch-omap/system.h index ff37bc27e603..9af415d2944a 100644 --- a/include/asm-arm/arch-omap/system.h +++ b/include/asm-arm/arch-omap/system.h | |||
@@ -6,18 +6,21 @@ | |||
6 | #define __ASM_ARCH_SYSTEM_H | 6 | #define __ASM_ARCH_SYSTEM_H |
7 | #include <linux/config.h> | 7 | #include <linux/config.h> |
8 | #include <asm/mach-types.h> | 8 | #include <asm/mach-types.h> |
9 | #include <asm/arch/hardware.h> | 9 | #include <asm/hardware/clock.h> |
10 | #include <asm/mach-types.h> | 10 | #include <asm/hardware.h> |
11 | #include <asm/arch/prcm.h> | ||
12 | |||
13 | #ifndef CONFIG_MACH_VOICEBLUE | ||
14 | #define voiceblue_reset() do {} while (0) | ||
15 | #endif | ||
11 | 16 | ||
12 | static inline void arch_idle(void) | 17 | static inline void arch_idle(void) |
13 | { | 18 | { |
14 | cpu_do_idle(); | 19 | cpu_do_idle(); |
15 | } | 20 | } |
16 | 21 | ||
17 | static inline void arch_reset(char mode) | 22 | static inline void omap1_arch_reset(char mode) |
18 | { | 23 | { |
19 | |||
20 | #ifdef CONFIG_ARCH_OMAP16XX | ||
21 | /* | 24 | /* |
22 | * Workaround for 5912/1611b bug mentioned in sprz209d.pdf p. 28 | 25 | * Workaround for 5912/1611b bug mentioned in sprz209d.pdf p. 28 |
23 | * "Global Software Reset Affects Traffic Controller Frequency". | 26 | * "Global Software Reset Affects Traffic Controller Frequency". |
@@ -27,13 +30,31 @@ static inline void arch_reset(char mode) | |||
27 | DPLL_CTL); | 30 | DPLL_CTL); |
28 | omap_writew(0x8, ARM_RSTCT1); | 31 | omap_writew(0x8, ARM_RSTCT1); |
29 | } | 32 | } |
30 | #endif | 33 | |
31 | #ifdef CONFIG_MACH_VOICEBLUE | ||
32 | if (machine_is_voiceblue()) | 34 | if (machine_is_voiceblue()) |
33 | voiceblue_reset(); | 35 | voiceblue_reset(); |
34 | else | 36 | else |
35 | #endif | ||
36 | omap_writew(1, ARM_RSTCT1); | 37 | omap_writew(1, ARM_RSTCT1); |
37 | } | 38 | } |
38 | 39 | ||
40 | static inline void omap2_arch_reset(char mode) | ||
41 | { | ||
42 | u32 rate; | ||
43 | struct clk *vclk, *sclk; | ||
44 | |||
45 | vclk = clk_get(NULL, "virt_prcm_set"); | ||
46 | sclk = clk_get(NULL, "sys_ck"); | ||
47 | rate = clk_get_rate(sclk); | ||
48 | clk_set_rate(vclk, rate); /* go to bypass for OMAP limitation */ | ||
49 | RM_RSTCTRL_WKUP |= 2; | ||
50 | } | ||
51 | |||
52 | static inline void arch_reset(char mode) | ||
53 | { | ||
54 | if (!cpu_is_omap24xx()) | ||
55 | omap1_arch_reset(mode); | ||
56 | else | ||
57 | omap2_arch_reset(mode); | ||
58 | } | ||
59 | |||
39 | #endif | 60 | #endif |
diff --git a/include/asm-arm/arch-omap/timex.h b/include/asm-arm/arch-omap/timex.h index b61ddb491e83..21f2e367185a 100644 --- a/include/asm-arm/arch-omap/timex.h +++ b/include/asm-arm/arch-omap/timex.h | |||
@@ -28,6 +28,14 @@ | |||
28 | #if !defined(__ASM_ARCH_OMAP_TIMEX_H) | 28 | #if !defined(__ASM_ARCH_OMAP_TIMEX_H) |
29 | #define __ASM_ARCH_OMAP_TIMEX_H | 29 | #define __ASM_ARCH_OMAP_TIMEX_H |
30 | 30 | ||
31 | /* | ||
32 | * OMAP 32KHz timer updates time one jiffie at a time from a secondary timer, | ||
33 | * and that's why the CLOCK_TICK_RATE is not 32768. | ||
34 | */ | ||
35 | #ifdef CONFIG_OMAP_32K_TIMER | ||
36 | #define CLOCK_TICK_RATE (CONFIG_OMAP_32K_TIMER_HZ) | ||
37 | #else | ||
31 | #define CLOCK_TICK_RATE (HZ * 100000UL) | 38 | #define CLOCK_TICK_RATE (HZ * 100000UL) |
39 | #endif | ||
32 | 40 | ||
33 | #endif /* __ASM_ARCH_OMAP_TIMEX_H */ | 41 | #endif /* __ASM_ARCH_OMAP_TIMEX_H */ |
diff --git a/include/asm-arm/arch-omap/uncompress.h b/include/asm-arm/arch-omap/uncompress.h index 3545c86859cc..c718264affbd 100644 --- a/include/asm-arm/arch-omap/uncompress.h +++ b/include/asm-arm/arch-omap/uncompress.h | |||
@@ -36,10 +36,14 @@ putstr(const char *s) | |||
36 | volatile u8 * uart = 0; | 36 | volatile u8 * uart = 0; |
37 | int shift = 2; | 37 | int shift = 2; |
38 | 38 | ||
39 | #ifdef CONFIG_MACH_OMAP_PALMTE | ||
40 | return; | ||
41 | #endif | ||
42 | |||
39 | #ifdef CONFIG_ARCH_OMAP | 43 | #ifdef CONFIG_ARCH_OMAP |
40 | #ifdef CONFIG_OMAP_LL_DEBUG_UART3 | 44 | #ifdef CONFIG_OMAP_LL_DEBUG_UART3 |
41 | uart = (volatile u8 *)(OMAP_UART3_BASE); | 45 | uart = (volatile u8 *)(OMAP_UART3_BASE); |
42 | #elif CONFIG_OMAP_LL_DEBUG_UART2 | 46 | #elif defined(CONFIG_OMAP_LL_DEBUG_UART2) |
43 | uart = (volatile u8 *)(OMAP_UART2_BASE); | 47 | uart = (volatile u8 *)(OMAP_UART2_BASE); |
44 | #else | 48 | #else |
45 | uart = (volatile u8 *)(OMAP_UART1_BASE); | 49 | uart = (volatile u8 *)(OMAP_UART1_BASE); |
diff --git a/include/asm-arm/arch-pxa/akita.h b/include/asm-arm/arch-pxa/akita.h index 4a1fbcfccc39..5d8cc1d9cb10 100644 --- a/include/asm-arm/arch-pxa/akita.h +++ b/include/asm-arm/arch-pxa/akita.h | |||
@@ -25,6 +25,8 @@ | |||
25 | /* Default Values */ | 25 | /* Default Values */ |
26 | #define AKITA_IOEXP_IO_OUT (AKITA_IOEXP_IR_ON | AKITA_IOEXP_AKIN_PULLUP) | 26 | #define AKITA_IOEXP_IO_OUT (AKITA_IOEXP_IR_ON | AKITA_IOEXP_AKIN_PULLUP) |
27 | 27 | ||
28 | extern struct platform_device akitaioexp_device; | ||
29 | |||
28 | void akita_set_ioexp(struct device *dev, unsigned char bitmask); | 30 | void akita_set_ioexp(struct device *dev, unsigned char bitmask); |
29 | void akita_reset_ioexp(struct device *dev, unsigned char bitmask); | 31 | void akita_reset_ioexp(struct device *dev, unsigned char bitmask); |
30 | 32 | ||
diff --git a/include/asm-arm/arch-pxa/hardware.h b/include/asm-arm/arch-pxa/hardware.h index cf35721cfa45..3e70bd95472c 100644 --- a/include/asm-arm/arch-pxa/hardware.h +++ b/include/asm-arm/arch-pxa/hardware.h | |||
@@ -44,12 +44,12 @@ | |||
44 | 44 | ||
45 | #ifndef __ASSEMBLY__ | 45 | #ifndef __ASSEMBLY__ |
46 | 46 | ||
47 | # define __REG(x) (*((volatile unsigned long *)io_p2v(x))) | 47 | # define __REG(x) (*((volatile u32 *)io_p2v(x))) |
48 | 48 | ||
49 | /* With indexed regs we don't want to feed the index through io_p2v() | 49 | /* With indexed regs we don't want to feed the index through io_p2v() |
50 | especially if it is a variable, otherwise horrible code will result. */ | 50 | especially if it is a variable, otherwise horrible code will result. */ |
51 | # define __REG2(x,y) \ | 51 | # define __REG2(x,y) \ |
52 | (*(volatile unsigned long *)((unsigned long)&__REG(x) + (y))) | 52 | (*(volatile u32 *)((u32)&__REG(x) + (y))) |
53 | 53 | ||
54 | # define __PREG(x) (io_v2p((u32)&(x))) | 54 | # define __PREG(x) (io_v2p((u32)&(x))) |
55 | 55 | ||
diff --git a/include/asm-arm/arch-pxa/io.h b/include/asm-arm/arch-pxa/io.h index c3bdbe44e21f..eb2dd58d397f 100644 --- a/include/asm-arm/arch-pxa/io.h +++ b/include/asm-arm/arch-pxa/io.h | |||
@@ -6,6 +6,8 @@ | |||
6 | #ifndef __ASM_ARM_ARCH_IO_H | 6 | #ifndef __ASM_ARM_ARCH_IO_H |
7 | #define __ASM_ARM_ARCH_IO_H | 7 | #define __ASM_ARM_ARCH_IO_H |
8 | 8 | ||
9 | #include <asm/hardware.h> | ||
10 | |||
9 | #define IO_SPACE_LIMIT 0xffffffff | 11 | #define IO_SPACE_LIMIT 0xffffffff |
10 | 12 | ||
11 | /* | 13 | /* |
diff --git a/include/asm-arm/arch-pxa/irda.h b/include/asm-arm/arch-pxa/irda.h new file mode 100644 index 000000000000..748406f384c2 --- /dev/null +++ b/include/asm-arm/arch-pxa/irda.h | |||
@@ -0,0 +1,17 @@ | |||
1 | #ifndef ASMARM_ARCH_IRDA_H | ||
2 | #define ASMARM_ARCH_IRDA_H | ||
3 | |||
4 | /* board specific transceiver capabilities */ | ||
5 | |||
6 | #define IR_OFF 1 | ||
7 | #define IR_SIRMODE 2 | ||
8 | #define IR_FIRMODE 4 | ||
9 | |||
10 | struct pxaficp_platform_data { | ||
11 | int transceiver_cap; | ||
12 | void (*transceiver_mode)(struct device *dev, int mode); | ||
13 | }; | ||
14 | |||
15 | extern void pxa_set_ficp_info(struct pxaficp_platform_data *info); | ||
16 | |||
17 | #endif | ||
diff --git a/include/asm-arm/arch-pxa/memory.h b/include/asm-arm/arch-pxa/memory.h index 58bad9748b5c..eaf6d43939e9 100644 --- a/include/asm-arm/arch-pxa/memory.h +++ b/include/asm-arm/arch-pxa/memory.h | |||
@@ -15,7 +15,7 @@ | |||
15 | /* | 15 | /* |
16 | * Physical DRAM offset. | 16 | * Physical DRAM offset. |
17 | */ | 17 | */ |
18 | #define PHYS_OFFSET (0xa0000000UL) | 18 | #define PHYS_OFFSET UL(0xa0000000) |
19 | 19 | ||
20 | /* | 20 | /* |
21 | * Virtual view <-> DMA view memory address translations | 21 | * Virtual view <-> DMA view memory address translations |
diff --git a/include/asm-arm/arch-pxa/pm.h b/include/asm-arm/arch-pxa/pm.h new file mode 100644 index 000000000000..7a8a1cdf430d --- /dev/null +++ b/include/asm-arm/arch-pxa/pm.h | |||
@@ -0,0 +1,12 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2005 Richard Purdie | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | * | ||
8 | */ | ||
9 | |||
10 | extern int pxa_pm_prepare(suspend_state_t state); | ||
11 | extern int pxa_pm_enter(suspend_state_t state); | ||
12 | extern int pxa_pm_finish(suspend_state_t state); | ||
diff --git a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h index 939d9e5020a0..a75a2470f4f5 100644 --- a/include/asm-arm/arch-pxa/pxa-regs.h +++ b/include/asm-arm/arch-pxa/pxa-regs.h | |||
@@ -126,8 +126,8 @@ | |||
126 | #define DRCMR12 __REG(0x40000130) /* Request to Channel Map Register for AC97 audio transmit Request */ | 126 | #define DRCMR12 __REG(0x40000130) /* Request to Channel Map Register for AC97 audio transmit Request */ |
127 | #define DRCMR13 __REG(0x40000134) /* Request to Channel Map Register for SSP receive Request */ | 127 | #define DRCMR13 __REG(0x40000134) /* Request to Channel Map Register for SSP receive Request */ |
128 | #define DRCMR14 __REG(0x40000138) /* Request to Channel Map Register for SSP transmit Request */ | 128 | #define DRCMR14 __REG(0x40000138) /* Request to Channel Map Register for SSP transmit Request */ |
129 | #define DRCMR15 __REG(0x4000013c) /* Reserved */ | 129 | #define DRCMR15 __REG(0x4000013c) /* Request to Channel Map Register for SSP2 receive Request */ |
130 | #define DRCMR16 __REG(0x40000140) /* Reserved */ | 130 | #define DRCMR16 __REG(0x40000140) /* Request to Channel Map Register for SSP2 transmit Request */ |
131 | #define DRCMR17 __REG(0x40000144) /* Request to Channel Map Register for ICP receive Request */ | 131 | #define DRCMR17 __REG(0x40000144) /* Request to Channel Map Register for ICP receive Request */ |
132 | #define DRCMR18 __REG(0x40000148) /* Request to Channel Map Register for ICP transmit Request */ | 132 | #define DRCMR18 __REG(0x40000148) /* Request to Channel Map Register for ICP transmit Request */ |
133 | #define DRCMR19 __REG(0x4000014c) /* Request to Channel Map Register for STUART receive Request */ | 133 | #define DRCMR19 __REG(0x4000014c) /* Request to Channel Map Register for STUART receive Request */ |
@@ -151,7 +151,8 @@ | |||
151 | #define DRCMR37 __REG(0x40000194) /* Request to Channel Map Register for USB endpoint 13 Request */ | 151 | #define DRCMR37 __REG(0x40000194) /* Request to Channel Map Register for USB endpoint 13 Request */ |
152 | #define DRCMR38 __REG(0x40000198) /* Request to Channel Map Register for USB endpoint 14 Request */ | 152 | #define DRCMR38 __REG(0x40000198) /* Request to Channel Map Register for USB endpoint 14 Request */ |
153 | #define DRCMR39 __REG(0x4000019C) /* Reserved */ | 153 | #define DRCMR39 __REG(0x4000019C) /* Reserved */ |
154 | 154 | #define DRCMR66 __REG(0x40001108) /* Request to Channel Map Register for SSP3 receive Request */ | |
155 | #define DRCMR67 __REG(0x4000110C) /* Request to Channel Map Register for SSP3 transmit Request */ | ||
155 | #define DRCMR68 __REG(0x40001110) /* Request to Channel Map Register for Camera FIFO 0 Request */ | 156 | #define DRCMR68 __REG(0x40001110) /* Request to Channel Map Register for Camera FIFO 0 Request */ |
156 | #define DRCMR69 __REG(0x40001114) /* Request to Channel Map Register for Camera FIFO 1 Request */ | 157 | #define DRCMR69 __REG(0x40001114) /* Request to Channel Map Register for Camera FIFO 1 Request */ |
157 | #define DRCMR70 __REG(0x40001118) /* Request to Channel Map Register for Camera FIFO 2 Request */ | 158 | #define DRCMR70 __REG(0x40001118) /* Request to Channel Map Register for Camera FIFO 2 Request */ |
@@ -325,6 +326,25 @@ | |||
325 | #define STDLL __REG(0x40700000) /* Divisor Latch Low Register (DLAB = 1) (read/write) */ | 326 | #define STDLL __REG(0x40700000) /* Divisor Latch Low Register (DLAB = 1) (read/write) */ |
326 | #define STDLH __REG(0x40700004) /* Divisor Latch High Register (DLAB = 1) (read/write) */ | 327 | #define STDLH __REG(0x40700004) /* Divisor Latch High Register (DLAB = 1) (read/write) */ |
327 | 328 | ||
329 | /* Hardware UART (HWUART) */ | ||
330 | #define HWUART HWRBR | ||
331 | #define HWRBR __REG(0x41600000) /* Receive Buffer Register (read only) */ | ||
332 | #define HWTHR __REG(0x41600000) /* Transmit Holding Register (write only) */ | ||
333 | #define HWIER __REG(0x41600004) /* Interrupt Enable Register (read/write) */ | ||
334 | #define HWIIR __REG(0x41600008) /* Interrupt ID Register (read only) */ | ||
335 | #define HWFCR __REG(0x41600008) /* FIFO Control Register (write only) */ | ||
336 | #define HWLCR __REG(0x4160000C) /* Line Control Register (read/write) */ | ||
337 | #define HWMCR __REG(0x41600010) /* Modem Control Register (read/write) */ | ||
338 | #define HWLSR __REG(0x41600014) /* Line Status Register (read only) */ | ||
339 | #define HWMSR __REG(0x41600018) /* Modem Status Register (read only) */ | ||
340 | #define HWSPR __REG(0x4160001C) /* Scratch Pad Register (read/write) */ | ||
341 | #define HWISR __REG(0x41600020) /* Infrared Selection Register (read/write) */ | ||
342 | #define HWFOR __REG(0x41600024) /* Receive FIFO Occupancy Register (read only) */ | ||
343 | #define HWABR __REG(0x41600028) /* Auto-Baud Control Register (read/write) */ | ||
344 | #define HWACR __REG(0x4160002C) /* Auto-Baud Count Register (read only) */ | ||
345 | #define HWDLL __REG(0x41600000) /* Divisor Latch Low Register (DLAB = 1) (read/write) */ | ||
346 | #define HWDLH __REG(0x41600004) /* Divisor Latch High Register (DLAB = 1) (read/write) */ | ||
347 | |||
328 | #define IER_DMAE (1 << 7) /* DMA Requests Enable */ | 348 | #define IER_DMAE (1 << 7) /* DMA Requests Enable */ |
329 | #define IER_UUE (1 << 6) /* UART Unit Enable */ | 349 | #define IER_UUE (1 << 6) /* UART Unit Enable */ |
330 | #define IER_NRZE (1 << 5) /* NRZ coding Enable */ | 350 | #define IER_NRZE (1 << 5) /* NRZ coding Enable */ |
@@ -652,7 +672,7 @@ | |||
652 | 672 | ||
653 | #define UDCCS_IO_RFS (1 << 0) /* Receive FIFO service */ | 673 | #define UDCCS_IO_RFS (1 << 0) /* Receive FIFO service */ |
654 | #define UDCCS_IO_RPC (1 << 1) /* Receive packet complete */ | 674 | #define UDCCS_IO_RPC (1 << 1) /* Receive packet complete */ |
655 | #define UDCCS_IO_ROF (1 << 3) /* Receive overflow */ | 675 | #define UDCCS_IO_ROF (1 << 2) /* Receive overflow */ |
656 | #define UDCCS_IO_DME (1 << 3) /* DMA enable */ | 676 | #define UDCCS_IO_DME (1 << 3) /* DMA enable */ |
657 | #define UDCCS_IO_RNE (1 << 6) /* Receive FIFO not empty */ | 677 | #define UDCCS_IO_RNE (1 << 6) /* Receive FIFO not empty */ |
658 | #define UDCCS_IO_RSP (1 << 7) /* Receive short packet */ | 678 | #define UDCCS_IO_RSP (1 << 7) /* Receive short packet */ |
@@ -1012,14 +1032,12 @@ | |||
1012 | #define ICCR0_LBM (1 << 1) /* Loopback mode */ | 1032 | #define ICCR0_LBM (1 << 1) /* Loopback mode */ |
1013 | #define ICCR0_ITR (1 << 0) /* IrDA transmission */ | 1033 | #define ICCR0_ITR (1 << 0) /* IrDA transmission */ |
1014 | 1034 | ||
1015 | #ifdef CONFIG_PXA27x | ||
1016 | #define ICCR2_RXP (1 << 3) /* Receive Pin Polarity select */ | 1035 | #define ICCR2_RXP (1 << 3) /* Receive Pin Polarity select */ |
1017 | #define ICCR2_TXP (1 << 2) /* Transmit Pin Polarity select */ | 1036 | #define ICCR2_TXP (1 << 2) /* Transmit Pin Polarity select */ |
1018 | #define ICCR2_TRIG (3 << 0) /* Receive FIFO Trigger threshold */ | 1037 | #define ICCR2_TRIG (3 << 0) /* Receive FIFO Trigger threshold */ |
1019 | #define ICCR2_TRIG_8 (0 << 0) /* >= 8 bytes */ | 1038 | #define ICCR2_TRIG_8 (0 << 0) /* >= 8 bytes */ |
1020 | #define ICCR2_TRIG_16 (1 << 0) /* >= 16 bytes */ | 1039 | #define ICCR2_TRIG_16 (1 << 0) /* >= 16 bytes */ |
1021 | #define ICCR2_TRIG_32 (2 << 0) /* >= 32 bytes */ | 1040 | #define ICCR2_TRIG_32 (2 << 0) /* >= 32 bytes */ |
1022 | #endif | ||
1023 | 1041 | ||
1024 | #ifdef CONFIG_PXA27x | 1042 | #ifdef CONFIG_PXA27x |
1025 | #define ICSR0_EOC (1 << 6) /* DMA End of Descriptor Chain */ | 1043 | #define ICSR0_EOC (1 << 6) /* DMA End of Descriptor Chain */ |
@@ -1249,9 +1267,13 @@ | |||
1249 | #define GPIO40_FFDTR 40 /* FFUART data terminal Ready */ | 1267 | #define GPIO40_FFDTR 40 /* FFUART data terminal Ready */ |
1250 | #define GPIO41_FFRTS 41 /* FFUART request to send */ | 1268 | #define GPIO41_FFRTS 41 /* FFUART request to send */ |
1251 | #define GPIO42_BTRXD 42 /* BTUART receive data */ | 1269 | #define GPIO42_BTRXD 42 /* BTUART receive data */ |
1270 | #define GPIO42_HWRXD 42 /* HWUART receive data */ | ||
1252 | #define GPIO43_BTTXD 43 /* BTUART transmit data */ | 1271 | #define GPIO43_BTTXD 43 /* BTUART transmit data */ |
1272 | #define GPIO43_HWTXD 43 /* HWUART transmit data */ | ||
1253 | #define GPIO44_BTCTS 44 /* BTUART clear to send */ | 1273 | #define GPIO44_BTCTS 44 /* BTUART clear to send */ |
1274 | #define GPIO44_HWCTS 44 /* HWUART clear to send */ | ||
1254 | #define GPIO45_BTRTS 45 /* BTUART request to send */ | 1275 | #define GPIO45_BTRTS 45 /* BTUART request to send */ |
1276 | #define GPIO45_HWRTS 45 /* HWUART request to send */ | ||
1255 | #define GPIO45_AC97_SYSCLK 45 /* AC97 System Clock */ | 1277 | #define GPIO45_AC97_SYSCLK 45 /* AC97 System Clock */ |
1256 | #define GPIO46_ICPRXD 46 /* ICP receive data */ | 1278 | #define GPIO46_ICPRXD 46 /* ICP receive data */ |
1257 | #define GPIO46_STRXD 46 /* STD_UART receive data */ | 1279 | #define GPIO46_STRXD 46 /* STD_UART receive data */ |
@@ -1377,17 +1399,26 @@ | |||
1377 | #define GPIO40_FFDTR_MD (40 | GPIO_ALT_FN_2_OUT) | 1399 | #define GPIO40_FFDTR_MD (40 | GPIO_ALT_FN_2_OUT) |
1378 | #define GPIO41_FFRTS_MD (41 | GPIO_ALT_FN_2_OUT) | 1400 | #define GPIO41_FFRTS_MD (41 | GPIO_ALT_FN_2_OUT) |
1379 | #define GPIO42_BTRXD_MD (42 | GPIO_ALT_FN_1_IN) | 1401 | #define GPIO42_BTRXD_MD (42 | GPIO_ALT_FN_1_IN) |
1402 | #define GPIO42_HWRXD_MD (42 | GPIO_ALT_FN_3_IN) | ||
1380 | #define GPIO43_BTTXD_MD (43 | GPIO_ALT_FN_2_OUT) | 1403 | #define GPIO43_BTTXD_MD (43 | GPIO_ALT_FN_2_OUT) |
1404 | #define GPIO43_HWTXD_MD (43 | GPIO_ALT_FN_3_OUT) | ||
1381 | #define GPIO44_BTCTS_MD (44 | GPIO_ALT_FN_1_IN) | 1405 | #define GPIO44_BTCTS_MD (44 | GPIO_ALT_FN_1_IN) |
1406 | #define GPIO44_HWCTS_MD (44 | GPIO_ALT_FN_3_IN) | ||
1382 | #define GPIO45_BTRTS_MD (45 | GPIO_ALT_FN_2_OUT) | 1407 | #define GPIO45_BTRTS_MD (45 | GPIO_ALT_FN_2_OUT) |
1408 | #define GPIO45_HWRTS_MD (45 | GPIO_ALT_FN_3_OUT) | ||
1383 | #define GPIO45_SYSCLK_AC97_MD (45 | GPIO_ALT_FN_1_OUT) | 1409 | #define GPIO45_SYSCLK_AC97_MD (45 | GPIO_ALT_FN_1_OUT) |
1384 | #define GPIO46_ICPRXD_MD (46 | GPIO_ALT_FN_1_IN) | 1410 | #define GPIO46_ICPRXD_MD (46 | GPIO_ALT_FN_1_IN) |
1385 | #define GPIO46_STRXD_MD (46 | GPIO_ALT_FN_2_IN) | 1411 | #define GPIO46_STRXD_MD (46 | GPIO_ALT_FN_2_IN) |
1386 | #define GPIO47_ICPTXD_MD (47 | GPIO_ALT_FN_2_OUT) | 1412 | #define GPIO47_ICPTXD_MD (47 | GPIO_ALT_FN_2_OUT) |
1387 | #define GPIO47_STTXD_MD (47 | GPIO_ALT_FN_1_OUT) | 1413 | #define GPIO47_STTXD_MD (47 | GPIO_ALT_FN_1_OUT) |
1388 | #define GPIO48_nPOE_MD (48 | GPIO_ALT_FN_2_OUT) | 1414 | #define GPIO48_nPOE_MD (48 | GPIO_ALT_FN_2_OUT) |
1415 | #define GPIO48_HWTXD_MD (48 | GPIO_ALT_FN_1_OUT) | ||
1416 | #define GPIO48_nPOE_MD (48 | GPIO_ALT_FN_2_OUT) | ||
1417 | #define GPIO49_HWRXD_MD (49 | GPIO_ALT_FN_1_IN) | ||
1389 | #define GPIO49_nPWE_MD (49 | GPIO_ALT_FN_2_OUT) | 1418 | #define GPIO49_nPWE_MD (49 | GPIO_ALT_FN_2_OUT) |
1390 | #define GPIO50_nPIOR_MD (50 | GPIO_ALT_FN_2_OUT) | 1419 | #define GPIO50_nPIOR_MD (50 | GPIO_ALT_FN_2_OUT) |
1420 | #define GPIO50_HWCTS_MD (50 | GPIO_ALT_FN_1_IN) | ||
1421 | #define GPIO51_HWRTS_MD (51 | GPIO_ALT_FN_1_OUT) | ||
1391 | #define GPIO51_nPIOW_MD (51 | GPIO_ALT_FN_2_OUT) | 1422 | #define GPIO51_nPIOW_MD (51 | GPIO_ALT_FN_2_OUT) |
1392 | #define GPIO52_nPCE_1_MD (52 | GPIO_ALT_FN_2_OUT) | 1423 | #define GPIO52_nPCE_1_MD (52 | GPIO_ALT_FN_2_OUT) |
1393 | #define GPIO53_nPCE_2_MD (53 | GPIO_ALT_FN_2_OUT) | 1424 | #define GPIO53_nPCE_2_MD (53 | GPIO_ALT_FN_2_OUT) |
@@ -1762,6 +1793,7 @@ | |||
1762 | #define CKEN7_BTUART (1 << 7) /* BTUART Unit Clock Enable */ | 1793 | #define CKEN7_BTUART (1 << 7) /* BTUART Unit Clock Enable */ |
1763 | #define CKEN6_FFUART (1 << 6) /* FFUART Unit Clock Enable */ | 1794 | #define CKEN6_FFUART (1 << 6) /* FFUART Unit Clock Enable */ |
1764 | #define CKEN5_STUART (1 << 5) /* STUART Unit Clock Enable */ | 1795 | #define CKEN5_STUART (1 << 5) /* STUART Unit Clock Enable */ |
1796 | #define CKEN4_HWUART (1 << 4) /* HWUART Unit Clock Enable */ | ||
1765 | #define CKEN4_SSP3 (1 << 4) /* SSP3 Unit Clock Enable */ | 1797 | #define CKEN4_SSP3 (1 << 4) /* SSP3 Unit Clock Enable */ |
1766 | #define CKEN3_SSP (1 << 3) /* SSP Unit Clock Enable */ | 1798 | #define CKEN3_SSP (1 << 3) /* SSP Unit Clock Enable */ |
1767 | #define CKEN3_SSP2 (1 << 3) /* SSP2 Unit Clock Enable */ | 1799 | #define CKEN3_SSP2 (1 << 3) /* SSP2 Unit Clock Enable */ |
@@ -2281,4 +2313,11 @@ | |||
2281 | 2313 | ||
2282 | #endif | 2314 | #endif |
2283 | 2315 | ||
2316 | /* PWRMODE register M field values */ | ||
2317 | |||
2318 | #define PWRMODE_IDLE 0x1 | ||
2319 | #define PWRMODE_STANDBY 0x2 | ||
2320 | #define PWRMODE_SLEEP 0x3 | ||
2321 | #define PWRMODE_DEEPSLEEP 0x7 | ||
2322 | |||
2284 | #endif | 2323 | #endif |
diff --git a/include/asm-arm/arch-pxa/pxafb.h b/include/asm-arm/arch-pxa/pxafb.h index 21c0e16dce5f..aba9b30f4249 100644 --- a/include/asm-arm/arch-pxa/pxafb.h +++ b/include/asm-arm/arch-pxa/pxafb.h | |||
@@ -66,4 +66,5 @@ struct pxafb_mach_info { | |||
66 | 66 | ||
67 | }; | 67 | }; |
68 | void set_pxa_fb_info(struct pxafb_mach_info *hard_pxa_fb_info); | 68 | void set_pxa_fb_info(struct pxafb_mach_info *hard_pxa_fb_info); |
69 | void set_pxa_fb_parent(struct device *parent_dev); | ||
69 | unsigned long pxafb_get_hsync_time(struct device *dev); | 70 | unsigned long pxafb_get_hsync_time(struct device *dev); |
diff --git a/include/asm-arm/arch-pxa/sharpsl.h b/include/asm-arm/arch-pxa/sharpsl.h index 311f2bb5386a..0b43495d24b4 100644 --- a/include/asm-arm/arch-pxa/sharpsl.h +++ b/include/asm-arm/arch-pxa/sharpsl.h | |||
@@ -21,12 +21,18 @@ struct corgits_machinfo { | |||
21 | void (*wait_hsync)(void); | 21 | void (*wait_hsync)(void); |
22 | }; | 22 | }; |
23 | 23 | ||
24 | |||
24 | /* | 25 | /* |
25 | * SharpSL Backlight | 26 | * SharpSL Backlight |
26 | */ | 27 | */ |
27 | |||
28 | struct corgibl_machinfo { | 28 | struct corgibl_machinfo { |
29 | int max_intensity; | 29 | int max_intensity; |
30 | void (*set_bl_intensity)(int intensity); | 30 | void (*set_bl_intensity)(int intensity); |
31 | }; | 31 | }; |
32 | extern void corgibl_limit_intensity(int limit); | ||
33 | |||
32 | 34 | ||
35 | /* | ||
36 | * SharpSL Battery/PM Driver | ||
37 | */ | ||
38 | extern void sharpsl_battery_kick(void); | ||
diff --git a/include/asm-arm/arch-pxa/ssp.h b/include/asm-arm/arch-pxa/ssp.h index 6ec67b018c09..949878c0d908 100644 --- a/include/asm-arm/arch-pxa/ssp.h +++ b/include/asm-arm/arch-pxa/ssp.h | |||
@@ -18,6 +18,11 @@ | |||
18 | #ifndef SSP_H | 18 | #ifndef SSP_H |
19 | #define SSP_H | 19 | #define SSP_H |
20 | 20 | ||
21 | /* | ||
22 | * SSP initialisation flags | ||
23 | */ | ||
24 | #define SSP_NO_IRQ 0x1 /* don't register an irq handler in SSP driver */ | ||
25 | |||
21 | struct ssp_state { | 26 | struct ssp_state { |
22 | u32 cr0; | 27 | u32 cr0; |
23 | u32 cr1; | 28 | u32 cr1; |
@@ -31,6 +36,7 @@ struct ssp_dev { | |||
31 | u32 flags; | 36 | u32 flags; |
32 | u32 psp_flags; | 37 | u32 psp_flags; |
33 | u32 speed; | 38 | u32 speed; |
39 | int irq; | ||
34 | }; | 40 | }; |
35 | 41 | ||
36 | int ssp_write_word(struct ssp_dev *dev, u32 data); | 42 | int ssp_write_word(struct ssp_dev *dev, u32 data); |
@@ -40,7 +46,7 @@ void ssp_enable(struct ssp_dev *dev); | |||
40 | void ssp_disable(struct ssp_dev *dev); | 46 | void ssp_disable(struct ssp_dev *dev); |
41 | void ssp_save_state(struct ssp_dev *dev, struct ssp_state *ssp); | 47 | void ssp_save_state(struct ssp_dev *dev, struct ssp_state *ssp); |
42 | void ssp_restore_state(struct ssp_dev *dev, struct ssp_state *ssp); | 48 | void ssp_restore_state(struct ssp_dev *dev, struct ssp_state *ssp); |
43 | int ssp_init(struct ssp_dev *dev, u32 port); | 49 | int ssp_init(struct ssp_dev *dev, u32 port, u32 init_flags); |
44 | int ssp_config(struct ssp_dev *dev, u32 mode, u32 flags, u32 psp_flags, u32 speed); | 50 | int ssp_config(struct ssp_dev *dev, u32 mode, u32 flags, u32 psp_flags, u32 speed); |
45 | void ssp_exit(struct ssp_dev *dev); | 51 | void ssp_exit(struct ssp_dev *dev); |
46 | 52 | ||
diff --git a/include/asm-arm/arch-pxa/tosa.h b/include/asm-arm/arch-pxa/tosa.h new file mode 100644 index 000000000000..c3364a2c4758 --- /dev/null +++ b/include/asm-arm/arch-pxa/tosa.h | |||
@@ -0,0 +1,166 @@ | |||
1 | /* | ||
2 | * Hardware specific definitions for Sharp SL-C6000x series of PDAs | ||
3 | * | ||
4 | * Copyright (c) 2005 Dirk Opfer | ||
5 | * | ||
6 | * Based on Sharp's 2.4 kernel patches | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | */ | ||
13 | #ifndef _ASM_ARCH_TOSA_H_ | ||
14 | #define _ASM_ARCH_TOSA_H_ 1 | ||
15 | |||
16 | /* TOSA Chip selects */ | ||
17 | #define TOSA_LCDC_PHYS PXA_CS4_PHYS | ||
18 | /* Internel Scoop */ | ||
19 | #define TOSA_CF_PHYS (PXA_CS2_PHYS + 0x00800000) | ||
20 | /* Jacket Scoop */ | ||
21 | #define TOSA_SCOOP_PHYS (PXA_CS5_PHYS + 0x00800000) | ||
22 | |||
23 | /* | ||
24 | * SCOOP2 internal GPIOs | ||
25 | */ | ||
26 | #define TOSA_SCOOP_PXA_VCORE1 SCOOP_GPCR_PA11 | ||
27 | #define TOSA_SCOOP_TC6393_REST_IN SCOOP_GPCR_PA12 | ||
28 | #define TOSA_SCOOP_IR_POWERDWN SCOOP_GPCR_PA13 | ||
29 | #define TOSA_SCOOP_SD_WP SCOOP_GPCR_PA14 | ||
30 | #define TOSA_SCOOP_PWR_ON SCOOP_GPCR_PA15 | ||
31 | #define TOSA_SCOOP_AUD_PWR_ON SCOOP_GPCR_PA16 | ||
32 | #define TOSA_SCOOP_BT_RESET SCOOP_GPCR_PA17 | ||
33 | #define TOSA_SCOOP_BT_PWR_EN SCOOP_GPCR_PA18 | ||
34 | #define TOSA_SCOOP_AC_IN_OL SCOOP_GPCR_PA19 | ||
35 | |||
36 | /* GPIO Direction 1 : output mode / 0:input mode */ | ||
37 | #define TOSA_SCOOP_IO_DIR ( TOSA_SCOOP_PXA_VCORE1 | TOSA_SCOOP_TC6393_REST_IN | \ | ||
38 | TOSA_SCOOP_IR_POWERDWN | TOSA_SCOOP_PWR_ON | TOSA_SCOOP_AUD_PWR_ON |\ | ||
39 | TOSA_SCOOP_BT_RESET | TOSA_SCOOP_BT_PWR_EN ) | ||
40 | /* GPIO out put level when init 1: Hi */ | ||
41 | #define TOSA_SCOOP_IO_OUT ( TOSA_SCOOP_TC6393_REST_IN ) | ||
42 | |||
43 | /* | ||
44 | * SCOOP2 jacket GPIOs | ||
45 | */ | ||
46 | #define TOSA_SCOOP_JC_BT_LED SCOOP_GPCR_PA11 | ||
47 | #define TOSA_SCOOP_JC_NOTE_LED SCOOP_GPCR_PA12 | ||
48 | #define TOSA_SCOOP_JC_CHRG_ERR_LED SCOOP_GPCR_PA13 | ||
49 | #define TOSA_SCOOP_JC_USB_PULLUP SCOOP_GPCR_PA14 | ||
50 | #define TOSA_SCOOP_JC_TC6393_SUSPEND SCOOP_GPCR_PA15 | ||
51 | #define TOSA_SCOOP_JC_TC3693_L3V_ON SCOOP_GPCR_PA16 | ||
52 | #define TOSA_SCOOP_JC_WLAN_DETECT SCOOP_GPCR_PA17 | ||
53 | #define TOSA_SCOOP_JC_WLAN_LED SCOOP_GPCR_PA18 | ||
54 | #define TOSA_SCOOP_JC_CARD_LIMIT_SEL SCOOP_GPCR_PA19 | ||
55 | |||
56 | /* GPIO Direction 1 : output mode / 0:input mode */ | ||
57 | #define TOSA_SCOOP_JC_IO_DIR ( TOSA_SCOOP_JC_BT_LED | TOSA_SCOOP_JC_NOTE_LED | \ | ||
58 | TOSA_SCOOP_JC_CHRG_ERR_LED | TOSA_SCOOP_JC_USB_PULLUP | \ | ||
59 | TOSA_SCOOP_JC_TC6393_SUSPEND | TOSA_SCOOP_JC_TC3693_L3V_ON | \ | ||
60 | TOSA_SCOOP_JC_WLAN_LED | TOSA_SCOOP_JC_CARD_LIMIT_SEL ) | ||
61 | /* GPIO out put level when init 1: Hi */ | ||
62 | #define TOSA_SCOOP_JC_IO_OUT ( 0 ) | ||
63 | |||
64 | /* | ||
65 | * Timing Generator | ||
66 | */ | ||
67 | #define TG_PNLCTL 0x00 | ||
68 | #define TG_TPOSCTL 0x01 | ||
69 | #define TG_DUTYCTL 0x02 | ||
70 | #define TG_GPOSR 0x03 | ||
71 | #define TG_GPODR1 0x04 | ||
72 | #define TG_GPODR2 0x05 | ||
73 | #define TG_PINICTL 0x06 | ||
74 | #define TG_HPOSCTL 0x07 | ||
75 | |||
76 | /* | ||
77 | * LED | ||
78 | */ | ||
79 | #define TOSA_SCOOP_LED_BLUE TOSA_SCOOP_GPCR_PA11 | ||
80 | #define TOSA_SCOOP_LED_GREEN TOSA_SCOOP_GPCR_PA12 | ||
81 | #define TOSA_SCOOP_LED_ORANGE TOSA_SCOOP_GPCR_PA13 | ||
82 | #define TOSA_SCOOP_LED_WLAN TOSA_SCOOP_GPCR_PA18 | ||
83 | |||
84 | |||
85 | /* | ||
86 | * PXA GPIOs | ||
87 | */ | ||
88 | #define TOSA_GPIO_POWERON (0) | ||
89 | #define TOSA_GPIO_RESET (1) | ||
90 | #define TOSA_GPIO_AC_IN (2) | ||
91 | #define TOSA_GPIO_RECORD_BTN (3) | ||
92 | #define TOSA_GPIO_SYNC (4) /* Cradle SYNC Button */ | ||
93 | #define TOSA_GPIO_USB_IN (5) | ||
94 | #define TOSA_GPIO_JACKET_DETECT (7) | ||
95 | #define TOSA_GPIO_nSD_DETECT (9) | ||
96 | #define TOSA_GPIO_nSD_INT (10) | ||
97 | #define TOSA_GPIO_TC6393_CLK (11) | ||
98 | #define TOSA_GPIO_BAT1_CRG (12) | ||
99 | #define TOSA_GPIO_CF_CD (13) | ||
100 | #define TOSA_GPIO_BAT0_CRG (14) | ||
101 | #define TOSA_GPIO_TC6393_INT (15) | ||
102 | #define TOSA_GPIO_BAT0_LOW (17) | ||
103 | #define TOSA_GPIO_TC6393_RDY (18) | ||
104 | #define TOSA_GPIO_ON_RESET (19) | ||
105 | #define TOSA_GPIO_EAR_IN (20) | ||
106 | #define TOSA_GPIO_CF_IRQ (21) /* CF slot0 Ready */ | ||
107 | #define TOSA_GPIO_ON_KEY (22) | ||
108 | #define TOSA_GPIO_VGA_LINE (27) | ||
109 | #define TOSA_GPIO_TP_INT (32) /* Touch Panel pen down interrupt */ | ||
110 | #define TOSA_GPIO_JC_CF_IRQ (36) /* CF slot1 Ready */ | ||
111 | #define TOSA_GPIO_BAT_LOCKED (38) /* Battery locked */ | ||
112 | #define TOSA_GPIO_TG_SPI_SCLK (81) | ||
113 | #define TOSA_GPIO_TG_SPI_CS (82) | ||
114 | #define TOSA_GPIO_TG_SPI_MOSI (83) | ||
115 | #define TOSA_GPIO_BAT1_LOW (84) | ||
116 | |||
117 | #define TOSA_GPIO_HP_IN GPIO_EAR_IN | ||
118 | |||
119 | #define TOSA_GPIO_MAIN_BAT_LOW GPIO_BAT0_LOW | ||
120 | |||
121 | #define TOSA_KEY_STROBE_NUM (11) | ||
122 | #define TOSA_KEY_SENSE_NUM (7) | ||
123 | |||
124 | #define TOSA_GPIO_HIGH_STROBE_BIT (0xfc000000) | ||
125 | #define TOSA_GPIO_LOW_STROBE_BIT (0x0000001f) | ||
126 | #define TOSA_GPIO_ALL_SENSE_BIT (0x00000fe0) | ||
127 | #define TOSA_GPIO_ALL_SENSE_RSHIFT (5) | ||
128 | #define TOSA_GPIO_STROBE_BIT(a) GPIO_bit(58+(a)) | ||
129 | #define TOSA_GPIO_SENSE_BIT(a) GPIO_bit(69+(a)) | ||
130 | #define TOSA_GAFR_HIGH_STROBE_BIT (0xfff00000) | ||
131 | #define TOSA_GAFR_LOW_STROBE_BIT (0x000003ff) | ||
132 | #define TOSA_GAFR_ALL_SENSE_BIT (0x00fffc00) | ||
133 | #define TOSA_GPIO_KEY_SENSE(a) (69+(a)) | ||
134 | #define TOSA_GPIO_KEY_STROBE(a) (58+(a)) | ||
135 | |||
136 | /* | ||
137 | * Interrupts | ||
138 | */ | ||
139 | #define TOSA_IRQ_GPIO_WAKEUP IRQ_GPIO(TOSA_GPIO_WAKEUP) | ||
140 | #define TOSA_IRQ_GPIO_AC_IN IRQ_GPIO(TOSA_GPIO_AC_IN) | ||
141 | #define TOSA_IRQ_GPIO_RECORD_BTN IRQ_GPIO(TOSA_GPIO_RECORD_BTN) | ||
142 | #define TOSA_IRQ_GPIO_SYNC IRQ_GPIO(TOSA_GPIO_SYNC) | ||
143 | #define TOSA_IRQ_GPIO_USB_IN IRQ_GPIO(TOSA_GPIO_USB_IN) | ||
144 | #define TOSA_IRQ_GPIO_JACKET_DETECT IRQ_GPIO(TOSA_GPIO_JACKET_DETECT) | ||
145 | #define TOSA_IRQ_GPIO_nSD_INT IRQ_GPIO(TOSA_GPIO_nSD_INT) | ||
146 | #define TOSA_IRQ_GPIO_nSD_DETECT IRQ_GPIO(TOSA_GPIO_nSD_DETECT) | ||
147 | #define TOSA_IRQ_GPIO_BAT1_CRG IRQ_GPIO(TOSA_GPIO_BAT1_CRG) | ||
148 | #define TOSA_IRQ_GPIO_CF_CD IRQ_GPIO(TOSA_GPIO_CF_CD) | ||
149 | #define TOSA_IRQ_GPIO_BAT0_CRG IRQ_GPIO(TOSA_GPIO_BAT0_CRG) | ||
150 | #define TOSA_IRQ_GPIO_TC6393_INT IRQ_GPIO(TOSA_GPIO_TC6393_INT) | ||
151 | #define TOSA_IRQ_GPIO_BAT0_LOW IRQ_GPIO(TOSA_GPIO_BAT0_LOW) | ||
152 | #define TOSA_IRQ_GPIO_EAR_IN IRQ_GPIO(TOSA_GPIO_EAR_IN) | ||
153 | #define TOSA_IRQ_GPIO_CF_IRQ IRQ_GPIO(TOSA_GPIO_CF_IRQ) | ||
154 | #define TOSA_IRQ_GPIO_ON_KEY IRQ_GPIO(TOSA_GPIO_ON_KEY) | ||
155 | #define TOSA_IRQ_GPIO_VGA_LINE IRQ_GPIO(TOSA_GPIO_VGA_LINE) | ||
156 | #define TOSA_IRQ_GPIO_TP_INT IRQ_GPIO(TOSA_GPIO_TP_INT) | ||
157 | #define TOSA_IRQ_GPIO_JC_CF_IRQ IRQ_GPIO(TOSA_GPIO_JC_CF_IRQ) | ||
158 | #define TOSA_IRQ_GPIO_BAT_LOCKED IRQ_GPIO(TOSA_GPIO_BAT_LOCKED) | ||
159 | #define TOSA_IRQ_GPIO_BAT1_LOW IRQ_GPIO(TOSA_GPIO_BAT1_LOW) | ||
160 | #define TOSA_IRQ_GPIO_KEY_SENSE(a) IRQ_GPIO(69+(a)) | ||
161 | |||
162 | #define TOSA_IRQ_GPIO_MAIN_BAT_LOW IRQ_GPIO(TOSA_GPIO_MAIN_BAT_LOW) | ||
163 | |||
164 | extern struct platform_device tosascoop_jc_device; | ||
165 | extern struct platform_device tosascoop_device; | ||
166 | #endif /* _ASM_ARCH_TOSA_H_ */ | ||
diff --git a/include/asm-arm/arch-pxa/uncompress.h b/include/asm-arm/arch-pxa/uncompress.h index 4428d3eb7432..fe38090444e0 100644 --- a/include/asm-arm/arch-pxa/uncompress.h +++ b/include/asm-arm/arch-pxa/uncompress.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #define FFUART ((volatile unsigned long *)0x40100000) | 12 | #define FFUART ((volatile unsigned long *)0x40100000) |
13 | #define BTUART ((volatile unsigned long *)0x40200000) | 13 | #define BTUART ((volatile unsigned long *)0x40200000) |
14 | #define STUART ((volatile unsigned long *)0x40700000) | 14 | #define STUART ((volatile unsigned long *)0x40700000) |
15 | #define HWUART ((volatile unsigned long *)0x41600000) | ||
15 | 16 | ||
16 | #define UART FFUART | 17 | #define UART FFUART |
17 | 18 | ||
diff --git a/include/asm-arm/arch-realview/debug-macro.S b/include/asm-arm/arch-realview/debug-macro.S new file mode 100644 index 000000000000..ed28bd012236 --- /dev/null +++ b/include/asm-arm/arch-realview/debug-macro.S | |||
@@ -0,0 +1,38 @@ | |||
1 | /* linux/include/asm-arm/arch-realview/debug-macro.S | ||
2 | * | ||
3 | * Debugging macro include header | ||
4 | * | ||
5 | * Copyright (C) 1994-1999 Russell King | ||
6 | * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #include <asm/hardware/amba_serial.h> | ||
15 | |||
16 | .macro addruart,rx | ||
17 | mrc p15, 0, \rx, c1, c0 | ||
18 | tst \rx, #1 @ MMU enabled? | ||
19 | moveq \rx, #0x10000000 | ||
20 | movne \rx, #0xf1000000 @ virtual base | ||
21 | orr \rx, \rx, #0x00009000 | ||
22 | .endm | ||
23 | |||
24 | .macro senduart,rd,rx | ||
25 | strb \rd, [\rx, #UART01x_DR] | ||
26 | .endm | ||
27 | |||
28 | .macro waituart,rd,rx | ||
29 | 1001: ldr \rd, [\rx, #0x18] @ UARTFLG | ||
30 | tst \rd, #1 << 5 @ UARTFLGUTXFF - 1 when full | ||
31 | bne 1001b | ||
32 | .endm | ||
33 | |||
34 | .macro busyuart,rd,rx | ||
35 | 1001: ldr \rd, [\rx, #0x18] @ UARTFLG | ||
36 | tst \rd, #1 << 3 @ UARTFLGUBUSY - 1 when busy | ||
37 | bne 1001b | ||
38 | .endm | ||
diff --git a/include/asm-arm/arch-realview/dma.h b/include/asm-arm/arch-realview/dma.h new file mode 100644 index 000000000000..744491a74bd9 --- /dev/null +++ b/include/asm-arm/arch-realview/dma.h | |||
@@ -0,0 +1,27 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-realview/dma.h | ||
3 | * | ||
4 | * Copyright (C) 2003 ARM Limited. | ||
5 | * Copyright (C) 1997,1998 Russell King | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | */ | ||
21 | #ifndef __ASM_ARCH_DMA_H | ||
22 | #define __ASM_ARCH_DMA_H | ||
23 | |||
24 | #define MAX_DMA_ADDRESS 0xffffffff | ||
25 | #define MAX_DMA_CHANNELS 0 | ||
26 | |||
27 | #endif /* _ASM_ARCH_DMA_H */ | ||
diff --git a/include/asm-arm/arch-realview/entry-macro.S b/include/asm-arm/arch-realview/entry-macro.S new file mode 100644 index 000000000000..6288fad0dc41 --- /dev/null +++ b/include/asm-arm/arch-realview/entry-macro.S | |||
@@ -0,0 +1,74 @@ | |||
1 | /* | ||
2 | * include/asm-arm/arch-realview/entry-macro.S | ||
3 | * | ||
4 | * Low-level IRQ helper macros for RealView platforms | ||
5 | * | ||
6 | * This file is licensed under the terms of the GNU General Public | ||
7 | * License version 2. This program is licensed "as is" without any | ||
8 | * warranty of any kind, whether express or implied. | ||
9 | */ | ||
10 | |||
11 | #include <asm/hardware/gic.h> | ||
12 | |||
13 | .macro disable_fiq | ||
14 | .endm | ||
15 | |||
16 | /* | ||
17 | * The interrupt numbering scheme is defined in the | ||
18 | * interrupt controller spec. To wit: | ||
19 | * | ||
20 | * Interrupts 0-15 are IPI | ||
21 | * 16-28 are reserved | ||
22 | * 29-31 are local. We allow 30 to be used for the watchdog. | ||
23 | * 32-1020 are global | ||
24 | * 1021-1022 are reserved | ||
25 | * 1023 is "spurious" (no interrupt) | ||
26 | * | ||
27 | * For now, we ignore all local interrupts so only return an interrupt if it's | ||
28 | * between 30 and 1020. The test_for_ipi routine below will pick up on IPIs. | ||
29 | * | ||
30 | * A simple read from the controller will tell us the number of the highest | ||
31 | * priority enabled interrupt. We then just need to check whether it is in the | ||
32 | * valid range for an IRQ (30-1020 inclusive). | ||
33 | */ | ||
34 | |||
35 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
36 | |||
37 | ldr \base, =IO_ADDRESS(REALVIEW_GIC_CPU_BASE) | ||
38 | ldr \irqstat, [\base, #GIC_CPU_INTACK] /* bits 12-10 = src CPU, 9-0 = int # */ | ||
39 | |||
40 | ldr \tmp, =1021 | ||
41 | |||
42 | bic \irqnr, \irqstat, #0x1c00 | ||
43 | |||
44 | cmp \irqnr, #29 | ||
45 | cmpcc \irqnr, \irqnr | ||
46 | cmpne \irqnr, \tmp | ||
47 | cmpcs \irqnr, \irqnr | ||
48 | |||
49 | .endm | ||
50 | |||
51 | /* We assume that irqstat (the raw value of the IRQ acknowledge | ||
52 | * register) is preserved from the macro above. | ||
53 | * If there is an IPI, we immediately signal end of interrupt on the | ||
54 | * controller, since this requires the original irqstat value which | ||
55 | * we won't easily be able to recreate later. | ||
56 | */ | ||
57 | |||
58 | .macro test_for_ipi, irqnr, irqstat, base, tmp | ||
59 | bic \irqnr, \irqstat, #0x1c00 | ||
60 | cmp \irqnr, #16 | ||
61 | strcc \irqstat, [\base, #GIC_CPU_EOI] | ||
62 | cmpcs \irqnr, \irqnr | ||
63 | .endm | ||
64 | |||
65 | /* As above, this assumes that irqstat and base are preserved.. */ | ||
66 | |||
67 | .macro test_for_ltirq, irqnr, irqstat, base, tmp | ||
68 | bic \irqnr, \irqstat, #0x1c00 | ||
69 | mov \tmp, #0 | ||
70 | cmp \irqnr, #29 | ||
71 | moveq \tmp, #1 | ||
72 | streq \irqstat, [\base, #GIC_CPU_EOI] | ||
73 | cmp \tmp, #0 | ||
74 | .endm | ||
diff --git a/include/asm-arm/arch-realview/hardware.h b/include/asm-arm/arch-realview/hardware.h new file mode 100644 index 000000000000..9ca76dc3a7af --- /dev/null +++ b/include/asm-arm/arch-realview/hardware.h | |||
@@ -0,0 +1,32 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-realview/hardware.h | ||
3 | * | ||
4 | * This file contains the hardware definitions of the RealView boards. | ||
5 | * | ||
6 | * Copyright (C) 2003 ARM Limited. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | */ | ||
22 | #ifndef __ASM_ARCH_HARDWARE_H | ||
23 | #define __ASM_ARCH_HARDWARE_H | ||
24 | |||
25 | #include <asm/sizes.h> | ||
26 | #include <asm/arch/platform.h> | ||
27 | |||
28 | /* macro to get at IO space when running virtually */ | ||
29 | #define IO_ADDRESS(x) (((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + 0xf0000000) | ||
30 | #define __io_address(n) __io(IO_ADDRESS(n)) | ||
31 | |||
32 | #endif | ||
diff --git a/include/asm-arm/arch-realview/io.h b/include/asm-arm/arch-realview/io.h new file mode 100644 index 000000000000..d444a68ac330 --- /dev/null +++ b/include/asm-arm/arch-realview/io.h | |||
@@ -0,0 +1,34 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-realview/io.h | ||
3 | * | ||
4 | * Copyright (C) 2003 ARM Limited | ||
5 | * | ||
6 | * 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 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | #ifndef __ASM_ARM_ARCH_IO_H | ||
21 | #define __ASM_ARM_ARCH_IO_H | ||
22 | |||
23 | #define IO_SPACE_LIMIT 0xffffffff | ||
24 | |||
25 | static inline void __iomem *__io(unsigned long addr) | ||
26 | { | ||
27 | return (void __iomem *)addr; | ||
28 | } | ||
29 | |||
30 | #define __io(a) __io(a) | ||
31 | #define __mem_pci(a) (a) | ||
32 | #define __mem_isa(a) (a) | ||
33 | |||
34 | #endif | ||
diff --git a/include/asm-arm/arch-realview/irqs.h b/include/asm-arm/arch-realview/irqs.h new file mode 100644 index 000000000000..c16223c9588d --- /dev/null +++ b/include/asm-arm/arch-realview/irqs.h | |||
@@ -0,0 +1,106 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-realview/irqs.h | ||
3 | * | ||
4 | * Copyright (C) 2003 ARM Limited | ||
5 | * Copyright (C) 2000 Deep Blue Solutions Ltd. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | */ | ||
21 | |||
22 | #include <asm/arch/platform.h> | ||
23 | |||
24 | #define IRQ_LOCALTIMER 29 | ||
25 | #define IRQ_LOCALWDOG 30 | ||
26 | |||
27 | /* | ||
28 | * IRQ interrupts definitions are the same the INT definitions | ||
29 | * held within platform.h | ||
30 | */ | ||
31 | #define IRQ_GIC_START 32 | ||
32 | #define IRQ_WDOGINT (IRQ_GIC_START + INT_WDOGINT) | ||
33 | #define IRQ_SOFTINT (IRQ_GIC_START + INT_SOFTINT) | ||
34 | #define IRQ_COMMRx (IRQ_GIC_START + INT_COMMRx) | ||
35 | #define IRQ_COMMTx (IRQ_GIC_START + INT_COMMTx) | ||
36 | #define IRQ_TIMERINT0_1 (IRQ_GIC_START + INT_TIMERINT0_1) | ||
37 | #define IRQ_TIMERINT2_3 (IRQ_GIC_START + INT_TIMERINT2_3) | ||
38 | #define IRQ_GPIOINT0 (IRQ_GIC_START + INT_GPIOINT0) | ||
39 | #define IRQ_GPIOINT1 (IRQ_GIC_START + INT_GPIOINT1) | ||
40 | #define IRQ_GPIOINT2 (IRQ_GIC_START + INT_GPIOINT2) | ||
41 | #define IRQ_GPIOINT3 (IRQ_GIC_START + INT_GPIOINT3) | ||
42 | #define IRQ_RTCINT (IRQ_GIC_START + INT_RTCINT) | ||
43 | #define IRQ_SSPINT (IRQ_GIC_START + INT_SSPINT) | ||
44 | #define IRQ_UARTINT0 (IRQ_GIC_START + INT_UARTINT0) | ||
45 | #define IRQ_UARTINT1 (IRQ_GIC_START + INT_UARTINT1) | ||
46 | #define IRQ_UARTINT2 (IRQ_GIC_START + INT_UARTINT2) | ||
47 | #define IRQ_UART3 (IRQ_GIC_START + INT_UARTINT3) | ||
48 | #define IRQ_SCIINT (IRQ_GIC_START + INT_SCIINT) | ||
49 | #define IRQ_CLCDINT (IRQ_GIC_START + INT_CLCDINT) | ||
50 | #define IRQ_DMAINT (IRQ_GIC_START + INT_DMAINT) | ||
51 | #define IRQ_PWRFAILINT (IRQ_GIC_START + INT_PWRFAILINT) | ||
52 | #define IRQ_MBXINT (IRQ_GIC_START + INT_MBXINT) | ||
53 | #define IRQ_GNDINT (IRQ_GIC_START + INT_GNDINT) | ||
54 | #define IRQ_MMCI0B (IRQ_GIC_START + INT_MMCI0B) | ||
55 | #define IRQ_MMCI1B (IRQ_GIC_START + INT_MMCI1B) | ||
56 | #define IRQ_KMI0 (IRQ_GIC_START + INT_KMI0) | ||
57 | #define IRQ_KMI1 (IRQ_GIC_START + INT_KMI1) | ||
58 | #define IRQ_SCI3 (IRQ_GIC_START + INT_SCI3) | ||
59 | #define IRQ_CLCD (IRQ_GIC_START + INT_CLCD) | ||
60 | #define IRQ_TOUCH (IRQ_GIC_START + INT_TOUCH) | ||
61 | #define IRQ_KEYPAD (IRQ_GIC_START + INT_KEYPAD) | ||
62 | #define IRQ_DoC (IRQ_GIC_START + INT_DoC) | ||
63 | #define IRQ_MMCI0A (IRQ_GIC_START + INT_MMCI0A) | ||
64 | #define IRQ_MMCI1A (IRQ_GIC_START + INT_MMCI1A) | ||
65 | #define IRQ_AACI (IRQ_GIC_START + INT_AACI) | ||
66 | #define IRQ_ETH (IRQ_GIC_START + INT_ETH) | ||
67 | #define IRQ_USB (IRQ_GIC_START + INT_USB) | ||
68 | |||
69 | #define IRQMASK_WDOGINT INTMASK_WDOGINT | ||
70 | #define IRQMASK_SOFTINT INTMASK_SOFTINT | ||
71 | #define IRQMASK_COMMRx INTMASK_COMMRx | ||
72 | #define IRQMASK_COMMTx INTMASK_COMMTx | ||
73 | #define IRQMASK_TIMERINT0_1 INTMASK_TIMERINT0_1 | ||
74 | #define IRQMASK_TIMERINT2_3 INTMASK_TIMERINT2_3 | ||
75 | #define IRQMASK_GPIOINT0 INTMASK_GPIOINT0 | ||
76 | #define IRQMASK_GPIOINT1 INTMASK_GPIOINT1 | ||
77 | #define IRQMASK_GPIOINT2 INTMASK_GPIOINT2 | ||
78 | #define IRQMASK_GPIOINT3 INTMASK_GPIOINT3 | ||
79 | #define IRQMASK_RTCINT INTMASK_RTCINT | ||
80 | #define IRQMASK_SSPINT INTMASK_SSPINT | ||
81 | #define IRQMASK_UARTINT0 INTMASK_UARTINT0 | ||
82 | #define IRQMASK_UARTINT1 INTMASK_UARTINT1 | ||
83 | #define IRQMASK_UARTINT2 INTMASK_UARTINT2 | ||
84 | #define IRQMASK_SCIINT INTMASK_SCIINT | ||
85 | #define IRQMASK_CLCDINT INTMASK_CLCDINT | ||
86 | #define IRQMASK_DMAINT INTMASK_DMAINT | ||
87 | #define IRQMASK_PWRFAILINT INTMASK_PWRFAILINT | ||
88 | #define IRQMASK_MBXINT INTMASK_MBXINT | ||
89 | #define IRQMASK_GNDINT INTMASK_GNDINT | ||
90 | #define IRQMASK_MMCI0B INTMASK_MMCI0B | ||
91 | #define IRQMASK_MMCI1B INTMASK_MMCI1B | ||
92 | #define IRQMASK_KMI0 INTMASK_KMI0 | ||
93 | #define IRQMASK_KMI1 INTMASK_KMI1 | ||
94 | #define IRQMASK_SCI3 INTMASK_SCI3 | ||
95 | #define IRQMASK_UART3 INTMASK_UART3 | ||
96 | #define IRQMASK_CLCD INTMASK_CLCD | ||
97 | #define IRQMASK_TOUCH INTMASK_TOUCH | ||
98 | #define IRQMASK_KEYPAD INTMASK_KEYPAD | ||
99 | #define IRQMASK_DoC INTMASK_DoC | ||
100 | #define IRQMASK_MMCI0A INTMASK_MMCI0A | ||
101 | #define IRQMASK_MMCI1A INTMASK_MMCI1A | ||
102 | #define IRQMASK_AACI INTMASK_AACI | ||
103 | #define IRQMASK_ETH INTMASK_ETH | ||
104 | #define IRQMASK_USB INTMASK_USB | ||
105 | |||
106 | #define NR_IRQS (IRQ_GIC_START + 64) | ||
diff --git a/include/asm-arm/arch-realview/memory.h b/include/asm-arm/arch-realview/memory.h new file mode 100644 index 000000000000..ed370abb638f --- /dev/null +++ b/include/asm-arm/arch-realview/memory.h | |||
@@ -0,0 +1,38 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-realview/memory.h | ||
3 | * | ||
4 | * Copyright (C) 2003 ARM Limited | ||
5 | * | ||
6 | * 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 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | #ifndef __ASM_ARCH_MEMORY_H | ||
21 | #define __ASM_ARCH_MEMORY_H | ||
22 | |||
23 | /* | ||
24 | * Physical DRAM offset. | ||
25 | */ | ||
26 | #define PHYS_OFFSET UL(0x00000000) | ||
27 | |||
28 | /* | ||
29 | * Virtual view <-> DMA view memory address translations | ||
30 | * virt_to_bus: Used to translate the virtual address to an | ||
31 | * address suitable to be passed to set_dma_addr | ||
32 | * bus_to_virt: Used to convert an address for DMA operations | ||
33 | * to an address that the kernel can use. | ||
34 | */ | ||
35 | #define __virt_to_bus(x) ((x) - PAGE_OFFSET) | ||
36 | #define __bus_to_virt(x) ((x) + PAGE_OFFSET) | ||
37 | |||
38 | #endif | ||
diff --git a/include/asm-arm/arch-realview/param.h b/include/asm-arm/arch-realview/param.h new file mode 100644 index 000000000000..89b1235d32bd --- /dev/null +++ b/include/asm-arm/arch-realview/param.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-realview/param.h | ||
3 | * | ||
4 | * Copyright (C) 2002 ARM Limited | ||
5 | * | ||
6 | * 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 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
diff --git a/include/asm-arm/arch-realview/platform.h b/include/asm-arm/arch-realview/platform.h new file mode 100644 index 000000000000..18d7c18b738c --- /dev/null +++ b/include/asm-arm/arch-realview/platform.h | |||
@@ -0,0 +1,450 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-realview/platform.h | ||
3 | * | ||
4 | * Copyright (c) ARM Limited 2003. All rights reserved. | ||
5 | * | ||
6 | * 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 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | |||
21 | #ifndef __address_h | ||
22 | #define __address_h 1 | ||
23 | |||
24 | /* | ||
25 | * Memory definitions | ||
26 | */ | ||
27 | #define REALVIEW_BOOT_ROM_LO 0x30000000 /* DoC Base (64Mb)...*/ | ||
28 | #define REALVIEW_BOOT_ROM_HI 0x30000000 | ||
29 | #define REALVIEW_BOOT_ROM_BASE REALVIEW_BOOT_ROM_HI /* Normal position */ | ||
30 | #define REALVIEW_BOOT_ROM_SIZE SZ_64M | ||
31 | |||
32 | #define REALVIEW_SSRAM_BASE /* REALVIEW_SSMC_BASE ? */ | ||
33 | #define REALVIEW_SSRAM_SIZE SZ_2M | ||
34 | |||
35 | #define REALVIEW_FLASH_BASE 0x40000000 | ||
36 | #define REALVIEW_FLASH_SIZE SZ_64M | ||
37 | |||
38 | /* | ||
39 | * SDRAM | ||
40 | */ | ||
41 | #define REALVIEW_SDRAM_BASE 0x00000000 | ||
42 | |||
43 | /* | ||
44 | * Logic expansion modules | ||
45 | * | ||
46 | */ | ||
47 | |||
48 | |||
49 | /* ------------------------------------------------------------------------ | ||
50 | * RealView Registers | ||
51 | * ------------------------------------------------------------------------ | ||
52 | * | ||
53 | */ | ||
54 | #define REALVIEW_SYS_ID_OFFSET 0x00 | ||
55 | #define REALVIEW_SYS_SW_OFFSET 0x04 | ||
56 | #define REALVIEW_SYS_LED_OFFSET 0x08 | ||
57 | #define REALVIEW_SYS_OSC0_OFFSET 0x0C | ||
58 | |||
59 | #define REALVIEW_SYS_OSC1_OFFSET 0x10 | ||
60 | #define REALVIEW_SYS_OSC2_OFFSET 0x14 | ||
61 | #define REALVIEW_SYS_OSC3_OFFSET 0x18 | ||
62 | #define REALVIEW_SYS_OSC4_OFFSET 0x1C /* OSC1 for RealView/AB */ | ||
63 | |||
64 | #define REALVIEW_SYS_LOCK_OFFSET 0x20 | ||
65 | #define REALVIEW_SYS_100HZ_OFFSET 0x24 | ||
66 | #define REALVIEW_SYS_CFGDATA1_OFFSET 0x28 | ||
67 | #define REALVIEW_SYS_CFGDATA2_OFFSET 0x2C | ||
68 | #define REALVIEW_SYS_FLAGS_OFFSET 0x30 | ||
69 | #define REALVIEW_SYS_FLAGSSET_OFFSET 0x30 | ||
70 | #define REALVIEW_SYS_FLAGSCLR_OFFSET 0x34 | ||
71 | #define REALVIEW_SYS_NVFLAGS_OFFSET 0x38 | ||
72 | #define REALVIEW_SYS_NVFLAGSSET_OFFSET 0x38 | ||
73 | #define REALVIEW_SYS_NVFLAGSCLR_OFFSET 0x3C | ||
74 | #define REALVIEW_SYS_RESETCTL_OFFSET 0x40 | ||
75 | #define REALVIEW_SYS_PCICTL_OFFSET 0x44 | ||
76 | #define REALVIEW_SYS_MCI_OFFSET 0x48 | ||
77 | #define REALVIEW_SYS_FLASH_OFFSET 0x4C | ||
78 | #define REALVIEW_SYS_CLCD_OFFSET 0x50 | ||
79 | #define REALVIEW_SYS_CLCDSER_OFFSET 0x54 | ||
80 | #define REALVIEW_SYS_BOOTCS_OFFSET 0x58 | ||
81 | #define REALVIEW_SYS_24MHz_OFFSET 0x5C | ||
82 | #define REALVIEW_SYS_MISC_OFFSET 0x60 | ||
83 | #define REALVIEW_SYS_IOSEL_OFFSET 0x70 | ||
84 | #define REALVIEW_SYS_TEST_OSC0_OFFSET 0x80 | ||
85 | #define REALVIEW_SYS_TEST_OSC1_OFFSET 0x84 | ||
86 | #define REALVIEW_SYS_TEST_OSC2_OFFSET 0x88 | ||
87 | #define REALVIEW_SYS_TEST_OSC3_OFFSET 0x8C | ||
88 | #define REALVIEW_SYS_TEST_OSC4_OFFSET 0x90 | ||
89 | |||
90 | #define REALVIEW_SYS_BASE 0x10000000 | ||
91 | #define REALVIEW_SYS_ID (REALVIEW_SYS_BASE + REALVIEW_SYS_ID_OFFSET) | ||
92 | #define REALVIEW_SYS_SW (REALVIEW_SYS_BASE + REALVIEW_SYS_SW_OFFSET) | ||
93 | #define REALVIEW_SYS_LED (REALVIEW_SYS_BASE + REALVIEW_SYS_LED_OFFSET) | ||
94 | #define REALVIEW_SYS_OSC0 (REALVIEW_SYS_BASE + REALVIEW_SYS_OSC0_OFFSET) | ||
95 | #define REALVIEW_SYS_OSC1 (REALVIEW_SYS_BASE + REALVIEW_SYS_OSC1_OFFSET) | ||
96 | |||
97 | #define REALVIEW_SYS_LOCK (REALVIEW_SYS_BASE + REALVIEW_SYS_LOCK_OFFSET) | ||
98 | #define REALVIEW_SYS_100HZ (REALVIEW_SYS_BASE + REALVIEW_SYS_100HZ_OFFSET) | ||
99 | #define REALVIEW_SYS_CFGDATA1 (REALVIEW_SYS_BASE + REALVIEW_SYS_CFGDATA1_OFFSET) | ||
100 | #define REALVIEW_SYS_CFGDATA2 (REALVIEW_SYS_BASE + REALVIEW_SYS_CFGDATA2_OFFSET) | ||
101 | #define REALVIEW_SYS_FLAGS (REALVIEW_SYS_BASE + REALVIEW_SYS_FLAGS_OFFSET) | ||
102 | #define REALVIEW_SYS_FLAGSSET (REALVIEW_SYS_BASE + REALVIEW_SYS_FLAGSSET_OFFSET) | ||
103 | #define REALVIEW_SYS_FLAGSCLR (REALVIEW_SYS_BASE + REALVIEW_SYS_FLAGSCLR_OFFSET) | ||
104 | #define REALVIEW_SYS_NVFLAGS (REALVIEW_SYS_BASE + REALVIEW_SYS_NVFLAGS_OFFSET) | ||
105 | #define REALVIEW_SYS_NVFLAGSSET (REALVIEW_SYS_BASE + REALVIEW_SYS_NVFLAGSSET_OFFSET) | ||
106 | #define REALVIEW_SYS_NVFLAGSCLR (REALVIEW_SYS_BASE + REALVIEW_SYS_NVFLAGSCLR_OFFSET) | ||
107 | #define REALVIEW_SYS_RESETCTL (REALVIEW_SYS_BASE + REALVIEW_SYS_RESETCTL_OFFSET) | ||
108 | #define REALVIEW_SYS_PCICTL (REALVIEW_SYS_BASE + REALVIEW_SYS_PCICTL_OFFSET) | ||
109 | #define REALVIEW_SYS_MCI (REALVIEW_SYS_BASE + REALVIEW_SYS_MCI_OFFSET) | ||
110 | #define REALVIEW_SYS_FLASH (REALVIEW_SYS_BASE + REALVIEW_SYS_FLASH_OFFSET) | ||
111 | #define REALVIEW_SYS_CLCD (REALVIEW_SYS_BASE + REALVIEW_SYS_CLCD_OFFSET) | ||
112 | #define REALVIEW_SYS_CLCDSER (REALVIEW_SYS_BASE + REALVIEW_SYS_CLCDSER_OFFSET) | ||
113 | #define REALVIEW_SYS_BOOTCS (REALVIEW_SYS_BASE + REALVIEW_SYS_BOOTCS_OFFSET) | ||
114 | #define REALVIEW_SYS_24MHz (REALVIEW_SYS_BASE + REALVIEW_SYS_24MHz_OFFSET) | ||
115 | #define REALVIEW_SYS_MISC (REALVIEW_SYS_BASE + REALVIEW_SYS_MISC_OFFSET) | ||
116 | #define REALVIEW_SYS_IOSEL (REALVIEW_SYS_BASE + REALVIEW_SYS_IOSEL_OFFSET) | ||
117 | #define REALVIEW_SYS_TEST_OSC0 (REALVIEW_SYS_BASE + REALVIEW_SYS_TEST_OSC0_OFFSET) | ||
118 | #define REALVIEW_SYS_TEST_OSC1 (REALVIEW_SYS_BASE + REALVIEW_SYS_TEST_OSC1_OFFSET) | ||
119 | #define REALVIEW_SYS_TEST_OSC2 (REALVIEW_SYS_BASE + REALVIEW_SYS_TEST_OSC2_OFFSET) | ||
120 | #define REALVIEW_SYS_TEST_OSC3 (REALVIEW_SYS_BASE + REALVIEW_SYS_TEST_OSC3_OFFSET) | ||
121 | #define REALVIEW_SYS_TEST_OSC4 (REALVIEW_SYS_BASE + REALVIEW_SYS_TEST_OSC4_OFFSET) | ||
122 | |||
123 | /* | ||
124 | * Values for REALVIEW_SYS_RESET_CTRL | ||
125 | */ | ||
126 | #define REALVIEW_SYS_CTRL_RESET_CONFIGCLR 0x01 | ||
127 | #define REALVIEW_SYS_CTRL_RESET_CONFIGINIT 0x02 | ||
128 | #define REALVIEW_SYS_CTRL_RESET_DLLRESET 0x03 | ||
129 | #define REALVIEW_SYS_CTRL_RESET_PLLRESET 0x04 | ||
130 | #define REALVIEW_SYS_CTRL_RESET_POR 0x05 | ||
131 | #define REALVIEW_SYS_CTRL_RESET_DoC 0x06 | ||
132 | |||
133 | #define REALVIEW_SYS_CTRL_LED (1 << 0) | ||
134 | |||
135 | |||
136 | /* ------------------------------------------------------------------------ | ||
137 | * RealView control registers | ||
138 | * ------------------------------------------------------------------------ | ||
139 | */ | ||
140 | |||
141 | /* | ||
142 | * REALVIEW_IDFIELD | ||
143 | * | ||
144 | * 31:24 = manufacturer (0x41 = ARM) | ||
145 | * 23:16 = architecture (0x08 = AHB system bus, ASB processor bus) | ||
146 | * 15:12 = FPGA (0x3 = XVC600 or XVC600E) | ||
147 | * 11:4 = build value | ||
148 | * 3:0 = revision number (0x1 = rev B (AHB)) | ||
149 | */ | ||
150 | |||
151 | /* | ||
152 | * REALVIEW_SYS_LOCK | ||
153 | * control access to SYS_OSCx, SYS_CFGDATAx, SYS_RESETCTL, | ||
154 | * SYS_CLD, SYS_BOOTCS | ||
155 | */ | ||
156 | #define REALVIEW_SYS_LOCK_LOCKED (1 << 16) | ||
157 | #define REALVIEW_SYS_LOCKVAL_MASK 0xFFFF /* write 0xA05F to enable write access */ | ||
158 | |||
159 | /* | ||
160 | * REALVIEW_SYS_FLASH | ||
161 | */ | ||
162 | #define REALVIEW_FLASHPROG_FLVPPEN (1 << 0) /* Enable writing to flash */ | ||
163 | |||
164 | /* | ||
165 | * REALVIEW_INTREG | ||
166 | * - used to acknowledge and control MMCI and UART interrupts | ||
167 | */ | ||
168 | #define REALVIEW_INTREG_WPROT 0x00 /* MMC protection status (no interrupt generated) */ | ||
169 | #define REALVIEW_INTREG_RI0 0x01 /* Ring indicator UART0 is asserted, */ | ||
170 | #define REALVIEW_INTREG_CARDIN 0x08 /* MMCI card in detect */ | ||
171 | /* write 1 to acknowledge and clear */ | ||
172 | #define REALVIEW_INTREG_RI1 0x02 /* Ring indicator UART1 is asserted, */ | ||
173 | #define REALVIEW_INTREG_CARDINSERT 0x03 /* Signal insertion of MMC card */ | ||
174 | |||
175 | /* | ||
176 | * REALVIEW peripheral addresses | ||
177 | */ | ||
178 | #define REALVIEW_SCTL_BASE 0x10001000 /* System controller */ | ||
179 | #define REALVIEW_I2C_BASE 0x10002000 /* I2C control */ | ||
180 | /* Reserved 0x10003000 */ | ||
181 | #define REALVIEW_AACI_BASE 0x10004000 /* Audio */ | ||
182 | #define REALVIEW_MMCI0_BASE 0x10005000 /* MMC interface */ | ||
183 | #define REALVIEW_KMI0_BASE 0x10006000 /* KMI interface */ | ||
184 | #define REALVIEW_KMI1_BASE 0x10007000 /* KMI 2nd interface */ | ||
185 | #define REALVIEW_CHAR_LCD_BASE 0x10008000 /* Character LCD */ | ||
186 | #define REALVIEW_UART0_BASE 0x10009000 /* UART 0 */ | ||
187 | #define REALVIEW_UART1_BASE 0x1000A000 /* UART 1 */ | ||
188 | #define REALVIEW_UART2_BASE 0x1000B000 /* UART 2 */ | ||
189 | #define REALVIEW_UART3_BASE 0x1000C000 /* UART 3 */ | ||
190 | #define REALVIEW_SSP_BASE 0x1000D000 /* Synchronous Serial Port */ | ||
191 | #define REALVIEW_SCI_BASE 0x1000E000 /* Smart card controller */ | ||
192 | /* Reserved 0x1000F000 */ | ||
193 | #define REALVIEW_WATCHDOG_BASE 0x10010000 /* watchdog interface */ | ||
194 | #define REALVIEW_TIMER0_1_BASE 0x10011000 /* Timer 0 and 1 */ | ||
195 | #define REALVIEW_TIMER2_3_BASE 0x10012000 /* Timer 2 and 3 */ | ||
196 | #define REALVIEW_GPIO0_BASE 0x10013000 /* GPIO port 0 */ | ||
197 | #define REALVIEW_GPIO1_BASE 0x10014000 /* GPIO port 1 */ | ||
198 | #define REALVIEW_GPIO2_BASE 0x10015000 /* GPIO port 2 */ | ||
199 | /* Reserved 0x10016000 */ | ||
200 | #define REALVIEW_RTC_BASE 0x10017000 /* Real Time Clock */ | ||
201 | #define REALVIEW_DMC_BASE 0x10018000 /* DMC configuration */ | ||
202 | #define REALVIEW_PCI_CORE_BASE 0x10019000 /* PCI configuration */ | ||
203 | /* Reserved 0x1001A000 - 0x1001FFFF */ | ||
204 | #define REALVIEW_CLCD_BASE 0x10020000 /* CLCD */ | ||
205 | #define REALVIEW_DMAC_BASE 0x10030000 /* DMA controller */ | ||
206 | #ifndef CONFIG_REALVIEW_MPCORE | ||
207 | #define REALVIEW_GIC_CPU_BASE 0x10040000 /* Generic interrupt controller CPU interface */ | ||
208 | #define REALVIEW_GIC_DIST_BASE 0x10041000 /* Generic interrupt controller distributor */ | ||
209 | #else | ||
210 | #define REALVIEW_MPCORE_SCU_BASE 0x10100000 /* SCU registers */ | ||
211 | #define REALVIEW_GIC_CPU_BASE 0x10100100 /* Generic interrupt controller CPU interface */ | ||
212 | #define REALVIEW_TWD_BASE 0x10100700 | ||
213 | #define REALVIEW_TWD_SIZE 0x00000100 | ||
214 | #define REALVIEW_GIC_DIST_BASE 0x10101000 /* Generic interrupt controller distributor */ | ||
215 | #endif | ||
216 | #define REALVIEW_SMC_BASE 0x10080000 /* SMC */ | ||
217 | /* Reserved 0x10090000 - 0x100EFFFF */ | ||
218 | |||
219 | #define REALVIEW_ETH_BASE 0x4E000000 /* Ethernet */ | ||
220 | |||
221 | /* PCI space */ | ||
222 | #define REALVIEW_PCI_BASE 0x41000000 /* PCI Interface */ | ||
223 | #define REALVIEW_PCI_CFG_BASE 0x42000000 | ||
224 | #define REALVIEW_PCI_MEM_BASE0 0x44000000 | ||
225 | #define REALVIEW_PCI_MEM_BASE1 0x50000000 | ||
226 | #define REALVIEW_PCI_MEM_BASE2 0x60000000 | ||
227 | /* Sizes of above maps */ | ||
228 | #define REALVIEW_PCI_BASE_SIZE 0x01000000 | ||
229 | #define REALVIEW_PCI_CFG_BASE_SIZE 0x02000000 | ||
230 | #define REALVIEW_PCI_MEM_BASE0_SIZE 0x0c000000 /* 32Mb */ | ||
231 | #define REALVIEW_PCI_MEM_BASE1_SIZE 0x10000000 /* 256Mb */ | ||
232 | #define REALVIEW_PCI_MEM_BASE2_SIZE 0x10000000 /* 256Mb */ | ||
233 | |||
234 | #define REALVIEW_SDRAM67_BASE 0x70000000 /* SDRAM banks 6 and 7 */ | ||
235 | #define REALVIEW_LT_BASE 0x80000000 /* Logic Tile expansion */ | ||
236 | |||
237 | /* | ||
238 | * Disk on Chip | ||
239 | */ | ||
240 | #define REALVIEW_DOC_BASE 0x2C000000 | ||
241 | #define REALVIEW_DOC_SIZE (16 << 20) | ||
242 | #define REALVIEW_DOC_PAGE_SIZE 512 | ||
243 | #define REALVIEW_DOC_TOTAL_PAGES (DOC_SIZE / PAGE_SIZE) | ||
244 | |||
245 | #define ERASE_UNIT_PAGES 32 | ||
246 | #define START_PAGE 0x80 | ||
247 | |||
248 | /* | ||
249 | * LED settings, bits [7:0] | ||
250 | */ | ||
251 | #define REALVIEW_SYS_LED0 (1 << 0) | ||
252 | #define REALVIEW_SYS_LED1 (1 << 1) | ||
253 | #define REALVIEW_SYS_LED2 (1 << 2) | ||
254 | #define REALVIEW_SYS_LED3 (1 << 3) | ||
255 | #define REALVIEW_SYS_LED4 (1 << 4) | ||
256 | #define REALVIEW_SYS_LED5 (1 << 5) | ||
257 | #define REALVIEW_SYS_LED6 (1 << 6) | ||
258 | #define REALVIEW_SYS_LED7 (1 << 7) | ||
259 | |||
260 | #define ALL_LEDS 0xFF | ||
261 | |||
262 | #define LED_BANK REALVIEW_SYS_LED | ||
263 | |||
264 | /* | ||
265 | * Control registers | ||
266 | */ | ||
267 | #define REALVIEW_IDFIELD_OFFSET 0x0 /* RealView build information */ | ||
268 | #define REALVIEW_FLASHPROG_OFFSET 0x4 /* Flash devices */ | ||
269 | #define REALVIEW_INTREG_OFFSET 0x8 /* Interrupt control */ | ||
270 | #define REALVIEW_DECODE_OFFSET 0xC /* Fitted logic modules */ | ||
271 | |||
272 | /* ------------------------------------------------------------------------ | ||
273 | * Interrupts - bit assignment (primary) | ||
274 | * ------------------------------------------------------------------------ | ||
275 | */ | ||
276 | #ifndef CONFIG_REALVIEW_MPCORE | ||
277 | #define INT_WDOGINT 0 /* Watchdog timer */ | ||
278 | #define INT_SOFTINT 1 /* Software interrupt */ | ||
279 | #define INT_COMMRx 2 /* Debug Comm Rx interrupt */ | ||
280 | #define INT_COMMTx 3 /* Debug Comm Tx interrupt */ | ||
281 | #define INT_TIMERINT0_1 4 /* Timer 0 and 1 */ | ||
282 | #define INT_TIMERINT2_3 5 /* Timer 2 and 3 */ | ||
283 | #define INT_GPIOINT0 6 /* GPIO 0 */ | ||
284 | #define INT_GPIOINT1 7 /* GPIO 1 */ | ||
285 | #define INT_GPIOINT2 8 /* GPIO 2 */ | ||
286 | /* 9 reserved */ | ||
287 | #define INT_RTCINT 10 /* Real Time Clock */ | ||
288 | #define INT_SSPINT 11 /* Synchronous Serial Port */ | ||
289 | #define INT_UARTINT0 12 /* UART 0 on development chip */ | ||
290 | #define INT_UARTINT1 13 /* UART 1 on development chip */ | ||
291 | #define INT_UARTINT2 14 /* UART 2 on development chip */ | ||
292 | #define INT_UARTINT3 15 /* UART 3 on development chip */ | ||
293 | #define INT_SCIINT 16 /* Smart Card Interface */ | ||
294 | #define INT_MMCI0A 17 /* Multimedia Card 0A */ | ||
295 | #define INT_MMCI0B 18 /* Multimedia Card 0B */ | ||
296 | #define INT_AACI 19 /* Audio Codec */ | ||
297 | #define INT_KMI0 20 /* Keyboard/Mouse port 0 */ | ||
298 | #define INT_KMI1 21 /* Keyboard/Mouse port 1 */ | ||
299 | #define INT_CHARLCD 22 /* Character LCD */ | ||
300 | #define INT_CLCDINT 23 /* CLCD controller */ | ||
301 | #define INT_DMAINT 24 /* DMA controller */ | ||
302 | #define INT_PWRFAILINT 25 /* Power failure */ | ||
303 | #define INT_PISMO 26 | ||
304 | #define INT_DoC 27 /* Disk on Chip memory controller */ | ||
305 | #define INT_ETH 28 /* Ethernet controller */ | ||
306 | #define INT_USB 29 /* USB controller */ | ||
307 | #define INT_TSPENINT 30 /* Touchscreen pen */ | ||
308 | #define INT_TSKPADINT 31 /* Touchscreen keypad */ | ||
309 | #else | ||
310 | #define INT_AACI 0 | ||
311 | #define INT_TIMERINT0_1 1 | ||
312 | #define INT_TIMERINT2_3 2 | ||
313 | #define INT_USB 3 | ||
314 | #define INT_UARTINT0 4 | ||
315 | #define INT_UARTINT1 5 | ||
316 | #define INT_RTCINT 6 | ||
317 | #define INT_KMI0 7 | ||
318 | #define INT_KMI1 8 | ||
319 | #define INT_ETH 9 | ||
320 | #define INT_EB_IRQ1 10 /* main GIC */ | ||
321 | #define INT_EB_IRQ2 11 /* tile GIC */ | ||
322 | #define INT_EB_FIQ1 12 /* main GIC */ | ||
323 | #define INT_EB_FIQ2 13 /* tile GIC */ | ||
324 | #define INT_MMCI0A 14 | ||
325 | #define INT_MMCI0B 15 | ||
326 | |||
327 | #define INT_PMU_CPU0 17 | ||
328 | #define INT_PMU_CPU1 18 | ||
329 | #define INT_PMU_CPU2 19 | ||
330 | #define INT_PMU_CPU3 20 | ||
331 | #define INT_PMU_SCU0 21 | ||
332 | #define INT_PMU_SCU1 22 | ||
333 | #define INT_PMU_SCU2 23 | ||
334 | #define INT_PMU_SCU3 24 | ||
335 | #define INT_PMU_SCU4 25 | ||
336 | #define INT_PMU_SCU5 26 | ||
337 | #define INT_PMU_SCU6 27 | ||
338 | #define INT_PMU_SCU7 28 | ||
339 | |||
340 | #define INT_L220_EVENT 29 | ||
341 | #define INT_L220_SLAVE 30 | ||
342 | #define INT_L220_DECODE 31 | ||
343 | |||
344 | #define INT_UARTINT2 -1 | ||
345 | #define INT_UARTINT3 -1 | ||
346 | #define INT_CLCDINT -1 | ||
347 | #define INT_DMAINT -1 | ||
348 | #define INT_WDOGINT -1 | ||
349 | #define INT_GPIOINT0 -1 | ||
350 | #define INT_GPIOINT1 -1 | ||
351 | #define INT_GPIOINT2 -1 | ||
352 | #define INT_SCIINT -1 | ||
353 | #define INT_SSPINT -1 | ||
354 | #endif | ||
355 | |||
356 | /* | ||
357 | * Interrupt bit positions | ||
358 | * | ||
359 | */ | ||
360 | #define INTMASK_WDOGINT (1 << INT_WDOGINT) | ||
361 | #define INTMASK_SOFTINT (1 << INT_SOFTINT) | ||
362 | #define INTMASK_COMMRx (1 << INT_COMMRx) | ||
363 | #define INTMASK_COMMTx (1 << INT_COMMTx) | ||
364 | #define INTMASK_TIMERINT0_1 (1 << INT_TIMERINT0_1) | ||
365 | #define INTMASK_TIMERINT2_3 (1 << INT_TIMERINT2_3) | ||
366 | #define INTMASK_GPIOINT0 (1 << INT_GPIOINT0) | ||
367 | #define INTMASK_GPIOINT1 (1 << INT_GPIOINT1) | ||
368 | #define INTMASK_GPIOINT2 (1 << INT_GPIOINT2) | ||
369 | #define INTMASK_RTCINT (1 << INT_RTCINT) | ||
370 | #define INTMASK_SSPINT (1 << INT_SSPINT) | ||
371 | #define INTMASK_UARTINT0 (1 << INT_UARTINT0) | ||
372 | #define INTMASK_UARTINT1 (1 << INT_UARTINT1) | ||
373 | #define INTMASK_UARTINT2 (1 << INT_UARTINT2) | ||
374 | #define INTMASK_UARTINT3 (1 << INT_UARTINT3) | ||
375 | #define INTMASK_SCIINT (1 << INT_SCIINT) | ||
376 | #define INTMASK_MMCI0A (1 << INT_MMCI0A) | ||
377 | #define INTMASK_MMCI0B (1 << INT_MMCI0B) | ||
378 | #define INTMASK_AACI (1 << INT_AACI) | ||
379 | #define INTMASK_KMI0 (1 << INT_KMI0) | ||
380 | #define INTMASK_KMI1 (1 << INT_KMI1) | ||
381 | #define INTMASK_CHARLCD (1 << INT_CHARLCD) | ||
382 | #define INTMASK_CLCDINT (1 << INT_CLCDINT) | ||
383 | #define INTMASK_DMAINT (1 << INT_DMAINT) | ||
384 | #define INTMASK_PWRFAILINT (1 << INT_PWRFAILINT) | ||
385 | #define INTMASK_PISMO (1 << INT_PISMO) | ||
386 | #define INTMASK_DoC (1 << INT_DoC) | ||
387 | #define INTMASK_ETH (1 << INT_ETH) | ||
388 | #define INTMASK_USB (1 << INT_USB) | ||
389 | #define INTMASK_TSPENINT (1 << INT_TSPENINT) | ||
390 | #define INTMASK_TSKPADINT (1 << INT_TSKPADINT) | ||
391 | |||
392 | #define MAXIRQNUM 31 | ||
393 | #define MAXFIQNUM 31 | ||
394 | #define MAXSWINUM 31 | ||
395 | |||
396 | /* | ||
397 | * Application Flash | ||
398 | * | ||
399 | */ | ||
400 | #define FLASH_BASE REALVIEW_FLASH_BASE | ||
401 | #define FLASH_SIZE REALVIEW_FLASH_SIZE | ||
402 | #define FLASH_END (FLASH_BASE + FLASH_SIZE - 1) | ||
403 | #define FLASH_BLOCK_SIZE SZ_128K | ||
404 | |||
405 | /* | ||
406 | * Boot Flash | ||
407 | * | ||
408 | */ | ||
409 | #define EPROM_BASE REALVIEW_BOOT_ROM_HI | ||
410 | #define EPROM_SIZE REALVIEW_BOOT_ROM_SIZE | ||
411 | #define EPROM_END (EPROM_BASE + EPROM_SIZE - 1) | ||
412 | |||
413 | /* | ||
414 | * Clean base - dummy | ||
415 | * | ||
416 | */ | ||
417 | #define CLEAN_BASE EPROM_BASE | ||
418 | |||
419 | /* | ||
420 | * System controller bit assignment | ||
421 | */ | ||
422 | #define REALVIEW_REFCLK 0 | ||
423 | #define REALVIEW_TIMCLK 1 | ||
424 | |||
425 | #define REALVIEW_TIMER1_EnSel 15 | ||
426 | #define REALVIEW_TIMER2_EnSel 17 | ||
427 | #define REALVIEW_TIMER3_EnSel 19 | ||
428 | #define REALVIEW_TIMER4_EnSel 21 | ||
429 | |||
430 | |||
431 | #define MAX_TIMER 2 | ||
432 | #define MAX_PERIOD 699050 | ||
433 | #define TICKS_PER_uSEC 1 | ||
434 | |||
435 | /* | ||
436 | * These are useconds NOT ticks. | ||
437 | * | ||
438 | */ | ||
439 | #define mSEC_1 1000 | ||
440 | #define mSEC_5 (mSEC_1 * 5) | ||
441 | #define mSEC_10 (mSEC_1 * 10) | ||
442 | #define mSEC_25 (mSEC_1 * 25) | ||
443 | #define SEC_1 (mSEC_1 * 1000) | ||
444 | |||
445 | #define REALVIEW_CSR_BASE 0x10000000 | ||
446 | #define REALVIEW_CSR_SIZE 0x10000000 | ||
447 | |||
448 | #endif | ||
449 | |||
450 | /* END */ | ||
diff --git a/include/asm-arm/arch-realview/smp.h b/include/asm-arm/arch-realview/smp.h new file mode 100644 index 000000000000..fc87783e8e8b --- /dev/null +++ b/include/asm-arm/arch-realview/smp.h | |||
@@ -0,0 +1,31 @@ | |||
1 | #ifndef ASMARM_ARCH_SMP_H | ||
2 | #define ASMARM_ARCH_SMP_H | ||
3 | |||
4 | #include <linux/config.h> | ||
5 | |||
6 | #include <asm/hardware/gic.h> | ||
7 | |||
8 | #define hard_smp_processor_id() \ | ||
9 | ({ \ | ||
10 | unsigned int cpunum; \ | ||
11 | __asm__("mrc p15, 0, %0, c0, c0, 5" \ | ||
12 | : "=r" (cpunum)); \ | ||
13 | cpunum &= 0x0F; \ | ||
14 | }) | ||
15 | |||
16 | /* | ||
17 | * We use IRQ1 as the IPI | ||
18 | */ | ||
19 | static inline void smp_cross_call(cpumask_t callmap) | ||
20 | { | ||
21 | gic_raise_softirq(callmap, 1); | ||
22 | } | ||
23 | |||
24 | /* | ||
25 | * Do nothing on MPcore. | ||
26 | */ | ||
27 | static inline void smp_cross_call_done(cpumask_t callmap) | ||
28 | { | ||
29 | } | ||
30 | |||
31 | #endif | ||
diff --git a/include/asm-arm/arch-realview/system.h b/include/asm-arm/arch-realview/system.h new file mode 100644 index 000000000000..6f3d0ce0ca1e --- /dev/null +++ b/include/asm-arm/arch-realview/system.h | |||
@@ -0,0 +1,51 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-realview/system.h | ||
3 | * | ||
4 | * Copyright (C) 2003 ARM Limited | ||
5 | * Copyright (C) 2000 Deep Blue Solutions Ltd | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | */ | ||
21 | #ifndef __ASM_ARCH_SYSTEM_H | ||
22 | #define __ASM_ARCH_SYSTEM_H | ||
23 | |||
24 | #include <asm/hardware.h> | ||
25 | #include <asm/io.h> | ||
26 | #include <asm/arch/platform.h> | ||
27 | |||
28 | static inline void arch_idle(void) | ||
29 | { | ||
30 | /* | ||
31 | * This should do all the clock switching | ||
32 | * and wait for interrupt tricks | ||
33 | */ | ||
34 | cpu_do_idle(); | ||
35 | } | ||
36 | |||
37 | static inline void arch_reset(char mode) | ||
38 | { | ||
39 | void __iomem *hdr_ctrl = __io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_RESETCTL_OFFSET; | ||
40 | unsigned int val; | ||
41 | |||
42 | /* | ||
43 | * To reset, we hit the on-board reset register | ||
44 | * in the system FPGA | ||
45 | */ | ||
46 | val = __raw_readl(hdr_ctrl); | ||
47 | val |= REALVIEW_SYS_CTRL_RESET_CONFIGCLR; | ||
48 | __raw_writel(val, hdr_ctrl); | ||
49 | } | ||
50 | |||
51 | #endif | ||
diff --git a/include/asm-arm/arch-realview/timex.h b/include/asm-arm/arch-realview/timex.h new file mode 100644 index 000000000000..5b9d82d0a5e0 --- /dev/null +++ b/include/asm-arm/arch-realview/timex.h | |||
@@ -0,0 +1,23 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-realview/timex.h | ||
3 | * | ||
4 | * RealView architecture timex specifications | ||
5 | * | ||
6 | * Copyright (C) 2003 ARM Limited | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | */ | ||
22 | |||
23 | #define CLOCK_TICK_RATE (50000000 / 16) | ||
diff --git a/include/asm-arm/arch-realview/uncompress.h b/include/asm-arm/arch-realview/uncompress.h new file mode 100644 index 000000000000..b5e4d360665b --- /dev/null +++ b/include/asm-arm/arch-realview/uncompress.h | |||
@@ -0,0 +1,54 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-realview/uncompress.h | ||
3 | * | ||
4 | * Copyright (C) 2003 ARM Limited | ||
5 | * | ||
6 | * 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 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | #include <asm/hardware.h> | ||
21 | |||
22 | #define AMBA_UART_DR (*(volatile unsigned char *) (REALVIEW_UART0_BASE + 0x00)) | ||
23 | #define AMBA_UART_LCRH (*(volatile unsigned char *) (REALVIEW_UART0_BASE + 0x2c)) | ||
24 | #define AMBA_UART_CR (*(volatile unsigned char *) (REALVIEW_UART0_BASE + 0x30)) | ||
25 | #define AMBA_UART_FR (*(volatile unsigned char *) (REALVIEW_UART0_BASE + 0x18)) | ||
26 | |||
27 | /* | ||
28 | * This does not append a newline | ||
29 | */ | ||
30 | static void putstr(const char *s) | ||
31 | { | ||
32 | while (*s) { | ||
33 | while (AMBA_UART_FR & (1 << 5)) | ||
34 | barrier(); | ||
35 | |||
36 | AMBA_UART_DR = *s; | ||
37 | |||
38 | if (*s == '\n') { | ||
39 | while (AMBA_UART_FR & (1 << 5)) | ||
40 | barrier(); | ||
41 | |||
42 | AMBA_UART_DR = '\r'; | ||
43 | } | ||
44 | s++; | ||
45 | } | ||
46 | while (AMBA_UART_FR & (1 << 3)) | ||
47 | barrier(); | ||
48 | } | ||
49 | |||
50 | /* | ||
51 | * nothing to do | ||
52 | */ | ||
53 | #define arch_decomp_setup() | ||
54 | #define arch_decomp_wdog() | ||
diff --git a/include/asm-arm/arch-realview/vmalloc.h b/include/asm-arm/arch-realview/vmalloc.h new file mode 100644 index 000000000000..0ad49af186af --- /dev/null +++ b/include/asm-arm/arch-realview/vmalloc.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* | ||
2 | * linux/include/asm-arm/arch-realview/vmalloc.h | ||
3 | * | ||
4 | * Copyright (C) 2003 ARM Limited | ||
5 | * Copyright (C) 2000 Russell King. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | */ | ||
21 | #define VMALLOC_END (PAGE_OFFSET + 0x18000000) | ||
diff --git a/include/asm-arm/arch-rpc/hardware.h b/include/asm-arm/arch-rpc/hardware.h index be9754a05c19..9d7f87375aa7 100644 --- a/include/asm-arm/arch-rpc/hardware.h +++ b/include/asm-arm/arch-rpc/hardware.h | |||
@@ -15,7 +15,7 @@ | |||
15 | #include <asm/arch/memory.h> | 15 | #include <asm/arch/memory.h> |
16 | 16 | ||
17 | #ifndef __ASSEMBLY__ | 17 | #ifndef __ASSEMBLY__ |
18 | #define IOMEM(x) ((void __iomem *)(x)) | 18 | #define IOMEM(x) ((void __iomem *)(unsigned long)(x)) |
19 | #else | 19 | #else |
20 | #define IOMEM(x) x | 20 | #define IOMEM(x) x |
21 | #endif /* __ASSEMBLY__ */ | 21 | #endif /* __ASSEMBLY__ */ |
@@ -52,7 +52,7 @@ | |||
52 | /* | 52 | /* |
53 | * IO Addresses | 53 | * IO Addresses |
54 | */ | 54 | */ |
55 | #define VIDC_BASE (void __iomem *)0xe0400000 | 55 | #define VIDC_BASE IOMEM(0xe0400000) |
56 | #define EXPMASK_BASE 0xe0360000 | 56 | #define EXPMASK_BASE 0xe0360000 |
57 | #define IOMD_BASE IOMEM(0xe0200000) | 57 | #define IOMD_BASE IOMEM(0xe0200000) |
58 | #define IOC_BASE IOMEM(0xe0200000) | 58 | #define IOC_BASE IOMEM(0xe0200000) |
diff --git a/include/asm-arm/arch-rpc/io.h b/include/asm-arm/arch-rpc/io.h index 24453c405a87..b4da08d7a336 100644 --- a/include/asm-arm/arch-rpc/io.h +++ b/include/asm-arm/arch-rpc/io.h | |||
@@ -13,6 +13,8 @@ | |||
13 | #ifndef __ASM_ARM_ARCH_IO_H | 13 | #ifndef __ASM_ARM_ARCH_IO_H |
14 | #define __ASM_ARM_ARCH_IO_H | 14 | #define __ASM_ARM_ARCH_IO_H |
15 | 15 | ||
16 | #include <asm/hardware.h> | ||
17 | |||
16 | #define IO_SPACE_LIMIT 0xffffffff | 18 | #define IO_SPACE_LIMIT 0xffffffff |
17 | 19 | ||
18 | /* | 20 | /* |
diff --git a/include/asm-arm/arch-rpc/memory.h b/include/asm-arm/arch-rpc/memory.h index 33fc75cdead0..0592cb3f0c74 100644 --- a/include/asm-arm/arch-rpc/memory.h +++ b/include/asm-arm/arch-rpc/memory.h | |||
@@ -21,7 +21,7 @@ | |||
21 | /* | 21 | /* |
22 | * Physical DRAM offset. | 22 | * Physical DRAM offset. |
23 | */ | 23 | */ |
24 | #define PHYS_OFFSET (0x10000000UL) | 24 | #define PHYS_OFFSET UL(0x10000000) |
25 | 25 | ||
26 | /* | 26 | /* |
27 | * These are exactly the same on the RiscPC as the | 27 | * These are exactly the same on the RiscPC as the |
diff --git a/include/asm-arm/arch-rpc/system.h b/include/asm-arm/arch-rpc/system.h index ca3277d1d5ea..729c2ae4b513 100644 --- a/include/asm-arm/arch-rpc/system.h +++ b/include/asm-arm/arch-rpc/system.h | |||
@@ -7,7 +7,7 @@ | |||
7 | * it under the terms of the GNU General Public License version 2 as | 7 | * it under the terms of the GNU General Public License version 2 as |
8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
9 | */ | 9 | */ |
10 | #include <asm/arch/hardware.h> | 10 | #include <asm/hardware.h> |
11 | #include <asm/hardware/iomd.h> | 11 | #include <asm/hardware/iomd.h> |
12 | #include <asm/io.h> | 12 | #include <asm/io.h> |
13 | 13 | ||
diff --git a/include/asm-arm/arch-s3c2410/anubis-map.h b/include/asm-arm/arch-s3c2410/anubis-map.h index 97741d6e506a..d529ffda8599 100644 --- a/include/asm-arm/arch-s3c2410/anubis-map.h +++ b/include/asm-arm/arch-s3c2410/anubis-map.h | |||
@@ -20,22 +20,22 @@ | |||
20 | 20 | ||
21 | /* start peripherals off after the S3C2410 */ | 21 | /* start peripherals off after the S3C2410 */ |
22 | 22 | ||
23 | #define ANUBIS_IOADDR(x) (S3C2410_ADDR((x) + 0x02000000)) | 23 | #define ANUBIS_IOADDR(x) (S3C2410_ADDR((x) + 0x01800000)) |
24 | 24 | ||
25 | #define ANUBIS_PA_CPLD (S3C2410_CS1 | (1<<26)) | 25 | #define ANUBIS_PA_CPLD (S3C2410_CS1 | (1<<26)) |
26 | 26 | ||
27 | /* we put the CPLD registers next, to get them out of the way */ | 27 | /* we put the CPLD registers next, to get them out of the way */ |
28 | 28 | ||
29 | #define ANUBIS_VA_CTRL1 ANUBIS_IOADDR(0x00000000) /* 0x01300000 */ | 29 | #define ANUBIS_VA_CTRL1 ANUBIS_IOADDR(0x00000000) /* 0x01800000 */ |
30 | #define ANUBIS_PA_CTRL1 (ANUBIS_PA_CPLD) | 30 | #define ANUBIS_PA_CTRL1 (ANUBIS_PA_CPLD) |
31 | 31 | ||
32 | #define ANUBIS_VA_CTRL2 ANUBIS_IOADDR(0x00100000) /* 0x01400000 */ | 32 | #define ANUBIS_VA_CTRL2 ANUBIS_IOADDR(0x00100000) /* 0x01900000 */ |
33 | #define ANUBIS_PA_CTRL2 (ANUBIS_PA_CPLD) | 33 | #define ANUBIS_PA_CTRL2 (ANUBIS_PA_CPLD) |
34 | 34 | ||
35 | #define ANUBIS_VA_CTRL3 ANUBIS_IOADDR(0x00200000) /* 0x01500000 */ | 35 | #define ANUBIS_VA_CTRL3 ANUBIS_IOADDR(0x00200000) /* 0x01A00000 */ |
36 | #define ANUBIS_PA_CTRL3 (ANUBIS_PA_CPLD) | 36 | #define ANUBIS_PA_CTRL3 (ANUBIS_PA_CPLD) |
37 | 37 | ||
38 | #define ANUBIS_VA_CTRL4 ANUBIS_IOADDR(0x00300000) /* 0x01600000 */ | 38 | #define ANUBIS_VA_CTRL4 ANUBIS_IOADDR(0x00300000) /* 0x01B00000 */ |
39 | #define ANUBIS_PA_CTRL4 (ANUBIS_PA_CPLD) | 39 | #define ANUBIS_PA_CTRL4 (ANUBIS_PA_CPLD) |
40 | 40 | ||
41 | #define ANUBIS_IDEPRI ANUBIS_IOADDR(0x01000000) | 41 | #define ANUBIS_IDEPRI ANUBIS_IOADDR(0x01000000) |
diff --git a/include/asm-arm/arch-s3c2410/fb.h b/include/asm-arm/arch-s3c2410/fb.h index ac57bc887d82..4790491ba9d0 100644 --- a/include/asm-arm/arch-s3c2410/fb.h +++ b/include/asm-arm/arch-s3c2410/fb.h | |||
@@ -13,6 +13,7 @@ | |||
13 | * 07-Sep-2004 RTP Created file | 13 | * 07-Sep-2004 RTP Created file |
14 | * 03-Nov-2004 BJD Updated and minor cleanups | 14 | * 03-Nov-2004 BJD Updated and minor cleanups |
15 | * 03-Aug-2005 RTP Renamed to fb.h | 15 | * 03-Aug-2005 RTP Renamed to fb.h |
16 | * 26-Oct-2005 BJD Changed name of platdata init | ||
16 | */ | 17 | */ |
17 | 18 | ||
18 | #ifndef __ASM_ARM_FB_H | 19 | #ifndef __ASM_ARM_FB_H |
@@ -64,6 +65,6 @@ struct s3c2410fb_mach_info { | |||
64 | unsigned long lpcsel; | 65 | unsigned long lpcsel; |
65 | }; | 66 | }; |
66 | 67 | ||
67 | void __init set_s3c2410fb_info(struct s3c2410fb_mach_info *hard_s3c2410fb_info); | 68 | extern void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *); |
68 | 69 | ||
69 | #endif /* __ASM_ARM_FB_H */ | 70 | #endif /* __ASM_ARM_FB_H */ |
diff --git a/include/asm-arm/arch-s3c2410/hardware.h b/include/asm-arm/arch-s3c2410/hardware.h index 48a39918a760..1c9de29cafef 100644 --- a/include/asm-arm/arch-s3c2410/hardware.h +++ b/include/asm-arm/arch-s3c2410/hardware.h | |||
@@ -92,6 +92,13 @@ extern unsigned int s3c2410_gpio_getpin(unsigned int pin); | |||
92 | 92 | ||
93 | extern unsigned int s3c2410_modify_misccr(unsigned int clr, unsigned int chg); | 93 | extern unsigned int s3c2410_modify_misccr(unsigned int clr, unsigned int chg); |
94 | 94 | ||
95 | #ifdef CONFIG_CPU_S3C2440 | ||
96 | |||
97 | extern int s3c2440_set_dsc(unsigned int pin, unsigned int value); | ||
98 | |||
99 | #endif /* CONFIG_CPU_S3C2440 */ | ||
100 | |||
101 | |||
95 | #endif /* __ASSEMBLY__ */ | 102 | #endif /* __ASSEMBLY__ */ |
96 | 103 | ||
97 | #include <asm/sizes.h> | 104 | #include <asm/sizes.h> |
diff --git a/include/asm-arm/arch-s3c2410/io.h b/include/asm-arm/arch-s3c2410/io.h index 418233a7ee6f..16fbc8afffd9 100644 --- a/include/asm-arm/arch-s3c2410/io.h +++ b/include/asm-arm/arch-s3c2410/io.h | |||
@@ -9,12 +9,14 @@ | |||
9 | * 06-Dec-1997 RMK Created. | 9 | * 06-Dec-1997 RMK Created. |
10 | * 02-Sep-2003 BJD Modified for S3C2410 | 10 | * 02-Sep-2003 BJD Modified for S3C2410 |
11 | * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA | 11 | * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA |
12 | * | 12 | * 13-Oct-2005 BJD Fixed problems with LDRH/STRH offset range |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #ifndef __ASM_ARM_ARCH_IO_H | 15 | #ifndef __ASM_ARM_ARCH_IO_H |
16 | #define __ASM_ARM_ARCH_IO_H | 16 | #define __ASM_ARM_ARCH_IO_H |
17 | 17 | ||
18 | #include <asm/hardware.h> | ||
19 | |||
18 | #define IO_SPACE_LIMIT 0xffffffff | 20 | #define IO_SPACE_LIMIT 0xffffffff |
19 | 21 | ||
20 | /* | 22 | /* |
@@ -97,7 +99,7 @@ DECLARE_IO(int,l,"") | |||
97 | else \ | 99 | else \ |
98 | __asm__ __volatile__( \ | 100 | __asm__ __volatile__( \ |
99 | "strb %0, [%1, #0] @ outbc" \ | 101 | "strb %0, [%1, #0] @ outbc" \ |
100 | : : "r" (value), "r" ((port))); \ | 102 | : : "r" (value), "r" ((port))); \ |
101 | }) | 103 | }) |
102 | 104 | ||
103 | #define __inbc(port) \ | 105 | #define __inbc(port) \ |
@@ -110,35 +112,61 @@ DECLARE_IO(int,l,"") | |||
110 | else \ | 112 | else \ |
111 | __asm__ __volatile__( \ | 113 | __asm__ __volatile__( \ |
112 | "ldrb %0, [%1, #0] @ inbc" \ | 114 | "ldrb %0, [%1, #0] @ inbc" \ |
113 | : "=r" (result) : "r" ((port))); \ | 115 | : "=r" (result) : "r" ((port))); \ |
114 | result; \ | 116 | result; \ |
115 | }) | 117 | }) |
116 | 118 | ||
117 | #define __outwc(value,port) \ | 119 | #define __outwc(value,port) \ |
118 | ({ \ | 120 | ({ \ |
119 | unsigned long v = value; \ | 121 | unsigned long v = value; \ |
120 | if (__PORT_PCIO((port))) \ | 122 | if (__PORT_PCIO((port))) { \ |
121 | __asm__ __volatile__( \ | 123 | if ((port) < 256 && (port) > -256) \ |
122 | "strh %0, [%1, %2] @ outwc" \ | 124 | __asm__ __volatile__( \ |
123 | : : "r" (v), "r" (PCIO_BASE), "Jr" ((port))); \ | 125 | "strh %0, [%1, %2] @ outwc" \ |
124 | else \ | 126 | : : "r" (v), "r" (PCIO_BASE), "Jr" ((port))); \ |
127 | else if ((port) > 0) \ | ||
128 | __asm__ __volatile__( \ | ||
129 | "strh %0, [%1, %2] @ outwc" \ | ||
130 | : : "r" (v), \ | ||
131 | "r" (PCIO_BASE + ((port) & ~0xff)), \ | ||
132 | "Jr" (((port) & 0xff))); \ | ||
133 | else \ | ||
134 | __asm__ __volatile__( \ | ||
135 | "strh %0, [%1, #0] @ outwc" \ | ||
136 | : : "r" (v), \ | ||
137 | "r" (PCIO_BASE + (port))); \ | ||
138 | } else \ | ||
125 | __asm__ __volatile__( \ | 139 | __asm__ __volatile__( \ |
126 | "strh %0, [%1, #0] @ outwc" \ | 140 | "strh %0, [%1, #0] @ outwc" \ |
127 | : : "r" (v), "r" ((port))); \ | 141 | : : "r" (v), "r" ((port))); \ |
128 | }) | 142 | }) |
129 | 143 | ||
130 | #define __inwc(port) \ | 144 | #define __inwc(port) \ |
131 | ({ \ | 145 | ({ \ |
132 | unsigned short result; \ | 146 | unsigned short result; \ |
133 | if (__PORT_PCIO((port))) \ | 147 | if (__PORT_PCIO((port))) { \ |
134 | __asm__ __volatile__( \ | 148 | if ((port) < 256 && (port) > -256 ) \ |
135 | "ldrh %0, [%1, %2] @ inwc" \ | 149 | __asm__ __volatile__( \ |
136 | : "=r" (result) : "r" (PCIO_BASE), "Jr" ((port))); \ | 150 | "ldrh %0, [%1, %2] @ inwc" \ |
137 | else \ | 151 | : "=r" (result) \ |
152 | : "r" (PCIO_BASE), \ | ||
153 | "Jr" ((port))); \ | ||
154 | else if ((port) > 0) \ | ||
155 | __asm__ __volatile__( \ | ||
156 | "ldrh %0, [%1, %2] @ inwc" \ | ||
157 | : "=r" (result) \ | ||
158 | : "r" (PCIO_BASE + ((port) & ~0xff)), \ | ||
159 | "Jr" (((port) & 0xff))); \ | ||
160 | else \ | ||
161 | __asm__ __volatile__( \ | ||
162 | "ldrh %0, [%1, #0] @ inwc" \ | ||
163 | : "=r" (result) \ | ||
164 | : "r" (PCIO_BASE + ((port)))); \ | ||
165 | } else \ | ||
138 | __asm__ __volatile__( \ | 166 | __asm__ __volatile__( \ |
139 | "ldrh %0, [%1, #0] @ inwc" \ | 167 | "ldrh %0, [%1, #0] @ inwc" \ |
140 | : "=r" (result) : "r" ((port))); \ | 168 | : "=r" (result) : "r" ((port))); \ |
141 | result; \ | 169 | result; \ |
142 | }) | 170 | }) |
143 | 171 | ||
144 | #define __outlc(value,port) \ | 172 | #define __outlc(value,port) \ |
diff --git a/include/asm-arm/arch-s3c2410/memory.h b/include/asm-arm/arch-s3c2410/memory.h index 3380ab1d0749..6ab834a14c8e 100644 --- a/include/asm-arm/arch-s3c2410/memory.h +++ b/include/asm-arm/arch-s3c2410/memory.h | |||
@@ -28,9 +28,9 @@ | |||
28 | * and at 0x0C000000 for S3C2400 | 28 | * and at 0x0C000000 for S3C2400 |
29 | */ | 29 | */ |
30 | #ifdef CONFIG_CPU_S3C2400 | 30 | #ifdef CONFIG_CPU_S3C2400 |
31 | #define PHYS_OFFSET (0x0C000000UL) | 31 | #define PHYS_OFFSET UL(0x0C000000) |
32 | #else | 32 | #else |
33 | #define PHYS_OFFSET (0x30000000UL) | 33 | #define PHYS_OFFSET UL(0x30000000) |
34 | #endif | 34 | #endif |
35 | 35 | ||
36 | /* | 36 | /* |
diff --git a/include/asm-arm/arch-s3c2410/regs-clock.h b/include/asm-arm/arch-s3c2410/regs-clock.h index 16f4c3cc1388..34360706e016 100644 --- a/include/asm-arm/arch-s3c2410/regs-clock.h +++ b/include/asm-arm/arch-s3c2410/regs-clock.h | |||
@@ -18,7 +18,9 @@ | |||
18 | * 10-Feb-2005 Ben Dooks Fixed CAMDIVN address (Guillaume Gourat) | 18 | * 10-Feb-2005 Ben Dooks Fixed CAMDIVN address (Guillaume Gourat) |
19 | * 10-Mar-2005 Lucas Villa Real Changed S3C2410_VA to S3C24XX_VA | 19 | * 10-Mar-2005 Lucas Villa Real Changed S3C2410_VA to S3C24XX_VA |
20 | * 27-Aug-2005 Ben Dooks Add clock-slow info | 20 | * 27-Aug-2005 Ben Dooks Add clock-slow info |
21 | */ | 21 | * 20-Oct-2005 Ben Dooks Fixed overflow in PLL (Guillaume Gourat) |
22 | * 20-Oct-2005 Ben Dooks Add masks for DCLK (Guillaume Gourat) | ||
23 | */ | ||
22 | 24 | ||
23 | #ifndef __ASM_ARM_REGS_CLOCK | 25 | #ifndef __ASM_ARM_REGS_CLOCK |
24 | #define __ASM_ARM_REGS_CLOCK "$Id: clock.h,v 1.4 2003/04/30 14:50:51 ben Exp $" | 26 | #define __ASM_ARM_REGS_CLOCK "$Id: clock.h,v 1.4 2003/04/30 14:50:51 ben Exp $" |
@@ -66,11 +68,16 @@ | |||
66 | #define S3C2410_DCLKCON_DCLK0_UCLK (1<<1) | 68 | #define S3C2410_DCLKCON_DCLK0_UCLK (1<<1) |
67 | #define S3C2410_DCLKCON_DCLK0_DIV(x) (((x) - 1 )<<4) | 69 | #define S3C2410_DCLKCON_DCLK0_DIV(x) (((x) - 1 )<<4) |
68 | #define S3C2410_DCLKCON_DCLK0_CMP(x) (((x) - 1 )<<8) | 70 | #define S3C2410_DCLKCON_DCLK0_CMP(x) (((x) - 1 )<<8) |
71 | #define S3C2410_DCLKCON_DCLK0_DIV_MASK ((0xf)<<4) | ||
72 | #define S3C2410_DCLKCON_DCLK0_CMP_MASK ((0xf)<<8) | ||
69 | 73 | ||
70 | #define S3C2410_DCLKCON_DCLK1EN (1<<16) | 74 | #define S3C2410_DCLKCON_DCLK1EN (1<<16) |
71 | #define S3C2410_DCLKCON_DCLK1_PCLK (0<<17) | 75 | #define S3C2410_DCLKCON_DCLK1_PCLK (0<<17) |
72 | #define S3C2410_DCLKCON_DCLK1_UCLK (1<<17) | 76 | #define S3C2410_DCLKCON_DCLK1_UCLK (1<<17) |
73 | #define S3C2410_DCLKCON_DCLK1_DIV(x) (((x) - 1) <<20) | 77 | #define S3C2410_DCLKCON_DCLK1_DIV(x) (((x) - 1) <<20) |
78 | #define S3C2410_DCLKCON_DCLK1_CMP(x) (((x) - 1) <<24) | ||
79 | #define S3C2410_DCLKCON_DCLK1_DIV_MASK ((0xf) <<20) | ||
80 | #define S3C2410_DCLKCON_DCLK1_CMP_MASK ((0xf) <<24) | ||
74 | 81 | ||
75 | #define S3C2410_CLKDIVN_PDIVN (1<<0) | 82 | #define S3C2410_CLKDIVN_PDIVN (1<<0) |
76 | #define S3C2410_CLKDIVN_HDIVN (1<<1) | 83 | #define S3C2410_CLKDIVN_HDIVN (1<<1) |
@@ -83,10 +90,13 @@ | |||
83 | 90 | ||
84 | #ifndef __ASSEMBLY__ | 91 | #ifndef __ASSEMBLY__ |
85 | 92 | ||
93 | #include <asm/div64.h> | ||
94 | |||
86 | static inline unsigned int | 95 | static inline unsigned int |
87 | s3c2410_get_pll(int pllval, int baseclk) | 96 | s3c2410_get_pll(unsigned int pllval, unsigned int baseclk) |
88 | { | 97 | { |
89 | int mdiv, pdiv, sdiv; | 98 | unsigned int mdiv, pdiv, sdiv; |
99 | uint64_t fvco; | ||
90 | 100 | ||
91 | mdiv = pllval >> S3C2410_PLLCON_MDIVSHIFT; | 101 | mdiv = pllval >> S3C2410_PLLCON_MDIVSHIFT; |
92 | pdiv = pllval >> S3C2410_PLLCON_PDIVSHIFT; | 102 | pdiv = pllval >> S3C2410_PLLCON_PDIVSHIFT; |
@@ -96,7 +106,10 @@ s3c2410_get_pll(int pllval, int baseclk) | |||
96 | pdiv &= S3C2410_PLLCON_PDIVMASK; | 106 | pdiv &= S3C2410_PLLCON_PDIVMASK; |
97 | sdiv &= S3C2410_PLLCON_SDIVMASK; | 107 | sdiv &= S3C2410_PLLCON_SDIVMASK; |
98 | 108 | ||
99 | return (baseclk * (mdiv + 8)) / ((pdiv + 2) << sdiv); | 109 | fvco = (uint64_t)baseclk * (mdiv + 8); |
110 | do_div(fvco, (pdiv + 2) << sdiv); | ||
111 | |||
112 | return (unsigned int)fvco; | ||
100 | } | 113 | } |
101 | 114 | ||
102 | #endif /* __ASSEMBLY__ */ | 115 | #endif /* __ASSEMBLY__ */ |
diff --git a/include/asm-arm/arch-s3c2410/regs-gpio.h b/include/asm-arm/arch-s3c2410/regs-gpio.h index 2053cbacffc3..7f1be48ad67e 100644 --- a/include/asm-arm/arch-s3c2410/regs-gpio.h +++ b/include/asm-arm/arch-s3c2410/regs-gpio.h | |||
@@ -20,6 +20,8 @@ | |||
20 | * 18-11-2004 BJD Added S3C2440 AC97 controls | 20 | * 18-11-2004 BJD Added S3C2440 AC97 controls |
21 | * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA | 21 | * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA |
22 | * 28-Mar-2005 LCVR Fixed definition of GPB10 | 22 | * 28-Mar-2005 LCVR Fixed definition of GPB10 |
23 | * 26-Oct-2005 BJD Added generic configuration types | ||
24 | * 27-Nov-2005 LCVR Added definitions to S3C2400 registers | ||
23 | */ | 25 | */ |
24 | 26 | ||
25 | 27 | ||
@@ -43,17 +45,26 @@ | |||
43 | /* general configuration options */ | 45 | /* general configuration options */ |
44 | 46 | ||
45 | #define S3C2410_GPIO_LEAVE (0xFFFFFFFF) | 47 | #define S3C2410_GPIO_LEAVE (0xFFFFFFFF) |
48 | #define S3C2410_GPIO_INPUT (0xFFFFFFF0) | ||
49 | #define S3C2410_GPIO_OUTPUT (0xFFFFFFF1) | ||
50 | #define S3C2410_GPIO_IRQ (0xFFFFFFF2) /* not available for all */ | ||
51 | #define S3C2410_GPIO_SFN2 (0xFFFFFFF2) /* not available on A */ | ||
52 | #define S3C2410_GPIO_SFN3 (0xFFFFFFF3) /* not available on A */ | ||
46 | 53 | ||
47 | /* configure GPIO ports A..G */ | 54 | /* configure GPIO ports A..G */ |
48 | 55 | ||
49 | #define S3C2410_GPIOREG(x) ((x) + S3C24XX_VA_GPIO) | 56 | #define S3C2410_GPIOREG(x) ((x) + S3C24XX_VA_GPIO) |
50 | 57 | ||
51 | /* port A - 22bits, zero in bit X makes pin X output | 58 | /* port A - S3C2410: 22bits, zero in bit X makes pin X output |
59 | * S3C2400: 18bits, zero in bit X makes pin X output | ||
52 | * 1 makes port special function, this is default | 60 | * 1 makes port special function, this is default |
53 | */ | 61 | */ |
54 | #define S3C2410_GPACON S3C2410_GPIOREG(0x00) | 62 | #define S3C2410_GPACON S3C2410_GPIOREG(0x00) |
55 | #define S3C2410_GPADAT S3C2410_GPIOREG(0x04) | 63 | #define S3C2410_GPADAT S3C2410_GPIOREG(0x04) |
56 | 64 | ||
65 | #define S3C2400_GPACON S3C2410_GPIOREG(0x00) | ||
66 | #define S3C2400_GPADAT S3C2410_GPIOREG(0x04) | ||
67 | |||
57 | #define S3C2410_GPA0 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 0) | 68 | #define S3C2410_GPA0 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 0) |
58 | #define S3C2410_GPA0_OUT (0<<0) | 69 | #define S3C2410_GPA0_OUT (0<<0) |
59 | #define S3C2410_GPA0_ADDR0 (1<<0) | 70 | #define S3C2410_GPA0_ADDR0 (1<<0) |
@@ -97,34 +108,42 @@ | |||
97 | #define S3C2410_GPA10 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 10) | 108 | #define S3C2410_GPA10 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 10) |
98 | #define S3C2410_GPA10_OUT (0<<10) | 109 | #define S3C2410_GPA10_OUT (0<<10) |
99 | #define S3C2410_GPA10_ADDR25 (1<<10) | 110 | #define S3C2410_GPA10_ADDR25 (1<<10) |
111 | #define S3C2400_GPA10_SCKE (1<<10) | ||
100 | 112 | ||
101 | #define S3C2410_GPA11 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 11) | 113 | #define S3C2410_GPA11 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 11) |
102 | #define S3C2410_GPA11_OUT (0<<11) | 114 | #define S3C2410_GPA11_OUT (0<<11) |
103 | #define S3C2410_GPA11_ADDR26 (1<<11) | 115 | #define S3C2410_GPA11_ADDR26 (1<<11) |
116 | #define S3C2400_GPA11_nCAS0 (1<<11) | ||
104 | 117 | ||
105 | #define S3C2410_GPA12 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 12) | 118 | #define S3C2410_GPA12 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 12) |
106 | #define S3C2410_GPA12_OUT (0<<12) | 119 | #define S3C2410_GPA12_OUT (0<<12) |
107 | #define S3C2410_GPA12_nGCS1 (1<<12) | 120 | #define S3C2410_GPA12_nGCS1 (1<<12) |
121 | #define S3C2400_GPA12_nCAS1 (1<<12) | ||
108 | 122 | ||
109 | #define S3C2410_GPA13 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 13) | 123 | #define S3C2410_GPA13 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 13) |
110 | #define S3C2410_GPA13_OUT (0<<13) | 124 | #define S3C2410_GPA13_OUT (0<<13) |
111 | #define S3C2410_GPA13_nGCS2 (1<<13) | 125 | #define S3C2410_GPA13_nGCS2 (1<<13) |
126 | #define S3C2400_GPA13_nGCS1 (1<<13) | ||
112 | 127 | ||
113 | #define S3C2410_GPA14 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 14) | 128 | #define S3C2410_GPA14 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 14) |
114 | #define S3C2410_GPA14_OUT (0<<14) | 129 | #define S3C2410_GPA14_OUT (0<<14) |
115 | #define S3C2410_GPA14_nGCS3 (1<<14) | 130 | #define S3C2410_GPA14_nGCS3 (1<<14) |
131 | #define S3C2400_GPA14_nGCS2 (1<<14) | ||
116 | 132 | ||
117 | #define S3C2410_GPA15 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 15) | 133 | #define S3C2410_GPA15 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 15) |
118 | #define S3C2410_GPA15_OUT (0<<15) | 134 | #define S3C2410_GPA15_OUT (0<<15) |
119 | #define S3C2410_GPA15_nGCS4 (1<<15) | 135 | #define S3C2410_GPA15_nGCS4 (1<<15) |
136 | #define S3C2400_GPA15_nGCS3 (1<<15) | ||
120 | 137 | ||
121 | #define S3C2410_GPA16 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 16) | 138 | #define S3C2410_GPA16 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 16) |
122 | #define S3C2410_GPA16_OUT (0<<16) | 139 | #define S3C2410_GPA16_OUT (0<<16) |
123 | #define S3C2410_GPA16_nGCS5 (1<<16) | 140 | #define S3C2410_GPA16_nGCS5 (1<<16) |
141 | #define S3C2400_GPA16_nGCS4 (1<<16) | ||
124 | 142 | ||
125 | #define S3C2410_GPA17 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 17) | 143 | #define S3C2410_GPA17 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 17) |
126 | #define S3C2410_GPA17_OUT (0<<17) | 144 | #define S3C2410_GPA17_OUT (0<<17) |
127 | #define S3C2410_GPA17_CLE (1<<17) | 145 | #define S3C2410_GPA17_CLE (1<<17) |
146 | #define S3C2400_GPA17_nGCS5 (1<<17) | ||
128 | 147 | ||
129 | #define S3C2410_GPA18 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 18) | 148 | #define S3C2410_GPA18 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 18) |
130 | #define S3C2410_GPA18_OUT (0<<18) | 149 | #define S3C2410_GPA18_OUT (0<<18) |
@@ -146,10 +165,16 @@ | |||
146 | #define S3C2410_GPA22_OUT (0<<22) | 165 | #define S3C2410_GPA22_OUT (0<<22) |
147 | #define S3C2410_GPA22_nFCE (1<<22) | 166 | #define S3C2410_GPA22_nFCE (1<<22) |
148 | 167 | ||
149 | /* 0x08 and 0x0c are reserved */ | 168 | /* 0x08 and 0x0c are reserved on S3C2410 */ |
150 | 169 | ||
151 | /* GPB is 10 IO pins, each configured by 2 bits each in GPBCON. | 170 | /* S3C2410: |
171 | * GPB is 10 IO pins, each configured by 2 bits each in GPBCON. | ||
152 | * 00 = input, 01 = output, 10=special function, 11=reserved | 172 | * 00 = input, 01 = output, 10=special function, 11=reserved |
173 | |||
174 | * S3C2400: | ||
175 | * GPB is 16 IO pins, each configured by 2 bits each in GPBCON. | ||
176 | * 00 = input, 01 = output, 10=data, 11=special function | ||
177 | |||
153 | * bit 0,1 = pin 0, 2,3= pin 1... | 178 | * bit 0,1 = pin 0, 2,3= pin 1... |
154 | * | 179 | * |
155 | * CPBUP = pull up resistor control, 1=disabled, 0=enabled | 180 | * CPBUP = pull up resistor control, 1=disabled, 0=enabled |
@@ -159,63 +184,113 @@ | |||
159 | #define S3C2410_GPBDAT S3C2410_GPIOREG(0x14) | 184 | #define S3C2410_GPBDAT S3C2410_GPIOREG(0x14) |
160 | #define S3C2410_GPBUP S3C2410_GPIOREG(0x18) | 185 | #define S3C2410_GPBUP S3C2410_GPIOREG(0x18) |
161 | 186 | ||
187 | #define S3C2400_GPBCON S3C2410_GPIOREG(0x08) | ||
188 | #define S3C2400_GPBDAT S3C2410_GPIOREG(0x0C) | ||
189 | #define S3C2400_GPBUP S3C2410_GPIOREG(0x10) | ||
190 | |||
162 | /* no i/o pin in port b can have value 3! */ | 191 | /* no i/o pin in port b can have value 3! */ |
163 | 192 | ||
164 | #define S3C2410_GPB0 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 0) | 193 | #define S3C2410_GPB0 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 0) |
165 | #define S3C2410_GPB0_INP (0x00 << 0) | 194 | #define S3C2410_GPB0_INP (0x00 << 0) |
166 | #define S3C2410_GPB0_OUTP (0x01 << 0) | 195 | #define S3C2410_GPB0_OUTP (0x01 << 0) |
167 | #define S3C2410_GPB0_TOUT0 (0x02 << 0) | 196 | #define S3C2410_GPB0_TOUT0 (0x02 << 0) |
197 | #define S3C2400_GPB0_DATA16 (0x02 << 0) | ||
168 | 198 | ||
169 | #define S3C2410_GPB1 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 1) | 199 | #define S3C2410_GPB1 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 1) |
170 | #define S3C2410_GPB1_INP (0x00 << 2) | 200 | #define S3C2410_GPB1_INP (0x00 << 2) |
171 | #define S3C2410_GPB1_OUTP (0x01 << 2) | 201 | #define S3C2410_GPB1_OUTP (0x01 << 2) |
172 | #define S3C2410_GPB1_TOUT1 (0x02 << 2) | 202 | #define S3C2410_GPB1_TOUT1 (0x02 << 2) |
203 | #define S3C2400_GPB1_DATA17 (0x02 << 2) | ||
173 | 204 | ||
174 | #define S3C2410_GPB2 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 2) | 205 | #define S3C2410_GPB2 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 2) |
175 | #define S3C2410_GPB2_INP (0x00 << 4) | 206 | #define S3C2410_GPB2_INP (0x00 << 4) |
176 | #define S3C2410_GPB2_OUTP (0x01 << 4) | 207 | #define S3C2410_GPB2_OUTP (0x01 << 4) |
177 | #define S3C2410_GPB2_TOUT2 (0x02 << 4) | 208 | #define S3C2410_GPB2_TOUT2 (0x02 << 4) |
209 | #define S3C2400_GPB2_DATA18 (0x02 << 4) | ||
210 | #define S3C2400_GPB2_TCLK1 (0x03 << 4) | ||
178 | 211 | ||
179 | #define S3C2410_GPB3 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 3) | 212 | #define S3C2410_GPB3 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 3) |
180 | #define S3C2410_GPB3_INP (0x00 << 6) | 213 | #define S3C2410_GPB3_INP (0x00 << 6) |
181 | #define S3C2410_GPB3_OUTP (0x01 << 6) | 214 | #define S3C2410_GPB3_OUTP (0x01 << 6) |
182 | #define S3C2410_GPB3_TOUT3 (0x02 << 6) | 215 | #define S3C2410_GPB3_TOUT3 (0x02 << 6) |
216 | #define S3C2400_GPB3_DATA19 (0x02 << 6) | ||
217 | #define S3C2400_GPB3_TXD1 (0x03 << 6) | ||
183 | 218 | ||
184 | #define S3C2410_GPB4 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 4) | 219 | #define S3C2410_GPB4 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 4) |
185 | #define S3C2410_GPB4_INP (0x00 << 8) | 220 | #define S3C2410_GPB4_INP (0x00 << 8) |
186 | #define S3C2410_GPB4_OUTP (0x01 << 8) | 221 | #define S3C2410_GPB4_OUTP (0x01 << 8) |
187 | #define S3C2410_GPB4_TCLK0 (0x02 << 8) | 222 | #define S3C2410_GPB4_TCLK0 (0x02 << 8) |
223 | #define S3C2400_GPB4_DATA20 (0x02 << 8) | ||
188 | #define S3C2410_GPB4_MASK (0x03 << 8) | 224 | #define S3C2410_GPB4_MASK (0x03 << 8) |
225 | #define S3C2400_GPB4_RXD1 (0x03 << 8) | ||
226 | #define S3C2400_GPB4_MASK (0x03 << 8) | ||
189 | 227 | ||
190 | #define S3C2410_GPB5 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 5) | 228 | #define S3C2410_GPB5 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 5) |
191 | #define S3C2410_GPB5_INP (0x00 << 10) | 229 | #define S3C2410_GPB5_INP (0x00 << 10) |
192 | #define S3C2410_GPB5_OUTP (0x01 << 10) | 230 | #define S3C2410_GPB5_OUTP (0x01 << 10) |
193 | #define S3C2410_GPB5_nXBACK (0x02 << 10) | 231 | #define S3C2410_GPB5_nXBACK (0x02 << 10) |
232 | #define S3C2400_GPB5_DATA21 (0x02 << 10) | ||
233 | #define S3C2400_GPB5_nCTS1 (0x03 << 10) | ||
194 | 234 | ||
195 | #define S3C2410_GPB6 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 6) | 235 | #define S3C2410_GPB6 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 6) |
196 | #define S3C2410_GPB6_INP (0x00 << 12) | 236 | #define S3C2410_GPB6_INP (0x00 << 12) |
197 | #define S3C2410_GPB6_OUTP (0x01 << 12) | 237 | #define S3C2410_GPB6_OUTP (0x01 << 12) |
198 | #define S3C2410_GPB6_nXBREQ (0x02 << 12) | 238 | #define S3C2410_GPB6_nXBREQ (0x02 << 12) |
239 | #define S3C2400_GPB6_DATA22 (0x02 << 12) | ||
240 | #define S3C2400_GPB6_nRTS1 (0x03 << 12) | ||
199 | 241 | ||
200 | #define S3C2410_GPB7 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 7) | 242 | #define S3C2410_GPB7 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 7) |
201 | #define S3C2410_GPB7_INP (0x00 << 14) | 243 | #define S3C2410_GPB7_INP (0x00 << 14) |
202 | #define S3C2410_GPB7_OUTP (0x01 << 14) | 244 | #define S3C2410_GPB7_OUTP (0x01 << 14) |
203 | #define S3C2410_GPB7_nXDACK1 (0x02 << 14) | 245 | #define S3C2410_GPB7_nXDACK1 (0x02 << 14) |
246 | #define S3C2400_GPB7_DATA23 (0x02 << 14) | ||
204 | 247 | ||
205 | #define S3C2410_GPB8 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 8) | 248 | #define S3C2410_GPB8 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 8) |
206 | #define S3C2410_GPB8_INP (0x00 << 16) | 249 | #define S3C2410_GPB8_INP (0x00 << 16) |
207 | #define S3C2410_GPB8_OUTP (0x01 << 16) | 250 | #define S3C2410_GPB8_OUTP (0x01 << 16) |
208 | #define S3C2410_GPB8_nXDREQ1 (0x02 << 16) | 251 | #define S3C2410_GPB8_nXDREQ1 (0x02 << 16) |
252 | #define S3C2400_GPB8_DATA24 (0x02 << 16) | ||
209 | 253 | ||
210 | #define S3C2410_GPB9 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 9) | 254 | #define S3C2410_GPB9 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 9) |
211 | #define S3C2410_GPB9_INP (0x00 << 18) | 255 | #define S3C2410_GPB9_INP (0x00 << 18) |
212 | #define S3C2410_GPB9_OUTP (0x01 << 18) | 256 | #define S3C2410_GPB9_OUTP (0x01 << 18) |
213 | #define S3C2410_GPB9_nXDACK0 (0x02 << 18) | 257 | #define S3C2410_GPB9_nXDACK0 (0x02 << 18) |
258 | #define S3C2400_GPB9_DATA25 (0x02 << 18) | ||
259 | #define S3C2400_GPB9_I2SSDI (0x03 << 18) | ||
214 | 260 | ||
215 | #define S3C2410_GPB10 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 10) | 261 | #define S3C2410_GPB10 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 10) |
216 | #define S3C2410_GPB10_INP (0x00 << 20) | 262 | #define S3C2410_GPB10_INP (0x00 << 20) |
217 | #define S3C2410_GPB10_OUTP (0x01 << 20) | 263 | #define S3C2410_GPB10_OUTP (0x01 << 20) |
218 | #define S3C2410_GPB10_nXDRE0 (0x02 << 20) | 264 | #define S3C2410_GPB10_nXDRE0 (0x02 << 20) |
265 | #define S3C2400_GPB10_DATA26 (0x02 << 20) | ||
266 | #define S3C2400_GPB10_nSS (0x03 << 20) | ||
267 | |||
268 | #define S3C2400_GPB11 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 11) | ||
269 | #define S3C2400_GPB11_INP (0x00 << 22) | ||
270 | #define S3C2400_GPB11_OUTP (0x01 << 22) | ||
271 | #define S3C2400_GPB11_DATA27 (0x02 << 22) | ||
272 | |||
273 | #define S3C2400_GPB12 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 12) | ||
274 | #define S3C2400_GPB12_INP (0x00 << 24) | ||
275 | #define S3C2400_GPB12_OUTP (0x01 << 24) | ||
276 | #define S3C2400_GPB12_DATA28 (0x02 << 24) | ||
277 | |||
278 | #define S3C2400_GPB13 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 13) | ||
279 | #define S3C2400_GPB13_INP (0x00 << 26) | ||
280 | #define S3C2400_GPB13_OUTP (0x01 << 26) | ||
281 | #define S3C2400_GPB13_DATA29 (0x02 << 26) | ||
282 | |||
283 | #define S3C2400_GPB14 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 14) | ||
284 | #define S3C2400_GPB14_INP (0x00 << 28) | ||
285 | #define S3C2400_GPB14_OUTP (0x01 << 28) | ||
286 | #define S3C2400_GPB14_DATA30 (0x02 << 28) | ||
287 | |||
288 | #define S3C2400_GPB15 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 15) | ||
289 | #define S3C2400_GPB15_INP (0x00 << 30) | ||
290 | #define S3C2400_GPB15_OUTP (0x01 << 30) | ||
291 | #define S3C2400_GPB15_DATA31 (0x02 << 30) | ||
292 | |||
293 | #define S3C2410_GPB_PUPDIS(x) (1<<(x)) | ||
219 | 294 | ||
220 | /* Port C consits of 16 GPIO/Special function | 295 | /* Port C consits of 16 GPIO/Special function |
221 | * | 296 | * |
@@ -227,150 +302,193 @@ | |||
227 | #define S3C2410_GPCDAT S3C2410_GPIOREG(0x24) | 302 | #define S3C2410_GPCDAT S3C2410_GPIOREG(0x24) |
228 | #define S3C2410_GPCUP S3C2410_GPIOREG(0x28) | 303 | #define S3C2410_GPCUP S3C2410_GPIOREG(0x28) |
229 | 304 | ||
305 | #define S3C2400_GPCCON S3C2410_GPIOREG(0x14) | ||
306 | #define S3C2400_GPCDAT S3C2410_GPIOREG(0x18) | ||
307 | #define S3C2400_GPCUP S3C2410_GPIOREG(0x1C) | ||
308 | |||
230 | #define S3C2410_GPC0 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 0) | 309 | #define S3C2410_GPC0 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 0) |
231 | #define S3C2410_GPC0_INP (0x00 << 0) | 310 | #define S3C2410_GPC0_INP (0x00 << 0) |
232 | #define S3C2410_GPC0_OUTP (0x01 << 0) | 311 | #define S3C2410_GPC0_OUTP (0x01 << 0) |
233 | #define S3C2410_GPC0_LEND (0x02 << 0) | 312 | #define S3C2410_GPC0_LEND (0x02 << 0) |
313 | #define S3C2400_GPC0_VD0 (0x02 << 0) | ||
234 | 314 | ||
235 | #define S3C2410_GPC1 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 1) | 315 | #define S3C2410_GPC1 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 1) |
236 | #define S3C2410_GPC1_INP (0x00 << 2) | 316 | #define S3C2410_GPC1_INP (0x00 << 2) |
237 | #define S3C2410_GPC1_OUTP (0x01 << 2) | 317 | #define S3C2410_GPC1_OUTP (0x01 << 2) |
238 | #define S3C2410_GPC1_VCLK (0x02 << 2) | 318 | #define S3C2410_GPC1_VCLK (0x02 << 2) |
319 | #define S3C2400_GPC1_VD1 (0x02 << 2) | ||
239 | 320 | ||
240 | #define S3C2410_GPC2 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 2) | 321 | #define S3C2410_GPC2 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 2) |
241 | #define S3C2410_GPC2_INP (0x00 << 4) | 322 | #define S3C2410_GPC2_INP (0x00 << 4) |
242 | #define S3C2410_GPC2_OUTP (0x01 << 4) | 323 | #define S3C2410_GPC2_OUTP (0x01 << 4) |
243 | #define S3C2410_GPC2_VLINE (0x02 << 4) | 324 | #define S3C2410_GPC2_VLINE (0x02 << 4) |
325 | #define S3C2400_GPC2_VD2 (0x02 << 4) | ||
244 | 326 | ||
245 | #define S3C2410_GPC3 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 3) | 327 | #define S3C2410_GPC3 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 3) |
246 | #define S3C2410_GPC3_INP (0x00 << 6) | 328 | #define S3C2410_GPC3_INP (0x00 << 6) |
247 | #define S3C2410_GPC3_OUTP (0x01 << 6) | 329 | #define S3C2410_GPC3_OUTP (0x01 << 6) |
248 | #define S3C2410_GPC3_VFRAME (0x02 << 6) | 330 | #define S3C2410_GPC3_VFRAME (0x02 << 6) |
331 | #define S3C2400_GPC3_VD3 (0x02 << 6) | ||
249 | 332 | ||
250 | #define S3C2410_GPC4 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 4) | 333 | #define S3C2410_GPC4 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 4) |
251 | #define S3C2410_GPC4_INP (0x00 << 8) | 334 | #define S3C2410_GPC4_INP (0x00 << 8) |
252 | #define S3C2410_GPC4_OUTP (0x01 << 8) | 335 | #define S3C2410_GPC4_OUTP (0x01 << 8) |
253 | #define S3C2410_GPC4_VM (0x02 << 8) | 336 | #define S3C2410_GPC4_VM (0x02 << 8) |
337 | #define S3C2400_GPC4_VD4 (0x02 << 8) | ||
254 | 338 | ||
255 | #define S3C2410_GPC5 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 5) | 339 | #define S3C2410_GPC5 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 5) |
256 | #define S3C2410_GPC5_INP (0x00 << 10) | 340 | #define S3C2410_GPC5_INP (0x00 << 10) |
257 | #define S3C2410_GPC5_OUTP (0x01 << 10) | 341 | #define S3C2410_GPC5_OUTP (0x01 << 10) |
258 | #define S3C2410_GPC5_LCDVF0 (0x02 << 10) | 342 | #define S3C2410_GPC5_LCDVF0 (0x02 << 10) |
343 | #define S3C2400_GPC5_VD5 (0x02 << 10) | ||
259 | 344 | ||
260 | #define S3C2410_GPC6 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 6) | 345 | #define S3C2410_GPC6 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 6) |
261 | #define S3C2410_GPC6_INP (0x00 << 12) | 346 | #define S3C2410_GPC6_INP (0x00 << 12) |
262 | #define S3C2410_GPC6_OUTP (0x01 << 12) | 347 | #define S3C2410_GPC6_OUTP (0x01 << 12) |
263 | #define S3C2410_GPC6_LCDVF1 (0x02 << 12) | 348 | #define S3C2410_GPC6_LCDVF1 (0x02 << 12) |
349 | #define S3C2400_GPC6_VD6 (0x02 << 12) | ||
264 | 350 | ||
265 | #define S3C2410_GPC7 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 7) | 351 | #define S3C2410_GPC7 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 7) |
266 | #define S3C2410_GPC7_INP (0x00 << 14) | 352 | #define S3C2410_GPC7_INP (0x00 << 14) |
267 | #define S3C2410_GPC7_OUTP (0x01 << 14) | 353 | #define S3C2410_GPC7_OUTP (0x01 << 14) |
268 | #define S3C2410_GPC7_LCDVF2 (0x02 << 14) | 354 | #define S3C2410_GPC7_LCDVF2 (0x02 << 14) |
355 | #define S3C2400_GPC7_VD7 (0x02 << 14) | ||
269 | 356 | ||
270 | #define S3C2410_GPC8 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 8) | 357 | #define S3C2410_GPC8 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 8) |
271 | #define S3C2410_GPC8_INP (0x00 << 16) | 358 | #define S3C2410_GPC8_INP (0x00 << 16) |
272 | #define S3C2410_GPC8_OUTP (0x01 << 16) | 359 | #define S3C2410_GPC8_OUTP (0x01 << 16) |
273 | #define S3C2410_GPC8_VD0 (0x02 << 16) | 360 | #define S3C2410_GPC8_VD0 (0x02 << 16) |
361 | #define S3C2400_GPC8_VD8 (0x02 << 16) | ||
274 | 362 | ||
275 | #define S3C2410_GPC9 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 9) | 363 | #define S3C2410_GPC9 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 9) |
276 | #define S3C2410_GPC9_INP (0x00 << 18) | 364 | #define S3C2410_GPC9_INP (0x00 << 18) |
277 | #define S3C2410_GPC9_OUTP (0x01 << 18) | 365 | #define S3C2410_GPC9_OUTP (0x01 << 18) |
278 | #define S3C2410_GPC9_VD1 (0x02 << 18) | 366 | #define S3C2410_GPC9_VD1 (0x02 << 18) |
367 | #define S3C2400_GPC9_VD9 (0x02 << 18) | ||
279 | 368 | ||
280 | #define S3C2410_GPC10 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 10) | 369 | #define S3C2410_GPC10 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 10) |
281 | #define S3C2410_GPC10_INP (0x00 << 20) | 370 | #define S3C2410_GPC10_INP (0x00 << 20) |
282 | #define S3C2410_GPC10_OUTP (0x01 << 20) | 371 | #define S3C2410_GPC10_OUTP (0x01 << 20) |
283 | #define S3C2410_GPC10_VD2 (0x02 << 20) | 372 | #define S3C2410_GPC10_VD2 (0x02 << 20) |
373 | #define S3C2400_GPC10_VD10 (0x02 << 20) | ||
284 | 374 | ||
285 | #define S3C2410_GPC11 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 11) | 375 | #define S3C2410_GPC11 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 11) |
286 | #define S3C2410_GPC11_INP (0x00 << 22) | 376 | #define S3C2410_GPC11_INP (0x00 << 22) |
287 | #define S3C2410_GPC11_OUTP (0x01 << 22) | 377 | #define S3C2410_GPC11_OUTP (0x01 << 22) |
288 | #define S3C2410_GPC11_VD3 (0x02 << 22) | 378 | #define S3C2410_GPC11_VD3 (0x02 << 22) |
379 | #define S3C2400_GPC11_VD11 (0x02 << 22) | ||
289 | 380 | ||
290 | #define S3C2410_GPC12 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 12) | 381 | #define S3C2410_GPC12 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 12) |
291 | #define S3C2410_GPC12_INP (0x00 << 24) | 382 | #define S3C2410_GPC12_INP (0x00 << 24) |
292 | #define S3C2410_GPC12_OUTP (0x01 << 24) | 383 | #define S3C2410_GPC12_OUTP (0x01 << 24) |
293 | #define S3C2410_GPC12_VD4 (0x02 << 24) | 384 | #define S3C2410_GPC12_VD4 (0x02 << 24) |
385 | #define S3C2400_GPC12_VD12 (0x02 << 24) | ||
294 | 386 | ||
295 | #define S3C2410_GPC13 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 13) | 387 | #define S3C2410_GPC13 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 13) |
296 | #define S3C2410_GPC13_INP (0x00 << 26) | 388 | #define S3C2410_GPC13_INP (0x00 << 26) |
297 | #define S3C2410_GPC13_OUTP (0x01 << 26) | 389 | #define S3C2410_GPC13_OUTP (0x01 << 26) |
298 | #define S3C2410_GPC13_VD5 (0x02 << 26) | 390 | #define S3C2410_GPC13_VD5 (0x02 << 26) |
391 | #define S3C2400_GPC13_VD13 (0x02 << 26) | ||
299 | 392 | ||
300 | #define S3C2410_GPC14 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 14) | 393 | #define S3C2410_GPC14 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 14) |
301 | #define S3C2410_GPC14_INP (0x00 << 28) | 394 | #define S3C2410_GPC14_INP (0x00 << 28) |
302 | #define S3C2410_GPC14_OUTP (0x01 << 28) | 395 | #define S3C2410_GPC14_OUTP (0x01 << 28) |
303 | #define S3C2410_GPC14_VD6 (0x02 << 28) | 396 | #define S3C2410_GPC14_VD6 (0x02 << 28) |
397 | #define S3C2400_GPC14_VD14 (0x02 << 28) | ||
304 | 398 | ||
305 | #define S3C2410_GPC15 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 15) | 399 | #define S3C2410_GPC15 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 15) |
306 | #define S3C2410_GPC15_INP (0x00 << 30) | 400 | #define S3C2410_GPC15_INP (0x00 << 30) |
307 | #define S3C2410_GPC15_OUTP (0x01 << 30) | 401 | #define S3C2410_GPC15_OUTP (0x01 << 30) |
308 | #define S3C2410_GPC15_VD7 (0x02 << 30) | 402 | #define S3C2410_GPC15_VD7 (0x02 << 30) |
403 | #define S3C2400_GPC15_VD15 (0x02 << 30) | ||
404 | |||
405 | #define S3C2410_GPC_PUPDIS(x) (1<<(x)) | ||
309 | 406 | ||
310 | /* Port D consists of 16 GPIO/Special function | 407 | /* |
408 | * S3C2410: Port D consists of 16 GPIO/Special function | ||
311 | * | 409 | * |
312 | * almost identical setup to port b, but the special functions are mostly | 410 | * almost identical setup to port b, but the special functions are mostly |
313 | * to do with the video system's data. | 411 | * to do with the video system's data. |
412 | * | ||
413 | * S3C2400: Port D consists of 11 GPIO/Special function | ||
414 | * | ||
415 | * almost identical setup to port c | ||
314 | */ | 416 | */ |
315 | 417 | ||
316 | #define S3C2410_GPDCON S3C2410_GPIOREG(0x30) | 418 | #define S3C2410_GPDCON S3C2410_GPIOREG(0x30) |
317 | #define S3C2410_GPDDAT S3C2410_GPIOREG(0x34) | 419 | #define S3C2410_GPDDAT S3C2410_GPIOREG(0x34) |
318 | #define S3C2410_GPDUP S3C2410_GPIOREG(0x38) | 420 | #define S3C2410_GPDUP S3C2410_GPIOREG(0x38) |
319 | 421 | ||
422 | #define S3C2400_GPDCON S3C2410_GPIOREG(0x20) | ||
423 | #define S3C2400_GPDDAT S3C2410_GPIOREG(0x24) | ||
424 | #define S3C2400_GPDUP S3C2410_GPIOREG(0x28) | ||
425 | |||
320 | #define S3C2410_GPD0 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 0) | 426 | #define S3C2410_GPD0 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 0) |
321 | #define S3C2410_GPD0_INP (0x00 << 0) | 427 | #define S3C2410_GPD0_INP (0x00 << 0) |
322 | #define S3C2410_GPD0_OUTP (0x01 << 0) | 428 | #define S3C2410_GPD0_OUTP (0x01 << 0) |
323 | #define S3C2410_GPD0_VD8 (0x02 << 0) | 429 | #define S3C2410_GPD0_VD8 (0x02 << 0) |
430 | #define S3C2400_GPD0_VFRAME (0x02 << 0) | ||
324 | 431 | ||
325 | #define S3C2410_GPD1 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 1) | 432 | #define S3C2410_GPD1 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 1) |
326 | #define S3C2410_GPD1_INP (0x00 << 2) | 433 | #define S3C2410_GPD1_INP (0x00 << 2) |
327 | #define S3C2410_GPD1_OUTP (0x01 << 2) | 434 | #define S3C2410_GPD1_OUTP (0x01 << 2) |
328 | #define S3C2410_GPD1_VD9 (0x02 << 2) | 435 | #define S3C2410_GPD1_VD9 (0x02 << 2) |
436 | #define S3C2400_GPD1_VM (0x02 << 2) | ||
329 | 437 | ||
330 | #define S3C2410_GPD2 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 2) | 438 | #define S3C2410_GPD2 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 2) |
331 | #define S3C2410_GPD2_INP (0x00 << 4) | 439 | #define S3C2410_GPD2_INP (0x00 << 4) |
332 | #define S3C2410_GPD2_OUTP (0x01 << 4) | 440 | #define S3C2410_GPD2_OUTP (0x01 << 4) |
333 | #define S3C2410_GPD2_VD10 (0x02 << 4) | 441 | #define S3C2410_GPD2_VD10 (0x02 << 4) |
442 | #define S3C2400_GPD2_VLINE (0x02 << 4) | ||
334 | 443 | ||
335 | #define S3C2410_GPD3 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 3) | 444 | #define S3C2410_GPD3 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 3) |
336 | #define S3C2410_GPD3_INP (0x00 << 6) | 445 | #define S3C2410_GPD3_INP (0x00 << 6) |
337 | #define S3C2410_GPD3_OUTP (0x01 << 6) | 446 | #define S3C2410_GPD3_OUTP (0x01 << 6) |
338 | #define S3C2410_GPD3_VD11 (0x02 << 6) | 447 | #define S3C2410_GPD3_VD11 (0x02 << 6) |
448 | #define S3C2400_GPD3_VCLK (0x02 << 6) | ||
339 | 449 | ||
340 | #define S3C2410_GPD4 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 4) | 450 | #define S3C2410_GPD4 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 4) |
341 | #define S3C2410_GPD4_INP (0x00 << 8) | 451 | #define S3C2410_GPD4_INP (0x00 << 8) |
342 | #define S3C2410_GPD4_OUTP (0x01 << 8) | 452 | #define S3C2410_GPD4_OUTP (0x01 << 8) |
343 | #define S3C2410_GPD4_VD12 (0x02 << 8) | 453 | #define S3C2410_GPD4_VD12 (0x02 << 8) |
454 | #define S3C2400_GPD4_LEND (0x02 << 8) | ||
344 | 455 | ||
345 | #define S3C2410_GPD5 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 5) | 456 | #define S3C2410_GPD5 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 5) |
346 | #define S3C2410_GPD5_INP (0x00 << 10) | 457 | #define S3C2410_GPD5_INP (0x00 << 10) |
347 | #define S3C2410_GPD5_OUTP (0x01 << 10) | 458 | #define S3C2410_GPD5_OUTP (0x01 << 10) |
348 | #define S3C2410_GPD5_VD13 (0x02 << 10) | 459 | #define S3C2410_GPD5_VD13 (0x02 << 10) |
460 | #define S3C2400_GPD5_TOUT0 (0x02 << 10) | ||
349 | 461 | ||
350 | #define S3C2410_GPD6 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 6) | 462 | #define S3C2410_GPD6 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 6) |
351 | #define S3C2410_GPD6_INP (0x00 << 12) | 463 | #define S3C2410_GPD6_INP (0x00 << 12) |
352 | #define S3C2410_GPD6_OUTP (0x01 << 12) | 464 | #define S3C2410_GPD6_OUTP (0x01 << 12) |
353 | #define S3C2410_GPD6_VD14 (0x02 << 12) | 465 | #define S3C2410_GPD6_VD14 (0x02 << 12) |
466 | #define S3C2400_GPD6_TOUT1 (0x02 << 12) | ||
354 | 467 | ||
355 | #define S3C2410_GPD7 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 7) | 468 | #define S3C2410_GPD7 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 7) |
356 | #define S3C2410_GPD7_INP (0x00 << 14) | 469 | #define S3C2410_GPD7_INP (0x00 << 14) |
357 | #define S3C2410_GPD7_OUTP (0x01 << 14) | 470 | #define S3C2410_GPD7_OUTP (0x01 << 14) |
358 | #define S3C2410_GPD7_VD15 (0x02 << 14) | 471 | #define S3C2410_GPD7_VD15 (0x02 << 14) |
472 | #define S3C2400_GPD7_TOUT2 (0x02 << 14) | ||
359 | 473 | ||
360 | #define S3C2410_GPD8 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 8) | 474 | #define S3C2410_GPD8 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 8) |
361 | #define S3C2410_GPD8_INP (0x00 << 16) | 475 | #define S3C2410_GPD8_INP (0x00 << 16) |
362 | #define S3C2410_GPD8_OUTP (0x01 << 16) | 476 | #define S3C2410_GPD8_OUTP (0x01 << 16) |
363 | #define S3C2410_GPD8_VD16 (0x02 << 16) | 477 | #define S3C2410_GPD8_VD16 (0x02 << 16) |
478 | #define S3C2400_GPD8_TOUT3 (0x02 << 16) | ||
364 | 479 | ||
365 | #define S3C2410_GPD9 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 9) | 480 | #define S3C2410_GPD9 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 9) |
366 | #define S3C2410_GPD9_INP (0x00 << 18) | 481 | #define S3C2410_GPD9_INP (0x00 << 18) |
367 | #define S3C2410_GPD9_OUTP (0x01 << 18) | 482 | #define S3C2410_GPD9_OUTP (0x01 << 18) |
368 | #define S3C2410_GPD9_VD17 (0x02 << 18) | 483 | #define S3C2410_GPD9_VD17 (0x02 << 18) |
484 | #define S3C2400_GPD9_TCLK0 (0x02 << 18) | ||
485 | #define S3C2410_GPD9_MASK (0x03 << 18) | ||
369 | 486 | ||
370 | #define S3C2410_GPD10 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 10) | 487 | #define S3C2410_GPD10 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 10) |
371 | #define S3C2410_GPD10_INP (0x00 << 20) | 488 | #define S3C2410_GPD10_INP (0x00 << 20) |
372 | #define S3C2410_GPD10_OUTP (0x01 << 20) | 489 | #define S3C2410_GPD10_OUTP (0x01 << 20) |
373 | #define S3C2410_GPD10_VD18 (0x02 << 20) | 490 | #define S3C2410_GPD10_VD18 (0x02 << 20) |
491 | #define S3C2400_GPD10_nWAIT (0x02 << 20) | ||
374 | 492 | ||
375 | #define S3C2410_GPD11 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 11) | 493 | #define S3C2410_GPD11 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 11) |
376 | #define S3C2410_GPD11_INP (0x00 << 22) | 494 | #define S3C2410_GPD11_INP (0x00 << 22) |
@@ -397,37 +515,56 @@ | |||
397 | #define S3C2410_GPD15_OUTP (0x01 << 30) | 515 | #define S3C2410_GPD15_OUTP (0x01 << 30) |
398 | #define S3C2410_GPD15_VD23 (0x02 << 30) | 516 | #define S3C2410_GPD15_VD23 (0x02 << 30) |
399 | 517 | ||
400 | /* Port E consists of 16 GPIO/Special function | 518 | #define S3C2410_GPD_PUPDIS(x) (1<<(x)) |
519 | |||
520 | /* S3C2410: | ||
521 | * Port E consists of 16 GPIO/Special function | ||
401 | * | 522 | * |
402 | * again, the same as port B, but dealing with I2S, SDI, and | 523 | * again, the same as port B, but dealing with I2S, SDI, and |
403 | * more miscellaneous functions | 524 | * more miscellaneous functions |
525 | * | ||
526 | * S3C2400: | ||
527 | * Port E consists of 12 GPIO/Special function | ||
528 | * | ||
529 | * GPIO / interrupt inputs | ||
404 | */ | 530 | */ |
405 | 531 | ||
406 | #define S3C2410_GPECON S3C2410_GPIOREG(0x40) | 532 | #define S3C2410_GPECON S3C2410_GPIOREG(0x40) |
407 | #define S3C2410_GPEDAT S3C2410_GPIOREG(0x44) | 533 | #define S3C2410_GPEDAT S3C2410_GPIOREG(0x44) |
408 | #define S3C2410_GPEUP S3C2410_GPIOREG(0x48) | 534 | #define S3C2410_GPEUP S3C2410_GPIOREG(0x48) |
409 | 535 | ||
536 | #define S3C2400_GPECON S3C2410_GPIOREG(0x2C) | ||
537 | #define S3C2400_GPEDAT S3C2410_GPIOREG(0x30) | ||
538 | #define S3C2400_GPEUP S3C2410_GPIOREG(0x34) | ||
539 | |||
410 | #define S3C2410_GPE0 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 0) | 540 | #define S3C2410_GPE0 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 0) |
411 | #define S3C2410_GPE0_INP (0x00 << 0) | 541 | #define S3C2410_GPE0_INP (0x00 << 0) |
412 | #define S3C2410_GPE0_OUTP (0x01 << 0) | 542 | #define S3C2410_GPE0_OUTP (0x01 << 0) |
413 | #define S3C2410_GPE0_I2SLRCK (0x02 << 0) | 543 | #define S3C2410_GPE0_I2SLRCK (0x02 << 0) |
544 | #define S3C2400_GPE0_EINT0 (0x02 << 0) | ||
414 | #define S3C2410_GPE0_MASK (0x03 << 0) | 545 | #define S3C2410_GPE0_MASK (0x03 << 0) |
415 | 546 | ||
416 | #define S3C2410_GPE1 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 1) | 547 | #define S3C2410_GPE1 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 1) |
417 | #define S3C2410_GPE1_INP (0x00 << 2) | 548 | #define S3C2410_GPE1_INP (0x00 << 2) |
418 | #define S3C2410_GPE1_OUTP (0x01 << 2) | 549 | #define S3C2410_GPE1_OUTP (0x01 << 2) |
419 | #define S3C2410_GPE1_I2SSCLK (0x02 << 2) | 550 | #define S3C2410_GPE1_I2SSCLK (0x02 << 2) |
551 | #define S3C2400_GPE1_EINT1 (0x02 << 2) | ||
552 | #define S3C2400_GPE1_nSS (0x03 << 2) | ||
420 | #define S3C2410_GPE1_MASK (0x03 << 2) | 553 | #define S3C2410_GPE1_MASK (0x03 << 2) |
421 | 554 | ||
422 | #define S3C2410_GPE2 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 2) | 555 | #define S3C2410_GPE2 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 2) |
423 | #define S3C2410_GPE2_INP (0x00 << 4) | 556 | #define S3C2410_GPE2_INP (0x00 << 4) |
424 | #define S3C2410_GPE2_OUTP (0x01 << 4) | 557 | #define S3C2410_GPE2_OUTP (0x01 << 4) |
425 | #define S3C2410_GPE2_CDCLK (0x02 << 4) | 558 | #define S3C2410_GPE2_CDCLK (0x02 << 4) |
559 | #define S3C2400_GPE2_EINT2 (0x02 << 4) | ||
560 | #define S3C2400_GPE2_I2SSDI (0x03 << 4) | ||
426 | 561 | ||
427 | #define S3C2410_GPE3 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 3) | 562 | #define S3C2410_GPE3 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 3) |
428 | #define S3C2410_GPE3_INP (0x00 << 6) | 563 | #define S3C2410_GPE3_INP (0x00 << 6) |
429 | #define S3C2410_GPE3_OUTP (0x01 << 6) | 564 | #define S3C2410_GPE3_OUTP (0x01 << 6) |
430 | #define S3C2410_GPE3_I2SSDI (0x02 << 6) | 565 | #define S3C2410_GPE3_I2SSDI (0x02 << 6) |
566 | #define S3C2400_GPE3_EINT3 (0x02 << 6) | ||
567 | #define S3C2400_GPE3_nCTS1 (0x03 << 6) | ||
431 | #define S3C2410_GPE3_nSS0 (0x03 << 6) | 568 | #define S3C2410_GPE3_nSS0 (0x03 << 6) |
432 | #define S3C2410_GPE3_MASK (0x03 << 6) | 569 | #define S3C2410_GPE3_MASK (0x03 << 6) |
433 | 570 | ||
@@ -435,6 +572,8 @@ | |||
435 | #define S3C2410_GPE4_INP (0x00 << 8) | 572 | #define S3C2410_GPE4_INP (0x00 << 8) |
436 | #define S3C2410_GPE4_OUTP (0x01 << 8) | 573 | #define S3C2410_GPE4_OUTP (0x01 << 8) |
437 | #define S3C2410_GPE4_I2SSDO (0x02 << 8) | 574 | #define S3C2410_GPE4_I2SSDO (0x02 << 8) |
575 | #define S3C2400_GPE4_EINT4 (0x02 << 8) | ||
576 | #define S3C2400_GPE4_nRTS1 (0x03 << 8) | ||
438 | #define S3C2410_GPE4_I2SSDI (0x03 << 8) | 577 | #define S3C2410_GPE4_I2SSDI (0x03 << 8) |
439 | #define S3C2410_GPE4_MASK (0x03 << 8) | 578 | #define S3C2410_GPE4_MASK (0x03 << 8) |
440 | 579 | ||
@@ -442,36 +581,46 @@ | |||
442 | #define S3C2410_GPE5_INP (0x00 << 10) | 581 | #define S3C2410_GPE5_INP (0x00 << 10) |
443 | #define S3C2410_GPE5_OUTP (0x01 << 10) | 582 | #define S3C2410_GPE5_OUTP (0x01 << 10) |
444 | #define S3C2410_GPE5_SDCLK (0x02 << 10) | 583 | #define S3C2410_GPE5_SDCLK (0x02 << 10) |
584 | #define S3C2400_GPE5_EINT5 (0x02 << 10) | ||
585 | #define S3C2400_GPE5_TCLK1 (0x03 << 10) | ||
445 | 586 | ||
446 | #define S3C2410_GPE6 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 6) | 587 | #define S3C2410_GPE6 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 6) |
447 | #define S3C2410_GPE6_INP (0x00 << 12) | 588 | #define S3C2410_GPE6_INP (0x00 << 12) |
448 | #define S3C2410_GPE6_OUTP (0x01 << 12) | 589 | #define S3C2410_GPE6_OUTP (0x01 << 12) |
449 | #define S3C2410_GPE6_SDCMD (0x02 << 12) | 590 | #define S3C2410_GPE6_SDCMD (0x02 << 12) |
591 | #define S3C2400_GPE6_EINT6 (0x02 << 12) | ||
450 | 592 | ||
451 | #define S3C2410_GPE7 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 7) | 593 | #define S3C2410_GPE7 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 7) |
452 | #define S3C2410_GPE7_INP (0x00 << 14) | 594 | #define S3C2410_GPE7_INP (0x00 << 14) |
453 | #define S3C2410_GPE7_OUTP (0x01 << 14) | 595 | #define S3C2410_GPE7_OUTP (0x01 << 14) |
454 | #define S3C2410_GPE7_SDDAT0 (0x02 << 14) | 596 | #define S3C2410_GPE7_SDDAT0 (0x02 << 14) |
597 | #define S3C2400_GPE7_EINT7 (0x02 << 14) | ||
455 | 598 | ||
456 | #define S3C2410_GPE8 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 8) | 599 | #define S3C2410_GPE8 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 8) |
457 | #define S3C2410_GPE8_INP (0x00 << 16) | 600 | #define S3C2410_GPE8_INP (0x00 << 16) |
458 | #define S3C2410_GPE8_OUTP (0x01 << 16) | 601 | #define S3C2410_GPE8_OUTP (0x01 << 16) |
459 | #define S3C2410_GPE8_SDDAT1 (0x02 << 16) | 602 | #define S3C2410_GPE8_SDDAT1 (0x02 << 16) |
603 | #define S3C2400_GPE8_nXDACK0 (0x02 << 16) | ||
460 | 604 | ||
461 | #define S3C2410_GPE9 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 9) | 605 | #define S3C2410_GPE9 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 9) |
462 | #define S3C2410_GPE9_INP (0x00 << 18) | 606 | #define S3C2410_GPE9_INP (0x00 << 18) |
463 | #define S3C2410_GPE9_OUTP (0x01 << 18) | 607 | #define S3C2410_GPE9_OUTP (0x01 << 18) |
464 | #define S3C2410_GPE9_SDDAT2 (0x02 << 18) | 608 | #define S3C2410_GPE9_SDDAT2 (0x02 << 18) |
609 | #define S3C2400_GPE9_nXDACK1 (0x02 << 18) | ||
610 | #define S3C2400_GPE9_nXBACK (0x03 << 18) | ||
465 | 611 | ||
466 | #define S3C2410_GPE10 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 10) | 612 | #define S3C2410_GPE10 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 10) |
467 | #define S3C2410_GPE10_INP (0x00 << 20) | 613 | #define S3C2410_GPE10_INP (0x00 << 20) |
468 | #define S3C2410_GPE10_OUTP (0x01 << 20) | 614 | #define S3C2410_GPE10_OUTP (0x01 << 20) |
469 | #define S3C2410_GPE10_SDDAT3 (0x02 << 20) | 615 | #define S3C2410_GPE10_SDDAT3 (0x02 << 20) |
616 | #define S3C2400_GPE10_nXDREQ0 (0x02 << 20) | ||
470 | 617 | ||
471 | #define S3C2410_GPE11 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 11) | 618 | #define S3C2410_GPE11 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 11) |
472 | #define S3C2410_GPE11_INP (0x00 << 22) | 619 | #define S3C2410_GPE11_INP (0x00 << 22) |
473 | #define S3C2410_GPE11_OUTP (0x01 << 22) | 620 | #define S3C2410_GPE11_OUTP (0x01 << 22) |
474 | #define S3C2410_GPE11_SPIMISO0 (0x02 << 22) | 621 | #define S3C2410_GPE11_SPIMISO0 (0x02 << 22) |
622 | #define S3C2400_GPE11_nXDREQ1 (0x02 << 22) | ||
623 | #define S3C2400_GPE11_nXBREQ (0x03 << 22) | ||
475 | 624 | ||
476 | #define S3C2410_GPE12 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 12) | 625 | #define S3C2410_GPE12 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 12) |
477 | #define S3C2410_GPE12_INP (0x00 << 24) | 626 | #define S3C2410_GPE12_INP (0x00 << 24) |
@@ -503,7 +652,8 @@ | |||
503 | 652 | ||
504 | #define S3C2410_GPE_PUPDIS(x) (1<<(x)) | 653 | #define S3C2410_GPE_PUPDIS(x) (1<<(x)) |
505 | 654 | ||
506 | /* Port F consists of 8 GPIO/Special function | 655 | /* S3C2410: |
656 | * Port F consists of 8 GPIO/Special function | ||
507 | * | 657 | * |
508 | * GPIO / interrupt inputs | 658 | * GPIO / interrupt inputs |
509 | * | 659 | * |
@@ -511,100 +661,141 @@ | |||
511 | * 00 = 0 input, 1 output, 2 interrupt (EINT0..7), 3 undefined | 661 | * 00 = 0 input, 1 output, 2 interrupt (EINT0..7), 3 undefined |
512 | * | 662 | * |
513 | * pull up works like all other ports. | 663 | * pull up works like all other ports. |
664 | * | ||
665 | * S3C2400: | ||
666 | * Port F consists of 7 GPIO/Special function | ||
667 | * | ||
668 | * GPIO/serial/misc pins | ||
514 | */ | 669 | */ |
515 | 670 | ||
516 | #define S3C2410_GPFCON S3C2410_GPIOREG(0x50) | 671 | #define S3C2410_GPFCON S3C2410_GPIOREG(0x50) |
517 | #define S3C2410_GPFDAT S3C2410_GPIOREG(0x54) | 672 | #define S3C2410_GPFDAT S3C2410_GPIOREG(0x54) |
518 | #define S3C2410_GPFUP S3C2410_GPIOREG(0x58) | 673 | #define S3C2410_GPFUP S3C2410_GPIOREG(0x58) |
519 | 674 | ||
675 | #define S3C2400_GPFCON S3C2410_GPIOREG(0x38) | ||
676 | #define S3C2400_GPFDAT S3C2410_GPIOREG(0x3C) | ||
677 | #define S3C2400_GPFUP S3C2410_GPIOREG(0x40) | ||
678 | |||
520 | #define S3C2410_GPF0 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 0) | 679 | #define S3C2410_GPF0 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 0) |
521 | #define S3C2410_GPF0_INP (0x00 << 0) | 680 | #define S3C2410_GPF0_INP (0x00 << 0) |
522 | #define S3C2410_GPF0_OUTP (0x01 << 0) | 681 | #define S3C2410_GPF0_OUTP (0x01 << 0) |
523 | #define S3C2410_GPF0_EINT0 (0x02 << 0) | 682 | #define S3C2410_GPF0_EINT0 (0x02 << 0) |
683 | #define S3C2400_GPF0_RXD0 (0x02 << 0) | ||
524 | 684 | ||
525 | #define S3C2410_GPF1 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 1) | 685 | #define S3C2410_GPF1 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 1) |
526 | #define S3C2410_GPF1_INP (0x00 << 2) | 686 | #define S3C2410_GPF1_INP (0x00 << 2) |
527 | #define S3C2410_GPF1_OUTP (0x01 << 2) | 687 | #define S3C2410_GPF1_OUTP (0x01 << 2) |
528 | #define S3C2410_GPF1_EINT1 (0x02 << 2) | 688 | #define S3C2410_GPF1_EINT1 (0x02 << 2) |
689 | #define S3C2400_GPF1_RXD1 (0x02 << 2) | ||
690 | #define S3C2400_GPF1_IICSDA (0x03 << 2) | ||
529 | 691 | ||
530 | #define S3C2410_GPF2 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 2) | 692 | #define S3C2410_GPF2 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 2) |
531 | #define S3C2410_GPF2_INP (0x00 << 4) | 693 | #define S3C2410_GPF2_INP (0x00 << 4) |
532 | #define S3C2410_GPF2_OUTP (0x01 << 4) | 694 | #define S3C2410_GPF2_OUTP (0x01 << 4) |
533 | #define S3C2410_GPF2_EINT2 (0x02 << 4) | 695 | #define S3C2410_GPF2_EINT2 (0x02 << 4) |
696 | #define S3C2400_GPF2_TXD0 (0x02 << 4) | ||
534 | 697 | ||
535 | #define S3C2410_GPF3 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 3) | 698 | #define S3C2410_GPF3 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 3) |
536 | #define S3C2410_GPF3_INP (0x00 << 6) | 699 | #define S3C2410_GPF3_INP (0x00 << 6) |
537 | #define S3C2410_GPF3_OUTP (0x01 << 6) | 700 | #define S3C2410_GPF3_OUTP (0x01 << 6) |
538 | #define S3C2410_GPF3_EINT3 (0x02 << 6) | 701 | #define S3C2410_GPF3_EINT3 (0x02 << 6) |
702 | #define S3C2400_GPF3_TXD1 (0x02 << 6) | ||
703 | #define S3C2400_GPF3_IICSCL (0x03 << 6) | ||
539 | 704 | ||
540 | #define S3C2410_GPF4 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 4) | 705 | #define S3C2410_GPF4 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 4) |
541 | #define S3C2410_GPF4_INP (0x00 << 8) | 706 | #define S3C2410_GPF4_INP (0x00 << 8) |
542 | #define S3C2410_GPF4_OUTP (0x01 << 8) | 707 | #define S3C2410_GPF4_OUTP (0x01 << 8) |
543 | #define S3C2410_GPF4_EINT4 (0x02 << 8) | 708 | #define S3C2410_GPF4_EINT4 (0x02 << 8) |
709 | #define S3C2400_GPF4_nRTS0 (0x02 << 8) | ||
710 | #define S3C2400_GPF4_nXBACK (0x03 << 8) | ||
544 | 711 | ||
545 | #define S3C2410_GPF5 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 5) | 712 | #define S3C2410_GPF5 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 5) |
546 | #define S3C2410_GPF5_INP (0x00 << 10) | 713 | #define S3C2410_GPF5_INP (0x00 << 10) |
547 | #define S3C2410_GPF5_OUTP (0x01 << 10) | 714 | #define S3C2410_GPF5_OUTP (0x01 << 10) |
548 | #define S3C2410_GPF5_EINT5 (0x02 << 10) | 715 | #define S3C2410_GPF5_EINT5 (0x02 << 10) |
716 | #define S3C2400_GPF5_nCTS0 (0x02 << 10) | ||
717 | #define S3C2400_GPF5_nXBREQ (0x03 << 10) | ||
549 | 718 | ||
550 | #define S3C2410_GPF6 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 6) | 719 | #define S3C2410_GPF6 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 6) |
551 | #define S3C2410_GPF6_INP (0x00 << 12) | 720 | #define S3C2410_GPF6_INP (0x00 << 12) |
552 | #define S3C2410_GPF6_OUTP (0x01 << 12) | 721 | #define S3C2410_GPF6_OUTP (0x01 << 12) |
553 | #define S3C2410_GPF6_EINT6 (0x02 << 12) | 722 | #define S3C2410_GPF6_EINT6 (0x02 << 12) |
723 | #define S3C2400_GPF6_CLKOUT (0x02 << 12) | ||
554 | 724 | ||
555 | #define S3C2410_GPF7 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 7) | 725 | #define S3C2410_GPF7 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 7) |
556 | #define S3C2410_GPF7_INP (0x00 << 14) | 726 | #define S3C2410_GPF7_INP (0x00 << 14) |
557 | #define S3C2410_GPF7_OUTP (0x01 << 14) | 727 | #define S3C2410_GPF7_OUTP (0x01 << 14) |
558 | #define S3C2410_GPF7_EINT7 (0x02 << 14) | 728 | #define S3C2410_GPF7_EINT7 (0x02 << 14) |
559 | 729 | ||
560 | /* Port G consists of 8 GPIO/IRQ/Special function | 730 | #define S3C2410_GPF_PUPDIS(x) (1<<(x)) |
731 | |||
732 | /* S3C2410: | ||
733 | * Port G consists of 8 GPIO/IRQ/Special function | ||
561 | * | 734 | * |
562 | * GPGCON has 2 bits for each of the input pins on port F | 735 | * GPGCON has 2 bits for each of the input pins on port F |
563 | * 00 = 0 input, 1 output, 2 interrupt (EINT0..7), 3 special func | 736 | * 00 = 0 input, 1 output, 2 interrupt (EINT0..7), 3 special func |
564 | * | 737 | * |
565 | * pull up works like all other ports. | 738 | * pull up works like all other ports. |
739 | * | ||
740 | * S3C2400: | ||
741 | * Port G consists of 10 GPIO/Special function | ||
566 | */ | 742 | */ |
567 | 743 | ||
568 | #define S3C2410_GPGCON S3C2410_GPIOREG(0x60) | 744 | #define S3C2410_GPGCON S3C2410_GPIOREG(0x60) |
569 | #define S3C2410_GPGDAT S3C2410_GPIOREG(0x64) | 745 | #define S3C2410_GPGDAT S3C2410_GPIOREG(0x64) |
570 | #define S3C2410_GPGUP S3C2410_GPIOREG(0x68) | 746 | #define S3C2410_GPGUP S3C2410_GPIOREG(0x68) |
571 | 747 | ||
748 | #define S3C2400_GPGCON S3C2410_GPIOREG(0x44) | ||
749 | #define S3C2400_GPGDAT S3C2410_GPIOREG(0x48) | ||
750 | #define S3C2400_GPGUP S3C2410_GPIOREG(0x4C) | ||
751 | |||
572 | #define S3C2410_GPG0 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 0) | 752 | #define S3C2410_GPG0 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 0) |
573 | #define S3C2410_GPG0_INP (0x00 << 0) | 753 | #define S3C2410_GPG0_INP (0x00 << 0) |
574 | #define S3C2410_GPG0_OUTP (0x01 << 0) | 754 | #define S3C2410_GPG0_OUTP (0x01 << 0) |
575 | #define S3C2410_GPG0_EINT8 (0x02 << 0) | 755 | #define S3C2410_GPG0_EINT8 (0x02 << 0) |
756 | #define S3C2400_GPG0_I2SLRCK (0x02 << 0) | ||
576 | 757 | ||
577 | #define S3C2410_GPG1 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 1) | 758 | #define S3C2410_GPG1 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 1) |
578 | #define S3C2410_GPG1_INP (0x00 << 2) | 759 | #define S3C2410_GPG1_INP (0x00 << 2) |
579 | #define S3C2410_GPG1_OUTP (0x01 << 2) | 760 | #define S3C2410_GPG1_OUTP (0x01 << 2) |
580 | #define S3C2410_GPG1_EINT9 (0x02 << 2) | 761 | #define S3C2410_GPG1_EINT9 (0x02 << 2) |
762 | #define S3C2400_GPG1_I2SSCLK (0x02 << 2) | ||
581 | 763 | ||
582 | #define S3C2410_GPG2 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 2) | 764 | #define S3C2410_GPG2 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 2) |
583 | #define S3C2410_GPG2_INP (0x00 << 4) | 765 | #define S3C2410_GPG2_INP (0x00 << 4) |
584 | #define S3C2410_GPG2_OUTP (0x01 << 4) | 766 | #define S3C2410_GPG2_OUTP (0x01 << 4) |
585 | #define S3C2410_GPG2_EINT10 (0x02 << 4) | 767 | #define S3C2410_GPG2_EINT10 (0x02 << 4) |
768 | #define S3C2400_GPG2_CDCLK (0x02 << 4) | ||
586 | 769 | ||
587 | #define S3C2410_GPG3 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 3) | 770 | #define S3C2410_GPG3 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 3) |
588 | #define S3C2410_GPG3_INP (0x00 << 6) | 771 | #define S3C2410_GPG3_INP (0x00 << 6) |
589 | #define S3C2410_GPG3_OUTP (0x01 << 6) | 772 | #define S3C2410_GPG3_OUTP (0x01 << 6) |
590 | #define S3C2410_GPG3_EINT11 (0x02 << 6) | 773 | #define S3C2410_GPG3_EINT11 (0x02 << 6) |
774 | #define S3C2400_GPG3_I2SSDO (0x02 << 6) | ||
775 | #define S3C2400_GPG3_I2SSDI (0x03 << 6) | ||
591 | 776 | ||
592 | #define S3C2410_GPG4 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 4) | 777 | #define S3C2410_GPG4 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 4) |
593 | #define S3C2410_GPG4_INP (0x00 << 8) | 778 | #define S3C2410_GPG4_INP (0x00 << 8) |
594 | #define S3C2410_GPG4_OUTP (0x01 << 8) | 779 | #define S3C2410_GPG4_OUTP (0x01 << 8) |
595 | #define S3C2410_GPG4_EINT12 (0x02 << 8) | 780 | #define S3C2410_GPG4_EINT12 (0x02 << 8) |
781 | #define S3C2400_GPG4_MMCCLK (0x02 << 8) | ||
782 | #define S3C2400_GPG4_I2SSDI (0x03 << 8) | ||
596 | #define S3C2410_GPG4_LCDPWREN (0x03 << 8) | 783 | #define S3C2410_GPG4_LCDPWREN (0x03 << 8) |
597 | 784 | ||
598 | #define S3C2410_GPG5 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 5) | 785 | #define S3C2410_GPG5 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 5) |
599 | #define S3C2410_GPG5_INP (0x00 << 10) | 786 | #define S3C2410_GPG5_INP (0x00 << 10) |
600 | #define S3C2410_GPG5_OUTP (0x01 << 10) | 787 | #define S3C2410_GPG5_OUTP (0x01 << 10) |
601 | #define S3C2410_GPG5_EINT13 (0x02 << 10) | 788 | #define S3C2410_GPG5_EINT13 (0x02 << 10) |
789 | #define S3C2400_GPG5_MMCCMD (0x02 << 10) | ||
790 | #define S3C2400_GPG5_IICSDA (0x03 << 10) | ||
602 | #define S3C2410_GPG5_SPIMISO1 (0x03 << 10) | 791 | #define S3C2410_GPG5_SPIMISO1 (0x03 << 10) |
603 | 792 | ||
604 | #define S3C2410_GPG6 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 6) | 793 | #define S3C2410_GPG6 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 6) |
605 | #define S3C2410_GPG6_INP (0x00 << 12) | 794 | #define S3C2410_GPG6_INP (0x00 << 12) |
606 | #define S3C2410_GPG6_OUTP (0x01 << 12) | 795 | #define S3C2410_GPG6_OUTP (0x01 << 12) |
607 | #define S3C2410_GPG6_EINT14 (0x02 << 12) | 796 | #define S3C2410_GPG6_EINT14 (0x02 << 12) |
797 | #define S3C2400_GPG6_MMCDAT (0x02 << 12) | ||
798 | #define S3C2400_GPG6_IICSCL (0x03 << 12) | ||
608 | #define S3C2410_GPG6_SPIMOSI1 (0x03 << 12) | 799 | #define S3C2410_GPG6_SPIMOSI1 (0x03 << 12) |
609 | 800 | ||
610 | #define S3C2410_GPG7 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 7) | 801 | #define S3C2410_GPG7 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 7) |
@@ -612,16 +803,22 @@ | |||
612 | #define S3C2410_GPG7_OUTP (0x01 << 14) | 803 | #define S3C2410_GPG7_OUTP (0x01 << 14) |
613 | #define S3C2410_GPG7_EINT15 (0x02 << 14) | 804 | #define S3C2410_GPG7_EINT15 (0x02 << 14) |
614 | #define S3C2410_GPG7_SPICLK1 (0x03 << 14) | 805 | #define S3C2410_GPG7_SPICLK1 (0x03 << 14) |
806 | #define S3C2400_GPG7_SPIMISO (0x02 << 14) | ||
807 | #define S3C2400_GPG7_IICSDA (0x03 << 14) | ||
615 | 808 | ||
616 | #define S3C2410_GPG8 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 8) | 809 | #define S3C2410_GPG8 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 8) |
617 | #define S3C2410_GPG8_INP (0x00 << 16) | 810 | #define S3C2410_GPG8_INP (0x00 << 16) |
618 | #define S3C2410_GPG8_OUTP (0x01 << 16) | 811 | #define S3C2410_GPG8_OUTP (0x01 << 16) |
619 | #define S3C2410_GPG8_EINT16 (0x02 << 16) | 812 | #define S3C2410_GPG8_EINT16 (0x02 << 16) |
813 | #define S3C2400_GPG8_SPIMOSI (0x02 << 16) | ||
814 | #define S3C2400_GPG8_IICSCL (0x03 << 16) | ||
620 | 815 | ||
621 | #define S3C2410_GPG9 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 9) | 816 | #define S3C2410_GPG9 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 9) |
622 | #define S3C2410_GPG9_INP (0x00 << 18) | 817 | #define S3C2410_GPG9_INP (0x00 << 18) |
623 | #define S3C2410_GPG9_OUTP (0x01 << 18) | 818 | #define S3C2410_GPG9_OUTP (0x01 << 18) |
624 | #define S3C2410_GPG9_EINT17 (0x02 << 18) | 819 | #define S3C2410_GPG9_EINT17 (0x02 << 18) |
820 | #define S3C2400_GPG9_SPICLK (0x02 << 18) | ||
821 | #define S3C2400_GPG9_MMCCLK (0x03 << 18) | ||
625 | 822 | ||
626 | #define S3C2410_GPG10 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 10) | 823 | #define S3C2410_GPG10 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 10) |
627 | #define S3C2410_GPG10_INP (0x00 << 20) | 824 | #define S3C2410_GPG10_INP (0x00 << 20) |
@@ -731,19 +928,27 @@ | |||
731 | #define S3C2410_GPH10_CLKOUT1 (0x02 << 20) | 928 | #define S3C2410_GPH10_CLKOUT1 (0x02 << 20) |
732 | 929 | ||
733 | /* miscellaneous control */ | 930 | /* miscellaneous control */ |
734 | 931 | #define S3C2400_MISCCR S3C2410_GPIOREG(0x54) | |
735 | #define S3C2410_MISCCR S3C2410_GPIOREG(0x80) | 932 | #define S3C2410_MISCCR S3C2410_GPIOREG(0x80) |
736 | #define S3C2410_DCLKCON S3C2410_GPIOREG(0x84) | 933 | #define S3C2410_DCLKCON S3C2410_GPIOREG(0x84) |
737 | 934 | ||
738 | /* see clock.h for dclk definitions */ | 935 | /* see clock.h for dclk definitions */ |
739 | 936 | ||
740 | /* pullup control on databus */ | 937 | /* pullup control on databus */ |
741 | #define S3C2410_MISCCR_SPUCR_HEN (0) | 938 | #define S3C2410_MISCCR_SPUCR_HEN (0<<0) |
742 | #define S3C2410_MISCCR_SPUCR_HDIS (1<<0) | 939 | #define S3C2410_MISCCR_SPUCR_HDIS (1<<0) |
743 | #define S3C2410_MISCCR_SPUCR_LEN (0) | 940 | #define S3C2410_MISCCR_SPUCR_LEN (0<<1) |
744 | #define S3C2410_MISCCR_SPUCR_LDIS (1<<1) | 941 | #define S3C2410_MISCCR_SPUCR_LDIS (1<<1) |
745 | 942 | ||
746 | #define S3C2410_MISCCR_USBDEV (0) | 943 | #define S3C2400_MISCCR_SPUCR_LEN (0<<0) |
944 | #define S3C2400_MISCCR_SPUCR_LDIS (1<<0) | ||
945 | #define S3C2400_MISCCR_SPUCR_HEN (0<<1) | ||
946 | #define S3C2400_MISCCR_SPUCR_HDIS (1<<1) | ||
947 | |||
948 | #define S3C2400_MISCCR_HZ_STOPEN (0<<2) | ||
949 | #define S3C2400_MISCCR_HZ_STOPPREV (1<<2) | ||
950 | |||
951 | #define S3C2410_MISCCR_USBDEV (0<<3) | ||
747 | #define S3C2410_MISCCR_USBHOST (1<<3) | 952 | #define S3C2410_MISCCR_USBHOST (1<<3) |
748 | 953 | ||
749 | #define S3C2410_MISCCR_CLK0_MPLL (0<<4) | 954 | #define S3C2410_MISCCR_CLK0_MPLL (0<<4) |
@@ -779,7 +984,7 @@ | |||
779 | * | 984 | * |
780 | * Samsung datasheet p9-25 | 985 | * Samsung datasheet p9-25 |
781 | */ | 986 | */ |
782 | 987 | #define S3C2400_EXTINT0 S3C2410_GPIOREG(0x58) | |
783 | #define S3C2410_EXTINT0 S3C2410_GPIOREG(0x88) | 988 | #define S3C2410_EXTINT0 S3C2410_GPIOREG(0x88) |
784 | #define S3C2410_EXTINT1 S3C2410_GPIOREG(0x8C) | 989 | #define S3C2410_EXTINT1 S3C2410_GPIOREG(0x8C) |
785 | #define S3C2410_EXTINT2 S3C2410_GPIOREG(0x90) | 990 | #define S3C2410_EXTINT2 S3C2410_GPIOREG(0x90) |
@@ -827,5 +1032,21 @@ | |||
827 | #define S3C2410_GSTATUS2_OFFRESET (1<<1) | 1032 | #define S3C2410_GSTATUS2_OFFRESET (1<<1) |
828 | #define S3C2410_GSTATUS2_PONRESET (1<<0) | 1033 | #define S3C2410_GSTATUS2_PONRESET (1<<0) |
829 | 1034 | ||
1035 | /* open drain control register */ | ||
1036 | #define S3C2400_OPENCR S3C2410_GPIOREG(0x50) | ||
1037 | |||
1038 | #define S3C2400_OPENCR_OPC_RXD1DIS (0<<0) | ||
1039 | #define S3C2400_OPENCR_OPC_RXD1EN (1<<0) | ||
1040 | #define S3C2400_OPENCR_OPC_TXD1DIS (0<<1) | ||
1041 | #define S3C2400_OPENCR_OPC_TXD1EN (1<<1) | ||
1042 | #define S3C2400_OPENCR_OPC_CMDDIS (0<<2) | ||
1043 | #define S3C2400_OPENCR_OPC_CMDEN (1<<2) | ||
1044 | #define S3C2400_OPENCR_OPC_DATDIS (0<<3) | ||
1045 | #define S3C2400_OPENCR_OPC_DATEN (1<<3) | ||
1046 | #define S3C2400_OPENCR_OPC_MISODIS (0<<4) | ||
1047 | #define S3C2400_OPENCR_OPC_MISOEN (1<<4) | ||
1048 | #define S3C2400_OPENCR_OPC_MOSIDIS (0<<5) | ||
1049 | #define S3C2400_OPENCR_OPC_MOSIEN (1<<5) | ||
1050 | |||
830 | #endif /* __ASM_ARCH_REGS_GPIO_H */ | 1051 | #endif /* __ASM_ARCH_REGS_GPIO_H */ |
831 | 1052 | ||
diff --git a/include/asm-arm/arch-s3c2410/regs-iis.h b/include/asm-arm/arch-s3c2410/regs-iis.h index fdd62e8cd6cb..7fdde9b91cb4 100644 --- a/include/asm-arm/arch-s3c2410/regs-iis.h +++ b/include/asm-arm/arch-s3c2410/regs-iis.h | |||
@@ -55,6 +55,7 @@ | |||
55 | #define S3C2410_IISMOD_16FS (0<<0) | 55 | #define S3C2410_IISMOD_16FS (0<<0) |
56 | #define S3C2410_IISMOD_32FS (1<<0) | 56 | #define S3C2410_IISMOD_32FS (1<<0) |
57 | #define S3C2410_IISMOD_48FS (2<<0) | 57 | #define S3C2410_IISMOD_48FS (2<<0) |
58 | #define S3C2410_IISMOD_FS_MASK (3<<0) | ||
58 | 59 | ||
59 | #define S3C2410_IISPSR (0x08) | 60 | #define S3C2410_IISPSR (0x08) |
60 | #define S3C2410_IISPSR_INTMASK (31<<5) | 61 | #define S3C2410_IISPSR_INTMASK (31<<5) |
diff --git a/include/asm-arm/arch-s3c2410/uncompress.h b/include/asm-arm/arch-s3c2410/uncompress.h index d7a4a8354fa9..ddd1578a7ee0 100644 --- a/include/asm-arm/arch-s3c2410/uncompress.h +++ b/include/asm-arm/arch-s3c2410/uncompress.h | |||
@@ -116,6 +116,8 @@ putstr(const char *ptr) | |||
116 | } | 116 | } |
117 | } | 117 | } |
118 | 118 | ||
119 | #define __raw_writel(d,ad) do { *((volatile unsigned int *)(ad)) = (d); } while(0) | ||
120 | |||
119 | /* CONFIG_S3C2410_BOOT_WATCHDOG | 121 | /* CONFIG_S3C2410_BOOT_WATCHDOG |
120 | * | 122 | * |
121 | * Simple boot-time watchdog setup, to reboot the system if there is | 123 | * Simple boot-time watchdog setup, to reboot the system if there is |
@@ -126,8 +128,6 @@ putstr(const char *ptr) | |||
126 | 128 | ||
127 | #define WDOG_COUNT (0xff00) | 129 | #define WDOG_COUNT (0xff00) |
128 | 130 | ||
129 | #define __raw_writel(d,ad) do { *((volatile unsigned int *)(ad)) = (d); } while(0) | ||
130 | |||
131 | static inline void arch_decomp_wdog(void) | 131 | static inline void arch_decomp_wdog(void) |
132 | { | 132 | { |
133 | __raw_writel(WDOG_COUNT, S3C2410_WTCNT); | 133 | __raw_writel(WDOG_COUNT, S3C2410_WTCNT); |
@@ -145,6 +145,24 @@ static void arch_decomp_wdog_start(void) | |||
145 | #define arch_decomp_wdog() | 145 | #define arch_decomp_wdog() |
146 | #endif | 146 | #endif |
147 | 147 | ||
148 | #ifdef CONFIG_S3C2410_BOOT_ERROR_RESET | ||
149 | |||
150 | static void arch_decomp_error(const char *x) | ||
151 | { | ||
152 | putstr("\n\n"); | ||
153 | putstr(x); | ||
154 | putstr("\n\n -- System resetting\n"); | ||
155 | |||
156 | __raw_writel(0x4000, S3C2410_WTDAT); | ||
157 | __raw_writel(0x4000, S3C2410_WTCNT); | ||
158 | __raw_writel(S3C2410_WTCON_ENABLE | S3C2410_WTCON_DIV128 | S3C2410_WTCON_RSTEN | S3C2410_WTCON_PRESCALE(0x40), S3C2410_WTCON); | ||
159 | |||
160 | while(1); | ||
161 | } | ||
162 | |||
163 | #define arch_error arch_decomp_error | ||
164 | #endif | ||
165 | |||
148 | static void error(char *err); | 166 | static void error(char *err); |
149 | 167 | ||
150 | static void | 168 | static void |
diff --git a/include/asm-arm/arch-sa1100/hardware.h b/include/asm-arm/arch-sa1100/hardware.h index 19c3b1e186bb..28711aaa4968 100644 --- a/include/asm-arm/arch-sa1100/hardware.h +++ b/include/asm-arm/arch-sa1100/hardware.h | |||
@@ -22,13 +22,6 @@ | |||
22 | 22 | ||
23 | 23 | ||
24 | /* | 24 | /* |
25 | * We requires absolute addresses i.e. (PCMCIA_IO_0_BASE + 0x3f8) for | ||
26 | * in*()/out*() macros to be usable for all cases. | ||
27 | */ | ||
28 | #define PCIO_BASE 0 | ||
29 | |||
30 | |||
31 | /* | ||
32 | * SA1100 internal I/O mappings | 25 | * SA1100 internal I/O mappings |
33 | * | 26 | * |
34 | * We have the following mapping: | 27 | * We have the following mapping: |
diff --git a/include/asm-arm/arch-sa1100/io.h b/include/asm-arm/arch-sa1100/io.h index 7d969ffbd3bb..040ccde7a11e 100644 --- a/include/asm-arm/arch-sa1100/io.h +++ b/include/asm-arm/arch-sa1100/io.h | |||
@@ -16,7 +16,11 @@ | |||
16 | * We don't actually have real ISA nor PCI buses, but there is so many | 16 | * We don't actually have real ISA nor PCI buses, but there is so many |
17 | * drivers out there that might just work if we fake them... | 17 | * drivers out there that might just work if we fake them... |
18 | */ | 18 | */ |
19 | #define __io(a) ((void __iomem *)(PCIO_BASE + (a))) | 19 | static inline void __iomem *__io(unsigned long addr) |
20 | { | ||
21 | return (void __iomem *)addr; | ||
22 | } | ||
23 | #define __io(a) __io(a) | ||
20 | #define __mem_pci(a) (a) | 24 | #define __mem_pci(a) (a) |
21 | #define __mem_isa(a) (a) | 25 | #define __mem_isa(a) (a) |
22 | 26 | ||
diff --git a/include/asm-arm/arch-sa1100/memory.h b/include/asm-arm/arch-sa1100/memory.h index 8743ff5c1b23..018a9f0e3986 100644 --- a/include/asm-arm/arch-sa1100/memory.h +++ b/include/asm-arm/arch-sa1100/memory.h | |||
@@ -13,25 +13,15 @@ | |||
13 | /* | 13 | /* |
14 | * Physical DRAM offset is 0xc0000000 on the SA1100 | 14 | * Physical DRAM offset is 0xc0000000 on the SA1100 |
15 | */ | 15 | */ |
16 | #define PHYS_OFFSET (0xc0000000UL) | 16 | #define PHYS_OFFSET UL(0xc0000000) |
17 | 17 | ||
18 | #ifndef __ASSEMBLY__ | 18 | #ifndef __ASSEMBLY__ |
19 | 19 | ||
20 | #ifdef CONFIG_SA1111 | 20 | #ifdef CONFIG_SA1111 |
21 | static inline void | 21 | void sa1111_adjust_zones(int node, unsigned long *size, unsigned long *holes); |
22 | __arch_adjust_zones(int node, unsigned long *size, unsigned long *holes) | ||
23 | { | ||
24 | unsigned int sz = SZ_1M >> PAGE_SHIFT; | ||
25 | |||
26 | if (node != 0) | ||
27 | sz = 0; | ||
28 | |||
29 | size[1] = size[0] - sz; | ||
30 | size[0] = sz; | ||
31 | } | ||
32 | 22 | ||
33 | #define arch_adjust_zones(node, size, holes) \ | 23 | #define arch_adjust_zones(node, size, holes) \ |
34 | __arch_adjust_zones(node, size, holes) | 24 | sa1111_adjust_zones(node, size, holes) |
35 | 25 | ||
36 | #define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_1M - 1) | 26 | #define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_1M - 1) |
37 | 27 | ||
diff --git a/include/asm-arm/arch-sa1100/system.h b/include/asm-arm/arch-sa1100/system.h index 6f52118ba1a4..0f0612f79b2b 100644 --- a/include/asm-arm/arch-sa1100/system.h +++ b/include/asm-arm/arch-sa1100/system.h | |||
@@ -4,6 +4,7 @@ | |||
4 | * Copyright (c) 1999 Nicolas Pitre <nico@cam.org> | 4 | * Copyright (c) 1999 Nicolas Pitre <nico@cam.org> |
5 | */ | 5 | */ |
6 | #include <linux/config.h> | 6 | #include <linux/config.h> |
7 | #include <asm/hardware.h> | ||
7 | 8 | ||
8 | static inline void arch_idle(void) | 9 | static inline void arch_idle(void) |
9 | { | 10 | { |
diff --git a/include/asm-arm/arch-shark/io.h b/include/asm-arm/arch-shark/io.h index 5e6ed0038b2b..87ffa27f2962 100644 --- a/include/asm-arm/arch-shark/io.h +++ b/include/asm-arm/arch-shark/io.h | |||
@@ -11,6 +11,8 @@ | |||
11 | #ifndef __ASM_ARM_ARCH_IO_H | 11 | #ifndef __ASM_ARM_ARCH_IO_H |
12 | #define __ASM_ARM_ARCH_IO_H | 12 | #define __ASM_ARM_ARCH_IO_H |
13 | 13 | ||
14 | #include <asm/hardware.h> | ||
15 | |||
14 | #define IO_SPACE_LIMIT 0xffffffff | 16 | #define IO_SPACE_LIMIT 0xffffffff |
15 | 17 | ||
16 | /* | 18 | /* |
diff --git a/include/asm-arm/arch-shark/memory.h b/include/asm-arm/arch-shark/memory.h index 8ff956d25463..95a29b4bc5d0 100644 --- a/include/asm-arm/arch-shark/memory.h +++ b/include/asm-arm/arch-shark/memory.h | |||
@@ -15,7 +15,7 @@ | |||
15 | /* | 15 | /* |
16 | * Physical DRAM offset. | 16 | * Physical DRAM offset. |
17 | */ | 17 | */ |
18 | #define PHYS_OFFSET (0x08000000UL) | 18 | #define PHYS_OFFSET UL(0x08000000) |
19 | 19 | ||
20 | #ifndef __ASSEMBLY__ | 20 | #ifndef __ASSEMBLY__ |
21 | 21 | ||
diff --git a/include/asm-arm/arch-versatile/io.h b/include/asm-arm/arch-versatile/io.h index 9f895bf61494..47e904cf25c7 100644 --- a/include/asm-arm/arch-versatile/io.h +++ b/include/asm-arm/arch-versatile/io.h | |||
@@ -22,7 +22,11 @@ | |||
22 | 22 | ||
23 | #define IO_SPACE_LIMIT 0xffffffff | 23 | #define IO_SPACE_LIMIT 0xffffffff |
24 | 24 | ||
25 | #define __io(a) ((void __iomem *)(a)) | 25 | static inline void __iomem *__io(unsigned long addr) |
26 | { | ||
27 | return (void __iomem *)addr; | ||
28 | } | ||
29 | #define __io(a) __io(a) | ||
26 | #define __mem_pci(a) (a) | 30 | #define __mem_pci(a) (a) |
27 | #define __mem_isa(a) (a) | 31 | #define __mem_isa(a) (a) |
28 | 32 | ||
diff --git a/include/asm-arm/arch-versatile/memory.h b/include/asm-arm/arch-versatile/memory.h index 7b8b7cc422fa..a9370976cc5e 100644 --- a/include/asm-arm/arch-versatile/memory.h +++ b/include/asm-arm/arch-versatile/memory.h | |||
@@ -23,7 +23,7 @@ | |||
23 | /* | 23 | /* |
24 | * Physical DRAM offset. | 24 | * Physical DRAM offset. |
25 | */ | 25 | */ |
26 | #define PHYS_OFFSET (0x00000000UL) | 26 | #define PHYS_OFFSET UL(0x00000000) |
27 | 27 | ||
28 | /* | 28 | /* |
29 | * Virtual view <-> DMA view memory address translations | 29 | * Virtual view <-> DMA view memory address translations |
diff --git a/include/asm-arm/assembler.h b/include/asm-arm/assembler.h index 69a28f96bee2..f31ac92b6c7f 100644 --- a/include/asm-arm/assembler.h +++ b/include/asm-arm/assembler.h | |||
@@ -83,10 +83,13 @@ | |||
83 | * Save the current IRQ state and disable IRQs. Note that this macro | 83 | * Save the current IRQ state and disable IRQs. Note that this macro |
84 | * assumes FIQs are enabled, and that the processor is in SVC mode. | 84 | * assumes FIQs are enabled, and that the processor is in SVC mode. |
85 | */ | 85 | */ |
86 | .macro save_and_disable_irqs, oldcpsr, temp | 86 | .macro save_and_disable_irqs, oldcpsr |
87 | mrs \oldcpsr, cpsr | 87 | mrs \oldcpsr, cpsr |
88 | mov \temp, #PSR_I_BIT | MODE_SVC | 88 | #if __LINUX_ARM_ARCH__ >= 6 |
89 | msr cpsr_c, \temp | 89 | cpsid i |
90 | #else | ||
91 | msr cpsr_c, #PSR_I_BIT | MODE_SVC | ||
92 | #endif | ||
90 | .endm | 93 | .endm |
91 | 94 | ||
92 | /* | 95 | /* |
diff --git a/include/asm-arm/atomic.h b/include/asm-arm/atomic.h index 2885972b0855..d586f65c8228 100644 --- a/include/asm-arm/atomic.h +++ b/include/asm-arm/atomic.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #define __ASM_ARM_ATOMIC_H | 12 | #define __ASM_ARM_ATOMIC_H |
13 | 13 | ||
14 | #include <linux/config.h> | 14 | #include <linux/config.h> |
15 | #include <linux/compiler.h> | ||
15 | 16 | ||
16 | typedef struct { volatile int counter; } atomic_t; | 17 | typedef struct { volatile int counter; } atomic_t; |
17 | 18 | ||
@@ -80,6 +81,24 @@ static inline int atomic_sub_return(int i, atomic_t *v) | |||
80 | return result; | 81 | return result; |
81 | } | 82 | } |
82 | 83 | ||
84 | static inline int atomic_cmpxchg(atomic_t *ptr, int old, int new) | ||
85 | { | ||
86 | unsigned long oldval, res; | ||
87 | |||
88 | do { | ||
89 | __asm__ __volatile__("@ atomic_cmpxchg\n" | ||
90 | "ldrex %1, [%2]\n" | ||
91 | "mov %0, #0\n" | ||
92 | "teq %1, %3\n" | ||
93 | "strexeq %0, %4, [%2]\n" | ||
94 | : "=&r" (res), "=&r" (oldval) | ||
95 | : "r" (&ptr->counter), "Ir" (old), "r" (new) | ||
96 | : "cc"); | ||
97 | } while (res); | ||
98 | |||
99 | return oldval; | ||
100 | } | ||
101 | |||
83 | static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr) | 102 | static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr) |
84 | { | 103 | { |
85 | unsigned long tmp, tmp2; | 104 | unsigned long tmp, tmp2; |
@@ -131,6 +150,20 @@ static inline int atomic_sub_return(int i, atomic_t *v) | |||
131 | return val; | 150 | return val; |
132 | } | 151 | } |
133 | 152 | ||
153 | static inline int atomic_cmpxchg(atomic_t *v, int old, int new) | ||
154 | { | ||
155 | int ret; | ||
156 | unsigned long flags; | ||
157 | |||
158 | local_irq_save(flags); | ||
159 | ret = v->counter; | ||
160 | if (likely(ret == old)) | ||
161 | v->counter = new; | ||
162 | local_irq_restore(flags); | ||
163 | |||
164 | return ret; | ||
165 | } | ||
166 | |||
134 | static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr) | 167 | static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr) |
135 | { | 168 | { |
136 | unsigned long flags; | 169 | unsigned long flags; |
@@ -142,6 +175,17 @@ static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr) | |||
142 | 175 | ||
143 | #endif /* __LINUX_ARM_ARCH__ */ | 176 | #endif /* __LINUX_ARM_ARCH__ */ |
144 | 177 | ||
178 | static inline int atomic_add_unless(atomic_t *v, int a, int u) | ||
179 | { | ||
180 | int c, old; | ||
181 | |||
182 | c = atomic_read(v); | ||
183 | while (c != u && (old = atomic_cmpxchg((v), c, c + a)) != c) | ||
184 | c = old; | ||
185 | return c != u; | ||
186 | } | ||
187 | #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) | ||
188 | |||
145 | #define atomic_add(i, v) (void) atomic_add_return(i, v) | 189 | #define atomic_add(i, v) (void) atomic_add_return(i, v) |
146 | #define atomic_inc(v) (void) atomic_add_return(1, v) | 190 | #define atomic_inc(v) (void) atomic_add_return(1, v) |
147 | #define atomic_sub(i, v) (void) atomic_sub_return(i, v) | 191 | #define atomic_sub(i, v) (void) atomic_sub_return(i, v) |
diff --git a/include/asm-arm/bitops.h b/include/asm-arm/bitops.h index aad7aad026b3..7399d431edfe 100644 --- a/include/asm-arm/bitops.h +++ b/include/asm-arm/bitops.h | |||
@@ -19,6 +19,7 @@ | |||
19 | 19 | ||
20 | #ifdef __KERNEL__ | 20 | #ifdef __KERNEL__ |
21 | 21 | ||
22 | #include <linux/compiler.h> | ||
22 | #include <asm/system.h> | 23 | #include <asm/system.h> |
23 | 24 | ||
24 | #define smp_mb__before_clear_bit() mb() | 25 | #define smp_mb__before_clear_bit() mb() |
@@ -347,7 +348,6 @@ static inline unsigned long __ffs(unsigned long word) | |||
347 | * the clz instruction for much better code efficiency. | 348 | * the clz instruction for much better code efficiency. |
348 | */ | 349 | */ |
349 | 350 | ||
350 | static __inline__ int generic_fls(int x); | ||
351 | #define fls(x) \ | 351 | #define fls(x) \ |
352 | ( __builtin_constant_p(x) ? generic_fls(x) : \ | 352 | ( __builtin_constant_p(x) ? generic_fls(x) : \ |
353 | ({ int __r; asm("clz\t%0, %1" : "=r"(__r) : "r"(x) : "cc"); 32-__r; }) ) | 353 | ({ int __r; asm("clz\t%0, %1" : "=r"(__r) : "r"(x) : "cc"); 32-__r; }) ) |
diff --git a/include/asm-arm/cpu.h b/include/asm-arm/cpu.h index fcbdd40cb667..751bc7462074 100644 --- a/include/asm-arm/cpu.h +++ b/include/asm-arm/cpu.h | |||
@@ -16,6 +16,7 @@ | |||
16 | struct cpuinfo_arm { | 16 | struct cpuinfo_arm { |
17 | struct cpu cpu; | 17 | struct cpu cpu; |
18 | #ifdef CONFIG_SMP | 18 | #ifdef CONFIG_SMP |
19 | struct task_struct *idle; | ||
19 | unsigned int loops_per_jiffy; | 20 | unsigned int loops_per_jiffy; |
20 | #endif | 21 | #endif |
21 | }; | 22 | }; |
diff --git a/include/asm-arm/dma-mapping.h b/include/asm-arm/dma-mapping.h index d62ade4e4cbb..e3e8541ee63b 100644 --- a/include/asm-arm/dma-mapping.h +++ b/include/asm-arm/dma-mapping.h | |||
@@ -70,7 +70,7 @@ static inline int dma_mapping_error(dma_addr_t dma_addr) | |||
70 | * device-viewed address. | 70 | * device-viewed address. |
71 | */ | 71 | */ |
72 | extern void * | 72 | extern void * |
73 | dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *handle, int gfp); | 73 | dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp); |
74 | 74 | ||
75 | /** | 75 | /** |
76 | * dma_free_coherent - free memory allocated by dma_alloc_coherent | 76 | * dma_free_coherent - free memory allocated by dma_alloc_coherent |
@@ -117,7 +117,7 @@ int dma_mmap_coherent(struct device *dev, struct vm_area_struct *vma, | |||
117 | * device-viewed address. | 117 | * device-viewed address. |
118 | */ | 118 | */ |
119 | extern void * | 119 | extern void * |
120 | dma_alloc_writecombine(struct device *dev, size_t size, dma_addr_t *handle, int gfp); | 120 | dma_alloc_writecombine(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp); |
121 | 121 | ||
122 | #define dma_free_writecombine(dev,size,cpu_addr,handle) \ | 122 | #define dma_free_writecombine(dev,size,cpu_addr,handle) \ |
123 | dma_free_coherent(dev,size,cpu_addr,handle) | 123 | dma_free_coherent(dev,size,cpu_addr,handle) |
diff --git a/include/asm-arm/elf.h b/include/asm-arm/elf.h index a1696ba238d3..7da97a937548 100644 --- a/include/asm-arm/elf.h +++ b/include/asm-arm/elf.h | |||
@@ -124,6 +124,8 @@ do { \ | |||
124 | if (((ex).e_flags & EF_ARM_EABI_MASK) || \ | 124 | if (((ex).e_flags & EF_ARM_EABI_MASK) || \ |
125 | ((ex).e_flags & EF_ARM_SOFT_FLOAT)) \ | 125 | ((ex).e_flags & EF_ARM_SOFT_FLOAT)) \ |
126 | set_thread_flag(TIF_USING_IWMMXT); \ | 126 | set_thread_flag(TIF_USING_IWMMXT); \ |
127 | else \ | ||
128 | clear_thread_flag(TIF_USING_IWMMXT); \ | ||
127 | } while (0) | 129 | } while (0) |
128 | 130 | ||
129 | #endif | 131 | #endif |
diff --git a/include/asm-arm/hardirq.h b/include/asm-arm/hardirq.h index e5ccb6b8ff83..1cbb173bf5b1 100644 --- a/include/asm-arm/hardirq.h +++ b/include/asm-arm/hardirq.h | |||
@@ -8,6 +8,7 @@ | |||
8 | 8 | ||
9 | typedef struct { | 9 | typedef struct { |
10 | unsigned int __softirq_pending; | 10 | unsigned int __softirq_pending; |
11 | unsigned int local_timer_irqs; | ||
11 | } ____cacheline_aligned irq_cpustat_t; | 12 | } ____cacheline_aligned irq_cpustat_t; |
12 | 13 | ||
13 | #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ | 14 | #include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ |
diff --git a/include/asm-arm/hardware/amba_clcd.h b/include/asm-arm/hardware/amba_clcd.h index ce4cf5c1c05d..6b8d73dc1ab0 100644 --- a/include/asm-arm/hardware/amba_clcd.h +++ b/include/asm-arm/hardware/amba_clcd.h | |||
@@ -22,7 +22,7 @@ | |||
22 | #define CLCD_UBAS 0x00000010 | 22 | #define CLCD_UBAS 0x00000010 |
23 | #define CLCD_LBAS 0x00000014 | 23 | #define CLCD_LBAS 0x00000014 |
24 | 24 | ||
25 | #ifndef CONFIG_ARCH_VERSATILE | 25 | #if !defined(CONFIG_ARCH_VERSATILE) && !defined(CONFIG_ARCH_REALVIEW) |
26 | #define CLCD_IENB 0x00000018 | 26 | #define CLCD_IENB 0x00000018 |
27 | #define CLCD_CNTL 0x0000001c | 27 | #define CLCD_CNTL 0x0000001c |
28 | #else | 28 | #else |
diff --git a/include/asm-arm/hardware/amba_serial.h b/include/asm-arm/hardware/amba_serial.h index 71770aa6389f..dc726ffccebd 100644 --- a/include/asm-arm/hardware/amba_serial.h +++ b/include/asm-arm/hardware/amba_serial.h | |||
@@ -50,6 +50,11 @@ | |||
50 | #define UART011_ICR 0x44 /* Interrupt clear register. */ | 50 | #define UART011_ICR 0x44 /* Interrupt clear register. */ |
51 | #define UART011_DMACR 0x48 /* DMA control register. */ | 51 | #define UART011_DMACR 0x48 /* DMA control register. */ |
52 | 52 | ||
53 | #define UART011_DR_OE (1 << 11) | ||
54 | #define UART011_DR_BE (1 << 10) | ||
55 | #define UART011_DR_PE (1 << 9) | ||
56 | #define UART011_DR_FE (1 << 8) | ||
57 | |||
53 | #define UART01x_RSR_OE 0x08 | 58 | #define UART01x_RSR_OE 0x08 |
54 | #define UART01x_RSR_BE 0x04 | 59 | #define UART01x_RSR_BE 0x04 |
55 | #define UART01x_RSR_PE 0x02 | 60 | #define UART01x_RSR_PE 0x02 |
diff --git a/include/asm-arm/hardware/arm_scu.h b/include/asm-arm/hardware/arm_scu.h new file mode 100644 index 000000000000..9903f60c84b7 --- /dev/null +++ b/include/asm-arm/hardware/arm_scu.h | |||
@@ -0,0 +1,13 @@ | |||
1 | #ifndef ASMARM_HARDWARE_ARM_SCU_H | ||
2 | #define ASMARM_HARDWARE_ARM_SCU_H | ||
3 | |||
4 | /* | ||
5 | * SCU registers | ||
6 | */ | ||
7 | #define SCU_CTRL 0x00 | ||
8 | #define SCU_CONFIG 0x04 | ||
9 | #define SCU_CPU_STATUS 0x08 | ||
10 | #define SCU_INVALIDATE 0x0c | ||
11 | #define SCU_FPGA_REVISION 0x10 | ||
12 | |||
13 | #endif | ||
diff --git a/include/asm-arm/hardware/dec21285.h b/include/asm-arm/hardware/dec21285.h index 9049f0ddaecf..6685e3fb97b1 100644 --- a/include/asm-arm/hardware/dec21285.h +++ b/include/asm-arm/hardware/dec21285.h | |||
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | #include <linux/config.h> | 21 | #include <linux/config.h> |
22 | #ifndef __ASSEMBLY__ | 22 | #ifndef __ASSEMBLY__ |
23 | #include <asm/arch/hardware.h> | 23 | #include <asm/hardware.h> |
24 | #define DC21285_IO(x) ((volatile unsigned long *)(ARMCSR_BASE+(x))) | 24 | #define DC21285_IO(x) ((volatile unsigned long *)(ARMCSR_BASE+(x))) |
25 | #else | 25 | #else |
26 | #define DC21285_IO(x) (x) | 26 | #define DC21285_IO(x) (x) |
diff --git a/include/asm-arm/hardware/scoop.h b/include/asm-arm/hardware/scoop.h index 527404b5a8df..d37bf7443264 100644 --- a/include/asm-arm/hardware/scoop.h +++ b/include/asm-arm/hardware/scoop.h | |||
@@ -38,6 +38,8 @@ | |||
38 | struct scoop_config { | 38 | struct scoop_config { |
39 | unsigned short io_out; | 39 | unsigned short io_out; |
40 | unsigned short io_dir; | 40 | unsigned short io_dir; |
41 | unsigned short suspend_clr; | ||
42 | unsigned short suspend_set; | ||
41 | }; | 43 | }; |
42 | 44 | ||
43 | /* Structure for linking scoop devices to PCMCIA sockets */ | 45 | /* Structure for linking scoop devices to PCMCIA sockets */ |
@@ -50,8 +52,14 @@ struct scoop_pcmcia_dev { | |||
50 | unsigned char keep_rd; | 52 | unsigned char keep_rd; |
51 | }; | 53 | }; |
52 | 54 | ||
53 | extern int scoop_num; | 55 | struct scoop_pcmcia_config { |
54 | extern struct scoop_pcmcia_dev *scoop_devs; | 56 | struct scoop_pcmcia_dev *devs; |
57 | int num_devs; | ||
58 | void (*pcmcia_init)(void); | ||
59 | void (*power_ctrl)(struct device *scoop, unsigned short cpr, int nr); | ||
60 | }; | ||
61 | |||
62 | extern struct scoop_pcmcia_config *platform_scoop_config; | ||
55 | 63 | ||
56 | void reset_scoop(struct device *dev); | 64 | void reset_scoop(struct device *dev); |
57 | unsigned short set_scoop_gpio(struct device *dev, unsigned short bit); | 65 | unsigned short set_scoop_gpio(struct device *dev, unsigned short bit); |
diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h index cfa71a0dffb6..ae69db4a1010 100644 --- a/include/asm-arm/io.h +++ b/include/asm-arm/io.h | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/types.h> | 26 | #include <linux/types.h> |
27 | #include <asm/byteorder.h> | 27 | #include <asm/byteorder.h> |
28 | #include <asm/memory.h> | 28 | #include <asm/memory.h> |
29 | #include <asm/arch/hardware.h> | ||
30 | 29 | ||
31 | /* | 30 | /* |
32 | * ISA I/O bus memory addresses are 1:1 with the physical address. | 31 | * ISA I/O bus memory addresses are 1:1 with the physical address. |
@@ -56,6 +55,12 @@ extern void __raw_readsl(void __iomem *addr, void *data, int longlen); | |||
56 | #define __raw_readl(a) (__chk_io_ptr(a), *(volatile unsigned int __force *)(a)) | 55 | #define __raw_readl(a) (__chk_io_ptr(a), *(volatile unsigned int __force *)(a)) |
57 | 56 | ||
58 | /* | 57 | /* |
58 | * Architecture ioremap implementation. | ||
59 | */ | ||
60 | extern void __iomem * __ioremap(unsigned long, size_t, unsigned long); | ||
61 | extern void __iounmap(void __iomem *addr); | ||
62 | |||
63 | /* | ||
59 | * Bad read/write accesses... | 64 | * Bad read/write accesses... |
60 | */ | 65 | */ |
61 | extern void __readwrite_bug(const char *fn); | 66 | extern void __readwrite_bug(const char *fn); |
@@ -136,9 +141,9 @@ extern void __readwrite_bug(const char *fn); | |||
136 | /* | 141 | /* |
137 | * String version of IO memory access ops: | 142 | * String version of IO memory access ops: |
138 | */ | 143 | */ |
139 | extern void _memcpy_fromio(void *, void __iomem *, size_t); | 144 | extern void _memcpy_fromio(void *, const volatile void __iomem *, size_t); |
140 | extern void _memcpy_toio(void __iomem *, const void *, size_t); | 145 | extern void _memcpy_toio(volatile void __iomem *, const void *, size_t); |
141 | extern void _memset_io(void __iomem *, int, size_t); | 146 | extern void _memset_io(volatile void __iomem *, int, size_t); |
142 | 147 | ||
143 | #define mmiowb() | 148 | #define mmiowb() |
144 | 149 | ||
@@ -257,18 +262,15 @@ out: | |||
257 | * ioremap takes a PCI memory address, as specified in | 262 | * ioremap takes a PCI memory address, as specified in |
258 | * Documentation/IO-mapping.txt. | 263 | * Documentation/IO-mapping.txt. |
259 | */ | 264 | */ |
260 | extern void __iomem * __ioremap(unsigned long, size_t, unsigned long, unsigned long); | ||
261 | extern void __iounmap(void __iomem *addr); | ||
262 | |||
263 | #ifndef __arch_ioremap | 265 | #ifndef __arch_ioremap |
264 | #define ioremap(cookie,size) __ioremap(cookie,size,0,1) | 266 | #define ioremap(cookie,size) __ioremap(cookie,size,0) |
265 | #define ioremap_nocache(cookie,size) __ioremap(cookie,size,0,1) | 267 | #define ioremap_nocache(cookie,size) __ioremap(cookie,size,0) |
266 | #define ioremap_cached(cookie,size) __ioremap(cookie,size,L_PTE_CACHEABLE,1) | 268 | #define ioremap_cached(cookie,size) __ioremap(cookie,size,L_PTE_CACHEABLE) |
267 | #define iounmap(cookie) __iounmap(cookie) | 269 | #define iounmap(cookie) __iounmap(cookie) |
268 | #else | 270 | #else |
269 | #define ioremap(cookie,size) __arch_ioremap((cookie),(size),0,1) | 271 | #define ioremap(cookie,size) __arch_ioremap((cookie),(size),0) |
270 | #define ioremap_nocache(cookie,size) __arch_ioremap((cookie),(size),0,1) | 272 | #define ioremap_nocache(cookie,size) __arch_ioremap((cookie),(size),0) |
271 | #define ioremap_cached(cookie,size) __arch_ioremap((cookie),(size),L_PTE_CACHEABLE,1) | 273 | #define ioremap_cached(cookie,size) __arch_ioremap((cookie),(size),L_PTE_CACHEABLE) |
272 | #define iounmap(cookie) __arch_iounmap(cookie) | 274 | #define iounmap(cookie) __arch_iounmap(cookie) |
273 | #endif | 275 | #endif |
274 | 276 | ||
diff --git a/include/asm-arm/irq.h b/include/asm-arm/irq.h index f97912fbb10f..59975ee43cf1 100644 --- a/include/asm-arm/irq.h +++ b/include/asm-arm/irq.h | |||
@@ -47,5 +47,6 @@ struct irqaction; | |||
47 | struct pt_regs; | 47 | struct pt_regs; |
48 | int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *); | 48 | int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *); |
49 | 49 | ||
50 | extern void migrate_irqs(void); | ||
50 | #endif | 51 | #endif |
51 | 52 | ||
diff --git a/include/asm-arm/locks.h b/include/asm-arm/locks.h index f08dc8447913..852220eecdbc 100644 --- a/include/asm-arm/locks.h +++ b/include/asm-arm/locks.h | |||
@@ -103,7 +103,7 @@ | |||
103 | ({ \ | 103 | ({ \ |
104 | smp_mb(); \ | 104 | smp_mb(); \ |
105 | __asm__ __volatile__( \ | 105 | __asm__ __volatile__( \ |
106 | "@ up_op_read\n" \ | 106 | "@ up_op_write\n" \ |
107 | "1: ldrex lr, [%0]\n" \ | 107 | "1: ldrex lr, [%0]\n" \ |
108 | " adds lr, lr, %1\n" \ | 108 | " adds lr, lr, %1\n" \ |
109 | " strex ip, lr, [%0]\n" \ | 109 | " strex ip, lr, [%0]\n" \ |
@@ -231,7 +231,7 @@ | |||
231 | #define __up_op_write(ptr,wake) \ | 231 | #define __up_op_write(ptr,wake) \ |
232 | ({ \ | 232 | ({ \ |
233 | __asm__ __volatile__( \ | 233 | __asm__ __volatile__( \ |
234 | "@ up_op_read\n" \ | 234 | "@ up_op_write\n" \ |
235 | " mrs ip, cpsr\n" \ | 235 | " mrs ip, cpsr\n" \ |
236 | " orr lr, ip, #128\n" \ | 236 | " orr lr, ip, #128\n" \ |
237 | " msr cpsr_c, lr\n" \ | 237 | " msr cpsr_c, lr\n" \ |
diff --git a/include/asm-arm/mach/arch.h b/include/asm-arm/mach/arch.h index 4fa95084a8c0..eb262e078c46 100644 --- a/include/asm-arm/mach/arch.h +++ b/include/asm-arm/mach/arch.h | |||
@@ -48,10 +48,11 @@ struct machine_desc { | |||
48 | * Set of macros to define architecture features. This is built into | 48 | * Set of macros to define architecture features. This is built into |
49 | * a table by the linker. | 49 | * a table by the linker. |
50 | */ | 50 | */ |
51 | #define MACHINE_START(_type,_name) \ | 51 | #define MACHINE_START(_type,_name) \ |
52 | const struct machine_desc __mach_desc_##_type \ | 52 | static const struct machine_desc __mach_desc_##_type \ |
53 | __attribute_used__ \ | ||
53 | __attribute__((__section__(".arch.info.init"))) = { \ | 54 | __attribute__((__section__(".arch.info.init"))) = { \ |
54 | .nr = MACH_TYPE_##_type, \ | 55 | .nr = MACH_TYPE_##_type, \ |
55 | .name = _name, | 56 | .name = _name, |
56 | 57 | ||
57 | #define MACHINE_END \ | 58 | #define MACHINE_END \ |
diff --git a/include/asm-arm/mach/flash.h b/include/asm-arm/mach/flash.h index a92887d4b2cb..05b029ef6371 100644 --- a/include/asm-arm/mach/flash.h +++ b/include/asm-arm/mach/flash.h | |||
@@ -11,22 +11,27 @@ | |||
11 | #define ASMARM_MACH_FLASH_H | 11 | #define ASMARM_MACH_FLASH_H |
12 | 12 | ||
13 | struct mtd_partition; | 13 | struct mtd_partition; |
14 | struct mtd_info; | ||
14 | 15 | ||
15 | /* | 16 | /* |
16 | * map_name: the map probe function name | 17 | * map_name: the map probe function name |
18 | * name: flash device name (eg, as used with mtdparts=) | ||
17 | * width: width of mapped device | 19 | * width: width of mapped device |
18 | * init: method called at driver/device initialisation | 20 | * init: method called at driver/device initialisation |
19 | * exit: method called at driver/device removal | 21 | * exit: method called at driver/device removal |
20 | * set_vpp: method called to enable or disable VPP | 22 | * set_vpp: method called to enable or disable VPP |
23 | * mmcontrol: method called to enable or disable Sync. Burst Read in OneNAND | ||
21 | * parts: optional array of mtd_partitions for static partitioning | 24 | * parts: optional array of mtd_partitions for static partitioning |
22 | * nr_parts: number of mtd_partitions for static partitoning | 25 | * nr_parts: number of mtd_partitions for static partitoning |
23 | */ | 26 | */ |
24 | struct flash_platform_data { | 27 | struct flash_platform_data { |
25 | const char *map_name; | 28 | const char *map_name; |
29 | const char *name; | ||
26 | unsigned int width; | 30 | unsigned int width; |
27 | int (*init)(void); | 31 | int (*init)(void); |
28 | void (*exit)(void); | 32 | void (*exit)(void); |
29 | void (*set_vpp)(int on); | 33 | void (*set_vpp)(int on); |
34 | void (*mmcontrol)(struct mtd_info *mtd, int sync_read); | ||
30 | struct mtd_partition *parts; | 35 | struct mtd_partition *parts; |
31 | unsigned int nr_parts; | 36 | unsigned int nr_parts; |
32 | }; | 37 | }; |
diff --git a/include/asm-arm/mach/map.h b/include/asm-arm/mach/map.h index 9ac47cf8d2e4..b338936bde4f 100644 --- a/include/asm-arm/mach/map.h +++ b/include/asm-arm/mach/map.h | |||
@@ -11,7 +11,7 @@ | |||
11 | */ | 11 | */ |
12 | struct map_desc { | 12 | struct map_desc { |
13 | unsigned long virtual; | 13 | unsigned long virtual; |
14 | unsigned long physical; | 14 | unsigned long pfn; |
15 | unsigned long length; | 15 | unsigned long length; |
16 | unsigned int type; | 16 | unsigned int type; |
17 | }; | 17 | }; |
@@ -27,6 +27,9 @@ struct meminfo; | |||
27 | #define MT_ROM 6 | 27 | #define MT_ROM 6 |
28 | #define MT_IXP2000_DEVICE 7 | 28 | #define MT_IXP2000_DEVICE 7 |
29 | 29 | ||
30 | #define __phys_to_pfn(paddr) ((paddr) >> PAGE_SHIFT) | ||
31 | #define __pfn_to_phys(pfn) ((pfn) << PAGE_SHIFT) | ||
32 | |||
30 | extern void create_memmap_holes(struct meminfo *); | 33 | extern void create_memmap_holes(struct meminfo *); |
31 | extern void memtable_init(struct meminfo *); | 34 | extern void memtable_init(struct meminfo *); |
32 | extern void iotable_init(struct map_desc *, int); | 35 | extern void iotable_init(struct map_desc *, int); |
diff --git a/include/asm-arm/memory.h b/include/asm-arm/memory.h index a8a933a775db..a547ee598c6c 100644 --- a/include/asm-arm/memory.h +++ b/include/asm-arm/memory.h | |||
@@ -12,6 +12,16 @@ | |||
12 | #ifndef __ASM_ARM_MEMORY_H | 12 | #ifndef __ASM_ARM_MEMORY_H |
13 | #define __ASM_ARM_MEMORY_H | 13 | #define __ASM_ARM_MEMORY_H |
14 | 14 | ||
15 | /* | ||
16 | * Allow for constants defined here to be used from assembly code | ||
17 | * by prepending the UL suffix only with actual C code compilation. | ||
18 | */ | ||
19 | #ifndef __ASSEMBLY__ | ||
20 | #define UL(x) (x##UL) | ||
21 | #else | ||
22 | #define UL(x) (x) | ||
23 | #endif | ||
24 | |||
15 | #include <linux/config.h> | 25 | #include <linux/config.h> |
16 | #include <linux/compiler.h> | 26 | #include <linux/compiler.h> |
17 | #include <asm/arch/memory.h> | 27 | #include <asm/arch/memory.h> |
@@ -21,20 +31,20 @@ | |||
21 | * TASK_SIZE - the maximum size of a user space task. | 31 | * TASK_SIZE - the maximum size of a user space task. |
22 | * TASK_UNMAPPED_BASE - the lower boundary of the mmap VM area | 32 | * TASK_UNMAPPED_BASE - the lower boundary of the mmap VM area |
23 | */ | 33 | */ |
24 | #define TASK_SIZE (0xbf000000UL) | 34 | #define TASK_SIZE UL(0xbf000000) |
25 | #define TASK_UNMAPPED_BASE (0x40000000UL) | 35 | #define TASK_UNMAPPED_BASE UL(0x40000000) |
26 | #endif | 36 | #endif |
27 | 37 | ||
28 | /* | 38 | /* |
29 | * The maximum size of a 26-bit user space task. | 39 | * The maximum size of a 26-bit user space task. |
30 | */ | 40 | */ |
31 | #define TASK_SIZE_26 (0x04000000UL) | 41 | #define TASK_SIZE_26 UL(0x04000000) |
32 | 42 | ||
33 | /* | 43 | /* |
34 | * Page offset: 3GB | 44 | * Page offset: 3GB |
35 | */ | 45 | */ |
36 | #ifndef PAGE_OFFSET | 46 | #ifndef PAGE_OFFSET |
37 | #define PAGE_OFFSET (0xc0000000UL) | 47 | #define PAGE_OFFSET UL(0xc0000000) |
38 | #endif | 48 | #endif |
39 | 49 | ||
40 | /* | 50 | /* |
@@ -58,6 +68,13 @@ | |||
58 | #error Top of user space clashes with start of module space | 68 | #error Top of user space clashes with start of module space |
59 | #endif | 69 | #endif |
60 | 70 | ||
71 | /* | ||
72 | * The XIP kernel gets mapped at the bottom of the module vm area. | ||
73 | * Since we use sections to map it, this macro replaces the physical address | ||
74 | * with its virtual address while keeping offset from the base section. | ||
75 | */ | ||
76 | #define XIP_VIRT_ADDR(physaddr) (MODULE_START + ((physaddr) & 0x000fffff)) | ||
77 | |||
61 | #ifndef __ASSEMBLY__ | 78 | #ifndef __ASSEMBLY__ |
62 | 79 | ||
63 | /* | 80 | /* |
diff --git a/include/asm-arm/mmu_context.h b/include/asm-arm/mmu_context.h index 4af9c411c617..81c59facea3b 100644 --- a/include/asm-arm/mmu_context.h +++ b/include/asm-arm/mmu_context.h | |||
@@ -13,6 +13,8 @@ | |||
13 | #ifndef __ASM_ARM_MMU_CONTEXT_H | 13 | #ifndef __ASM_ARM_MMU_CONTEXT_H |
14 | #define __ASM_ARM_MMU_CONTEXT_H | 14 | #define __ASM_ARM_MMU_CONTEXT_H |
15 | 15 | ||
16 | #include <linux/compiler.h> | ||
17 | #include <asm/cacheflush.h> | ||
16 | #include <asm/proc-fns.h> | 18 | #include <asm/proc-fns.h> |
17 | 19 | ||
18 | #if __LINUX_ARM_ARCH__ >= 6 | 20 | #if __LINUX_ARM_ARCH__ >= 6 |
@@ -86,7 +88,8 @@ switch_mm(struct mm_struct *prev, struct mm_struct *next, | |||
86 | cpu_set(cpu, next->cpu_vm_mask); | 88 | cpu_set(cpu, next->cpu_vm_mask); |
87 | check_context(next); | 89 | check_context(next); |
88 | cpu_switch_mm(next->pgd, next); | 90 | cpu_switch_mm(next->pgd, next); |
89 | cpu_clear(cpu, prev->cpu_vm_mask); | 91 | if (cache_is_vivt()) |
92 | cpu_clear(cpu, prev->cpu_vm_mask); | ||
90 | } | 93 | } |
91 | } | 94 | } |
92 | 95 | ||
diff --git a/include/asm-arm/numnodes.h b/include/asm-arm/numnodes.h index 5d2a1034a02e..8df36818ebc9 100644 --- a/include/asm-arm/numnodes.h +++ b/include/asm-arm/numnodes.h | |||
@@ -17,6 +17,8 @@ | |||
17 | #ifndef __ASM_ARM_NUMNODES_H | 17 | #ifndef __ASM_ARM_NUMNODES_H |
18 | #define __ASM_ARM_NUMNODES_H | 18 | #define __ASM_ARM_NUMNODES_H |
19 | 19 | ||
20 | #include <asm/memory.h> | ||
21 | |||
20 | #ifndef NODES_SHIFT | 22 | #ifndef NODES_SHIFT |
21 | # define NODES_SHIFT 2 /* Normally, Max 4 Nodes */ | 23 | # define NODES_SHIFT 2 /* Normally, Max 4 Nodes */ |
22 | #endif | 24 | #endif |
diff --git a/include/asm-arm/pgtable.h b/include/asm-arm/pgtable.h index 366bafbdfbb1..5a0d19b466b0 100644 --- a/include/asm-arm/pgtable.h +++ b/include/asm-arm/pgtable.h | |||
@@ -397,9 +397,6 @@ static inline pte_t *pmd_page_kernel(pmd_t pmd) | |||
397 | #define pgd_clear(pgdp) do { } while (0) | 397 | #define pgd_clear(pgdp) do { } while (0) |
398 | #define set_pgd(pgd,pgdp) do { } while (0) | 398 | #define set_pgd(pgd,pgdp) do { } while (0) |
399 | 399 | ||
400 | #define page_pte_prot(page,prot) mk_pte(page, prot) | ||
401 | #define page_pte(page) mk_pte(page, __pgprot(0)) | ||
402 | |||
403 | /* to find an entry in a page-table-directory */ | 400 | /* to find an entry in a page-table-directory */ |
404 | #define pgd_index(addr) ((addr) >> PGDIR_SHIFT) | 401 | #define pgd_index(addr) ((addr) >> PGDIR_SHIFT) |
405 | 402 | ||
diff --git a/include/asm-arm/semaphore.h b/include/asm-arm/semaphore.h index 60f33e6eb800..d5dc624f452a 100644 --- a/include/asm-arm/semaphore.h +++ b/include/asm-arm/semaphore.h | |||
@@ -24,8 +24,6 @@ struct semaphore { | |||
24 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait), \ | 24 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait), \ |
25 | } | 25 | } |
26 | 26 | ||
27 | #define __MUTEX_INITIALIZER(name) __SEMAPHORE_INIT(name,1) | ||
28 | |||
29 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ | 27 | #define __DECLARE_SEMAPHORE_GENERIC(name,count) \ |
30 | struct semaphore name = __SEMAPHORE_INIT(name,count) | 28 | struct semaphore name = __SEMAPHORE_INIT(name,count) |
31 | 29 | ||
@@ -49,11 +47,6 @@ static inline void init_MUTEX_LOCKED(struct semaphore *sem) | |||
49 | sema_init(sem, 0); | 47 | sema_init(sem, 0); |
50 | } | 48 | } |
51 | 49 | ||
52 | static inline int sema_count(struct semaphore *sem) | ||
53 | { | ||
54 | return atomic_read(&sem->count); | ||
55 | } | ||
56 | |||
57 | /* | 50 | /* |
58 | * special register calling convention | 51 | * special register calling convention |
59 | */ | 52 | */ |
diff --git a/include/asm-arm/signal.h b/include/asm-arm/signal.h index 760f6e65af05..ced69161917b 100644 --- a/include/asm-arm/signal.h +++ b/include/asm-arm/signal.h | |||
@@ -115,7 +115,6 @@ typedef unsigned long sigset_t; | |||
115 | 115 | ||
116 | #ifdef __KERNEL__ | 116 | #ifdef __KERNEL__ |
117 | #define SA_TIMER 0x40000000 | 117 | #define SA_TIMER 0x40000000 |
118 | #define SA_IRQNOMASK 0x08000000 | ||
119 | #endif | 118 | #endif |
120 | 119 | ||
121 | #include <asm-generic/signal.h> | 120 | #include <asm-generic/signal.h> |
diff --git a/include/asm-arm/smp.h b/include/asm-arm/smp.h index dbb4d859c586..5a72e50ca9fc 100644 --- a/include/asm-arm/smp.h +++ b/include/asm-arm/smp.h | |||
@@ -37,6 +37,11 @@ struct seq_file; | |||
37 | extern void show_ipi_list(struct seq_file *p); | 37 | extern void show_ipi_list(struct seq_file *p); |
38 | 38 | ||
39 | /* | 39 | /* |
40 | * Called from assembly code, this handles an IPI. | ||
41 | */ | ||
42 | asmlinkage void do_IPI(struct pt_regs *regs); | ||
43 | |||
44 | /* | ||
40 | * Move global data into per-processor storage. | 45 | * Move global data into per-processor storage. |
41 | */ | 46 | */ |
42 | extern void smp_store_cpu_info(unsigned int cpuid); | 47 | extern void smp_store_cpu_info(unsigned int cpuid); |
@@ -47,12 +52,23 @@ extern void smp_store_cpu_info(unsigned int cpuid); | |||
47 | extern void smp_cross_call(cpumask_t callmap); | 52 | extern void smp_cross_call(cpumask_t callmap); |
48 | 53 | ||
49 | /* | 54 | /* |
55 | * Broadcast a timer interrupt to the other CPUs. | ||
56 | */ | ||
57 | extern void smp_send_timer(void); | ||
58 | |||
59 | /* | ||
50 | * Boot a secondary CPU, and assign it the specified idle task. | 60 | * Boot a secondary CPU, and assign it the specified idle task. |
51 | * This also gives us the initial stack to use for this CPU. | 61 | * This also gives us the initial stack to use for this CPU. |
52 | */ | 62 | */ |
53 | extern int boot_secondary(unsigned int cpu, struct task_struct *); | 63 | extern int boot_secondary(unsigned int cpu, struct task_struct *); |
54 | 64 | ||
55 | /* | 65 | /* |
66 | * Called from platform specific assembly code, this is the | ||
67 | * secondary CPU entry point. | ||
68 | */ | ||
69 | asmlinkage void secondary_start_kernel(void); | ||
70 | |||
71 | /* | ||
56 | * Perform platform specific initialisation of the specified CPU. | 72 | * Perform platform specific initialisation of the specified CPU. |
57 | */ | 73 | */ |
58 | extern void platform_secondary_init(unsigned int cpu); | 74 | extern void platform_secondary_init(unsigned int cpu); |
@@ -66,4 +82,52 @@ struct secondary_data { | |||
66 | }; | 82 | }; |
67 | extern struct secondary_data secondary_data; | 83 | extern struct secondary_data secondary_data; |
68 | 84 | ||
85 | extern int __cpu_disable(void); | ||
86 | extern int mach_cpu_disable(unsigned int cpu); | ||
87 | |||
88 | extern void __cpu_die(unsigned int cpu); | ||
89 | extern void cpu_die(void); | ||
90 | |||
91 | extern void platform_cpu_die(unsigned int cpu); | ||
92 | extern int platform_cpu_kill(unsigned int cpu); | ||
93 | extern void platform_cpu_enable(unsigned int cpu); | ||
94 | |||
95 | #ifdef CONFIG_LOCAL_TIMERS | ||
96 | /* | ||
97 | * Setup a local timer interrupt for a CPU. | ||
98 | */ | ||
99 | extern void local_timer_setup(unsigned int cpu); | ||
100 | |||
101 | /* | ||
102 | * Stop a local timer interrupt. | ||
103 | */ | ||
104 | extern void local_timer_stop(unsigned int cpu); | ||
105 | |||
106 | /* | ||
107 | * Platform provides this to acknowledge a local timer IRQ | ||
108 | */ | ||
109 | extern int local_timer_ack(void); | ||
110 | |||
111 | #else | ||
112 | |||
113 | static inline void local_timer_setup(unsigned int cpu) | ||
114 | { | ||
115 | } | ||
116 | |||
117 | static inline void local_timer_stop(unsigned int cpu) | ||
118 | { | ||
119 | } | ||
120 | |||
121 | #endif | ||
122 | |||
123 | /* | ||
124 | * show local interrupt info | ||
125 | */ | ||
126 | extern void show_local_irqs(struct seq_file *); | ||
127 | |||
128 | /* | ||
129 | * Called from assembly, this is the local timer IRQ handler | ||
130 | */ | ||
131 | asmlinkage void do_local_timer(struct pt_regs *); | ||
132 | |||
69 | #endif /* ifndef __ASM_ARM_SMP_H */ | 133 | #endif /* ifndef __ASM_ARM_SMP_H */ |
diff --git a/include/asm-arm/spinlock.h b/include/asm-arm/spinlock.h index cb4906b45555..43ad4e55878c 100644 --- a/include/asm-arm/spinlock.h +++ b/include/asm-arm/spinlock.h | |||
@@ -30,6 +30,9 @@ static inline void __raw_spin_lock(raw_spinlock_t *lock) | |||
30 | __asm__ __volatile__( | 30 | __asm__ __volatile__( |
31 | "1: ldrex %0, [%1]\n" | 31 | "1: ldrex %0, [%1]\n" |
32 | " teq %0, #0\n" | 32 | " teq %0, #0\n" |
33 | #ifdef CONFIG_CPU_32v6K | ||
34 | " wfene\n" | ||
35 | #endif | ||
33 | " strexeq %0, %2, [%1]\n" | 36 | " strexeq %0, %2, [%1]\n" |
34 | " teqeq %0, #0\n" | 37 | " teqeq %0, #0\n" |
35 | " bne 1b" | 38 | " bne 1b" |
@@ -65,7 +68,11 @@ static inline void __raw_spin_unlock(raw_spinlock_t *lock) | |||
65 | smp_mb(); | 68 | smp_mb(); |
66 | 69 | ||
67 | __asm__ __volatile__( | 70 | __asm__ __volatile__( |
68 | " str %1, [%0]" | 71 | " str %1, [%0]\n" |
72 | #ifdef CONFIG_CPU_32v6K | ||
73 | " mcr p15, 0, %1, c7, c10, 4\n" /* DSB */ | ||
74 | " sev" | ||
75 | #endif | ||
69 | : | 76 | : |
70 | : "r" (&lock->lock), "r" (0) | 77 | : "r" (&lock->lock), "r" (0) |
71 | : "cc"); | 78 | : "cc"); |
@@ -80,13 +87,16 @@ static inline void __raw_spin_unlock(raw_spinlock_t *lock) | |||
80 | */ | 87 | */ |
81 | #define rwlock_is_locked(x) (*((volatile unsigned int *)(x)) != 0) | 88 | #define rwlock_is_locked(x) (*((volatile unsigned int *)(x)) != 0) |
82 | 89 | ||
83 | static inline void __raw_write_lock(rwlock_t *rw) | 90 | static inline void __raw_write_lock(raw_rwlock_t *rw) |
84 | { | 91 | { |
85 | unsigned long tmp; | 92 | unsigned long tmp; |
86 | 93 | ||
87 | __asm__ __volatile__( | 94 | __asm__ __volatile__( |
88 | "1: ldrex %0, [%1]\n" | 95 | "1: ldrex %0, [%1]\n" |
89 | " teq %0, #0\n" | 96 | " teq %0, #0\n" |
97 | #ifdef CONFIG_CPU_32v6K | ||
98 | " wfene\n" | ||
99 | #endif | ||
90 | " strexeq %0, %2, [%1]\n" | 100 | " strexeq %0, %2, [%1]\n" |
91 | " teq %0, #0\n" | 101 | " teq %0, #0\n" |
92 | " bne 1b" | 102 | " bne 1b" |
@@ -97,7 +107,7 @@ static inline void __raw_write_lock(rwlock_t *rw) | |||
97 | smp_mb(); | 107 | smp_mb(); |
98 | } | 108 | } |
99 | 109 | ||
100 | static inline int __raw_write_trylock(rwlock_t *rw) | 110 | static inline int __raw_write_trylock(raw_rwlock_t *rw) |
101 | { | 111 | { |
102 | unsigned long tmp; | 112 | unsigned long tmp; |
103 | 113 | ||
@@ -122,7 +132,11 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw) | |||
122 | smp_mb(); | 132 | smp_mb(); |
123 | 133 | ||
124 | __asm__ __volatile__( | 134 | __asm__ __volatile__( |
125 | "str %1, [%0]" | 135 | "str %1, [%0]\n" |
136 | #ifdef CONFIG_CPU_32v6K | ||
137 | " mcr p15, 0, %1, c7, c10, 4\n" /* DSB */ | ||
138 | " sev\n" | ||
139 | #endif | ||
126 | : | 140 | : |
127 | : "r" (&rw->lock), "r" (0) | 141 | : "r" (&rw->lock), "r" (0) |
128 | : "cc"); | 142 | : "cc"); |
@@ -148,6 +162,9 @@ static inline void __raw_read_lock(raw_rwlock_t *rw) | |||
148 | "1: ldrex %0, [%2]\n" | 162 | "1: ldrex %0, [%2]\n" |
149 | " adds %0, %0, #1\n" | 163 | " adds %0, %0, #1\n" |
150 | " strexpl %1, %0, [%2]\n" | 164 | " strexpl %1, %0, [%2]\n" |
165 | #ifdef CONFIG_CPU_32v6K | ||
166 | " wfemi\n" | ||
167 | #endif | ||
151 | " rsbpls %0, %1, #0\n" | 168 | " rsbpls %0, %1, #0\n" |
152 | " bmi 1b" | 169 | " bmi 1b" |
153 | : "=&r" (tmp), "=&r" (tmp2) | 170 | : "=&r" (tmp), "=&r" (tmp2) |
@@ -157,7 +174,7 @@ static inline void __raw_read_lock(raw_rwlock_t *rw) | |||
157 | smp_mb(); | 174 | smp_mb(); |
158 | } | 175 | } |
159 | 176 | ||
160 | static inline void __raw_read_unlock(rwlock_t *rw) | 177 | static inline void __raw_read_unlock(raw_rwlock_t *rw) |
161 | { | 178 | { |
162 | unsigned long tmp, tmp2; | 179 | unsigned long tmp, tmp2; |
163 | 180 | ||
@@ -169,6 +186,11 @@ static inline void __raw_read_unlock(rwlock_t *rw) | |||
169 | " strex %1, %0, [%2]\n" | 186 | " strex %1, %0, [%2]\n" |
170 | " teq %1, #0\n" | 187 | " teq %1, #0\n" |
171 | " bne 1b" | 188 | " bne 1b" |
189 | #ifdef CONFIG_CPU_32v6K | ||
190 | "\n cmp %0, #0\n" | ||
191 | " mcreq p15, 0, %0, c7, c10, 4\n" | ||
192 | " seveq" | ||
193 | #endif | ||
172 | : "=&r" (tmp), "=&r" (tmp2) | 194 | : "=&r" (tmp), "=&r" (tmp2) |
173 | : "r" (&rw->lock) | 195 | : "r" (&rw->lock) |
174 | : "cc"); | 196 | : "cc"); |
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h index 8efa4ebdcacb..5621d61ebc07 100644 --- a/include/asm-arm/system.h +++ b/include/asm-arm/system.h | |||
@@ -93,8 +93,6 @@ void hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int, | |||
93 | struct pt_regs *), | 93 | struct pt_regs *), |
94 | int sig, const char *name); | 94 | int sig, const char *name); |
95 | 95 | ||
96 | #include <asm/proc-fns.h> | ||
97 | |||
98 | #define xchg(ptr,x) \ | 96 | #define xchg(ptr,x) \ |
99 | ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) | 97 | ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) |
100 | 98 | ||
@@ -102,6 +100,8 @@ void hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int, | |||
102 | 100 | ||
103 | extern asmlinkage void __backtrace(void); | 101 | extern asmlinkage void __backtrace(void); |
104 | extern asmlinkage void c_backtrace(unsigned long fp, int pmode); | 102 | extern asmlinkage void c_backtrace(unsigned long fp, int pmode); |
103 | |||
104 | struct mm_struct; | ||
105 | extern void show_pte(struct mm_struct *mm, unsigned long addr); | 105 | extern void show_pte(struct mm_struct *mm, unsigned long addr); |
106 | extern void __show_regs(struct pt_regs *); | 106 | extern void __show_regs(struct pt_regs *); |
107 | 107 | ||
diff --git a/include/asm-arm/thread_info.h b/include/asm-arm/thread_info.h index 8252a4cd860f..7c98557b717f 100644 --- a/include/asm-arm/thread_info.h +++ b/include/asm-arm/thread_info.h | |||
@@ -12,6 +12,7 @@ | |||
12 | 12 | ||
13 | #ifdef __KERNEL__ | 13 | #ifdef __KERNEL__ |
14 | 14 | ||
15 | #include <linux/compiler.h> | ||
15 | #include <asm/fpstate.h> | 16 | #include <asm/fpstate.h> |
16 | 17 | ||
17 | #define THREAD_SIZE_ORDER 1 | 18 | #define THREAD_SIZE_ORDER 1 |
diff --git a/include/asm-arm/tlb.h b/include/asm-arm/tlb.h index 9bb325c54645..f49bfb78c221 100644 --- a/include/asm-arm/tlb.h +++ b/include/asm-arm/tlb.h | |||
@@ -27,11 +27,7 @@ | |||
27 | */ | 27 | */ |
28 | struct mmu_gather { | 28 | struct mmu_gather { |
29 | struct mm_struct *mm; | 29 | struct mm_struct *mm; |
30 | unsigned int freed; | ||
31 | unsigned int fullmm; | 30 | unsigned int fullmm; |
32 | |||
33 | unsigned int flushes; | ||
34 | unsigned int avoided_flushes; | ||
35 | }; | 31 | }; |
36 | 32 | ||
37 | DECLARE_PER_CPU(struct mmu_gather, mmu_gathers); | 33 | DECLARE_PER_CPU(struct mmu_gather, mmu_gathers); |
@@ -39,11 +35,9 @@ DECLARE_PER_CPU(struct mmu_gather, mmu_gathers); | |||
39 | static inline struct mmu_gather * | 35 | static inline struct mmu_gather * |
40 | tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush) | 36 | tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush) |
41 | { | 37 | { |
42 | int cpu = smp_processor_id(); | 38 | struct mmu_gather *tlb = &get_cpu_var(mmu_gathers); |
43 | struct mmu_gather *tlb = &per_cpu(mmu_gathers, cpu); | ||
44 | 39 | ||
45 | tlb->mm = mm; | 40 | tlb->mm = mm; |
46 | tlb->freed = 0; | ||
47 | tlb->fullmm = full_mm_flush; | 41 | tlb->fullmm = full_mm_flush; |
48 | 42 | ||
49 | return tlb; | 43 | return tlb; |
@@ -52,24 +46,13 @@ tlb_gather_mmu(struct mm_struct *mm, unsigned int full_mm_flush) | |||
52 | static inline void | 46 | static inline void |
53 | tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end) | 47 | tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end) |
54 | { | 48 | { |
55 | struct mm_struct *mm = tlb->mm; | ||
56 | unsigned long freed = tlb->freed; | ||
57 | int rss = get_mm_counter(mm, rss); | ||
58 | |||
59 | if (rss < freed) | ||
60 | freed = rss; | ||
61 | add_mm_counter(mm, rss, -freed); | ||
62 | |||
63 | if (tlb->fullmm) | 49 | if (tlb->fullmm) |
64 | flush_tlb_mm(mm); | 50 | flush_tlb_mm(tlb->mm); |
65 | 51 | ||
66 | /* keep the page table cache within bounds */ | 52 | /* keep the page table cache within bounds */ |
67 | check_pgt_cache(); | 53 | check_pgt_cache(); |
68 | } | ||
69 | 54 | ||
70 | static inline unsigned int tlb_is_full_mm(struct mmu_gather *tlb) | 55 | put_cpu_var(mmu_gathers); |
71 | { | ||
72 | return tlb->fullmm; | ||
73 | } | 56 | } |
74 | 57 | ||
75 | #define tlb_remove_tlb_entry(tlb,ptep,address) do { } while (0) | 58 | #define tlb_remove_tlb_entry(tlb,ptep,address) do { } while (0) |
diff --git a/include/asm-arm/uaccess.h b/include/asm-arm/uaccess.h index a2fdad0138b3..064f0f5e8e2b 100644 --- a/include/asm-arm/uaccess.h +++ b/include/asm-arm/uaccess.h | |||
@@ -100,7 +100,6 @@ static inline void set_fs (mm_segment_t fs) | |||
100 | extern int __get_user_1(void *); | 100 | extern int __get_user_1(void *); |
101 | extern int __get_user_2(void *); | 101 | extern int __get_user_2(void *); |
102 | extern int __get_user_4(void *); | 102 | extern int __get_user_4(void *); |
103 | extern int __get_user_8(void *); | ||
104 | extern int __get_user_bad(void); | 103 | extern int __get_user_bad(void); |
105 | 104 | ||
106 | #define __get_user_x(__r2,__p,__e,__s,__i...) \ | 105 | #define __get_user_x(__r2,__p,__e,__s,__i...) \ |
@@ -114,7 +113,7 @@ extern int __get_user_bad(void); | |||
114 | #define get_user(x,p) \ | 113 | #define get_user(x,p) \ |
115 | ({ \ | 114 | ({ \ |
116 | const register typeof(*(p)) __user *__p asm("r0") = (p);\ | 115 | const register typeof(*(p)) __user *__p asm("r0") = (p);\ |
117 | register typeof(*(p)) __r2 asm("r2"); \ | 116 | register unsigned int __r2 asm("r2"); \ |
118 | register int __e asm("r0"); \ | 117 | register int __e asm("r0"); \ |
119 | switch (sizeof(*(__p))) { \ | 118 | switch (sizeof(*(__p))) { \ |
120 | case 1: \ | 119 | case 1: \ |
@@ -126,12 +125,9 @@ extern int __get_user_bad(void); | |||
126 | case 4: \ | 125 | case 4: \ |
127 | __get_user_x(__r2, __p, __e, 4, "lr"); \ | 126 | __get_user_x(__r2, __p, __e, 4, "lr"); \ |
128 | break; \ | 127 | break; \ |
129 | case 8: \ | ||
130 | __get_user_x(__r2, __p, __e, 8, "lr"); \ | ||
131 | break; \ | ||
132 | default: __e = __get_user_bad(); break; \ | 128 | default: __e = __get_user_bad(); break; \ |
133 | } \ | 129 | } \ |
134 | x = __r2; \ | 130 | x = (typeof(*(p))) __r2; \ |
135 | __e; \ | 131 | __e; \ |
136 | }) | 132 | }) |
137 | 133 | ||
diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h index c49df635a80f..d626e70faded 100644 --- a/include/asm-arm/unistd.h +++ b/include/asm-arm/unistd.h | |||
@@ -544,7 +544,6 @@ asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp, | |||
544 | asmlinkage int sys_fork(struct pt_regs *regs); | 544 | asmlinkage int sys_fork(struct pt_regs *regs); |
545 | asmlinkage int sys_vfork(struct pt_regs *regs); | 545 | asmlinkage int sys_vfork(struct pt_regs *regs); |
546 | asmlinkage int sys_pipe(unsigned long *fildes); | 546 | asmlinkage int sys_pipe(unsigned long *fildes); |
547 | asmlinkage int sys_ptrace(long request, long pid, long addr, long data); | ||
548 | struct sigaction; | 547 | struct sigaction; |
549 | asmlinkage long sys_rt_sigaction(int sig, | 548 | asmlinkage long sys_rt_sigaction(int sig, |
550 | const struct sigaction __user *act, | 549 | const struct sigaction __user *act, |