I'm trying to get OpenWrt to work on ZTE H218N.
I've found ethernet ports not work on latest release but work well on an old one.
Here comes serial boot log.
Failed on OpenWrt 18.06.1:
[ 0.928598] 3 bcm47xxpart partitions found on MTD device bcm47xxsflash
[ 0.935239] Creating 3 MTD partitions on "bcm47xxsflash":
[ 0.940783] 0x000000000000-0x000000020000 : "boot"
[ 0.950200] 0x000000020000-0x000000ff0000 : "firmware"
[ 0.956629] 3 trx partitions found on MTD device firmware
[ 0.962123] Creating 3 MTD partitions on "firmware":
[ 0.967240] 0x00000000001c-0x000000000948 : "loader"
[ 0.975787] 0x000000000948-0x00000016b800 : "linux"
[ 0.982627] 0x00000016b800-0x000000fd0000 : "rootfs"
[ 0.988829] mtd: device 4 (rootfs) set to be root filesystem
[ 0.994638] 1 squashfs-split partitions found on MTD device rootfs
[ 1.000991] 0x000000340000-0x000000fd0000 : "rootfs_data"
[ 1.010413] 0x000000ff0000-0x000001000000 : "nvram"
[ 0.979356] libphy: Fixed MDIO Bus: probed
[ 0.983755] bgmac_bcma bcma0:2: Found PHY addr: 30 (NOREGS)
[ 0.991723] libphy: bcma_mdio mii bus: probed
[ 0.996173] bgmac_bcma bcma0:2: Support for Roboswitch not implemented
[ 1.100116] b53_common: unsupported switch detected (BCM5304/BCM4)
[ 1.106420] Broadcom B53 (2) bcma_mdio-0-0:1e: failed to register switch: -22
[ 1.113718] bgmac_bcma bcma0:2: PHY connection failed
[ 1.118852] bgmac_bcma bcma0:2: Cannot connect to phy
[ 1.124336] bgmac_bcma: probe of bcma0:2 failed with error -22
[ 1.130418] bgmac_bcma: Broadcom 47xx GBit MAC driver loaded
[ 1.136483] bcm47xx-wdt bcm47xx-wdt.0: BCM47xx Watchdog Timer enabled (30 seconds)
Work well with LEDE 17.01.5
[ 0.791464] 6 bcm47xxpart partitions found on MTD device bcm47xxsflash
[ 0.798106] Creating 6 MTD partitions on "bcm47xxsflash":
[ 0.803643] 0x000000000000-0x000000020000 : "boot"
[ 0.811727] 0x000000020000-0x000000ff0000 : "firmware"
[ 0.819195] 0x000000ff0000-0x000001000000 : "nvram"
[ 0.826457] 0x00000002001c-0x000000020924 : "loader"
[ 0.833845] 0x000000020924-0x000000147c00 : "linux"
[ 0.841215] 0x000000147c00-0x000000ff0000 : "rootfs"
[ 0.848525] mtd: device 5 (rootfs) set to be root filesystem
[ 0.854401] 1 squashfs-split partitions found on MTD device rootfs
[ 0.860730] 0x000000300000-0x000000ff0000 : "rootfs_data"
[ 0.870991] libphy: Fixed MDIO Bus: probed
[ 0.875320] bgmac_bcma bcma0:2: Found PHY addr: 30 (NOREGS)
[ 0.883798] libphy: bcma_mdio mii bus: probed
[ 0.888250] bgmac_bcma bcma0:2: Support for Roboswitch not implemented
[ 0.974910] b53_common: found switch: BCM5325, rev 4
[ 0.981009] bgmac_bcma: Broadcom 47xx GBit MAC driver loaded
[ 0.987139] bcm47xx-wdt bcm47xx-wdt.0: BCM47xx Watchdog Timer enabled (30 seconds)
I guess it is NOT due to commit 5df15c06ccd105a19431bc32bd1d158b3ff3325e, after revert it and test again.
I found a strange log after add some code to print result of b53_read8 called in b53_switch_detect.
It print twice, but in read result of b53_read8 is different.
- 18.06.1
log
[ 1.035530] libphy: Fixed MDIO Bus: probed
[ 1.039858] bgmac_bcma bcma0:2: Found PHY addr: 30 (NOREGS)
[ 1.047319] b53_common: b53_common.c:1638:b53_switch_detect: b53_read8 ret=0, id8=0
[ 1.055640] b53_mdio.c:290:b53_phy_probe: call b53_switch_detect, ret=0
[ 1.062460] libphy: bcma_mdio mii bus: probed
[ 1.066902] bgmac_bcma bcma0:2: Support for Roboswitch not implemented
[ 1.170013] b53_common: b53_common.c:1709:b53_switch_register: call b53_switch_detect, dev->chip_id=0
[ 1.179558] b53_common: b53_common.c:1638:b53_switch_detect: b53_read8 ret=0, id8=4
[ 1.187549] b53_common: b53_common.c:1668:b53_switch_detect: b53_read8 ret=0, id32=4
[ 1.195439] b53_common: unsupported switch detected (BCM5304/BCM4)
[ 1.201753] Broadcom B53 (2) bcma_mdio-0-0:1e: failed to register switch: -22
[ 1.209004] bgmac_bcma bcma0:2: PHY connection failed
[ 1.214177] bgmac_bcma bcma0:2: Cannot connect to phy
[ 1.219628] bgmac_bcma: probe of bcma0:2 failed with error -22
[ 1.225704] bgmac_bcma: Broadcom 47xx GBit MAC driver loaded
code
diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
index 670588c84e..d78157f05e 100644
--- a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
+++ b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
@@ -1635,6 +1635,7 @@ int b53_switch_detect(struct b53_device *dev)
int ret;
ret = b53_read8(dev, B53_MGMT_PAGE, B53_DEVICE_ID, &id8);
+ pr_info("%s:%d:%s: " "b53_read8 ret=%i, id8=%d\n", __FILENAME__, __LINE__, __func__, ret, id8);
if (ret)
return ret;
@@ -1664,6 +1665,7 @@ int b53_switch_detect(struct b53_device *dev)
break;
default:
ret = b53_read32(dev, B53_MGMT_PAGE, B53_DEVICE_ID, &id32);
+ pr_info("%s:%d:%s: " "b53_read8 ret=%i, id32=%d\n", __FILENAME__, __LINE__, __func__, ret, id32);
if (ret)
return ret;
@@ -1704,6 +1706,7 @@ int b53_switch_register(struct b53_device *dev)
dev->sw_dev.alias = dev->pdata->alias;
}
+ pr_info("%s:%d:%s: " "call b53_switch_detect, dev->chip_id=%x\n", __FILENAME__, __LINE__, __func__, dev->chip_id);
if (!dev->chip_id && b53_switch_detect(dev))
return -EINVAL;
diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c b/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c
index 75bb4d941c..6028e4b81b 100644
--- a/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c
+++ b/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c
@@ -287,6 +287,7 @@ static int b53_phy_probe(struct phy_device *phydev)
mutex_init(&dev.reg_mutex);
ret = b53_switch_detect(&dev);
+ pr_info("%s:%d:%s: " "call b53_switch_detect, ret=%d\n", __FILENAME__, __LINE__, __func__, ret);
if (ret)
return ret;
- 17.01.5
log
[ 0.820000] bgmac bcma0:2: Found PHY addr: 30 (NOREGS)
[ 0.830000] bgmac bcma0:2: Support for Roboswitch not implemented
[ 0.840000] b53_common: b53_common.c:1373:b53_switch_detect: b53_read8 ret=0, id8=0
[ 0.850000] b53_mdio.c:270:b53_phy_probe: call b53_switch_detect, ret=0
[ 0.860000] libphy: bgmac mii bus: probed
[ 0.940000] b53_common: b53_common.c:1444:b53_switch_register: call b53_switch_detect, dev->chip_id=0
[ 0.940000] b53_common: b53_common.c:1373:b53_switch_detect: b53_read8 ret=0, id8=0
[ 0.960000] b53_common: found switch: BCM5325, rev 4
[ 0.960000] bgmac: Broadcom 47xx GBit MAC driver loaded
code
diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
old mode 100644
new mode 100755
index 859d8d1bdc..62d3bc0620
--- a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
+++ b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
@@ -1370,6 +1370,7 @@ int b53_switch_detect(struct b53_device *dev)
int ret;
ret = b53_read8(dev, B53_MGMT_PAGE, B53_DEVICE_ID, &id8);
+ pr_info("%s:%d:%s: " "b53_read8 ret=%i, id8=%d\n", __FILENAME__, __LINE__, __func__, ret, id8);
if (ret)
return ret;
@@ -1399,6 +1400,7 @@ int b53_switch_detect(struct b53_device *dev)
break;
default:
ret = b53_read32(dev, B53_MGMT_PAGE, B53_DEVICE_ID, &id32);
+ pr_info("%s:%d:%s: " "b53_read8 ret=%i, id32=%d\n", __FILENAME__, __LINE__, __func__, ret, id32);
if (ret)
return ret;
@@ -1439,6 +1441,7 @@ int b53_switch_register(struct b53_device *dev)
dev->sw_dev.alias = dev->pdata->alias;
}
+ pr_info("%s:%d:%s: " "call b53_switch_detect, dev->chip_id=%x\n", __FILENAME__, __LINE__, __func__, dev->chip_id);
if (!dev->chip_id && b53_switch_detect(dev))
return -EINVAL;
diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c b/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c
old mode 100644
new mode 100755
index 3c25f0ea2b..44d2dac66a
--- a/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c
+++ b/target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c
@@ -267,6 +267,7 @@ static int b53_phy_probe(struct phy_device *phydev)
mutex_init(&dev.reg_mutex);
ret = b53_switch_detect(&dev);
+ pr_info("%s:%d:%s: " "call b53_switch_detect, ret=%d\n", __FILENAME__, __LINE__, __func__, ret);
if (ret)
return ret;