diff options
author | Marek Vasut <marek.vasut@gmail.com> | 2010-08-11 19:18:38 -0400 |
---|---|---|
committer | Eric Miao <eric.y.miao@gmail.com> | 2010-12-20 10:07:40 -0500 |
commit | 9b6956f45132f9bf696e9f6c2e457bdfa8e08721 (patch) | |
tree | 6b617e542192080d4c7b06cad15668a4453b59da /arch/arm | |
parent | 960c0acaabf603e39b121ae5c0580aaca6f8aa7b (diff) |
ARM: pxa: Push Colibri evalboard MFP into module files
This change -- pushing the MFP configuration back into Module files -- is
necessary because some evalboards can be used with multiple modules, where MFP
differs from module to module. Therefore MFP isn't board-specific, but
module-specific and the module should preconfigure itself for the board.
(And there is also the C preprocesor limitation and conflicting #define-s)
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Acked-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-pxa/Kconfig | 8 | ||||
-rw-r--r-- | arch/arm/mach-pxa/colibri-pxa270-evalboard.c | 61 | ||||
-rw-r--r-- | arch/arm/mach-pxa/colibri-pxa270-income.c | 47 | ||||
-rw-r--r-- | arch/arm/mach-pxa/colibri-pxa270.c | 96 | ||||
-rw-r--r-- | arch/arm/mach-pxa/colibri-pxa300.c | 61 | ||||
-rw-r--r-- | arch/arm/mach-pxa/colibri-pxa320.c | 112 | ||||
-rw-r--r-- | arch/arm/mach-pxa/colibri-pxa3xx.c | 49 | ||||
-rw-r--r-- | arch/arm/mach-pxa/include/mach/colibri.h | 6 |
8 files changed, 188 insertions, 252 deletions
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig index e912b2c8881e..4c31e3dee70f 100644 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig | |||
@@ -236,10 +236,6 @@ config MACH_COLIBRI | |||
236 | bool "Toradex Colibri PXA270" | 236 | bool "Toradex Colibri PXA270" |
237 | select PXA27x | 237 | select PXA27x |
238 | 238 | ||
239 | config MACH_COLIBRI_PXA270_EVALBOARD | ||
240 | bool "Toradex Colibri Evaluation Carrier Board support (PXA270)" | ||
241 | depends on MACH_COLIBRI | ||
242 | |||
243 | config MACH_COLIBRI_PXA270_INCOME | 239 | config MACH_COLIBRI_PXA270_INCOME |
244 | bool "Income s.r.o. PXA270 SBC" | 240 | bool "Income s.r.o. PXA270 SBC" |
245 | depends on MACH_COLIBRI | 241 | depends on MACH_COLIBRI |
@@ -257,6 +253,10 @@ config MACH_COLIBRI320 | |||
257 | select PXA3xx | 253 | select PXA3xx |
258 | select CPU_PXA320 | 254 | select CPU_PXA320 |
259 | 255 | ||
256 | config MACH_COLIBRI_PXA270_EVALBOARD | ||
257 | bool "Toradex Colibri Evaluation Carrier Board support" | ||
258 | depends on MACH_COLIBRI || MACH_COLIBRI300 || MACH_COLIBRI320 | ||
259 | |||
260 | config MACH_VPAC270 | 260 | config MACH_VPAC270 |
261 | bool "Voipac PXA270" | 261 | bool "Voipac PXA270" |
262 | select PXA27x | 262 | select PXA27x |
diff --git a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c b/arch/arm/mach-pxa/colibri-pxa270-evalboard.c index 6177ff5ecbcf..e1a2b52a9d21 100644 --- a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c +++ b/arch/arm/mach-pxa/colibri-pxa270-evalboard.c | |||
@@ -30,61 +30,28 @@ | |||
30 | #include "devices.h" | 30 | #include "devices.h" |
31 | 31 | ||
32 | /****************************************************************************** | 32 | /****************************************************************************** |
33 | * Pin configuration | ||
34 | ******************************************************************************/ | ||
35 | static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = { | ||
36 | /* MMC */ | ||
37 | GPIO32_MMC_CLK, | ||
38 | GPIO92_MMC_DAT_0, | ||
39 | GPIO109_MMC_DAT_1, | ||
40 | GPIO110_MMC_DAT_2, | ||
41 | GPIO111_MMC_DAT_3, | ||
42 | GPIO112_MMC_CMD, | ||
43 | GPIO0_GPIO, /* SD detect */ | ||
44 | |||
45 | /* FFUART */ | ||
46 | GPIO39_FFUART_TXD, | ||
47 | GPIO34_FFUART_RXD, | ||
48 | |||
49 | /* UHC */ | ||
50 | GPIO88_USBH1_PWR, | ||
51 | GPIO89_USBH1_PEN, | ||
52 | GPIO119_USBH2_PWR, | ||
53 | GPIO120_USBH2_PEN, | ||
54 | |||
55 | /* PCMCIA */ | ||
56 | GPIO85_nPCE_1, | ||
57 | GPIO54_nPCE_2, | ||
58 | GPIO55_nPREG, | ||
59 | GPIO50_nPIOR, | ||
60 | GPIO51_nPIOW, | ||
61 | GPIO49_nPWE, | ||
62 | GPIO48_nPOE, | ||
63 | GPIO57_nIOIS16, | ||
64 | GPIO56_nPWAIT, | ||
65 | GPIO104_PSKTSEL, | ||
66 | GPIO53_GPIO, /* RESET */ | ||
67 | GPIO83_GPIO, /* BVD1 */ | ||
68 | GPIO82_GPIO, /* BVD2 */ | ||
69 | GPIO1_GPIO, /* READY */ | ||
70 | GPIO84_GPIO, /* DETECT */ | ||
71 | GPIO107_GPIO, /* PPEN */ | ||
72 | }; | ||
73 | |||
74 | /****************************************************************************** | ||
75 | * SD/MMC card controller | 33 | * SD/MMC card controller |
76 | ******************************************************************************/ | 34 | ******************************************************************************/ |
77 | #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) | 35 | #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) |
78 | static struct pxamci_platform_data colibri_pxa270_mci_platform_data = { | 36 | static struct pxamci_platform_data colibri_pxa270_mci_platform_data = { |
79 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, | 37 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, |
80 | .gpio_power = -1, | 38 | .gpio_power = -1, |
81 | .gpio_card_detect = GPIO0_COLIBRI_PXA270_SD_DETECT, | ||
82 | .gpio_card_ro = -1, | 39 | .gpio_card_ro = -1, |
83 | .detect_delay_ms = 200, | 40 | .detect_delay_ms = 200, |
84 | }; | 41 | }; |
85 | 42 | ||
86 | static void __init colibri_pxa270_mmc_init(void) | 43 | static void __init colibri_pxa270_mmc_init(void) |
87 | { | 44 | { |
45 | if (machine_is_colibri()) /* PXA270 Colibri */ | ||
46 | colibri_pxa270_mci_platform_data.gpio_card_detect = | ||
47 | GPIO0_COLIBRI_PXA270_SD_DETECT; | ||
48 | if (machine_is_colibri300()) /* PXA300 Colibri */ | ||
49 | colibri_pxa270_mci_platform_data.gpio_card_detect = | ||
50 | GPIO39_COLIBRI_PXA300_SD_DETECT; | ||
51 | else /* PXA320 Colibri */ | ||
52 | colibri_pxa270_mci_platform_data.gpio_card_detect = | ||
53 | GPIO28_COLIBRI_PXA320_SD_DETECT; | ||
54 | |||
88 | pxa_set_mci_info(&colibri_pxa270_mci_platform_data); | 55 | pxa_set_mci_info(&colibri_pxa270_mci_platform_data); |
89 | } | 56 | } |
90 | #else | 57 | #else |
@@ -103,13 +70,17 @@ static int colibri_pxa270_ohci_init(struct device *dev) | |||
103 | 70 | ||
104 | static struct pxaohci_platform_data colibri_pxa270_ohci_info = { | 71 | static struct pxaohci_platform_data colibri_pxa270_ohci_info = { |
105 | .port_mode = PMM_PERPORT_MODE, | 72 | .port_mode = PMM_PERPORT_MODE, |
106 | .flags = ENABLE_PORT1 | ENABLE_PORT2 | | 73 | .flags = ENABLE_PORT1 | |
107 | POWER_CONTROL_LOW | POWER_SENSE_LOW, | 74 | POWER_CONTROL_LOW | POWER_SENSE_LOW, |
108 | .init = colibri_pxa270_ohci_init, | 75 | .init = colibri_pxa270_ohci_init, |
109 | }; | 76 | }; |
110 | 77 | ||
111 | static void __init colibri_pxa270_uhc_init(void) | 78 | static void __init colibri_pxa270_uhc_init(void) |
112 | { | 79 | { |
80 | /* Colibri PXA270 has two usb ports, TBA for 320 */ | ||
81 | if (machine_is_colibri()) | ||
82 | colibri_pxa270_ohci_info.flags |= ENABLE_PORT2; | ||
83 | |||
113 | pxa_set_ohci_info(&colibri_pxa270_ohci_info); | 84 | pxa_set_ohci_info(&colibri_pxa270_ohci_info); |
114 | } | 85 | } |
115 | #else | 86 | #else |
@@ -118,7 +89,6 @@ static inline void colibri_pxa270_uhc_init(void) {} | |||
118 | 89 | ||
119 | void __init colibri_pxa270_evalboard_init(void) | 90 | void __init colibri_pxa270_evalboard_init(void) |
120 | { | 91 | { |
121 | pxa2xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa270_evalboard_pin_config)); | ||
122 | pxa_set_ffuart_info(NULL); | 92 | pxa_set_ffuart_info(NULL); |
123 | pxa_set_btuart_info(NULL); | 93 | pxa_set_btuart_info(NULL); |
124 | pxa_set_stuart_info(NULL); | 94 | pxa_set_stuart_info(NULL); |
@@ -126,4 +96,3 @@ void __init colibri_pxa270_evalboard_init(void) | |||
126 | colibri_pxa270_mmc_init(); | 96 | colibri_pxa270_mmc_init(); |
127 | colibri_pxa270_uhc_init(); | 97 | colibri_pxa270_uhc_init(); |
128 | } | 98 | } |
129 | |||
diff --git a/arch/arm/mach-pxa/colibri-pxa270-income.c b/arch/arm/mach-pxa/colibri-pxa270-income.c index 37f0f3ed7c61..07b62a096f17 100644 --- a/arch/arm/mach-pxa/colibri-pxa270-income.c +++ b/arch/arm/mach-pxa/colibri-pxa270-income.c | |||
@@ -46,52 +46,6 @@ | |||
46 | #define GPIO113_INCOME_TS_IRQ (113) | 46 | #define GPIO113_INCOME_TS_IRQ (113) |
47 | 47 | ||
48 | /****************************************************************************** | 48 | /****************************************************************************** |
49 | * Pin configuration | ||
50 | ******************************************************************************/ | ||
51 | static mfp_cfg_t income_pin_config[] __initdata = { | ||
52 | /* MMC */ | ||
53 | GPIO32_MMC_CLK, | ||
54 | GPIO92_MMC_DAT_0, | ||
55 | GPIO109_MMC_DAT_1, | ||
56 | GPIO110_MMC_DAT_2, | ||
57 | GPIO111_MMC_DAT_3, | ||
58 | GPIO112_MMC_CMD, | ||
59 | GPIO0_GPIO, /* SD detect */ | ||
60 | GPIO1_GPIO, /* SD read-only */ | ||
61 | |||
62 | /* FFUART */ | ||
63 | GPIO39_FFUART_TXD, | ||
64 | GPIO34_FFUART_RXD, | ||
65 | |||
66 | /* BFUART */ | ||
67 | GPIO42_BTUART_RXD, | ||
68 | GPIO43_BTUART_TXD, | ||
69 | GPIO45_BTUART_RTS, | ||
70 | |||
71 | /* STUART */ | ||
72 | GPIO46_STUART_RXD, | ||
73 | GPIO47_STUART_TXD, | ||
74 | |||
75 | /* UHC */ | ||
76 | GPIO88_USBH1_PWR, | ||
77 | GPIO89_USBH1_PEN, | ||
78 | |||
79 | /* LCD */ | ||
80 | GPIOxx_LCD_TFT_16BPP, | ||
81 | |||
82 | /* PWM */ | ||
83 | GPIO16_PWM0_OUT, | ||
84 | |||
85 | /* I2C */ | ||
86 | GPIO117_I2C_SCL, | ||
87 | GPIO118_I2C_SDA, | ||
88 | |||
89 | /* LED */ | ||
90 | GPIO54_GPIO, /* LED A */ | ||
91 | GPIO55_GPIO, /* LED B */ | ||
92 | }; | ||
93 | |||
94 | /****************************************************************************** | ||
95 | * SD/MMC card controller | 49 | * SD/MMC card controller |
96 | ******************************************************************************/ | 50 | ******************************************************************************/ |
97 | #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) | 51 | #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) |
@@ -257,7 +211,6 @@ static inline void income_pwm_init(void) {} | |||
257 | 211 | ||
258 | void __init colibri_pxa270_income_boardinit(void) | 212 | void __init colibri_pxa270_income_boardinit(void) |
259 | { | 213 | { |
260 | pxa2xx_mfp_config(ARRAY_AND_SIZE(income_pin_config)); | ||
261 | pxa_set_ffuart_info(NULL); | 214 | pxa_set_ffuart_info(NULL); |
262 | pxa_set_btuart_info(NULL); | 215 | pxa_set_btuart_info(NULL); |
263 | pxa_set_stuart_info(NULL); | 216 | pxa_set_stuart_info(NULL); |
diff --git a/arch/arm/mach-pxa/colibri-pxa270.c b/arch/arm/mach-pxa/colibri-pxa270.c index 73205bc4a13c..e940004eac16 100644 --- a/arch/arm/mach-pxa/colibri-pxa270.c +++ b/arch/arm/mach-pxa/colibri-pxa270.c | |||
@@ -33,6 +33,99 @@ | |||
33 | #include "generic.h" | 33 | #include "generic.h" |
34 | 34 | ||
35 | /****************************************************************************** | 35 | /****************************************************************************** |
36 | * Evaluation board MFP | ||
37 | ******************************************************************************/ | ||
38 | #ifdef CONFIG_MACH_COLIBRI_PXA270_EVALBOARD | ||
39 | static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = { | ||
40 | /* MMC */ | ||
41 | GPIO32_MMC_CLK, | ||
42 | GPIO92_MMC_DAT_0, | ||
43 | GPIO109_MMC_DAT_1, | ||
44 | GPIO110_MMC_DAT_2, | ||
45 | GPIO111_MMC_DAT_3, | ||
46 | GPIO112_MMC_CMD, | ||
47 | GPIO0_GPIO, /* SD detect */ | ||
48 | |||
49 | /* FFUART */ | ||
50 | GPIO39_FFUART_TXD, | ||
51 | GPIO34_FFUART_RXD, | ||
52 | |||
53 | /* UHC */ | ||
54 | GPIO88_USBH1_PWR, | ||
55 | GPIO89_USBH1_PEN, | ||
56 | GPIO119_USBH2_PWR, | ||
57 | GPIO120_USBH2_PEN, | ||
58 | |||
59 | /* PCMCIA */ | ||
60 | GPIO85_nPCE_1, | ||
61 | GPIO54_nPCE_2, | ||
62 | GPIO55_nPREG, | ||
63 | GPIO50_nPIOR, | ||
64 | GPIO51_nPIOW, | ||
65 | GPIO49_nPWE, | ||
66 | GPIO48_nPOE, | ||
67 | GPIO57_nIOIS16, | ||
68 | GPIO56_nPWAIT, | ||
69 | GPIO104_PSKTSEL, | ||
70 | GPIO53_GPIO, /* RESET */ | ||
71 | GPIO83_GPIO, /* BVD1 */ | ||
72 | GPIO82_GPIO, /* BVD2 */ | ||
73 | GPIO1_GPIO, /* READY */ | ||
74 | GPIO84_GPIO, /* DETECT */ | ||
75 | GPIO107_GPIO, /* PPEN */ | ||
76 | }; | ||
77 | #else | ||
78 | static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = {}; | ||
79 | #endif | ||
80 | |||
81 | #ifdef CONFIG_MACH_COLIBRI_PXA270_INCOME | ||
82 | static mfp_cfg_t income_pin_config[] __initdata = { | ||
83 | /* MMC */ | ||
84 | GPIO32_MMC_CLK, | ||
85 | GPIO92_MMC_DAT_0, | ||
86 | GPIO109_MMC_DAT_1, | ||
87 | GPIO110_MMC_DAT_2, | ||
88 | GPIO111_MMC_DAT_3, | ||
89 | GPIO112_MMC_CMD, | ||
90 | GPIO0_GPIO, /* SD detect */ | ||
91 | GPIO1_GPIO, /* SD read-only */ | ||
92 | |||
93 | /* FFUART */ | ||
94 | GPIO39_FFUART_TXD, | ||
95 | GPIO34_FFUART_RXD, | ||
96 | |||
97 | /* BFUART */ | ||
98 | GPIO42_BTUART_RXD, | ||
99 | GPIO43_BTUART_TXD, | ||
100 | GPIO45_BTUART_RTS, | ||
101 | |||
102 | /* STUART */ | ||
103 | GPIO46_STUART_RXD, | ||
104 | GPIO47_STUART_TXD, | ||
105 | |||
106 | /* UHC */ | ||
107 | GPIO88_USBH1_PWR, | ||
108 | GPIO89_USBH1_PEN, | ||
109 | |||
110 | /* LCD */ | ||
111 | GPIOxx_LCD_TFT_16BPP, | ||
112 | |||
113 | /* PWM */ | ||
114 | GPIO16_PWM0_OUT, | ||
115 | |||
116 | /* I2C */ | ||
117 | GPIO117_I2C_SCL, | ||
118 | GPIO118_I2C_SDA, | ||
119 | |||
120 | /* LED */ | ||
121 | GPIO54_GPIO, /* LED A */ | ||
122 | GPIO55_GPIO, /* LED B */ | ||
123 | }; | ||
124 | #else | ||
125 | static mfp_cfg_t income_pin_config[] __initdata = {}; | ||
126 | #endif | ||
127 | |||
128 | /****************************************************************************** | ||
36 | * Pin configuration | 129 | * Pin configuration |
37 | ******************************************************************************/ | 130 | ******************************************************************************/ |
38 | static mfp_cfg_t colibri_pxa270_pin_config[] __initdata = { | 131 | static mfp_cfg_t colibri_pxa270_pin_config[] __initdata = { |
@@ -185,9 +278,12 @@ static void __init colibri_pxa270_init(void) | |||
185 | 278 | ||
186 | switch (colibri_pxa270_baseboard) { | 279 | switch (colibri_pxa270_baseboard) { |
187 | case COLIBRI_PXA270_EVALBOARD: | 280 | case COLIBRI_PXA270_EVALBOARD: |
281 | pxa2xx_mfp_config(ARRAY_AND_SIZE( | ||
282 | colibri_pxa270_evalboard_pin_config)); | ||
188 | colibri_pxa270_evalboard_init(); | 283 | colibri_pxa270_evalboard_init(); |
189 | break; | 284 | break; |
190 | case COLIBRI_PXA270_INCOME: | 285 | case COLIBRI_PXA270_INCOME: |
286 | pxa2xx_mfp_config(ARRAY_AND_SIZE(income_pin_config)); | ||
191 | colibri_pxa270_income_boardinit(); | 287 | colibri_pxa270_income_boardinit(); |
192 | break; | 288 | break; |
193 | default: | 289 | default: |
diff --git a/arch/arm/mach-pxa/colibri-pxa300.c b/arch/arm/mach-pxa/colibri-pxa300.c index d039bd1e2e40..649c83c427c9 100644 --- a/arch/arm/mach-pxa/colibri-pxa300.c +++ b/arch/arm/mach-pxa/colibri-pxa300.c | |||
@@ -31,9 +31,28 @@ | |||
31 | #include "generic.h" | 31 | #include "generic.h" |
32 | #include "devices.h" | 32 | #include "devices.h" |
33 | 33 | ||
34 | |||
35 | #ifdef CONFIG_MACH_COLIBRI_PXA270_EVALBOARD | ||
36 | static mfp_cfg_t colibri_pxa300_evalboard_pin_config[] __initdata = { | ||
37 | /* MMC */ | ||
38 | GPIO7_MMC1_CLK, | ||
39 | GPIO14_MMC1_CMD, | ||
40 | GPIO3_MMC1_DAT0, | ||
41 | GPIO4_MMC1_DAT1, | ||
42 | GPIO5_MMC1_DAT2, | ||
43 | GPIO6_MMC1_DAT3, | ||
44 | GPIO39_GPIO, /* SD detect */ | ||
45 | |||
46 | /* UHC */ | ||
47 | GPIO0_2_USBH_PEN, | ||
48 | GPIO1_2_USBH_PWR, | ||
49 | }; | ||
50 | #else | ||
51 | static mfp_cfg_t colibri_pxa300_evalboard_pin_config[] __initdata = {}; | ||
52 | #endif | ||
53 | |||
34 | #if defined(CONFIG_AX88796) | 54 | #if defined(CONFIG_AX88796) |
35 | #define COLIBRI_ETH_IRQ_GPIO mfp_to_gpio(GPIO26_GPIO) | 55 | #define COLIBRI_ETH_IRQ_GPIO mfp_to_gpio(GPIO26_GPIO) |
36 | |||
37 | /* | 56 | /* |
38 | * Asix AX88796 Ethernet | 57 | * Asix AX88796 Ethernet |
39 | */ | 58 | */ |
@@ -80,35 +99,6 @@ static void __init colibri_pxa300_init_eth(void) | |||
80 | static inline void __init colibri_pxa300_init_eth(void) {} | 99 | static inline void __init colibri_pxa300_init_eth(void) {} |
81 | #endif /* CONFIG_AX88796 */ | 100 | #endif /* CONFIG_AX88796 */ |
82 | 101 | ||
83 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) | ||
84 | static mfp_cfg_t colibri_pxa300_usb_pin_config[] __initdata = { | ||
85 | GPIO0_2_USBH_PEN, | ||
86 | GPIO1_2_USBH_PWR, | ||
87 | }; | ||
88 | |||
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, | ||
92 | }; | ||
93 | |||
94 | void __init colibri_pxa300_init_ohci(void) | ||
95 | { | ||
96 | pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_usb_pin_config)); | ||
97 | pxa_set_ohci_info(&colibri_pxa300_ohci_info); | ||
98 | } | ||
99 | #else | ||
100 | static inline void colibri_pxa300_init_ohci(void) {} | ||
101 | #endif /* CONFIG_USB_OHCI_HCD || CONFIG_USB_OHCI_HCD_MODULE */ | ||
102 | |||
103 | static mfp_cfg_t colibri_pxa300_mmc_pin_config[] __initdata = { | ||
104 | GPIO7_MMC1_CLK, | ||
105 | GPIO14_MMC1_CMD, | ||
106 | GPIO3_MMC1_DAT0, | ||
107 | GPIO4_MMC1_DAT1, | ||
108 | GPIO5_MMC1_DAT2, | ||
109 | GPIO6_MMC1_DAT3, | ||
110 | }; | ||
111 | |||
112 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) | 102 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) |
113 | static mfp_cfg_t colibri_pxa300_lcd_pin_config[] __initdata = { | 103 | static mfp_cfg_t colibri_pxa300_lcd_pin_config[] __initdata = { |
114 | GPIO54_LCD_LDD_0, | 104 | GPIO54_LCD_LDD_0, |
@@ -171,18 +161,15 @@ static inline void colibri_pxa310_init_ac97(void) {} | |||
171 | 161 | ||
172 | void __init colibri_pxa300_init(void) | 162 | void __init colibri_pxa300_init(void) |
173 | { | 163 | { |
174 | pxa_set_ffuart_info(NULL); | ||
175 | pxa_set_btuart_info(NULL); | ||
176 | pxa_set_stuart_info(NULL); | ||
177 | |||
178 | colibri_pxa300_init_eth(); | 164 | colibri_pxa300_init_eth(); |
179 | colibri_pxa300_init_ohci(); | ||
180 | colibri_pxa3xx_init_nand(); | 165 | colibri_pxa3xx_init_nand(); |
181 | colibri_pxa300_init_lcd(); | 166 | colibri_pxa300_init_lcd(); |
182 | colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO39_GPIO)); | 167 | colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO39_GPIO)); |
183 | colibri_pxa310_init_ac97(); | 168 | colibri_pxa310_init_ac97(); |
184 | colibri_pxa3xx_init_mmc(ARRAY_AND_SIZE(colibri_pxa300_mmc_pin_config), | 169 | |
185 | mfp_to_gpio(MFP_PIN_GPIO13)); | 170 | /* Evalboard init */ |
171 | pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_evalboard_pin_config)); | ||
172 | colibri_pxa270_evalboard_init(); | ||
186 | } | 173 | } |
187 | 174 | ||
188 | MACHINE_START(COLIBRI300, "Toradex Colibri PXA300") | 175 | MACHINE_START(COLIBRI300, "Toradex Colibri PXA300") |
diff --git a/arch/arm/mach-pxa/colibri-pxa320.c b/arch/arm/mach-pxa/colibri-pxa320.c index ccb2c59b2a3b..6f15f2acf0c6 100644 --- a/arch/arm/mach-pxa/colibri-pxa320.c +++ b/arch/arm/mach-pxa/colibri-pxa320.c | |||
@@ -35,9 +35,47 @@ | |||
35 | #include "generic.h" | 35 | #include "generic.h" |
36 | #include "devices.h" | 36 | #include "devices.h" |
37 | 37 | ||
38 | #ifdef CONFIG_MACH_COLIBRI_PXA270_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 | #else | ||
74 | static mfp_cfg_t colibri_pxa320_evalboard_pin_config[] __initdata = {}; | ||
75 | #endif | ||
76 | |||
38 | #if defined(CONFIG_AX88796) | 77 | #if defined(CONFIG_AX88796) |
39 | #define COLIBRI_ETH_IRQ_GPIO mfp_to_gpio(GPIO36_GPIO) | 78 | #define COLIBRI_ETH_IRQ_GPIO mfp_to_gpio(GPIO36_GPIO) |
40 | |||
41 | /* | 79 | /* |
42 | * Asix AX88796 Ethernet | 80 | * Asix AX88796 Ethernet |
43 | */ | 81 | */ |
@@ -84,26 +122,6 @@ static void __init colibri_pxa320_init_eth(void) | |||
84 | static inline void __init colibri_pxa320_init_eth(void) {} | 122 | static inline void __init colibri_pxa320_init_eth(void) {} |
85 | #endif /* CONFIG_AX88796 */ | 123 | #endif /* CONFIG_AX88796 */ |
86 | 124 | ||
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) | 125 | #if defined(CONFIG_USB_GADGET_PXA27X)||defined(CONFIG_USB_GADGET_PXA27X_MODULE) |
108 | static struct gpio_vbus_mach_info colibri_pxa320_gpio_vbus_info = { | 126 | static struct gpio_vbus_mach_info colibri_pxa320_gpio_vbus_info = { |
109 | .gpio_vbus = mfp_to_gpio(MFP_PIN_GPIO96), | 127 | .gpio_vbus = mfp_to_gpio(MFP_PIN_GPIO96), |
@@ -140,15 +158,6 @@ static void __init colibri_pxa320_init_udc(void) | |||
140 | static inline void colibri_pxa320_init_udc(void) {} | 158 | static inline void colibri_pxa320_init_udc(void) {} |
141 | #endif | 159 | #endif |
142 | 160 | ||
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) | 161 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) |
153 | static mfp_cfg_t colibri_pxa320_lcd_pin_config[] __initdata = { | 162 | static mfp_cfg_t colibri_pxa320_lcd_pin_config[] __initdata = { |
154 | GPIO6_2_LCD_LDD_0, | 163 | GPIO6_2_LCD_LDD_0, |
@@ -205,53 +214,18 @@ static inline void __init colibri_pxa320_init_ac97(void) | |||
205 | static inline void colibri_pxa320_init_ac97(void) {} | 214 | static inline void colibri_pxa320_init_ac97(void) {} |
206 | #endif | 215 | #endif |
207 | 216 | ||
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) | 217 | void __init colibri_pxa320_init(void) |
240 | { | 218 | { |
241 | pxa_set_ffuart_info(NULL); | ||
242 | pxa_set_btuart_info(NULL); | ||
243 | pxa_set_stuart_info(NULL); | ||
244 | |||
245 | colibri_pxa320_init_eth(); | 219 | colibri_pxa320_init_eth(); |
246 | colibri_pxa320_init_ohci(); | ||
247 | colibri_pxa3xx_init_nand(); | 220 | colibri_pxa3xx_init_nand(); |
248 | colibri_pxa320_init_lcd(); | 221 | colibri_pxa320_init_lcd(); |
249 | colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO49_GPIO)); | 222 | colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO49_GPIO)); |
250 | colibri_pxa320_init_ac97(); | 223 | 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(); | 224 | colibri_pxa320_init_udc(); |
225 | |||
226 | /* Evalboard init */ | ||
227 | pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_evalboard_pin_config)); | ||
228 | colibri_pxa270_evalboard_init(); | ||
255 | } | 229 | } |
256 | 230 | ||
257 | MACHINE_START(COLIBRI320, "Toradex Colibri PXA320") | 231 | MACHINE_START(COLIBRI320, "Toradex Colibri PXA320") |
diff --git a/arch/arm/mach-pxa/colibri-pxa3xx.c b/arch/arm/mach-pxa/colibri-pxa3xx.c index 199afa2ae303..96b2d9fbfef0 100644 --- a/arch/arm/mach-pxa/colibri-pxa3xx.c +++ b/arch/arm/mach-pxa/colibri-pxa3xx.c | |||
@@ -64,55 +64,6 @@ void __init colibri_pxa3xx_init_eth(struct ax_plat_data *plat_data) | |||
64 | } | 64 | } |
65 | #endif | 65 | #endif |
66 | 66 | ||
67 | #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) | ||
68 | static int mmc_detect_pin; | ||
69 | |||
70 | static int colibri_pxa3xx_mci_init(struct device *dev, | ||
71 | irq_handler_t colibri_mmc_detect_int, | ||
72 | void *data) | ||
73 | { | ||
74 | int ret; | ||
75 | |||
76 | ret = gpio_request(mmc_detect_pin, "mmc card detect"); | ||
77 | if (ret) | ||
78 | return ret; | ||
79 | |||
80 | gpio_direction_input(mmc_detect_pin); | ||
81 | ret = request_irq(gpio_to_irq(mmc_detect_pin), colibri_mmc_detect_int, | ||
82 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, | ||
83 | "MMC card detect", data); | ||
84 | if (ret) { | ||
85 | gpio_free(mmc_detect_pin); | ||
86 | return ret; | ||
87 | } | ||
88 | |||
89 | return 0; | ||
90 | } | ||
91 | |||
92 | static void colibri_pxa3xx_mci_exit(struct device *dev, void *data) | ||
93 | { | ||
94 | free_irq(mmc_detect_pin, data); | ||
95 | gpio_free(gpio_to_irq(mmc_detect_pin)); | ||
96 | } | ||
97 | |||
98 | static struct pxamci_platform_data colibri_pxa3xx_mci_platform_data = { | ||
99 | .detect_delay_ms = 200, | ||
100 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, | ||
101 | .init = colibri_pxa3xx_mci_init, | ||
102 | .exit = colibri_pxa3xx_mci_exit, | ||
103 | .gpio_card_detect = -1, | ||
104 | .gpio_card_ro = -1, | ||
105 | .gpio_power = -1, | ||
106 | }; | ||
107 | |||
108 | void __init colibri_pxa3xx_init_mmc(mfp_cfg_t *pins, int len, int detect_pin) | ||
109 | { | ||
110 | pxa3xx_mfp_config(pins, len); | ||
111 | mmc_detect_pin = detect_pin; | ||
112 | pxa_set_mci_info(&colibri_pxa3xx_mci_platform_data); | ||
113 | } | ||
114 | #endif /* CONFIG_MMC_PXA || CONFIG_MMC_PXA_MODULE */ | ||
115 | |||
116 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) | 67 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) |
117 | static int lcd_bl_pin; | 68 | static int lcd_bl_pin; |
118 | 69 | ||
diff --git a/arch/arm/mach-pxa/include/mach/colibri.h b/arch/arm/mach-pxa/include/mach/colibri.h index 58dada11054f..63a948aaed8d 100644 --- a/arch/arm/mach-pxa/include/mach/colibri.h +++ b/arch/arm/mach-pxa/include/mach/colibri.h | |||
@@ -59,5 +59,11 @@ static inline void colibri_pxa3xx_init_nand(void) {} | |||
59 | #define GPIO0_COLIBRI_PXA270_SD_DETECT 0 | 59 | #define GPIO0_COLIBRI_PXA270_SD_DETECT 0 |
60 | #define GPIO113_COLIBRI_PXA270_TS_IRQ 113 | 60 | #define GPIO113_COLIBRI_PXA270_TS_IRQ 113 |
61 | 61 | ||
62 | /* GPIO definitions for Colibri PXA300/310 */ | ||
63 | #define GPIO39_COLIBRI_PXA300_SD_DETECT 39 | ||
64 | |||
65 | /* GPIO definitions for Colibri PXA320 */ | ||
66 | #define GPIO28_COLIBRI_PXA320_SD_DETECT 28 | ||
67 | |||
62 | #endif /* _COLIBRI_H_ */ | 68 | #endif /* _COLIBRI_H_ */ |
63 | 69 | ||