This magic is from original driver. Maybe ramips_esw can be rewritten
to support swconfig but this will do the job for now.
Tested with Belkin F5D8235 v2 board.

Signed-off-by: Roman Yeryomin <ro...@advem.lv>
--

Index: target/linux/ramips/files/drivers/net/ramips_esw.c
===================================================================
--- a/target/linux/ramips/files/drivers/net/ramips_esw.c        (revision 22047)
+++ b/target/linux/ramips/files/drivers/net/ramips_esw.c        (working copy)
@@ -109,6 +109,17 @@
        mii_mgr_write(0, 14, 0x65);     //longer TP_IDL tail length
        mii_mgr_write(0, 31, 0x8000);   //select local register

+
+#if defined(CONFIG_RT305X_MACH_F5D8235_V2) && defined(CONFIG_RTL8366RB_PHY)
+       /* enable external switch, 1Gbps, full duplex, vlan support */
+       rt305x_sysc_wr(rt305x_sysc_rr(0x60) & ~(1 << 9), 0x60);
+       ramips_esw_wr(ramips_esw_rr(0xc8) & ~(1 << 29), 0xc8);
+       ramips_esw_wr(ramips_esw_rr(0xc8) | 0x3fff, 0xc8);
+       ramips_esw_wr(ramips_esw_rr(0xc8) & ~(0xf << 20), 0xc8);
+       ramips_esw_wr(0x00605555, 0x14);
+       ramips_esw_wr(0x00007f7f, 0x98);
+       ramips_esw_wr(0x00000060, 0xe4);
+#else
        /* Port 5 Disabled */
        rt305x_sysc_wr(rt305x_sysc_rr(0x60) | (1 << 9), 0x60); //set RGMII
to GPIO mode (GPIO41-GPIO50)
        rt305x_sysc_wr(0xfff, 0x674); //GPIO41-GPIO50 output mode
@@ -117,6 +128,7 @@
        /* set default vlan */
        ramips_esw_wr(0x2001, 0x50);
        ramips_esw_wr(0x504f, 0x70);
+#endif

        return 0;
 }
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to