summaryrefslogtreecommitdiff
path: root/drivers/net/dwc_eth_qos_imx.c
diff options
context:
space:
mode:
authorPeng Fan <peng.fan@nxp.com>2022-07-26 16:41:17 +0800
committerStefano Babic <sbabic@denx.de>2022-07-26 11:29:01 +0200
commita624251461bf9750d8a11545972fe575fc4cbf85 (patch)
tree97a37f774fb8efc840b6d87b76c62fd010c5c094 /drivers/net/dwc_eth_qos_imx.c
parenta6acf95508e268d6311408d24339b42fe6e5be14 (diff)
net: dwc_eth_qos: introduce eqos hook eqos_get_enetaddr
i.MX has specific hook to get MAC address, so introduce a hook and move i.MX code to its own driver Signed-off-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'drivers/net/dwc_eth_qos_imx.c')
-rw-r--r--drivers/net/dwc_eth_qos_imx.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/net/dwc_eth_qos_imx.c b/drivers/net/dwc_eth_qos_imx.c
index 2d1b5104af..42cb164ad1 100644
--- a/drivers/net/dwc_eth_qos_imx.c
+++ b/drivers/net/dwc_eth_qos_imx.c
@@ -92,6 +92,15 @@ static int eqos_set_tx_clk_speed_imx(struct udevice *dev)
return 0;
}
+static int eqos_get_enetaddr_imx(struct udevice *dev)
+{
+ struct eth_pdata *pdata = dev_get_plat(dev);
+
+ imx_get_mac_from_fuse(dev_seq(dev), pdata->enetaddr);
+
+ return 0;
+}
+
static struct eqos_ops eqos_imx_ops = {
.eqos_inval_desc = eqos_inval_desc_generic,
.eqos_flush_desc = eqos_flush_desc_generic,
@@ -106,7 +115,8 @@ static struct eqos_ops eqos_imx_ops = {
.eqos_calibrate_pads = eqos_null_ops,
.eqos_disable_calibration = eqos_null_ops,
.eqos_set_tx_clk_speed = eqos_set_tx_clk_speed_imx,
- .eqos_get_tick_clk_rate = eqos_get_tick_clk_rate_imx
+ .eqos_get_enetaddr = eqos_get_enetaddr_imx,
+ .eqos_get_tick_clk_rate = eqos_get_tick_clk_rate_imx,
};
struct eqos_config __maybe_unused eqos_imx_config = {