All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ramon Fried <rfried.dev@gmail.com>
To: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
Cc: Stefano Babic <sbabic@denx.de>,
	Fabio Estevam <festevam@gmail.com>,
	 Joe Hershberger <joe.hershberger@ni.com>,
	U-Boot Mailing List <u-boot@lists.denx.de>,
	Peng Fan <peng.fan@nxp.com>
Subject: Re: [PATCH V2 47/49] net: dwc_eth_qos: intrdouce eqos hook eqos_get_enetaddr
Date: Sun, 3 Jul 2022 22:19:27 +0300	[thread overview]
Message-ID: <CAGi-RUKuECqibOuHmPDiR1vYK33Ma+-sSuTT4qaJT_S9Z-Vmbg@mail.gmail.com> (raw)
In-Reply-To: <20220627032455.28280-48-peng.fan@oss.nxp.com>

intrdouce -> introduce

On Mon, Jun 27, 2022 at 5:44 AM Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote:
>
> From: Peng Fan <peng.fan@nxp.com>
>
> 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>
> ---
>  drivers/net/dwc_eth_qos.c     |  9 ++++++---
>  drivers/net/dwc_eth_qos.h     |  1 +
>  drivers/net/dwc_eth_qos_imx.c | 12 +++++++++++-
>  3 files changed, 18 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c
> index a4380d17d9c..c1f2391d635 100644
> --- 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)
>  static int eqos_read_rom_hwaddr(struct udevice *dev)
>  {
>         struct eth_pdata *pdata = dev_get_plat(dev);
> +       struct eqos_priv *eqos = dev_get_priv(dev);
> +       int ret;
> +
> +       ret = eqos->config->ops->eqos_get_enetaddr(dev);
> +       if (ret < 0)
> +               return ret;
>
> -#ifdef CONFIG_ARCH_IMX8M
> -       imx_get_mac_from_fuse(dev_seq(dev), pdata->enetaddr);
> -#endif
>         return !is_valid_ethaddr(pdata->enetaddr);
>  }
>
> diff --git a/drivers/net/dwc_eth_qos.h b/drivers/net/dwc_eth_qos.h
> index f470189e8d4..b35e7742634 100644
> --- a/drivers/net/dwc_eth_qos.h
> +++ b/drivers/net/dwc_eth_qos.h
> @@ -240,6 +240,7 @@ struct eqos_ops {
>         int (*eqos_calibrate_pads)(struct udevice *dev);
>         int (*eqos_disable_calibration)(struct udevice *dev);
>         int (*eqos_set_tx_clk_speed)(struct udevice *dev);
> +       int (*eqos_get_enetaddr)(struct udevice *dev);
>         ulong (*eqos_get_tick_clk_rate)(struct udevice *dev);
>  };
>
> diff --git a/drivers/net/dwc_eth_qos_imx.c b/drivers/net/dwc_eth_qos_imx.c
> index 2d1b5104af2..42cb164ad14 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 = {
> --
> 2.36.0
>

  reply	other threads:[~2022-07-03 19:19 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-27  3:24 [PATCH V2 00/49] imx: support i.MX93 Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 01/49] spl: imx8mm: enlarge SPL_MAX_SIZE Peng Fan (OSS)
2022-06-29 10:09   ` Frieder Schrempf
2022-07-05  1:35     ` Peng Fan
2022-07-05  2:08       ` Peng Fan
2022-07-05  6:40         ` Frieder Schrempf
2022-06-27  3:24 ` [PATCH V2 02/49] arm: makefile: cleanup mach-imx usage Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 03/49] imx: Change USB boot device type Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 04/49] imx: spl: Allow iMX7/8/8M to overwrite spl_board_boot_device Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 05/49] imx: simplify dependency with SPL_BOOTROM_SUPPORT Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 06/49] imx: move get_boot_device to common header Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 07/49] imx: move get_boot_device to common file Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 08/49] imx: add USB2_BOOT type Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 09/49] imx: add basic i.MX9 support Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 10/49] fsl_lpuart: add " Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 11/49] gpio: pca953x: support pcal6524 Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 12/49] imx: pinctrl: add pinctrl and pinfunc file for i.MX93 Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 13/49] imx: imx9: Add CCM and clock API support Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 14/49] mmc: fsl_esdhc_imx: Support i.MX9 Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 15/49] spl: Use SPL_FIT_IMAGE_TINY for iMX9 Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 16/49] imx: imx9: Add function to initialize timer Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 17/49] imx: imx9: disable watchdog Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 18/49] imx: imx9: support romapi Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 19/49] misc: imx: S400_API: Move S400 MU and API to a common place Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 20/49] misc: s4mu: Support iMX93 with Sentinel MU Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 21/49] misc: S400_API: Update release RDC API Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 22/49] misc: S400_API: New API for FW status and chip info Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 23/49] misc: s400_api: introduce ahab_release_m33_trout Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 24/49] imx: imx9: Add TRDC driver for TRDC init Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 25/49] imx: imx9: Add AHAB boot support Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 26/49] imx: imx9: Get the chip revision through S400 API Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 27/49] misc: S400_API: Rename imx8ulp_s400_msg to sentinel_msg Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 28/49] misc: imx8ulp: move fuse.c from imx8ulp to sentinel Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 29/49] misc: fuse: support to access fuse on i.MX93 Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 30/49] misc: fuse: update the code for accessing fuse of i.MX93 Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 31/49] imx: imx9: Add gpio registers structure Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 32/49] imx: imx9: Add MIX power init Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 33/49] imx: imx9: Add M33 release prepare function Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 34/49] imx: imx9: Support booting m33 from Acore Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 35/49] imx: imx9: Support multiple env storages at runtime Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 36/49] imx: imx9: clock: Add DDR clock support Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 37/49] ddr: imx: Add i.MX9 DDR controller driver Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 38/49] ddr: imx9: enable Performance monitor counter Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 39/49] arm: dts: Add i.MX93 SoC DTSi file Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 40/49] imx: imx93_evk: Add basic board support Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 41/49] imx: imx93_evk: Set ARM clock to 1.7Ghz Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 42/49] net: fec_mxc: support i.MX93 Peng Fan (OSS)
2022-07-03 19:13   ` Ramon Fried
2022-06-27  3:24 ` [PATCH V2 43/49] net: dwc_eth_qos: fix build break when CLK not enabled Peng Fan (OSS)
2022-07-03 19:21   ` Ramon Fried
2022-06-27  3:24 ` [PATCH V2 44/49] net: dwc_eth_qos: public some functions Peng Fan (OSS)
2022-07-03 19:14   ` Ramon Fried
2022-06-27  3:24 ` [PATCH V2 45/49] net: dwc_eth_qos: move i.MX code out Peng Fan (OSS)
2022-07-03 19:15   ` Ramon Fried
2022-06-27  3:24 ` [PATCH V2 46/49] net: eqos: add function to get phy node and address Peng Fan (OSS)
2022-07-03 19:17   ` Ramon Fried
2022-06-27  3:24 ` [PATCH V2 47/49] net: dwc_eth_qos: intrdouce eqos hook eqos_get_enetaddr Peng Fan (OSS)
2022-07-03 19:19   ` Ramon Fried [this message]
2022-06-27  3:24 ` [PATCH V2 48/49] board: freescale: imx93_evk: support ethernet Peng Fan (OSS)
2022-06-27  3:24 ` [PATCH V2 49/49] tools: image: support i.MX93 Peng Fan (OSS)
2022-06-27  6:45 ` [PATCH V2 00/49] imx: " Peng Fan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGi-RUKuECqibOuHmPDiR1vYK33Ma+-sSuTT4qaJT_S9Z-Vmbg@mail.gmail.com \
    --to=rfried.dev@gmail.com \
    --cc=festevam@gmail.com \
    --cc=joe.hershberger@ni.com \
    --cc=peng.fan@nxp.com \
    --cc=peng.fan@oss.nxp.com \
    --cc=sbabic@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.