Blame view
arch/arm/mach-pxa/colibri-pxa300.c
4.48 KB
5fc9f9a1d [ARM] pxa: add ba... |
1 2 3 |
/* * arch/arm/mach-pxa/colibri-pxa300.c * |
acb365597 [ARM] pxa: Refact... |
4 5 |
* Support for Toradex PXA300/310 based Colibri module * |
5fc9f9a1d [ARM] pxa: add ba... |
6 |
* Daniel Mack <daniel@caiaq.de> |
acb365597 [ARM] pxa: Refact... |
7 |
* Matthias Meier <matthias.j.meier@gmx.net> |
5fc9f9a1d [ARM] pxa: add ba... |
8 9 10 11 12 13 14 15 16 17 |
* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #include <linux/init.h> #include <linux/kernel.h> #include <linux/platform_device.h> #include <linux/gpio.h> |
8a28b10e9 [ARM] pxa/colibri... |
18 |
#include <linux/interrupt.h> |
5fc9f9a1d [ARM] pxa: add ba... |
19 20 |
#include <asm/mach-types.h> |
acb365597 [ARM] pxa: Refact... |
21 |
#include <asm/sizes.h> |
5fc9f9a1d [ARM] pxa: add ba... |
22 23 24 25 26 |
#include <asm/mach/arch.h> #include <asm/mach/irq.h> #include <mach/pxa300.h> #include <mach/colibri.h> |
42e07ad7f [ARM] pxa: add US... |
27 |
#include <mach/ohci.h> |
91fcfb908 [ARM] pxa: Add Co... |
28 |
#include <mach/pxafb.h> |
7fad69861 [ARM] pxa/colibri... |
29 |
#include <mach/audio.h> |
5fc9f9a1d [ARM] pxa: add ba... |
30 31 32 |
#include "generic.h" #include "devices.h" |
9b6956f45 ARM: pxa: Push Co... |
33 |
|
a3172e541 ARM: pxa: Rename ... |
34 |
#ifdef CONFIG_MACH_COLIBRI_EVALBOARD |
9b6956f45 ARM: pxa: Push Co... |
35 36 37 38 39 40 41 42 |
static mfp_cfg_t colibri_pxa300_evalboard_pin_config[] __initdata = { /* MMC */ GPIO7_MMC1_CLK, GPIO14_MMC1_CMD, GPIO3_MMC1_DAT0, GPIO4_MMC1_DAT1, GPIO5_MMC1_DAT2, GPIO6_MMC1_DAT3, |
57834a722 ARM: pxa/colibri:... |
43 |
GPIO13_GPIO, /* GPIO13_COLIBRI_PXA300_SD_DETECT */ |
9b6956f45 ARM: pxa: Push Co... |
44 45 46 47 |
/* UHC */ GPIO0_2_USBH_PEN, GPIO1_2_USBH_PWR, |
3534cccd2 ARM: pxa/colibri:... |
48 49 50 51 52 53 |
GPIO77_USB_P3_1, GPIO78_USB_P3_2, GPIO79_USB_P3_3, GPIO80_USB_P3_4, GPIO81_USB_P3_5, GPIO82_USB_P3_6, |
072e1ae73 ARM: pxa: Add M41... |
54 55 56 57 |
/* I2C */ GPIO21_I2C_SCL, GPIO22_I2C_SDA, |
9b6956f45 ARM: pxa: Push Co... |
58 59 60 61 |
}; #else static mfp_cfg_t colibri_pxa300_evalboard_pin_config[] __initdata = {}; #endif |
5fc9f9a1d [ARM] pxa: add ba... |
62 |
#if defined(CONFIG_AX88796) |
acb365597 [ARM] pxa: Refact... |
63 |
#define COLIBRI_ETH_IRQ_GPIO mfp_to_gpio(GPIO26_GPIO) |
5fc9f9a1d [ARM] pxa: add ba... |
64 65 66 67 |
/* * Asix AX88796 Ethernet */ static struct ax_plat_data colibri_asix_platdata = { |
22a0200b1 [ARM] pxa/colibri... |
68 69 |
.flags = 0, /* defined later */ .wordlength = 2, |
5fc9f9a1d [ARM] pxa: add ba... |
70 71 72 73 74 |
}; static struct resource colibri_asix_resource[] = { [0] = { .start = PXA3xx_CS2_PHYS, |
626806d96 [ARM] pxa: Fix Co... |
75 |
.end = PXA3xx_CS2_PHYS + (0x20 * 2) - 1, |
5fc9f9a1d [ARM] pxa: add ba... |
76 77 78 |
.flags = IORESOURCE_MEM, }, [1] = { |
4929f5a8a ARM: pxa: rename ... |
79 80 |
.start = PXA_GPIO_TO_IRQ(COLIBRI_ETH_IRQ_GPIO), .end = PXA_GPIO_TO_IRQ(COLIBRI_ETH_IRQ_GPIO), |
8a28b10e9 [ARM] pxa/colibri... |
81 |
.flags = IORESOURCE_IRQ | IRQF_TRIGGER_FALLING, |
5fc9f9a1d [ARM] pxa: add ba... |
82 83 84 85 86 87 88 89 90 91 92 93 |
} }; static struct platform_device asix_device = { .name = "ax88796", .id = 0, .num_resources = ARRAY_SIZE(colibri_asix_resource), .resource = colibri_asix_resource, .dev = { .platform_data = &colibri_asix_platdata } }; |
ebc046c2a [ARM] pxa: add MM... |
94 |
|
acb365597 [ARM] pxa: Refact... |
95 96 97 |
static mfp_cfg_t colibri_pxa300_eth_pin_config[] __initdata = { GPIO1_nCS2, /* AX88796 chip select */ GPIO26_GPIO | MFP_PULL_HIGH /* AX88796 IRQ */ |
ebc046c2a [ARM] pxa: add MM... |
98 |
}; |
acb365597 [ARM] pxa: Refact... |
99 |
static void __init colibri_pxa300_init_eth(void) |
ebc046c2a [ARM] pxa: add MM... |
100 |
{ |
22a0200b1 [ARM] pxa/colibri... |
101 |
colibri_pxa3xx_init_eth(&colibri_asix_platdata); |
acb365597 [ARM] pxa: Refact... |
102 |
pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_eth_pin_config)); |
acb365597 [ARM] pxa: Refact... |
103 |
platform_device_register(&asix_device); |
ebc046c2a [ARM] pxa: add MM... |
104 |
} |
ebc046c2a [ARM] pxa: add MM... |
105 |
#else |
acb365597 [ARM] pxa: Refact... |
106 107 |
static inline void __init colibri_pxa300_init_eth(void) {} #endif /* CONFIG_AX88796 */ |
ebc046c2a [ARM] pxa: add MM... |
108 |
|
91fcfb908 [ARM] pxa: Add Co... |
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) static mfp_cfg_t colibri_pxa300_lcd_pin_config[] __initdata = { GPIO54_LCD_LDD_0, GPIO55_LCD_LDD_1, GPIO56_LCD_LDD_2, GPIO57_LCD_LDD_3, GPIO58_LCD_LDD_4, GPIO59_LCD_LDD_5, GPIO60_LCD_LDD_6, GPIO61_LCD_LDD_7, GPIO62_LCD_LDD_8, GPIO63_LCD_LDD_9, GPIO64_LCD_LDD_10, GPIO65_LCD_LDD_11, GPIO66_LCD_LDD_12, GPIO67_LCD_LDD_13, GPIO68_LCD_LDD_14, GPIO69_LCD_LDD_15, GPIO70_LCD_LDD_16, GPIO71_LCD_LDD_17, GPIO62_LCD_CS_N, GPIO72_LCD_FCLK, GPIO73_LCD_LCLK, GPIO74_LCD_PCLK, GPIO75_LCD_BIAS, GPIO76_LCD_VSYNC, }; static void __init colibri_pxa300_init_lcd(void) { pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_lcd_pin_config)); } #else static inline void colibri_pxa300_init_lcd(void) {} #endif /* CONFIG_FB_PXA || CONFIG_FB_PXA_MODULE */ |
7fad69861 [ARM] pxa/colibri... |
145 |
#if defined(CONFIG_SND_AC97_CODEC) || defined(CONFIG_SND_AC97_CODEC_MODULE) |
e2bb5befd [ARM] pxa: AC97 p... |
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
static mfp_cfg_t colibri_pxa310_ac97_pin_config[] __initdata = { GPIO24_AC97_SYSCLK, GPIO23_AC97_nACRESET, GPIO25_AC97_SDATA_IN_0, GPIO27_AC97_SDATA_OUT, GPIO28_AC97_SYNC, GPIO29_AC97_BITCLK }; static inline void __init colibri_pxa310_init_ac97(void) { /* no AC97 codec on Colibri PXA300 */ if (!cpu_is_pxa310()) return; pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa310_ac97_pin_config)); pxa_set_ac97_info(NULL); } #else static inline void colibri_pxa310_init_ac97(void) {} #endif |
acb365597 [ARM] pxa: Refact... |
167 |
void __init colibri_pxa300_init(void) |
5fc9f9a1d [ARM] pxa: add ba... |
168 |
{ |
acb365597 [ARM] pxa: Refact... |
169 |
colibri_pxa300_init_eth(); |
53740df16 [ARM] pxa/colibri... |
170 |
colibri_pxa3xx_init_nand(); |
91fcfb908 [ARM] pxa: Add Co... |
171 |
colibri_pxa300_init_lcd(); |
c9b78189f [ARM] pxa: fix Co... |
172 |
colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO39_GPIO)); |
e2bb5befd [ARM] pxa: AC97 p... |
173 |
colibri_pxa310_init_ac97(); |
9b6956f45 ARM: pxa: Push Co... |
174 175 176 |
/* Evalboard init */ pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_evalboard_pin_config)); |
a3172e541 ARM: pxa: Rename ... |
177 |
colibri_evalboard_init(); |
5fc9f9a1d [ARM] pxa: add ba... |
178 179 180 |
} MACHINE_START(COLIBRI300, "Toradex Colibri PXA300") |
7375aba67 ARM: mach-pxa: co... |
181 |
.atag_offset = 0x100, |
5fc9f9a1d [ARM] pxa: add ba... |
182 |
.init_machine = colibri_pxa300_init, |
851982c1b ARM: pxa: Introdu... |
183 |
.map_io = pxa3xx_map_io, |
5fc9f9a1d [ARM] pxa: add ba... |
184 |
.init_irq = pxa3xx_init_irq, |
8a97ae2f5 ARM: pxa: enable ... |
185 |
.handle_irq = pxa3xx_handle_irq, |
5fc9f9a1d [ARM] pxa: add ba... |
186 |
.timer = &pxa_timer, |
271a74fc8 ARM: restart: pxa... |
187 |
.restart = pxa_restart, |
5fc9f9a1d [ARM] pxa: add ba... |
188 |
MACHINE_END |