mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-08-30 14:52:51 +08:00
Introduce identified RX/TX control register names
This commit is contained in:
@@ -63,6 +63,8 @@
|
|||||||
/*
|
/*
|
||||||
* NIC Related registers
|
* NIC Related registers
|
||||||
*/
|
*/
|
||||||
|
#define RTL837X_REG_RX_CTRL 0x785c
|
||||||
|
#define RTL837X_REG_TX_CTRL 0x7860
|
||||||
#define RTL837X_REG_RX_AVAIL 0x7874
|
#define RTL837X_REG_RX_AVAIL 0x7874
|
||||||
#define RTL837X_REG_RX_RINGPTR 0x787c
|
#define RTL837X_REG_RX_RINGPTR 0x787c
|
||||||
#define RTL837X_REG_RX_DONE 0x784c
|
#define RTL837X_REG_RX_DONE 0x784c
|
||||||
|
|||||||
+10
-11
@@ -1124,22 +1124,21 @@ void nic_setup(void)
|
|||||||
// R7844-000007fe
|
// R7844-000007fe
|
||||||
REG_SET(0x7844, 0x7fe);
|
REG_SET(0x7844, 0x7fe);
|
||||||
|
|
||||||
// r785c:0401201e R785c-0401201e r785c:0401201e R785c-0400201e
|
// Configure NIC RX to receive various types of packets
|
||||||
// 0x785c: Set bits 24-31 to 0x4, clear bits 16/17:
|
// RTL837X_REG_RX_CTRL: Set bits 24-31 to 0x4, clear bits 16/17
|
||||||
reg_read_m(0x785c);
|
reg_read_m(RTL837X_REG_RX_CTRL);
|
||||||
sfr_mask_data(3, 0xff, 0x04);
|
sfr_mask_data(3, 0xff, 0x04);
|
||||||
sfr_mask_data(2, 0x03, 0);
|
sfr_mask_data(2, 0x03, 0);
|
||||||
reg_write_m(0x785c);
|
reg_write_m(RTL837X_REG_RX_CTRL);
|
||||||
|
|
||||||
// Set bit 0 of 0x7860:
|
// Enable NIC TX (set bit 0)
|
||||||
// r7860:00000000 R7860-00000001
|
reg_bit_set(RTL837X_REG_TX_CTRL, 0);
|
||||||
reg_bit_set(0x7860, 0);
|
|
||||||
|
|
||||||
// r785c:0400201e R785c-0400201f
|
// Enable NIC RX (set bit 0)
|
||||||
reg_bit_set(0x785c, 0);
|
reg_bit_set(RTL837X_REG_RX_CTRL, 0);
|
||||||
|
|
||||||
// r785c:0400201f R785c-0400201b
|
// Drop packets with invalid CRC
|
||||||
reg_bit_clear(0x785c, 2);
|
reg_bit_clear(RTL837X_REG_RX_CTRL, 2);
|
||||||
|
|
||||||
// R603c-00000200
|
// R603c-00000200
|
||||||
REG_SET(0x603c, 0x200);
|
REG_SET(0x603c, 0x200);
|
||||||
|
|||||||
Reference in New Issue
Block a user