summaryrefslogtreecommitdiff
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* block: refuse registering block devices with absurdly large blocksAhmad Fatoum2023-05-081-0/+5
| | | | | | | | | | | Block layer caching can't work if a block is bigger than BUFSIZE which is used for the caching chunks. Instead of ending up with a rdbufsize of 0, which leads to strange errors on device access, just refuse this outright. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230508074612.3313870-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/usb'Sascha Hauer2023-04-191-3/+3
|\
| * usb: move include files to place where Linux has themSascha Hauer2023-03-201-3/+3
| | | | | | | | | | | | | | | | | | For easier patch merging and comparison with Linux move the usb gadget files to where Linux has them. For now do a plain git mv include/usb include/linux/usb, eventhough there might be some files which are purely barebox specific. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2023-04-192-0/+34
|\ \
| * | common: state: make barebox-state enabling in Kconfig easierAhmad Fatoum2023-04-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CONFIG_STATE only enables the framework, but practically all users interact with the framework via the device tree binding, which has a separate symbol. Make barebox state enabling easier by automatically enabling STATE_DRV and CMD_STATE if possible when STATE itself is enabled. They can still be disabled for configurations that don't need them. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230331143130.1903540-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | firmware: Add request/release_firmware() callsPhilipp Zabel2023-04-051-0/+32
| |/ | | | | | | | | | | | | | | | | | | | | Add request_firmware() and release_firmware() calls that allow drivers to load a firmware file. Also move the struct firmware definition from remoteproc.h into firmware.h. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230330124643.3562397-1-p.zabel@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/imx-image'Sascha Hauer2023-04-192-13/+33
|\ \
| * | filetype: add NXP FlexSPI filetypeMarco Felsch2023-04-041-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the NXP FlexSPI FCFB header check to the file_detect_type() so update handlers can verify the correct type. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20230228-v2023-02-0-topic-flexspi-v2-16-3d33126d2434@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | bbu: make it possible to check multiple of-compatiblesMarco Felsch2023-04-041-13/+28
| |/ | | | | | | | | | | | | | | | | | | | | | | | | It is possible that one barebox can rule multiple platforms e.g. multiple platform revision each has a dedicated device tree and of compatible. While it is possible to add multiple of-compatibles via IMD_USED_OF() (see: zii-imx8mq-dev) we didn't allowed it to flash it without 'force'. Fix this by check all possible IMD_TYPE_OF_COMPATIBLE image metadata types. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20230228-v2023-02-0-topic-flexspi-v2-2-3d33126d2434@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: i.MX6: fix DEBUG_LL useAhmad Fatoum2023-04-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | Below mentioned commit added a select DEBUG_IMX_UART for all supported i.MX variants apart from the i.MX6Q. Let's do likewise there, so DEBUG_LL may be enabled without errors about missing PUTC_LL definition. Fixes: 0fff6cb9bb4f ("ARM: i.MX: Only provide PUTC_LL() when activated") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230414132651.1703346-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | treewide: add missing device tree artifact cleanup where neededAhmad Fatoum2023-04-111-0/+3
| | | | | | | | | | | | | | | | | | | | | | The DTs in arch/$ARCH/dts are all cleaned up when invoking the make target, but we have a few DTs outside these directories. Clean those up as well and add a clean line for the overlay too. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20230408080616.938638-1-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | hush: pacify clang -Wparentheses-equality warningAhmad Fatoum2023-04-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Code is fine, but clang's -Wparentheses-equality warns when using double parentheses in conditionals that don't do assignment. This aligns with our code style as well, so change it to silence the warning. No functional change. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230404090542.1820785-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Revert "boards: qemu-virt: support passing in FIT public key"Sascha Hauer2023-03-223-14/+2
| | | | | | | | This reverts commit 9ac80cbb7b526bc6fe5f68b6c906ca086dd8da05.
* | Revert "boards: qemu-virt: ensure board driver probe at postcore_initcall level"Sascha Hauer2023-03-221-11/+1
|/ | | | This reverts commit f517a02bf8580446a54e62dea54a7275ad8728cc.
* Merge branch 'for-next/misc' into nextSascha Hauer2023-03-162-5/+4
|\
| * common: elf: use proper field to get segment memory sizeDenis Orlov2023-03-161-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For a program header, the value of 'p_filesz' may be less than the one of 'p_memsz', in which case the leftover amount of space should be filled with zeroes. This is done correctly when loading elf to memory. However, when we are requesting memory beforehand we do pass the value of 'p_filesz', instead of 'p_memsz', to 'request_sdram_region', resulting in potentially smaller amount of memory to be reserved. As 'p_memsz' is always greater or equal to 'p_filesz', use only the former for checking memory requirements in 'request_elf_segment'. Signed-off-by: Denis Orlov <denorl2009@gmail.com> Link: https://lore.barebox.org/20230315101126.4101087-1-denorl2009@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * blspec: support higher verbosity levels for bootAhmad Fatoum2023-03-091-1/+1
| | | | | | | | | | | | | | | | | | | | bootm_data::verbose is an integer and may take values higher than one for higher levels of verbosity. Yet, boots with blspec always had at most a verbosity of one, because verbose was treated as boolean. Fix this. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230308130416.3895317-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: Do not print exception stacktrace in panicSascha Hauer2023-03-101-6/+23
| | | | | | | | | | | | | | | | | | | | panic() prints a stacktrace by default. When being called in a an exception this will print the stacktrace of the exception stack which is not useful, so drop it. We are printing the desired stacktrace anyway before calling panic(). Link: https://lore.barebox.org/20230309142631.338244-1-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | boards: qemu-virt: support passing in FIT public keyAhmad Fatoum2023-03-103-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FIT public key is usually passed in via board DT. Usual way to use barebox with QEMU Virt however is to use DT supplied by Qemu and apply overlay to it. mkimage doesn't generate overlay DTB though. To make barbebox Qemu Virt behave like other boards, let's define a dummy DT that includes CONFIG_BOOTM_FITIMAGE_PUBKEY, which is merged with the barebox live device tree. Suggested-by: Jan Lübbe <jlu@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Tested-by: Jan Lübbe <jlu@pengutronix.de> Link: https://lore.barebox.org/20230210165353.3601175-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | boards: qemu-virt: ensure board driver probe at postcore_initcall levelAhmad Fatoum2023-03-101-1/+11
| | | | | | | | | | | | | | | | | | | | | | Qemu board driver fixups should be applied very early to be able to influence core components, even if they are controlled directly by initcalls. For this reason, enforce probe of the driver at postcore_initcall level. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230210165353.3601175-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: bcm283x: Only provide PUTC_LL() when activatedSascha Hauer2023-03-071-0/+7
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: vexpress: Only provide PUTC_LL() when activatedSascha Hauer2023-03-071-0/+7
| | | | | | | | | | | | Add a Kconfig symbol for the vexpress debug_ll UART port Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: stm32mp: Only provide PUTC_LL() when activatedSascha Hauer2023-03-071-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | With multi-arch support we must make sure we provide exactly one PUTC_LL() function as indicated by the "Kernel low-level debugging port" Kconfig choice. Make sure that the stm32mp specific debug_ll.h only provides PUTC_LL() when specified. The stm32mp specific debug_ll.h also provides other functions needed by board code regardless if the stm32mp debug_ll port is enabled or not, so include it explicitly where needed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: zynqmp: Add multi-arch supportSascha Hauer2023-03-071-0/+7
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: omap: Only provide PUTC_LL() when activatedSascha Hauer2023-03-071-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | With multi-arch support we must make sure we provide exactly one PUTC_LL() function as indicated by the "Kernel low-level debugging port" Kconfig choice. Make sure that the omap specific debug_ll.h only provides PUTC_LL() when specified. The omap specific debug_ll.h also provides other functions needed by board code regardless if the omap debug_ll port is enabled or not, so include it explicitly where needed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: Rockchip: Only provide PUTC_LL() when activatedSascha Hauer2023-03-071-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | With multi-arch support we must make sure we provide exactly one PUTC_LL() function as indicated by the "Kernel low-level debugging port" Kconfig choice. Make sure that the Rockchip specific debug_ll.h only provides PUTC_LL() when specified. The Rockchip specific debug_ll.h also provides other functions needed by board code regardless if the Rockchip debug_ll port is enabled or not, so include it explicitly where needed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: i.MX: Only provide PUTC_LL() when activatedSascha Hauer2023-03-071-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | With multi-arch support we must make sure we provide exactly one PUTC_LL() function as indicated by the "Kernel low-level debugging port" Kconfig choice. Make sure that the i.MX specific debug_ll.h only provides PUTC_LL() when specified. The i.MX specific debug_ll.h also provides other functions needed by board code regardless if the i.MX debug_ll port is enabled or not, so include it explicitly where needed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: mxs: Move mach header files to include/mach/mxsSascha Hauer2023-03-061-2/+2
| | | | | | | | | | | | | | | | | | | | Currently arch specific headers can be included with longer possible as there won't be a single mach anymore. Move all mxs specific header files to include/mach/mxs/ to prepare for multi-arch support. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: i.MX: Move mach header files to include/mach/imxSascha Hauer2023-03-062-4/+6
| | | | | | | | | | | | | | | | | | | | | | Currently arch specific headers can be included with #include <mach/xxx.h>. With upcoming multi-arch support this is no longer possible as there won't be a single mach anymore. Move all i.MX specific header files to include/mach/imx/ to prepare for multi-arch support. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: drop CONFIG_HAS_ASM_DEBUG_LLSascha Hauer2023-03-031-4/+0
|/ | | | | | | | | | | When CONFIG_HAS_ASM_DEBUG_LL is set then include/debug_ll.h includes asm/debug_ll.h, otherwise it includes mach/debug_ll.h. Drop this option and instead always include asm/debug_ll.h and include mach/debug_ll.h from there if necessary. This also adds the missing asm/debug_ll.h for architectures which previously did not have that file. Link: https://lore.barebox.org/20230302111606.1054037-6-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: Rename remaining struct device_d -> deviceSascha Hauer2023-02-231-3/+3
| | | | | | | struct device_d was renamed to struct device. Rename the remaining occurences of device_d. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/ratp'Sascha Hauer2023-02-231-1/+1
|\
| * ratp: Increase the establish timeout to 1secJules Maselbas2023-02-131-1/+1
| | | | | | | | | | | | | | | | | | | | Current timeout was only 100ms which is also the current initial value for the RTO (Retransmission Time Out), this is too short as it doesn't give barebox a chance to resent a packet during the handshake. Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu> Link: https://lore.barebox.org/20230207162055.10050-4-jmaselbas@kalray.eu Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2023-02-232-85/+78
|\ \
| * | common: boards: qemu-virt: use new-style DT overlay syntaxAhmad Fatoum2023-02-211-85/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DTC nowdays also supports a much less verbose syntax for DT overlays that is internally converted to the usual much more verbose fragment syntax. Switch to it. No functional change intended. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230217172414.1835351-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: add DEBUG_LL support for ARM64 QEMU VirtAhmad Fatoum2023-01-311-0/+4
| |/ | | | | | | | | | | | | | | | | We have DEBUG_LL for the PL011 on the ARM64 QEMU Virt, but it is unused. Wire it in. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230130064510.2398689-1-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/imx'Sascha Hauer2023-02-236-6/+1347
|\ \
| * | ddr_dimms: Check spd->mem_type before computing parametersJohn Watts2023-02-024-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Checking the mem_type here as well as the CRC means developers can just read the SPD and pass it directly to parameter computation. This makes it so developers can rely fully on parameters for checking if RAM is compatible with their board and not need to worry about reading SPD data themselves. Signed-off-by: John Watts <contact@jookia.org> Link: https://lore.barebox.org/20230201053334.971854-1-contact@jookia.org Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ddr_spd: remove unused local variableMarco Felsch2023-01-261-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | The buf8 variable was never used so remove it. Fixes: 2f1fc1c92 ("ddr_spd: Add function to read eeprom") Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20230125124840.3386338-1-m.felsch@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ddr_spd: Support reading SPD from DDR3 sticksJohn Watts2023-01-251-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | DDR4 splits the read in two pages while other DDR types do not. Introduce a new parameter to indicate how to read the SPD. Signed-off-by: John Watts <contact@jookia.org> Link: https://lore.barebox.org/20230121144429.3524905-8-contact@jookia.org Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ddr_dimms: Remove mclk_ps for DDR3 and DDR4John Watts2023-01-252-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | This parameter is unused, throw it away. Signed-off-by: John Watts <contact@jookia.org> Link: https://lore.barebox.org/20230121144429.3524905-7-contact@jookia.org Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ddr_dimms: Move ddr*_dimm_params to commonJohn Watts2023-01-255-0/+1316
| |/ | | | | | | | | | | | | | | | | | | This code is no longer specific to the any board. Also make ddr2_speed_bins static to not break PowerPC compilation Signed-off-by: John Watts <contact@jookia.org> Link: https://lore.barebox.org/20230121144429.3524905-6-contact@jookia.org Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | bootsource: use /chosen instead of /aliases/barebox,bootsource-Ahmad Fatoum2023-02-211-3/+3
|/ | | | | | | | | | | Aliases were a bad choice for this as barebox could end up calling MMC devices /dev/barebox,bootsource-mmc0, which was not intended. Move over to using chosen instead. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20230221070735.1130600-2-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/struct-rename'Sascha Hauer2023-01-204-7/+7
|\
| * state: backend: direct: open backend in read-only mode if possibleAhmad Fatoum2023-01-164-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We unconditionally open the device backing a direct bucket in read-write mode. We already populate struct state_backend_storage::readonly though, which we could consult at device open time. Do so. This could possibly be done for MTD as well, but until that's tested, for now, we do it only for the direct backend meant for use with block devices. This has no functional change for barebox, which calls state_new_from_node in the DT driver and in the EFI initcall always with readonly=false, but we can benefit from this in barebox_state to open a device in read-only mode when possible (e.g. when called to --dump). Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230116125443.713033-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2023-01-202-1/+12
|\ \
| * | common: deep-probe: write deep probe enabled message to logAhmad Fatoum2023-01-041-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "Deep probe supported due to" was not written to log and thus only shown on startup and not in dmesg output. Make it available in both. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20221222143513.3182725-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | pbl: Add Kconfig option to enable DEBUG globally in PBLAhmad Fatoum2022-12-161-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CONFIG_INITCALL_DEBUG=y is a very useful tool for debugging barebox hangs, but it's not so useful if the hang happens very early. Define a new CONFIG_DEBUG_PBL symbol that will define DEBUG globally in PBL to get more insight into boot hangs. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221212164212.2358450-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/caam'Sascha Hauer2023-01-201-1/+6
|\ \ \
| * | | common: add new CONFIG_HAVE_OPTEE symbolAhmad Fatoum2023-01-121-1/+6
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have two methods of loading a trusted OS: The legacy, but generic, way of doing it in barebox proper during bootm and the new way of doing it in prebootloader to reduce attack surface as much as possible by running barebox proper completely in normal world. Add a new CONFIG_HAVE_OPTEE symbol that is selected in both cases, so code can use just that instead of checking for both. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230111075940.922817-7-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>