Hello there.
I'm trying to configure switch on RB433GL board.
I've tried a lot of combinations, but nothing works fine.
I cant figure out what I'm doing wrong...
Any idea?
How to check what is connected to which pad without schematics?
mdio scan founds:
- two 004dd033 ( AR8216/AR8236/AR83160) on phy-id 1 and 4
- switch on phy-id 0
My code looks like this:
#define RB433GL_SWITCH_PHYMASK BIT(0)
#define RB433GL_LAN_PHYMASK BIT(1)
#define RB433GL_WAN_PHYMASK BIT(4)
#define RB433GL_MDIO_PHYMASK (RB433GL_SWITCH_PHYMASK |
RB433GL_LAN_PHYMASK | RB433GL_WAN_PHYMASK)
===== variant 1 ===========================
mdiobus_register_board_info(rb433gl_mdio_info,
ARRAY_SIZE(rb433gl_mdio_info));
ath79_register_mdio(0, ~RB433GL_MDIO_PHYMASK);
ath79_init_mac(ath79_eth0_data.mac_addr, ath79_mac_base, 0);
ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
ath79_eth0_data.phy_mask = RB433GL_WAN_PHYMASK;
ath79_register_eth(0);
ath79_init_mac(ath79_eth1_data.mac_addr, ath79_mac_base, 1);
ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
ath79_eth1_data.phy_mask = RB433GL_SWITCH_PHYMASK;
ath79_eth1_data.mii_bus_dev = &ath79_mdio0_device.dev;
ath79_register_eth(1);
console output:
[ 4.180000] mdiobus_register 0..32 mask ffffffec
[ 4.180000] ar8216_probe 0
[ 4.180000] ar8216_probe possible
[ 4.210000] ar8216: Atheros device [ver=18, rev=2]
[ 4.210000] ar8xxx_probe_switch name=Atheros AR8327 mib_ret=0
[ 4.220000] ar8216_probe found
[ 4.220000] ar8216_probe OK
[ 4.230000] ar8216_probe 1
[ 4.230000] ar8216_probe 4
[ 4.230000] libphy: ag71xx_mdio: probed
[ 4.240000] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode:RGMII
[ 4.540000] ag71xx ag71xx.0 eth0: connected to PHY at
ag71xx-mdio.0:04 [uid=0
04dd033, driver=Generic PHY]
[ 4.550000] eth1: Atheros AG71xx at 0xba000000, irq 5, mode:RGMII
[ 4.860000] ar8216_config_init priv=87809000
[ 4.860000] ar8216_config_init addr=0
[ 4.870000] ar8216_config_init ag71xx-mdio.0
[ 4.870000] switch0: Atheros AR8327 switch registered on ag71xx-mdio.0
[ 6.020000] ag71xx ag71xx.1 eth1: connected to PHY at
ag71xx-mdio.0:00 [uid=0
04dd033, driver=Atheros AR8216/AR8236/AR8316]
result:
both eth0 and eth1 does not work,
======================== variant 2
ath79_register_mdio(0, ~RB433GL_MDIO_PHYMASK);
ath79_init_mac(ath79_eth0_data.mac_addr, ath79_mac_base, 0);
ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
ath79_eth0_data.phy_mask = RB433GL_WAN_PHYMASK;
ath79_register_eth(0);
ath79_init_mac(ath79_eth1_data.mac_addr, ath79_mac_base, 1);
ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
ath79_eth1_data.mii_bus_dev = &ath79_mdio0_device.dev;
ath79_eth1_data.speed = SPEED_1000;
ath79_eth1_data.duplex = DUPLEX_FULL;
ath79_register_eth(1);
console output:
[ 4.180000] mdiobus_register 0..32 mask ffffffec
[ 4.180000] ar8216_probe 0
[ 4.190000] ar8216_probe possible
[ 4.210000] ar8216: Atheros device [ver=18, rev=2]
[ 4.220000] ar8xxx_probe_switch name=Atheros AR8327 mib_ret=0
[ 4.220000] ar8216_probe found
[ 4.220000] ar8216_probe OK
[ 4.230000] ar8216_probe 1
[ 4.230000] ar8216_probe 4
[ 4.230000] libphy: ag71xx_mdio: probed
[ 4.240000] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode:RGMII
[ 4.550000] ag71xx ag71xx.0 eth0: connected to PHY at
ag71xx-mdio.0:04 [uid=0
04dd033, driver=Generic PHY]
[ 4.560000] eth1: Atheros AG71xx at 0xba000000, irq 5, mode:RGMII
result:
eth0 works fine, eth1 is not functional
================== variant 3
ath79_init_mac(ath79_eth0_data.mac_addr, ath79_mac_base, 0);
ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
ath79_eth0_data.phy_mask = RB433GL_WAN_PHYMASK;
ath79_register_eth(0);
ath79_init_mac(ath79_eth1_data.mac_addr, ath79_mac_base, 1);
ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
ath79_eth1_data.phy_mask = RB433GL_LAN_PHYMASK;
ath79_eth1_data.mii_bus_dev = &ath79_mdio0_device.dev;
ath79_eth1_data.speed = SPEED_1000;
ath79_eth1_data.duplex = DUPLEX_FULL;
ath79_register_eth(1);
[ 4.180000] mdiobus_register 0..32 mask ffffffec
[ 4.180000] ar8216_probe 0
[ 4.190000] ar8216_probe possible
[ 4.210000] ar8216: Atheros device [ver=18, rev=2]
[ 4.220000] ar8xxx_probe_switch name=Atheros AR8327 mib_ret=0
[ 4.220000] ar8216_probe found
[ 4.230000] ar8216_probe OK
[ 4.230000] ar8216_probe 1
[ 4.230000] ar8216_probe 4
[ 4.240000] libphy: ag71xx_mdio: probed
[ 4.240000] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode:RGMII
[ 4.550000] ag71xx ag71xx.0 eth0: connected to PHY at
ag71xx-mdio.0:04 [uid=0
04dd033, driver=Generic PHY]
[ 4.560000] eth1: Atheros AG71xx at 0xba000000, irq 5, mode:RGMII
[ 4.860000] ag71xx ag71xx.1 eth1: connected to PHY at
ag71xx-mdio.0:01 [uid=0
04dd033, driver=Generic PHY]
eth0 still works fine
eth1 can detect link change on second port,
but all the data are lost somewhere deep in the qualcomm side of the wall
================================================
in all cases i can't connect to switch with swconfig
================================================
and some more configurations to be guessed:
static struct ar8327_pad_cfg rb433gl_ar8327_pad0_cfg = {
.mode = AR8327_PAD_MAC_RGMII,
.txclk_delay_en = true,
.rxclk_delay_en = true,
.txclk_delay_sel = AR8327_CLK_DELAY_SEL1,
.rxclk_delay_sel = AR8327_CLK_DELAY_SEL2,
};
static struct ar8327_pad_cfg rb433gl_ar8327_pad6_cfg = {
.mode = AR8327_PAD_MAC_RGMII,
.txclk_delay_en = true,
.rxclk_delay_en = true,
.txclk_delay_sel = AR8327_CLK_DELAY_SEL1,
.rxclk_delay_sel = AR8327_CLK_DELAY_SEL2,
};
static struct ar8327_platform_data rb433gl_ar8327_data = {
.pad0_cfg = &rb433gl_ar8327_pad0_cfg,
.pad6_cfg = &rb433gl_ar8327_pad6_cfg,
.port0_cfg = {
.force_link = 1,
.speed = AR8327_PORT_SPEED_1000,
.duplex = 1,
.txpause = 1,
.rxpause = 1,
},
.port6_cfg = {
.force_link = 1,
.speed = AR8327_PORT_SPEED_1000,
.duplex = 1,
.txpause = 1,
.rxpause = 1,
}
};
static struct mdio_board_info rb433gl_mdio_info[] = {
{
.bus_id = "ag71xx-mdio.0",
.phy_addr = 0,
.platform_data = &rb433gl_ar8327_data,
},
};
================================================
best regards
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel