summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* mci: mci-core: add HS200 supportSteffen Trumtrar11 days1-2/+40
| | | | | | | | | HS200 is a timing mode for eMMCs to work 8bit with 200MHz clocks. To be used, drivers need to set the correct drive strength, clock phases and then SDHCI can start tuning for HS200. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Acked-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
* mci: core: parse more host capabilities from DTSteffen Trumtrar11 days1-2/+30
| | | | | | | | | Port the linux v6.7 mmc host caps2 parsing. While at it, remove the ->no_sd and ->no_sdio. These are bits in the caps2 field. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
* include: mci: add more EXT_CSD_CARD_TYPE_*Steffen Trumtrar11 days1-2/+13
| | | | | | | | | | Import missing EXT_CSD_CARD_TYPE_ defines from linux v6.7. EXT_CSD_CARD_TYPE_SDR_1_8V/1_2V is unused in barebox. Replace with the defines from linux. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
* mci: core: save the set clock as actual_clockSteffen Trumtrar11 days1-0/+1
| | | | | | | | Linux mmc_host saves the actual_clock set on the HC. Do the same to use it later. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
* include: mci: sync mci_timing with linuxSteffen Trumtrar11 days1-8/+10
| | | | | | | | The timings are used to check if mci_host->timing is equal to one of this values. Linux uses a different numbering. Adapt that for compatability. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
* zynqmp: firmware: add functions to set tap delaySteffen Trumtrar11 days1-0/+23
| | | | | | | | Add a function to set the tap delay for the clk phase of the sd host controller. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2024-03-158-3/+73
|\
| * boot: add helper to set default boot source from board fileMarco Felsch2024-03-151-0/+1
| | | | | | | | | | | | | | | | | | Add a helper which can be called from board files to setup the "boot.default" parameter to be independent of the initcall level. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20240313195606.3911219-2-m.felsch@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * fastboot: add support to set fastboot_bbu from board codeMarco Felsch2024-03-151-0/+5
| | | | | | | | | | | | | | | | | | Add a helper to set the fastboot_bbu variable to be independent of the initlevel. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20240313195606.3911219-1-m.felsch@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: retire global NetRxPackets arraysAhmad Fatoum2024-03-131-2/+0
| | | | | | | | | | | | | | | | | | Now that no in-tree user of NetRxPackets remain, no one will miss this remnant of simpler times. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240313110704.1095554-8-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: add net_alloc_packets helperAhmad Fatoum2024-03-131-0/+8
| | | | | | | | | | | | | | | | | | | | | | We have a number of drivers that call net_alloc_packet in a loop and will gain some more in the quest to drop NetRxPackets. Let's provide a helper that can be used for this and a function to free the packets as well. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240313110704.1095554-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ddr_spd: add DDR3 Load Reduced module specific dataDenis Orlov2024-03-131-0/+34
| | | | | | | | | | | | | | | | | | | | This will be used by the DDR3 SPD data printing routine and is needed for completeness, to cover all of the DDR3-related cases from the original decode-dimms tool. Signed-off-by: Denis Orlov <denorl2009@gmail.com> Link: https://lore.barebox.org/20240311213915.584429-2-denorl2009@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * of: partition: Also add partitions created by addpart to the boot dtbUwe Kleine-König2024-03-131-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A partition added interactively using addpart was added in of_partition_fixup() before commit aec676b568 ("cdev: record whether partition is parsed from OF"). Restore that behaviour. To do that a new flag DEVFS_PARTITION_FOR_FIXUP is created that behaves very similar what DEVFS_PARTITION_FROM_OF did before. The only difference is that addpart makes use of it (and that stat uses a different string to describe it). Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.barebox.org/20240312100918.604105-1-u.kleine-koenig@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * commands: dmesg: support aborting dmesg output with ctrl-cAhmad Fatoum2024-03-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | dmesg output can get very long, especially if debug messages are compiled in and the maximum number of retained log messages is increased. Therefore, follow what we do for other potentially long-running commands and allow the user to abort it with ctrl+c. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240306184519.626594-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * FIT: support finding compatible configuration by FDT compatibleAhmad Fatoum2024-03-051-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far, we only supported finding compatible configurations that have a compatible property inside the configuration's device tree node. According to spec, this is optional however, and e.g. Yocto's kernel-fitimage.bbclass don't generate it. Instead, the bootloader is expected to lookup the compatible inside the referenced FDT. With fdt_machine_is_compatible, this is much less of a performance hit than with of_machine_is_compatible, so let's implement support for this. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240301130445.171385-5-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * of: fdt: implement fdt_machine_is_compatibleAhmad Fatoum2024-03-051-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When finding compatible bootloader spec files, barebox will unflatten each DTB in turn, allocating objects for each property and node, only to compare a single property and then free all the allocations again. Given that this operation is repeated for every device tree until a match is found, it's a good idea to be able to compare machine (top-level) compatibles without having to unflatten the whole FDT. Implemnt fdt_machine_is_compatible() that does just that. This intentionally opencodes the device tree iteration as to minimize code and runtime size. Using libfdt without LTO would be slower and bigger. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240301130445.171385-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * gpio: add slice supportSascha Hauer2024-02-231-0/+15
| | | | | | | | | | | | | | | | | | GPIOs are not only provided by raw register accesses but also by I2C devices. Add a slice to a gpio chip so that a gpio user can check if the slice is acquired before using it in a poller. Link: https://lore.barebox.org/20240221142800.1958810-2-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/imx'Sascha Hauer2024-03-1514-57/+119
|\ \
| * | ARM: i.MX: define MUX_MODE_SION for use in board codeAhmad Fatoum2024-03-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While we set SION for all I2C pinmux configurations, board code may need to set SION for other pads as well. Provide a MUX_MODE_SION definition that can be OR-d into the pinmux argument of imx8mm_setup_pad(). Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240313180026.3202602-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ddr: imx8m: add deprecation warnings for ddrphy_trained_csrAhmad Fatoum2024-03-151-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ddrphy_trained_csr and ddrphy_trained_csr_num are generated by the spreadsheet, but are unused. Instead a default array with fixed values is unconditionally used. Add a deprecation warning to alert to this fact. It seems GCC doesn't print this deprecation when using C99 designated initializers, but clang(d) does, so it's useful to have for those using clangd in their editors. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240313154217.2747582-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: phy: micrel: update id table from Linux kernelMarc Kleine-Budde2024-03-131-7/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This syncs the known Micrel PHY IDs and register definitions with the Linux kernel, commit f600bb612b06adf70ccdefbd3294c71275b650c2. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Stefan Kerkmann <s.kerkmann@pengutronix.de> Link: https://lore.barebox.org/20240311-karo-imx8mp-som-board-upstreaming-v2-2-6ecda693adb2@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | of: introduce of_property_read_s32Sebastian Reichel2024-03-131-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce signed 32bit integer of_property_read method. Signed-off-by: Sebastian Reichel <sre@kernel.org> Signed-off-by: Grant Likely <grant.likely@linaro.org> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Stefan Kerkmann <s.kerkmann@pengutronix.de> Link: https://lore.barebox.org/20240311-karo-imx8mp-som-board-upstreaming-v2-1-6ecda693adb2@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | nvmem: add nvmem_device_get_device()Sascha Hauer2024-03-131-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | We'll want to add a device parameter to the imx_ocotp0 device in the next step, but the device is private to the nvmem core. Add a getter function for it. Link: https://lore.barebox.org/20240311102152.360762-4-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: i.MX: ele: add ele_write_shadow_fuseSascha Hauer2024-03-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ocotp fuses have shadow values. For some fuses the shadow values can be read from and written to. While it's not really clear where the ROM really uses these shadow values, it still helps reading and writing them to get an idea if we are about to write the correct fuses before we finally enable permanent write. Link: https://lore.barebox.org/20240311102152.360762-3-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: i.MX: ele: move ELE_READ_SHADOW_REQ definitionSascha Hauer2024-03-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | The ELE request defines are in include/mach/imx/ele.h, move definition of ELE_READ_SHADOW_REQ there as well. Link: https://lore.barebox.org/20240311102152.360762-1-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: i.MX8MN: set SION bits for i2c mux optionsBastian Krause2024-03-131-32/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | i2c data lines are bidirectional, so the SION bit should be set. Apply them to all i2c mux options. Suggested-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Bastian Krause <bst@pengutronix.de> Link: https://lore.barebox.org/20240308142052.2683407-2-bst@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: i.MX8MM: set SION bits for i2c2, i2c3, i2c4 mux optionsBastian Krause2024-03-131-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | i2c data lines are bidirectional, so the SION bit should be set. For i2c1, this is already the case. Apply the same to the remaining i2c mux options. Suggested-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Bastian Krause <bst@pengutronix.de> Link: https://lore.barebox.org/20240308142052.2683407-1-bst@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: i.MX: ele: remove unnecessary argumentSascha Hauer2024-03-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The get_response argument to imx9_s3mua_call() is always set to true by the callers. It must be like that because in the ELE API Reference Guide every call into the ELE has a response. Drop the unnecessary argument. Link: https://lore.barebox.org/20240301111915.2439646-1-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | env: export getenv_ullx() helperAhmad Fatoum2024-03-131-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | getenv_ull() will parse values according to prefix: - If it starts with 0x, it's hexadecimal - If it's just 0, it's octal - otherwise, it's decimal Some variables like i.MX8M soc0.soc_uid are hexadecimal without leading 0x. Therefore add a getenv_ullx helper, so code that used to do: uid = imx8m_uid(); can be replaced with getenv_ullx("soc0.soc_uid", &uid); Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240228175128.2734265-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: i.MX8M: drop function prototype for removed imx8m_uidAhmad Fatoum2024-03-131-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The i.MX8M UID and some other SoC-related info is now available over soc0.soc_uid and imx8m_uid's function definition was removed. Therefore remove the prototype as well. Fixes: d392a0aea330 ("ARM: i.MX8M: convert the machine init to the soc driver") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240228175128.2734265-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | arm: mach-imx: tzasc: convert to cpu_is_mx8xyz macrosStefan Kerkmann2024-03-131-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of passing in configuration parameters at runtime we can utilize the `cpu_is_mx8xyz` macro family to determine which bits should be set. As the tzasc driver is imx specific, all functions are prefixed with `imx8m_` as well. Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Stefan Kerkmann <s.kerkmann@pengutronix.de> Link: https://lore.barebox.org/20240228-v2024-02-0-topic-imx8m-n-p-tzac-v2-3-ee1ae48dc399@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | arm: mach-imx: set cpu type in pblStefan Kerkmann2024-03-131-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to use the `cpu_is_imxxyz` macro family in the pbl, `__imx_cpu_type` has to be defined and initialized. As we don't have access to the devicetree at this point, we resort to manual assignment. Note: It is safe to build the same imx.o object file for both barebox pbl and proper as the `imx_init` function is discarded during linking as the whole `init_call` section is not linked into the final binary. Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Stefan Kerkmann <s.kerkmann@pengutronix.de> Link: https://lore.barebox.org/20240228-v2024-02-0-topic-imx8m-n-p-tzac-v2-2-ee1ae48dc399@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: i.MX93: add bootsource detectionSascha Hauer2024-03-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | On i.MX93 the ROM API can be used to detect the bootsource. Implement support for this. Link: https://lore.barebox.org/20240220114508.3685478-1-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: i.MX6: add i2c4 base addressSascha Hauer2024-03-131-0/+1
| | | | | | | | | | | | | | | | | | | | | Add a define for the I2C4 base address. Link: https://lore.barebox.org/20240221150323.2715164-5-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | board: tq: add support for 16bit eepromSascha Hauer2024-03-131-1/+1
| |/ | | | | | | | | | | | | | | | | Some I2C EEPROMs must be addressed with two bytes. Add the address argument to pbl_tq_read_eeprom(). The actual EEPROM address will be 0x0 always, but we can use the address to pass I2C_ADDR_16_BIT through it. Link: https://lore.barebox.org/20240221150323.2715164-4-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/hwrng'Sascha Hauer2024-03-154-0/+44
|\ \
| * | hw_random: add OMAP RNG driverAhmad Fatoum2024-03-152-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | To enable proper hardening with stack protector, add support for the OMAP RNG driver. This has been tested on a Beagle Bone Black. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240313105631.686778-13-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | hw_random: add BCM2835 RNG driverAhmad Fatoum2024-03-151-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | To enable proper hardening with stack protector, add support for the BCM2835 RNG. This has been tested on a Raspberry Pi 3B. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240313105631.686778-9-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | hw_random: add struct hwrng::priv memberAhmad Fatoum2024-03-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A number of Linux hw_random drivers use container_of to arrive at the driver private data, but some others use the priv member of struct hwrng. A unsigned long worth of extra malloc space doesn't hurt, so add the same member to barebox too. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240313105631.686778-5-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | driver: implement dev_platform_get_and_ioremap_resourceAhmad Fatoum2024-03-151-0/+4
| |/ | | | | | | | | | | | | | | | | | | | | | | To simplify porting of Linux drivers that make use of this function, add an implementation to barebox. This was so far not done, because AT91 has I/O memory regions that conflict with the error pointers. Therefore, we emit a warning if we run into such a conflict. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240313105631.686778-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/bus-probe'Sascha Hauer2024-03-151-0/+4
|\ \
| * | usb: print number of skipped OTG controllers when scanningAhmad Fatoum2024-02-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I often get confused by running usb and wondering why devices behind unconfigured OTG controllers are not enumerated. Improve the user experience by printing a message when doing a USB scan while some OTG controllers are not yet configured (i.e. the otg.mode device parameter hasn't been set to "peripheral" or "host"). Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240228160518.1589193-6-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | usb: otg: maintain list of USB OTG controllersAhmad Fatoum2024-02-291-0/+2
| |/ | | | | | | | | | | | | | | | | | | | | We register devices for OTG controllers only to associate a .mode device parameter with them. Follow-up commits will need to refer to previously registered OTG controllers, so let's register a bus type for them and use it to maintain a list of controllers. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240228160518.1589193-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/at91'Sascha Hauer2024-03-155-8/+11
|\ \
| * | ARM: at91: skov-arm9cpu: Add SD-Card xload supportSam Ravnborg2024-02-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This updates skov-arm9cpu with xload support, and we can now use barebox as a replacement for at91bootstrap Only boot via SD card is supported. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240220093100.1539120-12-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: at91: sam9263_ll: support configuration of PLLBAhmad Fatoum2024-02-232-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PLLB may be used as input to derive the USB's 48 MHz clock. PLLA is already being setup by currently unused sam9263_lowlevel_init(), so add an extra parameter for PLLB as well. While at it, we change the API of sam9263_lowlevel_init(): AT91Bootstrap code has PLLA_SETTINGS and PLLB_SETTINGS as hex values in the headers, so it makes porting easier by just allowing low-level barebox code to use the values as is without having to split them up to stuff into a struct, only to have them ORed into a single value again. Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240220093100.1539120-10-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: at91: implement SAM9_ENTRY_FUNCTIONAhmad Fatoum2024-02-231-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An On-chip SRAM is available at address 0x00300000 on all SAM9x variants, so let's define a macro that sets up the stack to grow down from its end. This will be useful for first stage barebox running without previously setup stack. Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240220093100.1539120-6-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: replace ENTRY_FUNCTION_HEAD with ENTRY_FUNCTION_WITHSTACK_HEADAhmad Fatoum2024-02-232-2/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To allow SoC-specific entry functions that don't replicate the code in ENTRY_FUNCTION, we provide a helper macro that support specifying a custom HEAD, but only on arm32. Make this macro private by prefixing with __ and implement the superset ENTRY_FUNCTION_WITHSTACK_HEAD for both arm32 and arm64 that should be used instead. Eventually, we will want to switch away from naked functions on arm32, like we did on arm64 and then we could use the same implementation for both platforms (and support clang on arm32!), but till then, this seems the least ugly way to go about it. Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240220093100.1539120-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | fs: fix overlap of O_RWSIZE with new O_PATH/O_CHROOT flagsAhmad Fatoum2024-03-111-5/+6
| | | | | | | | | | | | | | | | | | | | | | O_PATH had the same value as O_RWSIZE_2, while O_CHROOT overlapped with O_RWSIZE_4. Fix this by moving up the bits used for O_PATH and O_CHROOT. This resolves the EINVAL reported when running md -w 0. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240308142047.3890639-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | commands: provide efi_handle_dump in both payload and loaderAhmad Fatoum2024-03-051-0/+9
| | | | | | | | | | | | | | | | | | | | | | The efi_handle_dump command is currently used when barebox is built as payload, but it's also useful when running as a loader to list handles and their protocols. Move the code into a common area to make it accessible in both configurations. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240304190038.3486881-109-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>