diff options
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 ffb6f0ac7606..5930af8d434f 100644 --- a/arch/arm/mach-shmobile/board-lager.c +++ b/arch/arm/mach-shmobile/board-lager.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/pinctrl/machine.h> | 29 | #include <linux/pinctrl/machine.h> |
30 | #include <linux/platform_data/gpio-rcar.h> | 30 | #include <linux/platform_data/gpio-rcar.h> |
31 | #include <linux/platform_device.h> | 31 | #include <linux/platform_device.h> |
32 | #include <linux/phy.h> | ||
32 | #include <linux/regulator/fixed.h> | 33 | #include <linux/regulator/fixed.h> |
33 | #include <linux/regulator/machine.h> | 34 | #include <linux/regulator/machine.h> |
34 | #include <linux/sh_eth.h> | 35 | #include <linux/sh_eth.h> |
@@ -155,6 +156,30 @@ static void __init lager_add_standard_devices(void) | |||
155 | ðer_pdata, sizeof(ether_pdata)); | 156 | ðer_pdata, sizeof(ether_pdata)); |
156 | } | 157 | } |
157 | 158 | ||
159 | /* | ||
160 | * Ether LEDs on the Lager board are named LINK and ACTIVE which corresponds | ||
161 | * to non-default 01 setting of the Micrel KSZ8041 PHY control register 1 bits | ||
162 | * 14-15. We have to set them back to 01 from the default 00 value each time | ||
163 | * the PHY is reset. It's also important because the PHY's LED0 signal is | ||
164 | * connected to SoC's ETH_LINK signal and in the PHY's default mode it will | ||
165 | * bounce on and off after each packet, which we apparently want to avoid. | ||
166 | */ | ||
167 | static int lager_ksz8041_fixup(struct phy_device *phydev) | ||
168 | { | ||
169 | u16 phyctrl1 = phy_read(phydev, 0x1e); | ||
170 | |||
171 | phyctrl1 &= ~0xc000; | ||
172 | phyctrl1 |= 0x4000; | ||
173 | return phy_write(phydev, 0x1e, phyctrl1); | ||
174 | } | ||
175 | |||
176 | static void __init lager_init(void) | ||
177 | { | ||
178 | lager_add_standard_devices(); | ||
179 | |||
180 | phy_register_fixup_for_id("r8a7790-ether-ff:01", lager_ksz8041_fixup); | ||
181 | } | ||
182 | |||
158 | static const char *lager_boards_compat_dt[] __initdata = { | 183 | static const char *lager_boards_compat_dt[] __initdata = { |
159 | "renesas,lager", | 184 | "renesas,lager", |
160 | NULL, | 185 | NULL, |
@@ -163,6 +188,6 @@ static const char *lager_boards_compat_dt[] __initdata = { | |||
163 | DT_MACHINE_START(LAGER_DT, "lager") | 188 | DT_MACHINE_START(LAGER_DT, "lager") |
164 | .init_early = r8a7790_init_delay, | 189 | .init_early = r8a7790_init_delay, |
165 | .init_time = r8a7790_timer_init, | 190 | .init_time = r8a7790_timer_init, |
166 | .init_machine = lager_add_standard_devices, | 191 | .init_machine = lager_init, |
167 | .dt_compat = lager_boards_compat_dt, | 192 | .dt_compat = lager_boards_compat_dt, |
168 | MACHINE_END | 193 | MACHINE_END |