Skip to contentSkip to conversation

Initial Traverse Ten64 board support

PATCH In review Mathew McBride 2 participants 6 messages Nov 10, 2021 – Nov 17, 2021 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

v2 cover Initial Traverse Ten64 board support

This patchset adds initial support for the Traverse Ten64 family, which is a networking focused Mini-ITX board using NXP's LS1088A.

This patchset is the bare minimum necessary to get a system running on U-Boot and booting via distroboot/EFI.

There are still a few more drivers to come, such as the I2C setup for the USB5744 hub and EMC2301 fan controller.

Additionally, this patchset does not contain any of the defaults (e.g bootmenu settings) we have in our official firmware releases.

This set contains two additions:
- The driver for the board microcontroller
The microcontroller holds the board MAC address and controls some board functions (like power to the 10G retimer).
This has been placed in boards/traverse/common/ as future Traverse products may use it as well.
- The board file itself

Changes in v2:
- Delete #if CONFIG_IS_DEFINED(..) uses
Most of these are unlikely (such as compiling U-Boot with Ethernet and DPAA2) and the rest should go away with compiler optimization
- Move microcontroller constants (e.g API call numbers) to enum

Mathew McBride (2):
board: traverse: add Ten64 board controller driver
board: traverse: add initial Ten64 support

 arch/arm/Kconfig                         |  16 +
 arch/arm/dts/Makefile                    |   2 +
 arch/arm/dts/fsl-ls1088a-ten64.dts       | 377 +++++++++++++++++++
 board/traverse/common/Kconfig            |   6 +
 board/traverse/common/Makefile           |   1 +
 board/traverse/common/ten64-controller.h |  28 ++
 board/traverse/common/ten64_controller.c | 240 +++++++++++++
 board/traverse/ten64/Kconfig             |  17 +
 board/traverse/ten64/MAINTAINERS         |   8 +
 board/traverse/ten64/Makefile            |   6 +
 board/traverse/ten64/eth_ten64.c         |  47 +++
 board/traverse/ten64/ten64.c             | 438 +++++++++++++++++++++++
 configs/ten64_tfa_defconfig              | 119 ++++++
 include/configs/ten64.h                  |  55 +++
 14 files changed, 1360 insertions(+)
 create mode 100644 arch/arm/dts/fsl-ls1088a-ten64.dts
 create mode 100644 board/traverse/common/Kconfig
 create mode 100644 board/traverse/common/Makefile
 create mode 100644 board/traverse/common/ten64-controller.h
 create mode 100644 board/traverse/common/ten64_controller.c
 create mode 100644 board/traverse/ten64/Kconfig
 create mode 100644 board/traverse/ten64/MAINTAINERS
 create mode 100644 board/traverse/ten64/Makefile
 create mode 100644 board/traverse/ten64/eth_ten64.c
 create mode 100644 board/traverse/ten64/ten64.c
 create mode 100644 configs/ten64_tfa_defconfig
 create mode 100644 include/configs/ten64.h
Signature · 1 line
2.30.1
#1 lore raw

PATCH v2 1/2 board: traverse: add Ten64 board controller driver

Traverse Technologies Ten64 family boards use a microcontroller to control low level board functions like startup and reset, as well as holding details such as the board MAC address.

Communication between the CPU and microcontroller is via I2C.

To keep the driver structure clean between the Ten64 board file, DM_I2C, and a future utility command, this driver has been implemented as a misc uclass device.

---
 board/traverse/common/Kconfig            |   6 +
 board/traverse/common/Makefile           |   1 +
 board/traverse/common/ten64-controller.h |  28 +++
 board/traverse/common/ten64_controller.c | 240 +++++++++++++++++++++++
 4 files changed, 275 insertions(+)
 create mode 100644 board/traverse/common/Kconfig
 create mode 100644 board/traverse/common/Makefile
 create mode 100644 board/traverse/common/ten64-controller.h
 create mode 100644 board/traverse/common/ten64_controller.c
board/traverse/common/Kconfig new file +6 -0
new file mode 100644
index 0000000000..d34832bd0d
@@ -0,0 +1,6 @@
+config TEN64_CONTROLLER
+	bool "Enable Ten64 board controller driver"
+	depends on TARGET_TEN64
+	help
+		Support for the board microcontroller on the Traverse
+		Ten64 family of boards.
board/traverse/common/Makefile new file +1 -0
new file mode 100644
index 0000000000..d31e3535b9
@@ -0,0 +1 @@
+obj-$(CONFIG_TEN64_CONTROLLER) += ten64_controller.o
board/traverse/common/ten64-controller.h new file +28 -0
new file mode 100644
index 0000000000..fed6af470d
@@ -0,0 +1,28 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+#ifndef TEN64_CNTRL_H
+#define TEN64_CNTRL_H
+
+/**
+ * struct t64uc_board_info - Board Information Structure
+ * @mac: Base MAC address
+ * @cpuId: Microcontroller unique serial number
+ * @fwversion_major: Microcontroller version number (Major)
+ * @fwversion_minor: Microcontroller version number (Minor)
+ * @fwversion_patch: Microcontroller version number (Patch)
+ */
+struct t64uc_board_info {
+	u8 mac[6];
+	u32 cpuId[4];
+	u8 fwversion_major;
+	u8 fwversion_minor;
+	u8 fwversion_patch;
+} __packed;
+
+enum {
+	TEN64_CNTRL_GET_BOARD_INFO,
+	TEN64_CNTRL_10G_OFF,
+	TEN64_CNTRL_10G_ON,
+	TEN64_CNTRL_SET_NEXT_BOOTSRC
+};
+
+#endif
board/traverse/common/ten64_controller.c new file +240 -0

240 lines not on this page · raw message

Signature · 1 line
2.30.1
#2 lore raw

PATCH v2 2/2 board: traverse: add initial Ten64 support

In reply to Mathew McBride

The Ten64 is a networking-oriented MiniITX board
using the NXP LS1088A SoC.

This patch provides the bare minimum to support
Ten64 boards under U-Boot for distroboot.

Some related drivers have not yet been submitted
and this basic support lacks some of the
opinionated defaults provided by our firmware
distribution.

---
 arch/arm/Kconfig                   |  16 ++
 arch/arm/dts/Makefile              |   2 +
 arch/arm/dts/fsl-ls1088a-ten64.dts | 377 +++++++++++++++++++++++++
 board/traverse/ten64/Kconfig       |  17 ++
 board/traverse/ten64/MAINTAINERS   |   8 +
 board/traverse/ten64/Makefile      |   6 +
 board/traverse/ten64/eth_ten64.c   |  47 ++++
 board/traverse/ten64/ten64.c       | 438 +++++++++++++++++++++++++++++
 configs/ten64_tfa_defconfig        | 119 ++++++++
 include/configs/ten64.h            |  55 ++++
 10 files changed, 1085 insertions(+)
 create mode 100644 arch/arm/dts/fsl-ls1088a-ten64.dts
 create mode 100644 board/traverse/ten64/Kconfig
 create mode 100644 board/traverse/ten64/MAINTAINERS
 create mode 100644 board/traverse/ten64/Makefile
 create mode 100644 board/traverse/ten64/eth_ten64.c
 create mode 100644 board/traverse/ten64/ten64.c
 create mode 100644 configs/ten64_tfa_defconfig
 create mode 100644 include/configs/ten64.h
arch/arm/Kconfig +16 -0
index ae911d6e35..52de5e838f 100644
@@ -1761,6 +1761,21 @@ config TARGET_SL28
 	help
 	  Support for Kontron SMARC-sAL28 board.
 
+config TARGET_TEN64
+	bool "Support ten64"
+	select ARCH_LS1088A
+	select ARCH_MISC_INIT
+	select ARM64
+	select ARMV8_MULTIENTRY
+	select ARCH_SUPPORT_TFABOOT
+	select BOARD_LATE_INIT
+	select SUPPORT_SPL
+	select FSL_DDR_INTERACTIVE if !SD_BOOT
+	select GPIO_EXTRA_HEADER
+	help
+	  Support for Traverse Technologies Ten64 board, based
+	  on NXP LS1088A.
+
 config TARGET_COLIBRI_PXA270
 	bool "Support colibri_pxa270"
 	select CPU_PXA
@@ -2197,6 +2212,7 @@ source "board/socionext/developerbox/Kconfig"
 source "board/st/stv0991/Kconfig"
 source "board/tcl/sl50/Kconfig"
 source "board/toradex/colibri_pxa270/Kconfig"
+source "board/traverse/ten64/Kconfig"
 source "board/variscite/dart_6ul/Kconfig"
 source "board/vscom/baltos/Kconfig"
 source "board/phytium/durian/Kconfig"
arch/arm/dts/Makefile +2 -0
index cc34da7bd8..2655707a43 100644
@@ -478,6 +478,8 @@ dtb-$(CONFIG_TARGET_SL28) += fsl-ls1028a-kontron-sl28.dtb \
 	fsl-ls1028a-kontron-sl28-var3.dtb \
 	fsl-ls1028a-kontron-sl28-var4.dtb \
 
+dtb-$(CONFIG_TARGET_TEN64) += fsl-ls1088a-ten64.dtb
+
 dtb-$(CONFIG_TARGET_DRAGONBOARD410C) += dragonboard410c.dtb
 dtb-$(CONFIG_TARGET_DRAGONBOARD820C) += dragonboard820c.dtb
 dtb-$(CONFIG_TARGET_STARQLTECHN) += starqltechn.dtb
arch/arm/dts/fsl-ls1088a-ten64.dts new file +377 -0

377 lines not on this page · raw message

board/traverse/ten64/Kconfig new file +17 -0
new file mode 100644
index 0000000000..ea8e3ea20d
@@ -0,0 +1,17 @@
+if TARGET_TEN64
+
+config SYS_BOARD
+	default "ten64"
+
+config SYS_VENDOR
+	default "traverse"
+
+config SYS_SOC
+	default "fsl-layerscape"
+
+config SYS_CONFIG_NAME
+	default "ten64"
+
+endif
+
+source "board/traverse/common/Kconfig"
board/traverse/ten64/MAINTAINERS new file +8 -0
new file mode 100644
index 0000000000..7b53e87938
@@ -0,0 +1,8 @@
+TEN64 BOARD
+M:	Mathew McBride <[email protected]>
+S:	Maintained
+F:	arch/arm/dts/fsl-ls1088a-ten64.dts
+F:	board/traverse/ten64/
+F:	board/traverse/common/
+F:	include/configs/ten64.h
+F:	configs/ten64_tfa_defconfig
board/traverse/ten64/Makefile new file +6 -0
new file mode 100644
index 0000000000..fd8d5cc87b
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: GPL-2.0+
+
+obj-y += ten64.o
+obj-y += eth_ten64.o
+
+CFLAGS_ten64.o += -DDEBUG
board/traverse/ten64/eth_ten64.c new file +47 -0

47 lines not on this page · raw message

board/traverse/ten64/ten64.c new file +438 -0

438 lines not on this page · raw message

configs/ten64_tfa_defconfig new file +119 -0

119 lines not on this page · raw message

include/configs/ten64.h new file +55 -0

55 lines not on this page · raw message

Signature · 1 line
2.30.1
#3 lore raw

Re: [PATCH v2 2/2] board: traverse: add initial Ten64 support

Quoted 11 lines · Mathew McBride

The Ten64 is a networking-oriented MiniITX board
using the NXP LS1088A SoC.

This patch provides the bare minimum to support
Ten64 boards under U-Boot for distroboot.

Some related drivers have not yet been submitted
and this basic support lacks some of the
opinionated defaults provided by our firmware
distribution.

Quoted 5 lines
---
 arch/arm/Kconfig                   |  16 ++
 arch/arm/dts/Makefile              |   2 +
 arch/arm/dts/fsl-ls1088a-ten64.dts | 377 +++++++++++++++++++++++++

What is the status of this dts with upstream Linux?

[snip]

Quoted 1 line

+CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 ramdisk_size=0x3000000 default_hugepagesz=2m hugepagesz=2m hugepages=256"

Note that ramdisk information will be passed along correctly via DT and should not generally be set in this manner.

[snip]

Quoted 1 line

+CONFIG_MTDPARTS_DEFAULT="mtdparts=spi-nand0:8m(reserved),32m(recovery),108m(ubia),108m(ubib);nor1:1m(bl2),2m(bl3),2m(mcfirmware),512k(ubootenv),256k(dpl),256k(dpc),256k(devicetree)"

This should be the same as the fixed-partition in the dts and then not needed here.

include/configs/ten64.h

Quoted 5 lines
include/configs/ten64.h new file +0 -0
new file mode 100644
index 0000000000..54e65f29f1

Please make sure there's no already migrated CONFIG symbols in this. A quick 'git log configs' should make it clear what's been migrated to Kconfig since you last checked this.

include/configs/ten64.h line 20

Quoted 2 lines
include/configs/ten64.h new file +2 -0
+#define QSPI_NOR_BOOTCOMMAND	"run distro_bootcmd"
+#define SD_BOOTCOMMAND		"run distro_bootcmd"

You should just set CONFIG_USE_BOOTCOMMAND and then CONFIG_BOOTCOMMAND will be "run distro_bootcmd". Thanks!

Signature · 1 line
Tom
#4 lore raw

Re: [PATCH v2 2/2] board: traverse: add initial Ten64 support

Hi Tom,

Quoted 9 lines · Tom Rini
Quoted 5 lines · Mathew McBride
---
 arch/arm/Kconfig                   |  16 ++
 arch/arm/dts/Makefile              |   2 +
 arch/arm/dts/fsl-ls1088a-ten64.dts | 377 +++++++++++++++++++++++++

