[PATCH 0/5] Convert the LS208xA RDB/QDS boards to DM_SERIAL

This patch set converts the LS208xA based boards to DM_SERIAL.
Since we don't want to introduce even more differences between the U-Boot's and Linux's device trees the first 4 patches make the necessary updates so that the serial nodes are synced with their counterpart.
The last patch just enables DM_SERIAL in the associated configs.
Ioana Ciornei (5): arch: arm: dst: fsl-ls2080a.dtsi: add an 'soc' node arch: arm: dst: fsl-ls2080a.dtsi: move the serial nodes under soc arch: arm: dst: fsl-ls2080a.dts: sync serial nodes with Linux arch: arm: dst: fsl-ls2080a.dts: tag serial nodes with bootph-all configs: ls208x: enable DM_SERIAL
arch/arm/dts/fsl-ls2080a.dtsi | 57 +++++++++++++++----- configs/ls2088aqds_tfa_defconfig | 5 +- configs/ls2088ardb_tfa_SECURE_BOOT_defconfig | 4 +- configs/ls2088ardb_tfa_defconfig | 4 +- 4 files changed, 53 insertions(+), 17 deletions(-)

The u-boot dts for these boards do not have an soc node, unlike its Linux counterpart. This patch just adds the soc node as seen in Linux, the next patches will move some nodes under it.
Signed-off-by: Ioana Ciornei ioana.ciornei@nxp.com --- arch/arm/dts/fsl-ls2080a.dtsi | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/arch/arm/dts/fsl-ls2080a.dtsi b/arch/arm/dts/fsl-ls2080a.dtsi index a1837454f43d..77fec065584b 100644 --- a/arch/arm/dts/fsl-ls2080a.dtsi +++ b/arch/arm/dts/fsl-ls2080a.dtsi @@ -35,6 +35,15 @@ <1 10 0x8>; /* Hypervisor PPI, active-low */ };
+ soc { + compatible = "simple-bus"; + #address-cells = <2>; + #size-cells = <2>; + ranges; + dma-ranges = <0x0 0x0 0x0 0x0 0x10000 0x00000000>; + + }; + serial0: serial@21c0500 { device_type = "serial"; compatible = "fsl,ns16550", "ns16550a";

On Tue, Feb 28, 2023 at 06:32:08PM +0200, Ioana Ciornei wrote:
The u-boot dts for these boards do not have an soc node, unlike its Linux counterpart. This patch just adds the soc node as seen in Linux, the next patches will move some nodes under it.
Signed-off-by: Ioana Ciornei ioana.ciornei@nxp.com
Reviewed-by: Vladimir Oltean vladimir.oltean@nxp.com

Move the serial nodes under the soc node. No changes are made to the nodes, just their location is changed.
Signed-off-by: Ioana Ciornei ioana.ciornei@nxp.com --- arch/arm/dts/fsl-ls2080a.dtsi | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-)
diff --git a/arch/arm/dts/fsl-ls2080a.dtsi b/arch/arm/dts/fsl-ls2080a.dtsi index 77fec065584b..2ee426acfd58 100644 --- a/arch/arm/dts/fsl-ls2080a.dtsi +++ b/arch/arm/dts/fsl-ls2080a.dtsi @@ -42,22 +42,21 @@ ranges; dma-ranges = <0x0 0x0 0x0 0x0 0x10000 0x00000000>;
- }; - - serial0: serial@21c0500 { - device_type = "serial"; - compatible = "fsl,ns16550", "ns16550a"; - reg = <0x0 0x21c0500 0x0 0x100>; - clock-frequency = <0>; /* Updated by bootloader */ - interrupts = <0 32 0x1>; /* edge triggered */ - }; + serial0: serial@21c0500 { + device_type = "serial"; + compatible = "fsl,ns16550", "ns16550a"; + reg = <0x0 0x21c0500 0x0 0x100>; + clock-frequency = <0>; /* Updated by bootloader */ + interrupts = <0 32 0x1>; /* edge triggered */ + };
- serial1: serial@21c0600 { - device_type = "serial"; - compatible = "fsl,ns16550", "ns16550a"; - reg = <0x0 0x21c0600 0x0 0x100>; - clock-frequency = <0>; /* Updated by bootloader */ - interrupts = <0 32 0x1>; /* edge triggered */ + serial1: serial@21c0600 { + device_type = "serial"; + compatible = "fsl,ns16550", "ns16550a"; + reg = <0x0 0x21c0600 0x0 0x100>; + clock-frequency = <0>; /* Updated by bootloader */ + interrupts = <0 32 0x1>; /* edge triggered */ + }; };
i2c0: i2c@2000000 {

On Tue, Feb 28, 2023 at 06:32:09PM +0200, Ioana Ciornei wrote:
Move the serial nodes under the soc node. No changes are made to the nodes, just their location is changed.
Signed-off-by: Ioana Ciornei ioana.ciornei@nxp.com
Small typo in the commit message here and in other patches: "dst" instead of "dts".
Otherwise:
Reviewed-by: Vladimir Oltean vladimir.oltean@nxp.com

Sync the serial nodes of the LS208XA RDB/QDS boards with their representation in Linux. We also imported the clockgen and sysclk nodes which are dependencies.
Signed-off-by: Ioana Ciornei ioana.ciornei@nxp.com --- arch/arm/dts/fsl-ls2080a.dtsi | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-)
diff --git a/arch/arm/dts/fsl-ls2080a.dtsi b/arch/arm/dts/fsl-ls2080a.dtsi index 2ee426acfd58..03ef5d5cf6af 100644 --- a/arch/arm/dts/fsl-ls2080a.dtsi +++ b/arch/arm/dts/fsl-ls2080a.dtsi @@ -6,18 +6,32 @@ * Copyright 2013-2015 Freescale Semiconductor, Inc. */
+#include <dt-bindings/clock/fsl,qoriq-clockgen.h> + / { compatible = "fsl,ls2080a"; interrupt-parent = <&gic>; #address-cells = <2>; #size-cells = <2>;
+ aliases { + serial0 = &serial0; + serial1 = &serial1; + }; + memory@80000000 { device_type = "memory"; reg = <0x00000000 0x80000000 0 0x80000000>; /* DRAM space - 1, size : 2 GB DRAM */ };
+ sysclk: sysclk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <100000000>; + clock-output-names = "sysclk"; + }; + gic: interrupt-controller@6000000 { compatible = "arm,gic-v3"; reg = <0x0 0x06000000 0 0x10000>, /* GIC Dist */ @@ -42,20 +56,27 @@ ranges; dma-ranges = <0x0 0x0 0x0 0x0 0x10000 0x00000000>;
+ clockgen: clocking@1300000 { + compatible = "fsl,ls2080a-clockgen"; + reg = <0 0x1300000 0 0xa0000>; + #clock-cells = <2>; + clocks = <&sysclk>; + }; + serial0: serial@21c0500 { - device_type = "serial"; compatible = "fsl,ns16550", "ns16550a"; reg = <0x0 0x21c0500 0x0 0x100>; - clock-frequency = <0>; /* Updated by bootloader */ - interrupts = <0 32 0x1>; /* edge triggered */ + clocks = <&clockgen QORIQ_CLK_PLATFORM_PLL + QORIQ_CLK_PLL_DIV(4)>; + interrupts = <0 32 0x4>; /* Level high type */ };
serial1: serial@21c0600 { - device_type = "serial"; compatible = "fsl,ns16550", "ns16550a"; reg = <0x0 0x21c0600 0x0 0x100>; - clock-frequency = <0>; /* Updated by bootloader */ - interrupts = <0 32 0x1>; /* edge triggered */ + clocks = <&clockgen QORIQ_CLK_PLATFORM_PLL + QORIQ_CLK_PLL_DIV(4)>; + interrupts = <0 32 0x4>; /* Level high type */ }; };

On Tue, Feb 28, 2023 at 06:32:10PM +0200, Ioana Ciornei wrote:
Sync the serial nodes of the LS208XA RDB/QDS boards with their representation in Linux. We also imported the clockgen and sysclk nodes which are dependencies.
Signed-off-by: Ioana Ciornei ioana.ciornei@nxp.com
Reviewed-by: Vladimir Oltean vladimir.oltean@nxp.com

Tag the serial nodes with bootph-all in order to have these nodes and the drivers available before relocation.
Signed-off-by: Ioana Ciornei ioana.ciornei@nxp.com --- arch/arm/dts/fsl-ls2080a.dtsi | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/arch/arm/dts/fsl-ls2080a.dtsi b/arch/arm/dts/fsl-ls2080a.dtsi index 03ef5d5cf6af..d754eb4d5cc8 100644 --- a/arch/arm/dts/fsl-ls2080a.dtsi +++ b/arch/arm/dts/fsl-ls2080a.dtsi @@ -69,6 +69,7 @@ clocks = <&clockgen QORIQ_CLK_PLATFORM_PLL QORIQ_CLK_PLL_DIV(4)>; interrupts = <0 32 0x4>; /* Level high type */ + bootph-all; };
serial1: serial@21c0600 { @@ -77,6 +78,7 @@ clocks = <&clockgen QORIQ_CLK_PLATFORM_PLL QORIQ_CLK_PLL_DIV(4)>; interrupts = <0 32 0x4>; /* Level high type */ + bootph-all; }; };

