ldpaa_wriop.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * Copyright (C) 2015 Freescale Semiconductor
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #ifndef __LDPAA_WRIOP_H
  7. #define __LDPAA_WRIOP_H
  8. #include <phy.h>
  9. enum wriop_port {
  10. WRIOP1_DPMAC1 = 1,
  11. WRIOP1_DPMAC2,
  12. WRIOP1_DPMAC3,
  13. WRIOP1_DPMAC4,
  14. WRIOP1_DPMAC5,
  15. WRIOP1_DPMAC6,
  16. WRIOP1_DPMAC7,
  17. WRIOP1_DPMAC8,
  18. WRIOP1_DPMAC9,
  19. WRIOP1_DPMAC10,
  20. WRIOP1_DPMAC11,
  21. WRIOP1_DPMAC12,
  22. WRIOP1_DPMAC13,
  23. WRIOP1_DPMAC14,
  24. WRIOP1_DPMAC15,
  25. WRIOP1_DPMAC16,
  26. WRIOP1_DPMAC17,
  27. WRIOP1_DPMAC18,
  28. WRIOP1_DPMAC19,
  29. WRIOP1_DPMAC20,
  30. WRIOP1_DPMAC21,
  31. WRIOP1_DPMAC22,
  32. WRIOP1_DPMAC23,
  33. WRIOP1_DPMAC24,
  34. NUM_WRIOP_PORTS,
  35. };
  36. struct wriop_dpmac_info {
  37. u8 enabled;
  38. u8 id;
  39. u8 board_mux;
  40. int phy_addr;
  41. void *phy_regs;
  42. phy_interface_t enet_if;
  43. struct phy_device *phydev;
  44. struct mii_dev *bus;
  45. };
  46. extern struct wriop_dpmac_info dpmac_info[NUM_WRIOP_PORTS];
  47. #define DEFAULT_WRIOP_MDIO1_NAME "FSL_MDIO0"
  48. #define DEFAULT_WRIOP_MDIO2_NAME "FSL_MDIO1"
  49. void wriop_init_dpmac(int, int, int);
  50. void wriop_disable_dpmac(int);
  51. void wriop_enable_dpmac(int);
  52. u8 wriop_is_enabled_dpmac(int dpmac_id);
  53. void wriop_set_mdio(int, struct mii_dev *);
  54. struct mii_dev *wriop_get_mdio(int);
  55. void wriop_set_phy_address(int, int);
  56. int wriop_get_phy_address(int);
  57. void wriop_set_phy_dev(int, struct phy_device *);
  58. struct phy_device *wriop_get_phy_dev(int);
  59. phy_interface_t wriop_get_enet_if(int);
  60. void wriop_dpmac_disable(int);
  61. void wriop_dpmac_enable(int);
  62. phy_interface_t wriop_dpmac_enet_if(int, int);
  63. #endif /* __LDPAA_WRIOP_H */