All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ramon Fried <rfried.dev@gmail.com>
To: Robert Marko <robert.marko@sartura.hr>
Cc: "U-Boot Mailing List" <u-boot@lists.denx.de>,
	"Stefan Roese" <sr@denx.de>, "Pali Rohár" <pali@kernel.org>,
	"Marek Behun" <marek.behun@nic.cz>
Subject: Re: [PATCH v3 2/4] net: mvneta: add SFP TX disable handling
Date: Fri, 1 Apr 2022 18:34:35 +0300	[thread overview]
Message-ID: <CAGi-RUJYDA6sc_TeDhLoTmg5gV+0sTwwO1QQ14G_OrnkhaYrjw@mail.gmail.com> (raw)
In-Reply-To: <20220324095739.1162965-2-robert.marko@sartura.hr>

On Thu, Mar 24, 2022 at 11:58 AM Robert Marko <robert.marko@sartura.hr> wrote:
>
> Add support for handling SFP TX disable for MVNETA in the same fashion as
> to what MVPP2 is doing in order to enable using SFP-s.
>
> This allows using ethernet on SFP only boards.
>
> Signed-off-by: Robert Marko <robert.marko@sartura.hr>
> ---
> Changes in v3:
> * Check whether the SFP node is enabled
>
> Changes in v2:
> * Parse the standard SFP node for TX disable GPIO instead of using a
> custom property
>
>  drivers/net/mvneta.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/drivers/net/mvneta.c b/drivers/net/mvneta.c
> index 4a4268c2b2..edd818338c 100644
> --- a/drivers/net/mvneta.c
> +++ b/drivers/net/mvneta.c
> @@ -286,6 +286,7 @@ struct mvneta_port {
>         struct phy_device *phydev;
>  #if CONFIG_IS_ENABLED(DM_GPIO)
>         struct gpio_desc phy_reset_gpio;
> +       struct gpio_desc sfp_tx_disable_gpio;
>  #endif
>         struct mii_dev *bus;
>  };
> @@ -1693,6 +1694,9 @@ static int mvneta_probe(struct udevice *dev)
>  {
>         struct eth_pdata *pdata = dev_get_plat(dev);
>         struct mvneta_port *pp = dev_get_priv(dev);
> +#if CONFIG_IS_ENABLED(DM_GPIO)
> +       struct ofnode_phandle_args sfp_args;
> +#endif
>         void *blob = (void *)gd->fdt_blob;
>         int node = dev_of_offset(dev);
>         struct mii_dev *bus;
> @@ -1767,6 +1771,11 @@ static int mvneta_probe(struct udevice *dev)
>                 return ret;
>
>  #if CONFIG_IS_ENABLED(DM_GPIO)
> +       ret = dev_read_phandle_with_args(dev, "sfp", NULL, 0, 0, &sfp_args);
> +       if (!ret && ofnode_is_enabled(sfp_args.node))
> +               gpio_request_by_name_nodev(sfp_args.node, "tx-disable-gpio", 0,
> +                                          &pp->sfp_tx_disable_gpio, GPIOD_IS_OUT);
> +
>         gpio_request_by_name(dev, "phy-reset-gpios", 0,
>                              &pp->phy_reset_gpio, GPIOD_IS_OUT);
>
> @@ -1775,6 +1784,9 @@ static int mvneta_probe(struct udevice *dev)
>                 mdelay(10);
>                 dm_gpio_set_value(&pp->phy_reset_gpio, 0);
>         }
> +
> +       if (dm_gpio_is_valid(&pp->sfp_tx_disable_gpio))
> +               dm_gpio_set_value(&pp->sfp_tx_disable_gpio, 0);
>  #endif
>
>         return board_network_enable(bus);
> --
> 2.35.1
>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>

  parent reply	other threads:[~2022-04-01 15:35 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-24  9:57 [PATCH v3 1/4] arm: mvebu: dts: uDPU: update DTS Robert Marko
2022-03-24  9:57 ` [PATCH v3 2/4] net: mvneta: add SFP TX disable handling Robert Marko
2022-03-24 10:12   ` Marek Behún
2022-03-24 10:59     ` Robert Marko
2022-04-01 15:34   ` Ramon Fried [this message]
2022-04-07  6:58   ` Stefan Roese
2022-04-21 14:05   ` Stefan Roese
2022-03-24  9:57 ` [PATCH v3 3/4] arm: mvebu: dts: uDPU: fix non-working networking Robert Marko
2022-04-07  6:58   ` Stefan Roese
2022-04-21 14:05   ` Stefan Roese
2022-03-24  9:57 ` [PATCH v3 4/4] mvebu: uDPU: update defconfig Robert Marko
2022-04-07  6:59   ` Stefan Roese
2022-04-21 14:05   ` Stefan Roese
2022-04-07  6:57 ` [PATCH v3 1/4] arm: mvebu: dts: uDPU: update DTS Stefan Roese
2022-04-21 14:04 ` Stefan Roese

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-RUJYDA6sc_TeDhLoTmg5gV+0sTwwO1QQ14G_OrnkhaYrjw@mail.gmail.com \
    --to=rfried.dev@gmail.com \
    --cc=marek.behun@nic.cz \
    --cc=pali@kernel.org \
    --cc=robert.marko@sartura.hr \
    --cc=sr@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.