Now that the DT nodes for the serial devices are in place for these boards, enable DM_SERIAL in the associated configs.
Signed-off-by: Ioana Ciornei ioana.ciornei@nxp.com --- configs/ls2088aqds_tfa_defconfig | 5 +++-- configs/ls2088ardb_tfa_SECURE_BOOT_defconfig | 4 +++- configs/ls2088ardb_tfa_defconfig | 4 +++- 3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/configs/ls2088aqds_tfa_defconfig b/configs/ls2088aqds_tfa_defconfig index a9faa1525ac7..9f10dd23b283 100644 --- a/configs/ls2088aqds_tfa_defconfig +++ b/configs/ls2088aqds_tfa_defconfig @@ -18,7 +18,6 @@ CONFIG_AHCI=y CONFIG_FSL_USE_PCA9547_MUX=y CONFIG_FSL_QIXIS=y # CONFIG_QIXIS_I2C_ACCESS is not set -# CONFIG_SYS_MALLOC_F is not set CONFIG_REMAKE_ELF=y CONFIG_SYS_MONITOR_LEN=1048576 CONFIG_MP=y @@ -113,7 +112,9 @@ CONFIG_DM_RTC=y CONFIG_RTC_ENABLE_32KHZ_OUTPUT=y CONFIG_RTC_DS3231=y CONFIG_DM_SCSI=y -CONFIG_SYS_NS16550_SERIAL=y +CONFIG_SPECIFY_CONSOLE_INDEX=y +CONFIG_DM_SERIAL=y +CONFIG_SYS_NS16550=y CONFIG_SPI=y CONFIG_DM_SPI=y CONFIG_FSL_DSPI=y diff --git a/configs/ls2088ardb_tfa_SECURE_BOOT_defconfig b/configs/ls2088ardb_tfa_SECURE_BOOT_defconfig index 1dd7c1dd808c..f110bee57597 100644 --- a/configs/ls2088ardb_tfa_SECURE_BOOT_defconfig +++ b/configs/ls2088ardb_tfa_SECURE_BOOT_defconfig @@ -100,8 +100,10 @@ CONFIG_PCIE_LAYERSCAPE_RC=y CONFIG_DM_RTC=y CONFIG_RTC_DS3231=y CONFIG_DM_SCSI=y +CONFIG_SPECIFY_CONSOLE_INDEX=y CONFIG_CONS_INDEX=2 -CONFIG_SYS_NS16550_SERIAL=y +CONFIG_DM_SERIAL=y +CONFIG_SYS_NS16550=y CONFIG_SPI=y CONFIG_DM_SPI=y CONFIG_FSL_DSPI=y diff --git a/configs/ls2088ardb_tfa_defconfig b/configs/ls2088ardb_tfa_defconfig index 246ab403754b..6ff4e493dc8b 100644 --- a/configs/ls2088ardb_tfa_defconfig +++ b/configs/ls2088ardb_tfa_defconfig @@ -108,8 +108,10 @@ CONFIG_PCIE_LAYERSCAPE_RC=y CONFIG_DM_RTC=y CONFIG_RTC_DS3231=y CONFIG_DM_SCSI=y +CONFIG_SPECIFY_CONSOLE_INDEX=y CONFIG_CONS_INDEX=2 -CONFIG_SYS_NS16550_SERIAL=y +CONFIG_DM_SERIAL=y +CONFIG_SYS_NS16550=y CONFIG_SPI=y CONFIG_DM_SPI=y CONFIG_FSL_DSPI=y