What is the status of this dts with upstream Linux?

It's been in Linux since v5.15, though there is going to be some flux between U-Boot and Linux for a short while as some devices will be introduced into one or the other other first. e.g traverse,ten64-controller does not and will not have a Linux (kernel) counterpart but I'll try and get it added to the dt yaml's for validation.

(The upstream DTS intentionally left out some I2C devices that don't have Linux drivers or formal DT bindings yet)

Quoted 8 lines

[snip]

include/configs/ten64.h line 20

Quoted 2 lines
include/configs/ten64.h new file +2 -0
+#define QSPI_NOR_BOOTCOMMAND "run distro_bootcmd"
+#define SD_BOOTCOMMAND "run distro_bootcmd"

You should just set CONFIG_USE_BOOTCOMMAND and then CONFIG_BOOTCOMMAND will be "run distro_bootcmd". Thanks!

This actually comes about from fsl_setenv_bootcmd:
https://elixir.bootlin.com/u-boot/latest/source/arch/arm/cpu/armv8/fsl-layerscape/soc.c#L800
Which gets hooked into board_late_init
https://elixir.bootlin.com/u-boot/latest/source/arch/arm/cpu/armv8/fsl-layerscape/soc.c#L961

The main reason I understand that exists is because the secure boot (FSL trust architecture) setup differs a depending on where the board has booted from:
https://elixir.bootlin.com/u-boot/latest/source/include/configs/ls1088ardb.h#L448
(There is also a similar issue with mcinitcmd which does affect us)

Since trust architecture isn't supported on our board yet, it just collapses down to "run distro_bootcmd" regardless of where the board started from.

I guess this behaviour could be hidden behind a Kconfig so it's opt-in?

- Matt

#5 lore raw

Re: [PATCH v2 2/2] board: traverse: add initial Ten64 support

Quoted 11 lines · Mathew McBride

Hi Tom,

Quoted 8 lines · Tom Rini
Quoted 5 lines · Mathew McBride
---
 arch/arm/Kconfig                   |  16 ++
 arch/arm/dts/Makefile              |   2 +
 arch/arm/dts/fsl-ls1088a-ten64.dts | 377 +++++++++++++++++++++++++
Quoted 5 lines
Quoted 1 line

What is the status of this dts with upstream Linux?

It's been in Linux since v5.15, though there is going to be some flux between U-Boot and Linux for a short while as some devices will be introduced into one or the other other first. e.g traverse,ten64-controller does not and will not have a Linux (kernel) counterpart but I'll try and get it added to the dt yaml's for validation.

(The upstream DTS intentionally left out some I2C devices that don't have Linux drivers or formal DT bindings yet)

Bindings need to be upstreamed and reviewed, and the dts here kept in sync with the kernel, as it will be dropped in for updates. You also should at this point be able to get nodes (so long as there is a binding of course) that aren't strictly used in the kernel in the dts that's in the kernel.

Quoted 13 lines
Quoted 8 lines

[snip]

include/configs/ten64.h line 20

Quoted 2 lines
include/configs/ten64.h new file +2 -0
+#define QSPI_NOR_BOOTCOMMAND "run distro_bootcmd"
+#define SD_BOOTCOMMAND "run distro_bootcmd"

You should just set CONFIG_USE_BOOTCOMMAND and then CONFIG_BOOTCOMMAND will be "run distro_bootcmd". Thanks!

This actually comes about from fsl_setenv_bootcmd:
https://elixir.bootlin.com/u-boot/latest/source/arch/arm/cpu/armv8/fsl-layerscape/soc.c#L800
Which gets hooked into board_late_init
https://elixir.bootlin.com/u-boot/latest/source/arch/arm/cpu/armv8/fsl-layerscape/soc.c#L961

Quoted 7 lines

The main reason I understand that exists is because the secure boot (FSL trust architecture) setup differs a depending on where the board has booted from:
https://elixir.bootlin.com/u-boot/latest/source/include/configs/ls1088ardb.h#L448
(There is also a similar issue with mcinitcmd which does affect us)

Since trust architecture isn't supported on our board yet, it just collapses down to "run distro_bootcmd" regardless of where the board started from.

I guess this behaviour could be hidden behind a Kconfig so it's opt-in?

Thanks for explaining. That's...interesting. And something that might be able to be cleaned up a bit in -next now that we've added some more flexibility to how environment is constructed at build time. But, not a job for someone submitting a board that follows the best practices of the rest of the family, even if those best practices aren't always so great.

Signature · 1 line
Tom