summaryrefslogtreecommitdiff
path: root/bsp/hpmicro/libraries/drivers/drv_tsw_phy.h
blob: d7d36041050943dd8a6f76626fbb59c5583cc1b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
 * Copyright (c) 2025 HPMicro
 *
 * SPDX-License-Identifier: BSD-3-Clause
 *
 */

#ifndef DRV_TSW_PHY_H
#define DRV_TSW_PHY_H

#include "hpm_ioc_regs.h"
#include <rtdevice.h>

#if defined(BSP_USING_TSW_PHY_RTL8211)
#include "hpm_rtl8211.h"
#endif

#ifndef PHY_MDIO_CLK_FREQ
#define PHY_MDIO_CLK_FREQ (2500000U)
#endif

#ifndef PHY_MDIO_CSR_CLK_FREQ
#define PHY_MDIO_CSR_CLK_FREQ (100000000U)
#endif

enum phy_link_status {
   PHY_LINK_DOWN = 0U,
   PHY_LINK_UP
};

typedef struct {
    rt_uint32_t phy_speed;
    rt_uint32_t phy_duplex;
} phy_info_t;

typedef struct {
    rt_uint32_t phy_link;
    rt_phy_t phy;
    phy_info_t phy_info;
} phy_device_t;

#endif /* DRV_TSW_PHY_H */