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