40#define NO_OS_MDIO_C22_REGS 32
41#define NO_OS_MDIO_C45_START 0
42#define NO_OS_MDIO_C22_START 1
43#define NO_OS_MDIO_START_MASK NO_OS_GENMASK(31, 30)
44#define NO_OS_MDIO_OP_ADDRESS 0
45#define NO_OS_MDIO_OP_WRITE 1
46#define NO_OS_MDIO_OP_READ 2
47#define NO_OS_MDIO_OP_MASK NO_OS_GENMASK(29, 28)
48#define NO_OS_MDIO_PHYADDR_MASK NO_OS_GENMASK(27, 23)
49#define NO_OS_MDIO_REGADDR_MASK NO_OS_GENMASK(22, 18)
50#define NO_OS_MDIO_TURNAROUND 2
51#define NO_OS_MDIO_TURNAROUND_MASK NO_OS_GENMASK(17, 16)
52#define NO_OS_MDIO_DATA_MASK NO_OS_GENMASK(15, 0)
53#define NO_OS_MDIO_C45_DEVADDR_MASK NO_OS_GENMASK(20, 16)
54#define NO_OS_MDIO_C45_ADDR(dev, reg) (NO_OS_BIT(31) | no_os_field_prep(NO_OS_MDIO_C45_DEVADDR_MASK, dev) | (uint16_t)reg)
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 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 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
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
Header file of utility functions.
MDIO device descriptor created with no_os_mdio_init().
Definition no_os_mdio.h:78
uint8_t addr
Definition no_os_mdio.h:81
bool c45
Definition no_os_mdio.h:80
int id
Definition no_os_mdio.h:79
void * extra
Definition no_os_mdio.h:83
struct no_os_mdio_ops * ops
Definition no_os_mdio.h:82
Parameters for an MDIO slave.
Definition no_os_mdio.h:60
struct no_os_mdio_ops * ops
Definition no_os_mdio.h:69
uint8_t addr
Definition no_os_mdio.h:67
int id
Definition no_os_mdio.h:62
bool c45
Definition no_os_mdio.h:65
void * extra
Definition no_os_mdio.h:71
Collection of MDIO ops that point to specific implementations.
Definition no_os_mdio.h:90
int(* read)(struct no_os_mdio_desc *, uint32_t, uint16_t *)
Definition no_os_mdio.h:96
int(* write)(struct no_os_mdio_desc *, uint32_t, uint16_t)
Definition no_os_mdio.h:94
int(* remove)(struct no_os_mdio_desc *)
Definition no_os_mdio.h:98
int(* init)(struct no_os_mdio_desc **, struct no_os_mdio_init_param *)
Definition no_os_mdio.h:92