drv_enet_phy.h 977 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * Copyright (c) 2023-2024 HPMicro
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. *
  6. */
  7. #ifndef DRV_ENET_PHY_H
  8. #define DRV_ENET_PHY_H
  9. #include "hpm_ioc_regs.h"
  10. #include <rtdevice.h>
  11. #if defined(BSP_USING_ENET_PHY_DP83867)
  12. #include "hpm_dp83867.h"
  13. #endif
  14. #if defined(BSP_USING_ENET_PHY_RTL8211)
  15. #include "hpm_rtl8211.h"
  16. #endif
  17. #if defined(BSP_USING_ENET_PHY_DP83848)
  18. #include "hpm_dp83848.h"
  19. #endif
  20. #if defined(BSP_USING_ENET_PHY_RTL8201)
  21. #include "hpm_rtl8201.h"
  22. #endif
  23. #if defined(BSP_USING_ENET_PHY_LAN8720)
  24. #include "hpm_lan8720.h"
  25. #endif
  26. #ifndef PHY_AUTO_NEGO
  27. #define PHY_AUTO_NEGO (1U)
  28. #endif
  29. #ifndef PHY_MDIO_CSR_CLK_FREQ
  30. #define PHY_MDIO_CSR_CLK_FREQ (200000000U)
  31. #endif
  32. enum phy_link_status
  33. {
  34. PHY_LINK_DOWN = 0U,
  35. PHY_LINK_UP
  36. };
  37. typedef struct {
  38. rt_uint32_t phy_speed;
  39. rt_uint32_t phy_duplex;
  40. } phy_info_t;
  41. typedef struct {
  42. rt_uint32_t phy_link;
  43. rt_phy_t phy;
  44. phy_info_t phy_info;
  45. } phy_device_t;
  46. #endif /* DRV_ENET_PHY_H */