Skip to contentSkip to conversation

Basic Kontron SMARC-sAL28 board support

PATCH Superseded Michael Walle 2 participants 4 messages Aug 25, 2020 – Aug 26, 2020 Arm (32-bit)

v5 of 9 Superseded Latest is v9 →

lore
Share & tools
lore
#0 lore raw

v5 cover Basic Kontron SMARC-sAL28 board support

Add basic board support for the Kontron SMARC-sAL28 board. Please note, that this board doesn't support TF-a (yet). Therefore, the u-boot SPL is the first code which is run and it has to set up the RAM.

changes since v4:
- dropped "armv8: ls1028a: move FSL_LAYERSCAPE to kconfig" as it is already upstream
- new patch "board: sl28: add board specific nvm command"
- use binman
- sync device trees with linux
- use "<devicetree>-u-boot.dtsi" style
- rebase to lastest master

changes since v3:
- rebase to latest master
- use CONFIG_PCI_INIT_R
- set fdtfile in default environment

changes since v2:
- add variant 4 support. Since the atheros PHY dt bindings were merged into master, we can now use them
- add environment section in include/configs/kontron_sl28.h
- add cover letter

changes since v1:
- fix watchdog device tree reference

Michael Walle (2):
board: kontron: add sl28 support
board: sl28: add board specific nvm command

 arch/arm/Kconfig                              |  11 +
 arch/arm/dts/Makefile                         |   3 +
 .../dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi  | 135 +++++++++++++
 .../fsl-ls1028a-kontron-sl28-var3-u-boot.dtsi |   1 +
 .../arm/dts/fsl-ls1028a-kontron-sl28-var3.dts |  15 ++
 .../fsl-ls1028a-kontron-sl28-var4-u-boot.dtsi |   1 +
 .../arm/dts/fsl-ls1028a-kontron-sl28-var4.dts |  48 +++++
 arch/arm/dts/fsl-ls1028a-kontron-sl28.dts     | 189 ++++++++++++++++++
 board/kontron/sl28/Kconfig                    |  18 ++
 board/kontron/sl28/MAINTAINERS                |   6 +
 board/kontron/sl28/Makefile                   |   8 +
 board/kontron/sl28/README                     | 142 +++++++++++++
 board/kontron/sl28/cmds.c                     | 176 ++++++++++++++++
 board/kontron/sl28/common.c                   |  10 +
 board/kontron/sl28/ddr.c                      |  98 +++++++++
 board/kontron/sl28/sl28.c                     |  75 +++++++
 board/kontron/sl28/spl.c                      |  32 +++
 configs/kontron_sl28_defconfig                | 106 ++++++++++
 include/configs/kontron_sl28.h                | 125 ++++++++++++
 19 files changed, 1199 insertions(+)
 create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi
 create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28-var3-u-boot.dtsi
 create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28-var3.dts
 create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28-var4-u-boot.dtsi
 create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28-var4.dts
 create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28.dts
 create mode 100644 board/kontron/sl28/Kconfig
 create mode 100644 board/kontron/sl28/MAINTAINERS
 create mode 100644 board/kontron/sl28/Makefile
 create mode 100644 board/kontron/sl28/README
 create mode 100644 board/kontron/sl28/cmds.c
 create mode 100644 board/kontron/sl28/common.c
 create mode 100644 board/kontron/sl28/ddr.c
 create mode 100644 board/kontron/sl28/sl28.c
 create mode 100644 board/kontron/sl28/spl.c
 create mode 100644 configs/kontron_sl28_defconfig
 create mode 100644 include/configs/kontron_sl28.h
Signature · 1 line
2.20.1
#1 lore raw

PATCH v5 1/2 board: kontron: add sl28 support

Add basic support for the Kontron SMARC-sAL28 board. This includes just the bare minimum to be able to bring up the board and boot linux.

For now, the Single and Dual PHY variant is supported. Other variants will fall back to the basic variant.

In particular, there is no watchdog support for now. This means that you have to disable the default watchdog, otherwise you'll end up in the recovery bootloader. See the board README for details.

