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>
35 #ifdef CONFIG_MACH_COLIBRI_EVALBOARD
36 static mfp_cfg_t colibri_pxa300_evalboard_pin_config[] __initdata = {
44 GPIO39_GPIO, /* SD detect */
55 static mfp_cfg_t colibri_pxa300_evalboard_pin_config[] __initdata = {};
58 #if defined(CONFIG_AX88796)
59 #define COLIBRI_ETH_IRQ_GPIO mfp_to_gpio(GPIO26_GPIO)
61 * Asix AX88796 Ethernet
63 static struct ax_plat_data colibri_asix_platdata = {
64 .flags = 0, /* defined later */
68 static struct resource colibri_asix_resource[] = {
70 .start = PXA3xx_CS2_PHYS,
71 .end = PXA3xx_CS2_PHYS + (0x20 * 2) - 1,
72 .flags = IORESOURCE_MEM,
75 .start = gpio_to_irq(COLIBRI_ETH_IRQ_GPIO),
76 .end = gpio_to_irq(COLIBRI_ETH_IRQ_GPIO),
77 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_FALLING,
81 static struct platform_device asix_device = {
84 .num_resources = ARRAY_SIZE(colibri_asix_resource),
85 .resource = colibri_asix_resource,
87 .platform_data = &colibri_asix_platdata
91 static mfp_cfg_t colibri_pxa300_eth_pin_config[] __initdata = {
92 GPIO1_nCS2, /* AX88796 chip select */
93 GPIO26_GPIO | MFP_PULL_HIGH /* AX88796 IRQ */
96 static void __init colibri_pxa300_init_eth(void)
98 colibri_pxa3xx_init_eth(&colibri_asix_platdata);
99 pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_eth_pin_config));
100 platform_device_register(&asix_device);
103 static inline void __init colibri_pxa300_init_eth(void) {}
104 #endif /* CONFIG_AX88796 */
106 #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
107 static mfp_cfg_t colibri_pxa300_lcd_pin_config[] __initdata = {
134 static void __init colibri_pxa300_init_lcd(void)
136 pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_lcd_pin_config));
140 static inline void colibri_pxa300_init_lcd(void) {}
141 #endif /* CONFIG_FB_PXA || CONFIG_FB_PXA_MODULE */
143 #if defined(CONFIG_SND_AC97_CODEC) || defined(CONFIG_SND_AC97_CODEC_MODULE)
144 static mfp_cfg_t colibri_pxa310_ac97_pin_config[] __initdata = {
146 GPIO23_AC97_nACRESET,
147 GPIO25_AC97_SDATA_IN_0,
148 GPIO27_AC97_SDATA_OUT,
153 static inline void __init colibri_pxa310_init_ac97(void)
155 /* no AC97 codec on Colibri PXA300 */
156 if (!cpu_is_pxa310())
159 pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa310_ac97_pin_config));
160 pxa_set_ac97_info(NULL);
163 static inline void colibri_pxa310_init_ac97(void) {}
166 void __init colibri_pxa300_init(void)
168 colibri_pxa300_init_eth();
169 colibri_pxa3xx_init_nand();
170 colibri_pxa300_init_lcd();
171 colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO39_GPIO));
172 colibri_pxa310_init_ac97();
175 pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_evalboard_pin_config));
176 colibri_evalboard_init();
179 MACHINE_START(COLIBRI300, "Toradex Colibri PXA300")
180 .boot_params = COLIBRI_SDRAM_BASE + 0x100,
181 .init_machine = colibri_pxa300_init,
182 .map_io = pxa3xx_map_io,
183 .init_irq = pxa3xx_init_irq,