diff options
author | Simon Horman <horms+renesas@verge.net.au> | 2013-10-08 10:01:47 +0900 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2013-10-08 10:01:47 +0900 |
commit | 661a7335c4e47726df1e7264580209847509569a (patch) | |
tree | 9f86456e42fd13c3b82f630e6319faa3e6146732 /arch/arm/mach-shmobile/board-lager.c | |
parent | 63862f14bdf9e1251b7398947265422ec9b1400b (diff) | |
parent | 687c27b07050c21a62c4c975777c89e698649a6b (diff) |
Merge branch 'heads/soc2' into boards2-base
Conflicts:
arch/arm/mach-shmobile/board-lager.c
Diffstat (limited to 'arch/arm/mach-shmobile/board-lager.c')
-rw-r--r-- | arch/arm/mach-shmobile/board-lager.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c index 59951340b55..32183a39354 100644 --- a/arch/arm/mach-shmobile/board-lager.c +++ b/arch/arm/mach-shmobile/board-lager.c @@ -30,6 +30,7 @@ #include <linux/platform_data/gpio-rcar.h> #include <linux/platform_data/rcar-du.h> #include <linux/platform_device.h> +#include <linux/phy.h> #include <linux/regulator/fixed.h> #include <linux/regulator/machine.h> #include <linux/sh_eth.h> @@ -223,6 +224,30 @@ static void __init lager_add_standard_devices(void) lager_add_du_device(); } +/* + * Ether LEDs on the Lager board are named LINK and ACTIVE which corresponds + * to non-default 01 setting of the Micrel KSZ8041 PHY control register 1 bits + * 14-15. We have to set them back to 01 from the default 00 value each time + * the PHY is reset. It's also important because the PHY's LED0 signal is + * connected to SoC's ETH_LINK signal and in the PHY's default mode it will + * bounce on and off after each packet, which we apparently want to avoid. + */ +static int lager_ksz8041_fixup(struct phy_device *phydev) +{ + u16 phyctrl1 = phy_read(phydev, 0x1e); + + phyctrl1 &= ~0xc000; + phyctrl1 |= 0x4000; + return phy_write(phydev, 0x1e, phyctrl1); +} + +static void __init lager_init(void) +{ + lager_add_standard_devices(); + + phy_register_fixup_for_id("r8a7790-ether-ff:01", lager_ksz8041_fixup); +} + static const char *lager_boards_compat_dt[] __initdata = { "renesas,lager", NULL, @@ -232,6 +257,6 @@ DT_MACHINE_START(LAGER_DT, "lager") .smp = smp_ops(r8a7790_smp_ops), .init_early = r8a7790_init_early, .init_time = rcar_gen2_timer_init, - .init_machine = lager_add_standard_devices, + .init_machine = lager_init, .dt_compat = lager_boards_compat_dt, MACHINE_END |