---
 arch/arm/Kconfig                              |  11 +
 arch/arm/dts/Makefile                         |   3 +
 .../dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi  | 135 +++++++++++++
 .../fsl-ls1028a-kontron-sl28-var3-u-boot.dtsi |   2 +
 .../arm/dts/fsl-ls1028a-kontron-sl28-var3.dts |  15 ++
 .../fsl-ls1028a-kontron-sl28-var4-u-boot.dtsi |   2 +
 .../arm/dts/fsl-ls1028a-kontron-sl28-var4.dts |  48 +++++
 arch/arm/dts/fsl-ls1028a-kontron-sl28.dts     | 189 ++++++++++++++++++
 board/kontron/sl28/Kconfig                    |  18 ++
 board/kontron/sl28/MAINTAINERS                |   6 +
 board/kontron/sl28/Makefile                   |   8 +
 board/kontron/sl28/README                     |  63 ++++++
 board/kontron/sl28/common.c                   |  10 +
 board/kontron/sl28/ddr.c                      |  98 +++++++++
 board/kontron/sl28/sl28.c                     |  70 +++++++
 board/kontron/sl28/spl.c                      |  32 +++
 configs/kontron_sl28_defconfig                | 106 ++++++++++
 include/configs/kontron_sl28.h                | 125 ++++++++++++
 18 files changed, 941 insertions(+)
 create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi
 create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28-var3-u-boot.dtsi
 create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28-var3.dts
 create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28-var4-u-boot.dtsi
 create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28-var4.dts
 create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28.dts
 create mode 100644 board/kontron/sl28/Kconfig
 create mode 100644 board/kontron/sl28/MAINTAINERS
 create mode 100644 board/kontron/sl28/Makefile
 create mode 100644 board/kontron/sl28/README
 create mode 100644 board/kontron/sl28/common.c
 create mode 100644 board/kontron/sl28/ddr.c
 create mode 100644 board/kontron/sl28/sl28.c
 create mode 100644 board/kontron/sl28/spl.c
 create mode 100644 configs/kontron_sl28_defconfig
 create mode 100644 include/configs/kontron_sl28.h
arch/arm/Kconfig +11 -0
index c5ebd59d34..a9746f87cc 100644
@@ -1615,6 +1615,16 @@ config TARGET_LS1046AFRWY
 	  development platform that supports the QorIQ LS1046A
 	  Layerscape Architecture processor.
 
+config TARGET_SL28
+	bool "Support sl28"
+	select ARCH_LS1028A
+	select ARM64
+	select ARMV8_MULTIENTRY
+	select SUPPORT_SPL
+	select BINMAN
+	help
+	  Support for Kontron SMARC-sAL28 board.
+
 config TARGET_COLIBRI_PXA270
 	bool "Support colibri_pxa270"
 	select CPU_PXA
@@ -1962,6 +1972,7 @@ source "board/hisilicon/hikey/Kconfig"
 source "board/hisilicon/hikey960/Kconfig"
 source "board/hisilicon/poplar/Kconfig"
 source "board/isee/igep003x/Kconfig"
+source "board/kontron/sl28/Kconfig"
 source "board/myir/mys_6ulx/Kconfig"
 source "board/spear/spear300/Kconfig"
 source "board/spear/spear310/Kconfig"
arch/arm/dts/Makefile +3 -0
index f8f529435b..b45eb6a772 100644
@@ -422,6 +422,9 @@ dtb-$(CONFIG_FSL_LSCH2) += fsl-ls1043a-qds-duart.dtb \
 	fsl-ls1012a-2g5rdb.dtb \
 	fsl-ls1012a-frdm.dtb \
 	fsl-ls1012a-frwy.dtb
+dtb-$(CONFIG_TARGET_SL28) += fsl-ls1028a-kontron-sl28.dtb \
+	fsl-ls1028a-kontron-sl28-var3.dtb \
+	fsl-ls1028a-kontron-sl28-var4.dtb \
 
 dtb-$(CONFIG_TARGET_DRAGONBOARD410C) += dragonboard410c.dtb
 dtb-$(CONFIG_TARGET_DRAGONBOARD820C) += dragonboard820c.dtb
arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi new file +135 -0

135 lines not on this page · raw message

arch/arm/dts/fsl-ls1028a-kontron-sl28-var3-u-boot.dtsi new file +2 -0
new file mode 100644
index 0000000000..79b771e074
@@ -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-var3.dts new file +15 -0
new file mode 100644
index 0000000000..0c8b2af41a
@@ -0,0 +1,15 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Device Tree file for the Kontron SMARC-sAL28 board.
+ *
+ * Copyright (C) 2019 Michael Walle <[email protected]>
+ *
+ */
+
+/dts-v1/;
+#include "fsl-ls1028a-kontron-sl28.dts"
+
+/ {
+	model = "Kontron SMARC-sAL28 (Single PHY)";
+	compatible = "kontron,sl28-var3", "kontron,sl28", "fsl,ls1028a";
+};
arch/arm/dts/fsl-ls1028a-kontron-sl28-var4-u-boot.dtsi new file +2 -0
new file mode 100644
index 0000000000..79b771e074
@@ -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-var4.dts new file +48 -0

48 lines not on this page · raw message

