Advertisement
Guest User

Untitled

a guest
Sep 13th, 2021
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. 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
  2. index f6d061a5e0..056bc790c2 100644
  3. --- a/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl839x.c
  4. +++ b/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl839x.c
  5. @@ -607,10 +607,14 @@ int rtl8390_sds_power(int mac, int val)
  6. int rtl839x_read_phy(u32 port, u32 page, u32 reg, u32 *val)
  7. {
  8. u32 v;
  9. + int version = (sw_r32(RTL839X_MODEL_NAME_INFO) & 0x3f) >> 1;
  10.  
  11. if (port > 63 || page > 4095 || reg > 31)
  12. return -ENOTSUPP;
  13.  
  14. + if (port > 52 && version <= 2)
  15. + return -EIO;
  16. +
  17. mutex_lock(&smi_lock);
  18.  
  19. sw_w32_mask(0xffff0000, port << 16, RTL839X_PHYREG_DATA_CTRL);
  20. @@ -729,12 +733,15 @@ int rtl839x_write_mmd_phy(u32 port, u32 devnum, u32 regnum, u32 val)
  21.  
  22. void rtl8390_get_version(struct rtl838x_switch_priv *priv)
  23. {
  24. - u32 info;
  25. + u32 info, model;
  26.  
  27. sw_w32_mask(0xf << 28, 0xa << 28, RTL839X_CHIP_INFO);
  28. info = sw_r32(RTL839X_CHIP_INFO);
  29. - pr_debug("Chip-Info: %x\n", info);
  30. - priv->version = RTL8390_VERSION_A;
  31. +
  32. + model = sw_r32(RTL839X_MODEL_NAME_INFO);
  33. + priv->version = RTL8390_VERSION_A + ((model & 0x3f) >> 1);
  34. +
  35. + pr_info("RTL839X Chip-Info: %x, version %c\n", info, priv->version);
  36. }
  37.  
  38. void rtl839x_vlan_profile_dump(int profile)
  39. 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
  40. index f197e933d6..920d23d1e8 100644
  41. --- a/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl83xx.h
  42. +++ b/target/linux/realtek/files-5.4/drivers/net/dsa/rtl83xx/rtl83xx.h
  43. @@ -9,6 +9,8 @@
  44.  
  45. #define RTL8380_VERSION_A 'A'
  46. #define RTL8390_VERSION_A 'A'
  47. +#define RTL8390_VERSION_B 'B'
  48. +#define RTL8390_VERSION_C 'C'
  49. #define RTL8380_VERSION_B 'B'
  50.  
  51. struct fdb_update_work {
  52.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement