aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx5
diff options
context:
space:
mode:
authorFabio Estevam <fabioestevam@yahoo.com>2010-08-23 10:32:09 -0400
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-09-27 06:53:00 -0400
commit3efee47db7a191443b529740b35240d63ae1ad20 (patch)
tree25d1ad81d7ea38ab191685a21ed130c2e57f15f4 /arch/arm/mach-mx5
parentbd45140d98b60c8ddef8f053ad1645dc1572a15a (diff)
ARM: mx5/mx51_babbage: Add FEC support
Tested it by booting a rootfs via NFS. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx5')
-rw-r--r--arch/arm/mach-mx5/board-mx51_babbage.c43
1 files changed, 42 insertions, 1 deletions
diff --git a/arch/arm/mach-mx5/board-mx51_babbage.c b/arch/arm/mach-mx5/board-mx51_babbage.c
index 6e384d92e625..10d2f6bde172 100644
--- a/arch/arm/mach-mx5/board-mx51_babbage.c
+++ b/arch/arm/mach-mx5/board-mx51_babbage.c
@@ -17,6 +17,7 @@
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>
@@ -35,7 +36,8 @@
35 36
36#define BABBAGE_USB_HUB_RESET (0*32 + 7) /* GPIO_1_7 */ 37#define BABBAGE_USB_HUB_RESET (0*32 + 7) /* GPIO_1_7 */
37#define BABBAGE_USBH1_STP (0*32 + 27) /* GPIO_1_27 */ 38#define BABBAGE_USBH1_STP (0*32 + 27) /* GPIO_1_27 */
38#define BABBAGE_PHY_RESET (1*32 +5) /* GPIO_2_5 */ 39#define BABBAGE_PHY_RESET (1*32 + 5) /* GPIO_2_5 */
40#define BABBAGE_FEC_PHY_RESET (1*32 + 14) /* GPIO_2_14 */
39 41
40/* USB_CTRL_1 */ 42/* USB_CTRL_1 */
41#define MX51_USB_CTRL_1_OFFSET 0x10 43#define MX51_USB_CTRL_1_OFFSET 0x10
@@ -93,6 +95,28 @@ static struct pad_desc mx51babbage_pads[] = {
93 95
94 /* USB HUB reset line*/ 96 /* USB HUB reset line*/
95 MX51_PAD_GPIO_1_7__GPIO_1_7, 97 MX51_PAD_GPIO_1_7__GPIO_1_7,
98
99 /* FEC */
100 MX51_PAD_EIM_EB2__FEC_MDIO,
101 MX51_PAD_EIM_EB3__FEC_RDAT1,
102 MX51_PAD_EIM_CS2__FEC_RDAT2,
103 MX51_PAD_EIM_CS3__FEC_RDAT3,
104 MX51_PAD_EIM_CS4__FEC_RX_ER,
105 MX51_PAD_EIM_CS5__FEC_CRS,
106 MX51_PAD_NANDF_RB2__FEC_COL,
107 MX51_PAD_NANDF_RB3__FEC_RXCLK,
108 MX51_PAD_NANDF_RB6__FEC_RDAT0,
109 MX51_PAD_NANDF_RB7__FEC_TDAT0,
110 MX51_PAD_NANDF_CS2__FEC_TX_ER,
111 MX51_PAD_NANDF_CS3__FEC_MDC,
112 MX51_PAD_NANDF_CS4__FEC_TDAT1,
113 MX51_PAD_NANDF_CS5__FEC_TDAT2,
114 MX51_PAD_NANDF_CS6__FEC_TDAT3,
115 MX51_PAD_NANDF_CS7__FEC_TX_EN,
116 MX51_PAD_NANDF_RDY_INT__FEC_TX_CLK,
117
118 /* FEC PHY reset line */
119 MX51_PAD_EIM_A20__GPIO_2_14,
96}; 120};
97 121
98/* Serial ports */ 122/* Serial ports */
@@ -171,6 +195,22 @@ static inline void babbage_usbhub_reset(void)
171 gpio_set_value(BABBAGE_USB_HUB_RESET, 1); 195 gpio_set_value(BABBAGE_USB_HUB_RESET, 1);
172} 196}
173 197
198static inline void babbage_fec_reset(void)
199{
200 int ret;
201
202 /* reset FEC PHY */
203 ret = gpio_request(BABBAGE_FEC_PHY_RESET, "fec-phy-reset");
204 if (ret) {
205 printk(KERN_ERR"failed to get GPIO_FEC_PHY_RESET: %d\n", ret);
206 return;
207 }
208 gpio_direction_output(BABBAGE_FEC_PHY_RESET, 0);
209 gpio_set_value(BABBAGE_FEC_PHY_RESET, 0);
210 msleep(1);
211 gpio_set_value(BABBAGE_FEC_PHY_RESET, 1);
212}
213
174/* This function is board specific as the bit mask for the plldiv will also 214/* This function is board specific as the bit mask for the plldiv will also
175be different for other Freescale SoCs, thus a common bitmask is not 215be different for other Freescale SoCs, thus a common bitmask is not
176possible and cannot get place in /plat-mxc/ehci.c.*/ 216possible and cannot get place in /plat-mxc/ehci.c.*/
@@ -250,6 +290,7 @@ static void __init mxc_board_init(void)
250 mxc_iomux_v3_setup_multiple_pads(mx51babbage_pads, 290 mxc_iomux_v3_setup_multiple_pads(mx51babbage_pads,
251 ARRAY_SIZE(mx51babbage_pads)); 291 ARRAY_SIZE(mx51babbage_pads));
252 mxc_init_imx_uart(); 292 mxc_init_imx_uart();
293 babbage_fec_reset();
253 platform_add_devices(devices, ARRAY_SIZE(devices)); 294 platform_add_devices(devices, ARRAY_SIZE(devices));
254 295
255 mxc_register_device(&mxc_i2c_device0, &babbage_i2c_data); 296 mxc_register_device(&mxc_i2c_device0, &babbage_i2c_data);