LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH v1] arm64: dts: fsl: ls1028a-rdb: Add dts file to choose swp5 as dsa master
@ 2021-08-13  3:01 hongbo.wang
  2021-08-13 13:09 ` Andrew Lunn
  0 siblings, 1 reply; 8+ messages in thread
From: hongbo.wang @ 2021-08-13  3:01 UTC (permalink / raw)
  To: hongjun.chen, po.liu, shawnguo, leoyang.li, vladimir.oltean,
	robh+dt, linux-arm-kernel, devicetree, andrew, f.fainelli,
	vivien.didelot, davem, netdev, linux-kernel
  Cc: hongbo wang

From: hongbo wang <hongbo.wang@nxp.com>

some use cases want to use swp4-eno2 link as ordinary data path,
so we can enable swp5 as dsa master, the data from kernel can
be transmitted to eno3, then send to swp5 via internal link, switch will
forward it to swp0-3.

the data to kernel will come from swp0-3, and received by kernel
via swp5-eno3 link.

Signed-off-by: hongbo wang <hongbo.wang@nxp.com>
---
 arch/arm64/boot/dts/freescale/Makefile        |  1 +
 .../fsl-ls1028a-rdb-dsa-swp5-eno3.dts         | 27 +++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb-dsa-swp5-eno3.dts

diff --git a/arch/arm64/boot/dts/freescale/Makefile b/arch/arm64/boot/dts/freescale/Makefile
index 25806c4924cb..032aaf52079a 100644
--- a/arch/arm64/boot/dts/freescale/Makefile
+++ b/arch/arm64/boot/dts/freescale/Makefile
@@ -12,6 +12,7 @@ dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-kontron-sl28-var3-ads2.dtb
 dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-kontron-sl28-var4.dtb
 dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-qds.dtb
 dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-rdb.dtb
+dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1028a-rdb-dsa-swp5-eno3.dtb
 dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1043a-qds.dtb
 dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1043a-rdb.dtb
 dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls1046a-frwy.dtb
diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb-dsa-swp5-eno3.dts b/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb-dsa-swp5-eno3.dts
new file mode 100644
index 000000000000..a88396c137a1
--- /dev/null
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb-dsa-swp5-eno3.dts
@@ -0,0 +1,27 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Device Tree file for NXP LS1028A RDB with dsa master swp5-eno3.
+ *
+ * Copyright 2018-2021 NXP
+ *
+ * Hongbo Wang <hongbo.wang@nxp.com>
+ *
+ */
+
+/dts-v1/;
+#include "fsl-ls1028a-rdb.dts"
+
+&enetc_port3 {
+	status = "okay";
+};
+
+&mscc_felix_port4 {
+	label = "swp4";
+	/delete-property/ ethernet;
+	status = "okay";
+};
+
+&mscc_felix_port5 {
+	ethernet = <&enetc_port3>;
+	status = "okay";
+};
-- 
2.27.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v1] arm64: dts: fsl: ls1028a-rdb: Add dts file to choose swp5 as dsa master
  2021-08-13  3:01 [PATCH v1] arm64: dts: fsl: ls1028a-rdb: Add dts file to choose swp5 as dsa master hongbo.wang
@ 2021-08-13 13:09 ` Andrew Lunn
  2021-08-13 13:56   ` [EXT] " Hongbo Wang
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Lunn @ 2021-08-13 13:09 UTC (permalink / raw)
  To: hongbo.wang
  Cc: hongjun.chen, po.liu, shawnguo, leoyang.li, vladimir.oltean,
	robh+dt, linux-arm-kernel, devicetree, f.fainelli,
	vivien.didelot, davem, netdev, linux-kernel

On Fri, Aug 13, 2021 at 11:01:55AM +0800, hongbo.wang@nxp.com wrote:
> From: hongbo wang <hongbo.wang@nxp.com>
> 
> some use cases want to use swp4-eno2 link as ordinary data path,
> so we can enable swp5 as dsa master, the data from kernel can
> be transmitted to eno3, then send to swp5 via internal link, switch will
> forward it to swp0-3.
> 
> the data to kernel will come from swp0-3, and received by kernel
> via swp5-eno3 link.
 
> new file mode 100644
> index 000000000000..a88396c137a1
> --- /dev/null
> +++ b/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb-dsa-swp5-eno3.dts
> @@ -0,0 +1,27 @@
> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> +/*
> + * Device Tree file for NXP LS1028A RDB with dsa master swp5-eno3.
> + *
> + * Copyright 2018-2021 NXP
> + *
> + * Hongbo Wang <hongbo.wang@nxp.com>
> + *
> + */
> +
> +/dts-v1/;
> +#include "fsl-ls1028a-rdb.dts"

You will end up with two DT blobs with the same top level
compatible. This is going to cause confusion. I suggest you add an
additional top level compatible to make it clear this differs from the
compatible = "fsl,ls1028a-rdb", "fsl,ls1028a" blob.

   Andrew


^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [EXT] Re: [PATCH v1] arm64: dts: fsl: ls1028a-rdb: Add dts file to choose swp5 as dsa master
  2021-08-13 13:09 ` Andrew Lunn
