From: John Crispin Date: Thu, 7 Aug 2014 16:55:57 +0000 (+0200) Subject: MIPS: lantiq: reboot gphy on restart X-Git-Tag: v3.19-rc1~115^2~83 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=50128fe8164ba2c9e36bc5156eabdfd69225b7d2;p=karo-tx-linux.git MIPS: lantiq: reboot gphy on restart A reboot sometimes lead to a none working phy. An explicit reboot fixes the problem. Signed-off-by: John Crispin Patchwork: http://patchwork.linux-mips.org/patch/8044/ Signed-off-by: Ralf Baechle --- diff --git a/arch/mips/lantiq/xway/reset.c b/arch/mips/lantiq/xway/reset.c index a1e06b78e15a..fe68f9ae47c1 100644 --- a/arch/mips/lantiq/xway/reset.c +++ b/arch/mips/lantiq/xway/reset.c @@ -176,8 +176,15 @@ void ltq_rst_init(void) static void ltq_machine_restart(char *command) { + u32 val = ltq_rcu_r32(RCU_RST_REQ); + + if (of_device_is_compatible(ltq_rcu_np, "lantiq,rcu-xrx200")) + val |= RCU_RD_GPHY1_XRX200 | RCU_RD_GPHY0_XRX200; + + val |= RCU_RD_SRST; + local_irq_disable(); - ltq_rcu_w32(ltq_rcu_r32(RCU_RST_REQ) | RCU_RD_SRST, RCU_RST_REQ); + ltq_rcu_w32(val, RCU_RST_REQ); unreachable(); }