stm32mp1: Support falcon mode with OP-TEE payloads
Subsystems (6)
PATCH v3 1/13 spl: Untagle spl_start_uboot() from spl_mmc.c
In reply to Alexandru GagniucThe symbol spl_start_uboot() is provided in spl_mmc.c, but it may also be provided by platform code.
Fireworks can be created with the following combination:
CONFIG_SPL_OS_BOOT is not set
CONFIG_SPL_MMC=y
ARCH provides spl_start_uboot()
A weak implementation of spl_start_uboot() exists in spl/spl.c, so leverage that one and stop defining the symbol in spl_mmc.c. We need the symbol because spl_start_uboot() is called in spl_mmc.c irrespective of the Falcon mode being activated.
--- common/spl/spl.c | 10 ++++++---- common/spl/spl_mmc.c | 4 ---- 2 files changed, 6 insertions(+), 8 deletions(-)
common/spl/spl.c +6 -4
@@ -87,15 +87,17 @@ __weak int dram_init_banksize(void)* 0 to not start u-boot * positive if u-boot should start */ -#ifdef CONFIG_SPL_OS_BOOT __weak int spl_start_uboot (void ) { -puts (SPL_TPL_PROMPT -"Please implement spl_start_uboot() for your board\n" ); -puts (SPL_TPL_PROMPT "Direct Linux boot not active!\n" ); +if (IS_ENABLED (CONFIG_SPL_OS_BOOT )){ +puts (SPL_TPL_PROMPT +"Please implement spl_start_uboot() for your board\n" ); +puts (SPL_TPL_PROMPT "Direct Linux boot not active!\n" ); + }return 1 ; } +#ifdef CONFIG_SPL_OS_BOOT /* * Weak default function for arch specific zImage check. Return zero * and fill start and end address if image is recognized.
common/spl/spl_mmc.c +0 -4
@@ -252,10 +252,6 @@ static int mmc_load_image_raw_os(struct spl_image_info *spl_image, return 0; }#else -int spl_start_uboot (void ) -{ -return 1 ; -}static int mmc_load_image_raw_os (struct spl_image_info *spl_image,struct mmc *mmc) {
Signature · 1 line
2.31.1
v3 cover stm32mp1: Support falcon mode with OP-TEE payloads
The goal of this project is to to get to linux userspace within a second from power on, and be secure! This is my last full-time day on this project, so I don't expect to do a v4.
I chose to use SPL with a FIT payload. We have to add certain logic to SPL, as well as some FDT modifications that would be normally done in u-boot. The boot flow is
SPL -> OP-TEE -> Linux
Patrick suggested more changes, but I decided against the following:
I) Use SPL_OPTEE_IMAGE in mach-stm32mp Kconfig selection
I explained in more detail in another email why this is a bad idea.
II) Don't use USER2 button for falcon mode.
This already exists as "fastboot-gpios", but I wasn't supposed to use it. So I aliased it as "falcon-gpios", but I'm again not supposed to use it because it aliases an existing GPIO. This makes absolutely no sense to me. I need a GPIO for this. This is America! I paid for the button, I intend to use the button! [*]
III) Use env_get_yesno("boot_os") to select falcon mode
I like this idea, but I feel it is part of the OS/SPL communication mechanism, which is beyond the scope of this series.
IV) Use if (serial_getc() == 'c') in spl_start_uboot()
I don't like the idea of doing serial input in SPL.
V) Move SYS_MMCSD_RAW_MODE_ARGS_* to Kconfig
The boot flow herein does not use the ARGS partition. It would destroy the security model to allow an external unsigned devicetree. I don't want to encourage others to use it, and I don't want to waste time with it. I hope the args partition just fizzles away into nothingness.
VI) What the heck is "spl export"
"spl export" is the u-boot (not SPL) command used to patch the devicetree and save it to the args partition mentioned above. This series avoids "spl export" because:
it's a poor security choice (explained above).
VII) Wait what? How does the devicetree work? Huh?
A complete kernel devicetree is obtained using two methods:
a) FDT patching done by SPL to the FIT devicetree
b) devicetree overlays from the FIT
Both (a) and (b) can be signed. In my specific use case, the bootargs are applied as a devicetree overlay. It's super effective.
[*] This is meant to be humorous
Changes since v2:
- Drop armv7_boot_nonsec() hack
- Introduce CONFIG_SPL_FALCON_BOOT_MMCSD
- Remove superfluous spl_start_uboot() symbol
Changes since v1:
- Move SYS_MMCSD_RAW_MODE_KERNEL_SECTOR to Kconfig instead of stm32mp1.h
- Create a new defconfig for STM32MP in falcon mode
- Rework board_fit_config_name_match() per Patrick's suggestions
- Use "u-boot,falcon-gpios" instead of "st,fastboot-gpios"
- Only update shadow registers in SPL for BSEC .probe()
Alexandru Gagniuc (13):
spl: Untagle spl_start_uboot() from spl_mmc.c
spl: Move SYS_MMCSD_RAW_MODE_KERNEL_SECTOR to Kconfig
stm32mp1: Add support for baudrates higher than 115200
stm32mp1: Add support for falcon mode boot from SD card
board: stm32mp1: Implement board_fit_config_name_match() for SPL
fdt_support: Implement fdt_ethernet_set_macaddr()
arm: stm32mp: bsec: Update OTP shadow registers in SPL
arm: stm32mp: Factor out reading MAC address from OTP
stm32mp1: spl: Configure MAC address when booting OP-TEE
lib: Makefile: Make optee library available in SPL
ARM: dts: stm32mp: Add OP-TEE "/firmware" node to SPL dtb
stm32mp1: spl: Copy optee nodes to target FDT for OP-TEE payloads
ARM: dts: stm32mp: dts: Don't remove OPTEE nodes for DK2 boards
README | 4 - arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi | 6 +- arch/arm/mach-stm32mp/bsec.c | 4 +- arch/arm/mach-stm32mp/cpu.c | 59 ++++-- .../arm/mach-stm32mp/include/mach/sys_proto.h | 3 + arch/arm/mach-stm32mp/spl.c | 3 + board/st/stm32mp1/spl.c | 43 ++++ common/fdt_support.c | 30 +++ common/spl/Kconfig | 16 ++ common/spl/spl.c | 10 +- common/spl/spl_mmc.c | 6 +- configs/am335x_boneblack_vboot_defconfig | 2 + configs/am335x_evm_defconfig | 2 + configs/am335x_igep003x_defconfig | 2 + configs/am335x_shc_defconfig | 2 + configs/am335x_shc_ict_defconfig | 2 + configs/am335x_shc_netboot_defconfig | 2 + configs/am335x_shc_sdboot_defconfig | 2 + configs/am335x_sl50_defconfig | 2 + configs/am3517_evm_defconfig | 2 + configs/am43xx_evm_defconfig | 2 + configs/am43xx_evm_rtconly_defconfig | 2 + configs/am43xx_evm_usbhost_boot_defconfig | 2 + configs/am57xx_evm_defconfig | 2 + configs/devkit8000_defconfig | 2 + configs/display5_defconfig | 2 + configs/display5_factory_defconfig | 2 + configs/dra7xx_evm_defconfig | 2 + configs/gwventana_emmc_defconfig | 2 + configs/gwventana_gw5904_defconfig | 2 + configs/gwventana_nand_defconfig | 2 + configs/igep00x0_defconfig | 2 + configs/imx6dl_mamoj_defconfig | 2 + configs/imx6q_logic_defconfig | 2 + configs/omap35_logic_defconfig | 2 + configs/omap35_logic_somlv_defconfig | 2 + configs/omap3_logic_defconfig | 2 + configs/omap3_logic_somlv_defconfig | 2 + configs/omap4_panda_defconfig | 2 + configs/omap5_uevm_defconfig | 2 + configs/stm32mp15_falcon_defconfig | 183 ++++++++++++++++++ include/configs/brppt1.h | 1 - include/configs/devkit8000.h | 2 - include/configs/display5.h | 1 - include/configs/embestmx6boards.h | 1 - include/configs/gw_ventana.h | 1 - include/configs/imx6-engicam.h | 1 - include/configs/imx6_logic.h | 1 - include/configs/imx6dl-mamoj.h | 1 - include/configs/ls1043ardb.h | 1 - include/configs/mccmon6.h | 1 - include/configs/mx6sabreauto.h | 1 - include/configs/mx6sabresd.h | 1 - include/configs/pico-imx6.h | 1 - include/configs/pico-imx6ul.h | 1 - include/configs/pico-imx7d.h | 1 - include/configs/sama5d3_xplained.h | 1 - include/configs/stm32mp1.h | 4 + include/configs/tam3517-common.h | 1 - include/configs/ti_armv7_common.h | 1 - include/configs/vyasa-rk3288.h | 1 - include/configs/xea.h | 1 - include/configs/xilinx_zynqmp.h | 1 - include/configs/zynq-common.h | 1 - include/fdt_support.h | 17 ++ lib/Makefile | 2 +- scripts/config_whitelist.txt | 1 - 67 files changed, 415 insertions(+), 57 deletions(-) create mode 100644 configs/stm32mp15_falcon_defconfig
Signature · 1 line
2.31.1
PATCH v3 5/13 board: stm32mp1: Implement board_fit_config_name_match() for SPL
This function is needed when loading a FIT image from SPL. It selects the correct configuration node for the current board. Implement it.
--- board/st/stm32mp1/spl.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
board/st/stm32mp1/spl.c +14 -0
@@ -5,6 +5,7 @@#include <config.h> #include <common.h> +#include <dm/device.h> #include <init.h> #include <asm/io.h> #include <asm/arch/sys_proto.h>
@@ -82,3 +83,16 @@ void board_debug_uart_init(void) #endif }#endif + +int board_fit_config_name_match (const char *name) +{ +const void *compatible; + + compatible =fdt_getprop (gd->fdt_blob,0 ,"compatible" ,NULL ); + +/* only STM boards are supported (currently) */ +if (strncmp (compatible,"st," ,3 ) !=0 ) +return 1 ; + +return !strstr (name, compatible +3 ); +}
Signature · 1 line
2.31.1
PATCH v3 4/13 stm32mp1: Add support for falcon mode boot from SD card
In reply to Alexandru GagniucFalcon mode requires a board-specific mechanism to select between fast and normal boot. This is done via spl_start_uboot()
Use the USER2 button as the selection mechanism. This is connected to GPIO PA13. This GPIO is already accessible via the "st,fastboot-gpios" devicetree node, but is is also aliased as "u-boot,falcon-gpios". This is the only button on DK2 which accessible simultaneously to the RESET button. USER2 is too close, and I can't fit my fingers to press both.
The fact that USER2 is also used for android fastboot is of no consequence. One can let go of USER2 after SPL but before being sampled by u-boot. If that is missed, it's okay, u-boot tries to initialize the ethernet, which can be stopped with a Ctr-C. This conveniently opens up a u-boot shell.
Offsets for raw MMC loading are defined. These point to the partition after "ssbl". Offsets for SPI are not defined, and thus SPL_LOAD_SPI must be disabled to avoid a build failure. The only way to accommodate this is to add a new defconfig, adventurously named stm32mp1_falcon.
The baudrate is set to 2 Mbaud, as the point of this config is to boot fast. The default devicetree is set to -dk2. This is because EV1 does not have a crypto-enabled CPU, and thus enabling ECDSA support would have made far less sense. That and all the goodies with FIT in SPL are enabled to give this config some continuous integration TLC.
--- arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi | 2 + board/st/stm32mp1/spl.c | 29 ++++ configs/stm32mp15_falcon_defconfig | 183 +++++++++++++++++++++++ 3 files changed, 214 insertions(+) create mode 100644 configs/stm32mp15_falcon_defconfig
arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi +2 -0
@@ -16,6 +16,8 @@ u-boot,boot-led = "heartbeat"; u-boot,error-led = "error"; u-boot,mmc-env-partition = "fip"; + /* This is the same as fastboot-gpios. This is on purpose */ + u-boot,falcon-gpios = <&gpioa 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; st,adc_usb_pd = <&adc1 18>, <&adc1 19>; st,fastboot-gpios = <&gpioa 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; st,stm32prog-gpios = <&gpioa 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
board/st/stm32mp1/spl.c +29 -0
@@ -8,6 +8,7 @@#include <init.h> #include <asm/io.h> #include <asm/arch/sys_proto.h> +#include <asm/gpio.h> #include <linux/bitops.h> #include <linux/delay.h> #include "../common/stpmic1.h"
@@ -29,6 +30,34 @@ int board_early_init_f(void)return 0 ; } +#if IS_ENABLED (CONFIG_SPL_OS_BOOT ) +int spl_start_uboot (void ) +{ +ofnode node; +struct gpio_desc gpio; +int boot_uboot =1 ; + + node =ofnode_path ("/config" ); +if (!ofnode_valid (node)) { +pr_warn ("%s: no /config node?\n" , __func__); +return 0 ; + } + +if (gpio_request_by_name_nodev (node,"u-boot,falcon-gpios" ,0 , &gpio, +GPIOD_IS_IN )) { +pr_warn ("%s: could not find a /config/u-boot,falcon-gpios\n" , + __func__); +return 1 ; + } + + boot_uboot =dm_gpio_get_value (&gpio); +dm_gpio_free (NULL , &gpio); + +return boot_uboot; +} + +#endif /* CONFIG_SPL_OS_BOOT */ +#ifdef CONFIG_DEBUG_UART_BOARD_INIT void board_debug_uart_init (void ) {
configs/stm32mp15_falcon_defconfig new file +183 -0
183 lines not on this page · raw message
Signature · 1 line
2.31.1
PATCH v3 3/13 stm32mp1: Add support for baudrates higher than 115200
In reply to Alexandru GagniucThe UART can reliably go up to 2000000 baud when connected to the on-board st-link. Unfortunately u-boot will fall back to 115200 unless higher rates are declared via CONFIG_SYS_BAUDRATE_TABLE.
--- include/configs/stm32mp1.h | 4 ++++ 1 file changed, 4 insertions(+)
include/configs/stm32mp1.h +4 -0
@@ -16,6 +16,10 @@#define CONFIG_ARMV7_SECURE_MAX_SIZE STM32_SYSRAM_SIZE#endif +#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, \ + 230400, 460800, 921600, \ + 1000000, 2000000 } +/* * Configuration of the external SRAM memory used by U-Boot */
Signature · 1 line
2.31.1
PATCH v3 6/13 fdt_support: Implement fdt_ethernet_set_macaddr()
In reply to Alexandru GagniucOftentimes we have MAC address information stored in a ROM or OTP. The way to add that to the FDT would be through the u-boot environment, and then fdt_fixup_ethernet(). This is not very useful in SPL.
It would be more helpful to be able to "set interface x to MAC y". This is where fdt_ethernet_set_macaddr() comes in. It is similar in function to fdt_fixup_ethernet(), but only updates one interface, without using the u-boot env, and without string processing.
--- common/fdt_support.c | 30 ++++++++++++++++++++++++++++++ include/fdt_support.h | 17 +++++++++++++++++ 2 files changed, 47 insertions(+)
common/fdt_support.c +30 -0
@@ -610,6 +610,36 @@ void fdt_fixup_ethernet(void *fdt) } } +int fdt_ethernet_set_macaddr (void *fdt,int ethnum,const uint8_t *mac_addr) +{ +const char *path, *name; +int prop, aliases_node; +char eth_name[16 ] ="ethernet" ; + + aliases_node =fdt_path_offset (fdt,"/aliases" ); +if (aliases_node <0 ) +return aliases_node; + +if (ethnum >=0 ) +sprintf (eth_name,"ethernet%d" , ethnum); + +fdt_for_each_property_offset (prop, fdt, aliases_node) { + path =fdt_getprop_by_offset (fdt, prop, &name,NULL ); +if (!strcmp (name, eth_name)) +break ; + + path =NULL ; + } + +if (!path) +return -FDT_ERR_NOTFOUND ; + +do_fixup_by_path (fdt, path,"mac-address" , mac_addr,6 ,0 ); +do_fixup_by_path (fdt, path,"local-mac-address" , mac_addr,6 ,1 ); + +return 0 ; +} +int fdt_record_loadable (void *blob,u32 index,const char *name,uintptr_t load_addr,u32 size,uintptr_t entry_point,const char *type,const char *os,const char *arch)
include/fdt_support.h +17 -0
@@ -119,6 +119,23 @@ static inline int fdt_fixup_memory_banks(void *blob, u64 start[], u64 size[],#endif void fdt_fixup_ethernet (void *fdt); + +/** +* Set the "mac-address" and "local-mac-address" of ethernet node +* The ethernet node is located from the "/aliases" section of the fdt. When +* 'ethnum' is positive, then the name is matched exactly, e.g "ethernet0". +* When ethnum is negative, the first ethernet alias is updated. +* Unlike fdt_fixup_ethernet(), this function only updates one ethernet node, +* and soes not use the "ethaddr" from the u-boot environment. This is useful, +* for example, in SPL, when the environment is not initialized or available. +* +* @param fdt FDT blob to update +* @param ethnum Ethernet device index, or negative for any ethernet +* @param mac_addr Pointer to 6-byte array containing the MAC address +* +* @return 0 if ok, or -FDT_ERR_... on error +*/ +int fdt_ethernet_set_macaddr (void *fdt,int ethnum,const uint8_t *mac_addr);int fdt_find_and_setprop (void *fdt,const char *node,const char *prop,const void *val,int len,int create);void fdt_fixup_qe_firmware (void *fdt);
Signature · 1 line
2.31.1
PATCH v3 7/13 arm: stm32mp: bsec: Update OTP shadow registers in SPL
In reply to Alexandru GagniucFor TFABOOT and SPL_BUILD, stm32mp_bsec_probe() skipped updating the OTP shadow registers. The idea is that we can't access BSEC from the normal world. This is true with TFABOOT. However, in SPL, we are in the secure world, so skipping probe is incorrect. In fact, SPL is not even built when TFABOOT is selected.
Thus, do not skip this step for SPL_BUILD. Note that because SPL is now doing this step, we no longer need to do it in u-boot. The new logic is "let the FSBL do it", which is simpler.
--- arch/arm/mach-stm32mp/bsec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-stm32mp/bsec.c +2 -2
@@ -503,10 +503,10 @@ static int stm32mp_bsec_probe(struct udevice *dev)/* * update unlocked shadow for OTP cleared by the rom code -* only executed in U-Boot proper when TF-A is not used +* Executed only by FSBL (SPL or TF-A) */ -if (!IS_ENABLED (CONFIG_TFABOOT ) && !IS_ENABLED (CONFIG_SPL_BUILD )) { +if (IS_ENABLED (CONFIG_SPL_BUILD )) { plat =dev_get_plat (dev);for (otp =57 ; otp <=BSEC_OTP_MAX_VALUE ; otp++)
Signature · 1 line
2.31.1
PATCH v3 8/13 arm: stm32mp: Factor out reading MAC address from OTP
In reply to Alexandru GagniucMove the reading the OTP into a separate function. This is required for a subsequent change which sets the MAC in SPL.
--- arch/arm/mach-stm32mp/cpu.c | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-)
arch/arm/mach-stm32mp/cpu.c +23 -14
@@ -593,6 +593,28 @@ static void setup_boot_mode(void)clrsetbits_le32 (TAMP_BOOT_CONTEXT ,TAMP_BOOT_FORCED_MASK ,BOOT_NORMAL ); } +static int stm32_read_otp_mac (uint8_t enetaddr[ARP_HLEN ]) +{ +struct udevice *dev; +int ret, i; +u32 otp[2 ]; + + ret =uclass_get_device_by_driver (UCLASS_MISC , +DM_DRIVER_GET (stm32mp_bsec), + &dev); +if (ret) +return ret; + + ret =misc_read (dev,STM32_BSEC_SHADOW (BSEC_OTP_MAC ), otp,sizeof (otp)); +if (ret <0 ) +return ret; + +for (i =0 ; i <ARP_HLEN ; i++) + enetaddr[i] = ((uint8_t *)&otp)[i]; + +return 0 ; +} +/* * If there is no MAC address in the environment, then it will be initialized * (silently) from the value in the OTP.
@@ -601,29 +623,16 @@ __weak int setup_mac_address(void) {#if defined(CONFIG_NET )int ret; -int i; -u32 otp[2 ];uchar enetaddr[6 ]; -struct udevice *dev;/* MAC already in environment */ if (eth_env_get_enetaddr ("ethaddr" , enetaddr))return 0 ; - ret =uclass_get_device_by_driver (UCLASS_MISC , -DM_DRIVER_GET (stm32mp_bsec), - &dev); -if (ret) -return ret; - - ret =misc_read (dev,STM32_BSEC_SHADOW (BSEC_OTP_MAC ), - otp,sizeof (otp)); + ret =stm32_read_otp_mac (enetaddr);if (ret <0 )return ret; -for (i =0 ; i <6 ; i++) - enetaddr[i] = ((uint8_t *)&otp)[i]; -if (!is_valid_ethaddr (enetaddr)) {log_err ("invalid MAC address in OTP %pM\n" , enetaddr);return -EINVAL ;
Signature · 1 line
2.31.1
PATCH v3 9/13 stm32mp1: spl: Configure MAC address when booting OP-TEE
In reply to Alexandru GagniucWhen OP-TEE is booted as the SPL payload, the stage after OP-TEE is not guaranteed to be u-boot. Thus the FDT patching in u-boot is not guaranteed to occur. Add this step to SPL.
The patching by stm32_fdt_setup_mac_addr() is done in SPL, and patches the target FDT directly. This differs is different from setup_mac_address(), which sets the "ethaddr" env variable, and does not work in SPL.
An alternative way of setting the MAC is to patch the kernel's devicetree to use the "nvmem-cells" property. This would backend on the linux BSEC driver, which relies on an SMCC call. That call is implemented only by TF-A, not by SPL. Thus linux will not be able to read the MAC from OTP, and this alternative method will fail.
Changing the linux driver is not feasible is our goal is to support the current linux LTS release (v5.14). Implementing the SMCC call would require SPL finagling, and possibly carry security side-effects.
Thus, adding "mac-address" nodes to the kernel devicetree is the most economical method in terms of lines of code and complexity.
--- arch/arm/mach-stm32mp/cpu.c | 22 +++++++++++++++++++ .../arm/mach-stm32mp/include/mach/sys_proto.h | 3 +++ arch/arm/mach-stm32mp/spl.c | 1 + 3 files changed, 26 insertions(+)
arch/arm/mach-stm32mp/cpu.c +22 -0
@@ -10,6 +10,7 @@#include <cpu_func.h> #include <debug_uart.h> #include <env.h> +#include <fdt_support.h> #include <init.h> #include <log.h> #include <lmb.h>
@@ -646,6 +647,27 @@ __weak int setup_mac_address(void)return 0 ; } +int stm32_fdt_setup_mac_addr (void *fdt) +{ +int ret; +uchar enetaddr[ARP_HLEN ]; + + ret =stm32_read_otp_mac (enetaddr); +if (ret <0 ) +return ret; + +if (!is_valid_ethaddr (enetaddr)) { +printf ("invalid MAC address in OTP\n" ); +return -EINVAL ; + } + + ret =fdt_ethernet_set_macaddr (fdt,0 , enetaddr); +if (ret) +debug ("Failed to set mac address from OTP: %d\n" , ret); + +return ret; +} +static int setup_serial_number (void ) {char serial_string[25 ];
arch/arm/mach-stm32mp/include/mach/sys_proto.h +3 -0
@@ -47,7 +47,10 @@ void get_soc_name(char name[SOC_NAME_SIZE]);/* return boot mode */ u32 get_bootmode (void ); +/* Set 'ethaddr' env variable with MAC from OTP (useful for u-boot proper) */ int setup_mac_address (void ); +/* Patch the first 'ethernet' node of FDT with MAC from OTP (useful for SPL) */ +int stm32_fdt_setup_mac_addr (void *fdt);/* board power management : configure vddcore according OPP */ void board_vddcore_init (u32 voltage_mv);
arch/arm/mach-stm32mp/spl.c +1 -0
@@ -181,6 +181,7 @@ void stm32_init_tzc_for_optee(void)void spl_board_prepare_for_optee (void *fdt) { +stm32_fdt_setup_mac_addr (fdt);stm32_init_tzc_for_optee (); }
Signature · 1 line
2.31.1
PATCH v3 2/13 spl: Move SYS_MMCSD_RAW_MODE_KERNEL_SECTOR to Kconfig
In reply to Alexandru GagniucAlthough Falcon mode is very useful in improving boot speed, its implementation is quite antiquated. A question that Falcon mode asks is "Where do I look for the kernel". With MMC boot media, the correct answer is CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR.
There are a few things to be said about the wisdom of using a raw sector as opposed to more elegant schemes. However, changing how falcon mode works is beyond the scope of this change.
The predicate to enable mmc_load_image_raw_os() is changed from SPL_OS_BOOT to SPL_FALCON_BOOT_MMCSD. It is possible for a system to support Falcon mode from NOR but not MMC. In that case, it doesn't make sense to have mmc_load_image_raw_os().
--- README | 4 ---- common/spl/Kconfig | 16 ++++++++++++++++ common/spl/spl_mmc.c | 2 +- configs/am335x_boneblack_vboot_defconfig | 2 ++ configs/am335x_evm_defconfig | 2 ++ configs/am335x_igep003x_defconfig | 2 ++ configs/am335x_shc_defconfig | 2 ++ configs/am335x_shc_ict_defconfig | 2 ++ configs/am335x_shc_netboot_defconfig | 2 ++ configs/am335x_shc_sdboot_defconfig | 2 ++ configs/am335x_sl50_defconfig | 2 ++ configs/am3517_evm_defconfig | 2 ++ configs/am43xx_evm_defconfig | 2 ++ configs/am43xx_evm_rtconly_defconfig | 2 ++ configs/am43xx_evm_usbhost_boot_defconfig | 2 ++ configs/am57xx_evm_defconfig | 2 ++ configs/devkit8000_defconfig | 2 ++ configs/display5_defconfig | 2 ++ configs/display5_factory_defconfig | 2 ++ configs/dra7xx_evm_defconfig | 2 ++ configs/gwventana_emmc_defconfig | 2 ++ configs/gwventana_gw5904_defconfig | 2 ++ configs/gwventana_nand_defconfig | 2 ++ configs/igep00x0_defconfig | 2 ++ configs/imx6dl_mamoj_defconfig | 2 ++ configs/imx6q_logic_defconfig | 2 ++ configs/omap35_logic_defconfig | 2 ++ configs/omap35_logic_somlv_defconfig | 2 ++ configs/omap3_logic_defconfig | 2 ++ configs/omap3_logic_somlv_defconfig | 2 ++ configs/omap4_panda_defconfig | 2 ++ configs/omap5_uevm_defconfig | 2 ++ include/configs/brppt1.h | 1 - include/configs/devkit8000.h | 2 -- include/configs/display5.h | 1 - include/configs/embestmx6boards.h | 1 - include/configs/gw_ventana.h | 1 - include/configs/imx6-engicam.h | 1 - include/configs/imx6_logic.h | 1 - include/configs/imx6dl-mamoj.h | 1 - include/configs/ls1043ardb.h | 1 - include/configs/mccmon6.h | 1 - include/configs/mx6sabreauto.h | 1 - include/configs/mx6sabresd.h | 1 - include/configs/pico-imx6.h | 1 - include/configs/pico-imx6ul.h | 1 - include/configs/pico-imx7d.h | 1 - include/configs/sama5d3_xplained.h | 1 - include/configs/tam3517-common.h | 1 - include/configs/ti_armv7_common.h | 1 - include/configs/vyasa-rk3288.h | 1 - include/configs/xea.h | 1 - include/configs/xilinx_zynqmp.h | 1 - include/configs/zynq-common.h | 1 - scripts/config_whitelist.txt | 1 - 55 files changed, 75 insertions(+), 29 deletions(-)
README +0 -4
@@ -2020,10 +2020,6 @@ The following options need to be configured: Partition on the MMC to load U-Boot from when the MMC is being used in raw mode - CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR - Sector to load kernel uImage from when MMC is being - used in raw mode (for Falcon mode) - CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR, CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS Sector and number of sectors to load kernel argument
common/spl/Kconfig +16 -0
@@ -918,6 +918,22 @@ config SYS_OS_BASE endif # SPL_OS_BOOT +config SPL_FALCON_BOOT_MMCSD + bool "Enable Falcon boot from MMC or SD media" + depends on SPL_OS_BOOT && SPL_MMC + help + Select this if the Falcon mode OS image mode is on MMC or SD media. + +config SYS_MMCSD_RAW_MODE_KERNEL_SECTOR + hex "Falcon mode: Sector to load kernel uImage from MMC" + depends on SPL_FALCON_BOOT_MMCSD + help + When Falcon mode is used with an MMC or SD media, SPL needs to know + where to look for the kernel uImage. The image is expected to begin + at the raw MMC specified in this config. + Note that the Falcon mode image can also be a FIT, if FIT support is + enabled. + config SPL_PAYLOAD string "SPL payload" default "tpl/u-boot-with-tpl.bin" if TPL
common/spl/spl_mmc.c +1 -1
@@ -218,7 +218,7 @@ static int mmc_load_image_raw_partition(struct spl_image_info *spl_image, }#endif -#ifdef CONFIG_SPL_OS_BOOT +#ifdef CONFIG_SPL_FALCON_BOOT_MMCSD static int mmc_load_image_raw_os (struct spl_image_info *spl_image,struct mmc *mmc) {
configs/am335x_boneblack_vboot_defconfig +2 -0
@@ -24,6 +24,8 @@ CONFIG_SPL_MUSB_NEW=y CONFIG_SPL_NET=y CONFIG_SPL_NET_VCI_STRING="AM33xx U-Boot SPL" CONFIG_SPL_OS_BOOT=y +CONFIG_SPL_FALCON_BOOT_MMCSD=y +CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR=0x1700 CONFIG_SPL_USB_GADGET=y CONFIG_SPL_USB_ETHER=y CONFIG_CMD_SPL=y
configs/am335x_evm_defconfig +2 -0
@@ -24,6 +24,8 @@ CONFIG_SPL_NAND_BASE=y CONFIG_SPL_NET=y CONFIG_SPL_NET_VCI_STRING="AM335x U-Boot SPL" CONFIG_SPL_OS_BOOT=y +CONFIG_SPL_FALCON_BOOT_MMCSD=y +CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR=0x1700 CONFIG_SPL_USB_GADGET=y CONFIG_SPL_USB_ETHER=y CONFIG_CMD_SPL=y
configs/am335x_igep003x_defconfig +2 -0
@@ -37,6 +37,8 @@ CONFIG_SPL_UBI_LOAD_MONITOR_ID=0 CONFIG_SPL_UBI_LOAD_KERNEL_ID=3 CONFIG_SPL_UBI_LOAD_ARGS_ID=4 CONFIG_SPL_OS_BOOT=y +CONFIG_SPL_FALCON_BOOT_MMCSD=y +CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR=0x1700 CONFIG_SPL_POWER=y CONFIG_SPL_WATCHDOG=y CONFIG_SPL_YMODEM_SUPPORT=y
configs/am335x_shc_defconfig +2 -0
@@ -30,6 +30,8 @@ CONFIG_SPL_FS_EXT4=y CONFIG_SPL_I2C=y # CONFIG_SPL_NAND_SUPPORT is not set CONFIG_SPL_OS_BOOT=y +CONFIG_SPL_FALCON_BOOT_MMCSD=y +CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR=0x1700 CONFIG_SPL_POWER=y CONFIG_SPL_WATCHDOG=y CONFIG_SPL_YMODEM_SUPPORT=y
configs/am335x_shc_ict_defconfig +2 -0
@@ -31,6 +31,8 @@ CONFIG_SPL_FS_EXT4=y CONFIG_SPL_I2C=y # CONFIG_SPL_NAND_SUPPORT is not set CONFIG_SPL_OS_BOOT=y +CONFIG_SPL_FALCON_BOOT_MMCSD=y +CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR=0x1700 CONFIG_SPL_POWER=y CONFIG_SPL_WATCHDOG=y CONFIG_SPL_YMODEM_SUPPORT=y
configs/am335x_shc_netboot_defconfig +2 -0
@@ -32,6 +32,8 @@ CONFIG_SPL_FS_EXT4=y CONFIG_SPL_I2C=y # CONFIG_SPL_NAND_SUPPORT is not set CONFIG_SPL_OS_BOOT=y +CONFIG_SPL_FALCON_BOOT_MMCSD=y +CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR=0x1700 CONFIG_SPL_POWER=y CONFIG_SPL_WATCHDOG=y CONFIG_SPL_YMODEM_SUPPORT=y
configs/am335x_shc_sdboot_defconfig +2 -0
@@ -31,6 +31,8 @@ CONFIG_SPL_FS_EXT4=y CONFIG_SPL_I2C=y # CONFIG_SPL_NAND_SUPPORT is not set CONFIG_SPL_OS_BOOT=y +CONFIG_SPL_FALCON_BOOT_MMCSD=y +CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR=0x1700 CONFIG_SPL_POWER=y CONFIG_SPL_WATCHDOG=y CONFIG_SPL_YMODEM_SUPPORT=y
configs/am335x_sl50_defconfig +2 -0
@@ -32,6 +32,8 @@ CONFIG_SPL_NAND_BASE=y CONFIG_SPL_NET=y CONFIG_SPL_NET_VCI_STRING="AM335x U-Boot SPL" CONFIG_SPL_OS_BOOT=y +CONFIG_SPL_FALCON_BOOT_MMCSD=y +CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR=0x1700 CONFIG_SPL_POWER=y CONFIG_SPL_WATCHDOG=y CONFIG_SPL_YMODEM_SUPPORT=y
configs/am3517_evm_defconfig +2 -0
@@ -27,6 +27,8 @@ CONFIG_SPL_NAND_ECC=y CONFIG_SPL_NAND_SIMPLE=y CONFIG_SPL_NAND_BASE=y CONFIG_SPL_OS_BOOT=y +CONFIG_SPL_FALCON_BOOT_MMCSD=y +CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR=0x1700 # CONFIG_SPL_POWER is not set CONFIG_SYS_PROMPT="AM3517_EVM # " # CONFIG_CMD_IMI is not set
configs/am43xx_evm_defconfig +2 -0
@@ -24,6 +24,8 @@ CONFIG_SPL_NAND_BASE=y CONFIG_SPL_NET=y CONFIG_SPL_NET_VCI_STRING="AM43xx U-Boot SPL" CONFIG_SPL_OS_BOOT=y +CONFIG_SPL_FALCON_BOOT_MMCSD=y +CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR=0x1700 CONFIG_SPL_USB_HOST=y CONFIG_SPL_USB_GADGET=y CONFIG_SPL_USB_ETHER=y
configs/am43xx_evm_rtconly_defconfig +2 -0
@@ -21,6 +21,8 @@ CONFIG_SPL_NAND_DRIVERS=y CONFIG_SPL_NAND_ECC=y CONFIG_SPL_NAND_BASE=y CONFIG_SPL_OS_BOOT=y +CONFIG_SPL_FALCON_BOOT_MMCSD=y +CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR=0x1700 CONFIG_CMD_SPL=y CONFIG_CMD_SPL_NAND_OFS=0x00100000 CONFIG_CMD_SPL_WRITE_SIZE=0x40000
configs/am43xx_evm_usbhost_boot_defconfig +2 -0
@@ -20,6 +20,8 @@ CONFIG_SPL_NAND_DRIVERS=y CONFIG_SPL_NAND_ECC=y CONFIG_SPL_NAND_BASE=y CONFIG_SPL_OS_BOOT=y +CONFIG_SPL_FALCON_BOOT_MMCSD=y +CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR=0x1700 CONFIG_SPL_USB_HOST=y CONFIG_SPL_USB_STORAGE=y CONFIG_SPL_USB_GADGET=y
configs/am57xx_evm_defconfig +2 -0
@@ -33,6 +33,8 @@ CONFIG_SPL_DMA=y # CONFIG_SPL_NAND_SUPPORT is not set CONFIG_SPL_DM_SPI_FLASH=y CONFIG_SPL_OS_BOOT=y +CONFIG_SPL_FALCON_BOOT_MMCSD=y +CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR=0x1700 CONFIG_SPL_SPI_LOAD=y CONFIG_SYS_SPI_U_BOOT_OFFS=0x40000 CONFIG_SPL_YMODEM_SUPPORT=y
configs/devkit8000_defconfig +2 -0
@@ -14,6 +14,8 @@ CONFIG_SPL_NAND_ECC=y CONFIG_SPL_NAND_SIMPLE=y CONFIG_SPL_NAND_BASE=y CONFIG_SPL_OS_BOOT=y +CONFIG_SPL_FALCON_BOOT_MMCSD=y +CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR=0x500 # CONFIG_CMD_IMI is not set CONFIG_CMD_SPL=y CONFIG_CMD_SPL_NAND_OFS=0x680000
configs/display5_defconfig +2 -0
@@ -41,6 +41,8 @@ CONFIG_SPL_ENV_SUPPORT=y CONFIG_SPL_SAVEENV=y CONFIG_SPL_I2C=y CONFIG_SPL_OS_BOOT=y +CONFIG_SPL_FALCON_BOOT_MMCSD=y +CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR=0x100 CONFIG_SPL_SPI_LOAD=y CONFIG_SYS_SPI_U_BOOT_OFFS=0x20000 CONFIG_SPL_WATCHDOG=y
configs/display5_factory_defconfig +2 -0
@@ -38,6 +38,8 @@ CONFIG_MISC_INIT_R=y CONFIG_SPL_DMA=y CONFIG_SPL_I2C=y CONFIG_SPL_OS_BOOT=y +CONFIG_SPL_FALCON_BOOT_MMCSD=y +CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR=0x100 CONFIG_SPL_SPI_LOAD=y CONFIG_SYS_SPI_U_BOOT_OFFS=0x20000 CONFIG_SPL_USB_HOST=y
configs/dra7xx_evm_defconfig +2 -0
@@ -34,6 +34,8 @@ CONFIG_SPL_NAND_ECC=y CONFIG_SPL_NAND_BASE=y CONFIG_SPL_DM_SPI_FLASH=y CONFIG_SPL_OS_BOOT=y +CONFIG_SPL_FALCON_BOOT_MMCSD=y +CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR=0x1700 CONFIG_SPL_RAM_SUPPORT=y CONFIG_SPL_SPI_LOAD=y CONFIG_SYS_SPI_U_BOOT_OFFS=0x40000
configs/gwventana_emmc_defconfig +2 -0
@@ -43,6 +43,8 @@ CONFIG_SPL_FIT_IMAGE_TINY=y CONFIG_SPL_DMA=y CONFIG_SPL_I2C=y CONFIG_SPL_OS_BOOT=y +CONFIG_SPL_FALCON_BOOT_MMCSD=y +CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR=0x1000 CONFIG_SPL_POWER=y CONFIG_SPL_WATCHDOG=y CONFIG_HUSH_PARSER=y
configs/gwventana_gw5904_defconfig +2 -0
@@ -43,6 +43,8 @@ CONFIG_SPL_FIT_IMAGE_TINY=y CONFIG_SPL_DMA=y CONFIG_SPL_I2C=y CONFIG_SPL_OS_BOOT=y +CONFIG_SPL_FALCON_BOOT_MMCSD=y +CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR=0x1000 CONFIG_SPL_POWER=y CONFIG_SPL_WATCHDOG=y CONFIG_HUSH_PARSER=y
configs/gwventana_nand_defconfig +2 -0
@@ -44,6 +44,8 @@ CONFIG_SPL_DMA=y CONFIG_SPL_I2C=y CONFIG_SPL_NAND_SUPPORT=y CONFIG_SPL_OS_BOOT=y +CONFIG_SPL_FALCON_BOOT_MMCSD=y +CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR=0x1000 CONFIG_SPL_POWER=y CONFIG_SPL_WATCHDOG=y CONFIG_HUSH_PARSER=y
configs/igep00x0_defconfig +2 -0
@@ -35,6 +35,8 @@ CONFIG_SPL_UBI_LOAD_KERNEL_ID=3 CONFIG_SPL_UBI_LOAD_ARGS_ID=4 CONFIG_SPL_ONENAND_SUPPORT=y CONFIG_SPL_OS_BOOT=y +CONFIG_SPL_FALCON_BOOT_MMCSD=y +CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR=0x1700 CONFIG_CMD_SPL=y # CONFIG_CMD_FLASH is not set CONFIG_CMD_NAND=y
configs/imx6dl_mamoj_defconfig +2 -0
@@ -16,6 +16,8 @@ CONFIG_IMX_HAB=y CONFIG_DISTRO_DEFAULTS=y CONFIG_BOOTDELAY=3 CONFIG_SPL_OS_BOOT=y +CONFIG_SPL_FALCON_BOOT_MMCSD=y +CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR=0x1000 CONFIG_CMD_SPL=y CONFIG_CRC32_VERIFY=y CONFIG_CMD_MEMTEST=y
configs/imx6q_logic_defconfig +2 -0
@@ -33,6 +33,8 @@ CONFIG_SPL_DMA=y CONFIG_SPL_I2C=y CONFIG_SPL_NAND_SUPPORT=y CONFIG_SPL_OS_BOOT=y +CONFIG_SPL_FALCON_BOOT_MMCSD=y +CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR=0x1000 CONFIG_SPL_USB_HOST=y CONFIG_SPL_USB_GADGET=y CONFIG_SPL_USB_SDP_SUPPORT=y
configs/omap35_logic_defconfig +2 -0
@@ -30,6 +30,8 @@ CONFIG_SPL_NAND_ECC=y CONFIG_SPL_NAND_SIMPLE=y CONFIG_SPL_NAND_BASE=y CONFIG_SPL_OS_BOOT=y +CONFIG_SPL_FALCON_BOOT_MMCSD=y +CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR=0x1700 CONFIG_SYS_PROMPT="OMAP Logic # " # CONFIG_CMD_IMI is not set CONFIG_CMD_SPL=y
configs/omap35_logic_somlv_defconfig +2 -0
@@ -30,6 +30,8 @@ CONFIG_SPL_NAND_ECC=y CONFIG_SPL_NAND_SIMPLE=y CONFIG_SPL_NAND_BASE=y CONFIG_SPL_OS_BOOT=y +CONFIG_SPL_FALCON_BOOT_MMCSD=y +CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR=0x1700 # CONFIG_SPL_POWER is not set CONFIG_SYS_PROMPT="OMAP Logic # " # CONFIG_CMD_IMI is not set
configs/omap3_logic_defconfig +2 -0
@@ -30,6 +30,8 @@ CONFIG_SPL_NAND_ECC=y CONFIG_SPL_NAND_SIMPLE=y CONFIG_SPL_NAND_BASE=y CONFIG_SPL_OS_BOOT=y +CONFIG_SPL_FALCON_BOOT_MMCSD=y +CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR=0x1700 CONFIG_SYS_PROMPT="OMAP Logic # " # CONFIG_CMD_IMI is not set CONFIG_CMD_SPL=y
configs/omap3_logic_somlv_defconfig +2 -0
@@ -30,6 +30,8 @@ CONFIG_SPL_NAND_ECC=y CONFIG_SPL_NAND_SIMPLE=y CONFIG_SPL_NAND_BASE=y CONFIG_SPL_OS_BOOT=y +CONFIG_SPL_FALCON_BOOT_MMCSD=y +CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR=0x1700 # CONFIG_SPL_POWER is not set CONFIG_SYS_PROMPT="OMAP Logic # " # CONFIG_CMD_IMI is not set
configs/omap4_panda_defconfig +2 -0
@@ -15,6 +15,8 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y # CONFIG_SPL_I2C is not set # CONFIG_SPL_NAND_SUPPORT is not set CONFIG_SPL_OS_BOOT=y +CONFIG_SPL_FALCON_BOOT_MMCSD=y +CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR=0x1700 CONFIG_CMD_SPL=y CONFIG_CMD_ASKENV=y CONFIG_CMD_GPIO=y
configs/omap5_uevm_defconfig +2 -0
@@ -16,6 +16,8 @@ CONFIG_DEFAULT_FDT_FILE="omap5-uevm.dtb" CONFIG_SYS_CONSOLE_INFO_QUIET=y # CONFIG_SPL_NAND_SUPPORT is not set CONFIG_SPL_OS_BOOT=y +CONFIG_SPL_FALCON_BOOT_MMCSD=y +CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR=0x1700 CONFIG_CMD_SPL=y CONFIG_CMD_ASKENV=y CONFIG_CMD_DFU=y
include/configs/brppt1.h +0 -1
@@ -34,7 +34,6 @@#define CONFIG_SYS_SPL_ARGS_ADDR 0x80F80000/* RAW SD card / eMMC */ -#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0x900/* address 0x120000 */ #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x80/* address 0x10000 */ #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS 0x80/* 64KiB */
include/configs/devkit8000.h +0 -2
@@ -144,10 +144,8 @@/* SPL OS boot options */ #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x280000 -#undef CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR#undef CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR#undef CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS -#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0x500/* address 0xa0000 */ #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x8/* address 0x1000 */ #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS 8/* 4KB */
include/configs/display5.h +0 -1
@@ -16,7 +16,6 @@#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x3F00#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS \ (CONFIG_CMD_SPL_WRITE_SIZE / 512) -#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0x100/* 128KiB */ /* * display5 SPI-NOR memory layout
include/configs/embestmx6boards.h +0 -1
@@ -66,7 +66,6 @@#define CONFIG_SPL_FS_LOAD_KERNEL_NAME "uImage"#define CONFIG_SPL_FS_LOAD_ARGS_NAME "imx6dl-riotboard.dtb" -#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0/* offset 69KB */ #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0/* offset 69KB */ #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS 0/* offset 69KB */
include/configs/gw_ventana.h +0 -1
@@ -18,7 +18,6 @@/* Falcon Mode - MMC support: args@1MB kernel@2MB */ #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x800/* 1MB */ #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS (CONFIG_CMD_SPL_WRITE_SIZE / 512) -#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0x1000/* 2MB */ #include "imx6_spl.h" /* common IMX6 SPL configuration */ #include "mx6_common.h"
include/configs/imx6-engicam.h +0 -1
@@ -151,7 +151,6 @@/* MMC support: args@1MB kernel@2MB */ # define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x800/* 1MB */ # define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS (CONFIG_CMD_SPL_WRITE_SIZE / 512) -# define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0x1000/* 2MB */ #endif /* Framebuffer */
include/configs/imx6_logic.h +0 -1
@@ -155,6 +155,5 @@/* Falcon Mode - MMC support: args@1MB kernel@2MB */ #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x800/* 1MB */ #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS (CONFIG_CMD_SPL_WRITE_SIZE / 512) -#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0x1000/* 2MB */ #endif /* __IMX6LOGIC_CONFIG_H */
include/configs/imx6dl-mamoj.h +0 -1
@@ -58,7 +58,6 @@/* MMC support: args@1MB kernel@2MB */ #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x800/* 1MB */ #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS (CONFIG_CMD_SPL_WRITE_SIZE / 512) -#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0x1000/* 2MB */ /* Miscellaneous configurable options */
include/configs/ls1043ardb.h +0 -1
@@ -25,7 +25,6 @@#ifdef CONFIG_SD_BOOT #define CONFIG_SYS_SPL_ARGS_ADDR 0x90000000 -#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0x10000#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x500#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS 30#endif
include/configs/mccmon6.h +0 -1
@@ -22,7 +22,6 @@*/ #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR (0x800)#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS (0x80) -#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR (0x1000)#define CONFIG_SPL_FS_LOAD_KERNEL_NAME "fitImage"#define CONFIG_MXC_UART_BASE UART1_BASE
include/configs/mx6sabreauto.h +0 -1
@@ -35,7 +35,6 @@/* Falcon Mode - MMC support: args@1MB kernel@2MB */ #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x800/* 1MB */ #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS (CONFIG_CMD_SPL_WRITE_SIZE / 512) -#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0x1000/* 2MB */ #endif #ifdef CONFIG_MTD_NOR_FLASH
include/configs/mx6sabresd.h +0 -1
@@ -25,7 +25,6 @@/* Falcon Mode - MMC support: args@1MB kernel@2MB */ #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x800/* 1MB */ #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS (CONFIG_CMD_SPL_WRITE_SIZE / 512) -#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0x1000/* 2MB */ #define CONFIG_SYS_FSL_USDHC_NUM 3
include/configs/pico-imx6.h +0 -1
@@ -21,7 +21,6 @@/* Falcon Mode - MMC support: args@1MB kernel@2MB */ #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x800/* 1MB */ #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS (CONFIG_CMD_SPL_WRITE_SIZE / 512) -#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0x1000/* 2MB */ #endif #define CONFIG_MXC_UART_BASE UART1_BASE
include/configs/pico-imx6ul.h +0 -1
@@ -23,7 +23,6 @@/* Falcon Mode - MMC support: args@1MB kernel@2MB */ #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x800/* 1MB */ #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS (CONFIG_CMD_SPL_WRITE_SIZE / 512) -#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0x1000/* 2MB */ #endif /* Network support */
include/configs/pico-imx7d.h +0 -1
@@ -21,7 +21,6 @@/* Falcon Mode - MMC support: args@1MB kernel@2MB */ #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x800/* 1MB */ #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS (CONFIG_CMD_SPL_WRITE_SIZE / 512) -#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0x1000/* 2MB */ #endif #define CONFIG_MXC_UART_BASE UART5_IPS_BASE_ADDR
include/configs/sama5d3_xplained.h +0 -1
@@ -73,7 +73,6 @@#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x100/* 128 KiB */ #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS (CONFIG_CMD_SPL_WRITE_SIZE / 512)/* U-Boot proper stored by default at 0x200 (256 KiB) */ -#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0x1000/* 2MB */ #define CONFIG_SYS_SPL_ARGS_ADDR 0x22000000/* Falcon boot support on FAT on MMC */
include/configs/tam3517-common.h +0 -1
@@ -121,7 +121,6 @@#define CONFIG_SPL_FS_LOAD_ARGS_NAME "args"/* RAW SD card / eMMC */ -#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0x900/* address 0x120000 */ #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x80/* address 0x10000 */ #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS 0x80/* 64KiB */
include/configs/ti_armv7_common.h +0 -1
@@ -153,7 +153,6 @@#define CONFIG_SPL_FS_LOAD_ARGS_NAME "args"/* RAW SD card / eMMC */ -#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0x1700/* address 0x2E0000 */ #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x1500/* address 0x2A0000 */ #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS 0x200/* 256KiB */ #endif
include/configs/vyasa-rk3288.h +0 -1
@@ -32,7 +32,6 @@/* Falcon Mode - MMC support: args@16MB kernel@17MB */ #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x8000/* 16MB */ #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS (CONFIG_CMD_SPL_WRITE_SIZE / 512) -#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0x8800/* 17MB */ #endif #endif
include/configs/xea.h +0 -1
@@ -27,7 +27,6 @@#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR (SZ_512K / 0x200)#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS (SZ_32K / 0x200) -#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR (SZ_1M / 0x200)#ifndef CONFIG_SPL_BUILD #define CONFIG_SPI_FLASH_MTD
include/configs/xilinx_zynqmp.h +0 -1
@@ -242,7 +242,6 @@#ifdef CONFIG_MMC_SDHCI_ZYNQ # define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0/* unused */ # define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS 0/* unused */ -# define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0/* unused */ # if defined(CONFIG_SPL_LOAD_FIT )# define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME "u-boot.itb"# else
include/configs/zynq-common.h +0 -1
@@ -236,7 +236,6 @@/* Not using MMC raw mode - just for compilation purpose */ #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS 0 -#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0/* qspi mode is working fine */ #ifdef CONFIG_ZYNQ_QSPI
scripts/config_whitelist.txt +0 -1
@@ -2255,7 +2255,6 @@ CONFIG_SYS_MII_MODE CONFIG_SYS_MIPS_TIMER_FREQ CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS -CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR CONFIG_SYS_MMC_CD_PIN CONFIG_SYS_MMC_CLK_OD CONFIG_SYS_MMC_MAX_BLK_COUNT
Signature · 1 line
2.31.1
PATCH v3 10/13 lib: Makefile: Make optee library available in SPL
In reply to Alexandru GagniucWe want the optee_copy_fdt_nodes symbols in SPL. This is for cases when booting an OPTEE payload directly.
--- lib/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/Makefile +1 -1
@@ -16,7 +16,6 @@ obj-$(CONFIG_FIT) += libfdt/ obj-$(CONFIG_OF_LIVE) += of_live.o obj-$(CONFIG_CMD_DHRYSTONE) += dhry/ obj-$(CONFIG_ARCH_AT91) += at91/ -obj-$(CONFIG_OPTEE_LIB) += optee/ obj-$(CONFIG_ASN1_DECODER) += asn1_decoder.o obj-y += crypto/
@@ -50,6 +49,7 @@ obj-$(CONFIG_BITREVERSE) += bitrev.o obj-y += list_sort.o endif +obj-$(CONFIG_OPTEE_LIB) += optee/ obj-$(CONFIG_$(SPL_TPL_)TPM) += tpm-common.o ifeq ($(CONFIG_$(SPL_TPL_)TPM),y) obj-y += crc8.o
Signature · 1 line
2.31.1
PATCH v3 11/13 ARM: dts: stm32mp: Add OP-TEE "/firmware" node to SPL dtb
In reply to Alexandru GagniucThe optee "/firmware" node is normally used to load the OP-TEE driver. SPL does not use it this way, but instead uses it to patch the kernel devicetree when booting OP-TEE. This seems weird, as OP-TEE -- which would run after SPL -- is capable of patching the devicetree and adding the required "/firmware" and "/reserved-memory" nodes.
However, OP-TEE's devicetree patching (CFG_DT=y) comes with a significant boot time penalty. Measurements put it between 700 to 1800 milliseconds. SPL can also do this patching, without incurring a measurable increase in boot time. This is the use case for falcon mode, which is the main reason to launch OP-TEE from SPL.
Although some OP-TEE configurations do not require any pre-patching of the devicetree, there are good use cases for doing so. As far as concerns with adding the nodes twice, OP-TEE will not add the node if it already-exists.
Add the "/firmware/optee" node the SPL devicetree.
--- arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi +1 -0
@@ -35,6 +35,7 @@ optee { compatible = "linaro,optee-tz"; method = "smc"; + u-boot,dm-spl; }; };
Signature · 1 line
2.31.1
PATCH v3 12/13 stm32mp1: spl: Copy optee nodes to target FDT for OP-TEE payloads
In reply to Alexandru GagniucOP-TEE does not take a devicetree for its own use. However, it does pass the devicetree to the normal world OS. In most cases that will be some other devicetree-bearing platform, such as linux.
OP-TEE is capable of patching the devicetree and adding the required "/firmware" and "/reserved-memory" nodes. Not all OP-TEE configurations do so, and it would need to be explicitly enabled (CFG_DT=y). There is a measurable boot time penalty to enabling this feature, and sometimes it is preferrable to do it in SPL for this exact reason.
As such, there are cases where it is required to copy the optee nodes to he target's FDT. Do this as part of spl_board_prepare_for_optee().
--- arch/arm/mach-stm32mp/spl.c | 2 ++ 1 file changed, 2 insertions(+)
arch/arm/mach-stm32mp/spl.c +2 -0
@@ -19,6 +19,7 @@#include <asm/arch/sys_proto.h> #include <mach/tzc.h> #include <linux/libfdt.h> +#include <tee/optee.h> u32 spl_boot_device (void ) {
@@ -182,6 +183,7 @@ void stm32_init_tzc_for_optee(void)void spl_board_prepare_for_optee (void *fdt) {stm32_fdt_setup_mac_addr (fdt); +optee_copy_fdt_nodes (fdt);stm32_init_tzc_for_optee (); }
Signature · 1 line
2.31.1
PATCH v3 13/13 ARM: dts: stm32mp: dts: Don't remove OPTEE nodes for DK2 boards
In reply to Alexandru GagniucTo prepare for an OP-TEE payload, the spl_board_prepare_for_optee() handler of STM32MP calls. stm32_init_tzc_for_optee(), which will panic(). The reason for the panic is a failure to locate a valid "/reserved-memory/optee" node in the devicetree.
This all occurs in SPL, so to re-add the OP-TEE memory nodes to the SPL devicetree.
--- arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi | 3 --- 1 file changed, 3 deletions(-)
arch/arm/dts/stm32mp157a-dk1-u-boot.dtsi +0 -3
@@ -27,10 +27,7 @@ config { u-boot,mmc-env-partition = "ssbl"; }; -#endif -#ifdef CONFIG_STM32MP15x_STM32IMAGE - /* only needed for boot with TF-A, witout FIP support */ firmware { optee { compatible = "linaro,optee-tz";
Signature · 1 line
2.31.1