Hi,
I'm porting the MikroTik SXT Lite5 (SXT 5nD r2), which is already in ar71xx, to ath79. Everything works fine, except for the Ethernet.
Originally, in ar71xx, there was this (mach-rbsxtlite.c
):
static void __init rbsxtlite_setup(void)
{
[...]
ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_SW_ONLY_MODE);
ath79_register_mdio(1, 0x0);
/* GMAC0 is left unused */
/* GMAC1 is connected to MAC0 on the internal switch */
/* The ethernet port connects to PHY P0, which connects to MAC1
on the internal switch */
ath79_init_mac(ath79_eth1_data.mac_addr, ath79_mac_base, 0);
ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
ath79_register_eth(1);
}
which I've tried to translate into the DTS as:
ð1 {
status = "okay";
phy-handle = <&phy0>;
};
&mdio1 {
status = "okay";
phy0: ethernet-phy@0 {
reg = <0>;
};
};
resulting in a kernel panic but a functional eth0 interface:
[ 0.962127] libphy: Fixed MDIO Bus: probed
[ 0.967061] ag71xx 1a000000.eth: invalid MAC address, using random address
[ 1.288271] ------------[ cut here ]------------
[ 1.293148] WARNING: CPU: 0 PID: 1 at drivers/reset/core.c:419 __reset_control_get_internal+0x64/0x110
[ 1.302771] Modules linked in:
[ 1.305935] CPU: 0 PID: 1 Comm: swapper Not tainted 4.19.123 #0
[ 1.312059] Stack : 80620000 805d57fc 00000000 00000000 805d5014 8382597c 838282f4 80603b67
[ 1.320710] 80597ec0 00000001 80dc3670 000001a3 00000000 00000001 83825930 e9938325
[ 1.329357] 00000000 00000000 80df0000 0000005e 00000000 00000000 00000007 00000000
[ 1.338003] 0000005e e71a2829 00000000 0004ab0f 00000000 00000009 00000000 802eab64
[ 1.346656] 805bf804 000001a3 00000000 80620000 00000002 80300494 00000000 80dc0000
[ 1.355305] ...
[ 1.357831] Call Trace:
[ 1.360401] [<8006b0b4>] show_stack+0x58/0x100
[ 1.365037] [<80086240>] __warn+0xe4/0x13c
[ 1.369288] [<800862e0>] warn_slowpath_null+0x48/0x68
[ 1.374529] [<802eab64>] __reset_control_get_internal+0x64/0x110
[ 1.380758] [<802ead48>] __of_reset_control_get+0x138/0x1a0
[ 1.386536] [<802eb058>] __devm_reset_control_get+0x6c/0xc8
[ 1.392340] [<80375640>] ag71xx_mdio_probe+0x9c/0x1d4
[ 1.397597] [<80312b9c>] platform_drv_probe+0x40/0x88
[ 1.402832] [<80310f20>] really_probe+0x180/0x300
[ 1.407706] [<8030efd0>] bus_for_each_drv+0x50/0xb0
[ 1.412760] [<80310d20>] __device_attach+0x84/0xfc
[ 1.417724] [<80310004>] bus_probe_device+0x38/0xbc
[ 1.422776] [<8030c944>] device_add+0x420/0x634
[ 1.427498] [<80382f64>] of_platform_device_create_pdata+0xb4/0x100
[ 1.433991] [<8038313c>] of_platform_bus_create+0x180/0x248
[ 1.439769] [<80383380>] of_platform_populate+0x74/0xf0
[ 1.445195] [<80377e44>] ag71xx_probe+0x824/0x960
[ 1.450073] [<80312b9c>] platform_drv_probe+0x40/0x88
[ 1.455317] [<80310f20>] really_probe+0x180/0x300
[ 1.460194] [<80311464>] __driver_attach+0xb4/0xfc
[ 1.465157] [<8030ef14>] bus_for_each_dev+0x54/0xac
[ 1.470211] [<803102a4>] bus_add_driver+0xf4/0x214
[ 1.475175] [<80311c80>] driver_register+0xcc/0x11c
[ 1.480251] [<8063e2a4>] ag71xx_module_init+0x2c/0x50
[ 1.485488] [<8006096c>] do_one_initcall+0x7c/0x1a0
[ 1.490561] [<80628d54>] kernel_init_freeable+0x150/0x214
[ 1.496152] [<804e5658>] kernel_init+0x10/0xf0
[ 1.500759] [<800659f8>] ret_from_kernel_thread+0x14/0x1c
[ 1.506367] ---[ end trace b18eccab21fe21ee ]---
[ 1.511557] libphy: ag71xx_mdio: probed
[ 1.517116] libphy: ar8xxx-mdio: probed
[ 1.579716] switch0: Atheros AR8229 rev. 1 switch registered on mdio.0
[ 1.625681] mdio_bus mdio.0: MDIO device at address 0 is missing.
[ 1.657994] ag71xx 1a000000.eth: connected to PHY at fixed-0:00 [uid=00000000, driver=Generic PHY]
[ 1.668101] eth0: Atheros AG71xx at 0xba000000, irq 5, mode: gmii
Actually, eth0: Atheros AG71xx at 0xba000000, irq 5, mode: gmii
is the correct configuration, present in ar71xx.
I can't get rid of this kernel panic. I've tried many combinations, such as:
ð1 {
status = "okay";
phy-handle = <&swphy0>;
gmac-config {
device = <&gmac>;
switch-phy-swap = <1>;
switch-only-mode = <1>;
};
};
ð0 {
status = "disabled";
compatible = "syscon", "simple-mfd";
};
but I can't both have the interface working and get rid of the kernel panic.
Does anybody know what is the DTS equivalent for the ar71xx code?
Thanks!