summaryrefslogtreecommitdiff
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Merge branch 'for-next/at91'Sascha Hauer2023-01-2019-63/+68
|\ \ \
| * | | common: deep-probe: don't build without CONFIG_OFDEVICEAhmad Fatoum2023-01-121-1/+1
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have a number of drivers that can be used with and without device trees. On AT91, some non-OF enabled configurations run from on-chip SRAM, which is limited to few tens of kilobytes in size. We need to be very size-concious there and having deep_probe_is_supported() as static inline helper evaluating to false when unused makes it easy to discard code that is not needed for the non-OF case. Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230109130822.1657470-9-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | Rename struct fs_device_d to fs_deviceSascha Hauer2023-01-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the meaningless '_d' suffix. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20221214123512.189688-5-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | Rename struct driver_d to driverSascha Hauer2023-01-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The '_d' suffix was originally meant to distinguish barebox struct names from Linux struct names. struct driver doesn't exist in Linux, so we can rename it and remove the meaningless suffix. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20221214123512.189688-4-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | Rename struct device_d to deviceSascha Hauer2023-01-1018-55/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The '_d' suffix was originally introduced in case we want to import Linux struct device as a separate struct into barebox. Over time it became clear that this won't happen, instead barebox struct device_d is basically the same as Linux struct device. Rename the struct name accordingly to make porting Linux code easier. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20221214123512.189688-3-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | Rename device_d::device_node to device_d::of_nodeSascha Hauer2023-01-104-5/+5
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux struct device has the member of_node for the device_node pointer. Rename this in barebox accordingly to minimize the necessary changes when porting Linux code. This was done with the semantic patch: @@ struct device_d E; @@ - E.device_node + E.of_node @@ struct device_d *E; @@ - E->device_node + E->of_node Plus some manual adjustments. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20221214123512.189688-2-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ddr_spd: use unsigned type for crc bytes in DDR3/4 SPD checkDenis Orlov2023-01-161-10/+10
|/ | | | | | | | | | | | | | | Using signed char type for computed CRC bytes leads to them being sign extended on comparison with unsigned char values from SPD EEPROM struct. This happens as when being compared those values undergo integer promotion that converts them into ints, sign extending signed types. Having most significant byte set for any of computed CRC bytes thus results in the mismatch being erroneously detected. While at it, also remove redundant type casts. Signed-off-by: Denis Orlov <denorl2009@gmail.com> Link: https://lore.barebox.org/20230113140648.31572-1-denorl2009@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2022-12-124-8/+16
|\
| * bootsource: export bootsource_to_string()Ahmad Fatoum2022-12-092-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | bootsource_str which translates enum bootsource to a string is not exported to other parts of barebox. Define a new bootsource_to_string() that provides access. This can be useful for board code debugging prints, especially in PBL, where the $bootsource environment variable is not available. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221209072900.3769403-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * common: boards: qemu-virt: fix env path for QEMU RISC-VAhmad Fatoum2022-12-071-2/+2
| | | | | | | | | | | | | | | | | | | | At least with QEMU emulator version 7.1.0 (Debian 1:7.1+dfsg-2+b2), the flash node is no longer in /soc and is instead top-level like ARM Virt. Fix the path in the overlay accordingly. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221205133602.3016471-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * treewide: rename CONFIG_HAS_ARCH_SJLJ to CONFIG_ARCH_HAS_SJLJAhmad Fatoum2022-12-071-2/+2
| | | | | | | | | | | | | | | | | | We have 9 symbols beginning with ARCH_HAS, but only with HAS_ARCH. Change it over for symmetry. No functional change. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221205133033.3008535-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/imx7-nand-xload'Sascha Hauer2022-12-121-75/+156
|\ \
| * | imx-bbu-nand-fcb: Add fcb commandSascha Hauer2022-12-121-65/+151
| | | | | | | | | | | | | | | | | | | | | | | | The FCB on NAND has a special page layout and thus can't be read with the normal MTD driver. Add a fcb command for printing information about the installed FCB on the console. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | imx-bbu-nand-fcb: Drop ifdefferySascha Hauer2022-12-121-8/+3
| | | | | | | | | | | | | | | | | | | | | fcb_is_bch_encoded() needs cpu_is_mx6ul() and cpu_is_mx6ull(), so add stubs for them to arch-mxs to drop the #ifdef CONFIG_ARCH_IMX28. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | imx-bbu-nand-fcb: Fix reading FCB information from BCH registersSascha Hauer2022-11-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fcb->EccBlock0Size and fcb->EccBlock0EccType must be extracted from the BCH_FLASH0LAYOUT0 register, not from the BCH_FLASH0LAYOUT1 register. As we always use the same ECC block size for both the first and the subsequent blocks there's no functional change in this patch, it's only for consistency. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | fastboot: ubiformat: Fix writing sparse imagesSascha Hauer2022-11-231-1/+3
| |/ |/| | | | | | | | | | | | | | | in ubiformat_write() we may not write trailing empty areas in erase blocks as UBI assumes them to be empty and writable. This code path is used when fastboot handles sparse images. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2022-11-141-0/+9
|\ \
| * | hush: Fix handling '\ 'Sascha Hauer2022-10-271-0/+9
| |/ | | | | | | | | | | | | | | | | | | | | | | | | Currently when doing: echo foo\ bar we will get argv[1] = "foo\" and argv[2] = "bar". An unquoted escaped whitespace should be replaced by a whitespace. With this the above will correctly result in argv[1] = "foo bar" Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | restart: add reset -w for warm bootrom resetAhmad Fatoum2022-10-271-4/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently support reboot mode communication with BootROMs of the i.MX6Q/DL, i.MX8MM and STM32MP15x. For each of these, the user must take care to use the correct reset as the highest priority reset often clears the non-volatile register mapped by the syscon holding the reboot mode. As we only have one BootROM, we can improve usability by adding a global flag that describes whether a restart handler is suitable for use after a bootrom reboot mode write. Add a flag bit describing this and allow populating it from the device tree as well as from drivers. Existing i.MX/STM32 drivers will be moved onto this in follow-up commits. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221017071000.1458292-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | restart: do restart-priority OF parsing in restart_handler_registerAhmad Fatoum2022-10-271-15/+5
|/ | | | | | | | | | | | The restart-priority OF property is parsed for a number of MFDs, but there is no reason really not to parse it for every restart handler that has a device tree node like we already do for watchdogs. Add a new struct restart_handler::of_node field and look into it if populated. With this of_get_restart_priority, is no longer used, so drop it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221017071000.1458292-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* resource: fix recently broken memory bank fusingAhmad Fatoum2022-10-181-0/+1
| | | | | | | | | | | | | | | | | | barebox will fuse overlapping memory banks to avoid the common issue of the device tree being modified upstream to contain a minimum RAM size that would then conflict with a RAM size barebox determines by querying the memory controller. This was recently broken, because we changed memory banks to have IORESOURCE_MEM in their flags field, but resource_contains() used to compare regions won't return true if memory type differs. Fix this by settings .flags = IORESOURCE_MEM for the new resource as well. Reported-by: Ian Abbott <abbotti@mev.co.uk> Fixes: d0b5f6bde15b ("of: reserved-mem: reserve regions prior to mmu_initcall()") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Tested-by: Ian Abbott <abbotti@mev.co.uk> Link: https://lore.barebox.org/20221017133859.299705-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/riscv'Sascha Hauer2022-10-131-0/+5
|\
| * RISC-V: add Allwinner Sun20i D1 Nezha supportMarco Felsch2022-10-071-0/+5
| | | | | | | | | | | | | | | | Add Allwinner sun20i SoC and D1-Nezha board support. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20221005111214.148844-7-m.felsch@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/net'Sascha Hauer2022-10-131-0/+4
|\ \
| * | net: Bring up all interfaces when going interactiveSascha Hauer2022-09-221-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far we only bring up network interfaces when we actually need them. This means we could be idling in the shell for long and once the user decides to do networking he has to wait for the link to be established. We can do better: Before going interactive bring up all known network interfaces which makes the links established when the user needs them. To implement this we have to rework carrier checking a bit, because otherwise barebox would wait for the links to be established before continuing. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/misc'Sascha Hauer2022-10-1314-109/+120
|\ \ \
| * | | common: bootm: use switch-caseAhmad Fatoum2022-10-111-24/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The switch statement is more readable and lends itself to be easily extended for future file types, e.g. PE/COFF for EFI loading. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221010061122.2084009-11-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | common: bootm: factor out FIT parsing code into bootm_open_bitAhmad Fatoum2022-10-111-48/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We already have counterpart functions for ELF and uimage. Add one for FIT as well in preparation for moving to a more readable switch statement. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221010061122.2084009-10-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | lds: introduce <asm/barebox.lds.h>Ahmad Fatoum2022-10-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have a separate linker script for each architecture and one more for PBL if supported. All linker scripts include <asm-generic/barebox.lds.h>. In future, we may want to use a linker script common to more than one architecture. Prepare for this by having each architecture define a <asm/barebox.lds.h>. Currently, these files contain little more than 1-2 #include directives, but this will change in later commits. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221010061122.2084009-6-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | common: misc: remove now unused errno_strAhmad Fatoum2022-10-111-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With all errno_str() instanced removed in a previous commit, we can drop the now unused definition. New code should use printf("message: %m\n"); instead of printf("message: %s\n", errno_str()); or just use strerror(...) directly. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221010061122.2084009-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | treewide: replace errno_str() with %m printf format specifierAhmad Fatoum2022-10-116-21/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both errno_str() and printf("%m" end up calling strerror(). %m is more convenient to use, so switch over all instances to it. No functional change. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221010061122.2084009-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | block: have cdev_get_block_device accept const cdevAhmad Fatoum2022-10-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Having a non-const cdev parameter for cdev_get_block_device() limits its use as a user may want to just read struct block_device members without change. Allow this by changing parameter to be pointer to const instead. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221010061122.2084009-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | common: ubiformat: print 100 % complete message when doneAhmad Fatoum2022-10-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During formatting, current progress is printed every 300ms, e.g.: ubiformat: formatting eraseblock 1936 -- 95 % complete When formatting is done, a single new line is printed. When ubiformat is called in the fastboot workqueue, the barebox prompt won't be printed again, so the user may think that update is stuck at the last message printed. Improve user experience by explicitly printing a 100 % complete message. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221005195730.3405753-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | common: console_common: output log messages to CONSOLE_STDERRAhmad Fatoum2022-10-051-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Like U-Boot, barebox has two standard output streams: CONSOLE_STDOUT and CONSOLE_STDERR in addition to the input stream CONSOLE_STDIN. >From a consumer view, the console.active device parameter allows restricting which of these streams interact with a given console. >From a provider view, only CONSOLE_STDOUT is ever used. dputs dputc allow passing in CONSOLE_STDERR instead, but nothing in-tree does so. Change this by having all log messages (e.g. pr_debug or dev_err) go to CONSOLE_STDERR. For nearly all systems that just use the default of console.active="ioe" or "oe", there is no difference. But now systems that use either "o" or "e" can use different console devices for barebox log messages and for standard output by commands. This is especially useful to debug interactive applications like edit or for monitoring barebox debug messages during execution of payloads when barebox acts as EFI loader. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220930154145.754181-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | blspec: Use cdev_mount()Sascha Hauer2022-10-041-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In blspec we want either get the path where the cdev is mounted or mount it to the default path. That's what cdev_mount() does for us, so use it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | USB: gadget: fastboot: introduce optional flag for fastboot partitionsJohannes Zink2022-09-262-1/+14
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On some boards, some partitions exposed to fastboot may become unavailable under certain circumstances, e.g. if an SD-Card exposed to fastboot is removed. Previously, this lead to an error and the fastboot gadget did not initialize the remaining partitions exposed via fastboot, e.g. an eMMC which usually is permanently soldered on the board. This patch allows to append an optional flag 'o' to the description of a fastboot partition. If this partition is unavailable at the initialization of the fastboot gadget, said partition is skipped, while the remaining available partitions are still exposed. Signed-off-by: Johannes Zink <j.zink@pengutronix.de> Link: https://lore.barebox.org/20220922132410.2653284-1-j.zink@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/imx'Sascha Hauer2022-10-132-57/+212
|\ \ \
| * | | imx-bbu-nand-fcb: extend for i.MX7 supportJohannes Zink2022-10-052-7/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a barebox update handler for i.MX7 NAND Signed-off-by: Johannes Zink <j.zink@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Tested-by: Johannes Zink <j.zink@pengutronix.de> # innocomm S810 Link: https://lore.barebox.org/20220930121553.335796-8-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | imx-bbu-nand-fcb: add fcb_read/fcb_write function hooksSascha Hauer2022-10-051-38/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reading the FCB on i.MX7 needs special tweaks. As we already have two different variants of how the the FCB is read/written already, make function hooks from it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Tested-by: Johannes Zink <j.zink@pengutronix.de> # innocomm S810 Link: https://lore.barebox.org/20220930121553.335796-7-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | imx-bbu-nand-fcb: pass imx_handler further downSascha Hauer2022-10-051-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pass the struct bbu_handler *handler context pointer further down the road. We'll need that in the next patches. No functional change. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Tested-by: Johannes Zink <j.zink@pengutronix.de> # innocomm S810 Link: https://lore.barebox.org/20220930121553.335796-6-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | imx-bbu-nand-fcb: isolate i.MX28 specific partsJohannes Zink2022-10-051-9/+15
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | imx28_fcb_create() reads back some parameters from the BCH and GPMI unlike imx6_fcb_create() which has same parameters hardcoded. For i.MX7, we will need a mixture of both: Some values are hardcoded (albeit differently than i.MX6), while some others need be read from the BCH. In preparation for adding i.MX7 support, move common defines out of the #ifdef CONFIG_ARCH_IMX28 and prefix constants that are not applicable to i.MX6 and later with an IMX28_ prefix. No such constants are currently in use. Signed-off-by: Johannes Zink <j.zink@pengutronix.de> Tested-by: Johannes Zink <j.zink@pengutronix.de> # innocomm S810 Link: https://lore.barebox.org/20220930121553.335796-5-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | efi: add device tree configuration table supportAhmad Fatoum2022-10-133-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When running on device-tree enabled systems, barebox as EFI payload may be passed a device tree via the system table. We've no use for that just yet, but lets make it available as /efi.dtb. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221010060842.2083550-5-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | hw_random: add EFI RNG driverAhmad Fatoum2022-10-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The EFI_RNG_PROTOCOL_GUID is quite simple and as such was a good first protocol to implement for the barebox EFI loader support. We don't yet have a payload-side driver making use of it though, so add that here. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221010060842.2083550-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | block: fix calling cdev_get_block_device with partitionsAhmad Fatoum2022-10-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For partitions, cdev->priv references the parent block device. Doing the pointer arithmetic in container_of will result in an out-of-bounds access. Do what the rest of the code does and access cdev->priv instead. Fixes: 84173bf3d0cc ("block: set S_IFBLK for block devices instead of S_IFCHR") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221010063834.2110400-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | efi: payload: image: fix commandline-less bootAhmad Fatoum2022-10-101-5/+9
|/ / | | | | | | | | | | | | | | | | linux_bootargs_get() may return NULL, in that case we should avoid calling strlen on it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221010060510.2082414-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | bbu: fix exporting i.MX NAND bbu handler over fastbootAhmad Fatoum2022-09-301-19/+18
|/ | | | | | | | | | | | | | | | | handler->devicefile for i.MX NAND is nand0.barebox, which lacks a /dev/ prefix. This is ok for detection, as device_detect_by_name expects the cdev name and devpath_to_name() will strip a /dev/ if available. For stat() however, we need to add back /dev/, otherwise the file can't be found. Rework the code to do that. This fixes an issue where usbgadget -A '' -b would not export a i.MX NAND barebox update handler. Fixes: 726a802456bc ("common: bbu: only add available handlers") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220928085622.2677478-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/ratp'Sascha Hauer2022-09-142-2/+5
|\
| * ratp: i2c: Do not return errorSascha Hauer2022-09-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | The RATP command implementations should only return an error on internal failures. When an i2c command failed we should return 0 though to actually send the error message. Without it the remote would just wait for a response until it times out. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20220908093005.3035259-5-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ratp: getenv: Do not crash on non-existing variablesSascha Hauer2022-09-121-0/+3
| | | | | | | | | | | | | | | | | | getenv() returns NULL on non-existing variables. Replace result with empty string to avoid doing strlen() on a NULL pointer. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20220908093005.3035259-4-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2022-09-144-15/+84
|\ \