summaryrefslogtreecommitdiffstats
path: root/target/linux/realtek
diff options
context:
space:
mode:
authorStijn Tintel <stijn@linux-ipv6.be>2024-04-27 01:40:08 +0300
committerStijn Tintel <stijn@linux-ipv6.be>2024-05-07 12:27:33 +0300
commita9781a04a1868e5321a360e636290fb058e7477a (patch)
treed17e41431b2653cc5ffa8a34dd92f8fcecc02120 /target/linux/realtek
parent1626b06683edfb53d8fca4d2c6fd5f19b49d3a6d (diff)
downloadopenwrt-a9781a04a1868e5321a360e636290fb058e7477a.tar.gz
openwrt-a9781a04a1868e5321a360e636290fb058e7477a.tar.bz2
openwrt-a9781a04a1868e5321a360e636290fb058e7477a.zip
realtek: add RTL821X_CHIP_ID
According to the Realtek SDK code, the RTL8214FC, RTL8218B and RTL8218FB all have the same chip ID 0x6276. Let's add a constant for it, as we're using it in more than one location. Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Diffstat (limited to 'target/linux/realtek')
-rw-r--r--target/linux/realtek/files-5.15/drivers/net/phy/rtl83xx-phy.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/target/linux/realtek/files-5.15/drivers/net/phy/rtl83xx-phy.c b/target/linux/realtek/files-5.15/drivers/net/phy/rtl83xx-phy.c
index 56e8a7f49d..490020989f 100644
--- a/target/linux/realtek/files-5.15/drivers/net/phy/rtl83xx-phy.c
+++ b/target/linux/realtek/files-5.15/drivers/net/phy/rtl83xx-phy.c
@@ -46,6 +46,8 @@ extern struct mutex smi_lock;
/* external RTL821X PHY uses register 0x1e to select media page */
#define RTL821XEXT_MEDIA_PAGE_SELECT 0x1e
+#define RTL821X_CHIP_ID 0x6276
+
#define RTL821X_MEDIA_PAGE_AUTO 0
#define RTL821X_MEDIA_PAGE_COPPER 1
#define RTL821X_MEDIA_PAGE_FIBRE 3
@@ -834,7 +836,7 @@ static int rtl8380_configure_ext_rtl8218b(struct phy_device *phydev)
/* Read internal PHY ID */
phy_write_paged(phydev, 31, 27, 0x0002);
val = phy_read_paged(phydev, 31, 28);
- if (val != 0x6276) {
+ if (val != RTL821X_CHIP_ID) {
phydev_err(phydev, "Expected external RTL8218B, found PHY-ID %x\n", val);
return -1;
}
@@ -1331,7 +1333,7 @@ static int rtl8380_configure_rtl8214fc(struct phy_device *phydev)
phy_write_paged(phydev, 0, RTL821XEXT_MEDIA_PAGE_SELECT, RTL821X_MEDIA_PAGE_COPPER);
phy_write_paged(phydev, 0x1f, 0x1b, 0x0002);
val = phy_read_paged(phydev, 0x1f, 0x1c);
- if (val != 0x6276) {
+ if (val != RTL821X_CHIP_ID) {
phydev_err(phydev, "Expected external RTL8214FC, found PHY-ID %x\n", val);
return -1;
}