Skip to content

Commit 82478c2

Browse files
committed
drivers: ethernet: netc_psi: add MMIPO mapping support
In order to support MMU mapping on Cortex-A core, added MMIO mapping support in imx_netc_psi driver. Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
1 parent c242be4 commit 82478c2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/ethernet/nxp_imx_netc/eth_nxp_imx_netc_psi.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ LOG_MODULE_REGISTER(nxp_imx_eth_psi);
2222
#include "../eth.h"
2323
#include "eth_nxp_imx_netc_priv.h"
2424

25+
#define DEV_CFG(_dev) ((const struct netc_eth_config *)(_dev)->config)
26+
#define DEV_DATA(_dev) ((struct netc_eth_data *)(_dev)->data)
27+
2528
static void netc_eth_phylink_callback(const struct device *pdev, struct phy_link_state *state,
2629
void *user_data)
2730
{
@@ -104,6 +107,8 @@ static int netc_eth_init(const struct device *dev)
104107
const struct netc_eth_config *cfg = dev->config;
105108
int err;
106109

110+
DEVICE_MMIO_NAMED_MAP(dev, base, K_MEM_CACHE_NONE | K_MEM_DIRECT_MAP);
111+
107112
if (cfg->pseudo_mac) {
108113
goto init_common;
109114
}
@@ -192,6 +197,7 @@ static const struct ethernet_api netc_eth_api = {.iface_api.init = netc_eth_ifac
192197
.rx_frame = eth##n##_rx_frame, \
193198
}; \
194199
static const struct netc_eth_config netc_eth##n##_config = { \
200+
DEVICE_MMIO_NAMED_ROM_INIT(base, DT_DRV_INST(n)), \
195201
.generate_mac = netc_eth##n##_generate_mac, \
196202
.bdr_init = netc_eth##n##_bdr_init, \
197203
.phy_dev = (COND_CODE_1(DT_INST_NODE_HAS_PROP(n, phy_handle), \

0 commit comments

Comments
 (0)