aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/colibri-pxa270.c
diff options
context:
space:
mode:
authorDaniel Mack <daniel@caiaq.de>2010-05-21 18:29:38 -0400
committerEric Miao <eric.y.miao@gmail.com>2010-06-18 03:07:34 -0400
commit4c243c8584be9fbff9e11fc37fa2449448c5d442 (patch)
tree6ec6745dd0fad18ecd9ab2859e4d7b20b59ee030 /arch/arm/mach-pxa/colibri-pxa270.c
parent7cca84abf49afe28f3e81531f79b2cb4dd6cba1b (diff)
[ARM] pxa/colibri270: Split module and base board code
Follow the idea of several MX31 based boards and split code that is related to the module from code that is baseboard specific. This makes adding new base board support easier, while avoiding code duplication. Signed-off-by: Daniel Mack <daniel@caiaq.de> Acked-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'arch/arm/mach-pxa/colibri-pxa270.c')
-rw-r--r--arch/arm/mach-pxa/colibri-pxa270.c107
1 files changed, 20 insertions, 87 deletions
diff --git a/arch/arm/mach-pxa/colibri-pxa270.c b/arch/arm/mach-pxa/colibri-pxa270.c
index 99d511cf0a82..b4f53ccf3e80 100644
--- a/arch/arm/mach-pxa/colibri-pxa270.c
+++ b/arch/arm/mach-pxa/colibri-pxa270.c
@@ -11,36 +11,26 @@
11 */ 11 */
12 12
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/kernel.h>
15#include <linux/platform_device.h>
16#include <linux/sysdev.h>
17#include <linux/interrupt.h> 14#include <linux/interrupt.h>
18#include <linux/bitops.h> 15#include <linux/kernel.h>
19#include <linux/ioport.h>
20#include <linux/delay.h>
21#include <linux/mtd/mtd.h> 16#include <linux/mtd/mtd.h>
22#include <linux/mtd/partitions.h> 17#include <linux/mtd/partitions.h>
23#include <linux/mtd/physmap.h> 18#include <linux/mtd/physmap.h>
24#include <linux/gpio.h> 19#include <linux/platform_device.h>
20#include <linux/sysdev.h>
25#include <linux/ucb1400.h> 21#include <linux/ucb1400.h>
26#include <asm/mach-types.h> 22
27#include <mach/hardware.h>
28#include <asm/irq.h>
29#include <asm/sizes.h>
30#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
31#include <asm/mach/map.h>
32#include <asm/mach/irq.h>
33#include <asm/mach/flash.h> 24#include <asm/mach/flash.h>
25#include <asm/mach-types.h>
26#include <asm/sizes.h>
34 27
35#include <mach/audio.h> 28#include <mach/audio.h>
36#include <mach/pxa27x.h>
37#include <mach/colibri.h> 29#include <mach/colibri.h>
38#include <mach/mmc.h> 30#include <mach/pxa27x.h>
39#include <mach/ohci.h>
40#include <mach/pxa27x-udc.h>
41 31
42#include "generic.h"
43#include "devices.h" 32#include "devices.h"
33#include "generic.h"
44 34
45/****************************************************************************** 35/******************************************************************************
46 * Pin configuration 36 * Pin configuration
@@ -50,25 +40,6 @@ static mfp_cfg_t colibri_pxa270_pin_config[] __initdata = {
50 GPIO78_nCS_2, /* Ethernet CS */ 40 GPIO78_nCS_2, /* Ethernet CS */
51 GPIO114_GPIO, /* Ethernet IRQ */ 41 GPIO114_GPIO, /* Ethernet IRQ */
52 42
53 /* MMC */
54 GPIO32_MMC_CLK,
55 GPIO92_MMC_DAT_0,
56 GPIO109_MMC_DAT_1,
57 GPIO110_MMC_DAT_2,
58 GPIO111_MMC_DAT_3,
59 GPIO112_MMC_CMD,
60 GPIO0_GPIO, /* SD detect */
61
62 /* FFUART */
63 GPIO39_FFUART_TXD,
64 GPIO34_FFUART_RXD,
65
66 /* UHC */
67 GPIO88_USBH1_PWR,
68 GPIO89_USBH1_PEN,
69 GPIO119_USBH2_PWR,
70 GPIO120_USBH2_PEN,
71
72 /* AC97 */ 43 /* AC97 */
73 GPIO28_AC97_BITCLK, 44 GPIO28_AC97_BITCLK,
74 GPIO29_AC97_SDATA_IN_0, 45 GPIO29_AC97_SDATA_IN_0,
@@ -172,51 +143,6 @@ static inline void colibri_pxa270_eth_init(void) {}
172#endif 143#endif
173 144
174/****************************************************************************** 145/******************************************************************************
175 * SD/MMC card controller
176 ******************************************************************************/
177#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
178static struct pxamci_platform_data colibri_pxa270_mci_platform_data = {
179 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
180 .gpio_power = -1,
181 .gpio_card_detect = GPIO0_COLIBRI_PXA270_SD_DETECT,
182 .gpio_card_ro = -1,
183 .detect_delay_ms = 200,
184};
185
186static void __init colibri_pxa270_mmc_init(void)
187{
188 pxa_set_mci_info(&colibri_pxa270_mci_platform_data);
189}
190#else
191static inline void colibri_pxa270_mmc_init(void) {}
192#endif
193
194/******************************************************************************
195 * USB Host
196 ******************************************************************************/
197#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
198static int colibri_pxa270_ohci_init(struct device *dev)
199{
200 UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE;
201 return 0;
202}
203
204static struct pxaohci_platform_data colibri_pxa270_ohci_info = {
205 .port_mode = PMM_PERPORT_MODE,
206 .flags = ENABLE_PORT1 | ENABLE_PORT2 |
207 POWER_CONTROL_LOW | POWER_SENSE_LOW,
208 .init = colibri_pxa270_ohci_init,
209};
210
211static void __init colibri_pxa270_uhc_init(void)
212{
213 pxa_set_ohci_info(&colibri_pxa270_ohci_info);
214}
215#else
216static inline void colibri_pxa270_uhc_init(void) {}
217#endif
218
219/******************************************************************************
220 * Audio and Touchscreen 146 * Audio and Touchscreen
221 ******************************************************************************/ 147 ******************************************************************************/
222#if defined(CONFIG_TOUCHSCREEN_UCB1400) || \ 148#if defined(CONFIG_TOUCHSCREEN_UCB1400) || \
@@ -246,18 +172,25 @@ static void __init colibri_pxa270_tsc_init(void)
246static inline void colibri_pxa270_tsc_init(void) {} 172static inline void colibri_pxa270_tsc_init(void) {}
247#endif 173#endif
248 174
175static int colibri_pxa270_baseboard;
176core_param(colibri_pxa270_baseboard, colibri_pxa270_baseboard, int, 0444);
177
249static void __init colibri_pxa270_init(void) 178static void __init colibri_pxa270_init(void)
250{ 179{
251 pxa2xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa270_pin_config)); 180 pxa2xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa270_pin_config));
252 pxa_set_ffuart_info(NULL);
253 pxa_set_btuart_info(NULL);
254 pxa_set_stuart_info(NULL);
255 181
256 colibri_pxa270_nor_init(); 182 colibri_pxa270_nor_init();
257 colibri_pxa270_eth_init(); 183 colibri_pxa270_eth_init();
258 colibri_pxa270_mmc_init();
259 colibri_pxa270_uhc_init();
260 colibri_pxa270_tsc_init(); 184 colibri_pxa270_tsc_init();
185
186 switch (colibri_pxa270_baseboard) {
187 case COLIBRI_PXA270_EVALBOARD:
188 colibri_pxa270_evalboard_init();
189 break;
190 default:
191 printk(KERN_ERR "Illegal colibri_pxa270_baseboard type %d\n",
192 colibri_pxa270_baseboard);
193 }
261} 194}
262 195
263MACHINE_START(COLIBRI, "Toradex Colibri PXA270") 196MACHINE_START(COLIBRI, "Toradex Colibri PXA270")