arch/arm/dts/fsl-ls1028a-kontron-sl28.dts new file +189 -0

189 lines not on this page · raw message

board/kontron/sl28/Kconfig new file +18 -0
new file mode 100644
index 0000000000..cdec39be01
@@ -0,0 +1,18 @@
+if TARGET_SL28
+
+config SYS_BOARD
+	default "sl28"
+
+config SYS_VENDOR
+	default "kontron"
+
+config SYS_SOC
+	default "fsl-layerscape"
+
+config SYS_CONFIG_NAME
+	default "kontron_sl28"
+
+config SYS_TEXT_BASE
+	default 0x96000000
+
+endif
board/kontron/sl28/MAINTAINERS new file +6 -0
new file mode 100644
index 0000000000..047a057646
@@ -0,0 +1,6 @@
+Kontron SMARC-sAL28 board
+M:	Michael Walle <[email protected]>
+S:	Maintained
+F:	board/kontron/sl28/
+F:	include/configs/kontron_sl28.h
+F:	configs/kontron_sl28_defconfig
board/kontron/sl28/Makefile new file +8 -0
new file mode 100644
index 0000000000..0f1866c874
@@ -0,0 +1,8 @@
+# SPDX-License-Identifier:	GPL-2.0+
+
+ifndef CONFIG_SPL_BUILD
+obj-y += sl28.o
+endif
+
+obj-y += common.o ddr.o
+obj-$(CONFIG_SPL_BUILD) += spl.o
board/kontron/sl28/README new file +63 -0

63 lines not on this page · raw message

board/kontron/sl28/common.c new file +10 -0
new file mode 100644
index 0000000000..14704f7051
@@ -0,0 +1,10 @@
+// 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/ddr.c new file +98 -0

98 lines not on this page · raw message

board/kontron/sl28/sl28.c new file +70 -0

70 lines not on this page · raw message

board/kontron/sl28/spl.c new file +32 -0
new file mode 100644
index 0000000000..fa5829eee0
@@ -0,0 +1,32 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/spl.h>
+
+#define DCFG_RCWSR25 0x160
+#define GPINFO_HW_VARIANT_MASK 0xff
+
+int sl28_variant(void)
+{
+	return in_le32(DCFG_BASE + DCFG_RCWSR25) & GPINFO_HW_VARIANT_MASK;
+}
+
+int board_fit_config_name_match(const char *name)
+{
+	int variant = sl28_variant();
+
+	switch (variant) {
+	case 3:
+		return strcmp(name, "fsl-ls1028a-kontron-sl28-var3");
+	case 4:
+		return strcmp(name, "fsl-ls1028a-kontron-sl28-var4");
+	default:
+		return strcmp(name, "fsl-ls1028a-kontron-sl28");
+	}
+}
+
+void board_boot_order(u32 *spl_boot_list)
+{
+	spl_boot_list[0] = BOOT_DEVICE_SPI;
+}
configs/kontron_sl28_defconfig new file +106 -0

106 lines not on this page · raw message

include/configs/kontron_sl28.h new file +125 -0

125 lines not on this page · raw message

Signature · 1 line
2.20.1
#2 lore raw

PATCH v5 1/2 board: kontron: add sl28 support

Review

Quoted 3 lines
(quoted diff) +3 -0
+/* environment */
+/* allow to overwrite serial and ethaddr */ #define
+CONFIG_ENV_OVERWRITE

[...]

Hi Michael,
CONFIG_ENV_OVERWRITE is now converted to Kconfig option and has been moved to defconfigs. Adam Ford has a patch doing that and is available in latest master.

-Kuldeep

#3 lore raw

PATCH v5 2/2 board: sl28: add board specific nvm command

In reply to Michael Walle

The board supports 16 configuration bits which can be manipulated with this command. See the board's README for a detailed explanation on each bit.

---
 board/kontron/sl28/Makefile |   2 +-
 board/kontron/sl28/README   |  79 ++++++++++++++++
 board/kontron/sl28/cmds.c   | 178 ++++++++++++++++++++++++++++++++++++
 3 files changed, 258 insertions(+), 1 deletion(-)
 create mode 100644 board/kontron/sl28/cmds.c
board/kontron/sl28/Makefile +1 -1
index 0f1866c874..74d8012f0f 100644
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier:	GPL-2.0+
 
 ifndef CONFIG_SPL_BUILD
-obj-y += sl28.o
+obj-y += sl28.o cmds.o
 endif
 
 obj-y += common.o ddr.o
board/kontron/sl28/README +79 -0

85 lines not on this page · raw message

board/kontron/sl28/cmds.c new file +178 -0

178 lines not on this page · raw message

Signature · 1 line
2.20.1