@ 2021-08-13 13:56   ` Hongbo Wang
  2021-08-13 14:07     ` Vladimir Oltean
  0 siblings, 1 reply; 8+ messages in thread
From: Hongbo Wang @ 2021-08-13 13:56 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Hongjun Chen, Po Liu, shawnguo, Leo Li, Vladimir Oltean, robh+dt,
	linux-arm-kernel, devicetree, f.fainelli, vivien.didelot, davem,
	netdev, linux-kernel


> On Fri, Aug 13, 2021 at 11:01:55AM +0800, hongbo.wang@nxp.com wrote:
> > From: hongbo wang <hongbo.wang@nxp.com>
> >
> > some use cases want to use swp4-eno2 link as ordinary data path, so we
> > can enable swp5 as dsa master, the data from kernel can be transmitted
> > to eno3, then send to swp5 via internal link, switch will forward it
> > to swp0-3.
> >
> > the data to kernel will come from swp0-3, and received by kernel via
> > swp5-eno3 link.
> 
> > new file mode 100644
> > index 000000000000..a88396c137a1
> > --- /dev/null
> > +++ b/arch/arm64/boot/dts/freescale/fsl-ls1028a-rdb-dsa-swp5-eno3.dts
> > @@ -0,0 +1,27 @@
> > +// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
> > +/*
> > + * Device Tree file for NXP LS1028A RDB with dsa master swp5-eno3.
> > + *
> > + * Copyright 2018-2021 NXP
> > + *
> > + * Hongbo Wang <hongbo.wang@nxp.com>
> > + *
> > + */
> > +
> > +/dts-v1/;
> > +#include "fsl-ls1028a-rdb.dts"
> 
> You will end up with two DT blobs with the same top level compatible. This is
> going to cause confusion. I suggest you add an additional top level compatible
> to make it clear this differs from the compatible = "fsl,ls1028a-rdb",
> "fsl,ls1028a" blob.
> 
>    Andrew

hi Andrew, 

  thanks for comments.

  this "fsl-ls1028a-rdb-dsa-swp5-eno3.dts" is also for fsl-ls1028a-rdb platform,
the only difference with "fsl-ls1028a-rdb.dts" is that it use swp5 as dsa master, not swp4,
and it's based on "fsl-ls1028a-rdb.dts", so I choose this manner,
if "fsl-ls1028a-rdb.dts" has some modification for new version, this file don't need be changed.

thanks,
hongbo


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [EXT] Re: [PATCH v1] arm64: dts: fsl: ls1028a-rdb: Add dts file to choose swp5 as dsa master
  2021-08-13 13:56   ` [EXT] " Hongbo Wang
@ 2021-08-13 14:07     ` Vladimir Oltean
  2021-08-13 14:25       ` Andrew Lunn
  2021-08-16  6:03       ` Hongbo Wang
  0 siblings, 2 replies; 8+ messages in thread
From: Vladimir Oltean @ 2021-08-13 14:07 UTC (permalink / raw)
  To: Hongbo Wang
  Cc: Andrew Lunn, Hongjun Chen, Po Liu, shawnguo, Leo Li, robh+dt,
	linux-arm-kernel, devicetree, f.fainelli, vivien.didelot, davem,
	netdev, linux-kernel

