summaryrefslogtreecommitdiff
path: root/arch/arm/mach-mx6/board-mx6sl_arm2.c
diff options
context:
space:
mode:
authorFugang Duan <B38611@freescale.com>2012-05-16 18:27:09 +0800
committerJason Liu <r64343@freescale.com>2012-07-20 13:37:31 +0800
commitd35878f313e39e92a09703c707f299b779b1db76 (patch)
tree6b6d93ba9a55d46bb0c0c722394792aab98450f2 /arch/arm/mach-mx6/board-mx6sl_arm2.c
parent07af8fc0f20f3f6d4e29463875ec6843307e2fcb (diff)
ENGR00209520-01 - MX6SL MSL : Add FEC support
Add FEC support for mx6-sololite: - Add FEC pad iomux setting. - Power on phy and init fec. - Add devname to distinguish different IP. - Use ANATOP as FEC clock source in default, remove redundant config "FEC_CLOCK_FROM_ANATOP". Signed-off-by: Fugang Duan <B38611@freescale.com>
Diffstat (limited to 'arch/arm/mach-mx6/board-mx6sl_arm2.c')
-rwxr-xr-xarch/arm/mach-mx6/board-mx6sl_arm2.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/mach-mx6/board-mx6sl_arm2.c b/arch/arm/mach-mx6/board-mx6sl_arm2.c
index 3879b8d3fb79..220ea3241f24 100755
--- a/arch/arm/mach-mx6/board-mx6sl_arm2.c
+++ b/arch/arm/mach-mx6/board-mx6sl_arm2.c
@@ -80,6 +80,7 @@
#define MX6_ARM2_SD2_WP IMX_GPIO_NR(4, 29) /* SD2_DAT6 */
#define MX6_ARM2_SD2_CD IMX_GPIO_NR(5, 0) /* SD2_DAT7 */
#define MX6_ARM2_SD3_CD IMX_GPIO_NR(3, 22) /* REF_CLK_32K */
+#define MX6_ARM2_FEC_PWR_EN IMX_GPIO_NR(4, 21) /* FEC_TX_CLK */
static const struct esdhc_platform_data mx6_arm2_sd1_data __initconst = {
.cd_gpio = MX6_ARM2_SD1_CD,
@@ -113,6 +114,10 @@ static inline void mx6_arm2_init_uart(void)
imx6q_add_sdhci_usdhc_imx(2, &mx6_arm2_sd3_data);
}
+static struct fec_platform_data fec_data __initdata = {
+ .phy = PHY_INTERFACE_MODE_RMII,
+};
+
static void imx6_arm2_usbotg_vbus(bool on)
{
if (on)
@@ -161,6 +166,20 @@ static void __init mx6_arm2_init(void)
mxc_iomux_v3_setup_multiple_pads(mx6sl_arm2_pads, ARRAY_SIZE(mx6sl_arm2_pads));
mx6_arm2_init_uart();
+ /* get enet tx reference clk from FEC_REF_CLK pad.
+ * GPR1[14] = 0, GPR1[18:17] = 00
+ */
+ mxc_iomux_set_gpr_register(1, 14, 1, 0);
+ mxc_iomux_set_gpr_register(1, 17, 2, 0);
+
+ /* power on FEC phy and reset phy */
+ gpio_request(MX6_ARM2_FEC_PWR_EN, "fec-pwr");
+ gpio_direction_output(MX6_ARM2_FEC_PWR_EN, 1);
+ /* wait RC ms for hw reset */
+ udelay(500);
+
+ imx6_init_fec(fec_data);
+
mx6_arm2_init_usb();
}