On Tue, Feb 28, 2023 at 06:32:12PM +0200, Ioana Ciornei wrote:
Now that the DT nodes for the serial devices are in place for these boards, enable DM_SERIAL in the associated configs.
Signed-off-by: Ioana Ciornei ioana.ciornei@nxp.com
configs/ls2088aqds_tfa_defconfig | 5 +++-- configs/ls2088ardb_tfa_SECURE_BOOT_defconfig | 4 +++- configs/ls2088ardb_tfa_defconfig | 4 +++- 3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/configs/ls2088aqds_tfa_defconfig b/configs/ls2088aqds_tfa_defconfig index a9faa1525ac7..9f10dd23b283 100644 --- a/configs/ls2088aqds_tfa_defconfig +++ b/configs/ls2088aqds_tfa_defconfig @@ -18,7 +18,6 @@ CONFIG_AHCI=y CONFIG_FSL_USE_PCA9547_MUX=y CONFIG_FSL_QIXIS=y # CONFIG_QIXIS_I2C_ACCESS is not set -# CONFIG_SYS_MALLOC_F is not set
I found this part of the change to be unexpected, but an offline discussion with Ioana informed me that this line automatically goes away after a "make savedefconfig".
That being said:
Reviewed-by: Vladimir Oltean vladimir.oltean@nxp.com

On Tue, Feb 28, 2023 at 06:32:07PM +0200, Ioana Ciornei wrote:
This patch set converts the LS208xA based boards to DM_SERIAL.
Since we don't want to introduce even more differences between the U-Boot's and Linux's device trees the first 4 patches make the necessary updates so that the serial nodes are synced with their counterpart.
The last patch just enables DM_SERIAL in the associated configs.
Ioana Ciornei (5): arch: arm: dst: fsl-ls2080a.dtsi: add an 'soc' node arch: arm: dst: fsl-ls2080a.dtsi: move the serial nodes under soc arch: arm: dst: fsl-ls2080a.dts: sync serial nodes with Linux arch: arm: dst: fsl-ls2080a.dts: tag serial nodes with bootph-all configs: ls208x: enable DM_SERIAL
arch/arm/dts/fsl-ls2080a.dtsi | 57 +++++++++++++++----- configs/ls2088aqds_tfa_defconfig | 5 +- configs/ls2088ardb_tfa_SECURE_BOOT_defconfig | 4 +- configs/ls2088ardb_tfa_defconfig | 4 +- 4 files changed, 53 insertions(+), 17 deletions(-)
This is good to see. My main question is, can we do a more complete sync with the upstream dts files?

On Tue, Feb 28, 2023 at 11:40:15AM -0500, Tom Rini wrote:
On Tue, Feb 28, 2023 at 06:32:07PM +0200, Ioana Ciornei wrote:
This patch set converts the LS208xA based boards to DM_SERIAL.
Since we don't want to introduce even more differences between the U-Boot's and Linux's device trees the first 4 patches make the necessary updates so that the serial nodes are synced with their counterpart.
The last patch just enables DM_SERIAL in the associated configs.
Ioana Ciornei (5): arch: arm: dst: fsl-ls2080a.dtsi: add an 'soc' node arch: arm: dst: fsl-ls2080a.dtsi: move the serial nodes under soc arch: arm: dst: fsl-ls2080a.dts: sync serial nodes with Linux arch: arm: dst: fsl-ls2080a.dts: tag serial nodes with bootph-all configs: ls208x: enable DM_SERIAL
arch/arm/dts/fsl-ls2080a.dtsi | 57 +++++++++++++++----- configs/ls2088aqds_tfa_defconfig | 5 +- configs/ls2088ardb_tfa_SECURE_BOOT_defconfig | 4 +- configs/ls2088ardb_tfa_defconfig | 4 +- 4 files changed, 53 insertions(+), 17 deletions(-)
This is good to see. My main question is, can we do a more complete sync with the upstream dts files?
Sure, that would be the plan. Not in this patch set though.
Ioana

