Add SIMATIC IOT2050 board support
Subsystems (3)
v4 cover Add SIMATIC IOT2050 board support
This is the baseline support for the SIMATIC IOT2050 devices.
Changes in v4:
- rebased
- make rtd-wdt firmware a "loadable" inside U-Boot proper fit image, avoiding controversial embedding as object
- improved mmc1 removal from boot_targets
- fixed various build issues
Changes in v3:
- rebased
- addressed several checkpatch warnings
- a few #ifdef -> IS_ENABLED conversions
- comment marker for SPDK identifier in .S file
- trailing whitespaces
- factored out rti_wdt_load_fw (less #ifdef)
Changes in v2:
- rebased
- sync with upstream-accepted DT
- add boot switch
- include watchdog support
Allows to boot mainline 5.10 kernels, but not the original BSP-derived kernel we currently ship as reference. This is due to the TI sysfw ABI breakages between 2.x and 3.x. We will soon provide a transitional kernel that allows booting both firmware ABIs - as long as full upstream kernel support is work in progress.
Note that this baseline support lacks Ethernet drivers. We are working closely with TI to ensure that the to-be-upstreamed icssg-prueth driver will work both with new SR2.0 AM65x silicon as well as with SR1.0 which is used in the currently shipped IOT2050 devices.
A staging tree for complete IOT2050 support can be found at [1]. Full image integration is available via [2].
Jan
[1] https://github.com/siemens/u-boot/commits/jan/iot2050
[2] https://github.com/siemens/meta-iot2050
Jan Kiszka (5):
arm: dts: Add IOT2050 device tree files
board: siemens: Add support for SIMATIC IOT2050 devices
arm64: dts: ti: k3-am65-mcu: Add RTI watchdog entry
watchdog: rti_wdt: Add support for loading firmware
iot2050: Enable watchdog support, but do not auto-start it
arch/arm/dts/Makefile | 7 +- arch/arm/dts/k3-am65-iot2050-boot-image.dtsi | 121 ++++ .../dts/k3-am65-iot2050-common-u-boot.dtsi | 103 +++ arch/arm/dts/k3-am65-iot2050-common.dtsi | 655 ++++++++++++++++++ arch/arm/dts/k3-am65-iot2050-spl.dts | 16 + arch/arm/dts/k3-am65-mcu.dtsi | 9 + arch/arm/dts/k3-am6528-iot2050-basic.dts | 67 ++ arch/arm/dts/k3-am6548-iot2050-advanced.dts | 66 ++ arch/arm/mach-k3/Kconfig | 1 + board/siemens/iot2050/Kconfig | 32 + board/siemens/iot2050/MAINTAINERS | 8 + board/siemens/iot2050/Makefile | 10 + board/siemens/iot2050/README | 65 ++ board/siemens/iot2050/board.c | 284 ++++++++ board/siemens/iot2050/config.mk | 8 + configs/iot2050_defconfig | 138 ++++ drivers/watchdog/Kconfig | 20 + drivers/watchdog/rti_wdt.c | 88 +++ include/configs/iot2050.h | 67 ++ 19 files changed, 1764 insertions(+), 1 deletion(-) create mode 100644 arch/arm/dts/k3-am65-iot2050-boot-image.dtsi create mode 100644 arch/arm/dts/k3-am65-iot2050-common-u-boot.dtsi create mode 100644 arch/arm/dts/k3-am65-iot2050-common.dtsi create mode 100644 arch/arm/dts/k3-am65-iot2050-spl.dts create mode 100644 arch/arm/dts/k3-am6528-iot2050-basic.dts create mode 100644 arch/arm/dts/k3-am6548-iot2050-advanced.dts create mode 100644 board/siemens/iot2050/Kconfig create mode 100644 board/siemens/iot2050/MAINTAINERS create mode 100644 board/siemens/iot2050/Makefile create mode 100644 board/siemens/iot2050/README create mode 100644 board/siemens/iot2050/board.c create mode 100644 board/siemens/iot2050/config.mk create mode 100644 configs/iot2050_defconfig create mode 100644 include/configs/iot2050.h
Signature · 1 line
2.31.1
PATCH v4 2/5 board: siemens: Add support for SIMATIC IOT2050 devices
From: Jan Kiszka <[email protected]>
This adds support for the IOT2050 Basic and Advanced devices. The Basic used the dual-core AM6528 GP processor, the Advanced one the AM6548 HS quad-core version.
Both variants are booted via a Siemens-provided FSBL that runs on the R5 cores. Consequently, U-Boot support is targeting the A53 cores. U-Boot SPL, ATF and TEE have to reside in SPI flash.
Full integration into a bootable image can be found on
https://github.com/siemens/meta-iot2050
Based on original board support by Le Jin, Gao Nian and Chao Zeng.
--- arch/arm/mach-k3/Kconfig | 1 + board/siemens/iot2050/Kconfig | 32 ++++ board/siemens/iot2050/MAINTAINERS | 8 + board/siemens/iot2050/Makefile | 10 ++ board/siemens/iot2050/README | 65 +++++++ board/siemens/iot2050/board.c | 284 ++++++++++++++++++++++++++++++ board/siemens/iot2050/config.mk | 8 + configs/iot2050_defconfig | 132 ++++++++++++++ include/configs/iot2050.h | 67 +++++++ 9 files changed, 607 insertions(+) create mode 100644 board/siemens/iot2050/Kconfig create mode 100644 board/siemens/iot2050/MAINTAINERS create mode 100644 board/siemens/iot2050/Makefile create mode 100644 board/siemens/iot2050/README create mode 100644 board/siemens/iot2050/board.c create mode 100644 board/siemens/iot2050/config.mk create mode 100644 configs/iot2050_defconfig create mode 100644 include/configs/iot2050.h
arch/arm/mach-k3/Kconfig +1 -0
@@ -168,4 +168,5 @@ config K3_DM_FW source "board/ti/am65x/Kconfig" source "board/ti/am64x/Kconfig" source "board/ti/j721e/Kconfig" +source "board/siemens/iot2050/Kconfig" endif
board/siemens/iot2050/Kconfig new file +32 -0
@@ -0,0 +1,32 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright (c) Siemens AG, 2018-2021 +# +# Authors: +# Le Jin <[email protected]> +# Jan Kiszka <[email protected]> + +config TARGET_IOT2050_A53 + bool "IOT2050 running on A53" + select ARM64 + select SOC_K3_AM6 + select BOARD_LATE_INIT + select SYS_DISABLE_DCACHE_OPS + select BINMAN + +if TARGET_IOT2050_A53 + +config SYS_BOARD + default "iot2050" + +config SYS_VENDOR + default "siemens" + +config SYS_CONFIG_NAME + default "iot2050" + +config IOT2050_BOOT_SWITCH + bool "Disable eMMC boot via USER button (Advanced version only)" + default y + +endif
board/siemens/iot2050/MAINTAINERS new file +8 -0
@@ -0,0 +1,8 @@ +IOT2050 BOARD +M: Le Jin <[email protected]> +M: Jan Kiszka <[email protected]> +S: Maintained +F: board/siemens/iot2050/ +F: include/configs/iot2050.h +F: configs/iot2050_defconfig +F: arch/arm/dts/iot2050-*
board/siemens/iot2050/Makefile new file +10 -0
@@ -0,0 +1,10 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Makefile for Siemens IOT2050 board +# Copyright (c) Siemens AG, 2018-2021 +# +# Authors: +# Le Jin <[email protected]> +# + +obj-y += board.o
board/siemens/iot2050/README new file +65 -0
65 lines not on this page · raw message
board/siemens/iot2050/board.c new file +284 -0
284 lines not on this page · raw message
board/siemens/iot2050/config.mk new file +8 -0
@@ -0,0 +1,8 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright (c) Siemens AG, 2020-2021 +# +# Authors: +# Jan Kiszka <[email protected]> + +flash.bin: all
configs/iot2050_defconfig new file +132 -0
132 lines not on this page · raw message
include/configs/iot2050.h new file +67 -0
67 lines not on this page · raw message
Signature · 1 line
2.31.1
PATCH v4 5/5 iot2050: Enable watchdog support, but do not auto-start it
In reply to Jan KiszkaFrom: Jan Kiszka <[email protected]>
This allows to use the watchdog in custom scripts but does not enforce that the OS has to support it as well.
--- arch/arm/dts/k3-am65-iot2050-boot-image.dtsi | 16 ++++++++++++++++ configs/iot2050_defconfig | 6 ++++++ 2 files changed, 22 insertions(+)
arch/arm/dts/k3-am65-iot2050-boot-image.dtsi +16 -0
@@ -59,6 +59,16 @@ filename = "arch/arm/dts/k3-am6548-iot2050-advanced.dtb"; }; }; + +#ifdef CONFIG_WDT_K3_RTI_FW_FILE + k3-rti-wdt-firmware { + type = "blob"; + load = <0x82000000>; + blob { + filename = CONFIG_WDT_K3_RTI_FW_FILE; + }; + }; +#endif }; configurations {
@@ -68,12 +78,18 @@ description = "iot2050-basic"; firmware = "u-boot"; fdt = "fdt-iot2050-basic"; +#ifdef CONFIG_WDT_K3_RTI_FW_FILE + loadables = "k3-rti-wdt-firmware"; +#endif }; conf-iot2050-advanced { description = "iot2050-advanced"; firmware = "u-boot"; fdt = "fdt-iot2050-advanced"; +#ifdef CONFIG_WDT_K3_RTI_FW_FILE + loadables = "k3-rti-wdt-firmware"; +#endif }; }; };
configs/iot2050_defconfig +6 -0
@@ -51,6 +51,7 @@ CONFIG_CMD_MMC=y CONFIG_CMD_PCI=y CONFIG_CMD_REMOTEPROC=y CONFIG_CMD_USB=y +CONFIG_CMD_WDT=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_TIME=y # CONFIG_ISO_PARTITION is not set
@@ -129,4 +130,9 @@ CONFIG_USB_XHCI_DWC3=y CONFIG_USB_DWC3=y CONFIG_USB_DWC3_GENERIC=y CONFIG_USB_KEYBOARD=y +# CONFIG_WATCHDOG is not set +# CONFIG_WATCHDOG_AUTOSTART is not set +CONFIG_WDT=y +CONFIG_WDT_K3_RTI=y +CONFIG_WDT_K3_RTI_LOAD_FW=y CONFIG_OF_LIBFDT_OVERLAY=y
Signature · 1 line
2.31.1
PATCH v4 3/5 arm64: dts: ti: k3-am65-mcu: Add RTI watchdog entry
In reply to Jan KiszkaFrom: Jan Kiszka <[email protected]>
Add the DT entry for a watchdog based on RTI1. It requires additional firmware on the MCU R5F cores to handle the expiry, e.g.
https://github.com/siemens/k3-rti-wdt. As this firmware will also lock the power domain to protect it against premature shutdown, mark it shared.
Aligns us to the kernel's DT in this regard.
--- arch/arm/dts/k3-am65-mcu.dtsi | 9 +++++++++ 1 file changed, 9 insertions(+)
arch/arm/dts/k3-am65-mcu.dtsi +9 -0
@@ -308,4 +308,13 @@ ti,loczrama = <1>; }; }; + + mcu_rti1: rti@40610000 { + compatible = "ti,j7-rti-wdt"; + reg = <0x0 0x40610000 0x0 0x100>; + clocks = <&k3_clks 135 0>; + power-domains = <&k3_pds 135 TI_SCI_PD_SHARED>; + assigned-clocks = <&k3_clks 135 0>; + assigned-clock-parents = <&k3_clks 135 4>; + }; };
Signature · 1 line
2.31.1
PATCH v4 4/5 watchdog: rti_wdt: Add support for loading firmware
In reply to Jan KiszkaFrom: Jan Kiszka <[email protected]>
To avoid the need of extra boot scripting on AM65x for loading a watchdog firmware, add the required rproc init and loading logic for the first R5F core to the watchdog start handler. In case the R5F cluster is in lock-step mode, also initialize the second core. The firmware itself is embedded into U-Boot binary to ease access to it and ensure it is properly hashed in case of secure boot.
One possible firmware source is https://github.com/siemens/k3-rti-wdt.
The board is responsible for providing the firmware as additional loadable via the U-Boot fit image. The driver will pick up its location from /fit-images/k3-rti-wdt-firmware then.
--- drivers/watchdog/Kconfig | 20 +++++++++ drivers/watchdog/rti_wdt.c | 88 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 108 insertions(+)
drivers/watchdog/Kconfig +20 -0
@@ -209,6 +209,26 @@ config WDT_K3_RTI Say Y here if you want to include support for the K3 watchdog timer (RTI module) available in the K3 generation of processors. +if WDT_K3_RTI + +config WDT_K3_RTI_LOAD_FW + bool "Load watchdog firmware" + depends on REMOTEPROC + help + Automatically load the specified firmware image into the MCU R5F + core 0. On the AM65x, this firmware is supposed to handle the expiry + of the watchdog timer, typically by resetting the system. + +config WDT_K3_RTI_FW_FILE + string "Watchdog firmware image file" + default "k3-rti-wdt.fw" + depends on WDT_K3_RTI_LOAD_FW + help + Firmware image to be embedded into U-Boot and loaded on watchdog + start. + +endif + config WDT_SANDBOX bool "Enable Watchdog Timer support for Sandbox" depends on SANDBOX && WDT
drivers/watchdog/rti_wdt.c +88 -0
109 lines not on this page · raw message
Signature · 1 line
2.31.1
PATCH v4 1/5 arm: dts: Add IOT2050 device tree files
In reply to Jan KiszkaFrom: Jan Kiszka <[email protected]>
Prepares for the addition of the IOT2050 board which is based on the TI AM65x. The board comes in two variants, Basic and Advanced, so there are separate dts files. Furthermore, the SPL has its own device tree.
Based on original board support by Le Jin, Gao Nian and Chao Zeng.
--- arch/arm/dts/Makefile | 7 +- arch/arm/dts/k3-am65-iot2050-boot-image.dtsi | 105 +++ .../dts/k3-am65-iot2050-common-u-boot.dtsi | 103 +++ arch/arm/dts/k3-am65-iot2050-common.dtsi | 655 ++++++++++++++++++ arch/arm/dts/k3-am65-iot2050-spl.dts | 16 + arch/arm/dts/k3-am6528-iot2050-basic.dts | 67 ++ arch/arm/dts/k3-am6548-iot2050-advanced.dts | 66 ++ 7 files changed, 1018 insertions(+), 1 deletion(-) create mode 100644 arch/arm/dts/k3-am65-iot2050-boot-image.dtsi create mode 100644 arch/arm/dts/k3-am65-iot2050-common-u-boot.dtsi create mode 100644 arch/arm/dts/k3-am65-iot2050-common.dtsi create mode 100644 arch/arm/dts/k3-am65-iot2050-spl.dts create mode 100644 arch/arm/dts/k3-am6528-iot2050-basic.dts create mode 100644 arch/arm/dts/k3-am6548-iot2050-advanced.dts
arch/arm/dts/Makefile +6 -1
@@ -1084,7 +1084,12 @@ dtb-$(CONFIG_STM32MP15x) += \ stm32mp15xx-dhcom-picoitx.dtb \ stm32mp15xx-dhcor-avenger96.dtb -dtb-$(CONFIG_SOC_K3_AM6) += k3-am654-base-board.dtb k3-am654-r5-base-board.dtb +dtb-$(CONFIG_SOC_K3_AM6) += \ + k3-am654-base-board.dtb \ + k3-am654-r5-base-board.dtb \ + k3-am65-iot2050-spl.dtb \ + k3-am6528-iot2050-basic.dtb \ + k3-am6548-iot2050-advanced.dtb dtb-$(CONFIG_SOC_K3_J721E) += k3-j721e-common-proc-board.dtb \ k3-j721e-r5-common-proc-board.dtb \ k3-j7200-common-proc-board.dtb \
arch/arm/dts/k3-am65-iot2050-boot-image.dtsi new file +105 -0
105 lines not on this page · raw message
arch/arm/dts/k3-am65-iot2050-common-u-boot.dtsi new file +103 -0
103 lines not on this page · raw message
arch/arm/dts/k3-am65-iot2050-common.dtsi new file +655 -0
655 lines not on this page · raw message
arch/arm/dts/k3-am65-iot2050-spl.dts new file +16 -0
@@ -0,0 +1,16 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) Siemens AG, 2018-2021 + * + * Authors: + * Jan Kiszka <[email protected]> + */ + +/dts-v1/; + +#include "k3-am65-iot2050-common-u-boot.dtsi" + +/ { + compatible = "siemens,iot2050", "ti,am654"; + model = "Siemens IOT2050"; +};
arch/arm/dts/k3-am6528-iot2050-basic.dts new file +67 -0
67 lines not on this page · raw message
arch/arm/dts/k3-am6548-iot2050-advanced.dts new file +66 -0
66 lines not on this page · raw message
Signature · 1 line
2.31.1