[PATCH v2 1/5] board: sl28: enable EFI_SET_TIME support

Allow EFI to actually set the time before ExitBootServices().
Signed-off-by: Michael Walle michael@walle.cc --- changes since v1: - none
configs/kontron_sl28_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/configs/kontron_sl28_defconfig b/configs/kontron_sl28_defconfig index e15928bead..8bd7d5be4b 100644 --- a/configs/kontron_sl28_defconfig +++ b/configs/kontron_sl28_defconfig @@ -92,3 +92,4 @@ CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_DWC3=y CONFIG_OF_LIBFDT_ASSUME_MASK=0x0 CONFIG_OF_LIBFDT_OVERLAY=y +CONFIG_EFI_SET_TIME=y

Generate a FIT update image during build. The image will be called "u-boot.update" and can be used to build an EFI UpdateCapsule or during DFU mode. Although, the latter isn't supported because there is no USB OTG driver yet.
Signed-off-by: Michael Walle michael@walle.cc --- changes since v1: - new patch
.../dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi | 35 +++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-)
diff --git a/arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi b/arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi index 8538ce7984..d4b833284e 100644 --- a/arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi +++ b/arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi @@ -12,6 +12,12 @@ };
binman: binman { + multiple-images; + }; +}; + +&binman { + u_boot_rom: u-boot-rom { filename = "u-boot.rom"; pad-byte = <0xff>;
@@ -130,6 +136,31 @@ }; };
+&binman { + u-boot-update { + filename = "u-boot.update"; + + fit { + description = "FIT update image"; + + images { + u-boot-bin { + description = "U-Boot"; + type = "firmware"; + os = "u-boot"; + arch = "arm"; + compression = "none"; + load = <0>; /* unused */ + + blob { + filename = "u-boot.rom"; + }; + }; + }; + }; + }; +}; + #ifdef CONFIG_SL28_ENABLE_SER0_CONSOLE / { chosen { @@ -139,7 +170,7 @@ #endif
#ifdef CONFIG_SL28_SPL_LOADS_ATF_BL31 -&binman { +&u_boot_rom { fit { images { bl31 { @@ -188,7 +219,7 @@ #endif
#ifdef CONFIG_SL28_SPL_LOADS_OPTEE_BL32 -&binman { +&u_boot_rom { fit { images { bl32 {

Enable support for update over EFI UpdateCapsule mechanism. This board doesn't support setting EFI variables after ExitBootservices(). Therefore, we are also enabling EFI_IGNORE_OSINDICATIONS.
Signed-off-by: Michael Walle michael@walle.cc --- changes since v1: - new patch
configs/kontron_sl28_defconfig | 6 ++++++ include/configs/kontron_sl28.h | 2 ++ 2 files changed, 8 insertions(+)
diff --git a/configs/kontron_sl28_defconfig b/configs/kontron_sl28_defconfig index 8bd7d5be4b..20b4a8c40d 100644 --- a/configs/kontron_sl28_defconfig +++ b/configs/kontron_sl28_defconfig @@ -60,6 +60,8 @@ CONFIG_SCSI_AHCI=y CONFIG_SATA_CEVA=y CONFIG_FSL_CAAM=y CONFIG_SYS_FSL_DDR3=y +CONFIG_DFU_MMC=y +CONFIG_DFU_SF=y CONFIG_I2C_SET_DEFAULT_BUS_NUM=y CONFIG_I2C_DEFAULT_BUS_NUMBER=0 CONFIG_I2C_MUX=y @@ -93,3 +95,7 @@ CONFIG_USB_XHCI_DWC3=y CONFIG_OF_LIBFDT_ASSUME_MASK=0x0 CONFIG_OF_LIBFDT_OVERLAY=y CONFIG_EFI_SET_TIME=y +CONFIG_EFI_RUNTIME_UPDATE_CAPSULE=y +CONFIG_EFI_CAPSULE_ON_DISK=y +CONFIG_EFI_IGNORE_OSINDICATIONS=y +CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y diff --git a/include/configs/kontron_sl28.h b/include/configs/kontron_sl28.h index bfb4e67c8f..a02b8ce2b1 100644 --- a/include/configs/kontron_sl28.h +++ b/include/configs/kontron_sl28.h @@ -96,6 +96,8 @@ "envload=env import -d -b ${env_addr}\0" \ "install_rcw=source 20200000\0" \ "fdtfile=freescale/fsl-ls1028a-kontron-sl28.dtb\0" \ + "dfu_alt_info=sf 0:0=u-boot-bin raw 0x210000 0x1d0000;" \ + "u-boot-env raw 0x3e0000 0x20000\0" \ ENV_MEM_LAYOUT_SETTINGS \ BOOTENV

Am 13. September 2021 17:22:38 MESZ schrieb Michael Walle michael@walle.cc:
Enable support for update over EFI UpdateCapsule mechanism. This board doesn't support setting EFI variables after ExitBootservices(). Therefore, we are also enabling EFI_IGNORE_OSINDICATIONS.
Signed-off-by: Michael Walle michael@walle.cc
changes since v1:
- new patch
configs/kontron_sl28_defconfig | 6 ++++++ include/configs/kontron_sl28.h | 2 ++ 2 files changed, 8 insertions(+)
diff --git a/configs/kontron_sl28_defconfig b/configs/kontron_sl28_defconfig index 8bd7d5be4b..20b4a8c40d 100644 --- a/configs/kontron_sl28_defconfig +++ b/configs/kontron_sl28_defconfig @@ -60,6 +60,8 @@ CONFIG_SCSI_AHCI=y CONFIG_SATA_CEVA=y CONFIG_FSL_CAAM=y CONFIG_SYS_FSL_DDR3=y +CONFIG_DFU_MMC=y +CONFIG_DFU_SF=y CONFIG_I2C_SET_DEFAULT_BUS_NUM=y CONFIG_I2C_DEFAULT_BUS_NUMBER=0 CONFIG_I2C_MUX=y @@ -93,3 +95,7 @@ CONFIG_USB_XHCI_DWC3=y CONFIG_OF_LIBFDT_ASSUME_MASK=0x0 CONFIG_OF_LIBFDT_OVERLAY=y CONFIG_EFI_SET_TIME=y +CONFIG_EFI_RUNTIME_UPDATE_CAPSULE=y +CONFIG_EFI_CAPSULE_ON_DISK=y +CONFIG_EFI_IGNORE_OSINDICATIONS=y +CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
Mh this is wrong and it should have the fit support enabled. Something must have gone wrong while saving the defconfig.
please disregard this patch, I'll send a new version of it once I have access to a computer again.
thanks, -michael

