[PATCH v2 00/16] Sync NXP LS1028A-RDB device trees between U-Boot and Linux

The changes were intended to be minimal, but unfortunately I discovered some other stuff as well: - we need to make some changes to the compatible strings of RTC devices and I2C muxes. This has ramifications to other NXP boards which were also updated. - I broke Ethernet on LS1028A boards through a patch that is currently in Ramon's tree.
Therefore this patch set is a bit larger than would be otherwise expected.
The Linux device tree changes have just been posted by me here and are currently in flight, but they are rather small so I don't expect too much pushback on them: https://lore.kernel.org/linux-arm-kernel/20211202141528.2450169-5-vladimir.o...
I've also triggered an Azure CI build with these changes: https://github.com/u-boot/u-boot/pull/102 and it appears that 2 tests fail due to external causes: 1. https://dev.azure.com/u-boot/u-boot/_build/results?buildId=3283&view=log... 2. https://dev.azure.com/u-boot/u-boot/_build/results?buildId=3283&view=log...
Unable to find image 'trini/u-boot-gitlab-ci-runner:focal-20211006-14Nov2021' locally docker: Error response from daemon: Head "https://registry-1.docker.io/v2/trini/u-boot-gitlab-ci-runner/manifests/foca...": received unexpected HTTP status: 502 Bad Gateway.
The other tests seem to pass.
Cc: Heiko Schocher hs@denx.de Cc: Simon Glass sjg@chromium.org Cc: Ramon Fried rfried.dev@gmail.com
Vladimir Oltean (16): i2c: muxes: pca954x: add PCA9847 variant rtc: pcf2127: sync with Linux compatible strings arm: dts: ls1088a-qds: use Linux compatible string for RTC arm: dts: ls1088a-rdb: use Linux compatible string for RTC arm: dts: lx2160a-qds: use Linux compatible string for RTC arm: dts: ls1028a-qds: use Linux compatible string for RTC arm: dts: ls1028a-rdb: use Linux compatible string for RTC arm: dts: lx2160a-rdb: use Linux compatible string for RTC rtc: pcf2127: remove U-Boot specific compatible string arm: dts: ls1028a-rdb: sort nodes alphabetically arm: dts: ls1028a-rdb: sync Ethernet device tree nodes with Linux arm: dts: ls1028a-rdb: disable DSPI nodes arm: dts: ls1028a-rdb: disable I2C buses 1 through 7 arm: dts: ls1028a-rdb: enable PCIe controllers from U-Boot dtsi arm: dts: ls1028a-rdb: sync device tree with Linux arm: dts: ls1028a-qds: declare in-band autoneg for Ethernet ports
.../dts/fsl-ls1028a-qds-1xxx-sch-30842.dtsi | 1 + .../dts/fsl-ls1028a-qds-8xxx-sch-24801.dtsi | 1 + .../fsl-ls1028a-qds-9999-sch-24801-LBRW.dtsi | 4 + .../dts/fsl-ls1028a-qds-9999-sch-24801.dtsi | 4 + .../fsl-ls1028a-qds-x3xx-sch-30841-LBRW.dtsi | 4 + .../fsl-ls1028a-qds-x5xx-sch-28021-LBRW.dtsi | 4 + arch/arm/dts/fsl-ls1028a-qds.dtsi | 2 +- arch/arm/dts/fsl-ls1028a-rdb-u-boot.dtsi | 15 + arch/arm/dts/fsl-ls1028a-rdb.dts | 295 ++++++++++++------ arch/arm/dts/fsl-ls1088a-qds.dtsi | 2 +- arch/arm/dts/fsl-ls1088a-rdb.dts | 2 +- arch/arm/dts/fsl-lx2160a-qds.dtsi | 2 +- arch/arm/dts/fsl-lx2160a-rdb.dts | 2 +- drivers/i2c/muxes/pca954x.c | 9 +- drivers/rtc/pcf2127.c | 4 +- 15 files changed, 242 insertions(+), 109 deletions(-) create mode 100644 arch/arm/dts/fsl-ls1028a-rdb-u-boot.dtsi

This seems to be very similar to the already existing PCA9547, save for the fact that it supports 0.8V and doesn't support 5V. In fact, it is so similar to the PCA9547 that the NXP LS1028A-RDB board has been driving this chip using a "nxp,pca9547" compatible string.
Create a new compatible for the PCA9847 (which is the same as in Linux) and define the same operating parameters for it as for PCA9547.
Cc: Heiko Schocher hs@denx.de Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com Reviewed-by: Heiko Schocher hs@denx.de Reviewed-by: Priyanka Jain priyanka.jain@nxp.com --- drivers/i2c/muxes/pca954x.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/i2c/muxes/pca954x.c b/drivers/i2c/muxes/pca954x.c index 55858cf653f2..0034dfbf6daf 100644 --- a/drivers/i2c/muxes/pca954x.c +++ b/drivers/i2c/muxes/pca954x.c @@ -23,7 +23,8 @@ enum pca_type { PCA9546, PCA9547, PCA9548, - PCA9646 + PCA9646, + PCA9847, };
struct chip_desc { @@ -68,6 +69,11 @@ static const struct chip_desc chips[] = { .muxtype = pca954x_isswi, .width = 4, }, + [PCA9847] = { + .enable = 0x8, + .muxtype = pca954x_ismux, + .width = 8, + }, };
static int pca954x_deselect(struct udevice *mux, struct udevice *bus, @@ -106,6 +112,7 @@ static const struct udevice_id pca954x_ids[] = { { .compatible = "nxp,pca9547", .data = PCA9547 }, { .compatible = "nxp,pca9548", .data = PCA9548 }, { .compatible = "nxp,pca9646", .data = PCA9646 }, + { .compatible = "nxp,pca9847", .data = PCA9847 }, { } };

Allow this driver to be used by boards which inherit their device trees from Linux. Compatibility is temporarily retained with the old compatible string which is U-Boot specific, and will be removed after a few changes.
Cc: Simon Glass sjg@chromium.org Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com Reviewed-by: Simon Glass sjg@chromium.org --- drivers/rtc/pcf2127.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/drivers/rtc/pcf2127.c b/drivers/rtc/pcf2127.c index 57f86401d371..291ef0329a3e 100644 --- a/drivers/rtc/pcf2127.c +++ b/drivers/rtc/pcf2127.c @@ -121,6 +121,9 @@ static const struct rtc_ops pcf2127_rtc_ops = {
static const struct udevice_id pcf2127_rtc_ids[] = { { .compatible = "pcf2127-rtc" }, + { .compatible = "nxp,pcf2127" }, + { .compatible = "nxp,pcf2129" }, + { .compatible = "nxp,pca2129" }, { } };

During the LS1028A-RDB sync with Linux device trees, it was observed that the same RTC is present on the two boards, and the wrong compatible string is used in both places. This change updates the RTC from the LS1088A-QDS to use the compatible string that was established in Linux.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com Reviewed-by: Priyanka Jain priyanka.jain@nxp.com --- arch/arm/dts/fsl-ls1088a-qds.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/dts/fsl-ls1088a-qds.dtsi b/arch/arm/dts/fsl-ls1088a-qds.dtsi index a7d0edcf0aa9..21c50078c3a4 100644 --- a/arch/arm/dts/fsl-ls1088a-qds.dtsi +++ b/arch/arm/dts/fsl-ls1088a-qds.dtsi @@ -88,7 +88,7 @@ reg = <0x3>;
rtc@51 { - compatible = "pcf2127-rtc"; + compatible = "nxp,pcf2129"; reg = <0x51>; }; };

During the LS1028A-RDB sync with Linux device trees, it was observed that the same RTC is present on the two boards, and the wrong compatible string is used in both places. This change updates the RTC from the LS1088A-RDB to use the compatible string that was established in Linux.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com Reviewed-by: Priyanka Jain priyanka.jain@nxp.com --- arch/arm/dts/fsl-ls1088a-rdb.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/dts/fsl-ls1088a-rdb.dts b/arch/arm/dts/fsl-ls1088a-rdb.dts index de92bf22e203..5cdd59815234 100644 --- a/arch/arm/dts/fsl-ls1088a-rdb.dts +++ b/arch/arm/dts/fsl-ls1088a-rdb.dts @@ -135,7 +135,7 @@ reg = <0x3>;
rtc@51 { - compatible = "pcf2127-rtc"; + compatible = "nxp,pcf2129"; reg = <0x51>; }; };

During the LS1028A-RDB sync with Linux device trees, it was observed that the same RTC is present on the two boards, and the wrong compatible string is used in both places. This change updates the RTC from the LX2160A-QDS to use the compatible string that was established in Linux.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com Reviewed-by: Priyanka Jain priyanka.jain@nxp.com --- arch/arm/dts/fsl-lx2160a-qds.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/dts/fsl-lx2160a-qds.dtsi b/arch/arm/dts/fsl-lx2160a-qds.dtsi index 288607c0347b..69e11cca2da1 100644 --- a/arch/arm/dts/fsl-lx2160a-qds.dtsi +++ b/arch/arm/dts/fsl-lx2160a-qds.dtsi @@ -250,7 +250,7 @@ reg = <0x3>;
rtc@51 { - compatible = "pcf2127-rtc"; + compatible = "nxp,pcf2129"; reg = <0x51>; }; };

The LS1028A-QDS board won't be synced with the Linux device trees right now, since those are currently still in progress (Ethernet is missing).
However, while we're at converting the RDB, it can be observed that the same RTC is present on the two boards, and the wrong compatible string is used in both places. This change updates the RTC from the QDS to use the compatible string that was established in Linux.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com Reviewed-by: Priyanka Jain priyanka.jain@nxp.com --- arch/arm/dts/fsl-ls1028a-qds.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/dts/fsl-ls1028a-qds.dtsi b/arch/arm/dts/fsl-ls1028a-qds.dtsi index 0da0a7bc5db8..3b063d0257de 100644 --- a/arch/arm/dts/fsl-ls1028a-qds.dtsi +++ b/arch/arm/dts/fsl-ls1028a-qds.dtsi @@ -195,7 +195,7 @@ status = "okay";
rtc@51 { - compatible = "pcf2127-rtc"; + compatible = "nxp,pcf2129"; reg = <0x51>; }; };

During this board's sync with Linux device trees, it was observed that it doesn't use the same compatible string for the RTC node as in U-Boot. This change makes the RTC compatible strings match, for a smoother sync.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com --- arch/arm/dts/fsl-ls1028a-rdb.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/dts/fsl-ls1028a-rdb.dts b/arch/arm/dts/fsl-ls1028a-rdb.dts index 537ebbc697cb..ddb01db73f8e 100644 --- a/arch/arm/dts/fsl-ls1028a-rdb.dts +++ b/arch/arm/dts/fsl-ls1028a-rdb.dts @@ -75,7 +75,7 @@ reg = <0x3>;
rtc@51 { - compatible = "pcf2127-rtc"; + compatible = "nxp,pcf2129"; reg = <0x51>; }; };

During the LS1028A-RDB sync with Linux device trees, it was observed that the same RTC is present on the two boards, and the wrong compatible string is used in both places. This change updates the RTC from the LX2160A-RDB to use the compatible string that was established in Linux.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com Reviewed-by: Priyanka Jain priyanka.jain@nxp.com --- arch/arm/dts/fsl-lx2160a-rdb.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/dts/fsl-lx2160a-rdb.dts b/arch/arm/dts/fsl-lx2160a-rdb.dts index 5fbdd907017c..8ca4afa7eaea 100644 --- a/arch/arm/dts/fsl-lx2160a-rdb.dts +++ b/arch/arm/dts/fsl-lx2160a-rdb.dts @@ -117,7 +117,7 @@ status = "okay";
rtc@51 { - compatible = "pcf2127-rtc"; + compatible = "nxp,pcf2129"; reg = <0x51>; }; };

Now that all in-tree boards have been converted to the compatible strings from Linux, delete the support for the ad-hoc "pcf2127-rtc" one.
Cc: Simon Glass sjg@chromium.org Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com Reviewed-by: Simon Glass sjg@chromium.org --- drivers/rtc/pcf2127.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/drivers/rtc/pcf2127.c b/drivers/rtc/pcf2127.c index 291ef0329a3e..2f3fafb4968f 100644 --- a/drivers/rtc/pcf2127.c +++ b/drivers/rtc/pcf2127.c @@ -120,7 +120,6 @@ static const struct rtc_ops pcf2127_rtc_ops = { };
static const struct udevice_id pcf2127_rtc_ids[] = { - { .compatible = "pcf2127-rtc" }, { .compatible = "nxp,pcf2127" }, { .compatible = "nxp,pcf2129" }, { .compatible = "nxp,pca2129" },

The nodes in the NXP LS1028A-RDB device tree are out of order, regroup them alphabetically to have a simple delta when the Linux device tree is brought in.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com Reviewed-by: Priyanka Jain priyanka.jain@nxp.com --- arch/arm/dts/fsl-ls1028a-rdb.dts | 110 +++++++++++++++---------------- 1 file changed, 55 insertions(+), 55 deletions(-)
diff --git a/arch/arm/dts/fsl-ls1028a-rdb.dts b/arch/arm/dts/fsl-ls1028a-rdb.dts index ddb01db73f8e..11bf7e5f627d 100644 --- a/arch/arm/dts/fsl-ls1028a-rdb.dts +++ b/arch/arm/dts/fsl-ls1028a-rdb.dts @@ -36,6 +36,48 @@ status = "okay"; };
+&duart0 { + status = "okay"; +}; + +&duart1 { + status = "okay"; +}; + +&enetc_mdio_pf3 { + status = "okay"; + rdb_phy0: phy@2 { + reg = <2>; + }; + + /* VSC8514 QSGMII PHY */ + sw_phy0: phy@10 { + reg = <0x10>; + }; + + sw_phy1: phy@11 { + reg = <0x11>; + }; + + sw_phy2: phy@12 { + reg = <0x12>; + }; + + sw_phy3: phy@13 { + reg = <0x13>; + }; +}; + +&enetc_port0 { + status = "okay"; + phy-mode = "sgmii"; + phy-handle = <&rdb_phy0>; +}; + +&enetc_port2 { + status = "okay"; +}; + &esdhc { status = "okay"; }; @@ -110,44 +152,6 @@ status = "okay"; };
-&sata { - status = "okay"; -}; - -&duart0 { - status = "okay"; -}; - -&duart1 { - status = "okay"; -}; - -&pcie1 { - status = "okay"; -}; - -&pcie2 { - status = "okay"; -}; - -&usb0 { - status = "okay"; -}; - -&usb1 { - status = "okay"; -}; - -&enetc_port0 { - status = "okay"; - phy-mode = "sgmii"; - phy-handle = <&rdb_phy0>; -}; - -&enetc_port2 { - status = "okay"; -}; - &mscc_felix { status = "okay"; }; @@ -185,26 +189,22 @@ status = "okay"; };
-&enetc_mdio_pf3 { +&pcie1 { status = "okay"; - rdb_phy0: phy@2 { - reg = <2>; - }; +};
- /* VSC8514 QSGMII PHY */ - sw_phy0: phy@10 { - reg = <0x10>; - }; +&pcie2 { + status = "okay"; +};
- sw_phy1: phy@11 { - reg = <0x11>; - }; +&sata { + status = "okay"; +};
- sw_phy2: phy@12 { - reg = <0x12>; - }; +&usb0 { + status = "okay"; +};
- sw_phy3: phy@13 { - reg = <0x13>; - }; +&usb1 { + status = "okay"; };

In a bit of a blunder, the blamed commit in the Fixes: tag below made the mscc_felix switch driver look at the 'managed = "in-band-status"' device tree property, forgetting that the U-Boot device tree had not been updated to include that property, whereas the Linux one does.
The switch is therefore described in the device tree as not requiring in-band autoneg, but the PHY driver for VSC8514 (drivers/net/phy/mscc.c) still enables that feature. This results in a mismatch => no traffic.
This patch is a copy-paste of the Ethernet device tree nodes from Linux, which resolves that issue. The device tree update also renames the Ethernet PHY labels.
Fixes: e3789a726269 ("net: dsa: felix: configure the in-band autoneg property based on OF node info") Cc: Ramon Fried rfried.dev@gmail.com Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com Reviewed-by: Priyanka Jain priyanka.jain@nxp.com --- arch/arm/dts/fsl-ls1028a-rdb.dts | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-)
diff --git a/arch/arm/dts/fsl-ls1028a-rdb.dts b/arch/arm/dts/fsl-ls1028a-rdb.dts index 11bf7e5f627d..b5e56b1c1f15 100644 --- a/arch/arm/dts/fsl-ls1028a-rdb.dts +++ b/arch/arm/dts/fsl-ls1028a-rdb.dts @@ -45,33 +45,33 @@ };
&enetc_mdio_pf3 { - status = "okay"; - rdb_phy0: phy@2 { - reg = <2>; + sgmii_phy0: ethernet-phy@2 { + reg = <0x2>; };
- /* VSC8514 QSGMII PHY */ - sw_phy0: phy@10 { + /* VSC8514 QSGMII quad PHY */ + qsgmii_phy0: ethernet-phy@10 { reg = <0x10>; };
- sw_phy1: phy@11 { + qsgmii_phy1: ethernet-phy@11 { reg = <0x11>; };
- sw_phy2: phy@12 { + qsgmii_phy2: ethernet-phy@12 { reg = <0x12>; };
- sw_phy3: phy@13 { + qsgmii_phy3: ethernet-phy@13 { reg = <0x13>; }; };
&enetc_port0 { - status = "okay"; + phy-handle = <&sgmii_phy0>; phy-mode = "sgmii"; - phy-handle = <&rdb_phy0>; + managed = "in-band-status"; + status = "okay"; };
&enetc_port2 { @@ -158,28 +158,32 @@
&mscc_felix_port0 { label = "swp0"; - phy-handle = <&sw_phy0>; + managed = "in-band-status"; + phy-handle = <&qsgmii_phy0>; phy-mode = "qsgmii"; status = "okay"; };
&mscc_felix_port1 { label = "swp1"; - phy-handle = <&sw_phy1>; + managed = "in-band-status"; + phy-handle = <&qsgmii_phy1>; phy-mode = "qsgmii"; status = "okay"; };
&mscc_felix_port2 { label = "swp2"; - phy-handle = <&sw_phy2>; + managed = "in-band-status"; + phy-handle = <&qsgmii_phy2>; phy-mode = "qsgmii"; status = "okay"; };
&mscc_felix_port3 { label = "swp3"; - phy-handle = <&sw_phy3>; + managed = "in-band-status"; + phy-handle = <&qsgmii_phy3>; phy-mode = "qsgmii"; status = "okay"; };

There is no SPI peripheral on the LS1028A-RDB, therefore no reason to enable these nodes in the U-Boot device tree (and Linux does not enable them either).
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com Reviewed-by: Priyanka Jain priyanka.jain@nxp.com --- arch/arm/dts/fsl-ls1028a-rdb.dts | 12 ------------ 1 file changed, 12 deletions(-)
diff --git a/arch/arm/dts/fsl-ls1028a-rdb.dts b/arch/arm/dts/fsl-ls1028a-rdb.dts index b5e56b1c1f15..c5b95e169f5c 100644 --- a/arch/arm/dts/fsl-ls1028a-rdb.dts +++ b/arch/arm/dts/fsl-ls1028a-rdb.dts @@ -24,18 +24,6 @@ }; };
-&dspi0 { - status = "okay"; -}; - -&dspi1 { - status = "okay"; -}; - -&dspi2 { - status = "okay"; -}; - &duart0 { status = "okay"; };

There is no I2C peripheral on these buses on the reference design board, and the Linux device tree does not enable them either.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com Reviewed-by: Priyanka Jain priyanka.jain@nxp.com --- arch/arm/dts/fsl-ls1028a-rdb.dts | 28 ---------------------------- 1 file changed, 28 deletions(-)
diff --git a/arch/arm/dts/fsl-ls1028a-rdb.dts b/arch/arm/dts/fsl-ls1028a-rdb.dts index c5b95e169f5c..10070eab6e61 100644 --- a/arch/arm/dts/fsl-ls1028a-rdb.dts +++ b/arch/arm/dts/fsl-ls1028a-rdb.dts @@ -112,34 +112,6 @@ }; };
-&i2c1 { - status = "okay"; -}; - -&i2c2 { - status = "okay"; -}; - -&i2c3 { - status = "okay"; -}; - -&i2c4 { - status = "okay"; -}; - -&i2c5 { - status = "okay"; -}; - -&i2c6 { - status = "okay"; -}; - -&i2c7 { - status = "okay"; -}; - &mscc_felix { status = "okay"; };

Reuse the scheme implemented by the Kontron SL28 boards in commit d08011d7f9b4 ("arm: dts: ls1028a: disable the PCIe controller by default") and move the 'status = "okay"' lines for the PCIe controllers inside a separate U-Boot dtsi for the LS1028A-RDB board. This way, the existing Linux device tree can simply be dropped in.
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com --- arch/arm/dts/fsl-ls1028a-rdb-u-boot.dtsi | 15 +++++++++++++++ arch/arm/dts/fsl-ls1028a-rdb.dts | 9 +-------- 2 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 arch/arm/dts/fsl-ls1028a-rdb-u-boot.dtsi
diff --git a/arch/arm/dts/fsl-ls1028a-rdb-u-boot.dtsi b/arch/arm/dts/fsl-ls1028a-rdb-u-boot.dtsi new file mode 100644 index 000000000000..a72b57305dc3 --- /dev/null +++ b/arch/arm/dts/fsl-ls1028a-rdb-u-boot.dtsi @@ -0,0 +1,15 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* Copyright 2021 NXP */ + +/* + * u-boot will enable the device in the linux device tree in place. Because + * we are using the linux device tree, we have to enable the PCI controller + * ourselves. + */ +&pcie1 { + status = "okay"; +}; + +&pcie2 { + status = "okay"; +}; diff --git a/arch/arm/dts/fsl-ls1028a-rdb.dts b/arch/arm/dts/fsl-ls1028a-rdb.dts index 10070eab6e61..70fcf71dbd0e 100644 --- a/arch/arm/dts/fsl-ls1028a-rdb.dts +++ b/arch/arm/dts/fsl-ls1028a-rdb.dts @@ -9,6 +9,7 @@ /dts-v1/;
#include "fsl-ls1028a.dtsi" +#include "fsl-ls1028a-rdb-u-boot.dtsi"
/ { model = "NXP Layerscape 1028a RDB Board"; @@ -153,14 +154,6 @@ status = "okay"; };
-&pcie1 { - status = "okay"; -}; - -&pcie2 { - status = "okay"; -}; - &sata { status = "okay"; };

Am 2021-12-07 21:20, schrieb Vladimir Oltean:
diff --git a/arch/arm/dts/fsl-ls1028a-rdb.dts b/arch/arm/dts/fsl-ls1028a-rdb.dts index 10070eab6e61..70fcf71dbd0e 100644 --- a/arch/arm/dts/fsl-ls1028a-rdb.dts +++ b/arch/arm/dts/fsl-ls1028a-rdb.dts @@ -9,6 +9,7 @@ /dts-v1/;
#include "fsl-ls1028a.dtsi" +#include "fsl-ls1028a-rdb-u-boot.dtsi"
This shouldn't be needed, as as the -u-boot.dtsi is automagically included (at least at board level dtbs).
-michael

Allow device trees to be reused between Linux and U-Boot. The source for these device trees is today's linux-next plus these changes that have been made so that the sources can be shared. These other patches are currently in flight: https://lore.kernel.org/linux-arm-kernel/20211202141528.2450169-5-vladimir.o...
Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com Reviewed-by: Priyanka Jain priyanka.jain@nxp.com --- arch/arm/dts/fsl-ls1028a-rdb.dts | 158 ++++++++++++++++++++++++++++--- 1 file changed, 146 insertions(+), 12 deletions(-)
diff --git a/arch/arm/dts/fsl-ls1028a-rdb.dts b/arch/arm/dts/fsl-ls1028a-rdb.dts index 70fcf71dbd0e..09c38ecaf95c 100644 --- a/arch/arm/dts/fsl-ls1028a-rdb.dts +++ b/arch/arm/dts/fsl-ls1028a-rdb.dts @@ -1,20 +1,28 @@ -// SPDX-License-Identifier: GPL-2.0+ OR X11 +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) /* - * NXP ls1028ARDB device tree source + * Device Tree file for NXP LS1028A RDB Board. * - * Copyright 2019 NXP + * Copyright 2018-2021 NXP + * + * Harninder Rai harninder.rai@nxp.com * */
/dts-v1/; - #include "fsl-ls1028a.dtsi" #include "fsl-ls1028a-rdb-u-boot.dtsi"
/ { - model = "NXP Layerscape 1028a RDB Board"; + model = "LS1028A RDB Board"; compatible = "fsl,ls1028a-rdb", "fsl,ls1028a"; + aliases { + crypto = &crypto; + serial0 = &duart0; + serial1 = &duart1; + mmc0 = &esdhc; + mmc1 = &esdhc1; + rtc1 = &ftm_alarm0; spi0 = &fspi; ethernet0 = &enetc_port0; ethernet1 = &enetc_port2; @@ -23,6 +31,83 @@ ethernet4 = &mscc_felix_port2; ethernet5 = &mscc_felix_port3; }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + memory@80000000 { + device_type = "memory"; + reg = <0x0 0x80000000 0x1 0x0000000>; + }; + + sys_mclk: clock-mclk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <25000000>; + }; + + reg_1p8v: regulator-1p8v { + compatible = "regulator-fixed"; + regulator-name = "1P8V"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + }; + + sb_3v3: regulator-sb3v3 { + compatible = "regulator-fixed"; + regulator-name = "3v3_vbus"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + regulator-always-on; + }; + + sound { + compatible = "simple-audio-card"; + simple-audio-card,format = "i2s"; + simple-audio-card,widgets = + "Microphone", "Microphone Jack", + "Headphone", "Headphone Jack", + "Speaker", "Speaker Ext", + "Line", "Line In Jack"; + simple-audio-card,routing = + "MIC_IN", "Microphone Jack", + "Microphone Jack", "Mic Bias", + "LINE_IN", "Line In Jack", + "Headphone Jack", "HP_OUT", + "Speaker Ext", "LINE_OUT"; + + simple-audio-card,cpu { + sound-dai = <&sai4>; + frame-master; + bitclock-master; + }; + + simple-audio-card,codec { + sound-dai = <&sgtl5000>; + frame-master; + bitclock-master; + system-clock-frequency = <25000000>; + }; + }; +}; + +&can0 { + status = "okay"; + + can-transceiver { + max-bitrate = <5000000>; + }; +}; + +&can1 { + status = "okay"; + + can-transceiver { + max-bitrate = <5000000>; + }; };
&duart0 { @@ -68,43 +153,83 @@ };
&esdhc { + sd-uhs-sdr104; + sd-uhs-sdr50; + sd-uhs-sdr25; + sd-uhs-sdr12; status = "okay"; };
&esdhc1 { - status = "okay"; mmc-hs200-1_8v; + mmc-hs400-1_8v; + bus-width = <8>; + status = "okay"; };
&fspi { status = "okay";
mt35xu02g0: flash@0 { + compatible = "jedec,spi-nor"; #address-cells = <1>; #size-cells = <1>; - compatible = "jedec,spi-nor"; spi-max-frequency = <50000000>; + /* The following setting enables 1-1-8 (CMD-ADDR-DATA) mode */ + spi-rx-bus-width = <8>; /* 8 SPI Rx lines */ + spi-tx-bus-width = <1>; /* 1 SPI Tx line */ reg = <0>; - spi-rx-bus-width = <8>; - spi-tx-bus-width = <1>; }; };
&i2c0 { status = "okay";
- i2c-mux@77 { - - compatible = "nxp,pca9547"; + i2c-mux@77 { + compatible = "nxp,pca9847"; reg = <0x77>; #address-cells = <1>; #size-cells = <0>;
+ i2c@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x1>; + + sgtl5000: audio-codec@a { + #sound-dai-cells = <0>; + compatible = "fsl,sgtl5000"; + reg = <0xa>; + VDDA-supply = <®_1p8v>; + VDDIO-supply = <®_1p8v>; + clocks = <&sys_mclk>; + sclk-strength = <3>; + }; + }; + + i2c@2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x02>; + + current-monitor@40 { + compatible = "ti,ina220"; + reg = <0x40>; + shunt-resistor = <500>; + }; + }; + i2c@3 { #address-cells = <1>; #size-cells = <0>; reg = <0x3>;
+ temperature-sensor@4c { + compatible = "nxp,sa56004"; + reg = <0x4c>; + vcc-supply = <&sb_3v3>; + }; + rtc@51 { compatible = "nxp,pcf2129"; reg = <0x51>; @@ -154,6 +279,14 @@ status = "okay"; };
+&optee { + status = "okay"; +}; + +&sai4 { + status = "okay"; +}; + &sata { status = "okay"; }; @@ -163,5 +296,6 @@ };
&usb1 { + dr_mode = "otg"; status = "okay"; };

The commit in the Fixes: tag below broke traffic through switch ports where the SERDES protocol requires in-band autoneg and this requirement isn't described in the device tree: SGMII, QSGMII, USXGMII (with 2500Base-X, in-band autoneg isn't supported).
The LS1028A-QDS boards are not yet ready for syncing their device trees with Linux, since Ethernet is missing there (but has been submitted): https://lore.kernel.org/lkml/20211112223457.10599-11-leoyang.li@nxp.com/
When agreement is reached for the Ethernet support in Linux, there will be a sync for these boards as well. For now, just enable in-band autoneg to fix the breakage.
Fixes: e3789a726269 ("net: dsa: felix: configure the in-band autoneg property based on OF node info") Cc: Ramon Fried rfried.dev@gmail.com Signed-off-by: Vladimir Oltean vladimir.oltean@nxp.com Reviewed-by: Priyanka Jain priyanka.jain@nxp.com --- arch/arm/dts/fsl-ls1028a-qds-1xxx-sch-30842.dtsi | 1 + arch/arm/dts/fsl-ls1028a-qds-8xxx-sch-24801.dtsi | 1 + arch/arm/dts/fsl-ls1028a-qds-9999-sch-24801-LBRW.dtsi | 4 ++++ arch/arm/dts/fsl-ls1028a-qds-9999-sch-24801.dtsi | 4 ++++ arch/arm/dts/fsl-ls1028a-qds-x3xx-sch-30841-LBRW.dtsi | 4 ++++ arch/arm/dts/fsl-ls1028a-qds-x5xx-sch-28021-LBRW.dtsi | 4 ++++ 6 files changed, 18 insertions(+)
diff --git a/arch/arm/dts/fsl-ls1028a-qds-1xxx-sch-30842.dtsi b/arch/arm/dts/fsl-ls1028a-qds-1xxx-sch-30842.dtsi index f4c557e69e6e..f208a02721e3 100644 --- a/arch/arm/dts/fsl-ls1028a-qds-1xxx-sch-30842.dtsi +++ b/arch/arm/dts/fsl-ls1028a-qds-1xxx-sch-30842.dtsi @@ -15,6 +15,7 @@
&enetc_port0 { status = "okay"; + managed = "in-band-status"; phy-mode = "usxgmii"; phy-handle = <&{/soc/i2c@2000000/fpga@66/mux-mdio@54/mdio@40/phy@02}>; }; diff --git a/arch/arm/dts/fsl-ls1028a-qds-8xxx-sch-24801.dtsi b/arch/arm/dts/fsl-ls1028a-qds-8xxx-sch-24801.dtsi index 7d197c31814a..0a0926473541 100644 --- a/arch/arm/dts/fsl-ls1028a-qds-8xxx-sch-24801.dtsi +++ b/arch/arm/dts/fsl-ls1028a-qds-8xxx-sch-24801.dtsi @@ -14,6 +14,7 @@
&enetc_port0 { status = "okay"; + managed = "in-band-status"; phy-mode = "sgmii"; phy-handle = <&{/soc/i2c@2000000/fpga@66/mux-mdio@54/mdio@40/phy@1c}>; }; diff --git a/arch/arm/dts/fsl-ls1028a-qds-9999-sch-24801-LBRW.dtsi b/arch/arm/dts/fsl-ls1028a-qds-9999-sch-24801-LBRW.dtsi index 992092ec7838..94b5e765aedb 100644 --- a/arch/arm/dts/fsl-ls1028a-qds-9999-sch-24801-LBRW.dtsi +++ b/arch/arm/dts/fsl-ls1028a-qds-9999-sch-24801-LBRW.dtsi @@ -44,24 +44,28 @@
&mscc_felix_port0 { status = "okay"; + managed = "in-band-status"; phy-mode = "sgmii"; phy-handle = <&{/soc/i2c@2000000/fpga@66/mux-mdio@54/mdio@40/phy@1c}>; };
&mscc_felix_port1 { status = "okay"; + managed = "in-band-status"; phy-mode = "sgmii"; phy-handle = <&{/soc/i2c@2000000/fpga@66/mux-mdio@54/mdio@50/phy@1c}>; };
&mscc_felix_port2 { status = "okay"; + managed = "in-band-status"; phy-mode = "sgmii"; phy-handle = <&{/soc/i2c@2000000/fpga@66/mux-mdio@54/mdio@40/phy@1e}>; };
&mscc_felix_port3 { status = "okay"; + managed = "in-band-status"; phy-mode = "sgmii"; phy-handle = <&{/soc/i2c@2000000/fpga@66/mux-mdio@54/mdio@40/phy@1f}>; }; diff --git a/arch/arm/dts/fsl-ls1028a-qds-9999-sch-24801.dtsi b/arch/arm/dts/fsl-ls1028a-qds-9999-sch-24801.dtsi index a905d77a9a71..bd46adfd2928 100644 --- a/arch/arm/dts/fsl-ls1028a-qds-9999-sch-24801.dtsi +++ b/arch/arm/dts/fsl-ls1028a-qds-9999-sch-24801.dtsi @@ -29,24 +29,28 @@
&mscc_felix_port0 { status = "okay"; + managed = "in-band-status"; phy-mode = "sgmii"; phy-handle = <&{/soc/i2c@2000000/fpga@66/mux-mdio@54/mdio@40/phy@1c}>; };
&mscc_felix_port1 { status = "okay"; + managed = "in-band-status"; phy-mode = "sgmii"; phy-handle = <&{/soc/i2c@2000000/fpga@66/mux-mdio@54/mdio@40/phy@1d}>; };
&mscc_felix_port2 { status = "okay"; + managed = "in-band-status"; phy-mode = "sgmii"; phy-handle = <&{/soc/i2c@2000000/fpga@66/mux-mdio@54/mdio@40/phy@1e}>; };
&mscc_felix_port3 { status = "okay"; + managed = "in-band-status"; phy-mode = "sgmii"; phy-handle = <&{/soc/i2c@2000000/fpga@66/mux-mdio@54/mdio@40/phy@1f}>; }; diff --git a/arch/arm/dts/fsl-ls1028a-qds-x3xx-sch-30841-LBRW.dtsi b/arch/arm/dts/fsl-ls1028a-qds-x3xx-sch-30841-LBRW.dtsi index 62e818f099ca..5909e7635a1a 100644 --- a/arch/arm/dts/fsl-ls1028a-qds-x3xx-sch-30841-LBRW.dtsi +++ b/arch/arm/dts/fsl-ls1028a-qds-x3xx-sch-30841-LBRW.dtsi @@ -29,24 +29,28 @@
&mscc_felix_port0 { status = "okay"; + managed = "in-band-status"; phy-mode = "usxgmii"; phy-handle = <&{/soc/i2c@2000000/fpga@66/mux-mdio@54/mdio@50/phy@00}>; };
&mscc_felix_port1 { status = "okay"; + managed = "in-band-status"; phy-mode = "usxgmii"; phy-handle = <&{/soc/i2c@2000000/fpga@66/mux-mdio@54/mdio@50/phy@01}>; };
&mscc_felix_port2 { status = "okay"; + managed = "in-band-status"; phy-mode = "usxgmii"; phy-handle = <&{/soc/i2c@2000000/fpga@66/mux-mdio@54/mdio@50/phy@02}>; };
&mscc_felix_port3 { status = "okay"; + managed = "in-band-status"; phy-mode = "usxgmii"; phy-handle = <&{/soc/i2c@2000000/fpga@66/mux-mdio@54/mdio@50/phy@03}>; }; diff --git a/arch/arm/dts/fsl-ls1028a-qds-x5xx-sch-28021-LBRW.dtsi b/arch/arm/dts/fsl-ls1028a-qds-x5xx-sch-28021-LBRW.dtsi index 6f1f6cb32af7..b65220692079 100644 --- a/arch/arm/dts/fsl-ls1028a-qds-x5xx-sch-28021-LBRW.dtsi +++ b/arch/arm/dts/fsl-ls1028a-qds-x5xx-sch-28021-LBRW.dtsi @@ -23,24 +23,28 @@
&mscc_felix_port0 { status = "okay"; + managed = "in-band-status"; phy-mode = "qsgmii"; phy-handle = <&{/soc/i2c@2000000/fpga@66/mux-mdio@54/mdio@50/phy@08}>; };
&mscc_felix_port1 { status = "okay"; + managed = "in-band-status"; phy-mode = "qsgmii"; phy-handle = <&{/soc/i2c@2000000/fpga@66/mux-mdio@54/mdio@50/phy@09}>; };
&mscc_felix_port2 { status = "okay"; + managed = "in-band-status"; phy-mode = "qsgmii"; phy-handle = <&{/soc/i2c@2000000/fpga@66/mux-mdio@54/mdio@50/phy@0a}>; };
&mscc_felix_port3 { status = "okay"; + managed = "in-band-status"; phy-mode = "qsgmii"; phy-handle = <&{/soc/i2c@2000000/fpga@66/mux-mdio@54/mdio@50/phy@0b}>; };

Hi Priyanka,
On Tue, Dec 07, 2021 at 10:20:07PM +0200, Vladimir Oltean wrote:
The changes were intended to be minimal, but unfortunately I discovered some other stuff as well:
- we need to make some changes to the compatible strings of RTC devices and I2C muxes. This has ramifications to other NXP boards which were also updated.
- I broke Ethernet on LS1028A boards through a patch that is currently in Ramon's tree.
Therefore this patch set is a bit larger than would be otherwise expected.
The Linux device tree changes have just been posted by me here and are currently in flight, but they are rather small so I don't expect too much pushback on them: https://lore.kernel.org/linux-arm-kernel/20211202141528.2450169-5-vladimir.o...
I've also triggered an Azure CI build with these changes: https://github.com/u-boot/u-boot/pull/102 and it appears that 2 tests fail due to external causes:
- https://dev.azure.com/u-boot/u-boot/_build/results?buildId=3283&view=log...
- https://dev.azure.com/u-boot/u-boot/_build/results?buildId=3283&view=log...
Unable to find image 'trini/u-boot-gitlab-ci-runner:focal-20211006-14Nov2021' locally docker: Error response from daemon: Head "https://registry-1.docker.io/v2/trini/u-boot-gitlab-ci-runner/manifests/foca...": received unexpected HTTP status: 502 Bad Gateway.
The other tests seem to pass.
The Linux side of device tree patches were merged today, and I see you've reviewed the U-Boot side of changes too. Could you please pick them up?

-----Original Message----- From: Vladimir Oltean vladimir.oltean@nxp.com Sent: Tuesday, December 14, 2021 8:09 PM To: Priyanka Jain priyanka.jain@nxp.com; u-boot@lists.denx.de Cc: Michael Walle michael@walle.cc; Tom Rini trini@konsulko.com; Leo Li leoyang.li@nxp.com; Heiko Schocher hs@denx.de; Simon Glass sjg@chromium.org; Ramon Fried rfried.dev@gmail.com Subject: Re: [PATCH v2 00/16] Sync NXP LS1028A-RDB device trees between U- Boot and Linux
Hi Priyanka,
On Tue, Dec 07, 2021 at 10:20:07PM +0200, Vladimir Oltean wrote:
The changes were intended to be minimal, but unfortunately I discovered some other stuff as well:
- we need to make some changes to the compatible strings of RTC devices and I2C muxes. This has ramifications to other NXP boards which were also updated.
- I broke Ethernet on LS1028A boards through a patch that is currently in Ramon's tree.
Therefore this patch set is a bit larger than would be otherwise expected.
The Linux device tree changes have just been posted by me here and are currently in flight, but they are rather small so I don't expect too much pushback on them: https://lore.kernel.org/linux-arm-kernel/20211202141528.2450169-5-vlad imir.oltean@nxp.com/T/#m6f63c92e75fa79a01144b2c2c6dc4776e7971395
I've also triggered an Azure CI build with these changes: https://github.com/u-boot/u-boot/pull/102 and it appears that 2 tests fail due to external causes:
https://dev.azure.com/u-boot/u-boot/_build/results?buildId=3283&view=l ogs&jobId=5fafc5b9-a417-5c75-4c48-15c7f941e4ee&j=5fafc5b9-a417-5c75-4c 48-15c7f941e4ee&t=c864b9c4-48aa-5e04-3916-54070f85e156 2. https://dev.azure.com/u-boot/u-boot/_build/results?buildId=3283&view=l ogs&j=5fafc5b9-a417-5c75-4c48-15c7f941e4ee&t=c864b9c4-48aa-5e04-3916-
5
4070f85e156&l=27
Unable to find image 'trini/u-boot-gitlab-ci-runner:focal-20211006-14Nov2021' locally docker: Error response from daemon: Head "https://registry-
1.docker.io/v2/trini/u-boot-gitlab-ci-runner/manifests/focal-20211006- 14Nov2021": received unexpected HTTP status: 502 Bad Gateway.
The other tests seem to pass.
The Linux side of device tree patches were merged today, and I see you've reviewed the U-Boot side of changes too. Could you please pick them up?
Yes, I will pick the series as part of next pull-request for 2022.04
Regards Priyanka

On Thu, Dec 23, 2021 at 06:34:13AM +0000, Priyanka Jain wrote:
The Linux side of device tree patches were merged today, and I see you've reviewed the U-Boot side of changes too. Could you please pick them up?
Yes, I will pick the series as part of next pull-request for 2022.04
Thanks. Could you also delete the '#include "fsl-ls1028a-rdb-u-boot.dtsi"' line from patch 14/16 like Michael suggested, or should I resend for that?

Am 2021-12-23 13:44, schrieb Vladimir Oltean:
On Thu, Dec 23, 2021 at 06:34:13AM +0000, Priyanka Jain wrote:
The Linux side of device tree patches were merged today, and I see you've reviewed the U-Boot side of changes too. Could you please pick them up?
Yes, I will pick the series as part of next pull-request for 2022.04
Thanks. Could you also delete the '#include "fsl-ls1028a-rdb-u-boot.dtsi"' line from patch 14/16 like Michael suggested, or should I resend for that?
Patch 15/16 is also affected? I guess you took the linux dts and added that include line afterwards? that shouldn't be necessary.
-michael

On Thu, Dec 23, 2021 at 01:47:48PM +0100, Michael Walle wrote:
Am 2021-12-23 13:44, schrieb Vladimir Oltean:
On Thu, Dec 23, 2021 at 06:34:13AM +0000, Priyanka Jain wrote:
The Linux side of device tree patches were merged today, and I see you've reviewed the U-Boot side of changes too. Could you please pick them up?
Yes, I will pick the series as part of next pull-request for 2022.04
Thanks. Could you also delete the '#include "fsl-ls1028a-rdb-u-boot.dtsi"' line from patch 14/16 like Michael suggested, or should I resend for that?
Patch 15/16 is also affected? I guess you took the linux dts and added that include line afterwards? that shouldn't be necessary.
Alright, I'll send v3 later today or tomorrow.
participants (3)
-
Michael Walle
-
Priyanka Jain
-
Vladimir Oltean