All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ramon Fried <rfried.dev@gmail.com>
To: Tim Harvey <tharvey@gateworks.com>
Cc: Stefano Babic <sbabic@denx.de>,
	Fabio Estevam <festevam@gmail.com>,
	 "NXP i . MX U-Boot Team" <uboot-imx@nxp.com>,
	Joe Hershberger <joe.hershberger@ni.com>,
	 U-Boot Mailing List <u-boot@lists.denx.de>,
	Vladimir Oltean <vladimir.oltean@nxp.com>,
	 Claudiu Manoil <claudiu.manoil@nxp.com>,
	Michael Walle <michael@walle.cc>
Subject: Re: [PATCH 5/9] net: fec: add set_promisc function
Date: Fri, 2 Jul 2021 12:46:25 +0300	[thread overview]
Message-ID: <CAGi-RUKCLiJz88LrGrfaM8mqZbvsOnOExDOkK-vs4iNyraNtqg@mail.gmail.com> (raw)
In-Reply-To: <20210630235010.27536-6-tharvey@gateworks.com>

On Thu, Jul 1, 2021 at 2:50 AM Tim Harvey <tharvey@gateworks.com> wrote:
>
> Enabling promiscuous mode is necessary if FEC is the master of a DSA
> switch driver where each port has their own MAC address.
>
> Signed-off-by: Tim Harvey <tharvey@gateworks.com>
> ---
>  drivers/net/fec_mxc.c | 13 +++++++++++++
>  drivers/net/fec_mxc.h |  1 +
>  2 files changed, 14 insertions(+)
>
> diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
> index 77680491d0..db2cdaf684 100644
> --- a/drivers/net/fec_mxc.c
> +++ b/drivers/net/fec_mxc.c
> @@ -458,6 +458,9 @@ static void fec_reg_setup(struct fec_priv *fec)
>         else if (fec->xcv_type == RMII)
>                 rcntrl |= FEC_RCNTRL_RMII;
>
> +       if (fec->promisc)
> +               rcntrl |= 0x8;
> +
>         writel(rcntrl, &fec->eth->r_cntrl);
>  }
>
> @@ -1278,6 +1281,15 @@ static int fecmxc_read_rom_hwaddr(struct udevice *dev)
>         return fec_get_hwaddr(priv->dev_id, pdata->enetaddr);
>  }
>
> +static int fecmxc_set_promisc(struct udevice *dev, bool enable)
> +{
> +       struct fec_priv *priv = dev_get_priv(dev);
> +
> +       priv->promisc = enable;
> +
> +       return 0;
> +}
> +
>  static int fecmxc_free_pkt(struct udevice *dev, uchar *packet, int length)
>  {
>         if (packet)
> @@ -1294,6 +1306,7 @@ static const struct eth_ops fecmxc_ops = {
>         .stop                   = fecmxc_halt,
>         .write_hwaddr           = fecmxc_set_hwaddr,
>         .read_rom_hwaddr        = fecmxc_read_rom_hwaddr,
> +       .set_promisc            = fecmxc_set_promisc,
>  };
>
>  static int device_get_phy_addr(struct fec_priv *priv, struct udevice *dev)
> diff --git a/drivers/net/fec_mxc.h b/drivers/net/fec_mxc.h
> index 5ccde9193b..62b55ef395 100644
> --- a/drivers/net/fec_mxc.h
> +++ b/drivers/net/fec_mxc.h
> @@ -272,6 +272,7 @@ struct fec_priv {
>         struct clk clk_ref;
>         struct clk clk_ptp;
>         u32 clk_rate;
> +       char promisc;
>  };
>
>  /**
> --
> 2.17.1
>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>

  reply	other threads:[~2021-07-02  9:46 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-30 23:50 [PATCH 0/9] Add support for imx8mm-venice-gw7901 and DSA switch Tim Harvey
2021-06-30 23:50 ` [PATCH 1/9] board: gateworks: venice: add imx8mm-gw7901 support Tim Harvey
2021-07-10 19:35   ` sbabic
2021-06-30 23:50 ` [PATCH 2/9] net: fec: use device sequence vs index when fetching fec Tim Harvey
2021-07-02  9:44   ` Ramon Fried
2021-07-10 19:35   ` sbabic
2021-06-30 23:50 ` [PATCH 3/9] net: fec: set phy_of_node properly for fixed-link phy Tim Harvey
2021-07-02  9:44   ` Ramon Fried
2021-07-10 19:34   ` sbabic
2021-06-30 23:50 ` [PATCH 4/9] net: add set_promisc function to enable/disable Promiscuous mode Tim Harvey
2021-07-02  9:46   ` Ramon Fried
2021-07-10 19:36   ` sbabic
2021-06-30 23:50 ` [PATCH 5/9] net: fec: add set_promisc function Tim Harvey
2021-07-02  9:46   ` Ramon Fried [this message]
2021-07-10 19:35   ` sbabic
2021-06-30 23:50 ` [PATCH 6/9] net: dsa: enable master promisc mode if available and needed Tim Harvey
2021-07-02  9:47   ` Ramon Fried
2021-07-10 19:35   ` sbabic
2021-06-30 23:50 ` [PATCH 7/9] net: add support for KSZ9477/KSZ9897/KSZ9567 GbE switch Tim Harvey
2021-07-02  9:49   ` Ramon Fried
2021-07-10 19:35   ` sbabic
2021-06-30 23:50 ` [PATCH 8/9] arm: dts: imx8mm-venice-gw7901.dts: fix dsa switch configuration Tim Harvey
2021-07-10 19:35   ` sbabic
2021-06-30 23:50 ` [PATCH 9/9] configs: imx8mm_venice_defconfig: add support for gbe switch Tim Harvey
2021-07-10 19:37   ` sbabic

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-RUKCLiJz88LrGrfaM8mqZbvsOnOExDOkK-vs4iNyraNtqg@mail.gmail.com \
    --to=rfried.dev@gmail.com \
    --cc=claudiu.manoil@nxp.com \
    --cc=festevam@gmail.com \
    --cc=joe.hershberger@ni.com \
    --cc=michael@walle.cc \
    --cc=sbabic@denx.de \
    --cc=tharvey@gateworks.com \
    --cc=u-boot@lists.denx.de \
    --cc=uboot-imx@nxp.com \
    --cc=vladimir.oltean@nxp.com \
    /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.