Skip to content

Commit

Permalink
hw/net: cadence_gem: Fix MDIO_OP_xxx values
Browse files Browse the repository at this point in the history
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.

Fixes: 1b09eeb ("hw/net/cadence_gem: use FIELD to describe PHYMNTNC register fields")
Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
  • Loading branch information
lbmeng authored and Michael Tokarev committed Jan 5, 2024
1 parent 09a3615 commit 0c7ffc9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hw/net/cadence_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 0c7ffc9

Please sign in to comment.