Hi, I have been trying to deploy OpenWrt for RB493GAH (AR7161 + 2x AR8316, 9xEth). I compiled latest trunk (r25819) with modified some files:
$ svn diff
Index: target/linux/ar71xx/files/arch/mips/ar71xx/mach-rb4xx.c
===================================================================
--- target/linux/ar71xx/files/arch/mips/ar71xx/mach-rb4xx.c (revision 25819)
+++ target/linux/ar71xx/files/arch/mips/ar71xx/mach-rb4xx.c (working copy)
@@ -341,3 +341,30 @@
MIPS_MACHINE(AR71XX_MACH_RB_493, "493", "MikroTik RouterBOARD 493/AH",
rb493_setup);
+
+static void __init rb493g_setup(void)
+{
+ rb4xx_generic_setup();
+
+ spi_register_board_info(rb4xx_microsd_info,
+ ARRAY_SIZE(rb4xx_microsd_info));
+
+
+ ar71xx_add_device_mdio(0x3fffffe0);
+
+ ar71xx_init_mac(ar71xx_eth0_data.mac_addr, ar71xx_mac_base, 1);
+ ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
+ ar71xx_eth0_data.phy_mask = BIT(0);
+
+ ar71xx_init_mac(ar71xx_eth1_data.mac_addr, ar71xx_mac_base, 0);
+ ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
+ ar71xx_eth1_data.phy_mask = BIT(4);
+
+ ar71xx_add_device_eth(1);
+ ar71xx_add_device_eth(0);
+
+ ar71xx_pci_init(ARRAY_SIZE(rb4xx_pci_irqs), rb4xx_pci_irqs);
+}
+
+MIPS_MACHINE(AR71XX_MACH_RB_493G, "493G", "MikroTik RouterBOARD 493G/AH",
+ rb493g_setup);
Index: target/linux/ar71xx/files/arch/mips/ar71xx/machtype.h
===================================================================
--- target/linux/ar71xx/files/arch/mips/ar71xx/machtype.h (revision 25819)
+++ target/linux/ar71xx/files/arch/mips/ar71xx/machtype.h (working copy)
@@ -31,6 +31,7 @@
AR71XX_MACH_RB_450, /* MikroTik RouterBOARD 450 */
AR71XX_MACH_RB_450G, /* MikroTik RouterBOARD 450G */
AR71XX_MACH_RB_493, /* Mikrotik RouterBOARD 493/493AH */
+ AR71XX_MACH_RB_493G, /* Mikrotik RouterBOARD 493G/493GAH */
AR71XX_MACH_RB_750, /* MikroTik RouterBOARD 750 */
AR71XX_MACH_PB42, /* Atheros PB42 */
AR71XX_MACH_PB44, /* Atheros PB44 */
How values can be used in ar71xx_eth?_data.phy_mask, ar71xx_add_device_mdio?
When I boot from network the switch driver is attached only on eth1 and this device work well. Device eth0 dosn't work:-(
root@OpenWrt:/# dmesg
...
ag71xx_mdio: probed
eth0: Atheros AG71xx at 0xba000000, irq 5
eth0: connected to PHY at ag71xx-mdio:04 [uid=004dd041, driver=Atheros AR8216/AR8316]
eth1: Atheros AG71xx at 0xb9000000, irq 4
eth1: AR8316 switch driver attached.
eth1: connected to PHY at ag71xx-mdio:00 [uid=004dd041, driver=Atheros AR8216/AR8316]
...
Do you have any idea?