diff options
author | Richard Zhao <richard.zhao@linaro.org> | 2011-12-13 20:26:47 -0500 |
---|---|---|
committer | Shawn Guo <shawn.guo@linaro.org> | 2011-12-14 08:25:45 -0500 |
commit | 477fce49aef4096639ca169556435c1f9068ce33 (patch) | |
tree | 59b179baf9ed61a5bdb0bc1a7a9cb33283a93111 | |
parent | 3c8276c6bc912025db50ff7e93af6bc7c3de0c8c (diff) |
arm/imx6q-sabrelite: add enet phy ksz9021rn fixup
The default phy RGMII pad settings can not work, tune pad skew.
Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
-rw-r--r-- | arch/arm/mach-imx/mach-imx6q.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c index d24d6c485eee..b2c3f69fb4e9 100644 --- a/arch/arm/mach-imx/mach-imx6q.c +++ b/arch/arm/mach-imx/mach-imx6q.c | |||
@@ -16,6 +16,8 @@ | |||
16 | #include <linux/of.h> | 16 | #include <linux/of.h> |
17 | #include <linux/of_irq.h> | 17 | #include <linux/of_irq.h> |
18 | #include <linux/of_platform.h> | 18 | #include <linux/of_platform.h> |
19 | #include <linux/phy.h> | ||
20 | #include <linux/micrel_phy.h> | ||
19 | #include <asm/hardware/cache-l2x0.h> | 21 | #include <asm/hardware/cache-l2x0.h> |
20 | #include <asm/hardware/gic.h> | 22 | #include <asm/hardware/gic.h> |
21 | #include <asm/mach/arch.h> | 23 | #include <asm/mach/arch.h> |
@@ -23,8 +25,27 @@ | |||
23 | #include <mach/common.h> | 25 | #include <mach/common.h> |
24 | #include <mach/hardware.h> | 26 | #include <mach/hardware.h> |
25 | 27 | ||
28 | /* For imx6q sabrelite board: set KSZ9021RN RGMII pad skew */ | ||
29 | static int ksz9021rn_phy_fixup(struct phy_device *phydev) | ||
30 | { | ||
31 | /* min rx data delay */ | ||
32 | phy_write(phydev, 0x0b, 0x8105); | ||
33 | phy_write(phydev, 0x0c, 0x0000); | ||
34 | |||
35 | /* max rx/tx clock delay, min rx/tx control delay */ | ||
36 | phy_write(phydev, 0x0b, 0x8104); | ||
37 | phy_write(phydev, 0x0c, 0xf0f0); | ||
38 | phy_write(phydev, 0x0b, 0x104); | ||
39 | |||
40 | return 0; | ||
41 | } | ||
42 | |||
26 | static void __init imx6q_init_machine(void) | 43 | static void __init imx6q_init_machine(void) |
27 | { | 44 | { |
45 | if (of_machine_is_compatible("fsl,imx6q-sabrelite")) | ||
46 | phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK, | ||
47 | ksz9021rn_phy_fixup); | ||
48 | |||
28 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 49 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
29 | 50 | ||
30 | imx6q_pm_init(); | 51 | imx6q_pm_init(); |