rtl83xx-phy.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. struct rtl83xx_shared_private {
  3. char *name;
  4. };
  5. struct __attribute__ ((__packed__)) part {
  6. uint16_t start;
  7. uint8_t wordsize;
  8. uint8_t words;
  9. };
  10. struct __attribute__ ((__packed__)) fw_header {
  11. uint32_t magic;
  12. uint32_t phy;
  13. uint32_t checksum;
  14. uint32_t version;
  15. struct part parts[10];
  16. };
  17. // TODO: fixed path?
  18. #define FIRMWARE_838X_8380_1 "rtl838x_phy/rtl838x_8380.fw"
  19. #define FIRMWARE_838X_8214FC_1 "rtl838x_phy/rtl838x_8214fc.fw"
  20. #define FIRMWARE_838X_8218b_1 "rtl838x_phy/rtl838x_8218b.fw"
  21. /* External RTL8218B and RTL8214FC IDs are identical */
  22. #define PHY_ID_RTL8214C 0x001cc942
  23. #define PHY_ID_RTL8214FC 0x001cc981
  24. #define PHY_ID_RTL8218B_E 0x001cc981
  25. #define PHY_ID_RTL8218D 0x001cc983
  26. #define PHY_ID_RTL8218B_I 0x001cca40
  27. #define PHY_ID_RTL8221B 0x001cc849
  28. #define PHY_ID_RTL8226 0x001cc838
  29. #define PHY_ID_RTL8390_GENERIC 0x001ccab0
  30. #define PHY_ID_RTL8393_I 0x001c8393
  31. #define PHY_ID_RTL9300_I 0x70d03106
  32. // PHY MMD devices
  33. #define MMD_AN 7
  34. #define MMD_VEND2 31
  35. /* Registers of the internal Serdes of the 8380 */
  36. #define RTL838X_SDS_MODE_SEL (0x0028)
  37. #define RTL838X_SDS_CFG_REG (0x0034)
  38. #define RTL838X_INT_MODE_CTRL (0x005c)
  39. #define RTL838X_DMY_REG31 (0x3b28)
  40. #define RTL8380_SDS4_FIB_REG0 (0xF800)
  41. #define RTL838X_SDS4_REG28 (0xef80)
  42. #define RTL838X_SDS4_DUMMY0 (0xef8c)
  43. #define RTL838X_SDS5_EXT_REG6 (0xf18c)
  44. #define RTL838X_SDS4_FIB_REG0 (RTL838X_SDS4_REG28 + 0x880)
  45. #define RTL838X_SDS5_FIB_REG0 (RTL838X_SDS4_REG28 + 0x980)
  46. /* Registers of the internal SerDes of the RTL8390 */
  47. #define RTL839X_SDS12_13_XSG0 (0xB800)
  48. /* Registers of the internal Serdes of the 9300 */
  49. #define RTL930X_SDS_INDACS_CMD (0x03B0)
  50. #define RTL930X_SDS_INDACS_DATA (0x03B4)
  51. #define RTL930X_MAC_FORCE_MODE_CTRL (0xCA1C)
  52. /*Registers of the internal SerDes of the 9310 */
  53. #define RTL931X_SERDES_INDRT_ACCESS_CTRL (0x5638)
  54. #define RTL931X_SERDES_INDRT_DATA_CTRL (0x563C)
  55. #define RTL931X_SERDES_MODE_CTRL (0x13cc)
  56. #define RTL931X_PS_SERDES_OFF_MODE_CTRL_ADDR (0x13F4)
  57. #define RTL931X_MAC_SERDES_MODE_CTRL(sds) (0x136C + (((sds) << 2)))