hw/net: cadence_gem: Fix MDIO_OP_xxx values
PATCH 1/1 hw/net: cadence_gem: Fix MDIO_OP_xxx values
Testing upstream U-Boot with 'sifive_u' machine we see:
=> dhcp
ethernet@10090000: PHY present at 0
Could not get PHY for ethernet@10090000: addr 0
phy_connect failed
This has been working till QEMU 8.1 but broken since QEMU 8.2.
---
hw/net/cadence_gem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
hw/net/cadence_gem.c +2 -2
@@ -199,8 +199,8 @@ REG32(PHYMNTNC, 0x34) /* Phy Maintenance reg */ FIELD(PHYMNTNC, PHY_ADDR, 23, 5) FIELD(PHYMNTNC, OP, 28, 2) FIELD(PHYMNTNC, ST, 30, 2) -#define MDIO_OP_READ 0x3 -#define MDIO_OP_WRITE 0x2 +#define MDIO_OP_READ 0x2 +#define MDIO_OP_WRITE 0x1 REG32(RXPAUSE, 0x38) /* RX Pause Time reg */REG32 (TXPAUSE ,0x3c )/* TX Pause Time reg */
Signature · 1 line
2.34.1
Quoted 8 lines · Bin Meng
Testing upstream U-Boot with '
sifive_u' machine we see:=> dhcp ethernet@10090000: PHY present at 0 Could not get PHY for ethernet@10090000: addr 0 phy_connect failedThis has been working till QEMU 8.1 but broken since QEMU 8.2.
s/till/until/?
Quoted 14 lines
Fixes 1b09eeb122aa ("hw/net/cadence_gem: use FIELD to describe PHYMNTNC register fields")Reported-by Heinrich Schuchardt <[email protected]>Signed-off-by Bin Meng <[email protected]>---
hw/net/cadence_gem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)hw/net/cadence_gem.c +0
-0
hw/net/cadence_gem.c REG32(PHYMNTNC, 0x34) /* Phy Maintenance reg */ · line 206
Quoted 10 lines
hw/net/cadence_gem.c +2
-2@@ -199,8 +199,8 @@ REG32(PHYMNTNC, 0x34) /* Phy Maintenance reg */ FIELD(PHYMNTNC, PHY_ADDR, 23, 5) FIELD(PHYMNTNC, OP, 28, 2) FIELD(PHYMNTNC, ST, 30, 2) -#define MDIO_OP_READ 0x3 -#define MDIO_OP_WRITE 0x2 +#define MDIO_OP_READ 0x2 +#define MDIO_OP_WRITE 0x1 REG32(RXPAUSE, 0x38) /* RX Pause Time reg */REG32 (TXPAUSE ,0x3c )/* TX Pause Time reg */
Heinrich Schuchardt
Tested-byQuoted 11 lines · Philippe Mathieu-Daudé
Quoted 8 lines · Bin Meng
Testing upstream U-Boot with '
sifive_u' machine we see:=> dhcp
ethernet@10090000: PHY present at 0 Could not get PHY for ethernet@10090000: addr 0phy_connectfailedThis has been working till QEMU 8.1 but broken since QEMU 8.2.
s/till/until/?
These are synonyms. Till is more informal. No need to change.
Quoted 11 lines
Quoted 11 lines
Fixes 1b09eeb122aa ("hw/net/cadence_gem: use FIELD to describePHYMNTNC register fields")
Reported-by Heinrich Schuchardt <[email protected]>Signed-off-by Bin Meng <[email protected]>---
hw/net/cadence_gem.c| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 17 lines
Quoted 12 lines
hw/net/cadence_gem.c +2
-2@@ -199,8 +199,8 @@ REG32(PHYMNTNC, 0x34) /* Phy Maintenance reg */ FIELD(PHYMNTNC, PHY_ADDR, 23, 5) FIELD(PHYMNTNC, OP, 28, 2) FIELD(PHYMNTNC, ST, 30, 2) -#define MDIO_OP_READ 0x3 -#define MDIO_OP_WRITE 0x2 +#define MDIO_OP_READ 0x2 +#define MDIO_OP_WRITE 0x1Quoted 2 lines
REG32(RXPAUSE, 0x38)/* RX Pause Time reg */
REG32(TXPAUSE, 0x3c)/* TX Pause Time reg */Reviewed-by Philippe Mathieu-Daudé <[email protected]>
Thank you Bin for the fix.
With the fix I was able to download a file via TFTP to U-Boot sifive_unleashed_defconfig on the emulated board. Cf. docs/system/riscv/sifive_u.rst.
Quoted 9 lines · Heinrich Schuchardt
Quoted 8 lines · Philippe Mathieu-Daudé
Quoted 7 lines · Bin Meng
Testing upstream U-Boot with '
sifive_u' machine we see:=> dhcp
ethernet@10090000: PHY present at 0 Could not get PHY for ethernet@10090000: addr 0phy_connectfailed
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
This has been working till QEMU 8.1 but broken since QEMU 8.2.
s/till/until/?
These are synonyms. Till is more informal. No need to change.
Not obvious for non-native/fluent informal English speakers.
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Fixes 1b09eeb122aa ("hw/net/cadence_gem: use FIELD to describePHYMNTNC register fields")
Reported-by Heinrich Schuchardt <[email protected]>Signed-off-by Bin Meng <[email protected]>---
hw/net/cadence_gem.c| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)
Michael Tokarev
Applied02.01.2024 17:18, Bin Meng:
Quoted 7 lines
Testing upstream U-Boot with '
sifive_u' machine we see:=> dhcp ethernet@10090000: PHY present at 0 Could not get PHY for ethernet@10090000: addr 0 phy_connect failed
Quoted 5 lines
This has been working till QEMU 8.1 but broken since QEMU 8.2.
Fixes 1b09eeb122aa ("hw/net/cadence_gem: use FIELD to describe PHYMNTNC register fields")Reported-by Heinrich Schuchardt <[email protected]>Signed-off-by Bin Meng <[email protected]>
Applied to trivial-patches tree, and marked to be picked up for stable.
Thanks,
/mjt