From: Frieder Schrempf frieder.schrempf@kontron.de
In order to add other Kontron boards to the docs alongside the existing sl28 board, we need to reduce the levels of the sections and change the title.
Cc: Fabio Estevam festevam@gmail.com Signed-off-by: Frieder Schrempf frieder.schrempf@kontron.de Acked-by: Michael Walle michael@walle.cc --- Frieder, Fabio, I took the liberty and added this patch to this series, because the next patch depends on it. It wasn't picked up yet in the imx queue. In fact, Frieders patches should not depend on this one, although the documentation will be incorrectly formatted, so it should be fine if this patch will go through the qoriq queue.
changes since v1: - new patch
doc/board/kontron/sl28.rst | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/doc/board/kontron/sl28.rst b/doc/board/kontron/sl28.rst index e458fbc607..07431986d8 100644 --- a/doc/board/kontron/sl28.rst +++ b/doc/board/kontron/sl28.rst @@ -1,17 +1,17 @@ .. SPDX-License-Identifier: GPL-2.0+
-Summary -======= +Kontron SMARC-sAL28 +===================
The Kontron SMARC-sAL28 board is a TSN-enabled dual-core ARM A72 processor module with an on-chip 6-port TSN switch and a 3D GPU.
Quickstart -========== +----------
Compile U-Boot --------------- +^^^^^^^^^^^^^^
Configure and compile the binary::
@@ -21,7 +21,7 @@ Configure and compile the binary:: Copy u-boot.rom to a TFTP server.
Install the bootloader on the board ------------------------------------ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Please note, this bootloader doesn't support the builtin watchdog (yet), therefore you have to disable it, see below. Otherwise you'll end up in @@ -36,7 +36,7 @@ disabled the builtin watchdog you might have to manually enter failsafe mode by asserting the ``FORCE_RECOV#`` line during board reset.
Disable the builtin watchdog ----------------------------- +^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- boot into the failsafe bootloader, either by asserting the ``FORCE_RECOV#`` line or if you still have the original bootloader @@ -53,7 +53,7 @@ Disable the builtin watchdog
Useful I2C tricks -================= +-----------------
The board has a board management controller which is not supported in u-boot (yet). But you can use the i2c command to access it. @@ -68,7 +68,7 @@ u-boot (yet). But you can use the i2c command to access it.
Non-volatile Board Configuration Bits -===================================== +-------------------------------------
The board has 16 configuration bits which are stored in the CPLD and are non-volatile. These can be changed by the `sl28 nvm` command. @@ -98,21 +98,21 @@ Please note, that if the board is in failsafe mode, the bits will have the factory defaults, ie. all bits are off.
Power-On Inhibit ----------------- +^^^^^^^^^^^^^^^^
If this is set, the board doesn't automatically turn on when power is applied. Instead, the user has to either toggle the ``PWR_BTN#`` line or use any other wake-up source such as RTC alarm or Wake-on-LAN.
eMMC Boot ---------- +^^^^^^^^^
If this is set, the RCW will be fetched from the on-board eMMC at offset 1MiB. For further details, have a look at the `Reset Configuration Word Documentation`_.
Watchdog --------- +^^^^^^^^
By default, the CPLD watchdog is enabled in failsafe mode. Using bits 2 and 3, the user can change its mode or disable it altogether. @@ -127,21 +127,21 @@ Bit 2 Bit 3 Description ===== ===== ===============================
Clock Generator Select ----------------------- +^^^^^^^^^^^^^^^^^^^^^^
The board is prepared to supply different SerDes clock speeds. But for now, only setting 0 is supported, otherwise the CPU will hang because the PLL will not lock.
Clock Output Disable And Keep Devices In Reset ----------------------------------------------- +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
To safe power, the user might disable different devices and clock output of the board. It is not supported to disable the "CPU SerDes clock #2" for now, otherwise the CPU will hang because the PLL will not lock.
Automatic reset of the onboard PHYs ------------------------------------ +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
By default, there is no hardware reset of the onboard PHY. This is because for Wake-on-LAN, some registers have to retain their values. If you don't @@ -151,7 +151,7 @@ power-on reset.
Further documentation -===================== +---------------------
- `Vendor Documentation`_ - `Reset Configuration Word Documentation`_

Document the update image and how to use the EFI UpdateCapsule.
Signed-off-by: Michael Walle michael@walle.cc --- changes since v1: - new patch
doc/board/kontron/sl28.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
diff --git a/doc/board/kontron/sl28.rst b/doc/board/kontron/sl28.rst index 07431986d8..c7b18bed10 100644 --- a/doc/board/kontron/sl28.rst +++ b/doc/board/kontron/sl28.rst @@ -52,6 +52,21 @@ Disable the builtin watchdog - power-cycle the board
+Update image +------------ + +After the build finished, there will be an update image called +u-boot.update. This can either be used in the DFU mode (which isn't +supported yet) or encapsulated in an EFI UpdateCapsule. + +To build the capsule use the following command + + $ tools/mkeficapsule -f u-boot.update -i 1 UpdateUboot + +Afterward you can copy this file to your ESP into the /EFI/UpdateCapsule/ +folder. On the next EFI boot this will automatically update your +bootloader. + Useful I2C tricks -----------------
participants (1)
-
Michael Walle