- Jul 31, 2021
-
-
Platform specific BootROM may use its own image type for loading SPL or U-Boot proper. In some cases it makes sense to not use BootROM supplied code for booting U-Boot proper but rather to use U-Boot SPL for this, e.g. when U-Boot SPL can load U-Boot proper faster than BootROM. In this case it is required for platform board code to parse and load U-Boot in BootROM specific image type. This change adds support for parsing platform / board / BootROM specific image types via weak function spl_parse_board_header() which is called before marking boot image as a raw. Signed-off-by:
Pali Rohár <pali@kernel.org> Reviewed-by:
Marek Behún <marek.behun@nic.cz> Reviewed-by:
Stefan Roese <sr@denx.de>
-
Some image types (e.g. kwbimage v1) store the offset to SPL binary and offset to U-Boot proper binary in their headers. To avoid reading SPL binary when loading U-Boot proper, add support for specifying offset in struct spl_image_info, which defines the offset from the beginning of the header and the beginning of the executable data. Initial support is added only for SPI, MMC and SATA code. We can extend it later if needed. Signed-off-by:
Pali Rohár <pali@kernel.org> Reviewed-by:
Marek Behún <marek.behun@nic.cz> Reviewed-by:
Stefan Roese <sr@denx.de>
-
Current code uses hack in board_init_f() which calls return_to_bootrom() to skip U-Boot SPL code and return back to BootROM to load U-Boot via UART or from NAND. This change migrates that hack from the board_init_f() function and changes it to return BOOT_DEVICE_BOOTROM instead of returning to BootROM directly, so that U-Boot's SPL framework is used for returning to BootROM. Signed-off-by:
Pali Rohár <pali@kernel.org> Reviewed-by:
Marek Behún <marek.behun@nic.cz> Reviewed-by:
Stefan Roese <sr@denx.de> Reviewed-by:
Chris Packham <judge.packham@gmail.com> Tested-by:
Chris Packham <judge.packham@gmail.com>
-
U-Boot's SPL framework already has an API for loading U-Boot via BootROM. Implement the function board_return_to_bootrom() for mvebu SPL code. Signed-off-by:
Pali Rohár <pali@kernel.org> Reviewed-by:
Marek Behún <marek.behun@nic.cz> Reviewed-by:
Stefan Roese <sr@denx.de> Reviewed-by:
Chris Packham <judge.packham@gmail.com> Tested-by:
Chris Packham <judge.packham@gmail.com>
-
This function does not return, so add the appropriate compiler flag. Signed-off-by:
Pali Rohár <pali@kernel.org> Reviewed-by:
Marek Behún <marek.behun@nic.cz> Reviewed-by:
Stefan Roese <sr@denx.de> Reviewed-by:
Chris Packham <judge.packham@gmail.com> Tested-by:
Chris Packham <judge.packham@gmail.com>
-
Register r0 should be set to return value 0x0 - NO_ERR. Set r0 with return value after all registers are restored from the stack, so that the return value is always correct. Signed-off-by:
Pali Rohár <pali@kernel.org> Fixes: 944c7a31 ("arm: mvebu: Add option to use UART xmodem protocol via kwboot") Reviewed-by:
Marek Behún <marek.behun@nic.cz> Reviewed-by:
Stefan Roese <sr@denx.de> Reviewed-by:
Chris Packham <judge.packham@gmail.com> Tested-by:
Chris Packham <judge.packham@gmail.com>
-
Function image_version() returns unsigned value, so it can never be negative. Explicitly check for two supported image versions: v0 and v1. Signed-off-by:
Pali Rohár <pali@kernel.org> Reviewed-by:
Marek Behún <marek.behun@nic.cz> Reviewed-by:
Stefan Roese <sr@denx.de>
-
Too small invalid headers may cause kwboot to crash. Check for header size of v1 images. Signed-off-by:
Pali Rohár <pali@kernel.org> Reviewed-by:
Marek Behún <marek.behun@nic.cz> Reviewed-by:
Stefan Roese <sr@denx.de> Reviewed-by:
Chris Packham <judge.packham@gmail.com> Tested-by:
Chris Packham <judge.packham@gmail.com>
-
Add missing curly brackets for this else statement. Signed-off-by:
Pali Rohár <pali@kernel.org> Reviewed-by:
Marek Behún <marek.behun@nic.cz> Reviewed-by:
Stefan Roese <sr@denx.de> Reviewed-by:
Chris Packham <judge.packham@gmail.com> Tested-by:
Chris Packham <judge.packham@gmail.com>
-
Print trailing newline as the last printed byte can be something different. Signed-off-by:
Pali Rohár <pali@kernel.org> Reviewed-by:
Marek Behún <marek.behun@nic.cz> Reviewed-by:
Stefan Roese <sr@denx.de> Reviewed-by:
Chris Packham <judge.packham@gmail.com> Tested-by:
Chris Packham <judge.packham@gmail.com>
-
Call tcsetattr() only if the file descriptor is valid. It may be invalidated by previous lines (if it is not a tty descriptor). Signed-off-by:
Pali Rohár <pali@kernel.org> Reviewed-by:
Marek Behún <marek.behun@nic.cz> Reviewed-by:
Stefan Roese <sr@denx.de> Reviewed-by:
Chris Packham <judge.packham@gmail.com> Tested-by:
Chris Packham <judge.packham@gmail.com>
-
The 'buf' variable is a pointer and '_buf' is the array itself. Therefore we should pass sizeof(_buf) instead of sizeof(buf) to read(). Signed-off-by:
Pali Rohár <pali@kernel.org> Reviewed-by:
Marek Behún <marek.behun@nic.cz> Reviewed-by:
Stefan Roese <sr@denx.de> Reviewed-by:
Chris Packham <judge.packham@gmail.com> Tested-by:
Chris Packham <judge.packham@gmail.com>
-
There is no code for extracting data from kwbimage, so show an error message when user tries this via e.g. dumpimage call: ./tools/dumpimage -T kwbimage -o /tmp/out u-boot-spl.kwb Signed-off-by:
Pali Rohár <pali@kernel.org> Reviewed-by:
Marek Behún <marek.behun@nic.cz> Reviewed-by:
Stefan Roese <sr@denx.de>
-
Trying to call the following command causes NULL pointer dereference in strlen(): ./tools/dumpimage -T kwbimage -o /tmp/out u-boot-spl.kwb Fix it by checking whether params->imagename is non-NULL before calling strlen(). Signed-off-by:
Pali Rohár <pali@kernel.org> Reviewed-by:
Marek Behún <marek.behun@nic.cz> Reviewed-by:
Stefan Roese <sr@denx.de>
-
These structures must have specific size without padding, so mark them as packed via the de-facto standard macro __packed. Also replace PACKED macro. Signed-off-by:
Pali Rohár <pali@kernel.org> Reviewed-by:
Marek Behún <marek.behun@nic.cz> Reviewed-by:
Stefan Roese <sr@denx.de>
-
The mkimage host tool can be used to generate kwbimage v1 image with secure header on host system for A38x plaform also when U-Boot is being compiled for different platform. So there is no reason to not allow compiling of mkimage/kwbimage with secure header support for e.g. x86-64 host. Signed-off-by:
Pali Rohár <pali@kernel.org> Reviewed-by:
Marek Behún <marek.behun@nic.cz> Reviewed-by:
Chris Packham <judge.packham@gmail.com> Reviewed-by:
Stefan Roese <sr@denx.de> Tested-by:
Chris Packham <judge.packham@gmail.com>
-
This command is supported only by v1 images and specifies a milliseconds delay after executing some set of DATA commands. The special string value SDRAM_SETUP instructs BootROM to setup SDRAM controller instead of executing delay. SDRAM_SETUP may be specified only once and after the last DATA command. Signed-off-by:
Pali Rohár <pali@kernel.org> Reviewed-by:
Marek Behún <marek.behun@nic.cz> Reviewed-by:
Chris Packham <judge.packham@gmail.com> Reviewed-by:
Stefan Roese <sr@denx.de> Tested-by:
Chris Packham <judge.packham@gmail.com>
-
The DATA command is already supported by mkimage for v0 images, but not for v1 images. BootROM code which executes v1 images also supports DATA command via an optional extended v1 header OPT_HDR_V1_REGISTER_TYPE. Implement support for DATA command for v1 images. Signed-off-by:
Pali Rohár <pali@kernel.org> Reviewed-by:
Marek Behún <marek.behun@nic.cz> Reviewed-by:
Chris Packham <judge.packham@gmail.com> Reviewed-by:
Stefan Roese <sr@denx.de> Tested-by:
Chris Packham <judge.packham@gmail.com>
-
The PAYLOAD keyword does nothing. No code is using it and both mkimage and kwbimage completely ignore it. It looks like a relict from the past. The payload image itself can be specified only via -d parameter to mkimage. Signed-off-by:
Pali Rohár <pali@kernel.org> Reviewed-by:
Marek Behún <marek.behun@nic.cz> Reviewed-by:
Chris Packham <judge.packham@gmail.com> Reviewed-by:
Stefan Roese <sr@denx.de> Tested-by:
Chris Packham <judge.packham@gmail.com>
-
The kwbimage v1 format supports multiple BINARY executable headers. Add support for it into mkimage/kwbimage tool. Signed-off-by:
Pali Rohár <pali@kernel.org> Reviewed-by:
Marek Behún <marek.behun@nic.cz> Reviewed-by:
Chris Packham <judge.packham@gmail.com> Reviewed-by:
Stefan Roese <sr@denx.de> Tested-by:
Chris Packham <judge.packham@gmail.com>
-
Binary header consist of: * 1 byte for header type * 3 bytes for header size * 1 byte for number of arguments * 3 reserved bytes * N*4 bytes for arguments * M bytes (aligned to 4 bytes) for executable data * 1 byte for information about next header * 3 reserved bytes The first four bytes are specified as sizeof(struct opt_hdr_v1) and the remaining bytes as ALIGN(s.st_size, 4) + (binarye->binary.nargs + 2) * sizeof(uint32_t) Signed-off-by:
Pali Rohár <pali@kernel.org> Reviewed-by:
Marek Behún <marek.behun@nic.cz> Reviewed-by:
Stefan Roese <sr@denx.de>
-
The number is stored in one byte, so the maximum should be 255. Signed-off-by:
Pali Rohár <pali@kernel.org> Reviewed-by:
Marek Behún <marek.behun@nic.cz> Reviewed-by:
Stefan Roese <sr@denx.de>
-
The data part of v1 kwbimage currently contains U-Boot binary prepended by 64 bytes long Legacy U-Boot image header. This means that the load address is currently substracted by 64 bytes to ensure that U-Boot's entry point is at specified execution address. As mkimage has already separate arguments for load (-a) and execution (-e) address, there is no need to derive fixed load address from execution address. Therefore remove this load address hack from the kwbimage tool and support generating v1 kwbimage with arbitrary addresses for load and execution. Finally, calculate correct load address by caller for mkimage tool in Makefile. File u-boot-spl.kwb is always a v1 kwbimage and it is the only v1 kwbimage which U-Boot's build system generates. Remove also useless overwriting of destaddr for /binary.0 to the value which is already set on previous lines. Signed-off-by:
Pali Rohár <pali@kernel.org> Reviewed-by:
Marek Behún <marek.behun@nic.cz> Reviewed-by:
Stefan Roese <sr@denx.de> Reviewed-by:
Chris Packham <judge.packham@gmail.com> Tested-by:
Chris Packham <judge.packham@gmail.com>
-
Remove this space, since the constants are indented by tabs. Signed-off-by:
Marek Behún <marek.behun@nic.cz> Reviewed-by:
Stefan Roese <sr@denx.de> Reviewed-by:
Chris Packham <judge.packham@gmail.com> Tested-by:
Chris Packham <judge.packham@gmail.com>
-
The binary header in kwbimage contains executable SPL code. Print information about this binary header and not only information about it's data part. Signed-off-by:
Pali Rohár <pali@kernel.org> Reviewed-by:
Marek Behún <marek.behun@nic.cz> Reviewed-by:
Stefan Roese <sr@denx.de> Reviewed-by:
Chris Packham <judge.packham@gmail.com> Tested-by:
Chris Packham <judge.packham@gmail.com>
-
The data part of v1 images contains 32-bit checksum after the data. Validate whether this checksum is correct. Signed-off-by:
Pali Rohár <pali@kernel.org> Reviewed-by:
Marek Behún <marek.behun@nic.cz> Reviewed-by:
Stefan Roese <sr@denx.de> Reviewed-by:
Chris Packham <judge.packham@gmail.com> Tested-by:
Chris Packham <judge.packham@gmail.com>
-
Add basic checks for extended headers of v1 images. Signed-off-by:
Pali Rohár <pali@kernel.org> Reviewed-by:
Marek Behún <marek.behun@nic.cz> Reviewed-by:
Stefan Roese <sr@denx.de> Reviewed-by:
Chris Packham <judge.packham@gmail.com> Tested-by:
Chris Packham <judge.packham@gmail.com>
-
Extended header checksum for v0 image is present only in the case when extended header is present. Skip checksum validation if extended header is not present. Signed-off-by:
Pali Rohár <pali@kernel.org> Reviewed-by:
Marek Behún <marek.behun@nic.cz> Reviewed-by:
Stefan Roese <sr@denx.de> Reviewed-by:
Chris Packham <judge.packham@gmail.com> Tested-by:
Chris Packham <judge.packham@gmail.com>
-
In the case when the file name is specified relative to the current working directory, it does not contain '/' character and strrchr() returns NULL. The following strcmp() function then crashes on NULL pointer dereference. Signed-off-by:
Pali Rohár <pali@kernel.org> Reviewed-by:
Marek Behún <marek.behun@nic.cz> Reviewed-by:
Stefan Roese <sr@denx.de> Reviewed-by:
Chris Packham <judge.packham@gmail.com> Tested-by:
Chris Packham <judge.packham@gmail.com>
-
SATA and SDIO images must be aligned to sector size (which in most cases is 512 bytes) and Source Address in main header is stored in number of sectors from the beginning of the drive. SATA image must be stored at sector 1 and SDIO image at sector 0. Source Address for PCIe image is not used and must be set to 0xFFFFFFFF. Signed-off-by:
Pali Rohár <pali@kernel.org> Reviewed-by:
Marek Behún <marek.behun@nic.cz> Reviewed-by:
Stefan Roese <sr@denx.de> Reviewed-by:
Chris Packham <judge.packham@gmail.com> Tested-by:
Chris Packham <judge.packham@gmail.com>
-
Add constant for SDIO value of the bootfrom header field. Signed-off-by:
Marek Behún <marek.behun@nic.cz> Reviewed-by:
Stefan Roese <sr@denx.de> Reviewed-by:
Chris Packham <judge.packham@gmail.com> Tested-by:
Chris Packham <judge.packham@gmail.com>
-
Writing into SPI NOR and NAND memory can be done only in 256 bytes long blocks. Align final image size so that when it is burned into SPI NOR or NAND memory via U-Boot's commands (sf or mtd), we can use the $filesize variable directly as the length argument. Signed-off-by:
Pali Rohár <pali@kernel.org> Reviewed-by:
Marek Behún <marek.behun@nic.cz> Reviewed-by:
Stefan Roese <sr@denx.de> Reviewed-by:
Chris Packham <judge.packham@gmail.com> Tested-by:
Chris Packham <judge.packham@gmail.com>
-
The return value of kwbimage_generate() is used for aligning the data part of kwbimage. Use it for calculating proper 4 byte alignment as is required by BootROM and also use it for allocating additional 4 bytes for the 32-bit data checksum. This simplifies the alignment code to be only at one place (in function kwbimage_generate) and also simplifies setting checksum as it can be directly updated in memory. Signed-off-by:
Pali Rohár <pali@kernel.org> Reviewed-by:
Marek Behún <marek.behun@nic.cz> Reviewed-by:
Stefan Roese <sr@denx.de> Reviewed-by:
Chris Packham <judge.packham@gmail.com> Tested-by:
Chris Packham <judge.packham@gmail.com>
-
The CONFIG_SYS_U_BOOT_OFFS option may be defined as empty string. In this case it causes compilation error: tools/kwbimage.c: In function ‘image_headersz_v1’: tools/kwbimage.c:1002:39: error: expected expression before ‘)’ token if (headersz > CONFIG_SYS_U_BOOT_OFFS) { ^ tools/kwbimage.c:1006:41: error: expected expression before ‘)’ token (int)headersz, CONFIG_SYS_U_BOOT_OFFS); ^ tools/kwbimage.c:1011:35: error: expected expression before ‘;’ token headersz = CONFIG_SYS_U_BOOT_OFFS; ^ make[1]: *** [scripts/Makefile.host:112: tools/kwbimage.o] Error 1 make: *** [Makefile:1822: tools] Error 2 Check whether the value of CONFIG_SYS_U_BOOT_OFFS is really set. Signed-off-by:
Pali Rohár <pali@kernel.org> Reviewed-by:
Marek Behún <marek.behun@nic.cz> Reviewed-by:
Stefan Roese <sr@denx.de> Reviewed-by:
Chris Packham <judge.packham@gmail.com> Tested-by:
Chris Packham <judge.packham@gmail.com>
-
- Jul 29, 2021
-
-
Tom Rini authored
- Assorted bugfixes
-
https://source.denx.de/u-boot/custodians/u-boot-tiTom Rini authored
- Add MMC High speed modes for AM64 and J7200 - Add Sierra/Torrent SERDES driver - Minor clean-ups for R5F boot from SPL
-
The PADCONFIG_202 register (0x02621328) is affected by the locking of the RSTMUX8 register (0x02620328), and so cannot be configured in kernel. This has been confirmed as a hardware bug and affects all K2G SoCs. Setup the pinmux for this pin before locking the RSTMUX8 register to allow the ICSS1 PRU1 Ethernet PHY port to work properly. The workaround was added only for the K2G-ICE board to configure the pins needed for the PRUSS Ethernet usecase. Signed-off-by:
Suman Anna <s-anna@ti.com> Signed-off-by:
Lokesh Vutla <lokeshvutla@ti.com> Link: https://lore.kernel.org/r/20210726232248.24395-1-s-anna@ti.com
-
This patch adds the possibility to pass the PIN the OpenSSL Engine used during signing via the environment variable MKIMAGE_SIGN_PIN. This follows the approach used during kernel module signing ("KBUILD_SIGN_PIN") or UBIFS image signing ("MKIMAGE_SIGN_PIN"). Signed-off-by:
Marc Kleine-Budde <mkl@pengutronix.de>
-
Some builds of squashfs-tools append version string with "-git" or similar. The float() conversion will fail in this case. Improve the code to only convert to float() the string before the '-' character. Signed-off-by:
Marek Behún <marek.behun@nic.cz> Reviewed-by:
Simon Glass <sjg@chromium.org> Reviewed-by:
Joao Marcos Costa <jmcosta944@gmail.com>
-
With LTO activated, the buildman tools failed with an error on my configuration (Ubuntu 20.04, stm32mp15_trusted_defconfig) with the error: ../arm-linux-gnueabi/bin/nm: scripts/gen_ll_addressable_symbols.sh: file format not recognized It seems the shell variable initialization NM=$(NM) is not correctly interpreted when shell is started in the Makefile, but I have not this issue when I compile the same target without buildman. I don't found the root reason of the problem but I solve it by providing $(NM) as script parameter instead using a shell variable. The command executed is identical: cmd_keep-syms-lto.c := NM=arm-none-linux-gnueabihf-gcc-nm \ u-boot/scripts/gen_ll_addressable_symbols.sh arch/arm/cpu/built-in.o \ .... net/built-in.o >keep-syms-lto.c cmd_keep-syms-lto.c := u-boot/scripts/gen_ll_addressable_symbols.sh \ arm-none-linux-gnueabihf-gcc-nm arch/arm/cpu/built-in.o \ ... net/built-in.o > keep-syms-lto.c Reviewed-by:
Simon Glass <sjg@chromium.org> Signed-off-by:
Patrick Delaunay <patrick.delaunay@foss.st.com>
-