summaryrefslogtreecommitdiff
path: root/boot
Commit message (Collapse)AuthorAgeFilesLines
* image: fdt: Fix DT relocation handling with multiple DRAM banks with gapMarek Vasut2022-04-201-4/+36
| | | | | | | | | | | | | | | | | | | | | | | The current implementation of boot_relocate_fdt() places DT at the highest usable DRAM address, which is calculated as: env_get_bootm_low() + env_get_bootm_mapsize() which by default becomes gd->ram_base + gd->ram_size. Systems like i.MX53 can have multiple DRAM banks with gap between them, e.g. have DRAM at 0x70000000-0x8fffffff and 0xb0000000-0xcfffffff , so for them the calculated highest DRAM address is 0xafffffff, which is exactly in the gap and thus not usable. Fix this by iterating over all DRAM banks and tracking the remaining amount of the total mapping size obtained from env_get_bootm_mapsize(). Limit the maximum LMB area size to each bank, to avoid using nonexistent DRAM. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Marek Vasut <marex@denx.de> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com>
* image-fit: don't check free() argumentHeinrich Schuchardt2022-04-191-9/+3
| | | | | | | * free() checks if its argument is NULL. Remove duplicate checks. * Remove duplicate free(ovcopy). Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
* image-fdt: save name of FIT configuration in '/chosen' nodeDaniel Golle2022-04-191-0/+6
| | | | | | | | | | It can be useful for the OS (Linux) to know which configuration has been chosen by U-Boot when launching a FIT image. Store the name of the FIT configuration node used in a new string property called 'u-boot,bootconf' in the '/chosen' node in device tree. Signed-off-by: Daniel Golle <daniel@makrotopia.org> Reviewed-by: Tom Rini <trini@konsulko.com>
* image: fit: Align hash output buffersSean Anderson2022-04-111-1/+3
| | | | | | | | | | | Hardware-accelerated hash functions require that the input and output buffers be aligned to the minimum DMA alignment. memalign.h helpfully provides a macro just for this purpose. It doesn't exist on the host, but we don't need to be aligned there either. Fixes: 5dfb521386 ("[new uImage] New uImage low-level API") Signed-off-by: Sean Anderson <sean.anderson@seco.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* cmd: pxe_utils: sysboot: replace cls command by video_clear in PXE parserPatrick Delaunay2022-04-111-3/+9
| | | | | | | | | | | | | | | Since the commit bfaa51dd4adf ("cmd: add serial console support for the cls command") the cls command is not enough to clear the video display when ANSI console is activated. This patch clears the video device with the video_clear() API before to display the bitmap used for the PXE background. This patch avoids to display the LOGO, activated by default with commit 7a8555d87136 ("video: Show the U-Boot logo by default"). Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
* Merge branch '2022-04-04-platform-updates'Tom Rini2022-04-051-0/+24
|\ | | | | | | - Updates for exynos78x0 and TI K3 platforms
| * arm: init: save previous bootloader dataDzmitry Sankouski2022-04-041-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When u-boot is used as a chain-loaded bootloader (replacing OS kernel), previous bootloader leaves data in RAM, that can be reused. For example, on recent arm linux system, when chainloading u-boot, there are initramfs and fdt in RAM prepared for OS booting. Initramfs may be modified to store u-boot's payload, thus providing the ability to use chainloaded u-boot to boot OS without any storage support. Two config options added: - SAVE_PREV_BL_INITRAMFS_START_ADDR saves initramfs start address to 'prevbl_initrd_start_addr' environment variable - SAVE_PREV_BL_FDT_ADDR saves fdt address to 'prevbl_fdt_addr' environment variable Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com> Cc: Tom Rini <trini@konsulko.com>
* | Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxiTom Rini2022-04-051-0/+1
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A big part is the DM pinctrl driver, which allows us to get rid of quite some custom pinmux code and make the whole port much more robust. Many thanks to Samuel for that nice contribution! There are some more or less cosmetic warnings about missing clocks right now, I will send the trivial fixes for that later. Another big chunk is the mkimage upgrade, which adds RISC-V and TOC0 (secure images) support. Both features are unused at the moment, but I have an always-secure board that will use that once the DT lands in the kernel. On top of those big things we have some smaller fixes, improving the I2C DM support, fixing some H6/H616 early clock setup and improving the eMMC boot partition support. The gitlab CI completed successfully, including the build test for all 161 sunxi boards. I also boot tested on a A64, A20, H3, H6, and F1C100 board. USB, SD card, eMMC, and Ethernet all work there (where applicable).
| * tools: mkimage: Add Allwinner TOC0 supportSamuel Holland2022-04-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most Allwinner sunxi SoCs have separate boot ROMs in non-secure and secure mode. The "non-secure" or "normal" boot ROM (NBROM) uses the existing sunxi_egon image type. The secure boot ROM (SBROM) uses a completely different image type, known as TOC0. A TOC0 image is composed of a header and two or more items. One item is the firmware binary. The others form a chain linking the firmware signature to the root-of-trust public key (ROTPK), which has its hash burned in the SoC's eFuses. Signatures are made using RSA-2048 + SHA256. The pseudo-ASN.1 structure is manually assembled; this is done to work around bugs/quirks in the boot ROM, which vary between SoCs. This TOC0 implementation has been verified to work with the A50, A64, H5, H6, and H616 SBROMs, and it may work with other SoCs. Signed-off-by: Samuel Holland <samuel@sholland.org> Acked-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
* | Revert "global: Remove CONFIG_SYS_EXTRA_OPTIONS support"Tom Rini2022-04-021-0/+13
| | | | | | | | | | | | | | | | | | Unfortunately, we require additional logic to buildman to support this removal and still use SYS_SOC, etc, for build targets. This reverts commit eeec00072d7a0b5b91896d014618e558ce438738. Signed-off-by: Tom Rini <trini@konsulko.com>
* | global: Remove CONFIG_SYS_EXTRA_OPTIONS supportTom Rini2022-04-011-13/+0
| | | | | | | | | | | | | | All options have now been migrated to Kconfig correctly so remove this support. Signed-off-by: Tom Rini <trini@konsulko.com>
* | Convert CONFIG_SYS_MONITOR_BASE to KconfigTom Rini2022-04-011-0/+25
| | | | | | | | | | | | | | | | | | | | | | This converts the following to Kconfig: CONFIG_SYS_MONITOR_BASE Note that for how this is re-used on some PowePC platforms, we introduce CONFIG_SPL_SYS_MONITOR_BASE and CONFIG_TPL_SYS_MONITOR_BASE and use the CONFIG_VAL macro to get the correct value at build time, in the code. Signed-off-by: Tom Rini <trini@konsulko.com>
* | Convert CONFIG_SDCARD et al to KconfigTom Rini2022-04-011-0/+14
| | | | | | | | | | | | | | | | This converts the following to Kconfig: CONFIG_SDCARD CONFIG_SPIFLASH Signed-off-by: Tom Rini <trini@konsulko.com>
* | cmd: bootm: add a stage pre-loadPhilippe Reynes2022-03-311-0/+33
| | | | | | | | | | | | | | | | | | | | Add a stage pre-load to the command bootm. Right now, this stage may be used to read a header and check the signature of the full image. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
* | boot: image: add a stage pre-loadPhilippe Reynes2022-03-313-0/+472
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a stage pre-load that could check or modify an image. For the moment, only a header with a signature is supported. This header has the following format: - magic : 4 bytes - version : 4 bytes - header size : 4 bytes - image size : 4 bytes - offset image signature : 4 bytes - flags : 4 bytes - reserved0 : 4 bytes - reserved1 : 4 bytes - sha256 of the image signature : 32 bytes - signature of the first 64 bytes : n bytes - image signature : n bytes - padding : up to header size The stage uses a node /image/pre-load/sig to get some informations: - algo-name (mandatory) : name of the algo used to sign - padding-name : name of padding used to sign - signature-size : size of the signature (in the header) - mandatory : set to yes if this sig is mandatory - public-key (madatory) : value of the public key Before running the image, the stage pre-load checks the signature provided in the header. This is an initial support, later we could add the support of: - ciphering - uncompressing - ... Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
* | Merge tag 'v2022.04-rc5' into nextTom Rini2022-03-281-1/+1
|\ \ | |/ | | | | Prepare v2022.04-rc5
| * boot: image: fixup zstd decompression buffer initialization typoJérôme Carretero2022-03-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code was mistakenly initializing the input buffer twice. Tested to be working on BeagleBone by adjusting CONFIG_SYS_BOOTM_LEN to 64MiB (probably works with less) and preparing uImage with: cat arch/arm/boot/Image \ | zstd --ultra -22 --zstd=windowLog=22 \ > linux.bin.zst mkimage -A arm -T kernel uImage -C zstd -d linux.bin.zst \ -a 0x80008000 -e 0x80008000 Without the windowLog restriction, bootm fails with a zstd decompression error 7 (window too large), which I haven't troubleshooted. There should be a bit more documentation on the feature... Reviewed-by: Simon Glass <sjg@chromium.org> Fixes: 458b30af66c image: Update image_decomp() to avoid ifdefs
* | Convert CONFIG_BOOT_RETRY_TIME et al to KconfigTom Rini2022-03-183-9/+31
|/ | | | | | | | | | | | | This converts the following to Kconfig: CONFIG_BOOT_RETRY_TIME CONFIG_BOOT_RETRY_MIN CONFIG_RESET_TO_RETRY We also introduce CONFIG_BOOT_RETRY to gate these options, and clean up the associated Makefile entry and C code for picking default values of CONFIG_BOOT_RETRY_MIN. Signed-off-by: Tom Rini <trini@konsulko.com>
* cmd: pxe_utils: sysboot: add kaslr-seed generation supportZhang Ning2022-02-111-0/+75
| | | | | | | | | | | | | | | | | | | | this will add kaslrseed keyword to sysboot lable, when it set, it will request to genarate random number from hwrng as kaslr-seed. with this patch exlinux.conf label looks like label l0 menu testing linux /boot/vmlinuz-5.15.16-arm initrd /boot/initramfs-5.15.16-arm.img fdtdir /boot/dtbs/5.15.16-arm/ kaslrseed append root=UUID=92ae1e50-eeeb-4c5b-8939-7e1cd6cfb059 ro Tested on Khadas VIM with kernel 5.16.0-rc5-arm64, Debian 11. Signed-off-by: Zhang Ning <zhangn1985@qq.com>
* configs: sunxi: Add support for Lichee Pi NanoIcenowy Zheng2022-02-041-3/+4
| | | | | | | | | | The Lichee Pi Nano is a board based on the F1C100s. Add defconfigs for it. Signed-off-by: Icenowy Zheng <icenowy@aosc.io> Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
* tools: Pass the key blob aroundSimon Glass2022-01-262-18/+25
| | | | | | | | At present we rely on the key blob being in the global_data fdt_blob pointer. This is true in U-Boot but not with tools. For clarity, pass the parameter around. Signed-off-by: Simon Glass <sjg@chromium.org>
* tools: Tidy up argument order in fit_config_check_sig()Simon Glass2022-01-261-9/+22
| | | | | | | Put the parent node first in the parameters as this is more natural. Also add a comment to explain what is going on. Signed-off-by: Simon Glass <sjg@chromium.org>
* tools: Avoid confusion between keys and signaturesSimon Glass2022-01-261-25/+72
| | | | | | | | | | | | | We should be consistent in using the term 'signature' to describe a value added to sign something and 'key' to describe the key that can be used to verify the signature. Tidy up the code to stick to this. Add some comments to fit_config_verify_key() and its callers while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
* image-fit: Make string of algo parameter constantJan Kiszka2022-01-242-5/+5
| | | | | | | Modifications would be invalid. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* Convert CONFIG_TIMESTAMP to KconfigSimon Glass2022-01-211-0/+11
| | | | | | | This converts the following to Kconfig: CONFIG_TIMESTAMP Signed-off-by: Simon Glass <sjg@chromium.org>
* doc: replace @return by Return:Heinrich Schuchardt2022-01-1910-22/+22
| | | | | | | | | | | | Sphinx expects Return: and not @return to indicate a return value. find . -name '*.c' -exec \ sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \; find . -name '*.h' -exec \ sed -i 's/^\(\s\)\*\(\s*\)@return\(\s\)/\1*\2Return:\3/' {} \; Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
* Merge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-netTom Rini2022-01-171-0/+15
|\ | | | | | | | | | | | | - PXE label override support - Fastboot UDP configurable port - new phy driver: TI DP83869HM - and few minor fixes to dsa.
| * cmd: pxe_utils: sysboot: add label override supportAmjad Ouled-Ameur2022-01-151-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will allow consumers to choose a pxe label at runtime instead of having to prompt the user. One good use-case for this, is choosing whether or not to apply a dtbo depending on the hardware configuration. e.g: for TI's AM335x EVM, it would be convenient to apply a particular dtbo only when the J9 jumper is on PRUSS mode. To achieve this, the pxe menu should have 2 labels, one with the dtbo and the other without, then the "pxe_label_override" env variable should point to the label with the dtbo at runtime only when the jumper is on PRUSS mode. This change can be used for different use-cases and bring more flexibilty to consumers who use sysboot/pxe_utils. if "pxe_label_override" is set but does not exist in the pxe menu, the code should fallback to the default label if given, and no failure is returned but rather a warning message. Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Artem Lapkin <email2tema@gmail.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
* | LynxOS is no longer supportedThomas Huth2022-01-121-3/+0
|/ | | | | | | | | | | | LynxOS needed the do_bootm_lynxkdi() function that got removed in 7e713067ee ("Remove LYNX KDI remainders") - and that function needed a lynxkdi_boot() function, where the last implementation had been removed in 98f705c9ce ("powerpc: remove 4xx support") already. Looks like this OS is definitely not supported anymore, so remove it from the corresponding lists. Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Stefan Roese <sr@denx.de>
* Finish conversion of CONFIG_SYS_CLK_FREQ to KconfigTom Rini2021-12-271-2/+18
| | | | | | | | | | | | | | | | | In order to finish moving this symbol to Kconfig for all platforms, we need to do a few more things. First, for all platforms that define this to a function, introduce CONFIG_DYNAMIC_SYS_CLK_FREQ, similar to CONFIG_DYNAMIC_DDR_CLK_FREQ and populate clock_legacy.h. This entails also switching all users from CONFIG_SYS_CLK_FREQ to get_board_sys_clk() and updating a few preprocessor tests. With that done, all platforms that define a value here can be converted to Kconfig, and a fall-back of zero is sufficiently safe to use (and what is used today in cases where code may or may not have this available). Make sure that code which calls this function includes <clock_legacy.h> to get the prototype. Signed-off-by: Tom Rini <trini@konsulko.com>
* Convert CONFIG_SD_BOOT et al to KconfigTom Rini2021-12-271-0/+7
| | | | | | | | This converts the following to Kconfig: CONFIG_SD_BOOT CONFIG_SD_BOOT_QSPI Signed-off-by: Tom Rini <trini@konsulko.com>
* Merge tag 'v2022.01-rc4' into nextTom Rini2021-12-201-72/+67
|\ | | | | | | Prepare v2022.01-rc4
| * Revert "image: Remove #ifdefs from select_ramdisk()"Tom Rini2021-12-201-72/+67
| | | | | | | | | | | | | | | | | | | | This reverts commit f33a2c1bd0fb371511a485cac1f182ba50db51be. This causes a crash on some platforms as seen here: https://lore.kernel.org/r/f153017b-c41a-0d32-67b9-f288e695f900@baylibre.com/ Reported-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Tom Rini <trini@konsulko.com>
* | fdtgrep: Handle an empty output treeSimon Glass2021-12-171-6/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In strange cases it is possible for fdtgrep to find nothing to output. Typically this means that the resulting SPL device tree is not going to allow anything to boot, but at present the tree is actually invalid, since it only has an END tag in the struct region. The FDT spec requires at least a root node. So add a special case to include at least this, if the FDT_REG_SUPERNODES flag is set. This ensures that grepping an empty tree still produces a valid tree. Also add comments to the enum since it is not completely obvious from the names now. The typical symptom of this problem is a message from binman: pylibfdt error -11: FDT_ERR_BADSTRUCTURE Signed-off-by: Simon Glass <sjg@chromium.org>
* | Merge tag 'v2022.01-rc3' into nextTom Rini2021-11-292-5/+2
|\ \ | |/ | | | | | | | | Prepare v2022.01-rc3 Signed-off-by: Tom Rini <trini@konsulko.com>
| * image: Explicitly declare do_bdinfo()Andy Shevchenko2021-11-152-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Compiler is not happy: common/image-board.c: In function ‘boot_get_kbd’: common/image-board.c:902:17: warning: implicit declaration of function ‘do_bdinfo’ [-Wimplicit-function-declaration] 902 | do_bdinfo(NULL, 0, 0, NULL); | ^~~~~~~~~ Move the forward declaration to a header. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* | cmd: pxe_utils: Check fdtcontroladdr in label_bootPeter Hoyes2021-11-231-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If using OF_CONTROL, fdtcontroladdr is set to the fdt used to configure U-Boot. When using PXE, if no fdt is defined in the menu file, and there is no fdt at fdt_addr, add fall back on fdtcontroladdr too. We are developing board support for the Armv8r64 FVP using config_distro_bootcmd. We are also using OF_BOARD and would like the PXE boot option to default to the fdt provided by board_fdt_blob_setup. Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
* | image: fit: Fix parameter name for hash algorithmChia-Wei Wang2021-11-171-2/+2
| | | | | | | | | | | | | | | | | | Fix inconsistent function parameter name of the hash algorithm. Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com> Fixes: 92055e138f2 ("image: Drop if/elseif hash selection in calculate_hash()") Reviewed-by: Joel Stanley <joel@jms.id.au> Reviewed-by: Simon Glass <sjg@chromium.org>
* | bootm: Tidy up use of autostart env varSimon Glass2021-11-161-4/+1
|/ | | | | | | | | | | | | | | This has different semantics in different places. Go with the bootm method and put it in a common function so that the behaviour is consistent in U-Boot. Update the docs. To be clear, this changes the way that 'bootelf' and standalone boot work. Before, if autostart was set to "fred" or "YES", for example, they would consider that a "yes". This may change behaviour for some boards, but the only in-tree boards which mention autostart use "no" to disable it, which will still work. Signed-off-by: Simon Glass <sjg@chromium.org> Suggested-by: Wolfgang Denk <wd@denx.de>
* bootstage: Differentiate boot progress kconfig entriesJan Kiszka2021-11-131-1/+1
| | | | | | | | Both U-Boot proper and SPL entries were using the same description. Fixes: b55881dd ("bootstage: Add SPL support") Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* Remove LYNX KDI remaindersThomas Huth2021-11-112-26/+1
| | | | | | | | | | | | | The last board that used to set CONFIG_LYNXKDI has been removed in commit 242836a893ae ("powerpc: ppc4xx: remove pcs440ep support"), doc/README.lynxkdi only talks about a MPC8260 board being supported, and the mpc8260 support has been removed four years ago in commit 2eb48ff7a210d ("powerpc, 8260: remove support for mpc8260") already, and common/lynxkdi.c only consists of an "#error" statement these days, so it seems like the LYNX KDI code is dead code nowadays. Let's remove it now. Signed-off-by: Thomas Huth <thuth@redhat.com>
* pxe: Return the file size from the getfile() functionSimon Glass2021-11-111-27/+43
| | | | | | | | | | | | | | | | | It is pretty strange that the pxe code uses the 'filesize' environment variable find the size of a file it has just read. Partly this is because it uses the command-line interpreter to parse its request to load the file. As a first step towards unwinding this, return it directly from the getfile() function. This makes the code a bit longer, for now, but will be cleaned up in future patches. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Artem Lapkin <email2tema@gmail.com> Tested-by: Artem Lapkin <email2tema@gmail.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
* pxe: Drop get_bootfile_path()Simon Glass2021-11-111-48/+5
| | | | | | | | | | This function no longer makes sense, since it is pretty easy to prepend the boot directory to the filename. Drop it and update its only caller. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Artem Lapkin <email2tema@gmail.com> Tested-by: Artem Lapkin <email2tema@gmail.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
* pxe: Clean up the use of bootfileSimon Glass2021-11-111-22/+38
| | | | | | | | | | | | | | | | | | | The 'bootfile' environment variable is read in the bowels of pxe_util to provide a directory to which all loaded files are relative. This is not obvious from the API to PXE and it is strange to make the caller set an environment variable rather than pass this as a parameter. The code is also convoluted, which this feature implemented by get_bootfile_path(). Update the API to improve this. Unfortunately this means that pxe_setup_ctx() can fail, so add error checking. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Artem Lapkin <email2tema@gmail.com> Tested-by: Artem Lapkin <email2tema@gmail.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
* pxe: Move common parsing coding into pxe_utilSimon Glass2021-11-111-0/+20
| | | | | | | | | | Both the syslinux and pxe commands use essentially the same code to parse and run extlinux.conf files. Move this into a common function. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Artem Lapkin <email2tema@gmail.com> Tested-by: Artem Lapkin <email2tema@gmail.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
* pxe: Tidy up code style a little in pxe_utilsSimon Glass2021-11-111-53/+13
| | | | | | | | | | There are a few more blank lines than makes sense for readability. Also free() handles a NULL pointer so drop the pointless checks. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Artem Lapkin <email2tema@gmail.com> Tested-by: Artem Lapkin <email2tema@gmail.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
* pxe: Tidy up some comments in pxe_utilsSimon Glass2021-11-111-51/+138
| | | | | | | | | | Some of these functions are a big vague in the comments. Tidy them up a bit. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Artem Lapkin <email2tema@gmail.com> Tested-by: Artem Lapkin <email2tema@gmail.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
* pxe: Move pxe_utils filesSimon Glass2021-11-112-0/+1463
| | | | | | | | | | | Move the header file into the main include/ directory so we can use it from the bootmethod code. Move the C file into boot/ since it relates to booting. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Artem Lapkin <email2tema@gmail.com> Tested-by: Artem Lapkin <email2tema@gmail.com> Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
* Create a new boot/ directorySimon Glass2021-11-1119-0/+10292
Quite a lot of the code in common/relates to booting and images. Before adding more it seems like a good time to move the code into its own directory. Most files with 'boot' or 'image' in them are moved, except: - autoboot.c which relates to U-Boot automatically running a script - bootstage.c which relates to U-Boot timing Drop the removal of boot* files from the output directory, since this interfers with the symlinks created by tools and there does not appear to be any such file from my brief testing. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Artem Lapkin <email2tema@gmail.com> Tested-by: Artem Lapkin <email2tema@gmail.com>