mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Oleksij Rempel <linux@rempel-privat.de>
To: Oleksij Rempel <o.rempel@pengutronix.de>, barebox@lists.infradead.org
Subject: Re: [PATCH v1 3/9] net: add DSA framework to support basic switch functionality
Date: Fri, 25 Mar 2022 10:37:29 +0100	[thread overview]
Message-ID: <e7ed1d0b-fb49-1151-e0f1-b5a88a85d1b9@rempel-privat.de> (raw)
In-Reply-To: <20220321092606.1459834-4-o.rempel@pengutronix.de>

Am 21.03.22 um 10:26 schrieb Oleksij Rempel:
> Add DSA based port multiplexing functionality for barebox. With this
> framework we will be able to use different ports of as switch
> separately.
>
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---
>   drivers/net/Kconfig  |   3 +
>   drivers/net/Makefile |   1 +
>   drivers/net/dsa.c    | 385 +++++++++++++++++++++++++++++++++++++++++++
>   include/dsa.h        |  94 +++++++++++
>   4 files changed, 483 insertions(+)
>   create mode 100644 drivers/net/dsa.c
>   create mode 100644 include/dsa.h
>
> diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
> index b583299a44..419f8c515d 100644
> --- a/drivers/net/Kconfig
> +++ b/drivers/net/Kconfig
> @@ -17,6 +17,9 @@ config HAS_MACB
>   config PHYLIB
>   	bool
>
> +config DSA
> +	bool
> +
>   menu "Network drivers"
>   	depends on NET
>
> diff --git a/drivers/net/Makefile b/drivers/net/Makefile
> index 563dfdfd9e..ef3513a6b0 100644
> --- a/drivers/net/Makefile
> +++ b/drivers/net/Makefile
> @@ -1,4 +1,5 @@
>   # SPDX-License-Identifier: GPL-2.0-only
> +obj-$(CONFIG_DSA)			+= dsa.o
>   obj-$(CONFIG_PHYLIB)			+= phy/
>   obj-$(CONFIG_NET_USB)			+= usb/
>
> diff --git a/drivers/net/dsa.c b/drivers/net/dsa.c
> new file mode 100644
> index 0000000000..a9e3563b9b
> --- /dev/null
> +++ b/drivers/net/dsa.c
> @@ -0,0 +1,385 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +
> +#include <common.h>
> +#include <dma.h>
> +#include <dsa.h>
> +#include <of_net.h>
> +
> +static int dsa_port_probe(struct eth_device *edev)
> +{
> +	struct dsa_port *dp = edev->priv;
> +	struct dsa_switch *ds = dp->ds;
> +	const struct dsa_ops *ops = ds->ops;
> +	phy_interface_t interface;
> +	int ret;
> +
> +	interface = of_get_phy_mode(dp->dev.device_node);
> +	ret = phy_device_connect(edev, NULL, 0, NULL, 0, interface);
> +	if (ret)
> +		return ret;
> +
> +	if (ops->port_probe) {
> +		ret = ops->port_probe(dp, dp->index, dp->edev.phydev);
> +		if (ret)
> +			return ret;
> +	}

The probe part should be reworked to enable CLK for RMII PHYs early.

--
Regards,
Oleksij

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


  reply	other threads:[~2022-03-25  9:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-21  9:25 [PATCH v1 0/9] add basic DSA support Oleksij Rempel
2022-03-21  9:25 ` [PATCH v1 1/9] net: add RX preprocessor support Oleksij Rempel
2022-03-21  9:25 ` [PATCH v1 2/9] net: add of_find_eth_device_by_node() function Oleksij Rempel
2022-03-21  9:26 ` [PATCH v1 3/9] net: add DSA framework to support basic switch functionality Oleksij Rempel
2022-03-25  9:37   ` Oleksij Rempel [this message]
2022-03-28 10:31   ` Sascha Hauer
2022-03-28 12:23     ` Oleksij Rempel
2022-03-21  9:26 ` [PATCH v1 4/9] driver: add dev_get_priv() helper Oleksij Rempel
2022-03-21  9:26 ` [PATCH v1 5/9] net: port part of if_vlan header from kernel v5.17 Oleksij Rempel
2022-03-21  9:26 ` [PATCH v1 6/9] spi: port spi_sync_transfer() function " Oleksij Rempel
2022-03-21  9:26 ` [PATCH v1 7/9] net: mdio: add MDIO_DEVAD_NONE define Oleksij Rempel
2022-03-21  9:26 ` [PATCH v1 8/9] net: phy: make sure MDIO bus is probed if we search for the PHY Oleksij Rempel
2022-03-21  9:26 ` [PATCH v1 9/9] net: dsa: add support for SJA11xx switches Oleksij Rempel
2022-03-28 10:40   ` Sascha Hauer

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=e7ed1d0b-fb49-1151-e0f1-b5a88a85d1b9@rempel-privat.de \
    --to=linux@rempel-privat.de \
    --cc=barebox@lists.infradead.org \
    --cc=o.rempel@pengutronix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox