[PATCH v1] arm64: dts: fsl: ls1028a-rdb: Add dts file to choose swp5 as dsa master

Subsystems: arm/freescale imx / mxc / layerscape arm architecture, the rest

STALE1436d

9 messages, 3 authors, 2022-09-05 · open the first message on its own page

[PATCH v1] arm64: dts: fsl: ls1028a-rdb: Add dts file to choose swp5 as dsa master

From: <hidden>
Date: 2021-08-13 02:57:44

From: hongbo wang <redacted>

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 <redacted>
---
 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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Re: [PATCH v1] arm64: dts: fsl: ls1028a-rdb: Add dts file to choose swp5 as dsa master

From: Andrew Lunn <andrew@lunn.ch>
Date: 2021-08-13 13:10:17

On Fri, Aug 13, 2021 at 11:01:55AM +0800, hongbo.wang@nxp.com wrote:
From: hongbo wang <redacted>

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.
 
quoted hunk
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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

RE: [EXT] Re: [PATCH v1] arm64: dts: fsl: ls1028a-rdb: Add dts file to choose swp5 as dsa master

From: Hongbo Wang <hidden>
Date: 2021-08-13 13:57:00

On Fri, Aug 13, 2021 at 11:01:55AM +0800, hongbo.wang@nxp.com wrote:
quoted
From: hongbo wang <redacted>

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.
quoted
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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Re: [EXT] Re: [PATCH v1] arm64: dts: fsl: ls1028a-rdb: Add dts file to choose swp5 as dsa master

From: Vladimir Oltean <vladimir.oltean@nxp.com>
Date: 2021-08-13 14:07:58

On Fri, Aug 13, 2021 at 01:56:53PM +0000, Hongbo Wang wrote:
quoted
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.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Re: [EXT] Re: [PATCH v1] arm64: dts: fsl: ls1028a-rdb: Add dts file to choose swp5 as dsa master

From: Andrew Lunn <andrew@lunn.ch>
Date: 2021-08-13 14:25:53

quoted
  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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

RE: [EXT] Re: [PATCH v1] arm64: dts: fsl: ls1028a-rdb: Add dts file to choose swp5 as dsa master

From: Hongbo Wang <hidden>
Date: 2021-08-16 06:04:03

On Fri, Aug 13, 2021 at 01:56:53PM +0000, Hongbo Wang wrote:
quoted
quoted
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




_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Re: [EXT] Re: [PATCH v1] arm64: dts: fsl: ls1028a-rdb: Add dts file to choose swp5 as dsa master

From: Vladimir Oltean <vladimir.oltean@nxp.com>
Date: 2021-08-16 17:48:10

On Mon, Aug 16, 2021 at 06:03:52AM +0000, Hongbo Wang wrote:
quoted
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.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

RE: [EXT] Re: [PATCH v1] arm64: dts: fsl: ls1028a-rdb: Add dts file to choose swp5 as dsa master

From: Hongbo Wang <hidden>
Date: 2021-08-17 02:59:18

On Mon, Aug 16, 2021 at 06:03:52AM +0000, Hongbo Wang wrote:
quoted
quoted
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.
quoted
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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Re: [PATCH v1] arm64: dts: fsl: ls1028a-rdb: Add dts file to choose swp5 as dsa master

From: Vladimir Oltean <vladimir.oltean@nxp.com>
Date: 2022-09-05 20:52:38

On Tue, Aug 17, 2021 at 02:59:07AM +0000, Hongbo Wang wrote:
quoted
On Mon, Aug 16, 2021 at 06:03:52AM +0000, Hongbo Wang wrote:
quoted
quoted
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
I'm replying to a very old topic here, but I don't think this made too
much progress (NXP still carries a downstream fsl-ls1028a-rdb-dsa-swp5-eno3.dts,
for a use case which is valid: using one of the 2 internal Ethernet
ports between the switch and the SoC as a plain data port, rather than a
CPU port).

I've found what I think is a satisfactory solution for myself. Rather
than carrying an entirely new device tree just to move around the DSA
master from &enetc_port2 to &enetc_port3, I'm building upon the changes
for multiple CPU ports which Shawn has accepted now.
https://lore.kernel.org/linux-arm-kernel/20220831160124.914453-1-olteanv@gmail.com/

With that patch set, what Hongbo tried to add here simply becomes:

&mscc_felix_port4 {
	/delete-property/ ethernet;
};

I've already expressed discontent with the fact that it isn't possible
to move just this action to a device tree overlay and apply it to
whatever LS1028A based board, not just the RDB. However, I found that it
is possible to do this instead, just from within the U-Boot shell:

fdt addr $fdt_addr_r
fdt rm /soc/pcie@1f0000000/ethernet-switch@0,5/ports/port@4 ethernet
...
bootm $kernel_addr_r - $fdt_addr_r

which is even more convenient, because this way, the board device trees
now don't even need to be compiled with the dtc "-@" option (to include
the __symbols__ node required for dtb overlays).

It's likely that some of the people copied here do fancier tricks with
dynamic editing of the FDT already, on a day by day basis. In that case,
what can I say, have a good rest of the day ;)
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help