board: sl28: new variants and SATA support
cover board: sl28: new variants and SATA support
Add support for the last two remaining board variants and add SATA support.
This is intended for the next branch.
Michael Walle (4):
board: sl28: move ethernet aliases to variant specific dtsi
board: sl28: add network variant 1 support
board: sl28: add network variant 2 support
board: sl28: add SATA support
arch/arm/dts/Makefile | 2 + .../dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi | 64 +++++++++++++++++-- .../fsl-ls1028a-kontron-sl28-var1-u-boot.dtsi | 8 +++ .../arm/dts/fsl-ls1028a-kontron-sl28-var1.dts | 57 +++++++++++++++++ .../fsl-ls1028a-kontron-sl28-var2-u-boot.dtsi | 2 + .../arm/dts/fsl-ls1028a-kontron-sl28-var2.dts | 25 ++++++++ .../fsl-ls1028a-kontron-sl28-var3-u-boot.dtsi | 6 ++ .../fsl-ls1028a-kontron-sl28-var4-u-boot.dtsi | 7 ++ arch/arm/dts/fsl-ls1028a-kontron-sl28.dts | 4 ++ board/kontron/sl28/Makefile | 2 +- board/kontron/sl28/common.c | 10 --- board/kontron/sl28/sl28.c | 6 ++ board/kontron/sl28/spl.c | 38 +++++++++++ configs/kontron_sl28_defconfig | 1 + include/configs/kontron_sl28.h | 1 + 15 files changed, 215 insertions(+), 18 deletions(-) create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28-var1-u-boot.dtsi create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28-var1.dts create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28-var2-u-boot.dtsi create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28-var2.dts delete mode 100644 board/kontron/sl28/common.c
Signature · 1 line
2.20.1
PATCH 1/4 board: sl28: move ethernet aliases to variant specific dtsi
The variants differ in their network configuration. Move the first two network aliases to the proper variant device tree includes. This is in prepartion for variant 1 and 2 support which has a different network port mapping. The network aliases for the two internal ports will stay in the common dtsi because they are present on all board variants.
This might leave a hole if there is no ethernet1 alias. This is intended.
--- arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi | 2 -- arch/arm/dts/fsl-ls1028a-kontron-sl28-var3-u-boot.dtsi | 6 ++++++ arch/arm/dts/fsl-ls1028a-kontron-sl28-var4-u-boot.dtsi | 7 +++++++ 3 files changed, 13 insertions(+), 2 deletions(-)
arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi +0 -2
@@ -10,8 +10,6 @@ i2c1 = &i2c3; i2c2 = &i2c4; rtc0 = &rtc; - ethernet0 = &enetc0; - ethernet1 = &enetc1; ethernet2 = &enetc2; ethernet3 = &enetc6; };
arch/arm/dts/fsl-ls1028a-kontron-sl28-var3-u-boot.dtsi +6 -0
@@ -1,2 +1,8 @@ // SPDX-License-Identifier: GPL-2.0+ #include "fsl-ls1028a-kontron-sl28-u-boot.dtsi" + +/ { + aliases { + ethernet0 = &enetc0; + }; +};
arch/arm/dts/fsl-ls1028a-kontron-sl28-var4-u-boot.dtsi +7 -0
@@ -1,2 +1,9 @@ // SPDX-License-Identifier: GPL-2.0+ #include "fsl-ls1028a-kontron-sl28-u-boot.dtsi" + +/ { + aliases { + ethernet0 = &enetc0; + ethernet1 = &enetc1; + }; +};
Signature · 1 line
2.20.1
PATCH 2/4 board: sl28: add network variant 1 support
In reply to Michael WalleThis variant has one network port connected via RGMII and doesn't have any TSN capabilities out-of-the-box. Instead it has all four SerDes lanes available for customer use.
--- arch/arm/dts/Makefile | 1 + .../dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi | 33 ++++++++++- .../fsl-ls1028a-kontron-sl28-var1-u-boot.dtsi | 8 +++ .../arm/dts/fsl-ls1028a-kontron-sl28-var1.dts | 57 +++++++++++++++++++ board/kontron/sl28/spl.c | 2 + 5 files changed, 98 insertions(+), 3 deletions(-) create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28-var1-u-boot.dtsi create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28-var1.dts
arch/arm/dts/Makefile +1 -0
@@ -432,6 +432,7 @@ dtb-$(CONFIG_FSL_LSCH2) += fsl-ls1043a-qds-duart.dtb \ fsl-ls1012a-frdm.dtb \ fsl-ls1012a-frwy.dtb dtb-$(CONFIG_TARGET_SL28) += fsl-ls1028a-kontron-sl28.dtb \ + fsl-ls1028a-kontron-sl28-var1.dtb \ fsl-ls1028a-kontron-sl28-var3.dtb \ fsl-ls1028a-kontron-sl28-var4.dtb \
arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi +30 -3
@@ -50,6 +50,17 @@ }; fdt-2 { + description = "fsl-ls1028a-kontron-sl28-var1"; + type = "flat_dt"; + arch = "arm"; + compression = "none"; + + blob { + filename = "arch/arm/dts/fsl-ls1028a-kontron-sl28-var1.dtb"; + }; + }; + + fdt-3 { description = "fsl-ls1028a-kontron-sl28-var3"; type = "flat_dt"; arch = "arm";
@@ -60,7 +71,7 @@ }; }; - fdt-3 { + fdt-4 { description = "fsl-ls1028a-kontron-sl28-var4"; type = "flat_dt"; arch = "arm";
@@ -82,16 +93,23 @@ }; conf-2 { - description = "fsl-ls1028a-kontron-sl28-var3"; + description = "fsl-ls1028a-kontron-sl28-var1"; firmware = "uboot"; fdt = "fdt-2"; }; conf-3 { - description = "fsl-ls1028a-kontron-sl28-var4"; + description = "fsl-ls1028a-kontron-sl28-var3"; firmware = "uboot"; fdt = "fdt-3"; }; + + conf-4 { + description = "fsl-ls1028a-kontron-sl28-var4"; + firmware = "uboot"; + loadables = "uboot"; + fdt = "fdt-4"; + }; }; }; };
@@ -131,6 +149,11 @@ firmware = "bl31"; loadables = "uboot"; }; + + conf-4 { + firmware = "bl31"; + loadables = "uboot"; + }; }; }; };
@@ -167,6 +190,10 @@ conf-3 { loadables = "uboot", "bl32"; }; + + conf-4 { + loadables = "uboot", "bl32"; + }; }; }; };
arch/arm/dts/fsl-ls1028a-kontron-sl28-var1-u-boot.dtsi new file +8 -0
@@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0+ +#include "fsl-ls1028a-kontron-sl28-u-boot.dtsi" + +/ { + aliases { + ethernet0 = &enetc1; + }; +};
arch/arm/dts/fsl-ls1028a-kontron-sl28-var1.dts new file +57 -0
57 lines not on this page · raw message
board/kontron/sl28/spl.c +2 -0
@@ -17,6 +17,8 @@ int board_fit_config_name_match(const char *name)int variant =sl28_variant ();switch (variant) { +case 1 : +return strcmp (name,"fsl-ls1028a-kontron-sl28-var1" );case 3 :return strcmp (name,"fsl-ls1028a-kontron-sl28-var3" );case 4 :
Signature · 1 line
2.20.1
PATCH 3/4 board: sl28: add network variant 2 support
In reply to Michael WalleAlthough this variant has two external network ports, they are not (yet) supported by the bootloader because they are connected via an internal network switch. Otherwise its the same as the other variants.
--- arch/arm/dts/Makefile | 1 + .../dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi | 33 +++++++++++++++++-- .../fsl-ls1028a-kontron-sl28-var2-u-boot.dtsi | 2 ++ .../arm/dts/fsl-ls1028a-kontron-sl28-var2.dts | 25 ++++++++++++++ board/kontron/sl28/spl.c | 2 ++ 5 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28-var2-u-boot.dtsi create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28-var2.dts
arch/arm/dts/Makefile +1 -0
@@ -433,6 +433,7 @@ dtb-$(CONFIG_FSL_LSCH2) += fsl-ls1043a-qds-duart.dtb \ fsl-ls1012a-frwy.dtb dtb-$(CONFIG_TARGET_SL28) += fsl-ls1028a-kontron-sl28.dtb \ fsl-ls1028a-kontron-sl28-var1.dtb \ + fsl-ls1028a-kontron-sl28-var2.dtb \ fsl-ls1028a-kontron-sl28-var3.dtb \ fsl-ls1028a-kontron-sl28-var4.dtb \
arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi +30 -3
@@ -61,6 +61,17 @@ }; fdt-3 { + description = "fsl-ls1028a-kontron-sl28-var2"; + type = "flat_dt"; + arch = "arm"; + compression = "none"; + + blob { + filename = "arch/arm/dts/fsl-ls1028a-kontron-sl28-var2.dtb"; + }; + }; + + fdt-4 { description = "fsl-ls1028a-kontron-sl28-var3"; type = "flat_dt"; arch = "arm";
@@ -71,7 +82,7 @@ }; }; - fdt-4 { + fdt-5 { description = "fsl-ls1028a-kontron-sl28-var4"; type = "flat_dt"; arch = "arm";
@@ -99,17 +110,24 @@ }; conf-3 { - description = "fsl-ls1028a-kontron-sl28-var3"; + description = "fsl-ls1028a-kontron-sl28-var2"; firmware = "uboot"; fdt = "fdt-3"; }; conf-4 { - description = "fsl-ls1028a-kontron-sl28-var4"; + description = "fsl-ls1028a-kontron-sl28-var3"; firmware = "uboot"; loadables = "uboot"; fdt = "fdt-4"; }; + + conf-5 { + description = "fsl-ls1028a-kontron-sl28-var4"; + firmware = "uboot"; + loadables = "uboot"; + fdt = "fdt-5"; + }; }; }; };
@@ -154,6 +172,11 @@ firmware = "bl31"; loadables = "uboot"; }; + + conf-5 { + firmware = "bl31"; + loadables = "uboot"; + }; }; }; };
@@ -194,6 +217,10 @@ conf-4 { loadables = "uboot", "bl32"; }; + + conf-5 { + loadables = "uboot", "bl32"; + }; }; }; };
arch/arm/dts/fsl-ls1028a-kontron-sl28-var2-u-boot.dtsi new file +2 -0
@@ -0,0 +1,2 @@ +// SPDX-License-Identifier: GPL-2.0+ +#include "fsl-ls1028a-kontron-sl28-u-boot.dtsi"
arch/arm/dts/fsl-ls1028a-kontron-sl28-var2.dts new file +25 -0
@@ -0,0 +1,25 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Device Tree file for the Kontron SMARC-sAL28 board. + * + * This is for the network variant 2 which has no ethernet support in the + * bootloader. + * + * Copyright (C) 2020 Michael Walle <[email protected]> + * + */ + +/dts-v1/; +#include "fsl-ls1028a-kontron-sl28.dts" + +/ { + model = "Kontron SMARC-sAL28 (TSN-on-module)"; + compatible = "kontron,sl28-var2", "kontron,sl28", "fsl,ls1028a"; +}; + +&enetc0 { + status = "disabled"; + /delete-property/ phy-handle; +}; + +/delete-node/ &phy0;
board/kontron/sl28/spl.c +2 -0
@@ -19,6 +19,8 @@ int board_fit_config_name_match(const char *name)switch (variant) {case 1 :return strcmp (name,"fsl-ls1028a-kontron-sl28-var1" ); +case 2 : +return strcmp (name,"fsl-ls1028a-kontron-sl28-var2" );case 3 :return strcmp (name,"fsl-ls1028a-kontron-sl28-var3" );case 4 :
Signature · 1 line
2.20.1
PATCH 4/4 board: sl28: add SATA support
In reply to Michael WalleEnable SATA support. Although not supported by the usual SATA pins on the SMARC baseboard connector, SATA mode is supported on a PCIe lane. This way one can use a mSATA card in a Mini PCI slot.
We need to invert the received data because in this mode the polarity of the SerDes lane is swapped. Provide a fixup in board_early_init_f() for the SPL. board_early_init_f() is then not common between SPL and u-boot proper anymore, thus common.c is removed, as it just contained said function.
--- arch/arm/dts/fsl-ls1028a-kontron-sl28.dts | 4 +++ board/kontron/sl28/Makefile | 2 +- board/kontron/sl28/common.c | 10 ------- board/kontron/sl28/sl28.c | 6 ++++ board/kontron/sl28/spl.c | 34 +++++++++++++++++++++++ configs/kontron_sl28_defconfig | 1 + include/configs/kontron_sl28.h | 1 + 7 files changed, 47 insertions(+), 11 deletions(-) delete mode 100644 board/kontron/sl28/common.c
arch/arm/dts/fsl-ls1028a-kontron-sl28.dts +4 -0
@@ -172,6 +172,10 @@ }; }; +&sata { + status = "okay"; +}; + &serial0 { status = "okay"; };
board/kontron/sl28/Makefile +1 -1
@@ -4,7 +4,7 @@ ifndef CONFIG_SPL_BUILD obj-y += sl28.o cmds.o endif -obj-y += common.o ddr.o +obj-y += ddr.o ifdef CONFIG_SPL_BUILD obj-y += spl.o
board/kontron/sl28/common.c deleted +0 -10
@@ -1,10 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ - -#include <common.h> -#include <asm/arch-fsl-layerscape/soc.h> - -int board_early_init_f (void ) -{ -fsl_lsch3_early_init_f (); -return 0 ; -}
board/kontron/sl28/sl28.c +6 -0
@@ -19,6 +19,12 @@DECLARE_GLOBAL_DATA_PTR ; +int board_early_init_f (void ) +{ +fsl_lsch3_early_init_f (); +return 0 ; +} +int board_init (void ) {if (CONFIG_IS_ENABLED (FSL_CAAM ))
board/kontron/sl28/spl.c +34 -0
@@ -3,10 +3,36 @@#include <common.h> #include <asm/io.h> #include <asm/spl.h> +#include <asm/arch-fsl-layerscape/fsl_serdes.h> +#include <asm/arch-fsl-layerscape/soc.h> #define DCFG_RCWSR25 0x160#define GPINFO_HW_VARIANT_MASK 0xff +#define SERDES_LNDGCR0 0x1ea08c0 +#define LNDGCR0_PROTS_MASK GENMASK(11, 7) +#define LNDGCR0_PROTS_SATA (0x2 << 7) +#define SERDES_LNDGCR1 0x1ea08c4 +#define LNDGCR1_RDAT_INV BIT(31) + +/* +* On this board the SMARC PCIe lane D might be switched to SATA mode. This +* makes sense if this lane is connected to a Mini PCI slot and a mSATA card +* is plugged in. In this case, the RX pair is swapped and we need to invert +* the received data. +*/ +static void fixup_sata_rx_polarity (void ) +{ +u32 prot =in_le32 (SERDES_LNDGCR0 ) &LNDGCR0_PROTS_MASK ; +u32 tmp; + +if (prot ==LNDGCR0_PROTS_SATA ) { + tmp =in_le32 (SERDES_LNDGCR1 ); + tmp |=LNDGCR1_RDAT_INV ; +out_le32 (SERDES_LNDGCR1 , tmp); + } +} +int sl28_variant (void ) {return in_le32 (DCFG_BASE +DCFG_RCWSR25 ) &GPINFO_HW_VARIANT_MASK ;
@@ -34,3 +60,11 @@ void board_boot_order(u32 *spl_boot_list) { spl_boot_list[0 ] =BOOT_DEVICE_SPI ; } + +int board_early_init_f (void ) +{ +fixup_sata_rx_polarity (); +fsl_lsch3_early_init_f (); + +return 0 ; +}
configs/kontron_sl28_defconfig +1 -0
@@ -62,6 +62,7 @@ CONFIG_DM=y CONFIG_SPL_DM=y CONFIG_SPL_DM_SEQ_ALIAS=y CONFIG_SCSI_AHCI=y +CONFIG_SATA_CEVA=y CONFIG_FSL_CAAM=y CONFIG_SYS_FSL_DDR3=y CONFIG_DM_I2C=y
include/configs/kontron_sl28.h +1 -0
@@ -93,6 +93,7 @@ func(MMC, mmc, 1) \ func(NVME, nvme, 0) \ func(USB, usb, 0) \ + func(SCSI, scsi, 0) \ func(DHCP, dhcp, 0) \ func(PXE, pxe, 0)#include <config_distro_bootcmd.h>
Signature · 1 line
2.20.1