drv_tsw_phy.h 689 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Copyright (c) 2025 HPMicro
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. *
  6. */
  7. #ifndef DRV_TSW_PHY_H
  8. #define DRV_TSW_PHY_H
  9. #include "hpm_ioc_regs.h"
  10. #include <rtdevice.h>
  11. #if defined(BSP_USING_TSW_PHY_RTL8211)
  12. #include "hpm_rtl8211.h"
  13. #endif
  14. #ifndef PHY_MDIO_CLK_FREQ
  15. #define PHY_MDIO_CLK_FREQ (2500000U)
  16. #endif
  17. #ifndef PHY_MDIO_CSR_CLK_FREQ
  18. #define PHY_MDIO_CSR_CLK_FREQ (100000000U)
  19. #endif
  20. enum phy_link_status {
  21. PHY_LINK_DOWN = 0U,
  22. PHY_LINK_UP
  23. };
  24. typedef struct {
  25. rt_uint32_t phy_speed;
  26. rt_uint32_t phy_duplex;
  27. } phy_info_t;
  28. typedef struct {
  29. rt_uint32_t phy_link;
  30. rt_phy_t phy;
  31. phy_info_t phy_info;
  32. } phy_device_t;
  33. #endif /* DRV_TSW_PHY_H */