On Fri, Aug 13, 2021 at 01:56:53PM +0000, Hongbo Wang wrote:
> > You will end up with two DT blobs with the same top level compatible. This is
> > going to cause confusion. I suggest you add an additional top level compatible
> > to make it clear this differs from the compatible = "fsl,ls1028a-rdb",
> > "fsl,ls1028a" blob.
> >
> >    Andrew
>
> hi Andrew,
>
>   thanks for comments.
>
>   this "fsl-ls1028a-rdb-dsa-swp5-eno3.dts" is also for fsl-ls1028a-rdb platform,
> the only difference with "fsl-ls1028a-rdb.dts" is that it use swp5 as dsa master, not swp4,
> and it's based on "fsl-ls1028a-rdb.dts", so I choose this manner,
> if "fsl-ls1028a-rdb.dts" has some modification for new version, this file don't need be changed.

I tend to agree with Hongbo. What confusion is it going to cause? It is
fundamentally the same board, just an Ethernet port stopped having
'status = "disabled"' and another changed role, all inside of the SoC
with no externally-visible change. If anything, I think that creating a
new top-level compatible for each small change like this would create a
bloat-fest of its own.

I was going to suggest as an alternative to define a device tree overlay
file with the changes in the CPU port assignment, instead of defining a
wholly new DTS for the LS1028A reference design board. But I am pretty
sure that it is not possible to specify a /delete-property/ inside a
device tree overlay file, so that won't actually work.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [EXT] Re: [PATCH v1] arm64: dts: fsl: ls1028a-rdb: Add dts file to choose swp5 as dsa master
  2021-08-13 14:07     ` Vladimir Oltean
@ 2021-08-13 14:25       ` Andrew Lunn
  2021-08-16  6:03       ` Hongbo Wang
  1 sibling, 0 replies; 8+ messages in thread
From: Andrew Lunn @ 2021-08-13 14:25 UTC (permalink / raw)
  To: Vladimir Oltean
  Cc: Hongbo Wang, Hongjun Chen, Po Liu, shawnguo, Leo Li, robh+dt,
	linux-arm-kernel, devicetree, f.fainelli, vivien.didelot, davem,
	netdev, linux-kernel

> >   this "fsl-ls1028a-rdb-dsa-swp5-eno3.dts" is also for fsl-ls1028a-rdb platform,
> > the only difference with "fsl-ls1028a-rdb.dts" is that it use swp5 as dsa master, not swp4,
> > and it's based on "fsl-ls1028a-rdb.dts", so I choose this manner,
> > if "fsl-ls1028a-rdb.dts" has some modification for new version, this file don't need be changed.
> 
> I tend to agree with Hongbo. What confusion is it going to cause?

I don't know if Debian, or any other distribution, ever implemented
it, but it was suggested that the install media read the available DT
blobs and present the user with a list they can choose from. I've no
idea if this was based on the blob filename, or if it read the
compatible string.

The Compatible string is also printed in the kernel log at boot. If it
is not unique, you need further information to figure out the blob
sources.

We probably needs Rob input. Are there other boards with multiple
blobs? Do they use the same or different compatible strings?

       Andrew

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [EXT] Re: [PATCH v1] arm64: dts: fsl: ls1028a-rdb: Add dts file to choose swp5 as dsa master
  2021-08-13 14:07     ` Vladimir Oltean
  2021-08-13 14:25       ` Andrew Lunn
@ 2021-08-16  6:03       ` Hongbo Wang
  2021-08-16 17:48         ` Vladimir Oltean
  1 sibling, 1 reply; 8+ messages in thread
From: Hongbo Wang @ 2021-08-16  6:03 UTC (permalink / raw)
  To: Vladimir Oltean
  Cc: Andrew Lunn, Hongjun Chen, Po Liu, shawnguo, Leo Li, robh+dt,
	linux-arm-kernel, devicetree, f.fainelli, vivien.didelot, davem,
	netdev, linux-kernel


> On Fri, Aug 13, 2021 at 01:56:53PM +0000, Hongbo Wang wrote:
> > > You will end up with two DT blobs with the same top level
> > > compatible. This is going to cause confusion. I suggest you add an
> > > additional top level compatible to make it clear this differs from
> > > the compatible = "fsl,ls1028a-rdb", "fsl,ls1028a" blob.
> > >
> > >    Andrew
> >
> > hi Andrew,
> >
> >   thanks for comments.
> >
> >   this "fsl-ls1028a-rdb-dsa-swp5-eno3.dts" is also for fsl-ls1028a-rdb
> > platform, the only difference with "fsl-ls1028a-rdb.dts" is that it
> > use swp5 as dsa master, not swp4, and it's based on
> > "fsl-ls1028a-rdb.dts", so I choose this manner, if "fsl-ls1028a-rdb.dts" has
> some modification for new version, this file don't need be changed.
> 
> I tend to agree with Hongbo. What confusion is it going to cause? It is
> fundamentally the same board, just an Ethernet port stopped having 'status =
> "disabled"' and another changed role, all inside of the SoC with no
> externally-visible change. If anything, I think that creating a new top-level
> compatible for each small change like this would create a bloat-fest of its own.
> 
> I was going to suggest as an alternative to define a device tree overlay file with
> the changes in the CPU port assignment, instead of defining a wholly new DTS
> for the LS1028A reference design board. But I am pretty sure that it is not
> possible to specify a /delete-property/ inside a device tree overlay file, so that
> won't actually work.

hi Vladimir,

  if don't specify "/delete-property/" in this dts file, the corresponding dtb will not work well,
so I add it to delete 'ethernet' property from mscc_felix_port4 explicitly.

thanks,
hongbo




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [EXT] Re: [PATCH v1] arm64: dts: fsl: ls1028a-rdb: Add dts file to choose swp5 as dsa master
  2021-08-16  6:03       ` Hongbo Wang
