summaryrefslogtreecommitdiffstats
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* ARM: rpi: add debug_ll support for Raspberry Pi 4Ahmad Fatoum2022-06-171-0/+7
| | | | | | | | | | | The mini uart (Pins 8/10) is the primary UART on the Raspberry Pi 4 and can be set up in firmware by specifying enable_uart=1 in the config.txt. Add a DEBUG_LL implementation to use this for early debugging. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220609055922.667016-20-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* tlsf: fix internal overflow trying to allocate big buffersAhmad Fatoum2022-05-241-3/+16
| | | | | | | | | | | | | | | | The function adjust_request_size() has an unhandled failure mode: If aligning a buffer up overflows SIZE_MAX, it will compute a way to short buffer instead of propagating an error. Fix this by returning 0 in this case and checking for 0 whereever the function is called. 0 is a safe choice for an error code, because the function returns at least block_size_min on success and 0 was already an error code (that was just never handled). Reported-by: Jonas Martin <j.martin@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220523062756.774153-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/rsa'Sascha Hauer2022-05-191-30/+21
|\
| * fit: try other keys as fallbackSascha Hauer2022-05-041-14/+22
| | | | | | | | | | | | | | | | | | So far the rsa key and the image signature must have a matching key-name-hint. Relax that by trying other available keys when the key-name-hints don't match or when the matching key can't verify the signature. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * rsa: Collect keys on listSascha Hauer2022-05-041-21/+4
| | | | | | | | | | | | | | | | Currently there is no way to iterate over all available RSA keys. This patch collects all keys on a list so we can add an iterator in the next step. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | of: add generic of_prepend_machine_compatible()Oleksij Rempel2022-05-052-0/+59
| | | | | | | | | | | | | | | | Add generic function to extend/fixup machine compatible. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.barebox.org/20220503091220.3871612-4-o.rempel@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | common: add $global.serial_number with device tree fixupAhmad Fatoum2022-05-052-0/+21
|/ | | | | | | | | | | This new variable can be set by boards from C code or from the environment to change the serial number fixed up into the kernel device tree. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.barebox.org/20220503091220.3871612-2-o.rempel@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2022-04-211-2/+2
|\
| * partitions: efi: print GPT offset in debug messageAhmad Fatoum2022-03-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | This debug message is printed for the alternative GPT header as well, which may not exist at that location, because the medium has a different length than what's in the GPT header. Make it easier to differentiate, whether the message refers to the primary or alternate GPT header by printing the LBA the header was expected at. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20220319072427.1310855-1-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | usb: gadget: don't register UMS with empty functionAhmad Fatoum2022-03-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | system_partitions_get clones the system partitions and passes it along. DFU and Fastboot use system partitions as a fallback and pass along a NULL file list if they are empty. This enables e.g. usbgadget -A '' to work: No files are expored, but fastboot OEM commands are possible. USB mass storage though does pass along an empty system partitions file list instead of NULL, which leads to bind failure, because UMS gadget refuses to bind with no LUNs. Detect this case. Fixes: 57313f83e83e ("usbgadget: add support for USB mass storage gadget") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220319110246.2850396-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | usb: gadget: implement and use system_partitions_get_nullAhmad Fatoum2022-03-282-6/+2
|/ | | | | | | | | | | | | system_partitions_get() clones the system partitions file list and returns the copy. usb multi gadget code expects disabled gadgets to have a NULL file list, not an empty one, so fastboot and DFU handle this case. Add a new system_partitions_get_null helper that can be used instead. This will be used for USB mass storage gadget as well in a follow-up commit. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220319110246.2850396-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/stm32'Sascha Hauer2022-03-141-0/+4
|\
| * filetype: detect TF-A Firmware Image Packages (FIP)Ahmad Fatoum2022-02-231-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | FIP is the new format for firmware loaded by ARM Trusted Firmware. It can contain non-secure firmware, hardware config (device tree), firmware config (configuration DT) and optionally OP-TEE. In future, we may want to mount FIP to chain boot barebox out of it, but for now, just let barebox filetype detect it correctly. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220220124736.3052502-6-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | of: rename of_find_node_by_name() to of_find_node_by_name_address()Sascha Hauer2022-03-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | of_find_node_by_name() has the same name as the corresponding kernel function but a different semantics. A node name is comprised of the nodes name and a unit address, separated with '@'. Linux of_find_node_by_name() matches only the name before the '@' whereas the barebox function compares the full name. As several callers depend on the barebox semantics we can't just change the semantics, so rename the barebox function to of_find_node_by_name_address(). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | bootm: add missing space in error messageAhmad Fatoum2022-03-021-1/+1
| | | | | | | | | | | | | | | | | | There is no space between the "at" and the hex base address currently. Fix the formatting. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220301092024.3368293-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts: bareboximd: Fix -c optionSascha Hauer2022-02-281-2/+5
|/ | | | | | | | | | | | | | | | | Using mmap in read_file doesn't work when the same file is written afterwards with write_file. This problem was fixed in 738601e125 ("scripts/common: fix write_file when opened with mmap"). Using mmap in read_file was removed in 07b87a0908 ("scripts/common: Do not mmap in read_file_2()") but then re-introduced for bareboximd in 013e8ea757 ("scripts: bareboximd: Use mmap when possible"). I'll put my brown paper bag on for this :( This patch fixes the issue by explicitly avoiding mmap when the file is written later as done with the -c option to bareboximd Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reported-by: Andrej Picej <andrej.picej@norik.com> Tested-by: Andrej Picej <andrej.picej@norik.com>
* Merge branch 'for-next/state'Sascha Hauer2022-02-181-1/+19
|\
| * state: add deep probe aware helpers to get stateAhmad Fatoum2022-02-071-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | state_by_name itself can't be made deep probe aware as it doesn't have enough information on what to probe. Board code calling it must instead itself ensure that the state has been proved (either via initcall ordering or by calling e.g. of_ensure_probed_by_alias). For state_by_node we can do it better: We can ensure probe of the supplied device node. For most purposes, users just want to probe the default state. This can now be done with state_by_alias("state"). Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220202111932.1227416-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/qoi'Sascha Hauer2022-02-181-0/+3
|\ \
| * | filetype: Add QOI format image typeJules Maselbas2022-01-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | QOI image format is a "Quite OK" image format, it's simplicity is it's strengh and could be a good replacement of bmp, maybe even for png. Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu> Link: https://lore.barebox.org/20220117230235.13549-2-jmaselbas@kalray.eu Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/misc'Sascha Hauer2022-02-182-1/+17
|\ \ \
| * | | imd: add optional endianness= parameter for bi-endian systemsAntony Pavlov2022-02-112-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MIPS architecture supports both little- and big-endian modes. It's handy to have means to determine endianness of barebox image. This patch adds necessary record into imd block. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Link: https://lore.barebox.org/20220210134639.341801-1-antonynpavlov@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | crypto: consistently name the algo digest symbols HAVE_DIGEST_...Uwe Kleine-König2022-02-101-1/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | The better naming prevents confusion (for me at least) because MACHINE_ID depends on a symbol that cannot be enabled manually. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.barebox.org/20220209095924.x7p4wo47thxbeih5@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/efi'Sascha Hauer2022-02-187-7/+14
|\ \ \
| * | | efi: probe devices from the device-treeMichael Olbrich2022-02-081-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The state device-tree may contain devices. For example block devices with a 'barebox,storage-by-uuid' compatible. Probing is necessary to ensure that those devices are available. Call barebox_register_of() instead of of_set_root_node(). It probes the devices after setting the root node. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | rename cdev_open() -> cdev_open_by_name()Sascha Hauer2022-02-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The cdev_* functions normally take a struct cdev * argument, with the exception of cdev_open(). Rename cdev_open() to cdev_open_by_name() to be able to implement cdev_open() with the expected semantics in the next step. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220207094953.949868-3-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | cdev: add diskuuid supportMichael Olbrich2022-02-082-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows identifying disks by UUID. For disks with GPT the disk GUID is used. For DOS partition tables the NT signature ist used, similar to how the partuuid is generated. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Link: https://lore.barebox.org/20220124100458.2924679-3-m.olbrich@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20220207094953.949868-2-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | cdev: rename partuuid to uuidMichael Olbrich2022-02-083-5/+5
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | Partitions are not the only devices that can have UUIDs. Change the name to something more generic to prepare for other users. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Link: https://lore.barebox.org/20220124100458.2924679-2-m.olbrich@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20220207094953.949868-1-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / | scripts: bareboximd: Use mmap when possibleSascha Hauer2022-02-111-1/+6
|/ / | | | | | | | | | | | | | | | | Using mmap() in read_file_2 was dropped in the last patch, bring it back in a bareboximd specific function here. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20220211094230.1807262-2-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / dos-partitions: Fix extended partitionsSascha Hauer2022-01-251-0/+2
|/ | | | | | | | | | | | | extended partitions are currently registered with their full size which means they overlap with the logical partitions therein. Since 7f9f45b9bf ("devfs: Do not create overlapping partitions") we no longer register overlapping partitions, so the logical partitions are no longer accessible. Fix this by reducing the size of the extended partition to two blocks (1kiB) which is the same as Linux does. Fixes: 7f9f45b9bf ("devfs: Do not create overlapping partitions") Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reported-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
* Merge branch 'for-next/spdx'Sascha Hauer2022-01-1923-2/+46
|\
| * treewide: add SPDX-License-Identifier for files without explicit licenseAhmad Fatoum2022-01-0515-1/+30
| | | | | | | | | | | | | | | | | | Record GPL-2.0-only as license for all files lacking an explicit license statement. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220103120539.1730644-12-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * treewide: add SPDX-License-Identifier for .gitignoreAhmad Fatoum2022-01-051-0/+2
| | | | | | | | | | | | | | | | | | Makes the files not appear when searching for files that lack SPDX-License-Identifier. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220103120539.1730644-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * treewide: add SPDX-License-Identifier for Kbuild/KconfigAhmad Fatoum2022-01-057-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To verify only Kconfig/Makefile is touched: git show --numstat --format=oneline HEAD | grep -v 'Kconfig\|Makefile' will print only arch/powerpc/Kbuild. To verify nothing unexpected is added: git show -U0 | grep '^-[^-]\|^+[^+]' | sort -u Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220103120539.1730644-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/riscv'Sascha Hauer2022-01-191-0/+21
|\ \
| * | RISC-V: add stacktrace support via frame pointer walkingAhmad Fatoum2022-01-121-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | Make debugging more convenient by implementing stack_dump() and changing exception handlers to print stack trace along with the register dump. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220108171524.587144-8-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | RISC-V: virt: riscvemu: add HTIF DEBUG_LL supportAhmad Fatoum2022-01-121-0/+9
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | Default console of riscvemu is available Virt I/O console and as a HTIF blocking character device. We already support Virt I/O console, but the HTIF is easier to support for very early low level debugging. Add DEBUG_LL support to facilitate using it. Note: when using a framebuffer, riscvemu doesn't allocate a default console, so barebox calling into HTIF will segfault the emulator. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220108171524.587144-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2022-01-195-19/+50
|\ \
| * | ARM64: rockchip: add config symbol for ARMv8-based rk3399 SoCAhmad Fatoum2022-01-171-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | As preperation for adding support for the RK3399-based Radxa Rock Pi N10, define the ARCH_RK3399 config symbol and associated boilerplate. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20220114083825.726347-2-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | driver: have CONFIG_DEBUG_PROBES report device unbind as wellAhmad Fatoum2022-01-141-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | This aligns it with DEBUG_INITCALLS, which also traces exitcalls. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220113160414.3943151-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | commands: add new tutorial commandAhmad Fatoum2022-01-131-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have a web demo at http://barebox.org/jsbarebox and it would be nice to have a tutorial there. Add a new tutorial command that cycles through a number of tips. Tutorial will follow later. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220108171555.588426-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | state: make first boot with uninitialized legacy state less verboseAhmad Fatoum2022-01-102-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With non-legacy state, barebox checks a header for a specific magic signature. This can be all zero on an uninitialized state, so in that particular case, bump down the log message severity. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20211129072235.2016324-1-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | common: boards: qemu-virt: fix dtc warningAhmad Fatoum2022-01-101-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DTC complains about a Warning (chosen_node_is_root): /fragment@1/__overlay__/chosen: chosen node must be at root node As /chosen is already available in the device tree of all of: - ARM 32-Bit QEMU Virt - ARM 64-Bit QEMU Virt - RISC-V 32-Bit QEMU Virt - RISC-V 64-Bit QEMU Virt Just reference that in a new fragment to silence the warning. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220108171356.586099-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | common: elf: add elf_load_binaryClement Leger2022-01-181-22/+61
| |/ |/| | | | | | | | | | | | | | | | | In order to load elf from a binary buffer, add elf_load_binary. This will be used by FIT support to allow loading an elf from FIT. Signed-off-by: Clement Leger <clement.leger@bootlin.com> Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu> Link: https://lore.barebox.org/20220117221917.26970-5-jmaselbas@kalray.eu Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | imx-bbu-nand-fcb: suppress compiler warning about uninitialized useAhmad Fatoum2022-01-051-1/+1
|/ | | | | | | | | | | | fw_orig_len is selectively initialized in read_firmware_all. In case it's left uninitialized, fw_orig will keep it's initial value of NULL. fw_orig is checked before fw_orig_len use, so there is no use of an uninitialized variable in practice, but GCC 11.1.1 warns about it anyway. Give it an initial value of 0 to silence the warning. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220103115718.1723730-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2021-12-1513-19/+235
|\
| * RISC-V: qemu-virt: add overlay for environment and stateAhmad Fatoum2021-12-073-0/+9
| | | | | | | | | | | | | | | | | | Like we do on ARM, let's add state and environment to RISC-V QEMU Virt as well. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211125161042.3829996-8-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * common: boards: qemu-virt: genericize to support non-ARM architecturesAhmad Fatoum2021-12-072-7/+26
| | | | | | | | | | | | | | | | | | In preparation for extending support to RISC-V, sprinkle around some preprocessor directives. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211125161042.3829996-7-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: qemu: move board code to central locationAhmad Fatoum2021-12-077-0/+163
| | | | | | | | | | | | | | | | | | | | | | The state/environment overlay applied on top of QEMU is applicable to other virt platforms as well, like RISC-V. In preparation for sharing code across architectures, add a new common/boards and move the board code there. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211125161042.3829996-6-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * state: make first boot less verboseAhmad Fatoum2021-12-073-7/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First boot with uninitialized state is needlessly verbose: state: New state registered 'state' state: Detected old on-storage format ERROR: state: Error, invalid header crc in raw format, calculated 0x7bd5c66f, found 0x00000000 state: Ignoring broken bucket 0@0x00000000... state: Detected old on-storage format ERROR: state: Error, invalid header crc in raw format, calculated 0x7bd5c66f, found 0x00000000 state: Ignoring broken bucket 1@0x00040000... state: Detected old on-storage format ERROR: state: Error, invalid header crc in raw format, calculated 0x7bd5c66f, found 0x00000000 state: Ignoring broken bucket 2@0x00080000... ERROR: state: Failed to find any valid state copy in any bucket ERROR: state: Failed to read state with format raw, -2 This has confused barebox-state novices more than once. Let's handle the zeroed state case specially and reduce output in that case, so it now looks like this: state: New state registered 'state' state: Detected old on-storage format state: Detected old on-storage format state: Detected old on-storage format state state.of: Fresh state detected, continuing with defaults This is only the output when CRC is zero (hinting at zeroed state partition). If crc != zero, then output is a little more verbose than before: state: New state registered 'state' state: Detected old on-storage format ERROR: state: init error: Invalid argument: header crc in raw format, calculated 0x7bd5c66f, found 0x00000000 state: Ignoring broken bucket 0@0x00000000... state: Detected old on-storage format ERROR: state: init error: Invalid argument: header crc in raw format, calculated 0x7bd5c66f, found 0x00000000 state: Ignoring broken bucket 1@0x00040000... state: Detected old on-storage format ERROR: state: init error: Invalid argument: header crc in raw format, calculated 0x7bd5c66f, found 0x00000000 state: Ignoring broken bucket 2@0x00080000... ERROR: state: init error: No such file or directory: no valid state copy in any bucket ERROR: state: init error: No such file or directory: format raw read failed WARNING: state state.of: Failed to load persistent state, continuing with defaults, -2 Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211125161042.3829996-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>