On Tue, Feb 28, 2023 at 06:47:04PM +0200, Ioana Ciornei wrote:
On Tue, Feb 28, 2023 at 11:40:15AM -0500, Tom Rini wrote:
On Tue, Feb 28, 2023 at 06:32:07PM +0200, Ioana Ciornei wrote:
This patch set converts the LS208xA based boards to DM_SERIAL.
Since we don't want to introduce even more differences between the U-Boot's and Linux's device trees the first 4 patches make the necessary updates so that the serial nodes are synced with their counterpart.
The last patch just enables DM_SERIAL in the associated configs.
Ioana Ciornei (5): arch: arm: dst: fsl-ls2080a.dtsi: add an 'soc' node arch: arm: dst: fsl-ls2080a.dtsi: move the serial nodes under soc arch: arm: dst: fsl-ls2080a.dts: sync serial nodes with Linux arch: arm: dst: fsl-ls2080a.dts: tag serial nodes with bootph-all configs: ls208x: enable DM_SERIAL
arch/arm/dts/fsl-ls2080a.dtsi | 57 +++++++++++++++----- configs/ls2088aqds_tfa_defconfig | 5 +- configs/ls2088ardb_tfa_SECURE_BOOT_defconfig | 4 +- configs/ls2088ardb_tfa_defconfig | 4 +- 4 files changed, 53 insertions(+), 17 deletions(-)
This is good to see. My main question is, can we do a more complete sync with the upstream dts files?
Sure, that would be the plan. Not in this patch set though.
OK. It is future work I would very much like to see, thanks.

Hi Ioana,
Thanks for working on this.
On 3/1/2023 12:32 AM, Ioana Ciornei wrote:
This patch set converts the LS208xA based boards to DM_SERIAL.
Since we don't want to introduce even more differences between the U-Boot's and Linux's device trees the first 4 patches make the necessary updates so that the serial nodes are synced with their counterpart.
The last patch just enables DM_SERIAL in the associated configs.
LGTM: Reviewed-by: Peng Fan peng.fan@nxp.com
Thanks, Peng.
Ioana Ciornei (5): arch: arm: dst: fsl-ls2080a.dtsi: add an 'soc' node arch: arm: dst: fsl-ls2080a.dtsi: move the serial nodes under soc arch: arm: dst: fsl-ls2080a.dts: sync serial nodes with Linux arch: arm: dst: fsl-ls2080a.dts: tag serial nodes with bootph-all configs: ls208x: enable DM_SERIAL
arch/arm/dts/fsl-ls2080a.dtsi | 57 +++++++++++++++----- configs/ls2088aqds_tfa_defconfig | 5 +- configs/ls2088ardb_tfa_SECURE_BOOT_defconfig | 4 +- configs/ls2088ardb_tfa_defconfig | 4 +- 4 files changed, 53 insertions(+), 17 deletions(-)
participants (4)
-
Ioana Ciornei
-
Peng Fan
-
Tom Rini
-
Vladimir Oltean