mv88e6352.h 1.5 KB

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