GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / linux / linux-2.6.36 / arch / arm / mach-pxa / colibri-pxa270.c
blob3f4cf60bc80e26071dae8d4aa8eef4128e8a73f2
1 /*
2 * linux/arch/arm/mach-pxa/colibri-pxa270.c
4 * Support for Toradex PXA270 based Colibri module
5 * Daniel Mack <daniel@caiaq.de>
6 * Marek Vasut <marek.vasut@gmail.com>
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.
13 #include <linux/init.h>
14 #include <linux/interrupt.h>
15 #include <linux/kernel.h>
16 #include <linux/mtd/mtd.h>
17 #include <linux/mtd/partitions.h>
18 #include <linux/mtd/physmap.h>
19 #include <linux/platform_device.h>
20 #include <linux/sysdev.h>
21 #include <linux/ucb1400.h>
23 #include <asm/mach/arch.h>
24 #include <asm/mach/flash.h>
25 #include <asm/mach-types.h>
26 #include <asm/sizes.h>
28 #include <mach/audio.h>
29 #include <mach/colibri.h>
30 #include <mach/pxa27x.h>
32 #include "devices.h"
33 #include "generic.h"
35 /******************************************************************************
36 * Pin configuration
37 ******************************************************************************/
38 static mfp_cfg_t colibri_pxa270_pin_config[] __initdata = {
39 /* Ethernet */
40 GPIO78_nCS_2, /* Ethernet CS */
41 GPIO114_GPIO, /* Ethernet IRQ */
43 /* AC97 */
44 GPIO28_AC97_BITCLK,
45 GPIO29_AC97_SDATA_IN_0,
46 GPIO30_AC97_SDATA_OUT,
47 GPIO31_AC97_SYNC,
48 GPIO95_AC97_nRESET,
49 GPIO98_AC97_SYSCLK,
50 GPIO113_GPIO, /* Touchscreen IRQ */
53 /******************************************************************************
54 * NOR Flash
55 ******************************************************************************/
56 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
57 static struct mtd_partition colibri_partitions[] = {
59 .name = "Bootloader",
60 .offset = 0x00000000,
61 .size = 0x00040000,
62 .mask_flags = MTD_WRITEABLE /* force read-only */
63 }, {
64 .name = "Kernel",
65 .offset = 0x00040000,
66 .size = 0x00400000,
67 .mask_flags = 0
68 }, {
69 .name = "Rootfs",
70 .offset = 0x00440000,
71 .size = MTDPART_SIZ_FULL,
72 .mask_flags = 0
76 static struct physmap_flash_data colibri_flash_data[] = {
78 .width = 4, /* bankwidth in bytes */
79 .parts = colibri_partitions,
80 .nr_parts = ARRAY_SIZE(colibri_partitions)
84 static struct resource colibri_pxa270_flash_resource = {
85 .start = PXA_CS0_PHYS,
86 .end = PXA_CS0_PHYS + SZ_32M - 1,
87 .flags = IORESOURCE_MEM,
90 static struct platform_device colibri_pxa270_flash_device = {
91 .name = "physmap-flash",
92 .id = 0,
93 .dev = {
94 .platform_data = colibri_flash_data,
96 .resource = &colibri_pxa270_flash_resource,
97 .num_resources = 1,
100 static void __init colibri_pxa270_nor_init(void)
102 platform_device_register(&colibri_pxa270_flash_device);
104 #else
105 static inline void colibri_pxa270_nor_init(void) {}
106 #endif
108 /******************************************************************************
109 * Ethernet
110 ******************************************************************************/
111 #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
112 static struct resource colibri_pxa270_dm9000_resources[] = {
114 .start = PXA_CS2_PHYS,
115 .end = PXA_CS2_PHYS + 3,
116 .flags = IORESOURCE_MEM,
119 .start = PXA_CS2_PHYS + 4,
120 .end = PXA_CS2_PHYS + 4 + 500,
121 .flags = IORESOURCE_MEM,
124 .start = gpio_to_irq(GPIO114_COLIBRI_PXA270_ETH_IRQ),
125 .end = gpio_to_irq(GPIO114_COLIBRI_PXA270_ETH_IRQ),
126 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING,
130 static struct platform_device colibri_pxa270_dm9000_device = {
131 .name = "dm9000",
132 .id = -1,
133 .num_resources = ARRAY_SIZE(colibri_pxa270_dm9000_resources),
134 .resource = colibri_pxa270_dm9000_resources,
137 static void __init colibri_pxa270_eth_init(void)
139 platform_device_register(&colibri_pxa270_dm9000_device);
141 #else
142 static inline void colibri_pxa270_eth_init(void) {}
143 #endif
145 /******************************************************************************
146 * Audio and Touchscreen
147 ******************************************************************************/
148 #if defined(CONFIG_TOUCHSCREEN_UCB1400) || defined(CONFIG_TOUCHSCREEN_UCB1400_MODULE)
149 static pxa2xx_audio_ops_t colibri_pxa270_ac97_pdata = {
150 .reset_gpio = 95,
153 static struct ucb1400_pdata colibri_pxa270_ucb1400_pdata = {
154 .irq = gpio_to_irq(GPIO113_COLIBRI_PXA270_TS_IRQ),
157 static struct platform_device colibri_pxa270_ucb1400_device = {
158 .name = "ucb1400_core",
159 .id = -1,
160 .dev = {
161 .platform_data = &colibri_pxa270_ucb1400_pdata,
165 static void __init colibri_pxa270_tsc_init(void)
167 pxa_set_ac97_info(&colibri_pxa270_ac97_pdata);
168 platform_device_register(&colibri_pxa270_ucb1400_device);
170 #else
171 static inline void colibri_pxa270_tsc_init(void) {}
172 #endif
174 static int colibri_pxa270_baseboard;
175 core_param(colibri_pxa270_baseboard, colibri_pxa270_baseboard, int, 0444);
177 static void __init colibri_pxa270_init(void)
179 pxa2xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa270_pin_config));
181 colibri_pxa270_nor_init();
182 colibri_pxa270_eth_init();
183 colibri_pxa270_tsc_init();
185 switch (colibri_pxa270_baseboard) {
186 case COLIBRI_PXA270_EVALBOARD:
187 colibri_pxa270_evalboard_init();
188 break;
189 case COLIBRI_PXA270_INCOME:
190 colibri_pxa270_income_boardinit();
191 break;
192 default:
193 printk(KERN_ERR "Illegal colibri_pxa270_baseboard type %d\n",
194 colibri_pxa270_baseboard);
198 /* The "Income s.r.o. SH-Dmaster PXA270 SBC" board can be booted either
199 * with the INCOME mach type or with COLIBRI and the kernel parameter
200 * "colibri_pxa270_baseboard=1"
202 static void __init colibri_pxa270_income_init(void)
204 colibri_pxa270_baseboard = COLIBRI_PXA270_INCOME;
205 colibri_pxa270_init();
208 MACHINE_START(COLIBRI, "Toradex Colibri PXA270")
209 .phys_io = 0x40000000,
210 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
211 .boot_params = COLIBRI_SDRAM_BASE + 0x100,
212 .init_machine = colibri_pxa270_init,
213 .map_io = pxa_map_io,
214 .init_irq = pxa27x_init_irq,
215 .timer = &pxa_timer,
216 MACHINE_END
218 MACHINE_START(INCOME, "Income s.r.o. SH-Dmaster PXA270 SBC")
219 .phys_io = 0x40000000,
220 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
221 .boot_params = 0xa0000100,
222 .init_machine = colibri_pxa270_income_init,
223 .map_io = pxa_map_io,
224 .init_irq = pxa27x_init_irq,
225 .timer = &pxa_timer,
226 MACHINE_END