2 * arch/arm/mach-pxa/colibri-pxa300.c
4 * Support for Toradex PXA300/310 based Colibri module
6 * Daniel Mack <daniel@caiaq.de>
7 * Matthias Meier <matthias.j.meier@gmx.net>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
14 #include <linux/init.h>
15 #include <linux/kernel.h>
16 #include <linux/platform_device.h>
17 #include <linux/gpio.h>
18 #include <linux/interrupt.h>
20 #include <asm/mach-types.h>
21 #include <asm/sizes.h>
22 #include <asm/mach/arch.h>
23 #include <asm/mach/irq.h>
25 #include <mach/pxa300.h>
26 #include <mach/colibri.h>
27 #include <mach/ohci.h>
28 #include <mach/pxafb.h>
29 #include <mach/audio.h>
34 #if defined(CONFIG_AX88796)
35 #define COLIBRI_ETH_IRQ_GPIO mfp_to_gpio(GPIO26_GPIO)
38 * Asix AX88796 Ethernet
40 static struct ax_plat_data colibri_asix_platdata
= {
41 .flags
= 0, /* defined later */
45 static struct resource colibri_asix_resource
[] = {
47 .start
= PXA3xx_CS2_PHYS
,
48 .end
= PXA3xx_CS2_PHYS
+ (0x20 * 2) - 1,
49 .flags
= IORESOURCE_MEM
,
52 .start
= gpio_to_irq(COLIBRI_ETH_IRQ_GPIO
),
53 .end
= gpio_to_irq(COLIBRI_ETH_IRQ_GPIO
),
54 .flags
= IORESOURCE_IRQ
| IRQF_TRIGGER_FALLING
,
58 static struct platform_device asix_device
= {
61 .num_resources
= ARRAY_SIZE(colibri_asix_resource
),
62 .resource
= colibri_asix_resource
,
64 .platform_data
= &colibri_asix_platdata
68 static mfp_cfg_t colibri_pxa300_eth_pin_config
[] __initdata
= {
69 GPIO1_nCS2
, /* AX88796 chip select */
70 GPIO26_GPIO
| MFP_PULL_HIGH
/* AX88796 IRQ */
73 static void __init
colibri_pxa300_init_eth(void)
75 colibri_pxa3xx_init_eth(&colibri_asix_platdata
);
76 pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_eth_pin_config
));
77 platform_device_register(&asix_device
);
80 static inline void __init
colibri_pxa300_init_eth(void) {}
81 #endif /* CONFIG_AX88796 */
83 #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
84 static mfp_cfg_t colibri_pxa300_usb_pin_config
[] __initdata
= {
89 static struct pxaohci_platform_data colibri_pxa300_ohci_info
= {
90 .port_mode
= PMM_GLOBAL_MODE
,
91 .flags
= ENABLE_PORT1
| POWER_CONTROL_LOW
| POWER_SENSE_LOW
,
94 void __init
colibri_pxa300_init_ohci(void)
96 pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_usb_pin_config
));
97 pxa_set_ohci_info(&colibri_pxa300_ohci_info
);
100 static inline void colibri_pxa300_init_ohci(void) {}
101 #endif /* CONFIG_USB_OHCI_HCD || CONFIG_USB_OHCI_HCD_MODULE */
103 static mfp_cfg_t colibri_pxa300_mmc_pin_config
[] __initdata
= {
112 #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
113 static mfp_cfg_t colibri_pxa300_lcd_pin_config
[] __initdata
= {
140 static void __init
colibri_pxa300_init_lcd(void)
142 pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_lcd_pin_config
));
146 static inline void colibri_pxa300_init_lcd(void) {}
147 #endif /* CONFIG_FB_PXA || CONFIG_FB_PXA_MODULE */
149 #if defined(CONFIG_SND_AC97_CODEC) || defined(CONFIG_SND_AC97_CODEC_MODULE)
150 static mfp_cfg_t colibri_pxa310_ac97_pin_config
[] __initdata
= {
152 GPIO23_AC97_nACRESET
,
153 GPIO25_AC97_SDATA_IN_0
,
154 GPIO27_AC97_SDATA_OUT
,
159 static inline void __init
colibri_pxa310_init_ac97(void)
161 /* no AC97 codec on Colibri PXA300 */
162 if (!cpu_is_pxa310())
165 pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa310_ac97_pin_config
));
166 pxa_set_ac97_info(NULL
);
169 static inline void colibri_pxa310_init_ac97(void) {}
172 void __init
colibri_pxa300_init(void)
174 pxa_set_ffuart_info(NULL
);
175 pxa_set_btuart_info(NULL
);
176 pxa_set_stuart_info(NULL
);
178 colibri_pxa300_init_eth();
179 colibri_pxa300_init_ohci();
180 colibri_pxa3xx_init_nand();
181 colibri_pxa300_init_lcd();
182 colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO39_GPIO
));
183 colibri_pxa310_init_ac97();
184 colibri_pxa3xx_init_mmc(ARRAY_AND_SIZE(colibri_pxa300_mmc_pin_config
),
185 mfp_to_gpio(MFP_PIN_GPIO13
));
188 MACHINE_START(COLIBRI300
, "Toradex Colibri PXA300")
189 .phys_io
= 0x40000000,
190 .io_pg_offst
= (io_p2v(0x40000000) >> 18) & 0xfffc,
191 .boot_params
= COLIBRI_SDRAM_BASE
+ 0x100,
192 .init_machine
= colibri_pxa300_init
,
193 .map_io
= pxa_map_io
,
194 .init_irq
= pxa3xx_init_irq
,