Go to the documentation of this file.
8 #define MAX24287_REG(page, addr) (((page) << 5) | ((addr) & 0x1f))
9 #define MAX24287_PAGE(addr) ((addr) >> 5)
10 #define MAX24287_ADDR(addr) ((addr) & 0x1f)
12 #define MAX24287_BMCR 0
13 #define MAX24287_DP_RST_MASK NO_OS_BIT(15)
14 #define MAX24287_AN_EN_MASK NO_OS_BIT(12)
15 #define MAX24287_AN_START_MASK NO_OS_BIT(9)
17 #define MAX24287_BMSR 1
18 #define MAX24287_LINK_ST_MASK NO_OS_BIT(2)
20 #define MAX24287_ID1 2
21 #define MAX24287_ID2 3
23 #define MAX24287_AN_ADV 4
24 #define MAX24287_AN_ADV_W_MASK NO_OS_BIT(0)
25 #define MAX24287_LK_MASK NO_OS_BIT(15)
26 #define MAX24287_DPLX_MASK NO_OS_BIT(12)
27 #define MAX24287_SPD_MASK NO_OS_GENMASK(11, 10)
29 #define MAX24287_AN_RX 5
31 #define MAX24287_AN_EXP 6
32 #define MAX24287_AN_RX_PAGE NO_OS_BIT(1)
34 #define MAX24287_EXT_STAT 15
35 #define MAX24287_JIT_DIAG 16
37 #define MAX24287_PCSCR 17
38 #define MAX24287_WD_DIS_MASK NO_OS_BIT(6)
39 #define MAX24287_BASEX_MASK NO_OS_BIT(4)
40 #define MAX24287_EN_CDET_MASK NO_OS_BIT(0)
42 #define MAX24287_GMIICR 18
43 #define MAX24287_GMIICR_W_MASK NO_OS_BIT(7)
44 #define MAX24287_GMIICR_SPD_MASK NO_OS_GENMASK(15, 14)
45 #define MAX24287_GMIICR_DTE_DCE_MASK NO_OS_BIT(12)
46 #define MAX24287_GMIICR_DDR_MASK NO_OS_BIT(11)
47 #define MAX24287_GMIICR_TXCLK_EN_MASK NO_OS_BIT(10)
49 #define MAX24287_CR 19
51 #define MAX24287_IR 20
52 #define MAX24287_PAGE_IE NO_OS_BIT(10)
54 #define MAX24287_ID MAX24287_REG(1, 16)
56 #define MAX24287_GPIOCR1 MAX24287_REG(1, 17)
57 #define MAX24287_RST_MASK NO_OS_BIT(15)
58 #define MAX24287_GPO1_SEL NO_OS_GENMASK(14, 12)
59 #define MAX24287_GPO2_SEL NO_OS_GENMASK(11, 9)
60 #define MAX24287_GPIO1_SEL NO_OS_GENMASK(8, 6)
61 #define MAX24287_GPIO2_SEL NO_OS_GENMASK(5, 3)
62 #define MAX24287_GPIO3_SEL NO_OS_GENMASK(2, 0)
64 #define MAX24287_GPIOCR2 MAX24287_REG(1, 18)
65 #define MAX24287_GPIOSR MAX24287_REG(1, 19)
67 #define MAX24287_PTPCR1 MAX24287_REG(2, 16)
68 #define MAX24287_PTPCR1_W_MASK NO_OS_BIT(14)
69 #define MAX24287_PLL_PWDN_MASK NO_OS_BIT(5)
70 #define MAX24287_TX_PWDN_MASK NO_OS_BIT(3)
71 #define MAX24287_RX_PWDN_MASK NO_OS_BIT(2)
73 #define MAX24287_PAGESEL 31
74 #define MAX24287_PAGE_MASK NO_OS_GENMASK(1, 0)
#define MAX24287_JIT_DIAG
Definition: max24287.h:35
@ MAX24287_100_HALFDUPLEX
Definition: max24287.h:92
bool max24287_link_is_up(struct max24287_desc *dev)
Definition: max24287.c:258
#define MAX24287_AN_RX
Definition: max24287.h:29
#define MAX24287_BMSR
Definition: max24287.h:17
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
Parameters for an MDIO slave.
Definition: no_os_mdio.h:60
uint8_t addr
Definition: no_os_mdio.h:81
@ MAX24287_1250_FULLDUPLEX
Definition: max24287.h:97
int max24287_get_config_parallel(struct max24287_desc *dev, enum max24287_parallel *par, enum max24287_speed *speed)
Definition: max24287.c:183
bool max24287_link_is_up(struct max24287_desc *dev)
Definition: max24287.c:258
int max24287_config_link(struct max24287_desc *dev, bool up)
Definition: max24287.c:249
int max24287_get_config_parallel(struct max24287_desc *dev, enum max24287_parallel *par, enum max24287_speed *speed)
Definition: max24287.c:183
#define MAX24287_GMIICR
Definition: max24287.h:42
@ MAX24287_100_FULLDUPLEX
Definition: max24287.h:93
struct no_os_mdio_desc * mdio
Definition: max24287.h:111
int max24287_read(struct max24287_desc *dev, uint8_t addr, uint16_t *val)
Definition: max24287.c:129
@ MAX24287_SGMII
Definition: max24287.h:85
struct no_os_gpio_desc * reset_gpio
Definition: max24287.h:110
Header file of Delay functions.
int max24287_write(struct max24287_desc *dev, uint8_t addr, uint16_t val)
Definition: max24287.c:112
int max24287_config_serial(struct max24287_desc *dev, enum max24287_serial ser, enum max24287_speed speed)
Definition: max24287.c:200
#define MAX24287_GMIICR_SPD_MASK
Definition: max24287.h:44
int max24287_remove(struct max24287_desc *dev)
@ MAX24287_TBI
Definition: max24287.h:77
enum max24287_serial serial
Definition: max24287.h:105
@ MAX24287_1000_FULLDUPLEX
Definition: max24287.h:95
int max24287_write(struct max24287_desc *dev, uint8_t addr, uint16_t val)
Definition: max24287.c:112
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:117
max24287_speed
Definition: max24287.h:89
@ MAX24287_GMII
Definition: max24287.h:79
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 NO_OS_ARRAY_SIZE(x)
Definition: no_os_util.h:49
@ MAX24287_1000BASEX
Definition: max24287.h:86
@ MAX24287_10_HALFDUPLEX
Definition: max24287.h:90
@ NO_OS_GPIO_LOW
Definition: no_os_gpio.h:115
#define MAX24287_RST_MASK
Definition: max24287.h:57
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
int max24287_read(struct max24287_desc *dev, uint8_t addr, uint16_t *val)
Definition: max24287.c:129
#define MAX24287_GPIOCR1
Definition: max24287.h:56
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
@ MAX24287_RGMII
Definition: max24287.h:80
enum max24287_parallel parallel
Definition: max24287.h:103
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
#define MAX24287_LK_MASK
Definition: max24287.h:25
@ MAX24287_10_FULLDUPLEX
Definition: max24287.h:91
void max24287_regmap(struct max24287_desc *dev)
Definition: max24287.c:271
int max24287_soft_reset(struct max24287_desc *dev)
Definition: max24287.c:81
max24287_parallel
Definition: max24287.h:76
@ MAX24287_RTBI
Definition: max24287.h:78
#define MAX24287_PAGE(addr)
Definition: max24287.h:9
Header file for MDIO interface driver.
Definition: max24287.h:100
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
#define MAX24287_AN_ADV
Definition: max24287.h:23
int max24287_init(struct max24287_desc **dev, struct max24287_init_param *param)
Definition: max24287.c:9
#define MAX24287_ADDR(addr)
Definition: max24287.h:10
struct no_os_gpio_init_param * reset_param
Definition: max24287.h:101
int max24287_hard_reset(struct max24287_desc *dev)
Definition: max24287.c:95
#define MAX24287_ID
Definition: max24287.h:54
#define MAX24287_ID1
Definition: max24287.h:20
int max24287_config_parallel(struct max24287_desc *dev, enum max24287_parallel par, enum max24287_speed speed)
Definition: max24287.c:162
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
Definition: max24287.h:109
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
int max24287_init(struct max24287_desc **dev, struct max24287_init_param *param)
Definition: max24287.c:9
#define MAX24287_GPIOSR
Definition: max24287.h:65
#define MAX24287_IR
Definition: max24287.h:51
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
uint32_t no_os_field_get(uint32_t mask, uint32_t word)
#define MAX24287_BMCR
Definition: max24287.h:12
int max24287_config_link(struct max24287_desc *dev, bool up)
Definition: max24287.c:249
#define MAX24287_ID2
Definition: max24287.h:21
MDIO device descriptor created with no_os_mdio_init().
Definition: no_os_mdio.h:78
#define MAX24287_LINK_ST_MASK
Definition: max24287.h:18
#define MAX24287_DP_RST_MASK
Definition: max24287.h:13
void max24287_regmap(struct max24287_desc *dev)
Definition: max24287.c:271
int max24287_soft_reset(struct max24287_desc *dev)
Definition: max24287.c:81
#define MAX24287_EXT_STAT
Definition: max24287.h:34
#define MAX24287_BASEX_MASK
Definition: max24287.h:39
int max24287_config_parallel(struct max24287_desc *dev, enum max24287_parallel par, enum max24287_speed speed)
Definition: max24287.c:162
#define MAX24287_AN_ADV_W_MASK
Definition: max24287.h:24
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:114
#define MAX24287_PTPCR1
Definition: max24287.h:67
Header file for MDIO implementation using gpio bit banging.
#define MAX24287_GMIICR_DDR_MASK
Definition: max24287.h:46
#define MAX24287_PTPCR1_W_MASK
Definition: max24287.h:68
int max24287_get_config_serial(struct max24287_desc *dev, enum max24287_serial *ser, enum max24287_speed *speed)
Definition: max24287.c:226
int max24287_write_bits(struct max24287_desc *dev, uint8_t addr, uint16_t val, uint16_t bitmask)
Definition: max24287.c:146
#define MAX24287_PCSCR
Definition: max24287.h:37
#define MAX24287_CR
Definition: max24287.h:49
int max24287_hard_reset(struct max24287_desc *dev)
Definition: max24287.c:95
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
#define MAX24287_GPIOCR2
Definition: max24287.h:64
@ MAX24287_1250_HALFDUPLEX
Definition: max24287.h:96
int max24287_get_config_serial(struct max24287_desc *dev, enum max24287_serial *ser, enum max24287_speed *speed)
Definition: max24287.c:226
#define MAX24287_GMIICR_W_MASK
Definition: max24287.h:43
int max24287_write_bits(struct max24287_desc *dev, uint8_t addr, uint16_t val, uint16_t bitmask)
Definition: max24287.c:146
Header file of GPIO Interface.
enum max24287_speed serspeed
Definition: max24287.h:106
struct no_os_mdio_init_param mdio_param
Definition: max24287.h:102
@ MAX24287_1000_HALFDUPLEX
Definition: max24287.h:94
Header file of utility functions.
@ MAX24287_MII
Definition: max24287.h:81
#define MAX24287_DPLX_MASK
Definition: max24287.h:26
#define MAX24287_PAGESEL
Definition: max24287.h:73
#define MAX24287_RX_PWDN_MASK
Definition: max24287.h:71
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
max24287_serial
Definition: max24287.h:84
#define MAX24287_SPD_MASK
Definition: max24287.h:27
Error macro definition for ARM Compiler.
int max24287_config_serial(struct max24287_desc *dev, enum max24287_serial ser, enum max24287_speed speed)
Definition: max24287.c:200
enum max24287_speed parspeed
Definition: max24287.h:104