From a597d2d08b7a9fbad4bcb656dd0d4d2e5716a724 Mon Sep 17 00:00:00 2001 From: logicog Date: Wed, 25 Mar 2026 20:43:55 +0100 Subject: [PATCH] Fix EEE control register address and add 5G/10G EEE defines Register RTL8373_EEE_CTRL_BASE did not actually exist at 0x606c, instead RTL837X_EEE_STATUS is actually not only a status, but also a control register for EEE enable/disable at the MAC. The defines are not actually register bits, but port EEE settings, so move them to rtl837x_port.h while adding 5G/10G flags. --- rtl837x_port.h | 10 ++++++++++ rtl837x_regs.h | 9 +++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/rtl837x_port.h b/rtl837x_port.h index 9be1680..ff036b9 100644 --- a/rtl837x_port.h +++ b/rtl837x_port.h @@ -33,6 +33,16 @@ struct vlan_settings { uint16_t tagged; }; +/* + * Port EEE settings + */ +#define EEE_100 0x01 +#define EEE_1000 0x04 +#define EEE_2G5 0x10 +#define EEE_5G 0x20 +#define EEE_10G 0x40 +#define EEE_NORESET 0x80 + extern __xdata struct vlan_settings vlan_settings; uint8_t port_l2_forget(void) __banked; diff --git a/rtl837x_regs.h b/rtl837x_regs.h index 2f6a699..c1a27bb 100644 --- a/rtl837x_regs.h +++ b/rtl837x_regs.h @@ -269,14 +269,11 @@ /* * EEE */ -#define RTL837X_EEE_STATUS 0x125C +#define RTL837X_EEE_CTRL_BASE 0x125C +#define EEE_RX_ENABLE 0x01 +#define EEE_TX_ENABLE 0x02 #define RTL837X_MAC_EEE_ABLTY 0x6404 #define RTL8373_PHY_EEE_ABLTY 0x642C -#define RTL8373_EEE_CTRL_BASE 0x606c -#define EEE_100 0x01 -#define EEE_1000 0x04 -#define EEE_2G5 0x10 -#define EEE_NORESET 0x80 /* * RANDOM