@ 2021-08-16 17:48         ` Vladimir Oltean
  2021-08-17  2:59           ` Hongbo Wang
  0 siblings, 1 reply; 8+ messages in thread
From: Vladimir Oltean @ 2021-08-16 17:48 UTC (permalink / raw)
  To: Hongbo Wang
  Cc: Andrew Lunn, Hongjun Chen, Po Liu, shawnguo, Leo Li, robh+dt,
	linux-arm-kernel, devicetree, f.fainelli, vivien.didelot, davem,
	netdev, linux-kernel

On Mon, Aug 16, 2021 at 06:03:52AM +0000, Hongbo Wang wrote:
> > I was going to suggest as an alternative to define a device tree overlay file with
> > the changes in the CPU port assignment, instead of defining a wholly new DTS
> > for the LS1028A reference design board. But I am pretty sure that it is not
> > possible to specify a /delete-property/ inside a device tree overlay file, so that
> > won't actually work.
>
> hi Vladimir,
>
>   if don't specify "/delete-property/" in this dts file, the corresponding dtb will not work well,
> so I add it to delete 'ethernet' property from mscc_felix_port4 explicitly.

Judging by the reply, I am not actually sure you've understood what has been said.

I said:

There is an option to create a device tree overlay:

https://www.kernel.org/doc/html/latest/devicetree/overlay-notes.html

We use these for the riser cards on the LS1028A-QDS boards.

https://source.codeaurora.org/external/qoriq/qoriq-components/linux/tree/arch/arm64/boot/dts/freescale/fsl-ls1028a-qds-13bb.dts?h=LSDK-20.12-V5.4

They are included as usual in a U-Boot ITB file:

/ {
	images {
		/* Base DTB */
		ls1028aqds-dtb {
			description = "ls1028aqds-dtb";
			data = /incbin/("arch/arm64/boot/dts/freescale/fsl-ls1028a-qds.dtb");
			type = "flat_dt";
			arch = "arm64";
			os = "linux";
			compression = "none";
			load = <0x90000000>;
			hash@1 {
				algo = "crc32";
			};
		};
		/* Overlay */
		fdt@ls1028aqds-13bb {
			description = "ls1028aqds-13bb";
			data = /incbin/("arch/arm64/boot/dts/freescale/fsl-ls1028a-qds-13bb.dtb");
			type = "flat_dt";
			arch = "arm64";
			load = <0x90010000>;
		};
	};
};

In U-Boot, you apply the overlay as following:

tftp $kernel_addr_r boot.itb && bootm $kernel_addr_r#ls1028aqds#ls1028aqds-13bb

It would have been nice to have a similar device tree overlay that
changes the DSA master from eno2 to eno3, and for that overlay to be
able to be applied (or not) from U-Boot.

