All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Simek <monstr@monstr.eu>
To: U-Boot <u-boot@lists.denx.de>, git <git@xilinx.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>,
	Ramon Fried <rfried.dev@gmail.com>
Subject: Re: [PATCH v2] net: zynq: Add support for GEM reset
Date: Wed, 5 Jan 2022 10:34:21 +0100	[thread overview]
Message-ID: <CAHTX3dLXXUHhJ_=77b3x-cG_bSaiSCCV4jH6CNcmH2-CnW7JkA@mail.gmail.com> (raw)
In-Reply-To: <5ae1c85b282d632bb62030f1f24a0065661b9153.1638804318.git.michal.simek@xilinx.com>

po 6. 12. 2021 v 16:25 odesílatel Michal Simek <michal.simek@xilinx.com> napsal:
>
> Perform reset before core initialization.
> Standard flow which close to 99% users are using getting all IPs out of
> reset that there is no need to reset IP again. This is because of all low
> level initialization is done in previous bootloader stage.
> In SOM case these IPs are not touched by previous bootloader stage that's
> why reset needs to be called before IP is accessed to make sure that it is
> in correct state.
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
> Changes in v2:
> - Update commit message
>
>  drivers/net/zynq_gem.c | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
>
> diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c
> index 91957757727d..5cbe8d28304b 100644
> --- a/drivers/net/zynq_gem.c
> +++ b/drivers/net/zynq_gem.c
> @@ -21,6 +21,7 @@
>  #include <asm/cache.h>
>  #include <asm/io.h>
>  #include <phy.h>
> +#include <reset.h>
>  #include <miiphy.h>
>  #include <wait_bit.h>
>  #include <watchdog.h>
> @@ -217,6 +218,7 @@ struct zynq_gem_priv {
>         bool int_pcs;
>         bool dma_64bit;
>         u32 clk_en_info;
> +       struct reset_ctl_bulk resets;
>  };
>
>  static int phy_setup_op(struct zynq_gem_priv *priv, u32 phy_addr, u32 regnum,
> @@ -688,12 +690,36 @@ static int zynq_gem_miiphy_write(struct mii_dev *bus, int addr, int devad,
>         return phywrite(priv, addr, reg, value);
>  }
>
> +static int zynq_gem_reset_init(struct udevice *dev)
> +{
> +       struct zynq_gem_priv *priv = dev_get_priv(dev);
> +       int ret;
> +
> +       ret = reset_get_bulk(dev, &priv->resets);
> +       if (ret == -ENOTSUPP || ret == -ENOENT)
> +               return 0;
> +       else if (ret)
> +               return ret;
> +
> +       ret = reset_deassert_bulk(&priv->resets);
> +       if (ret) {
> +               reset_release_bulk(&priv->resets);
> +               return ret;
> +       }
> +
> +       return 0;
> +}
> +
>  static int zynq_gem_probe(struct udevice *dev)
>  {
>         void *bd_space;
>         struct zynq_gem_priv *priv = dev_get_priv(dev);
>         int ret;
>
> +       ret = zynq_gem_reset_init(dev);
> +       if (ret)
> +               return ret;
> +
>         /* Align rxbuffers to ARCH_DMA_MINALIGN */
>         priv->rxbuffers = memalign(ARCH_DMA_MINALIGN, RX_BUF * PKTSIZE_ALIGN);
>         if (!priv->rxbuffers)
> --
> 2.33.1
>

Applied.
M

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs

      parent reply	other threads:[~2022-01-05  9:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-06 15:25 [PATCH v2] net: zynq: Add support for GEM reset Michal Simek
2021-12-09  0:23 ` Ramon Fried
2022-01-05  9:34 ` Michal Simek [this message]

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='CAHTX3dLXXUHhJ_=77b3x-cG_bSaiSCCV4jH6CNcmH2-CnW7JkA@mail.gmail.com' \
    --to=monstr@monstr.eu \
    --cc=git@xilinx.com \
    --cc=joe.hershberger@ni.com \
    --cc=rfried.dev@gmail.com \
    --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.