Go to the documentation of this file.
8 #define ADIN1300_MII_CONTROL 0x0000
9 #define ADIN1300_LOOPBACK_MASK NO_OS_BIT(14)
10 #define ADIN1300_SPEED_SEL_LSB_MASK NO_OS_BIT(13)
11 #define ADIN1300_AUTONEG_EN_MASK NO_OS_BIT(12)
12 #define ADIN1300_RESTART_ANEG_MASK NO_OS_BIT(9)
13 #define ADIN1300_DPLX_MODE_MASK NO_OS_BIT(8)
14 #define ADIN1300_SPEED_SEL_MSB_MASK NO_OS_BIT(6)
16 #define ADIN1300_MII_STATUS 0x1
17 #define ADIN1300_AUTONEG_DONE_MASK NO_OS_BIT(5)
18 #define ADIN1300_REM_FLT_LAT_MASK NO_OS_BIT(4)
19 #define ADIN1300_LINK_STAT_LAT_MASK NO_OS_BIT(2)
20 #define ADIN1300_JABBER_DET_LAT_MASK NO_OS_BIT(1)
22 #define ADIN1300_PHY_ID_1 0x2
23 #define ADIN1300_PHY_ID_2 0x3
25 #define ADIN1300_AUTONEG_ADV 0x04
26 #define ADIN1300_FD_100_ADV_MASK NO_OS_BIT(8)
27 #define ADIN1300_HD_100_ADV_MASK NO_OS_BIT(7)
28 #define ADIN1300_FD_10_ADV_MASK NO_OS_BIT(6)
29 #define ADIN1300_HD_10_ADV_MASK NO_OS_BIT(5)
30 #define ADIN1300_SELECTOR_ADV_MASK NO_OS_GENMASK(4, 0)
32 #define ADIN1300_MSTR_SLV_CONTROL 0x09
33 #define ADIN1300_FD_1000_ADV_MASK NO_OS_BIT(9)
34 #define ADIN1300_HD_1000_ADV_MASK NO_OS_BIT(8)
36 #define ADIN1300_PHY_CTRL_1 0x0012
37 #define ADIN1300_DIAG_CLK_EN_MASK NO_OS_BIT(2)
39 #define ADIN1300_PHY_CTRL_STATUS_1 0x0013
40 #define ADIN1300_LB_ALL_DIG_SEL_MASK NO_OS_BIT(12)
42 #define ADIN1300_RX_ERR_CNT 0x0014
44 #define ADIN1300_PHY_CTRL_2 0x0016
45 #define ADIN1300_DN_SPEED_TO_100_EN_MASK NO_OS_BIT(11)
46 #define ADIN1300_DN_SPEED_TO_10_EN_MASK NO_OS_BIT(10)
47 #define ADIN1300_CLK_CNTRL_MASK NO_OS_GENMASK(3, 1)
49 #define ADIN1300_PHY_CTRL_3 0x0017
50 #define ADIN1300_LINK_EN_MASK NO_OS_BIT(13)
52 #define ADIN1300_IRQ_MASK 0x0018
53 #define ADIN1300_IRQ_STATUS 0x0019
54 #define ADIN1300_LNK_STAT_CHNG_IRQ_MASK NO_OS_BIT(2)
55 #define ADIN1300_SPEED_CHG_IRQ_MASK NO_OS_BIT(1)
56 #define ADIN1300_HW_IRQ_EN_MASK NO_OS_BIT(0)
58 #define ADIN1300_PHY_STATUS_1 0x001a
59 #define ADIN1300_HCD_TECH_MASK NO_OS_GENMASK(9, 7)
60 #define ADIN1300_LINK_STAT_MASK NO_OS_BIT(6)
62 #define ADIN1300_PHY_STATUS_2 0x001f
64 #define ADIN1300_FC_EN NO_OS_MDIO_C45_ADDR(0x1e, 0x9403)
65 #define ADIN1300_FC_EN_MASK NO_OS_BIT(0)
67 #define ADIN1300_FC_TX_SEL NO_OS_MDIO_C45_ADDR(0x1e, 0x9407)
68 #define ADIN1300_FC_TX_SEL_MASK NO_OS_BIT(0)
70 #define ADIN1300_FC_FRM_CNT_H NO_OS_MDIO_C45_ADDR(0x1e, 0x940a)
71 #define ADIN1300_FC_FRM_CNT_L NO_OS_MDIO_C45_ADDR(0x1e, 0x940b)
72 #define ADIN1300_FC_LEN_ERR_CNT NO_OS_MDIO_C45_ADDR(0x1e, 0x940c)
73 #define ADIN1300_FC_ALGN_ERR_CNT NO_OS_MDIO_C45_ADDR(0x1e, 0x940d)
74 #define ADIN1300_FC_SYMB_ERR_CNT NO_OS_MDIO_C45_ADDR(0x1e, 0x940e)
75 #define ADIN1300_FC_OSZ_ERR_CNT NO_OS_MDIO_C45_ADDR(0x1e, 0x940f)
76 #define ADIN1300_FC_USZ_ERR_CNT NO_OS_MDIO_C45_ADDR(0x1e, 0x9410)
78 #define ADIN1300_FG_EN NO_OS_MDIO_C45_ADDR(0x1e, 0x9415)
79 #define ADIN1300_FG_EN_MASK NO_OS_BIT(0)
81 #define ADIN1300_FG_CNTRL_RSTRT NO_OS_MDIO_C45_ADDR(0x1e, 0x9416)
82 #define ADIN1300_FG_RSTRT_MASK NO_OS_BIT(3)
83 #define ADIN1300_FG_CNTRL_MASK NO_OS_GENMASK(2, 0)
85 #define ADIN1300_FG_FRM_LEN NO_OS_MDIO_C45_ADDR(0x1e, 0x941a)
87 #define ADIN1300_FG_DONE NO_OS_MDIO_C45_ADDR(0x1e, 0x941e)
88 #define ADIN1300_FG_DONE_MASK NO_OS_BIT(0)
90 #define ADIN1300_GE_SFT_RST NO_OS_MDIO_C45_ADDR(0x1e, 0xff0c)
91 #define ADIN1300_GE_SFT_RST_MASK NO_OS_BIT(0)
93 #define ADIN1300_GE_CLK_CFG NO_OS_MDIO_C45_ADDR(0x1e, 0xff1f)
94 #define ADIN1300_GE_CLK_RCVR_125_EN_MASK NO_OS_BIT(5)
95 #define ADIN1300_GE_CLK_FREE_125_EN_MASK NO_OS_BIT(4)
96 #define ADIN1300_GE_REF_CLK_EN_MASK NO_OS_BIT(3)
97 #define ADIN1300_GE_CLK_HRT_RCVR_EN_MASK NO_OS_BIT(2)
98 #define ADIN1300_GE_CLK_HRT_FREE_EN_MASK NO_OS_BIT(1)
99 #define ADIN1300_GE_CLK_25_EN_MASK NO_OS_BIT(0)
101 #define ADIN1300_GE_RGMII_CFG NO_OS_MDIO_C45_ADDR(0x1e, 0xff23)
102 #define ADIN1300_GE_RGMII_100_LOW_LTNCY_EN_MSK NO_OS_BIT(10)
103 #define ADIN1300_GE_RGMII_10_LOW_LTNCY_EN_MSK NO_OS_BIT(9)
104 #define ADIN1300_GE_RGMII_RX_SEL_MASK NO_OS_GENMASK(8, 6)
105 #define ADIN1300_GE_RGMII_GTX_SEL_MASK NO_OS_GENMASK(5, 3)
106 #define ADIN1300_GE_RGMII_RX_ID_EN_MASK NO_OS_BIT(2)
107 #define ADIN1300_GE_RGMII_TX_ID_EN_MASK NO_OS_BIT(1)
108 #define ADIN1300_GE_RGMII_EN_MASK NO_OS_BIT(0)
110 #define ADIN1300_GE_B10_REGEN_PRE NO_OS_MDIO_C45_ADDR(0x1e, 0xff38)
111 #define ADIN1300_GE_B10_REGEN_PRE_MSK NO_OS_BIT(0)
bool clk25_ref
Definition: adin1300.h:152
bool rx_idelay_en
Definition: adin1300.h:141
#define ADIN1300_FD_100_ADV_MASK
Definition: adin1300.h:26
#define ADIN1300_GE_RGMII_CFG
Definition: adin1300.h:101
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
#define ADIN1300_RESTART_ANEG_MASK
Definition: adin1300.h:12
Parameters for an MDIO slave.
Definition: no_os_mdio.h:60
#define ADIN1300_SPEED_SEL_MSB_MASK
Definition: adin1300.h:14
uint8_t addr
Definition: no_os_mdio.h:81
@ ADIN1300_GP_CLK_REFERENCE
Definition: adin1300.h:123
@ ADIN1300_RGMII_2_00_NS
Definition: adin1300.h:131
#define ADIN1300_MII_CONTROL
Definition: adin1300.h:8
bool gp_clk
Definition: adin1300.h:150
@ ADIN1300_GP_CLK_HEARTBEAT_FREE
Definition: adin1300.h:124
int adin1300_hard_reset(struct adin1300_desc *dev)
Definition: adin1300.c:96
#define ADIN1300_GE_SFT_RST_MASK
Definition: adin1300.h:91
int adin1300_remove(struct adin1300_desc *dev)
Definition: adin1300.c:112
@ ADIN1300_10_BASE_T_FULLDUPLEX
Definition: adin1300.h:115
#define ADIN1300_AUTONEG_EN_MASK
Definition: adin1300.h:11
#define ADIN1300_GE_CLK_HRT_RCVR_EN_MASK
Definition: adin1300.h:97
#define ADIN1300_MSTR_SLV_CONTROL
Definition: adin1300.h:32
bool adin1300_link_is_up(struct adin1300_desc *dev)
Definition: adin1300.c:246
bool adin1300_link_is_up(struct adin1300_desc *dev)
Definition: adin1300.c:246
Header file of Delay functions.
int adin1300_write(struct adin1300_desc *dev, uint32_t addr, uint16_t val)
Definition: adin1300.c:120
#define ADIN1300_GE_REF_CLK_EN_MASK
Definition: adin1300.h:96
#define ADIN1300_GE_RGMII_TX_ID_EN_MASK
Definition: adin1300.h:107
@ ADIN1300_RGMII_1_80_NS
Definition: adin1300.h:133
int adin1300_config_gp_clk(struct adin1300_desc *dev, bool on, enum adin1300_gp_clk_source source)
Definition: adin1300.c:168
int adin1300_config_rgmii(struct adin1300_desc *dev, struct adin1300_rgmii_config rgmii)
Definition: adin1300.c:148
enum adin1300_speed adin1300_resolved_speed(struct adin1300_desc *dev)
Definition: adin1300.c:258
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:117
int adin1300_config_clk25_ref(struct adin1300_desc *dev, bool on)
Definition: adin1300.c:188
Definition: adin1300.h:138
#define ADIN1300_FD_1000_ADV_MASK
Definition: adin1300.h:33
Definition: adin1300.h:146
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:54
#define ADIN1300_SELECTOR_ADV_MASK
Definition: adin1300.h:30
#define ADIN1300_GE_CLK_25_EN_MASK
Definition: adin1300.h:99
int adin1300_remove(struct adin1300_desc *dev)
Definition: adin1300.c:112
#define ADIN1300_SPEED_SEL_LSB_MASK
Definition: adin1300.h:10
@ ADIN1300_1000_BASE_T_FULLDUPLEX
Definition: adin1300.h:119
enum adin1300_speed speed_cap
Definition: adin1300.h:153
#define ADIN1300_HD_1000_ADV_MASK
Definition: adin1300.h:34
@ ADIN1300_RGMII_2_40_NS
Definition: adin1300.h:135
int adin1300_autoneg(struct adin1300_desc *dev, bool on)
Definition: adin1300.c:239
@ NO_OS_GPIO_LOW
Definition: no_os_gpio.h:115
int adin1300_init(struct adin1300_desc **dev, struct adin1300_init_param *param)
Definition: adin1300.c:9
int adin1300_write_bits(struct adin1300_desc *dev, uint32_t addr, uint16_t val, uint16_t bitmask)
Definition: adin1300.c:132
#define ADIN1300_PHY_ID_2
Definition: adin1300.h:23
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
adin1300_gp_clk_source
Definition: adin1300.h:122
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
@ ADIN1300_GP_CLK_RECOVERED
Definition: adin1300.h:127
int adin1300_read(struct adin1300_desc *dev, uint32_t addr, uint16_t *val)
Definition: adin1300.c:126
enum adin1300_rgmii_idelay tx_idelay
Definition: adin1300.h:140
#define ADIN1300_PHY_STATUS_1
Definition: adin1300.h:58
struct no_os_mdio_init_param mdio_param
Definition: adin1300.h:148
int no_os_mdio_init(struct no_os_mdio_desc **desc, struct no_os_mdio_init_param *param)
Initialize the MDIO interface.
Definition: no_os_mdio.c:42
struct adin1300_rgmii_config rgmii_config
Definition: adin1300.h:149
@ ADIN1300_10_BASE_T_HALFDUPLEX
Definition: adin1300.h:114
int adin1300_read(struct adin1300_desc *dev, uint32_t addr, uint16_t *val)
Definition: adin1300.c:126
int no_os_mdio_write(struct no_os_mdio_desc *desc, uint32_t reg, uint16_t val)
Write a register using MDIO.
Definition: no_os_mdio.c:90
int adin1300_config_speed(struct adin1300_desc *dev, enum adin1300_speed speed_cap)
Definition: adin1300.c:194
int adin1300_init(struct adin1300_desc **dev, struct adin1300_init_param *param)
Definition: adin1300.c:9
#define ADIN1300_HD_100_ADV_MASK
Definition: adin1300.h:27
#define ADIN1300_GE_RGMII_GTX_SEL_MASK
Definition: adin1300.h:105
#define ADIN1300_LINK_STAT_MASK
Definition: adin1300.h:60
Header file for MDIO interface driver.
adin1300_rgmii_idelay
Definition: adin1300.h:130
#define ADIN1300_GE_CLK_HRT_FREE_EN_MASK
Definition: adin1300.h:98
struct no_os_gpio_desc * reset_gpio
Definition: adin1300.h:158
int adin1300_soft_reset(struct adin1300_desc *dev)
Definition: adin1300.c:83
int32_t no_os_gpio_remove(struct no_os_gpio_desc *desc)
Free the resources allocated by no_os_gpio_get().
Definition: no_os_gpio.c:104
@ ADIN1300_RGMII_1_60_NS
Definition: adin1300.h:132
@ ADIN1300_100_BASE_TX_FULLDUPLEX
Definition: adin1300.h:117
#define ADIN1300_DPLX_MODE_MASK
Definition: adin1300.h:13
int adin1300_config_rgmii(struct adin1300_desc *dev, struct adin1300_rgmii_config rgmii)
Definition: adin1300.c:148
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
int adin1300_soft_reset(struct adin1300_desc *dev)
Definition: adin1300.c:83
Definition: adin1300.h:157
int no_os_mdio_remove(struct no_os_mdio_desc *desc)
Free the resources allocated by no_os_mdio_init().
Definition: no_os_mdio.c:70
int32_t no_os_gpio_get(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Obtain the GPIO decriptor.
Definition: no_os_gpio.c:49
int adin1300_config_clk25_ref(struct adin1300_desc *dev, bool on)
Definition: adin1300.c:188
#define ADIN1300_GE_RGMII_RX_SEL_MASK
Definition: adin1300.h:104
uint32_t no_os_field_get(uint32_t mask, uint32_t word)
bool tx_idelay_en
Definition: adin1300.h:139
#define ADIN1300_GE_CLK_CFG
Definition: adin1300.h:93
int adin1300_autoneg(struct adin1300_desc *dev, bool on)
Definition: adin1300.c:239
#define NO_OS_BIT(x)
Definition: no_os_util.h:45
MDIO device descriptor created with no_os_mdio_init().
Definition: no_os_mdio.h:78
#define ADIN1300_GE_CLK_FREE_125_EN_MASK
Definition: adin1300.h:95
#define ADIN1300_GE_SFT_RST
Definition: adin1300.h:90
bool autoneg
Definition: adin1300.h:154
@ ADIN1300_RGMII_2_20_NS
Definition: adin1300.h:134
#define ADIN1300_FD_10_ADV_MASK
Definition: adin1300.h:28
Header file for MDIO implementation using gpio bit banging.
#define ADIN1300_PHY_ID_1
Definition: adin1300.h:22
@ ADIN1300_1000_BASE_T_HALFDUPLEX
Definition: adin1300.h:118
enum adin1300_gp_clk_source gp_clk_source
Definition: adin1300.h:151
int adin1300_write_bits(struct adin1300_desc *dev, uint32_t addr, uint16_t val, uint16_t bitmask)
Definition: adin1300.c:132
struct no_os_mdio_desc * mdio
Definition: adin1300.h:159
@ ADIN1300_GP_CLK_FREE
Definition: adin1300.h:126
int no_os_mdio_read(struct no_os_mdio_desc *desc, uint32_t reg, uint16_t *val)
Read a register using MDIO.
Definition: no_os_mdio.c:110
struct no_os_gpio_init_param * reset_param
Definition: adin1300.h:147
Header file of GPIO Interface.
#define ADIN1300_HD_10_ADV_MASK
Definition: adin1300.h:29
#define ADIN1300_GE_RGMII_RX_ID_EN_MASK
Definition: adin1300.h:106
int adin1300_config_speed(struct adin1300_desc *dev, enum adin1300_speed speed_cap)
Definition: adin1300.c:194
#define ADIN1300_GE_RGMII_EN_MASK
Definition: adin1300.h:108
Header file of utility functions.
int adin1300_write(struct adin1300_desc *dev, uint32_t addr, uint16_t val)
Definition: adin1300.c:120
@ ADIN1300_GP_CLK_HEARTBEAT_RECOVERED
Definition: adin1300.h:125
enum adin1300_speed adin1300_resolved_speed(struct adin1300_desc *dev)
Definition: adin1300.c:258
int adin1300_config_gp_clk(struct adin1300_desc *dev, bool on, enum adin1300_gp_clk_source source)
Definition: adin1300.c:168
enum adin1300_rgmii_idelay rx_idelay
Definition: adin1300.h:142
#define ADIN1300_GE_RGMII_10_LOW_LTNCY_EN_MSK
Definition: adin1300.h:103
adin1300_speed
Definition: adin1300.h:113
int32_t no_os_gpio_direction_output(struct no_os_gpio_desc *desc, uint8_t value)
Enable the output direction of the specified GPIO.
Definition: no_os_gpio.c:147
#define ADIN1300_GE_CLK_RCVR_125_EN_MASK
Definition: adin1300.h:94
#define ADIN1300_AUTONEG_ADV
Definition: adin1300.h:25
@ ADIN1300_100_BASE_TX_HALFDUPLEX
Definition: adin1300.h:116
int adin1300_hard_reset(struct adin1300_desc *dev)
Definition: adin1300.c:96
Error macro definition for ARM Compiler.
#define ADIN1300_HCD_TECH_MASK
Definition: adin1300.h:59
#define ADIN1300_GE_RGMII_100_LOW_LTNCY_EN_MSK
Definition: adin1300.h:102