qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH-for-9.1 v2 04/11] hw/net/lan9118: Replace magic '5' value by TX_F


From: Philippe Mathieu-Daudé
Subject: [PATCH-for-9.1 v2 04/11] hw/net/lan9118: Replace magic '5' value by TX_FIF_SZ_RESET definition
Date: Tue, 9 Apr 2024 15:37:53 +0200

TX_FIF_SZ is described in chapter 5.3.9,
"HW_CFG — HARDWARE CONFIGURATION REGISTER".

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/net/lan9118.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/net/lan9118.c b/hw/net/lan9118.c
index d6f0e37eb1..a6a869de32 100644
--- a/hw/net/lan9118.c
+++ b/hw/net/lan9118.c
@@ -71,6 +71,8 @@ do { printf("lan9118: " fmt , ## __VA_ARGS__); } while (0)
 #define CSR_E2P_CMD     0xb0
 #define CSR_E2P_DATA    0xb4
 
+#define TX_FIF_SZ_RESET 5
+
 #define E2P_CMD_MAC_ADDR_LOADED 0x100
 
 /* IRQ_CFG */
@@ -435,7 +437,7 @@ static void lan9118_reset(DeviceState *d)
     s->fifo_int = 0x48000000;
     s->rx_cfg = 0;
     s->tx_cfg = 0;
-    s->hw_cfg = s->mode_16bit ? 0x00050000 : 0x00050004;
+    s->hw_cfg = (TX_FIF_SZ_RESET << 16) | (s->mode_16bit << 2);
     s->pmt_ctrl &= 0x45;
     s->gpio_cfg = 0;
     s->txp->state = TX_IDLE;
-- 
2.41.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]