Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl839x.c b/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl839x.c
- index f6d061a5e0..056bc790c2 100644
- --- a/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl839x.c
- +++ b/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl839x.c
- @@ -607,10 +607,14 @@ int rtl8390_sds_power(int mac, int val)
- int rtl839x_read_phy(u32 port, u32 page, u32 reg, u32 *val)
- {
- u32 v;
- + int version = (sw_r32(RTL839X_MODEL_NAME_INFO) & 0x3f) >> 1;
- if (port > 63 || page > 4095 || reg > 31)
- return -ENOTSUPP;
- + if (port > 52 && version <= 2)
- + return -EIO;
- +
- mutex_lock(&smi_lock);
- sw_w32_mask(0xffff0000, port << 16, RTL839X_PHYREG_DATA_CTRL);
- @@ -729,12 +733,15 @@ int rtl839x_write_mmd_phy(u32 port, u32 devnum, u32 regnum, u32 val)
- void rtl8390_get_version(struct rtl838x_switch_priv *priv)
- {
- - u32 info;
- + u32 info, model;
- sw_w32_mask(0xf << 28, 0xa << 28, RTL839X_CHIP_INFO);
- info = sw_r32(RTL839X_CHIP_INFO);
- - pr_debug("Chip-Info: %x\n", info);
- - priv->version = RTL8390_VERSION_A;
- +
- + model = sw_r32(RTL839X_MODEL_NAME_INFO);
- + priv->version = RTL8390_VERSION_A + ((model & 0x3f) >> 1);
- +
- + pr_info("RTL839X Chip-Info: %x, version %c\n", info, priv->version);
- }
- void rtl839x_vlan_profile_dump(int profile)
- diff --git a/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl83xx.h b/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl83xx.h
- index f197e933d6..920d23d1e8 100644
- --- a/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl83xx.h
- +++ b/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl83xx.h
- @@ -9,6 +9,8 @@
- #define RTL8380_VERSION_A 'A'
- #define RTL8390_VERSION_A 'A'
- +#define RTL8390_VERSION_B 'B'
- +#define RTL8390_VERSION_C 'C'
- #define RTL8380_VERSION_B 'B'
- struct fdb_update_work {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement