mv88e6352.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * (C) Copyright 2012
  4. * Valentin Lontgchamp, Keymile AG, valentin.longchamp@keymile.com
  5. */
  6. #ifndef __MV886352_H
  7. #define __MV886352_H
  8. #include <common.h>
  9. /* PHY registers */
  10. #define PHY(itf) (itf)
  11. #define PHY_CTRL 0x00
  12. #define PHY_100_MBPS 0x2000
  13. #define PHY_1_GBPS 0x0040
  14. #define AUTONEG_EN 0x1000
  15. #define AUTONEG_RST 0x0200
  16. #define FULL_DUPLEX 0x0100
  17. #define PHY_PWR_DOWN 0x0800
  18. #define PHY_STATUS 0x01
  19. #define AN1000FIX 0x0001
  20. #define PHY_SPEC_CTRL 0x10
  21. #define SPEC_PWR_DOWN 0x0004
  22. #define AUTO_MDIX_EN 0x0060
  23. #define PHY_1000_CTRL 0x9
  24. #define NO_ADV 0x0000
  25. #define ADV_1000_FDPX 0x0200
  26. #define ADV_1000_HDPX 0x0100
  27. #define PHY_PAGE 0x16
  28. #define AN1000FIX_PAGE 0x00fc
  29. /* PORT or MAC registers */
  30. #define PORT(itf) (itf+0x10)
  31. #define PORT_STATUS 0x00
  32. #define NO_PHY_DETECT 0x0000
  33. #define PORT_PHY 0x01
  34. #define RX_RGMII_TIM 0x8000
  35. #define TX_RGMII_TIM 0x4000
  36. #define FLOW_CTRL_EN 0x0080
  37. #define FLOW_CTRL_FOR 0x0040
  38. #define LINK_VAL 0x0020
  39. #define LINK_FOR 0x0010
  40. #define FULL_DPX 0x0008
  41. #define FULL_DPX_FOR 0x0004
  42. #define NO_SPEED_FOR 0x0003
  43. #define SPEED_1000_FOR 0x0002
  44. #define SPEED_100_FOR 0x0001
  45. #define SPEED_10_FOR 0x0000
  46. #define PORT_CTRL 0x04
  47. #define FORWARDING 0x0003
  48. #define EGRS_FLD_ALL 0x000c
  49. #define PORT_DIS 0x0000
  50. struct mv88e_sw_reg {
  51. u8 port;
  52. u8 reg;
  53. u16 value;
  54. };
  55. int mv88e_sw_reset(const char *devname, u8 phy_addr);
  56. int mv88e_sw_program(const char *devname, u8 phy_addr,
  57. struct mv88e_sw_reg *regs, int regs_nb);
  58. #endif