diff options
Diffstat (limited to 'arch/arm/mach-mx5/board-mx51_babbage.c')
-rw-r--r-- | arch/arm/mach-mx5/board-mx51_babbage.c | 74 |
1 files changed, 54 insertions, 20 deletions
diff --git a/arch/arm/mach-mx5/board-mx51_babbage.c b/arch/arm/mach-mx5/board-mx51_babbage.c index 6e384d92e62..0821fe9b3b2 100644 --- a/arch/arm/mach-mx5/board-mx51_babbage.c +++ b/arch/arm/mach-mx5/board-mx51_babbage.c | |||
@@ -17,12 +17,11 @@ | |||
17 | #include <linux/delay.h> | 17 | #include <linux/delay.h> |
18 | #include <linux/io.h> | 18 | #include <linux/io.h> |
19 | #include <linux/fsl_devices.h> | 19 | #include <linux/fsl_devices.h> |
20 | #include <linux/fec.h> | ||
20 | 21 | ||
21 | #include <mach/common.h> | 22 | #include <mach/common.h> |
22 | #include <mach/hardware.h> | 23 | #include <mach/hardware.h> |
23 | #include <mach/imx-uart.h> | ||
24 | #include <mach/iomux-mx51.h> | 24 | #include <mach/iomux-mx51.h> |
25 | #include <mach/i2c.h> | ||
26 | #include <mach/mxc_ehci.h> | 25 | #include <mach/mxc_ehci.h> |
27 | 26 | ||
28 | #include <asm/irq.h> | 27 | #include <asm/irq.h> |
@@ -31,11 +30,13 @@ | |||
31 | #include <asm/mach/arch.h> | 30 | #include <asm/mach/arch.h> |
32 | #include <asm/mach/time.h> | 31 | #include <asm/mach/time.h> |
33 | 32 | ||
33 | #include "devices-imx51.h" | ||
34 | #include "devices.h" | 34 | #include "devices.h" |
35 | 35 | ||
36 | #define BABBAGE_USB_HUB_RESET (0*32 + 7) /* GPIO_1_7 */ | 36 | #define BABBAGE_USB_HUB_RESET (0*32 + 7) /* GPIO_1_7 */ |
37 | #define BABBAGE_USBH1_STP (0*32 + 27) /* GPIO_1_27 */ | 37 | #define BABBAGE_USBH1_STP (0*32 + 27) /* GPIO_1_27 */ |
38 | #define BABBAGE_PHY_RESET (1*32 +5) /* GPIO_2_5 */ | 38 | #define BABBAGE_PHY_RESET (1*32 + 5) /* GPIO_2_5 */ |
39 | #define BABBAGE_FEC_PHY_RESET (1*32 + 14) /* GPIO_2_14 */ | ||
39 | 40 | ||
40 | /* USB_CTRL_1 */ | 41 | /* USB_CTRL_1 */ |
41 | #define MX51_USB_CTRL_1_OFFSET 0x10 | 42 | #define MX51_USB_CTRL_1_OFFSET 0x10 |
@@ -45,10 +46,6 @@ | |||
45 | #define MX51_USB_PLL_DIV_19_2_MHZ 0x01 | 46 | #define MX51_USB_PLL_DIV_19_2_MHZ 0x01 |
46 | #define MX51_USB_PLL_DIV_24_MHZ 0x02 | 47 | #define MX51_USB_PLL_DIV_24_MHZ 0x02 |
47 | 48 | ||
48 | static struct platform_device *devices[] __initdata = { | ||
49 | &mxc_fec_device, | ||
50 | }; | ||
51 | |||
52 | static struct pad_desc mx51babbage_pads[] = { | 49 | static struct pad_desc mx51babbage_pads[] = { |
53 | /* UART1 */ | 50 | /* UART1 */ |
54 | MX51_PAD_UART1_RXD__UART1_RXD, | 51 | MX51_PAD_UART1_RXD__UART1_RXD, |
@@ -93,19 +90,41 @@ static struct pad_desc mx51babbage_pads[] = { | |||
93 | 90 | ||
94 | /* USB HUB reset line*/ | 91 | /* USB HUB reset line*/ |
95 | MX51_PAD_GPIO_1_7__GPIO_1_7, | 92 | MX51_PAD_GPIO_1_7__GPIO_1_7, |
93 | |||
94 | /* FEC */ | ||
95 | MX51_PAD_EIM_EB2__FEC_MDIO, | ||
96 | MX51_PAD_EIM_EB3__FEC_RDAT1, | ||
97 | MX51_PAD_EIM_CS2__FEC_RDAT2, | ||
98 | MX51_PAD_EIM_CS3__FEC_RDAT3, | ||
99 | MX51_PAD_EIM_CS4__FEC_RX_ER, | ||
100 | MX51_PAD_EIM_CS5__FEC_CRS, | ||
101 | MX51_PAD_NANDF_RB2__FEC_COL, | ||
102 | MX51_PAD_NANDF_RB3__FEC_RXCLK, | ||
103 | MX51_PAD_NANDF_RB6__FEC_RDAT0, | ||
104 | MX51_PAD_NANDF_RB7__FEC_TDAT0, | ||
105 | MX51_PAD_NANDF_CS2__FEC_TX_ER, | ||
106 | MX51_PAD_NANDF_CS3__FEC_MDC, | ||
107 | MX51_PAD_NANDF_CS4__FEC_TDAT1, | ||
108 | MX51_PAD_NANDF_CS5__FEC_TDAT2, | ||
109 | MX51_PAD_NANDF_CS6__FEC_TDAT3, | ||
110 | MX51_PAD_NANDF_CS7__FEC_TX_EN, | ||
111 | MX51_PAD_NANDF_RDY_INT__FEC_TX_CLK, | ||
112 | |||
113 | /* FEC PHY reset line */ | ||
114 | MX51_PAD_EIM_A20__GPIO_2_14, | ||
96 | }; | 115 | }; |
97 | 116 | ||
98 | /* Serial ports */ | 117 | /* Serial ports */ |
99 | #if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE) | 118 | #if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE) |
100 | static struct imxuart_platform_data uart_pdata = { | 119 | static const struct imxuart_platform_data uart_pdata __initconst = { |
101 | .flags = IMXUART_HAVE_RTSCTS, | 120 | .flags = IMXUART_HAVE_RTSCTS, |
102 | }; | 121 | }; |
103 | 122 | ||
104 | static inline void mxc_init_imx_uart(void) | 123 | static inline void mxc_init_imx_uart(void) |
105 | { | 124 | { |
106 | mxc_register_device(&mxc_uart_device0, &uart_pdata); | 125 | imx51_add_imx_uart(0, &uart_pdata); |
107 | mxc_register_device(&mxc_uart_device1, &uart_pdata); | 126 | imx51_add_imx_uart(1, &uart_pdata); |
108 | mxc_register_device(&mxc_uart_device2, &uart_pdata); | 127 | imx51_add_imx_uart(2, &uart_pdata); |
109 | } | 128 | } |
110 | #else /* !SERIAL_IMX */ | 129 | #else /* !SERIAL_IMX */ |
111 | static inline void mxc_init_imx_uart(void) | 130 | static inline void mxc_init_imx_uart(void) |
@@ -113,7 +132,7 @@ static inline void mxc_init_imx_uart(void) | |||
113 | } | 132 | } |
114 | #endif /* SERIAL_IMX */ | 133 | #endif /* SERIAL_IMX */ |
115 | 134 | ||
116 | static struct imxi2c_platform_data babbage_i2c_data = { | 135 | static const struct imxi2c_platform_data babbage_i2c_data __initconst = { |
117 | .bitrate = 100000, | 136 | .bitrate = 100000, |
118 | }; | 137 | }; |
119 | 138 | ||
@@ -171,6 +190,22 @@ static inline void babbage_usbhub_reset(void) | |||
171 | gpio_set_value(BABBAGE_USB_HUB_RESET, 1); | 190 | gpio_set_value(BABBAGE_USB_HUB_RESET, 1); |
172 | } | 191 | } |
173 | 192 | ||
193 | static inline void babbage_fec_reset(void) | ||
194 | { | ||
195 | int ret; | ||
196 | |||
197 | /* reset FEC PHY */ | ||
198 | ret = gpio_request(BABBAGE_FEC_PHY_RESET, "fec-phy-reset"); | ||
199 | if (ret) { | ||
200 | printk(KERN_ERR"failed to get GPIO_FEC_PHY_RESET: %d\n", ret); | ||
201 | return; | ||
202 | } | ||
203 | gpio_direction_output(BABBAGE_FEC_PHY_RESET, 0); | ||
204 | gpio_set_value(BABBAGE_FEC_PHY_RESET, 0); | ||
205 | msleep(1); | ||
206 | gpio_set_value(BABBAGE_FEC_PHY_RESET, 1); | ||
207 | } | ||
208 | |||
174 | /* This function is board specific as the bit mask for the plldiv will also | 209 | /* This function is board specific as the bit mask for the plldiv will also |
175 | be different for other Freescale SoCs, thus a common bitmask is not | 210 | be different for other Freescale SoCs, thus a common bitmask is not |
176 | possible and cannot get place in /plat-mxc/ehci.c.*/ | 211 | possible and cannot get place in /plat-mxc/ehci.c.*/ |
@@ -178,7 +213,7 @@ static int initialize_otg_port(struct platform_device *pdev) | |||
178 | { | 213 | { |
179 | u32 v; | 214 | u32 v; |
180 | void __iomem *usb_base; | 215 | void __iomem *usb_base; |
181 | u32 usbother_base; | 216 | void __iomem *usbother_base; |
182 | 217 | ||
183 | usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); | 218 | usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); |
184 | usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET; | 219 | usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET; |
@@ -196,7 +231,7 @@ static int initialize_usbh1_port(struct platform_device *pdev) | |||
196 | { | 231 | { |
197 | u32 v; | 232 | u32 v; |
198 | void __iomem *usb_base; | 233 | void __iomem *usb_base; |
199 | u32 usbother_base; | 234 | void __iomem *usbother_base; |
200 | 235 | ||
201 | usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); | 236 | usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); |
202 | usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET; | 237 | usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET; |
@@ -250,10 +285,11 @@ static void __init mxc_board_init(void) | |||
250 | mxc_iomux_v3_setup_multiple_pads(mx51babbage_pads, | 285 | mxc_iomux_v3_setup_multiple_pads(mx51babbage_pads, |
251 | ARRAY_SIZE(mx51babbage_pads)); | 286 | ARRAY_SIZE(mx51babbage_pads)); |
252 | mxc_init_imx_uart(); | 287 | mxc_init_imx_uart(); |
253 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 288 | babbage_fec_reset(); |
289 | imx51_add_fec(NULL); | ||
254 | 290 | ||
255 | mxc_register_device(&mxc_i2c_device0, &babbage_i2c_data); | 291 | imx51_add_imx_i2c(0, &babbage_i2c_data); |
256 | mxc_register_device(&mxc_i2c_device1, &babbage_i2c_data); | 292 | imx51_add_imx_i2c(1, &babbage_i2c_data); |
257 | mxc_register_device(&mxc_hsi2c_device, &babbage_hsi2c_data); | 293 | mxc_register_device(&mxc_hsi2c_device, &babbage_hsi2c_data); |
258 | 294 | ||
259 | if (otg_mode_host) | 295 | if (otg_mode_host) |
@@ -281,9 +317,7 @@ static struct sys_timer mxc_timer = { | |||
281 | 317 | ||
282 | MACHINE_START(MX51_BABBAGE, "Freescale MX51 Babbage Board") | 318 | MACHINE_START(MX51_BABBAGE, "Freescale MX51 Babbage Board") |
283 | /* Maintainer: Amit Kucheria <amit.kucheria@canonical.com> */ | 319 | /* Maintainer: Amit Kucheria <amit.kucheria@canonical.com> */ |
284 | .phys_io = MX51_AIPS1_BASE_ADDR, | 320 | .boot_params = MX51_PHYS_OFFSET + 0x100, |
285 | .io_pg_offst = ((MX51_AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, | ||
286 | .boot_params = PHYS_OFFSET + 0x100, | ||
287 | .map_io = mx51_map_io, | 321 | .map_io = mx51_map_io, |
288 | .init_irq = mx51_init_irq, | 322 | .init_irq = mx51_init_irq, |
289 | .init_machine = mxc_board_init, | 323 | .init_machine = mxc_board_init, |