summaryrefslogtreecommitdiffstats
path: root/scripts
Commit message (Collapse)AuthorAgeFilesLines
* pblimage: suppress stdout outputAhmad Fatoum5 days1-2/+1
| | | | | | | | | | | | | | Any output, stdout or stderr, during normal operation looks jarring when interleaved with Kbuild, so utilities should just be always silent on stdout and print errors to stderr if they occur. The pblimage tool violated this and had a stdout debug print left-over and printed part of an error message to stdout instead of stderr. Fix both instances. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240503100856.1222507-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: imx: IMX8MQ: fix header entry offsetBenjamin Gaignard2024-04-221-1/+6
| | | | | | | | | | Unlike other IMX8M, IMX8MQ version use a fixed offset so do a special case for this SoC. Fixes: 1c18863354dc ("scripts: imx-image: header_v2: add header_len parameter") Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com> Link: https://lore.barebox.org/20240418092411.224055-1-benjamin.gaignard@collabora.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: config: add script to manipulate .config files on the command lineAhmad Fatoum2024-04-161-0/+230
| | | | | | | | | | | | | | This ports over the Linux v6.9-rc3 state of the config script, which allows easy enabling and disabling of options from the command line, e.g.: scripts/config --file build/.config -d CONFIG_WERROR By having the script in the barebox scripts directory, it's available for use by build systems instead of running sed over the .config file. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240410122645.3701482-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pbl: introduce CONFIG_PBL_FULLY_PICAhmad Fatoum2024-03-052-0/+27
| | | | | | | | | | | | | | | | In the quest for making barebox PBL code W^X mappable, we have now taken care to make the ARM64 assembly routines not emit code relocations, so let's do the same for the C code as well. We do this by setting pragma GCC visibility push(hidden) globally. This option is stronger than -fvisibility=hidden and ensures we are completely position-independent. See kernel commit e544ea57ac07 ("x86/boot/compressed: Force hidden visibility for all symbol references") for more information. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240304190038.3486881-59-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2024-01-231-1/+1
|\
| * rsatoc: fix typo in usage stringAhmad Fatoum2024-01-111-1/+1
| | | | | | | | | | | | | | | | | | | | The commit introducing help text for the individual options, inadvertently modified the usage string. Revert that single line. Fixes: 94a2b2b28738 ("rsatoc: support generating standalone keys unreferenced by FIT keyring") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240105131000.1328500-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/layerscape'Sascha Hauer2024-01-231-37/+110
|\ \
| * | pblimage: Add LS1028a supportSascha Hauer2024-01-101-14/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The PBL images for the LS1028a are a bit different from the ones for the LS1046a, but can be supported in the same pblimage tool. This adds support for the LS1028a. To accomplish this the SoC type has to be passed on the command line, so adjust the Makefiles calling pblimage accordingly. Link: https://lore.barebox.org/20231219130040.4115-5-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | pblimage: use roundup() from kernel.hSascha Hauer2024-01-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | We already have roundup() defined in linux/kernel.h, so use it instead of adding a local definition. Link: https://lore.barebox.org/20231219130040.4115-4-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | pblimage: simplify a bitSascha Hauer2024-01-021-15/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | next_pbl_cmd is a global static variable that is initialized multiple times, but used in a single function only. Instead of obfuscating its usage, just pass its value as a parameter to generate_pbl_cmd(). Link: https://lore.barebox.org/20231219130040.4115-3-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | pblimage: drop PowerPC supportSascha Hauer2024-01-021-17/+5
| |/ | | | | | | | | | | | | | | PowerPC support has never been tested in the pblimage tool and will hopefully be never needed. Drop its support from pblimage Link: https://lore.barebox.org/20231219130040.4115-2-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | firmware: fix missing firmware handling for external firmwareMarco Felsch2024-01-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we depend on the external firmware file since we need it for the sha256sum. But this dependency break the 'optional missing firmware' feature. Fix this by dropping the firmware file prerequisite and instead evaluate the FWNAME_EXISTS variable. If the firmware file does not exist a dummy file is created and the build continues till the linking process (like we do for the other firmware). Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20240110145908.3965855-1-m.felsch@pengutronix.de Link: https://lore.barebox.org/20240119080706.2381579-1-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | omap3-usb-loader: Fix for big endian hostsSascha Hauer2024-01-111-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | omap3-usb-loader does a "filelen = cpu_to_le32(file->size)" and does arithmetic operations on filelen afterwards. Also it passes filelen to omap_usb_write() as the number of bytes to upload. This obviously only works on little endian hosts where cpu_to_le32() is a no-op. Fix this by doing the cpu_to_le32() conversion after all arithmetic operations and do not use filelen after it has been converted. This is a drive-by fix, untested currently as I don't have any big endian host to test it with. Link: https://lore.barebox.org/20240110-scripts-omap3-usb-loader-fix-compilation-v1-2-0503f170fa59@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | omap3-usb-loader: Fix compilationSascha Hauer2024-01-111-13/+0
| | | | | | | | | | | | | | | | | | | | Since a4a04ec768e ("scripts: common: fix read_file_2 for windows") common.c includes compiler.h which defines cpu_to_le32 and friends which are also defined in omap3-usb-loader.c. Drop the duplicated definitions from omap3-usb-loader.c to make it compile again. Link: https://lore.barebox.org/20240110-scripts-omap3-usb-loader-fix-compilation-v1-1-0503f170fa59@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts/get_maintainer.pl: Drop wrong line from outputSascha Hauer2024-01-101-1/+0
|/ | | | | | | | scripts/get_maintainer.pl prints "Maintained" on an otherwise empty line. Drop this wrong line as it triggers "b4 send" to try take this as an EMail address. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2023-12-183-145/+12
|\
| * scripts: socfpga_mkimage: re-use crc32 implementation from crypto/crc32.cSascha Hauer2023-12-131-57/+2
| | | | | | | | | | | | | | We already have crc32_be in the tree, so re-use that. Link: https://lore.barebox.org/20231212081623.1548734-4-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * scripts: mxsimage: re-use crc32 implementation from crypto/crc32.cSascha Hauer2023-12-131-44/+5
| | | | | | | | | | | | | | We already have crc32_be in the tree, so re-use that. Link: https://lore.barebox.org/20231212081623.1548734-3-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * scripts: pblimage: re-use crc32 implementation from crypto/crc32.cSascha Hauer2023-12-131-44/+5
| | | | | | | | | | | | | | We already have crc32_be in the tree, so re-use that. Link: https://lore.barebox.org/20231212081623.1548734-2-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/imx'Sascha Hauer2023-12-181-5/+14
|\ \
| * | scripts: imx-image: don't pad the final binary for i.MX8M devicesMarco Felsch2023-12-051-5/+14
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the padding was required the follwing error may appear: | found i.MX8MP USB device [1fc9:0146] | No dcd table in this ivt | dl_command err=-1, last_trans=-1 | 4 in err=-4, last_trans=0 00 00 00 00 The error is triggered since the target request only the required size of bytes and move on as soon as all bytes are received while, on the other hand, host tools like imx-usb-loader and uuu try to send the complete file size. The alignment was introduced long time ago by commit 7cb4778e7f49 ("imx-image: pad generated image to 4k") and may be required for HAB boot on older SoCs like i.MX6/7. On these SoCs the CSF data is placed behind the whole barebox image including the optional padding. On newer SoCs like the i.MX8M* this isn't the case anymore. On these SoCs the CSF is placed behind the barebox-pbl (aligned to 0x1000). So the final padding isn't required anymore on these SoCs. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20231114133358.3746051-1-m.felsch@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | kbuild: don't warn about reg formattingAhmad Fatoum2023-12-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Overlays, especially new style ones, are prone to trigger the reg formatting warnings if fragments add node with reg properties without also patching the parent: &phy0 { reg = <7>; }; In order to add #address-cells and #size-cells, the parent would need to be overlaid, which is a bad tradeoff as it's either redundant or it overrides the existing cell count with the wrong ones, possibly invalidating reg parsing for existing nodes. Improve the situation and avoid false positives by silencing the warnings when building device tree overlays. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20231130070320.3295372-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | kbuild: don't mix overlay and normal DTC and CPP flagsAhmad Fatoum2023-12-051-4/+3
|/ | | | | | | | | | | | | | | | | | | We currently conflate flags for *.dtb and *.dtbo targets: - -@ doesn't make sense for overlays, but is used there anyway when CONFIG_OF_OVERLAY_LIVE - DTC_CPP_FLAGS_basetarget.dtbo and DTC_CPP_FLAGS_basetarget.dtb are interchangeable Fix this by allowing flags to be specific to either *.dtb or *.dtbo generation. Fixes: 3610ec11f72b ("kbuild: Add target to build dtb overlay files") Fixes: 5b3d7e66aac0 ("kbuild: support DTC_CPP_FLAGS_file.dtbo") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20231130070320.3295372-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2023-11-272-2/+48
|\
| * scripts: imx: add Makefile.mingw64Marco Felsch2023-11-011-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a small Makfile for building the imx-usb-loader.exe outside the Kbuild system. The user can compile the tool for windows by: make -f scripts/imx/Makfile.mingw64 LIBUSB_DIR=~/libusb-1.0.26 or by make -f scripts/imx/Makfile.mingw64 LIBUSB_DIR=~/libusb-1.0.26 O=win Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20231018144038.504641-1-m.felsch@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * scripts: get_maintainers: drop --status enforcementMarco Felsch2023-11-011-2/+0
| | | | | | | | | | | | | | | | | | | | The status parameter is never used so drop it and stop bother the user of the script. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Acked-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20231026144325.4172966-2-m.felsch@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | imx-usb-loader: Add i.MX9 supportSascha Hauer2023-11-171-0/+29
| | | | | | | | | | | | | | | | i.MX9 support is straight forward: Just upload the whole image in one go. Link: https://lore.barebox.org/20231110125800.1901232-22-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts: imx9image: Add PBL size optionSascha Hauer2023-11-171-9/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The i.MX9 ROM can only load images that fit into OCRAM. The barebox image is usually bigger. This adds a -pblsize option that has the effect that it sets the image size in the header to the provided pbl size, so that the ROM only partially loads the image. barebox will then use the ROMAPI to load the rest of the image. We also add an additional alignment of 1KiB to the pblsize. This helps us with USB booting, as the USB protocol uploads in chunks of 1KiB. Link: https://lore.barebox.org/20231110125800.1901232-6-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts: Add imx9image toolSascha Hauer2023-11-173-0/+2179
| | | | | | | | | | | | | | | | | | This adds a tool for building images for the NXP i.MX9 SoC. The code is based on: https://github.com/nxp-imx/imx-mkimage/tree/5a0faefc223e51e088433663b6e7d6fbce89bf59 Link: https://lore.barebox.org/20231110125800.1901232-5-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts: setlocalversion: sync with LinuxAhmad Fatoum2023-11-101-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We are using an older version of setlocalversion that sources the config. This is wrong as there's no guarantee that it's ok to source the config, e.g.: CONFIG_DEFAULT_ENVIRONMENT_PATH="$(objtree)/.ptxdist-defaultenv" when sourced will lead to: scripts/setlocalversion: 15: include/config/auto.conf: objtree: not found Fix this by grepping the file instead. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20231109113835.1199875-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts: xz_wrap.sh: clear BCJ only when setSascha Hauer2023-11-061-1/+3
|/ | | | | | | | | | | | | xz_wrap.sh parses the the xz help output to test if the selected BCJ filter is actually supported. $BCJ might be empty though for some architectures like Mips, so test the variable for being non-empty before grepping for the BCJ filter to avoid warnings from grep: Usage: grep [OPTION]... PATTERNS [FILE]... Try 'grep --help' for more information. Fixes: 02898c798d ("scripts: Select XZ --arm64 BCJ filter for 64-bit arm") Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2023-10-271-0/+4
|\
| * decompress: xz: enable armthumb BCJ filter for Thumb-2 bareboxAhmad Fatoum2023-10-231-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The XZ decompressor in barebox has BCJ filter support for THUMB, but like Linux, it's unused and instead the ARM BCJ filter is used. Fixing that lets us save a few kilobytes, which is especially useful for legacy configuration that fit a whole barebox into limited on-chip SRAM (and not only the prebootloader). For example, with this patch applied barebox-am33xx-beaglebone-mlo.img is shrinked 3K from 109236 to 106028 bytes. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20231020180912.2914428-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/imx'Sascha Hauer2023-10-272-4/+9
|\ \
| * | imx-usb-loader: fix windows usageMarco Felsch2023-10-181-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This ports commit 561f0377db5e ("Transfer always specified report 2 length") from imx_usb_loader[1] to our implementation. | commit 561f0377db5e1a36f5ab5e17f97d774f9f1e22ab | Author: Stefan Agner <stefan.agner@toradex.com> | Date: Wed Nov 2 16:51:24 2016 -0700 | | Transfer always specified report 2 length | | The Windows HIDAPI is very strict when it comes to packet lengths: | The API always expect the length specified by the device and rejects | the transfer otherwise. The report size is specified by the HID | Report Descriptor. The i.MX 6 SoC reports a report 2 size of 1024. | Currently, imx_usb reads the length from the device specific config | files and stores it in max_transfer. This change uses max_transfer | for report 2 when using the HID API. | | The boot ROM handles too long transfers just fine. Also NXP's | sb_loader transfers always complete reports. The change has been | successfully tested on Linux and Windows. | | Given that the device reports the size, it is probably also "the | right thing to do"... | | With that change, we might end up transferring up to 1023 bytes | more than actually necessary. Make sure that DoIRomDownload does | not print an error message and returns successfully even if too | many bytes have been transferred (this now typically happens at the | end of every file). | | In write_dcd use a signed length variable to keep track of remaining | bytes. Continue transfer loop only if more than 0 bytes are left to | transfer. Also drop the m_ prefix, m_ is usually used for member | variables but this is a local variable. | | Signed-off-by: Stefan Agner <stefan.agner@toradex.com> [1] https://github.com/boundarydevices/imx_usb_loader/commit/561f0377db5e1a36f5ab5e17f97d774f9f1e22ab Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20231017213608.3494255-5-m.felsch@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: common: fix buffer freeingMarco Felsch2023-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We pass the wrong address to free in case of an error occured in preceding while-read loop if the loop is executed more than once. Fix this by use the outbuf which stores the original malloc'ed address. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20231017213608.3494255-3-m.felsch@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: common: fix read_file_2 for windowsMarco Felsch2023-10-181-1/+2
| |/ | | | | | | | | | | | | | | | | We need to specify the O_BINARY flag for Windows else the followed read() may detected a EOF condition. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20231017213608.3494255-2-m.felsch@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts: imx-image: add support for CST_EXTRA_CMDLINE_OPTIONSMarco Felsch2023-10-241-5/+9
| | | | | | | | | | | | | | | | | | | | | | Add CST_EXTRA_CMDLINE_OPTIONS environment variable to allow build tools like PTXdist or Yocto to pass additional cst command line options. This becomes important for newer cst versions (> 3.3.1) since they support multiple backends: ssl (default) and pkcs11. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20231017145131.3069283-27-m.felsch@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts: imx-image: add missing close()Marco Felsch2023-10-241-0/+2
| | | | | | | | | | | | | | | | Close the csfbin file after we read it into buf. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20231017145131.3069283-26-m.felsch@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts: imx: fix HAB for FlexSPI bootMarco Felsch2023-10-242-3/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The HAB FlexSPI boot use-case is currently broken, albeit the BootROM does the same steps as for MMC/SD. To fix this we need a 2nd CSF slot, since the HAB ROM code expect the IVT and payload data to be signed by the code signing tool (CST) and the MMC/SD IVT does differ slightly from the FlexSPI IVT. Please check the upcoming documentation patch for a in detail image layout overview. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20231017145131.3069283-25-m.felsch@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts: imx: add helper to write CSF Blocks commandMarco Felsch2023-10-241-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The upcoming commit fixes the HAB support for FlexSPI enabled barebox images. This commit prepares the source to keep the diff smaller. For the upcoming fix we need a 2nd CSF command sequence which is basically the same as the first except for the "Blocks = ...." command. Therefore we need to handle the blocks command separately which is done by this commit. Please note that the struct config_data 'flexspi_csf' member is added in the follow up commit. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20231017145131.3069283-24-m.felsch@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts: imx: add hab_qspi supportMarco Felsch2023-10-231-0/+20
| | | | | | | | | | | | | | | | | | Add 'hab_qspi' command which can be specified by .imxcfg board config files to request building HAB compatible QSPI images. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20231017145131.3069283-23-m.felsch@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts: imx: replace static string allocationMarco Felsch2023-10-231-15/+19
| | | | | | | | | | | | | | | | | | | | Make the CSF command string allocation more dynamic by introducing strcata(lloc)(). To make it more straight forward. Suggested-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20231017145131.3069283-22-m.felsch@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts: imx-image: hab_sign: refactor functionMarco Felsch2023-10-231-4/+7
| | | | | | | | | | | | | | | | | | Refactor the code to make it possible to write multiple CSF blocks. This is required for the upcoming FlexSPI CSF data fix. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20231017145131.3069283-21-m.felsch@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts: imx-image: header_v2: add CSF slotsMarco Felsch2023-10-231-4/+4
| | | | | | | | | | | | | | | | | | | | Place the MMC/SD CSF data int slot-0 and the FlexSPI CSF data into slot-1. This must be done since the MMC/SD and FlexSPI CSF data are different. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20231017145131.3069283-20-m.felsch@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts: imx: add imx8m_get_offset_size helperMarco Felsch2023-10-231-11/+18
| | | | | | | | | | | | | | | | | | No functional change, just move the offset and signed_size calculation into a dedicated helper. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20231017145131.3069283-19-m.felsch@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts: imx: fix i.MX8M CSF header placementMarco Felsch2023-10-182-5/+11
| | | | | | | | | | | | | | | | | | | | | | The current boot flow is broken if both the FlexSPI image and the HAB support is enabled. The HAB/CST tool need to take the additional FlexSPI IVT header into account which is added in between the first IVT header and the barebox pbl code. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20231017145131.3069283-18-m.felsch@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts: imx: move flexspi_image() into headerMarco Felsch2023-10-182-12/+13
| | | | | | | | | | | | | | | | | | Move the flexspi_image() into the imx.h header to make the code reusable between imx.c and imx-image.c. No functional change. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20231017145131.3069283-17-m.felsch@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts: imx: force flexspi and hab option orderMarco Felsch2023-10-181-0/+12
|/ | | | | | | | | | | | Force the order to ensure that the hab options are parsed after the flexspi options. This is important since we need to know which memory regions need to be verified and/or en-/decrypted and with the flexspi support a 2nd header is added in between the first header and the barebox pbl binary. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20231017145131.3069283-16-m.felsch@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2023-09-255-50/+54
|\