diff options
Diffstat (limited to 'arch/arm/mach-pxa/colibri-pxa320.c')
-rw-r--r-- | arch/arm/mach-pxa/colibri-pxa320.c | 139 |
1 files changed, 69 insertions, 70 deletions
diff --git a/arch/arm/mach-pxa/colibri-pxa320.c b/arch/arm/mach-pxa/colibri-pxa320.c index ca5f29e2e9cd..ff9ff5f4fc47 100644 --- a/arch/arm/mach-pxa/colibri-pxa320.c +++ b/arch/arm/mach-pxa/colibri-pxa320.c | |||
@@ -35,9 +35,72 @@ | |||
35 | #include "generic.h" | 35 | #include "generic.h" |
36 | #include "devices.h" | 36 | #include "devices.h" |
37 | 37 | ||
38 | #ifdef CONFIG_MACH_COLIBRI_EVALBOARD | ||
39 | static mfp_cfg_t colibri_pxa320_evalboard_pin_config[] __initdata = { | ||
40 | /* MMC */ | ||
41 | GPIO22_MMC1_CLK, | ||
42 | GPIO23_MMC1_CMD, | ||
43 | GPIO18_MMC1_DAT0, | ||
44 | GPIO19_MMC1_DAT1, | ||
45 | GPIO20_MMC1_DAT2, | ||
46 | GPIO21_MMC1_DAT3, | ||
47 | GPIO28_GPIO, /* SD detect */ | ||
48 | |||
49 | /* UART 1 configuration (may be set by bootloader) */ | ||
50 | GPIO99_UART1_CTS, | ||
51 | GPIO104_UART1_RTS, | ||
52 | GPIO97_UART1_RXD, | ||
53 | GPIO98_UART1_TXD, | ||
54 | GPIO101_UART1_DTR, | ||
55 | GPIO103_UART1_DSR, | ||
56 | GPIO100_UART1_DCD, | ||
57 | GPIO102_UART1_RI, | ||
58 | |||
59 | /* UART 2 configuration */ | ||
60 | GPIO109_UART2_CTS, | ||
61 | GPIO112_UART2_RTS, | ||
62 | GPIO110_UART2_RXD, | ||
63 | GPIO111_UART2_TXD, | ||
64 | |||
65 | /* UART 3 configuration */ | ||
66 | GPIO30_UART3_RXD, | ||
67 | GPIO31_UART3_TXD, | ||
68 | |||
69 | /* UHC */ | ||
70 | GPIO2_2_USBH_PEN, | ||
71 | GPIO3_2_USBH_PWR, | ||
72 | |||
73 | /* I2C */ | ||
74 | GPIO32_I2C_SCL, | ||
75 | GPIO33_I2C_SDA, | ||
76 | |||
77 | /* PCMCIA */ | ||
78 | MFP_CFG(GPIO59, AF7), /* PRST ; AF7 to tristate */ | ||
79 | MFP_CFG(GPIO61, AF7), /* PCE1 ; AF7 to tristate */ | ||
80 | MFP_CFG(GPIO60, AF7), /* PCE2 ; AF7 to tristate */ | ||
81 | MFP_CFG(GPIO62, AF7), /* PCD ; AF7 to tristate */ | ||
82 | MFP_CFG(GPIO56, AF7), /* PSKTSEL ; AF7 to tristate */ | ||
83 | GPIO27_GPIO, /* RDnWR ; input/tristate */ | ||
84 | GPIO50_GPIO, /* PREG ; input/tristate */ | ||
85 | GPIO2_RDY, | ||
86 | GPIO5_NPIOR, | ||
87 | GPIO6_NPIOW, | ||
88 | GPIO7_NPIOS16, | ||
89 | GPIO8_NPWAIT, | ||
90 | GPIO29_GPIO, /* PRDY (READY GPIO) */ | ||
91 | GPIO57_GPIO, /* PPEN (POWER GPIO) */ | ||
92 | GPIO81_GPIO, /* PCD (DETECT GPIO) */ | ||
93 | GPIO77_GPIO, /* PRST (RESET GPIO) */ | ||
94 | GPIO53_GPIO, /* PBVD1 */ | ||
95 | GPIO79_GPIO, /* PBVD2 */ | ||
96 | GPIO54_GPIO, /* POE */ | ||
97 | }; | ||
98 | #else | ||
99 | static mfp_cfg_t colibri_pxa320_evalboard_pin_config[] __initdata = {}; | ||
100 | #endif | ||
101 | |||
38 | #if defined(CONFIG_AX88796) | 102 | #if defined(CONFIG_AX88796) |
39 | #define COLIBRI_ETH_IRQ_GPIO mfp_to_gpio(GPIO36_GPIO) | 103 | #define COLIBRI_ETH_IRQ_GPIO mfp_to_gpio(GPIO36_GPIO) |
40 | |||
41 | /* | 104 | /* |
42 | * Asix AX88796 Ethernet | 105 | * Asix AX88796 Ethernet |
43 | */ | 106 | */ |
@@ -84,26 +147,6 @@ static void __init colibri_pxa320_init_eth(void) | |||
84 | static inline void __init colibri_pxa320_init_eth(void) {} | 147 | static inline void __init colibri_pxa320_init_eth(void) {} |
85 | #endif /* CONFIG_AX88796 */ | 148 | #endif /* CONFIG_AX88796 */ |
86 | 149 | ||
87 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) | ||
88 | static mfp_cfg_t colibri_pxa320_usb_pin_config[] __initdata = { | ||
89 | GPIO2_2_USBH_PEN, | ||
90 | GPIO3_2_USBH_PWR, | ||
91 | }; | ||
92 | |||
93 | static struct pxaohci_platform_data colibri_pxa320_ohci_info = { | ||
94 | .port_mode = PMM_GLOBAL_MODE, | ||
95 | .flags = ENABLE_PORT1 | POWER_CONTROL_LOW | POWER_SENSE_LOW, | ||
96 | }; | ||
97 | |||
98 | void __init colibri_pxa320_init_ohci(void) | ||
99 | { | ||
100 | pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_usb_pin_config)); | ||
101 | pxa_set_ohci_info(&colibri_pxa320_ohci_info); | ||
102 | } | ||
103 | #else | ||
104 | static inline void colibri_pxa320_init_ohci(void) {} | ||
105 | #endif /* CONFIG_USB_OHCI_HCD || CONFIG_USB_OHCI_HCD_MODULE */ | ||
106 | |||
107 | #if defined(CONFIG_USB_GADGET_PXA27X)||defined(CONFIG_USB_GADGET_PXA27X_MODULE) | 150 | #if defined(CONFIG_USB_GADGET_PXA27X)||defined(CONFIG_USB_GADGET_PXA27X_MODULE) |
108 | static struct gpio_vbus_mach_info colibri_pxa320_gpio_vbus_info = { | 151 | static struct gpio_vbus_mach_info colibri_pxa320_gpio_vbus_info = { |
109 | .gpio_vbus = mfp_to_gpio(MFP_PIN_GPIO96), | 152 | .gpio_vbus = mfp_to_gpio(MFP_PIN_GPIO96), |
@@ -140,15 +183,6 @@ static void __init colibri_pxa320_init_udc(void) | |||
140 | static inline void colibri_pxa320_init_udc(void) {} | 183 | static inline void colibri_pxa320_init_udc(void) {} |
141 | #endif | 184 | #endif |
142 | 185 | ||
143 | static mfp_cfg_t colibri_pxa320_mmc_pin_config[] __initdata = { | ||
144 | GPIO22_MMC1_CLK, | ||
145 | GPIO23_MMC1_CMD, | ||
146 | GPIO18_MMC1_DAT0, | ||
147 | GPIO19_MMC1_DAT1, | ||
148 | GPIO20_MMC1_DAT2, | ||
149 | GPIO21_MMC1_DAT3 | ||
150 | }; | ||
151 | |||
152 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) | 186 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) |
153 | static mfp_cfg_t colibri_pxa320_lcd_pin_config[] __initdata = { | 187 | static mfp_cfg_t colibri_pxa320_lcd_pin_config[] __initdata = { |
154 | GPIO6_2_LCD_LDD_0, | 188 | GPIO6_2_LCD_LDD_0, |
@@ -205,59 +239,24 @@ static inline void __init colibri_pxa320_init_ac97(void) | |||
205 | static inline void colibri_pxa320_init_ac97(void) {} | 239 | static inline void colibri_pxa320_init_ac97(void) {} |
206 | #endif | 240 | #endif |
207 | 241 | ||
208 | /* | ||
209 | * The following configuration is verified to work with the Toradex Orchid | ||
210 | * carrier board | ||
211 | */ | ||
212 | static mfp_cfg_t colibri_pxa320_uart_pin_config[] __initdata = { | ||
213 | /* UART 1 configuration (may be set by bootloader) */ | ||
214 | GPIO99_UART1_CTS, | ||
215 | GPIO104_UART1_RTS, | ||
216 | GPIO97_UART1_RXD, | ||
217 | GPIO98_UART1_TXD, | ||
218 | GPIO101_UART1_DTR, | ||
219 | GPIO103_UART1_DSR, | ||
220 | GPIO100_UART1_DCD, | ||
221 | GPIO102_UART1_RI, | ||
222 | |||
223 | /* UART 2 configuration */ | ||
224 | GPIO109_UART2_CTS, | ||
225 | GPIO112_UART2_RTS, | ||
226 | GPIO110_UART2_RXD, | ||
227 | GPIO111_UART2_TXD, | ||
228 | |||
229 | /* UART 3 configuration */ | ||
230 | GPIO30_UART3_RXD, | ||
231 | GPIO31_UART3_TXD, | ||
232 | }; | ||
233 | |||
234 | static void __init colibri_pxa320_init_uart(void) | ||
235 | { | ||
236 | pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_uart_pin_config)); | ||
237 | } | ||
238 | |||
239 | void __init colibri_pxa320_init(void) | 242 | void __init colibri_pxa320_init(void) |
240 | { | 243 | { |
241 | pxa_set_ffuart_info(NULL); | ||
242 | pxa_set_btuart_info(NULL); | ||
243 | pxa_set_stuart_info(NULL); | ||
244 | |||
245 | colibri_pxa320_init_eth(); | 244 | colibri_pxa320_init_eth(); |
246 | colibri_pxa320_init_ohci(); | ||
247 | colibri_pxa3xx_init_nand(); | 245 | colibri_pxa3xx_init_nand(); |
248 | colibri_pxa320_init_lcd(); | 246 | colibri_pxa320_init_lcd(); |
249 | colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO49_GPIO)); | 247 | colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO49_GPIO)); |
250 | colibri_pxa320_init_ac97(); | 248 | colibri_pxa320_init_ac97(); |
251 | colibri_pxa3xx_init_mmc(ARRAY_AND_SIZE(colibri_pxa320_mmc_pin_config), | ||
252 | mfp_to_gpio(MFP_PIN_GPIO28)); | ||
253 | colibri_pxa320_init_uart(); | ||
254 | colibri_pxa320_init_udc(); | 249 | colibri_pxa320_init_udc(); |
250 | |||
251 | /* Evalboard init */ | ||
252 | pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_evalboard_pin_config)); | ||
253 | colibri_evalboard_init(); | ||
255 | } | 254 | } |
256 | 255 | ||
257 | MACHINE_START(COLIBRI320, "Toradex Colibri PXA320") | 256 | MACHINE_START(COLIBRI320, "Toradex Colibri PXA320") |
258 | .boot_params = COLIBRI_SDRAM_BASE + 0x100, | 257 | .boot_params = COLIBRI_SDRAM_BASE + 0x100, |
259 | .init_machine = colibri_pxa320_init, | 258 | .init_machine = colibri_pxa320_init, |
260 | .map_io = pxa_map_io, | 259 | .map_io = pxa3xx_map_io, |
261 | .init_irq = pxa3xx_init_irq, | 260 | .init_irq = pxa3xx_init_irq, |
262 | .timer = &pxa_timer, | 261 | .timer = &pxa_timer, |
263 | MACHINE_END | 262 | MACHINE_END |