Skip to content

Commit 17a2c6d

Browse files
michalsieronmbolivar-nordic
authored andcommitted
drivers: ethernet: eth_liteeth: Update driver
Correct width when accessing LITEETH_RX_LENGTH register. Also update register data in device tree to the 32-bit CSR variant. Signed-off-by: Michal Sieron <[email protected]>
1 parent e088d05 commit 17a2c6d

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

drivers/ethernet/eth_liteeth.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ static void eth_rx(const struct device *port)
129129
key = irq_lock();
130130

131131
/* get frame's length */
132-
len = litex_read32(LITEETH_RX_LENGTH_ADDR);
132+
len = litex_read16(LITEETH_RX_LENGTH_ADDR);
133133

134134
/* which slot is the frame in */
135135
context->rxslot = litex_read8(LITEETH_RX_SLOT_ADDR);

dts/riscv/riscv32-litex-vexriscv.dtsi

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,26 +117,35 @@
117117
interrupt-parent = <&intc0>;
118118
interrupts = <3 0>;
119119
reg = <0xe0009800 0x4
120-
0xe0009804 0x8
120+
0xe0009804 0x4
121+
0xe0009808 0x4
122+
0xe000980c 0x4
123+
0xe0009810 0x4
124+
0xe0009814 0x4
125+
0xe0009818 0x4
126+
0xe000981c 0x4
127+
0xe0009820 0x4
128+
0xe0009824 0x4
121129
0xe0009828 0x4
122130
0xe000982c 0x4
123131
0xe0009830 0x4
124132
0xe0009834 0x4
125-
0xe000983c 0x4
126-
0xe0009840 0x8
127-
0xe000984c 0x4
128133
0xb0000000 0x2000>;
129134
local-mac-address = [10 e2 d5 00 00 02];
130-
reg-names =
131-
"rx_slot",
135+
reg-names = "rx_slot",
132136
"rx_length",
137+
"rx_errors",
138+
"rx_ev_status",
133139
"rx_ev_pending",
134140
"rx_ev_enable",
135141
"tx_start",
136142
"tx_ready",
143+
"tx_level",
137144
"tx_slot",
138145
"tx_length",
146+
"tx_ev_status",
139147
"tx_ev_pending",
148+
"tx_ev_enable",
140149
"buffers";
141150
label = "eth0";
142151
status = "disabled";

0 commit comments

Comments
 (0)