diff options
author | Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 2009-02-16 12:40:55 -0500 |
---|---|---|
committer | Eric Miao <eric.miao@marvell.com> | 2009-03-13 05:10:44 -0400 |
commit | aac429707df233e9dc7ed70ea04cd29d832dfe61 (patch) | |
tree | 5a7df3142af59013716cb5db9df0e57d25167a9f | |
parent | 53f5649b21a7c7b894d68ac4848eb01136fa64aa (diff) |
[ARM] pxa: add initial support for Cogent CSB726 board
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Eric Miao <eric.miao@marvell.com>
-rw-r--r-- | arch/arm/mach-pxa/Kconfig | 8 | ||||
-rw-r--r-- | arch/arm/mach-pxa/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-pxa/csb726.c | 318 | ||||
-rw-r--r-- | arch/arm/mach-pxa/include/mach/csb726.h | 26 | ||||
-rw-r--r-- | arch/arm/mach-pxa/include/mach/uncompress.h | 3 |
5 files changed, 355 insertions, 1 deletions
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig index 33214c1e0607..ff1872db5b3d 100644 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig | |||
@@ -393,6 +393,14 @@ config PCM990_DISPLAY_NONE | |||
393 | 393 | ||
394 | endchoice | 394 | endchoice |
395 | 395 | ||
396 | config MACH_CSB726 | ||
397 | bool "Enable Cogent CSB726 System On a Module" | ||
398 | select PXA27x | ||
399 | select IWMMXT | ||
400 | help | ||
401 | Say Y here if you intend to run this kernel on a Cogent | ||
402 | CSB726 System On Module. | ||
403 | |||
396 | config PXA_EZX | 404 | config PXA_EZX |
397 | bool "Motorola EZX Platform" | 405 | bool "Motorola EZX Platform" |
398 | select PXA27x | 406 | select PXA27x |
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile index 361fcfa7531a..96a72f02c136 100644 --- a/arch/arm/mach-pxa/Makefile +++ b/arch/arm/mach-pxa/Makefile | |||
@@ -75,6 +75,7 @@ obj-$(CONFIG_MACH_CM_X300) += cm-x300.o | |||
75 | obj-$(CONFIG_PXA_EZX) += ezx.o | 75 | obj-$(CONFIG_PXA_EZX) += ezx.o |
76 | 76 | ||
77 | obj-$(CONFIG_MACH_INTELMOTE2) += imote2.o | 77 | obj-$(CONFIG_MACH_INTELMOTE2) += imote2.o |
78 | obj-$(CONFIG_MACH_CSB726) += csb726.o | ||
78 | 79 | ||
79 | # Support for blinky lights | 80 | # Support for blinky lights |
80 | led-y := leds.o | 81 | led-y := leds.o |
diff --git a/arch/arm/mach-pxa/csb726.c b/arch/arm/mach-pxa/csb726.c new file mode 100644 index 000000000000..2b289f83a61a --- /dev/null +++ b/arch/arm/mach-pxa/csb726.c | |||
@@ -0,0 +1,318 @@ | |||
1 | /* | ||
2 | * Support for Cogent CSB726 | ||
3 | * | ||
4 | * Copyright (c) 2008 Dmitry Eremin-Solenikov | ||
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 | #include <linux/kernel.h> | ||
12 | #include <linux/init.h> | ||
13 | #include <linux/io.h> | ||
14 | #include <linux/gpio.h> | ||
15 | #include <linux/platform_device.h> | ||
16 | #include <linux/mtd/physmap.h> | ||
17 | #include <linux/mtd/partitions.h> | ||
18 | #include <linux/sm501.h> | ||
19 | |||
20 | #include <asm/mach-types.h> | ||
21 | #include <asm/mach/arch.h> | ||
22 | #include <mach/csb726.h> | ||
23 | #include <mach/mfp-pxa27x.h> | ||
24 | #include <mach/i2c.h> | ||
25 | #include <mach/mmc.h> | ||
26 | #include <mach/ohci.h> | ||
27 | #include <mach/pxa2xx-regs.h> | ||
28 | |||
29 | #include "generic.h" | ||
30 | #include "devices.h" | ||
31 | |||
32 | /* | ||
33 | * n/a: 2, 5, 6, 7, 8, 23, 24, 25, 26, 27, 87, 88, 89, | ||
34 | * nu: 58 -- 77, 90, 91, 93, 102, 105-108, 114-116, | ||
35 | * XXX: 21, | ||
36 | * XXX: 79 CS_3 for LAN9215 or PSKTSEL on R2, R3 | ||
37 | * XXX: 33 CS_5 for LAN9215 on R1 | ||
38 | */ | ||
39 | |||
40 | static unsigned long csb726_pin_config[] = { | ||
41 | GPIO78_nCS_2, /* EXP_CS */ | ||
42 | GPIO79_nCS_3, /* SMSC9215 */ | ||
43 | GPIO80_nCS_4, /* SM501 */ | ||
44 | |||
45 | GPIO52_GPIO, /* #SMSC9251 int */ | ||
46 | GPIO53_GPIO, /* SM501 int */ | ||
47 | |||
48 | GPIO1_GPIO, /* GPIO0 */ | ||
49 | GPIO11_GPIO, /* GPIO1 */ | ||
50 | GPIO9_GPIO, /* GPIO2 */ | ||
51 | GPIO10_GPIO, /* GPIO3 */ | ||
52 | GPIO16_PWM0_OUT, /* or GPIO4 */ | ||
53 | GPIO17_PWM1_OUT, /* or GPIO5 */ | ||
54 | GPIO94_GPIO, /* GPIO6 */ | ||
55 | GPIO95_GPIO, /* GPIO7 */ | ||
56 | GPIO96_GPIO, /* GPIO8 */ | ||
57 | GPIO97_GPIO, /* GPIO9 */ | ||
58 | GPIO15_GPIO, /* EXP_IRQ */ | ||
59 | GPIO18_RDY, /* EXP_WAIT */ | ||
60 | |||
61 | GPIO0_GPIO, /* PWR_INT */ | ||
62 | GPIO104_GPIO, /* PWR_OFF */ | ||
63 | |||
64 | GPIO12_GPIO, /* touch irq */ | ||
65 | |||
66 | GPIO13_SSP2_TXD, | ||
67 | GPIO14_SSP2_SFRM, | ||
68 | MFP_CFG_OUT(GPIO19, AF1, DRIVE_LOW),/* SSP2_SYSCLK */ | ||
69 | GPIO22_SSP2_SCLK, | ||
70 | |||
71 | GPIO81_SSP3_TXD, | ||
72 | GPIO82_SSP3_RXD, | ||
73 | GPIO83_SSP3_SFRM, | ||
74 | GPIO84_SSP3_SCLK, | ||
75 | |||
76 | GPIO20_GPIO, /* SDIO int */ | ||
77 | GPIO32_MMC_CLK, | ||
78 | GPIO92_MMC_DAT_0, | ||
79 | GPIO109_MMC_DAT_1, | ||
80 | GPIO110_MMC_DAT_2, | ||
81 | GPIO111_MMC_DAT_3, | ||
82 | GPIO112_MMC_CMD, | ||
83 | GPIO100_GPIO, /* SD CD */ | ||
84 | GPIO101_GPIO, /* SD WP */ | ||
85 | |||
86 | GPIO28_AC97_BITCLK, | ||
87 | GPIO29_AC97_SDATA_IN_0, | ||
88 | GPIO30_AC97_SDATA_OUT, | ||
89 | GPIO31_AC97_SYNC, | ||
90 | GPIO113_AC97_nRESET, | ||
91 | |||
92 | GPIO34_FFUART_RXD, | ||
93 | GPIO35_FFUART_CTS, | ||
94 | GPIO36_FFUART_DCD, | ||
95 | GPIO37_FFUART_DSR, | ||
96 | GPIO38_FFUART_RI, | ||
97 | GPIO39_FFUART_TXD, | ||
98 | GPIO40_FFUART_DTR, | ||
99 | GPIO41_FFUART_RTS, | ||
100 | |||
101 | GPIO42_BTUART_RXD, | ||
102 | GPIO43_BTUART_TXD, | ||
103 | GPIO44_BTUART_CTS, | ||
104 | GPIO45_BTUART_RTS, | ||
105 | |||
106 | GPIO46_STUART_RXD, | ||
107 | GPIO47_STUART_TXD, | ||
108 | |||
109 | GPIO48_nPOE, | ||
110 | GPIO49_nPWE, | ||
111 | GPIO50_nPIOR, | ||
112 | GPIO51_nPIOW, | ||
113 | GPIO54_nPCE_2, | ||
114 | GPIO55_nPREG, | ||
115 | GPIO56_nPWAIT, | ||
116 | GPIO57_nIOIS16, /* maybe unused */ | ||
117 | GPIO85_nPCE_1, | ||
118 | GPIO98_GPIO, /* CF IRQ */ | ||
119 | GPIO99_GPIO, /* CF CD */ | ||
120 | GPIO103_GPIO, /* Reset */ | ||
121 | |||
122 | GPIO117_I2C_SCL, | ||
123 | GPIO118_I2C_SDA, | ||
124 | }; | ||
125 | |||
126 | static struct pxamci_platform_data csb726_mci_data; | ||
127 | |||
128 | static int csb726_mci_init(struct device *dev, | ||
129 | irq_handler_t detect, void *data) | ||
130 | { | ||
131 | int err; | ||
132 | |||
133 | csb726_mci_data.detect_delay = msecs_to_jiffies(500); | ||
134 | |||
135 | err = gpio_request(CSB726_GPIO_MMC_DETECT, "MMC detect"); | ||
136 | if (err) | ||
137 | goto err_det_req; | ||
138 | |||
139 | err = gpio_direction_input(CSB726_GPIO_MMC_DETECT); | ||
140 | if (err) | ||
141 | goto err_det_dir; | ||
142 | |||
143 | err = gpio_request(CSB726_GPIO_MMC_RO, "MMC ro"); | ||
144 | if (err) | ||
145 | goto err_ro_req; | ||
146 | |||
147 | err = gpio_direction_input(CSB726_GPIO_MMC_RO); | ||
148 | if (err) | ||
149 | goto err_ro_dir; | ||
150 | |||
151 | err = request_irq(gpio_to_irq(CSB726_GPIO_MMC_DETECT), detect, | ||
152 | IRQF_DISABLED, "MMC card detect", data); | ||
153 | if (err) | ||
154 | goto err_irq; | ||
155 | |||
156 | return 0; | ||
157 | |||
158 | err_irq: | ||
159 | err_ro_dir: | ||
160 | gpio_free(CSB726_GPIO_MMC_RO); | ||
161 | err_ro_req: | ||
162 | err_det_dir: | ||
163 | gpio_free(CSB726_GPIO_MMC_DETECT); | ||
164 | err_det_req: | ||
165 | return err; | ||
166 | } | ||
167 | |||
168 | static int csb726_mci_get_ro(struct device *dev) | ||
169 | { | ||
170 | return gpio_get_value(CSB726_GPIO_MMC_RO); | ||
171 | } | ||
172 | |||
173 | static void csb726_mci_exit(struct device *dev, void *data) | ||
174 | { | ||
175 | free_irq(gpio_to_irq(CSB726_GPIO_MMC_DETECT), data); | ||
176 | gpio_free(CSB726_GPIO_MMC_RO); | ||
177 | gpio_free(CSB726_GPIO_MMC_DETECT); | ||
178 | } | ||
179 | |||
180 | static struct pxamci_platform_data csb726_mci = { | ||
181 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, | ||
182 | .init = csb726_mci_init, | ||
183 | .get_ro = csb726_mci_get_ro, | ||
184 | /* FIXME setpower */ | ||
185 | .exit = csb726_mci_exit, | ||
186 | }; | ||
187 | |||
188 | static struct pxaohci_platform_data csb726_ohci_platform_data = { | ||
189 | .port_mode = PMM_NPS_MODE, | ||
190 | .flags = ENABLE_PORT1 | NO_OC_PROTECTION, | ||
191 | }; | ||
192 | |||
193 | static struct mtd_partition csb726_flash_partitions[] = { | ||
194 | { | ||
195 | .name = "Bootloader", | ||
196 | .offset = 0, | ||
197 | .size = CSB726_FLASH_uMON, | ||
198 | .mask_flags = MTD_WRITEABLE /* force read-only */ | ||
199 | }, | ||
200 | { | ||
201 | .name = "root", | ||
202 | .offset = MTDPART_OFS_APPEND, | ||
203 | .size = MTDPART_SIZ_FULL, | ||
204 | } | ||
205 | }; | ||
206 | |||
207 | static struct physmap_flash_data csb726_flash_data = { | ||
208 | .width = 2, | ||
209 | .parts = csb726_flash_partitions, | ||
210 | .nr_parts = ARRAY_SIZE(csb726_flash_partitions), | ||
211 | }; | ||
212 | |||
213 | static struct resource csb726_flash_resources[] = { | ||
214 | { | ||
215 | .start = PXA_CS0_PHYS, | ||
216 | .end = PXA_CS0_PHYS + CSB726_FLASH_SIZE - 1 , | ||
217 | .flags = IORESOURCE_MEM, | ||
218 | } | ||
219 | }; | ||
220 | |||
221 | static struct platform_device csb726_flash = { | ||
222 | .name = "physmap-flash", | ||
223 | .dev = { | ||
224 | .platform_data = &csb726_flash_data, | ||
225 | }, | ||
226 | .resource = csb726_flash_resources, | ||
227 | .num_resources = ARRAY_SIZE(csb726_flash_resources), | ||
228 | }; | ||
229 | |||
230 | static struct resource csb726_sm501_resources[] = { | ||
231 | { | ||
232 | .start = PXA_CS4_PHYS, | ||
233 | .end = PXA_CS4_PHYS + SZ_8M - 1, | ||
234 | .flags = IORESOURCE_MEM, | ||
235 | .name = "sm501-localmem", | ||
236 | }, | ||
237 | { | ||
238 | .start = PXA_CS4_PHYS + SZ_64M - SZ_2M, | ||
239 | .end = PXA_CS4_PHYS + SZ_64M - 1, | ||
240 | .flags = IORESOURCE_MEM, | ||
241 | .name = "sm501-regs", | ||
242 | }, | ||
243 | { | ||
244 | .start = CSB726_IRQ_SM501, | ||
245 | .end = CSB726_IRQ_SM501, | ||
246 | .flags = IORESOURCE_IRQ, | ||
247 | }, | ||
248 | }; | ||
249 | |||
250 | static struct sm501_initdata csb726_sm501_initdata = { | ||
251 | /* .devices = SM501_USE_USB_HOST, */ | ||
252 | .devices = SM501_USE_USB_HOST | SM501_USE_UART0 | SM501_USE_UART1, | ||
253 | }; | ||
254 | |||
255 | static struct sm501_platdata csb726_sm501_platdata = { | ||
256 | .init = &csb726_sm501_initdata, | ||
257 | }; | ||
258 | |||
259 | static struct platform_device csb726_sm501 = { | ||
260 | .name = "sm501", | ||
261 | .id = 0, | ||
262 | .num_resources = ARRAY_SIZE(csb726_sm501_resources), | ||
263 | .resource = csb726_sm501_resources, | ||
264 | .dev = { | ||
265 | .platform_data = &csb726_sm501_platdata, | ||
266 | }, | ||
267 | }; | ||
268 | |||
269 | static struct resource csb726_lan_resources[] = { | ||
270 | { | ||
271 | .start = PXA_CS3_PHYS, | ||
272 | .end = PXA_CS3_PHYS + SZ_64K - 1, | ||
273 | .flags = IORESOURCE_MEM, | ||
274 | }, | ||
275 | { | ||
276 | .start = CSB726_IRQ_LAN, | ||
277 | .end = CSB726_IRQ_LAN, | ||
278 | .flags = IORESOURCE_IRQ, | ||
279 | }, | ||
280 | }; | ||
281 | |||
282 | static struct platform_device csb726_lan = { | ||
283 | .name = "smc911x", | ||
284 | .id = -1, | ||
285 | .num_resources = ARRAY_SIZE(csb726_lan_resources), | ||
286 | .resource = csb726_lan_resources, | ||
287 | }; | ||
288 | |||
289 | static struct platform_device *devices[] __initdata = { | ||
290 | &csb726_flash, | ||
291 | &csb726_sm501, | ||
292 | &csb726_lan, | ||
293 | }; | ||
294 | |||
295 | static void __init csb726_init(void) | ||
296 | { | ||
297 | pxa2xx_mfp_config(ARRAY_AND_SIZE(csb726_pin_config)); | ||
298 | /* MSC1 = 0x7ffc3ffc; *//* LAN9215/EXP_CS */ | ||
299 | /* MSC2 = 0x06697ff4; *//* none/SM501 */ | ||
300 | MSC2 = (MSC2 & ~0xffff) | 0x7ff4; /* SM501 */ | ||
301 | |||
302 | pxa_set_i2c_info(NULL); | ||
303 | pxa27x_set_i2c_power_info(NULL); | ||
304 | pxa_set_mci_info(&csb726_mci); | ||
305 | pxa_set_ohci_info(&csb726_ohci_platform_data); | ||
306 | |||
307 | platform_add_devices(devices, ARRAY_SIZE(devices)); | ||
308 | } | ||
309 | |||
310 | MACHINE_START(CSB726, "Cogent CSB726") | ||
311 | .phys_io = 0x40000000, | ||
312 | .boot_params = 0xa0000100, | ||
313 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | ||
314 | .map_io = pxa_map_io, | ||
315 | .init_irq = pxa27x_init_irq, | ||
316 | .init_machine = csb726_init, | ||
317 | .timer = &pxa_timer, | ||
318 | MACHINE_END | ||
diff --git a/arch/arm/mach-pxa/include/mach/csb726.h b/arch/arm/mach-pxa/include/mach/csb726.h new file mode 100644 index 000000000000..747ab1a71f2f --- /dev/null +++ b/arch/arm/mach-pxa/include/mach/csb726.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /* | ||
2 | * Support for Cogent CSB726 | ||
3 | * | ||
4 | * Copyright (c) 2008 Dmitry Baryshkov | ||
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 CSB726_H | ||
12 | #define CSB726_H | ||
13 | |||
14 | #define CSB726_GPIO_IRQ_LAN 52 | ||
15 | #define CSB726_GPIO_IRQ_SM501 53 | ||
16 | #define CSB726_GPIO_MMC_DETECT 100 | ||
17 | #define CSB726_GPIO_MMC_RO 101 | ||
18 | |||
19 | #define CSB726_FLASH_SIZE (64 * 1024 * 1024) | ||
20 | #define CSB726_FLASH_uMON (8 * 1024 * 1024) | ||
21 | |||
22 | #define CSB726_IRQ_LAN gpio_to_irq(CSB726_GPIO_IRQ_LAN) | ||
23 | #define CSB726_IRQ_SM501 gpio_to_irq(CSB726_GPIO_IRQ_SM501) | ||
24 | |||
25 | #endif | ||
26 | |||
diff --git a/arch/arm/mach-pxa/include/mach/uncompress.h b/arch/arm/mach-pxa/include/mach/uncompress.h index f4b029c03957..5706cea95d11 100644 --- a/arch/arm/mach-pxa/include/mach/uncompress.h +++ b/arch/arm/mach-pxa/include/mach/uncompress.h | |||
@@ -35,7 +35,8 @@ static inline void flush(void) | |||
35 | 35 | ||
36 | static inline void arch_decomp_setup(void) | 36 | static inline void arch_decomp_setup(void) |
37 | { | 37 | { |
38 | if (machine_is_littleton() || machine_is_intelmote2()) | 38 | if (machine_is_littleton() || machine_is_intelmote2() |
39 | || machine_is_csb726()) | ||
39 | UART = STUART; | 40 | UART = STUART; |
40 | } | 41 | } |
41 | 42 | ||