But it's _not_ possible, because you cannot put the /delete-property/
(that you need to have) in the .dtbo file. Or if you put it, it will not
delete the property from the base dtb.

That's all I said.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [EXT] Re: [PATCH v1] arm64: dts: fsl: ls1028a-rdb: Add dts file to choose swp5 as dsa master
  2021-08-16 17:48         ` Vladimir Oltean
@ 2021-08-17  2:59           ` Hongbo Wang
  0 siblings, 0 replies; 8+ messages in thread
From: Hongbo Wang @ 2021-08-17  2:59 UTC (permalink / raw)
  To: Vladimir Oltean
  Cc: Andrew Lunn, Hongjun Chen, Po Liu, shawnguo, Leo Li, robh+dt,
	linux-arm-kernel, devicetree, f.fainelli, vivien.didelot, davem,
	netdev, linux-kernel


> On Mon, Aug 16, 2021 at 06:03:52AM +0000, Hongbo Wang wrote:
> > > I was going to suggest as an alternative to define a device tree
> > > overlay file with the changes in the CPU port assignment, instead of
> > > defining a wholly new DTS for the LS1028A reference design board.
> > > But I am pretty sure that it is not possible to specify a
> > > /delete-property/ inside a device tree overlay file, so that won't actually
> work.
> >
> > hi Vladimir,
> >
> >   if don't specify "/delete-property/" in this dts file, the
> > corresponding dtb will not work well, so I add it to delete 'ethernet' property
> from mscc_felix_port4 explicitly.
> 
> Judging by the reply, I am not actually sure you've understood what has been
> said.
> 
> I said:
> 
> There is an option to create a device tree overlay:
> 
> https://www.kernel.org/doc/html/latest/devicetree/overlay-notes.html
> 
> We use these for the riser cards on the LS1028A-QDS boards.
> 
> https://source.codeaurora.org/external/qoriq/qoriq-components/linux/tree/ar
> ch/arm64/boot/dts/freescale/fsl-ls1028a-qds-13bb.dts?h=LSDK-20.12-V5.4
> 
> They are included as usual in a U-Boot ITB file:
> 
> / {
> 	images {
> 		/* Base DTB */
> 		ls1028aqds-dtb {
> 			description = "ls1028aqds-dtb";
> 			data =
> /incbin/("arch/arm64/boot/dts/freescale/fsl-ls1028a-qds.dtb");
> 			type = "flat_dt";
> 			arch = "arm64";
> 			os = "linux";
> 			compression = "none";
> 			load = <0x90000000>;
> 			hash@1 {
> 				algo = "crc32";
> 			};
> 		};
> 		/* Overlay */
> 		fdt@ls1028aqds-13bb {
> 			description = "ls1028aqds-13bb";
> 			data =
> /incbin/("arch/arm64/boot/dts/freescale/fsl-ls1028a-qds-13bb.dtb");
> 			type = "flat_dt";
> 			arch = "arm64";
> 			load = <0x90010000>;
> 		};
> 	};
> };
> 
> In U-Boot, you apply the overlay as following:
> 
> tftp $kernel_addr_r boot.itb && bootm
> $kernel_addr_r#ls1028aqds#ls1028aqds-13bb
> 
> It would have been nice to have a similar device tree overlay that changes the
> DSA master from eno2 to eno3, and for that overlay to be able to be applied
> (or not) from U-Boot.
> 
> But it's _not_ possible, because you cannot put the /delete-property/ (that you
> need to have) in the .dtbo file. Or if you put it, it will not delete the property
> from the base dtb.
> 
> That's all I said.

thanks for the detailed explanation,
I have got your point.

thanks,
hongbo


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-08-17  2:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-13  3:01 [PATCH v1] arm64: dts: fsl: ls1028a-rdb: Add dts file to choose swp5 as dsa master hongbo.wang
2021-08-13 13:09 ` Andrew Lunn
2021-08-13 13:56   ` [EXT] " Hongbo Wang
2021-08-13 14:07     ` Vladimir Oltean
2021-08-13 14:25       ` Andrew Lunn
2021-08-16  6:03       ` Hongbo Wang
2021-08-16 17:48         ` Vladimir Oltean
2021-08-17  2:59           ` Hongbo Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).