diff options
author | Ben Dooks <ben-linux@fluff.org> | 2008-10-21 09:06:26 -0400 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2008-12-15 16:46:38 -0500 |
commit | ce46a9c497ed788146449c230765ee5d6dd3cb53 (patch) | |
tree | 24962a338eae4976e4a6bd051d4cc0db3461bf67 /arch/arm | |
parent | 1d4bab082474d539f900e896880aa2135e0f5393 (diff) |
[ARM] S3C24XX: Split map.h into plat-s3c24xx and mach-s3c2410
Split the map.h definitions into common S3C24XX code by
adding arch/arm/plat-s3c24xx/include/plat/map.h and
altering the machine specific header for the S3C24A0.
As we add a new <plat/map.h> we move the original one
in arch/arm/plat-s3c include directory to be called
map-base.h to distinguish the two files.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-s3c2410/include/mach/map.h | 80 | ||||
-rw-r--r-- | arch/arm/mach-s3c24a0/include/mach/map.h | 5 | ||||
-rw-r--r-- | arch/arm/plat-s3c/include/plat/map-base.h (renamed from arch/arm/plat-s3c/include/plat/map.h) | 0 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/devs.c | 8 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/include/plat/map.h | 99 |
5 files changed, 111 insertions, 81 deletions
diff --git a/arch/arm/mach-s3c2410/include/mach/map.h b/arch/arm/mach-s3c2410/include/mach/map.h index 6e08594d7162..6b30361a0805 100644 --- a/arch/arm/mach-s3c2410/include/mach/map.h +++ b/arch/arm/mach-s3c2410/include/mach/map.h | |||
@@ -13,34 +13,20 @@ | |||
13 | #ifndef __ASM_ARCH_MAP_H | 13 | #ifndef __ASM_ARCH_MAP_H |
14 | #define __ASM_ARCH_MAP_H | 14 | #define __ASM_ARCH_MAP_H |
15 | 15 | ||
16 | #include <plat/map-base.h> | ||
16 | #include <plat/map.h> | 17 | #include <plat/map.h> |
17 | 18 | ||
18 | #define S3C2410_ADDR(x) S3C_ADDR(x) | 19 | #define S3C2410_ADDR(x) S3C_ADDR(x) |
19 | 20 | ||
20 | /* interrupt controller is the first thing we put in, to make | ||
21 | * the assembly code for the irq detection easier | ||
22 | */ | ||
23 | #define S3C24XX_VA_IRQ S3C_VA_IRQ | ||
24 | #define S3C2410_PA_IRQ (0x4A000000) | ||
25 | #define S3C24XX_SZ_IRQ SZ_1M | ||
26 | |||
27 | /* memory controller registers */ | ||
28 | #define S3C24XX_VA_MEMCTRL S3C_VA_MEM | ||
29 | #define S3C2410_PA_MEMCTRL (0x48000000) | ||
30 | #define S3C24XX_SZ_MEMCTRL SZ_1M | ||
31 | |||
32 | /* USB host controller */ | 21 | /* USB host controller */ |
33 | #define S3C2410_PA_USBHOST (0x49000000) | 22 | #define S3C2410_PA_USBHOST (0x49000000) |
34 | #define S3C24XX_SZ_USBHOST SZ_1M | ||
35 | 23 | ||
36 | /* DMA controller */ | 24 | /* DMA controller */ |
37 | #define S3C2410_PA_DMA (0x4B000000) | 25 | #define S3C2410_PA_DMA (0x4B000000) |
38 | #define S3C24XX_SZ_DMA SZ_1M | 26 | #define S3C24XX_SZ_DMA SZ_1M |
39 | 27 | ||
40 | /* Clock and Power management */ | 28 | /* Clock and Power management */ |
41 | #define S3C24XX_VA_CLKPWR S3C_VA_SYS | ||
42 | #define S3C2410_PA_CLKPWR (0x4C000000) | 29 | #define S3C2410_PA_CLKPWR (0x4C000000) |
43 | #define S3C24XX_SZ_CLKPWR SZ_1M | ||
44 | 30 | ||
45 | /* LCD controller */ | 31 | /* LCD controller */ |
46 | #define S3C2410_PA_LCD (0x4D000000) | 32 | #define S3C2410_PA_LCD (0x4D000000) |
@@ -48,48 +34,12 @@ | |||
48 | 34 | ||
49 | /* NAND flash controller */ | 35 | /* NAND flash controller */ |
50 | #define S3C2410_PA_NAND (0x4E000000) | 36 | #define S3C2410_PA_NAND (0x4E000000) |
51 | #define S3C24XX_SZ_NAND SZ_1M | ||
52 | |||
53 | /* UARTs */ | ||
54 | #define S3C24XX_VA_UART S3C_VA_UART | ||
55 | #define S3C2410_PA_UART (0x50000000) | ||
56 | #define S3C24XX_SZ_UART SZ_1M | ||
57 | |||
58 | /* Timers */ | ||
59 | #define S3C24XX_VA_TIMER S3C_VA_TIMER | ||
60 | #define S3C2410_PA_TIMER (0x51000000) | ||
61 | #define S3C24XX_SZ_TIMER SZ_1M | ||
62 | |||
63 | /* USB Device port */ | ||
64 | #define S3C2410_PA_USBDEV (0x52000000) | ||
65 | #define S3C24XX_SZ_USBDEV SZ_1M | ||
66 | |||
67 | /* Watchdog */ | ||
68 | #define S3C24XX_VA_WATCHDOG S3C_VA_WATCHDOG | ||
69 | #define S3C2410_PA_WATCHDOG (0x53000000) | ||
70 | #define S3C24XX_SZ_WATCHDOG SZ_1M | ||
71 | 37 | ||
72 | /* IIC hardware controller */ | 38 | /* IIC hardware controller */ |
73 | #define S3C2410_PA_IIC (0x54000000) | 39 | #define S3C2410_PA_IIC (0x54000000) |
74 | #define S3C24XX_SZ_IIC SZ_1M | ||
75 | 40 | ||
76 | /* IIS controller */ | 41 | /* IIS controller */ |
77 | #define S3C2410_PA_IIS (0x55000000) | 42 | #define S3C2410_PA_IIS (0x55000000) |
78 | #define S3C24XX_SZ_IIS SZ_1M | ||
79 | |||
80 | /* GPIO ports */ | ||
81 | |||
82 | /* the calculation for the VA of this must ensure that | ||
83 | * it is the same distance apart from the UART in the | ||
84 | * phsyical address space, as the initial mapping for the IO | ||
85 | * is done as a 1:1 maping. This puts it (currently) at | ||
86 | * 0xFA800000, which is not in the way of any current mapping | ||
87 | * by the base system. | ||
88 | */ | ||
89 | |||
90 | #define S3C2410_PA_GPIO (0x56000000) | ||
91 | #define S3C24XX_VA_GPIO ((S3C24XX_PA_GPIO - S3C24XX_PA_UART) + S3C24XX_VA_UART) | ||
92 | #define S3C24XX_SZ_GPIO SZ_1M | ||
93 | 43 | ||
94 | /* RTC */ | 44 | /* RTC */ |
95 | #define S3C2410_PA_RTC (0x57000000) | 45 | #define S3C2410_PA_RTC (0x57000000) |
@@ -97,15 +47,12 @@ | |||
97 | 47 | ||
98 | /* ADC */ | 48 | /* ADC */ |
99 | #define S3C2410_PA_ADC (0x58000000) | 49 | #define S3C2410_PA_ADC (0x58000000) |
100 | #define S3C24XX_SZ_ADC SZ_1M | ||
101 | 50 | ||
102 | /* SPI */ | 51 | /* SPI */ |
103 | #define S3C2410_PA_SPI (0x59000000) | 52 | #define S3C2410_PA_SPI (0x59000000) |
104 | #define S3C24XX_SZ_SPI SZ_1M | ||
105 | 53 | ||
106 | /* SDI */ | 54 | /* SDI */ |
107 | #define S3C2410_PA_SDI (0x5A000000) | 55 | #define S3C2410_PA_SDI (0x5A000000) |
108 | #define S3C24XX_SZ_SDI SZ_1M | ||
109 | 56 | ||
110 | /* CAMIF */ | 57 | /* CAMIF */ |
111 | #define S3C2440_PA_CAMIF (0x4F000000) | 58 | #define S3C2440_PA_CAMIF (0x4F000000) |
@@ -120,13 +67,6 @@ | |||
120 | #define S3C2443_PA_HSMMC (0x4A800000) | 67 | #define S3C2443_PA_HSMMC (0x4A800000) |
121 | #define S3C2443_SZ_HSMMC (256) | 68 | #define S3C2443_SZ_HSMMC (256) |
122 | 69 | ||
123 | /* ISA style IO, for each machine to sort out mappings for, if it | ||
124 | * implements it. We reserve two 16M regions for ISA. | ||
125 | */ | ||
126 | |||
127 | #define S3C24XX_VA_ISA_WORD S3C2410_ADDR(0x02000000) | ||
128 | #define S3C24XX_VA_ISA_BYTE S3C2410_ADDR(0x03000000) | ||
129 | |||
130 | /* physical addresses of all the chip-select areas */ | 70 | /* physical addresses of all the chip-select areas */ |
131 | 71 | ||
132 | #define S3C2410_CS0 (0x00000000) | 72 | #define S3C2410_CS0 (0x00000000) |
@@ -158,21 +98,7 @@ | |||
158 | #define S3C24XX_PA_RTC S3C2410_PA_RTC | 98 | #define S3C24XX_PA_RTC S3C2410_PA_RTC |
159 | #define S3C24XX_PA_ADC S3C2410_PA_ADC | 99 | #define S3C24XX_PA_ADC S3C2410_PA_ADC |
160 | #define S3C24XX_PA_SPI S3C2410_PA_SPI | 100 | #define S3C24XX_PA_SPI S3C2410_PA_SPI |
161 | 101 | #define S3C24XX_PA_SDI S3C2410_PA_SDI | |
162 | /* deal with the registers that move under the 2412/2413 */ | 102 | #define S3C24XX_PA_NAND S3C2410_PA_NAND |
163 | |||
164 | #if defined(CONFIG_CPU_S3C2412) || defined(CONFIG_CPU_S3C2413) | ||
165 | #ifndef __ASSEMBLY__ | ||
166 | extern void __iomem *s3c24xx_va_gpio2; | ||
167 | #endif | ||
168 | #ifdef CONFIG_CPU_S3C2412_ONLY | ||
169 | #define S3C24XX_VA_GPIO2 (S3C24XX_VA_GPIO + 0x10) | ||
170 | #else | ||
171 | #define S3C24XX_VA_GPIO2 s3c24xx_va_gpio2 | ||
172 | #endif | ||
173 | #else | ||
174 | #define s3c24xx_va_gpio2 S3C24XX_VA_GPIO | ||
175 | #define S3C24XX_VA_GPIO2 S3C24XX_VA_GPIO | ||
176 | #endif | ||
177 | 103 | ||
178 | #endif /* __ASM_ARCH_MAP_H */ | 104 | #endif /* __ASM_ARCH_MAP_H */ |
diff --git a/arch/arm/mach-s3c24a0/include/mach/map.h b/arch/arm/mach-s3c24a0/include/mach/map.h index 65a146fd78ec..2ce1839de4ee 100644 --- a/arch/arm/mach-s3c24a0/include/mach/map.h +++ b/arch/arm/mach-s3c24a0/include/mach/map.h | |||
@@ -14,6 +14,9 @@ | |||
14 | #ifndef __ASM_ARCH_24A0_MAP_H | 14 | #ifndef __ASM_ARCH_24A0_MAP_H |
15 | #define __ASM_ARCH_24A0_MAP_H __FILE__ | 15 | #define __ASM_ARCH_24A0_MAP_H __FILE__ |
16 | 16 | ||
17 | #include <plat/map-base.h> | ||
18 | #include <plat/map.h> | ||
19 | |||
17 | #define S3C24A0_PA_IO_BASE (0x40000000) | 20 | #define S3C24A0_PA_IO_BASE (0x40000000) |
18 | #define S3C24A0_PA_CLKPWR (0x40000000) | 21 | #define S3C24A0_PA_CLKPWR (0x40000000) |
19 | #define S3C24A0_PA_IRQ (0x40200000) | 22 | #define S3C24A0_PA_IRQ (0x40200000) |
@@ -74,5 +77,7 @@ | |||
74 | #define S3C24XX_PA_RTC S3C24A0_PA_RTC | 77 | #define S3C24XX_PA_RTC S3C24A0_PA_RTC |
75 | #define S3C24XX_PA_ADC S3C24A0_PA_ADC | 78 | #define S3C24XX_PA_ADC S3C24A0_PA_ADC |
76 | #define S3C24XX_PA_SPI S3C24A0_PA_SPI | 79 | #define S3C24XX_PA_SPI S3C24A0_PA_SPI |
80 | #define S3C24XX_PA_SDI S3C24A0_PA_SDI | ||
81 | #define S3C24XX_PA_NAND S3C24A0_PA_NAND | ||
77 | 82 | ||
78 | #endif /* __ASM_ARCH_24A0_MAP_H */ | 83 | #endif /* __ASM_ARCH_24A0_MAP_H */ |
diff --git a/arch/arm/plat-s3c/include/plat/map.h b/arch/arm/plat-s3c/include/plat/map-base.h index b84289d32a54..b84289d32a54 100644 --- a/arch/arm/plat-s3c/include/plat/map.h +++ b/arch/arm/plat-s3c/include/plat/map-base.h | |||
diff --git a/arch/arm/plat-s3c24xx/devs.c b/arch/arm/plat-s3c24xx/devs.c index adf535aaf43a..ea445850ff47 100644 --- a/arch/arm/plat-s3c24xx/devs.c +++ b/arch/arm/plat-s3c24xx/devs.c | |||
@@ -192,8 +192,8 @@ void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *pd) | |||
192 | 192 | ||
193 | static struct resource s3c_nand_resource[] = { | 193 | static struct resource s3c_nand_resource[] = { |
194 | [0] = { | 194 | [0] = { |
195 | .start = S3C2410_PA_NAND, | 195 | .start = S3C24XX_PA_NAND, |
196 | .end = S3C2410_PA_NAND + S3C24XX_SZ_NAND - 1, | 196 | .end = S3C24XX_PA_NAND + S3C24XX_SZ_NAND - 1, |
197 | .flags = IORESOURCE_MEM, | 197 | .flags = IORESOURCE_MEM, |
198 | } | 198 | } |
199 | }; | 199 | }; |
@@ -382,8 +382,8 @@ struct platform_device s3c_device_adc = { | |||
382 | 382 | ||
383 | static struct resource s3c_sdi_resource[] = { | 383 | static struct resource s3c_sdi_resource[] = { |
384 | [0] = { | 384 | [0] = { |
385 | .start = S3C2410_PA_SDI, | 385 | .start = S3C24XX_PA_SDI, |
386 | .end = S3C2410_PA_SDI + S3C24XX_SZ_SDI - 1, | 386 | .end = S3C24XX_PA_SDI + S3C24XX_SZ_SDI - 1, |
387 | .flags = IORESOURCE_MEM, | 387 | .flags = IORESOURCE_MEM, |
388 | }, | 388 | }, |
389 | [1] = { | 389 | [1] = { |
diff --git a/arch/arm/plat-s3c24xx/include/plat/map.h b/arch/arm/plat-s3c24xx/include/plat/map.h new file mode 100644 index 000000000000..6222ba8341d4 --- /dev/null +++ b/arch/arm/plat-s3c24xx/include/plat/map.h | |||
@@ -0,0 +1,99 @@ | |||
1 | /* linux/include/asm-arm/plat-s3c24xx/map.h | ||
2 | * | ||
3 | * Copyright (c) 2008 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * S3C24XX - Memory map definitions | ||
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_PLAT_S3C24XX_MAP_H | ||
14 | #define __ASM_PLAT_S3C24XX_MAP_H | ||
15 | |||
16 | /* interrupt controller is the first thing we put in, to make | ||
17 | * the assembly code for the irq detection easier | ||
18 | */ | ||
19 | #define S3C24XX_VA_IRQ S3C_VA_IRQ | ||
20 | #define S3C2410_PA_IRQ (0x4A000000) | ||
21 | #define S3C24XX_SZ_IRQ SZ_1M | ||
22 | |||
23 | /* memory controller registers */ | ||
24 | #define S3C24XX_VA_MEMCTRL S3C_VA_MEM | ||
25 | #define S3C2410_PA_MEMCTRL (0x48000000) | ||
26 | #define S3C24XX_SZ_MEMCTRL SZ_1M | ||
27 | |||
28 | /* UARTs */ | ||
29 | #define S3C24XX_VA_UART S3C_VA_UART | ||
30 | #define S3C2410_PA_UART (0x50000000) | ||
31 | #define S3C24XX_SZ_UART SZ_1M | ||
32 | |||
33 | /* Timers */ | ||
34 | #define S3C24XX_VA_TIMER S3C_VA_TIMER | ||
35 | #define S3C2410_PA_TIMER (0x51000000) | ||
36 | #define S3C24XX_SZ_TIMER SZ_1M | ||
37 | |||
38 | /* Clock and Power management */ | ||
39 | #define S3C24XX_VA_CLKPWR S3C_VA_SYS | ||
40 | #define S3C24XX_SZ_CLKPWR SZ_1M | ||
41 | |||
42 | /* USB Device port */ | ||
43 | #define S3C2410_PA_USBDEV (0x52000000) | ||
44 | #define S3C24XX_SZ_USBDEV SZ_1M | ||
45 | |||
46 | /* Watchdog */ | ||
47 | #define S3C24XX_VA_WATCHDOG S3C_VA_WATCHDOG | ||
48 | #define S3C2410_PA_WATCHDOG (0x53000000) | ||
49 | #define S3C24XX_SZ_WATCHDOG SZ_1M | ||
50 | |||
51 | /* Standard size definitions for peripheral blocks. */ | ||
52 | |||
53 | #define S3C24XX_SZ_IIC SZ_1M | ||
54 | #define S3C24XX_SZ_IIS SZ_1M | ||
55 | #define S3C24XX_SZ_ADC SZ_1M | ||
56 | #define S3C24XX_SZ_SPI SZ_1M | ||
57 | #define S3C24XX_SZ_SDI SZ_1M | ||
58 | #define S3C24XX_SZ_NAND SZ_1M | ||
59 | #define S3C24XX_SZ_USBHOST SZ_1M | ||
60 | |||
61 | /* GPIO ports */ | ||
62 | |||
63 | /* the calculation for the VA of this must ensure that | ||
64 | * it is the same distance apart from the UART in the | ||
65 | * phsyical address space, as the initial mapping for the IO | ||
66 | * is done as a 1:1 maping. This puts it (currently) at | ||
67 | * 0xFA800000, which is not in the way of any current mapping | ||
68 | * by the base system. | ||
69 | */ | ||
70 | |||
71 | #define S3C2410_PA_GPIO (0x56000000) | ||
72 | #define S3C24XX_VA_GPIO ((S3C24XX_PA_GPIO - S3C24XX_PA_UART) + S3C24XX_VA_UART) | ||
73 | #define S3C24XX_SZ_GPIO SZ_1M | ||
74 | |||
75 | |||
76 | /* ISA style IO, for each machine to sort out mappings for, if it | ||
77 | * implements it. We reserve two 16M regions for ISA. | ||
78 | */ | ||
79 | |||
80 | #define S3C24XX_VA_ISA_WORD S3C2410_ADDR(0x02000000) | ||
81 | #define S3C24XX_VA_ISA_BYTE S3C2410_ADDR(0x03000000) | ||
82 | |||
83 | /* deal with the registers that move under the 2412/2413 */ | ||
84 | |||
85 | #if defined(CONFIG_CPU_S3C2412) || defined(CONFIG_CPU_S3C2413) | ||
86 | #ifndef __ASSEMBLY__ | ||
87 | extern void __iomem *s3c24xx_va_gpio2; | ||
88 | #endif | ||
89 | #ifdef CONFIG_CPU_S3C2412_ONLY | ||
90 | #define S3C24XX_VA_GPIO2 (S3C24XX_VA_GPIO + 0x10) | ||
91 | #else | ||
92 | #define S3C24XX_VA_GPIO2 s3c24xx_va_gpio2 | ||
93 | #endif | ||
94 | #else | ||
95 | #define s3c24xx_va_gpio2 S3C24XX_VA_GPIO | ||
96 | #define S3C24XX_VA_GPIO2 S3C24XX_VA_GPIO | ||
97 | #endif | ||
98 | |||
99 | #endif /* __ASM_PLAT_S3C24XX_MAP_H */ | ||