summaryrefslogtreecommitdiffstats
path: root/drivers
Commit message (Collapse)AuthorAgeFilesLines
...
| * gpio: pca953x: depend on i2c sliceSascha Hauer2024-02-231-0/+2
| | | | | | | | | | | | | | | | | | The GPIOs provided by the pca953x cannot be used inside a poller while the I2C controller is in use. Add a dependency to from the GPIO controller to the I2C controller for this purpose. Link: https://lore.barebox.org/20240221142800.1958810-3-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * gpio: add slice supportSascha Hauer2024-02-231-0/+11
| | | | | | | | | | | | | | | | | | 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-157-10/+241
|\ \
| * | ddr: imx8m: add deprecation warnings for ddrphy_trained_csrAhmad Fatoum2024-03-151-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: add support for ksz9131 phyMarc Kleine-Budde2024-03-131-0/+188
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This imports the micrel KSZ9131 gigabit phy driver from Linux, commit 0316c7e66bbd16cf2d01a4e2f5afa6afb01278f2. 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-3-6ecda693adb2@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | nvmem: imx-ocotp-ele: implement permanent write supportSascha Hauer2024-03-131-1/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implements write support to imx-ocotp-ele. By default only the shadow values are written which is harmless and nearly useless (as the ROM doesn't seem use these values). Real write support is enabled by setting imx_ocotp0.permanent_write_enable to true. A big warning is printed and the next write access to /dev/imx_ocotp will then really burn fuses. Link: https://lore.barebox.org/20240311102152.360762-5-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | nvmem: add nvmem_device_get_device()Sascha Hauer2024-03-131-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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: mach-imx: tzasc: convert to cpu_is_mx8xyz macrosStefan Kerkmann2024-03-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | net: phy: fix miibus parent device of_node not matching phy nodeSascha Hauer2024-03-132-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The device node of a miibus parent device usually points to the ethernet device node whereas the parent device node of a phy device usually points to the mdio {} subnode between the ethernet node and the phy node, so both can't match. Ethernet drivers usually provide a pointer to the mdio {} subnode in miibus::dev.of_node, so use that to match against the phy nodes parent. This occured on a TQMa6UL where two FECs are registered, but both phys are connected to the FEC2. Link: https://lore.barebox.org/20240221150323.2715164-8-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/hwrng'Sascha Hauer2024-03-1510-8/+1499
|\ \ \
| * | | hw_random: add OMAP RNG driverAhmad Fatoum2024-03-153-0/+445
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 timeriomem_rng driverAhmad Fatoum2024-03-153-0/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To enable proper hardening with stack protector, add support for the RNGs with the interface of a single memory mapped 32-bit register. This can possibly come in handy for the web demo. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240313105631.686778-12-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | hw_random: add Rockchip RNG supportAhmad Fatoum2024-03-153-0/+267
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To enable proper hardening with stack protector, add support for the Rockchip RNG. This has been tested on the RK3568. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240313105631.686778-11-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | hw_random: add IPROC RNG200 driver for BCM2711Ahmad Fatoum2024-03-153-0/+228
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To enable proper hardening with stack protector, add support for the IPROC RNG200. This has been tested on a Raspberry Pi 4. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240313105631.686778-10-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | hw_random: add BCM2835 RNG driverAhmad Fatoum2024-03-153-0/+207
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Atmel RNG driverAhmad Fatoum2024-03-153-0/+173
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To enable proper hardening with stack protector, add support for the Atmel RNG. This has been tested on a SAMA5D2. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240313105631.686778-8-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | hw_random: remove reference to undefined CONFIG_HW_RANDOMAhmad Fatoum2024-03-151-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CONFIG_HW_RANDOM is called CONFIG_HWRNG in barebox, so remove references to the former. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240313105631.686778-7-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | hw_random: remove confusing left-overs from kernel help textsAhmad Fatoum2024-03-151-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mentioning Linux in the help text for barebox drivers can be confusing as there's indeed barebox drivers that prepare stuff for Linux to use. hw_random drivers don't though and they for use inside barebox, so adjust the help text accordingly. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240313105631.686778-6-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/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | hw_random: support ctrlc()Ahmad Fatoum2024-03-151-4/+4
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's valid for HWRNG drivers to return 0 bytes read, thereby instructing the caller to try again. We do that for the cdev_read operation, but in case the driver never returns a non-zero value, barebox will keep waiting indefinitely. Check ctrlc() in that case and return a short read if the user interrupts the operation. We don't need ctrlc() in the general case, as the caller is free to check for ctrlc() between reads to the device. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240313105631.686778-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/bus-probe'Sascha Hauer2024-03-157-37/+51
|\ \ \
| * | | usb: print number of skipped OTG controllers when scanningAhmad Fatoum2024-02-292-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: turn global otg device into device aliasAhmad Fatoum2024-02-291-13/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | barebox supports manual switching of USB OTG ports to either peripheral or host via the otgX.mode={host,peripheral} device parameter. When support for configuring multiple OTG ports was added, the old singleton otg device was kept, as not to break existing scripts. Since then, barebox has gained support for device aliases, which are a light weight mechanism to resolve device names and point at a different device. This is exactly what's required here, so make use of it. Cc: Jules Maselbas <jmaselbas@zdiv.net> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240228160518.1589193-5-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/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | treewide: remove bus probe functions that just call driver probeAhmad Fatoum2024-02-294-24/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that the driver core will call the driver probe function if there is no bus probe function, remove all bus probe functions that do what the core can do instead. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240228160518.1589193-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | driver: make struct bus_type::probe optionalAhmad Fatoum2024-02-291-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Newly introduce soc_bus_type doesn't define .probe, which would crash once a driver is registered on that bus. Do as Linux does and defer to the driver probe function if there's no bus probe function and treat non-existence of either as a successful probe. This has the added benefit that it will allow us to drop very simple bus probe functions that just call the driver probe and do nothing else. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240228160518.1589193-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | driver: make struct bus_type::match optionalAhmad Fatoum2024-02-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Newly introduce soc_bus_type doesn't define .match, which would crash once a driver is registered on that bus. Do as Linux does and treat a non-existent match callback as meaning that all drivers should be matched and that the probe function should indicate via -ENODEV/-ENXIO whether a device is indeed suitable. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240228160518.1589193-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | Merge branch 'for-next/at91'Sascha Hauer2024-03-153-1/+13
|\ \ \ \
| * | | | mci: atmel_mci: fix zeroing of block length on AT91SAM9263Ahmad Fatoum2024-02-231-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We don't read back ATMCI_MR, but instead set up the value once and keep writing it on every reset. On the SAM9263, but not on the later SAM9x5, the ATMCI_MR register also includes a field for the block length. Not taking that into account means that we zero the block length on every reset. While the effect of this zeroing is likely limited, because we set the block length on every transfer via ATMCI_BLKR, it would be less surprising and more robust against future change to not intermittently zero the block length via the MR register. Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240220093100.1539120-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | mci: atmel_mci: disable power save modeAhmad Fatoum2024-02-232-0/+2
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Power saving mode will clock down the MCI clock according to the value of the PWSDIV (Power Saving Divider) field of the mode register. No where in Linux or barebox do we set a value for PWSDIV however, so the safe thing to do is disabling power saving mode. This aligns barebox with what AT91Bootstrap and the U-Boot driver are doing and fixes SD-Card block write failures when using barebox as first stage bootloader on the AT91SAM9263. Without this change, writing the environment would fail in barebox, an ext4 fsck in Linux would hang and barebox PBL chainloading of barebox proper would hang when CONFIG_DEBUG_PBL is disabled. Fixes: 6cf02124b10d ("mci: add Atmel AT91 MCI driver") Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240220093100.1539120-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | Merge branch 'for-next/arm-efi-prepare'Sascha Hauer2024-03-1530-283/+123
|\ \ \ \
| * | | | commands: provide efi_handle_dump in both payload and loaderAhmad Fatoum2024-03-053-195/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | | efi: devicepath: namespace definitionsAhmad Fatoum2024-03-051-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using a DEVICE_PATH_ prefix everywhere will make it clear what the definitions is about and in part align us with the naming in U-Boot. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240304190038.3486881-104-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | efi: payload: don't require efi_loaded_image->parent_handle for bootsource ↵Ahmad Fatoum2024-03-051-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | detection This fixes bootsource detection running barebox as EFI payload under EDK2 2020.11. Fixes: 443eb41376d9 ("efi: add bootsource detection") Cc: Enrico Jorns <ejo@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240304190038.3486881-97-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | video: mark EFI_GOP driver x86-only for nowAhmad Fatoum2024-03-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The driver currently crashes when running barebox on ARM64 Virt under Tianocore. Until that's resolved, mark it x86-only. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240304190038.3486881-81-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | efi: flesh out EFI definitions in headerAhmad Fatoum2024-03-052-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have a lot of function pointer members in the protocols, that were defined as void pointers instead of properly prototyped function pointers. Similarly, a lot of data types are defined to equivalent types that aren't as descriptive, e.g. size_t vs ulong and s16 vs efi_char16_t. Let's switch them over all at once. No functional change as the types are either equivalent or were unused in the case of function pointers. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240304190038.3486881-75-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | efi-stdio: wait for extended input key event when using extended inputAhmad Fatoum2024-03-051-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extended input protocol support was added to deal with EFI firmwares that don't report control characters rendering utilities like barebox edit unusable. The extended input support comes with its own event for use with the wait_for_event boot service, which we should use instead of the non-extended variant in case we are going to read the key with the extended protocol. Fixes: 438f80e98658 ("serial: efi-stdio: Add simple_text_input_ex_protocol backend") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240304190038.3486881-74-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | efi-stdio: fix wait_for_event argumentAhmad Fatoum2024-03-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | EFI v2.10 documents the following about EFI events: | // EFI_EVENT: Handle to an event structure. Type VOID * | | typedef | EFI_STATUS | (EFIAPI *EFI_WAIT_FOR_EVENT) ( | IN UINTN NumberOfEvents, | IN EFI_EVENT *Event, | OUT UINTN *Index | ); | | typedef struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL { | EFI_INPUT_RESET Reset; | EFI_INPUT_READ_KEY ReadKeyStroke; | EFI_EVENT WaitForKey; | } EFI_SIMPLE_TEXT_INPUT_PROTOCOL; To sum up, wait_for_event takes the number of events to wait for and a pointer to an EFI_EVENT array of that size. Because we define efi_event as void *, it went unnoticed that we passed a plain pointer instead of a pointer to a pointer like the API expects. With the using of an opaque type in the follow-up commit, this will trigger a warning, so we fix this here in anticipation. I am not sure how this went unnoticed so far, but the efi-stdio console driver behaves as one would expect in Qemu. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240304190038.3486881-73-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | efi: rename efi_simple_input_interface to efi_simple_text_input_protocolAhmad Fatoum2024-03-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This aligns the name with what's in the specification. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240304190038.3486881-71-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | efi: define efi_handle_t as opaque pointerAhmad Fatoum2024-03-051-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Typedef'ing efi_handle_t as void * means that we don't catch instance where we pass a double indirect pointer when a normal pointer is expected. With loader support, we will start to dereference it anyway, so have it point at an opaque type instead. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240304190038.3486881-69-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | efi: block: move definitions into header fileAhmad Fatoum2024-03-051-27/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We will need these definitions for the EFI loader as well, so move them into a header. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240304190038.3486881-68-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | efi: use efi_handle_t where appropriateAhmad Fatoum2024-03-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | efi_handle_t is a typedef for a void pointer. We use either void * directly or unsigned long at places, where a handle would be the more descriptive type. Fix this. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240304190038.3486881-67-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | efi: payload: suppress EFI payload initcalls when not EFI-loadedAhmad Fatoum2024-03-052-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For development, it has proven very useful to be able to load the same barebox binary both as EFI loader and EFI payload and debug the interaction. For this to work, we need to mark all current EFI payload initcalls as such to avoid running them when barebox is not running as EFI payload. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240304190038.3486881-63-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | efi: make headers self-containedAhmad Fatoum2024-03-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the loader support, efi.h will grow quite a bit. To avoid having to include it always, lets move the base definitions into a new <efi/types.h> and make the different <efi/*.h> headers self contained. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240304190038.3486881-54-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | efi: don't hide structs, enums or unions behind _tAhmad Fatoum2024-03-053-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Kernel coding style is to usually not hide the fact that a type is a struct or enum behind a typedef. Follow that in the EFI code. Besides being more descriptive, this also allows forward declarations, so <efi.h> doesn't have to be included everywhere. No functional change. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240304190038.3486881-53-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | block: record block device typeAhmad Fatoum2024-03-057-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Software running under EFI can query the type of a block device. For barebox to be able to report this, start assigning types to all block devices it can create. No functional change yet. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240304190038.3486881-24-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | block: virtio: assign virtio-mmio device tree node to cdevsAhmad Fatoum2024-03-052-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All block devices except for virtio-mmio have a pointer to the hardware device tree node if available, so add it to virtio-mmio as well. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240304190038.3486881-20-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | cdev: implement setter/getter for cdev device nodeAhmad Fatoum2024-03-054-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A cdev has two device tree node pointers, one directly at struct cdev.device_node and another indirectly via cdev.dev->device_node. We may want to remove cdev::device_node in future, but till then to avoid users having to guess, which device_node is the correct one, add a helper to set and get the device tree node. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240304190038.3486881-19-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | of: don't report failure to of_read_file twiceAhmad Fatoum2024-03-051-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of_read_file already prints to log messages when it fails, so duplicating the error message in the caller is needlessly verbose. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240304190038.3486881-11-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | efi: payload: rename CONFIG_EFI_BOOTUP to CONFIG_EFI_PAYLOADAhmad Fatoum2024-03-0510-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The symbol is internal, so we don't break anything by renaming it. CONFIG_EFI_PAYLOAD is clearer in intent, as BOOTUP doesn't clearly indificate whether barebox would act as EFI payload or as EFI loader. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240304190038.3486881-9-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>