|
3 | 3 | *
|
4 | 4 | * SPDX-License-Identifier: Apache-2.0
|
5 | 5 | */
|
| 6 | +#define DT_DRV_COMPAT nxp_imx_netc |
6 | 7 |
|
7 | 8 | #define LOG_LEVEL CONFIG_ETHERNET_LOG_LEVEL
|
8 | 9 | #include <zephyr/logging/log.h>
|
@@ -32,6 +33,17 @@ LOG_MODULE_REGISTER(nxp_imx_eth);
|
32 | 33 | #define NETC_HAS_NO_SWITCH_TAG_SUPPORT 1
|
33 | 34 | #endif
|
34 | 35 |
|
| 36 | +#define DEV_CFG(_dev) ((const struct eth_nxp_imx_netc_ecam_config *)(_dev)->config) |
| 37 | +#define DEV_DATA(_dev) ((struct eth_nxp_imx_netc_ecam_data *)(_dev)->data) |
| 38 | + |
| 39 | +struct eth_nxp_imx_netc_ecam_config { |
| 40 | + DEVICE_MMIO_NAMED_ROM(base); |
| 41 | +}; |
| 42 | + |
| 43 | +struct eth_nxp_imx_netc_ecam_data { |
| 44 | + DEVICE_MMIO_NAMED_RAM(base); |
| 45 | +}; |
| 46 | + |
35 | 47 | const struct device *netc_dev_list[NETC_DRV_MAX_INST_SUPPORT];
|
36 | 48 |
|
37 | 49 | #ifdef CONFIG_PTP_CLOCK_NXP_NETC
|
@@ -529,3 +541,22 @@ int netc_eth_set_config(const struct device *dev, enum ethernet_config_type type
|
529 | 541 |
|
530 | 542 | return ret;
|
531 | 543 | }
|
| 544 | + |
| 545 | +static int eth_nxp_imx_netc_ecam_init(const struct device *dev) |
| 546 | +{ |
| 547 | + DEVICE_MMIO_NAMED_MAP(dev, base, K_MEM_CACHE_NONE | K_MEM_DIRECT_MAP); |
| 548 | + |
| 549 | + return 0; |
| 550 | +} |
| 551 | + |
| 552 | +#define ETH_NXP_IMX_NETC_ECAM_INIT(inst) \ |
| 553 | + static struct eth_nxp_imx_netc_ecam_data eth_nxp_imx_netc_ecam_data_##inst; \ |
| 554 | + static const struct eth_nxp_imx_netc_ecam_config eth_nxp_imx_netc_ecam_config_##inst = { \ |
| 555 | + DEVICE_MMIO_NAMED_ROM_INIT(base, DT_DRV_INST(inst)), \ |
| 556 | + }; \ |
| 557 | + DEVICE_DT_INST_DEFINE(inst, eth_nxp_imx_netc_ecam_init, NULL, \ |
| 558 | + ð_nxp_imx_netc_ecam_data_##inst, \ |
| 559 | + ð_nxp_imx_netc_ecam_config_##inst, POST_KERNEL, \ |
| 560 | + CONFIG_ETH_INIT_PRIORITY, NULL); |
| 561 | + |
| 562 | +DT_INST_FOREACH_STATUS_OKAY(ETH_NXP_IMX_NETC_ECAM_INIT) |
0 commit comments