• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-cqtcocoa誰得pythonphprubygameguibathyscaphec翻訳計画中(planning stage)omegatframeworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

Commit MetaInfo

Revisióna624251461bf9750d8a11545972fe575fc4cbf85 (tree)
Tiempo2022-07-26 18:29:01
AutorPeng Fan <peng.fan@nxp....>
CommiterStefano Babic

Log Message

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>

Cambiar Resumen

Diferencia incremental

--- a/drivers/net/dwc_eth_qos.c
+++ b/drivers/net/dwc_eth_qos.c
@@ -712,10 +712,13 @@ static int eqos_write_hwaddr(struct udevice *dev)
712712 static int eqos_read_rom_hwaddr(struct udevice *dev)
713713 {
714714 struct eth_pdata *pdata = dev_get_plat(dev);
715+ struct eqos_priv *eqos = dev_get_priv(dev);
716+ int ret;
717+
718+ ret = eqos->config->ops->eqos_get_enetaddr(dev);
719+ if (ret < 0)
720+ return ret;
715721
716-#ifdef CONFIG_ARCH_IMX8M
717- imx_get_mac_from_fuse(dev_seq(dev), pdata->enetaddr);
718-#endif
719722 return !is_valid_ethaddr(pdata->enetaddr);
720723 }
721724
--- a/drivers/net/dwc_eth_qos.h
+++ b/drivers/net/dwc_eth_qos.h
@@ -240,6 +240,7 @@ struct eqos_ops {
240240 int (*eqos_calibrate_pads)(struct udevice *dev);
241241 int (*eqos_disable_calibration)(struct udevice *dev);
242242 int (*eqos_set_tx_clk_speed)(struct udevice *dev);
243+ int (*eqos_get_enetaddr)(struct udevice *dev);
243244 ulong (*eqos_get_tick_clk_rate)(struct udevice *dev);
244245 };
245246
--- 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)
9292 return 0;
9393 }
9494
95+static int eqos_get_enetaddr_imx(struct udevice *dev)
96+{
97+ struct eth_pdata *pdata = dev_get_plat(dev);
98+
99+ imx_get_mac_from_fuse(dev_seq(dev), pdata->enetaddr);
100+
101+ return 0;
102+}
103+
95104 static struct eqos_ops eqos_imx_ops = {
96105 .eqos_inval_desc = eqos_inval_desc_generic,
97106 .eqos_flush_desc = eqos_flush_desc_generic,
@@ -106,7 +115,8 @@ static struct eqos_ops eqos_imx_ops = {
106115 .eqos_calibrate_pads = eqos_null_ops,
107116 .eqos_disable_calibration = eqos_null_ops,
108117 .eqos_set_tx_clk_speed = eqos_set_tx_clk_speed_imx,
109- .eqos_get_tick_clk_rate = eqos_get_tick_clk_rate_imx
118+ .eqos_get_enetaddr = eqos_get_enetaddr_imx,
119+ .eqos_get_tick_clk_rate = eqos_get_tick_clk_rate_imx,
110120 };
111121
112122 struct eqos_config __maybe_unused eqos_imx_config = {