summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-03-02arm: mvebu: Add select on ARCH_EARLY_INIT_R if ARM64Tom Rini
We need to be calling arch_early_init_r() on 64bit mvebu platforms, so move this to a select. Cc: Stefan Roese <[email protected]> Signed-off-by: Tom Rini <[email protected]> Reviewed-by: Stefan Roese <[email protected]>
2023-03-02common/Kconfig: Reword text for BOARD_TYPESTom Rini
While it is true that for some Samsung platforms, we call get_board_type() the main usage of this CONFIG switch is to enable board_types in global data, which is then used by various platforms. Signed-off-by: Tom Rini <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-03-01Merge tag 'dm-pull-29feb23' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-dm minor sandbox fixes a37xx fix Add camel-case tool, since the conversion will take a while
2023-03-01tools: binman: minor formatting fix in docsRalph Siemsen
This should fix a rendering oddity when viewing the docs online at https://u-boot.readthedocs.io/en/latest/develop/package/binman.html Signed-off-by: Ralph Siemsen <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-03-01sandbox: fix building with CONFIG_SPL_TIMER=yHeinrich Schuchardt
Building sandbox_defconfig with CONFIG_SPL_TIMER=y results in an error include/dm/platdata.h:63:33: error: static assertion failed: "Cannot use U_BOOT_DRVINFO with of-platdata. Please use devicetree instead" Add a missing condition in the sandbox driver. Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-03-01MAINTAINERS: assign sandbox drivers to SANDBOXHeinrich Schuchardt
Drivers should have a maintainer. Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-03-01sandbox: allow building sandbox_spl with CONFIG_DEBUGHeinrich Schuchardt
Building sandbox_spl with CONFIG_DEBUG leads to errors due to missing symbols: /usr/bin/ld: common/spl/spl_fit.o: in function `spl_fit_upload_fpga': common/spl/spl_fit.c:595: undefined reference to `fpga_load' /usr/bin/ld: test/test-main.o: in function `dm_test_post_run': test/test-main.c:124: undefined reference to `crc8' /usr/bin/ld: test/test-main.o: in function `dm_test_pre_run': test/test-main.c:95: undefined reference to `crc8' collect2: error: ld returned 1 exit status This is due to -Og not eliminating unused functions. Add FPGA and CRC8 support to the defconfig. Sandbox tests for SPL_FPGA and CRC8 should be created. So enabling these setting is advised anyway. Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-03-01arm64: a37xx: pinctrl: probe after bindingRobert Marko
Currently, pinctrl drivers are getting probed during post-bind, however that is being reverted, and on A37XX pinctrl driver is the one that registers the GPIO driver during the probe. So, if the pinctrl driver doesn't get probed GPIO-s won't get registered and thus they cannot be used. This is a problem on the Methode eDPU as it just uses SB pins as GPIO-s and without them being registered networking won't work as it only has one SFP slot and the TX disable GPIO is on the SB controller. So, lets just add a flag only to A37XX driver to probe after binding in order for the GPIO driver to always get registered. Signed-off-by: Robert Marko <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-03-01sandbox: Correctly define BITS_PER_LONGMichal Suchanek
SANDBOX_BITS_PER_LONG is the number of bits in long on the sandbox platform. Signed-off-by: Michal Suchanek <[email protected]>
2023-03-01RFC: tools: Add a camel-case conversion scriptSimon Glass
This is only for posterity, since once the conversion is done, the script is of no use. Signed-off-by: Simon Glass <[email protected]>
2023-03-01Merge branch 'next' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-marvell into next - mvebu: Various fixes in SPL / kwboot / kwbimage (Pali)
2023-03-01Merge tag 'u-boot-at91-fixes-2023.04-a' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-at91 First set of u-boot-at91 fixes for the 2023.04 cycle: This fixes set include one clock index fix for sama7g5 and two board configuration alignments for pm9g45.
2023-03-01doc/kwboot.1: Update example descriptionPali Rohár
Mention fact about changing baudrate back when -B is used. Signed-off-by: Pali Rohár <[email protected]>
2023-03-01arm: mvebu: Define SPL memory mapsPali Rohár
In SPL are active memory maps set by the BootROM. Define them in cpu.h file to the correct values. Some peripherals are not mapped at all. Signed-off-by: Pali Rohár <[email protected]>
2023-03-01arm: mvebu: Define env_sf_get_env_addr() also for Proper U-BootPali Rohár
Proper U-Boot moves SPI0 CS0 Flash mapping from 0xD4000000 to 0xF4000000 and change its size from 64 MB to 8 MB. Definitions are already in MBUS_SPI_BASE/MBUS_SPI_SIZE macros. So define these macros also for SPL build, use them in env_sf_get_env_addr() function and move this function from spl.c to cpu.c to be available in Proper U-Boot too. Signed-off-by: Pali Rohár <[email protected]>
2023-03-01arm: mvebu: Fix comment about CPU_ATTR_BOOTROM mappingPali Rohár
Signed-off-by: Pali Rohár <[email protected]>
2023-03-01arm: mvebu: Remove A39x relictsPali Rohár
Signed-off-by: Pali Rohár <[email protected]>
2023-03-01arm: mvebu: clearfog: Add defconfig for SATA bootingPali Rohár
This new clearfog_sata_defconfig file is copy of existing clearfog_defconfig file and changed to instruct build system to generate final kwbimage for SATA booting. This change is more readable via git option --find-copies-harder. Signed-off-by: Pali Rohár <[email protected]>
2023-03-01arm: mvebu: db-88f6820-amc: Add defconfig for NAND bootingPali Rohár
This new db-88f6820-amc_nand_defconfig file is copy of existing db-88f6820-amc_defconfig file and changed to instruct build system to generate final kwbimage for NAND booting. It was done by adding options: CONFIG_MVEBU_SPL_BOOT_DEVICE_NAND=y CONFIG_MVEBU_SPL_NAND_BADBLK_LOCATION=0x00 CONFIG_SYS_NAND_BLOCK_SIZE=0x40000 CONFIG_SYS_NAND_PAGE_SIZE=0x1000 Board has Micron MT29F8G08ABACAWP chip which is SLC NAND with 4kB page size and block size of 64 pages. This change was only compile-tested and is useful for CI testing that mkimage can generate valid kwbimage of NAND type. This change is more readable via git option --find-copies-harder. Signed-off-by: Pali Rohár <[email protected]>
2023-03-01arm: mvebu: Fix description of MVEBU_SPL_BOOT_DEVICE_(SPI|MMC) optionsPali Rohár
MVEBU_SPL_BOOT_DEVICE_SPI is for NOR flash. Either serial or parallel. Not for general serial/SPI devices. The correct name should be BOOT_DEVICE_NOR but name SPI is already used in mkimage config format which we do not want to change for compatibility reasons. MVEBU_SPL_BOOT_DEVICE_MMC is for MMC and SD compatible devices. Not for SDIO devices. In most cases used for eMMC or SD card. Signed-off-by: Pali Rohár <[email protected]>
2023-03-01arm: mvebu: Add support for generating PEX kwbimagePali Rohár
Add a new Kconfig option CONFIG_MVEBU_SPL_BOOT_DEVICE_PEX which instruct make to generate kwbimage with PEX header. This image is used for booting from PCI Express device which is in the Root Complex mode. Support is very simple, SPL after finishes DDR training returns back to the BootROM (via CONFIG_SPL_BOOTROM_SUPPORT option) and BootROM then start executing U-Boot proper. Signed-off-by: Pali Rohár <[email protected]>
2023-03-01arm: mvebu: Add support for generating NAND kwbimagePali Rohár
Add a new Kconfig option CONFIG_MVEBU_SPL_BOOT_DEVICE_NAND which instruct make to generate kwbimage with NAND header. This image is used for booting from NAND flash (either SPI or parallel). Support is very simple, SPL after finishes DDR training returns back to the BootROM (via CONFIG_SPL_BOOTROM_SUPPORT option) and BootROM then loads and executes U-Boot proper. To generate correct kwbimage NAND header, it is required to set following Kconfig options: CONFIG_SYS_NAND_PAGE_SIZE CONFIG_SYS_NAND_BLOCK_SIZE CONFIG_MVEBU_SPL_NAND_BADBLK_LOCATION They are used only by make / mkimage when generating final kwbimage. CONFIG_MVEBU_SPL_NAND_BADBLK_LOCATION is a new mvebu specific Kconfig option which is set into kwbimage NAND_BADBLK_LOCATION header field. Signed-off-by: Pali Rohár <[email protected]>
2023-03-01tools: kwbimage: Add support for creating an image with no dataPali Rohár
This change add support for mkimage's -s option to kwbimage format. It will create an kwbimage with empty data part of image (data part would contain only required 32-bit checksum). mkimage's -s option is indicated by skipcpy flag and it is basically in conflict with mkimage's -d (datafile) option. "Empty" kwbimage with no data can still contain headers. For example it can contain binary executable header which is copied by BootROM into L2SRAM. This is useful for example for small images which can do not require DDR RAM and can be run in L2SRAM (which do not require any initialization). Signed-off-by: Pali Rohár <[email protected]>
2023-03-01tools: mkimage: Do not try to open datafile when it is skippedPali Rohár
When mkimage was instructed to skip datafile via option -s then do not try to validate or open datafile as it does not have to exist or to be specified via -d option. This change allows to use -s option for skipping datafile when -d option for datafile was not specified. Signed-off-by: Pali Rohár <[email protected]>
2023-03-01tools: mkimage: Print human readable error when -d is not specifiedPali Rohár
When asking mkimage to create a new image file and option -d is not specified then mkimage show human unfriendly error message: mkimage: Can't open (null): Bad address Without debugger it is hard to debug what is the issue. Function open() is being called with file name set to NULL. So add a check for this and if it happens then show human readable message that option -d was not specified. Signed-off-by: Pali Rohár <[email protected]>
2023-03-01tools: kwbimage: Add support for XIP SPI/NOR imagesPali Rohár
Marvell BootROM can execute SPI images directly from NOR (either SPI/serial or parallel) without copying them to DDR RAM. This is know at XIP - execute in place. To achieve that, destination address in kwbimage must be set to 0xFFFFFFFF and execute address to the offset in bytes from the beginning of NOR memory. Kirkwood and Dove which use kwbimage v0 format and have SPI address space mapped to physical memory at 0xE8000000-0xEFFFFFFF by BootROM. Armada SoCs use kwbimage v1 format and have SPI address space mapped to physical memory at 0xD4000000-0xD7FFFFFF and Device bus address space (used for parallel NOR) at 0xD8000000-0xDFFFFFFF. Add support for generating XIP kwbimages by mkimage -x flag and mark xflag as valid option in kwbimage.c. Signed-off-by: Pali Rohár <[email protected]>
2023-03-01tools: mkimage: Do not fill legacy_img_hdr for non-legacy XIP imagesPali Rohár
Skip filling legacy_img_hdr structure for XIP images which do not use legacy_img_hdr structure header. Adding unwanted header to other image formats, like kwbimage cause generation of broken image. Signed-off-by: Pali Rohár <[email protected]>
2023-03-01tools: kwbimage: Fix invalid secure boot header signaturePali Rohár
Secure boot header signature is calculated from the image header with zeroed header checksum. Calculation is done in add_secure_header_v1() function. So after calling this function no header member except main_hdr->checksum can be modified. Commit 2b0980c24027 ("tools: kwbimage: Fill the real header size into the main header") broke this requirement as final header size started to be filled into main_hdr->headersz_* members after the add_secure_header_v1() call. Fix this issue by following steps: - Split header size and image data offset into two variables (headersz and *dataoff). - Change image_headersz_v0() and add_binary_header_v1() functions to return real (unaligned) header size instead of image data offset. - On every place use correct variable (headersz or *dataoff) After these steps variable headersz is correctly filled into the main_hdr->headersz_* members and so overwriting them in the end of the image_create_v1() function is not needed anymore. Remove those overwriting which effectively reverts changes in problematic commit without affecting value in main_hdr->headersz_* members and makes secure boot header signature valid again. Fixes: 2b0980c24027 ("tools: kwbimage: Fill the real header size into the main header") Signed-off-by: Pali Rohár <[email protected]>
2023-03-01tools: kwbimage: Fix generating secure boot data image signaturePali Rohár
Secure boot data image signature is calculated from the data image without trailing 4-bit checksum. Commit 37cb9c15d70d ("tools: kwbimage: Simplify aligning and calculating checksum") unintentionally broke this calculation when it increased payloadsz variable by 4 bytes which was propagated also into the add_secure_header_v1() function. Fix this issue by decreasing size of buffer by 4 bytes from which is calculated secure boot data image signature. Fixes: 37cb9c15d70d ("tools: kwbimage: Simplify aligning and calculating checksum") Signed-off-by: Pali Rohár <[email protected]>
2023-03-01tools: kwbimage: Rename imagesz to dataoffPali Rohár
Variable imagesz in functions image_create_v0(), image_create_v1() and kwbimage_set_header() stores offset to data from the beginning of the main header. So it is not image size. Signed-off-by: Pali Rohár <[email protected]>
2023-03-01tools: kwbimage: Simplify add_secure_header_v1()Pali Rohár
To make add_secure_header_v1() function more readable, call it directly with arguments: header pointer with header size and data image pointer with data image size. No functional change. Signed-off-by: Pali Rohár <[email protected]>
2023-03-01tools: kwbimage: Print image data offset when printing kwbimage headerPali Rohár
For all images except SATA is data offset in bytes. For SATA it is in LBA format (number of sectors). This is how Marvell BootROM interprets it. Signed-off-by: Pali Rohár <[email protected]>
2023-03-01tools: kwbimage: Print binary image offset as sizePali Rohár
Use for it pretty print function: genimg_print_size(). This makes it more human readable, like other offset and sizes printed by this tool. Signed-off-by: Pali Rohár <[email protected]>
2023-03-01tools: kwbimage: Add support for dumping NAND_BLKSZ for v0 imagesPali Rohár
In Dove functional specification, which use kwbimage v0, is also defined nand block size field. So dump NAND_BLKSZ also for v0 images. In Kirkwood functional specification, which also use kwbimage v0, this field is not defined. So when it is zero and Kirkwood is detected, do not dump it. Fixes: f76ae2571fe0 ("tools: kwbimage: Add support for dumping extended and binary v0 headers") Signed-off-by: Pali Rohár <[email protected]>
2023-03-01tools: kwbimage: Reject mkimage -F optionPali Rohár
mkimage -F option (re-sign existing FIT image) signaled by fflag is not supported by kwbimage. So mark its usage as invalid parameter. Signed-off-by: Pali Rohár <[email protected]>
2023-03-01tools: kwbimage: Fix endianity when printing kwbimage headerPali Rohár
All fields in kwbimage header are in little endian format. Signed-off-by: Pali Rohár <[email protected]>
2023-03-01tools: kwbimage: Fix generating of kwbimage v0 header checksumPali Rohár
Checksum for v0 image must be generated after filling all fields in the main header. Otherwise it would be invalid. Exactly same problem for v1 images was already fixed in the past in commit 9203c73895ab ("tools: kwbimage: Fix checksum calculation for v1 images"). Fixes: 5c61710c9880 ("tools: kwbimage: Properly set srcaddr in kwbimage v0") Signed-off-by: Pali Rohár <[email protected]>
2023-03-01tools: kwbimage: Fix dumping NAND_BLKSZPali Rohár
kwbimage nandblocksize field is in 64 kB unit, but NAND_BLKSZ command expects it in bytes. So do required unit conversion. Also zero value in nandblocksize field has special meaning. When this field is set to zero, the default block size is used. This default size is defined by the NAND flash page size (16 KB for a 512B page or small page NAND and 64 KB for a large page NAND flash). Fixes: 1a8e6b63e24f ("tools: kwbimage: Dump kwbimage config file on '-p -1' option") Signed-off-by: Pali Rohár <[email protected]>
2023-03-01tools: kwbimage: Fix dumping NAND_BADBLK_LOCATIONPali Rohár
Value 0x0 for NAND_BADBLK_LOCATION/nandbadblklocation means that BBI is on the first or second page and value 0x1 means that BBI is on the last page. This indicates also NAND Flash Technology, value 0x0 is SLC NAND and value 0x1 is MLC NAND. Therefore we need to dump NAND_BADBLK_LOCATION also when it is zero. Note that in v0 images, nandbadblklocation field overlaps with ddrinitdelay field in one union. ddrinitdelay is used in Kirkwood and nandbadblklocation is used in Dove. For Dove images is_v0_ext should be set, so use it to distinguish if nandbadblklocation is available or not. In v1 images there is always nandbadblklocation field. Fixes: 1a8e6b63e24f ("tools: kwbimage: Dump kwbimage config file on '-p -1' option") Signed-off-by: Pali Rohár <[email protected]>
2023-03-01tools: kwbimage: Fix endianity when dumping NAND_PAGE_SIZEPali Rohár
Fixes: 1a8e6b63e24f ("tools: kwbimage: Dump kwbimage config file on '-p -1' option") Signed-off-by: Pali Rohár <[email protected]>
2023-03-01tools: kwbimage: Fix dumping register set / DATA commandsPali Rohár
Upper-bound for iterating for-loop over register set entries is incorrect. Fix it byt calculating correct number of entries. And fix also dumping the last entry DATA_DELAY, which is the last and not first (zero). Fixes: 1a8e6b63e24f ("tools: kwbimage: Dump kwbimage config file on '-p -1' option") Signed-off-by: Pali Rohár <[email protected]>
2023-03-01cmd: mvebu/bubt: Enable command by defaultPali Rohár
This makes updating of u-boot/firmware on Marvell boards easier. Signed-off-by: Pali Rohár <[email protected]>
2023-03-01cmd: mvebu/bubt: Fix warnings: unused variable 'secure_mode' and ↵Pali Rohár
'fuse_read_u64' defined but not used 'secure_mode' and 'fuse_read_u64' are used only on A38x and A37xx. Fixes: f7b0bbca2b62 ("cmd: mvebu/bubt: Check for A38x/A37xx OTP secure bits and secure boot") Signed-off-by: Pali Rohár <[email protected]>
2023-03-01cmd: mvebu/bubt: Better guess default MVEBU_*_BOOT optionPali Rohár
For 32-bit Armada boards which use SPL we can determinate boot device from existing MVEBU_SPL_BOOT_DEVICE_* option. For all other boards (e.g. 64-bit Armada) default option still needs to be set manually. Signed-off-by: Pali Rohár <[email protected]>
2023-03-01cmd: mvebu/bubt: Set correct default image name for 32-bit Armada SoCsPali Rohár
32-bit Armada SoCs uses u-boot binary packed in kwbimage format. Name of the image is in CONFIG_BUILD_TARGET option. So use it as a default option in Kconfig. Signed-off-by: Pali Rohár <[email protected]>
2023-03-01cmd: mvebu/bubt: Check also A8K boot image checksumPali Rohár
Signed-off-by: Pali Rohár <[email protected]>
2023-03-01cmd: mvebu/bubt: Do not modify image in A8K check_image_header()Pali Rohár
Change checksum verification code so it does require to modify image. Signed-off-by: Pali Rohár <[email protected]>
2023-03-01cmd: mvebu/bubt: Mark all local symbols as staticPali Rohár
There is no need to export these local functions and structures. Signed-off-by: Pali Rohár <[email protected]>
2023-03-01cmd: mvebu/bubt: Rename variable image_size to hdr_sizePali Rohár
Variable image_size contains size of the header, not size of the whole image. Rename this variable to reflect content. Signed-off-by: Pali Rohár <[email protected]>
2023-03-01cmd: mvebu/bubt: Add support for reading image from the SATA disk partitionPali Rohár
This change allows to load boot image from the first SATA/SCSI device partition and burn it to board boot location (e.g. SPI-NOR). This is particularly when storage device is not handled by U-Boot as USB mass storage (which is already supported by bubt) but as SATA/SCSI device. Signed-off-by: Pali Rohár <[email protected]>