Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
eth_nxp_enet_qos.h
Go to the documentation of this file.
1/*
2 * Copyright 2023-2026 NXP
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
12
13#ifndef ZEPHYR_INCLUDE_DRIVERS_ETH_NXP_ENET_QOS_H__
14#define ZEPHYR_INCLUDE_DRIVERS_ETH_NXP_ENET_QOS_H__
15
16#include <fsl_device_registers.h>
18
20
21/* Different platforms named the peripheral different in the register definitions */
22#if defined(CONFIG_SOC_FAMILY_MCXN) || defined(CONFIG_SOC_FAMILY_MCXA)
23#undef ENET
24#define ENET_QOS_NAME ENET
25#define ENET_QOS_ALIGNMENT 4
26typedef ENET_Type enet_qos_t;
27#else
28#error "ENET_QOS not enabled on this SOC series"
29#endif
30
31#define _PREFIX_UNDERLINE(x) _##x
32#define _ENET_QOS_REG_FIELD(reg, field) MACRO_MAP_CAT(_PREFIX_UNDERLINE, reg, field, MASK)
33#define _ENET_QOS_REG_MASK(reg, field) CONCAT(ENET_QOS_NAME, _ENET_QOS_REG_FIELD(reg, field))
34
35/* Deciphers value of a field from a read value of an enet qos register
36 *
37 * reg: name of the register
38 * field: name of the bit field within the register
39 * val: value that had been read from the register
40 */
41#define ENET_QOS_REG_GET(reg, field, val) FIELD_GET(_ENET_QOS_REG_MASK(reg, field), val)
42
43/* Prepares value of a field for a write to an enet qos register
44 *
45 * reg: name of the register
46 * field: name of the bit field within the register
47 * val: value to put into the field
48 */
49#define ENET_QOS_REG_PREP(reg, field, val) FIELD_PREP(_ENET_QOS_REG_MASK(reg, field), val)
50
51
52#define ENET_QOS_ALIGN_ADDR_SHIFT(x) (x >> (ENET_QOS_ALIGNMENT >> 1))
53
54struct nxp_enet_qos_config {
55 const struct pinctrl_dev_config *pincfg;
56 const struct device *clock_dev;
57 clock_control_subsys_t clock_subsys;
58 enet_qos_t *base;
59};
60#define ENET_QOS_MODULE_CFG(module_dev) ((struct nxp_enet_qos_config *) module_dev->config)
61
63
64#endif /* ZEPHYR_INCLUDE_DRIVERS_ETH_NXP_ENET_H__ */
Main header file for clock control driver API.
void * clock_control_subsys_t
Opaque handle identifying a clock controller subsystem.
Definition clock_control.h:65