Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
eth_nxp_enet.h
Go to the documentation of this file.
1/*
2 * Copyright 2023 NXP
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
12
13#ifndef ZEPHYR_INCLUDE_DRIVERS_ETH_NXP_ENET_H__
14#define ZEPHYR_INCLUDE_DRIVERS_ETH_NXP_ENET_H__
15
16/*
17 * This header is for NXP ENET driver development
18 * and has definitions for internal implementations
19 * not to be used by application
20 */
21
22#include <zephyr/device.h>
23#include <zephyr/kernel.h>
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
30
31/*
32 * Reasons for callback to a driver:
33 *
34 * Module reset: The ENET module was reset, perhaps because of power management
35 * actions, and subdriver should reinitialize part of the module.
36 * Interrupt: An interrupt of a type relevant to the subdriver occurred.
37 * Interrupt enable: The driver's relevant interrupt was enabled in NVIC
38 */
39enum nxp_enet_callback_reason {
40 NXP_ENET_MODULE_RESET,
41 NXP_ENET_INTERRUPT,
42 NXP_ENET_INTERRUPT_ENABLED,
43};
44
45enum nxp_enet_driver {
46 NXP_ENET_MAC,
47 NXP_ENET_MDIO,
48 NXP_ENET_PTP_CLOCK,
49};
50
51struct nxp_enet_ptp_data {
52 struct k_sem ptp_ts_sem;
53 struct k_mutex *ptp_mutex; /* created in PTP driver */
54 void *enet; /* enet_handle poiniter used by PTP driver */
55};
56
57#ifdef CONFIG_MDIO_NXP_ENET
58extern void nxp_enet_mdio_callback(const struct device *mdio_dev,
59 enum nxp_enet_callback_reason event,
60 void *data);
61#else
62#define nxp_enet_mdio_callback(...)
63#endif
64
65#ifdef CONFIG_PTP_CLOCK_NXP_ENET
66extern void nxp_enet_ptp_clock_callback(const struct device *dev,
67 enum nxp_enet_callback_reason event,
68 void *data);
69#else
70#define nxp_enet_ptp_clock_callback(...)
71#endif
72
73/*
74 * Internal implementation, inter-driver communication function
75 *
76 * dev: target device to call back
77 * dev_type: which driver to call back
78 * event: reason/cause of callback
79 * data: opaque data, will be interpreted based on reason and target driver
80 */
81extern void nxp_enet_driver_cb(const struct device *dev,
82 enum nxp_enet_driver dev_type,
83 enum nxp_enet_callback_reason event,
84 void *data);
85
87
88#ifdef __cplusplus
89}
90#endif
91
92
93#endif /* ZEPHYR_INCLUDE_DRIVERS_ETH_NXP_ENET_H__ */
Public kernel APIs.
Runtime device structure (in ROM) per driver instance.
Definition device.h:513