summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
...
| * | efi: align LOAD_FILE_PROTOCOL_GUID's name with other PROTOCOL_GUIDsAhmad Fatoum2021-11-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Convention is to m/EFI_.*_PROTOCOLG_GUID/. Rename LOAD_FILE_PROTOCOL_GUID for uniformity. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211122084732.2597109-7-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | include: <linux/types.h>: wrap in #ifndef __ASSEMBLY__Ahmad Fatoum2021-11-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While it makes no sense for assembly sources to include <linux/types.h> directly, it may be included transitively outside of an __ASSEMBLY__ guard, thus wrap it completely in the __ASSEMBLY__ guard, just like Linux does. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211122084732.2597109-5-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | fs: remove unused struct node_d in struct dirAhmad Fatoum2021-11-251-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | This struct member is never used, so it can just be dropped. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211122084732.2597109-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | fs: remove useless AT_FDCWD referencesAhmad Fatoum2021-11-251-4/+0
| |/ | | | | | | | | | | | | | | | | | | All name lookups by barebox are AT_FDCWD and there are no dirfd support that could be used in its place, so just remove that parameter altogether from the FS functions. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211122084732.2597109-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / include: linux/printk.h: include <stdarg.h> to make header self-containedAhmad Fatoum2021-12-131-0/+1
|/ | | | | | | | | | The point of <linux/printk.h> is to have a minimal self-contained header for use where ever printing is required. va_list was used, but not defined, remedy this. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20211211084026.443756-1-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/spdx'Sascha Hauer2021-11-151-6/+1
|\
| * drivers: add missing SPDX-License-IdentifierAhmad Fatoum2021-11-011-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the suitable SPDX-License-Identifier to all files in drivers/ that previously lacked one. To aid manual inspection, following heuristics can be used: * No changes outside of comments/whitespace: git show -U0 HEAD | rg -v '^(@@|diff|index)|[-+]([-+]|//|#|[\s/]\*)' * -or-later come in pairs: git show --inter-hunk-context=19 HEAD | \ perl -0777 -F'/^@/gm' -ne 'for (@F) { @m = /later/g; print if @m & 1 }' Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211030175632.2276077-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/rockchip'Sascha Hauer2021-11-152-0/+7
|\ \
| * | clk: handle CLK_OF_DECLARE in deep probeAhmad Fatoum2021-11-101-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An assigned-clock-parents referring to a fixed-clock will result in a warning: WARNING: clk: couldn't get parent clock 0 for /ethernet@fe300000 That's because the device for the fixed clock is created on demand and even after ensuring probe, no driver will have bound against it as CLK_OF_DECLARE operates outside the driver model. Fix this by creating devices and binding the dummy driver while iterating over the CLK_OF_DECLARE list. No functional change for systems not enabling deep-probe. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211108075209.2366770-7-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | cdev: Add function to get unallocated space at start of deviceSascha Hauer2021-10-121-0/+1
| |/ | | | | | | | | | | | | | | | | | | | | On several SoCs barebox is written to the raw device in front of the first partition. So far we blindly trust that there is enough space available for the barebox image. Start changing this by adding a function that retrieves the available space. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20211012073352.4071559-8-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2021-11-1510-190/+200
|\ \
| * | include/phy: add driver_data to resume more of kernel codeOleksij Rempel2021-11-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add driver_data pointer to be able to port more of kernel code for micrel phy. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.barebox.org/20211013121825.4278-1-o.rempel@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | include: move ARRAY_AND_SIZE to <linux/kernel.h>Ahmad Fatoum2021-11-012-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux defines this macro at multiple places. We define it once, but in <common.h>, which is a bit heavy weight. Move it next to the ARRAY_SIZE() definition. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211030141739.2207431-5-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | include: <asm-generic/bug.h>: make self-containedAhmad Fatoum2021-11-013-11/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | <asm-generic/bug.h> so far depended on a preceding <common.h> to get the dump_stack() definition. Move dump_stack() to the new printk.h and drop the remaining puts() use to make header self-contained. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211030141739.2207431-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | include: add dedicated header for printf/printkAhmad Fatoum2021-11-016-178/+190
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Including <stdio.h> for printf is a bit problematic, because it pulls in other headers for <console.h>, which includes quite a few more headers as well. To make it easier to share code between barebox and host tools make <printk.h> the new minimal header for printf and move the extra logging stuff into <linux/printk.h>. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211030141739.2207431-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | include: <linux/bitops.h>: discard left-over hweight codeAhmad Fatoum2021-11-011-5/+0
| |/ | | | | | | | | | | | | | | | | | | There are no definitions for __sw_hweight*, so no point in keeping the prototypes around. The scripts version of the header also ultimately tries to access non-existing normal headers, so fix that up as well. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211030141739.2207431-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | include/image-metadata.h: fix whitespaces in the BAREBOX_IMD_CRC macroAntony Pavlov2021-11-011-3/+3
| | | | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Link: https://lore.barebox.org/20211028012816.929611-4-antonynpavlov@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | imd: fix imd_is_crc32()Antony Pavlov2021-11-011-1/+1
|/ | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Link: https://lore.barebox.org/20211028012816.929611-2-antonynpavlov@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2021-10-077-4/+369
|\
| * usb: gadget: dfu: Rework dfu command to use usbgadgetJules Maselbas2021-10-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dfu command now uses the composite multi gadget to register the usb functionality. This allows the removal of the usb composite driver from dfu.c As the dfu command is blocking the command slice must be released while the dfu gadget is running in order to do operations on the file system. The usb_dfu_register() function is replaced with usb_dfu_detached() for the dfu command to return a different value depending on if it has been interrupted with CTRL-C or if the gadget has been detached. Tested-by: Anže Lešnik <anze.lesnik@norik.com> Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu> Link: https://lore.barebox.org/20210910102931.26078-1-jmaselbas@kalray.eu Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * fs: remove unused struct fs_device_d::parent_deviceAhmad Fatoum2021-10-051-1/+0
| | | | | | | | | | | | | | | | The parent_device member is unused anywhere, so drop it. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20210913083019.364599-1-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * net: add virtio network driverAhmad Fatoum2021-10-052-2/+363
| | | | | | | | | | | | | | | | | | | | | | | | | | This gives virtio-enabled boards an easy route to network connectivity: qemu-system-aarch64 -M virt -serial mon:stdio -trace file=/dev/null \ -kernel images/barebox-dt-2nd.img -cpu cortex-a57 -nographic \ -device virtio-net-device,netdev=network0 -netdev tap,id=network0,ifname=tap0 The tap0 interface created by QEMU can then be bridged/listened on. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * console: add new CONFIG_CONSOLE_DISABLE_INPUT optionRouven Czerwinski2021-10-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | Add CONFIG_CONSOLE_DISABLE_INPUT to initialize the consoles without input support, making default bootup effectively non-interactive. Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Tested-by: Christian Melki <christian.melki@t2data.com> Link: https://lore.barebox.org/20210915123644.1292607-1-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * file_list: add file_list_parse_null()Rouven Czerwinski2021-10-051-0/+1
| | | | | | | | | | | | | | | | | | | | Move the usbgadget parse() function to file_list and rename it to file_list_parse_null() which will return a NULL pointer instead of an error. Also adjust the callers in the usbgadget code. Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Link: https://lore.barebox.org/20210810052928.101783-1-r.czerwinski@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * asm-generic: include bitio.h from io.hAhmad Fatoum2021-08-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is currently used on ARM and sandbox, but it's relevant for other platforms like x86 as well if driver code wants to make use of the functions defined within. MIPS and PowerPC already defines the symbols, but that's ok because <bitio.h> doesn't override existing macros. This works for MIPS, but not PowerPC, where those aren't macros. Fix that up. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210812121944.4419-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/layerscape'Sascha Hauer2021-10-073-63/+354
|\ \
| * | nand: add NXP IFC nand driverRenaud Barbier2021-08-231-0/+305
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the NXP IFC nand driver support. This driver can be used with the NXP QorIQ cores. Originally, derived from U-boot commit cce573e (2015-10) Signed-off-by: Renaud Barbier <renaud.barbier@abaco.com> Link: https://lore.barebox.org/1628842608-17031-3-git-send-email-renaud.barbier@abaco.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: atomic.h: add 64-bit counter supportRenaud Barbier2021-08-232-63/+49
| |/ | | | | | | | | | | | | | | | | | | | | In preparation for the introduction of the FSL IFC nand driver for the layerscape CPU, add 64-bit counter support. Remove functions calling undefined functions. Signed-off-by: Renaud Barbier <renaud.barbier@abaco.com> Link: https://lore.barebox.org/1628842608-17031-2-git-send-email-renaud.barbier@abaco.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/imx'Sascha Hauer2021-10-072-1/+32
|\ \
| * | ddr: imx8m: ddrphy_train: add DDR4 supportAhmad Fatoum2021-10-051-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are DDR3L, DDR4 and LPDDR4 variants of the i.MX8M* SoMs used with the NXP EVKs. So far, we only supported LPDDR4. For DDR4, we just need different PHY training code. Encode the DRAM variant information into a new dram_timing_info::dram_type and adjust the driver to make use of it. The new CONFIG_FIRMWARE_IMX_DDR4_PMU_TRAIN Kconfig symbol can co-exist with CONFIG_FIRMWARE_IMX_LPDDR4_PMU_TRAIN, allowing the same barebox binary to target different memory types, provided board code can determine what kind of DRAM is fitted. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211001100949.6891-7-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ddr: imx8m: add i.MX8MN (Nano) supportAhmad Fatoum2021-10-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DRAM setup on i.MX8MP is the same as on the i.MX8MP, except for DDRC_DDR_SS_GPR0, which the vendor's U-Boot port explicitly skips on the nano, irrespective of the configured DRAM type. Do likewise. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211001100949.6891-6-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: i.MX6: boot: detect USB serial downloader more reliableMarco Felsch2021-08-181-0/+11
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem with the BootROM is that the SRC registers are not set accordingly in case of a failed primary boot. E.g. if the device is configured to boot from an eMMC and the eMMC is empty or image is corrupt, the BootROM goes into 'recovery boot mode' (reference manual Figure 8-1) and the last possible recovery option is the serial downloader. In such case the SRC registers still indicate that the device was booted from an eMMC instead of serial-download. This commit ports the U-Boot commit [1] with slightly adaptions suggested by Ahmad to Barebox. Also we need to reorder the imx6_init() else we reset the otg-controller to early. [1] https://source.denx.de/u-boot/u-boot/-/commit/e203dcf23e9eabc2e4f3d0b079457cd1516f2081 Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210812083651.3576-1-m.felsch@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | blspec: fix use-after-free of firmware search pathAhmad Fatoum2021-10-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | firmware_set_searchpath() is used to temporarily extend firmware search path when parsing boot spec files. It does so by first freeing the original firmware pointer and then storing a pointer to a copy of the new search path. firmware_get_searchpath() returns this pointer without copying meaning that following sequence causes a use-after-free: old_fws = firmware_get_searchpath(); firmware_set_searchpath(fws); /* calls free(old_fws) */ firmware_set_searchpath(old_fws); Fix this by keeping around a copy of the search path. Fixes: dfebbb0a5944 ("blspec: Set firmware searchpath") Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20210913082957.364440-1-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | virtio: implement remove callbacksAhmad Fatoum2021-10-021-0/+2
|/ | | | | | | | | | | | | | | | | | | | | virtio parent device drivers (e.g. PCI and MMIO) create child devices and free them on remove. The virtio drivers for the child devices (e.g. block and console) however don't unregister with their respective subsystems in the remove callbacks. So these subsystems may have stale pointers pointing at removed devices. This is especially problematic for the console driver, because the virtio console device_d will be removed, but the console itself remains registered leading to a use-after-free as soon as printf is invoked for the previously active console. This leads to a crash when typing reset in https://www.barebox.org/jsbarebox/?graphic=0 Fix this for all virtio drivers. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210916093458.21102-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* crypto: add crypto_memneq()Sascha Hauer2021-07-301-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds crypto_memneq() from Linux for the same reason it is present in Linux. From the commit message adding it: When comparing MAC hashes, AEAD authentication tags, or other hash values in the context of authentication or integrity checking, it is important not to leak timing information to a potential attacker, i.e. when communication happens over a network. Bytewise memory comparisons (such as memcmp) are usually optimized so that they return a nonzero value as soon as a mismatch is found. E.g, on x86_64/i5 for 512 bytes this can be ~50 cyc for a full mismatch and up to ~850 cyc for a full match (cold). This early-return behavior can leak timing information as a side channel, allowing an attacker to iteratively guess the correct result. This patch adds a new method crypto_memneq ("memory not equal to each other") to the crypto API that compares memory areas of the same length in roughly "constant time" (cache misses could change the timing, but since they don't reveal information about the content of the strings being compared, they are effectively benign). Iow, best and worst case behaviour take the same amount of time to complete (in contrast to memcmp). Note that crypto_memneq (unlike memcmp) can only be used to test for equality or inequality, NOT for lexicographical order. This, however, is not an issue for its use-cases within the crypto API. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: partition: implement of_partition_ensure_probedAhmad Fatoum2021-07-181-0/+6
| | | | | | | | | | | | | | The device tree nodes for both barebox environment and state can have phandles that reference partitions. Environment runs at late_initcall level, so deep probe will have populated the device by the time the probe is called. barebox-state however is probed at device_initcall level and thus must take care itself to ensure the partition provider is probed. Add a new of_partition_ensure_probed that does this. It can handle both legacy and new style (fixed) partitions. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210628064517.28636-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/usb-gadget'Sascha Hauer2021-07-189-21/+215
|\
| * bthread: replace blocking bthread_stop with nonblocking bthread_cancelAhmad Fatoum2021-06-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When bthread were first merged, they could be scheduled in any context and bthread_stop could just keep rescheduling until the bthread in question exits after which it would return the exit code. Now that bthreads are only scheduled in command context, bthread_stop also can only be scheduled in command context, making it much less useful and easier to shoot yourself in the foot with. Avoid this by introducing a bthread_cancel function instead that will asynchronously terminate the thread. For most purposes that should be fine, because bthread_stop is used to synchronize cleanup and we can move the cleanup into the thread instead. The only exception is the bthread command, which relies on being able to wait on bthreads to complete. For these __bthread_stop remains available, but should not be used in new code. This fixes a hang that is encountered when the usb mass storage gadget unbind is called from a poller leading barebox to wait indefinitely. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210628070732.16812-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * bthread: remove thread exit codesAhmad Fatoum2021-06-281-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow-up commit will replace blocking bthread_stop with non-blocking bthread_cancel. Prepare for this by dropping exit codes. This is not much of a loss, because most users of bthreads will only call bthread_stop at cleanup time. bthread command is an exception, so have it take manual care of passing around exit codes. As we touch the bthread_stop prototype anyway, rename it to __bthread_stop. This will make it clearer in the future, that it's not meant for driver use. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210628070732.16812-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usbgadget: add support for USB mass storage gadgetAhmad Fatoum2021-06-254-0/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This driver is based on the f_mass_storage drivers in Linux v5.11 and U-Boot v2021.01. Unlike the U-Boot version, it runs asynchronously without blocking the bootloader from doing other tasks, like exporting other USB gadgets at the same time or enabling shell access. With pollers and workqueues, enabling this would need a large rework of the code to be completely callback based, whenever the original Linux code sleeps waiting for events. With the new bthread support, we can actually sleep and handover control to other bthreads until there is actual work to do. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210622082617.18011-9-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usbgadget: refactor usbgadget_register to accept arrayAhmad Fatoum2021-06-251-4/+13
| | | | | | | | | | | | | | | | | | | | usbgadget_register currently takes 6 arguments. Instead of increasing them to 8 to support the new usb mass storage gadget, rewrite it to accept a pointer to a struct with all the options instead. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210622082617.18011-8-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * bthread: implement basic Linux-like completion APIAhmad Fatoum2021-06-251-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | So far, completions made sense only in one direction: The main thread can wait for pollers, but the other way around didn't work. With the new bthread support, any bthread can wait for another to complete(). Wrap this up using the Linux completion API to make porting threaded code easier. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210622082617.18011-6-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * common: bthread: schedule only in command contextAhmad Fatoum2021-06-251-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Originally, I envisioned bthreads as replacement for pollers and workqueues. But even without preemption, having functions you call possibly accessing structures you are iterating over can corrupt memory. This problem exists with pollers as well, but because of their limited scope, it's harder to shoot your foot with them, as you don't keep implicit state between poller activations unlike bthreads, which maintain their stack across context switches. Limit bthread scope instead to be a replacement for workqueues. This still allows us to port some classes of state-machine-in-kthread kernel code, while avoding the aforementioned pitfalls. Cc: Jan Luebbe <j.luebbe@pengutronix.de> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210622082617.18011-5-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * common: move workqueue handling from poller_call() to sched()Ahmad Fatoum2021-06-253-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Workqueues are run out of poller_call, not because of a dependency, but because when they were added, poller_call was directly called from is_timeout. With the addition of bthreads, there is now a general resched() function that runs pollers and switches between bthreads. It makes sense to move workqueue handling there as well to keep scheduling matter contained in a single function. Do so. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210622082617.18011-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/rockchip'Sascha Hauer2021-07-183-0/+6
|\ \
| * | ARM: Rockchip: Add rk3568 supportSascha Hauer2021-06-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This adds basic support for the Rockchip rk3568 SoC. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20210615141641.31577-8-s.hauer@pengutronix.de Link: https://lore.barebox.org/20210621092802.27275-8-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | filetype: Add Rockchip boot image typeSascha Hauer2021-06-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Newer Rockchip SoCs boot images starting with the magic "RKNS". There are older image formats currently not supported, this one is at least supported on the RK3568. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20210615141641.31577-4-s.hauer@pengutronix.de Link: https://lore.barebox.org/20210621092802.27275-4-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | clk: Add clk_name_* functionsSascha Hauer2021-06-211-0/+4
| |/ | | | | | | | | | | | | | | | | | | | | At some places a clk name may be known without having a struct clk * directly. Add some convenience functions to handle this situation and use them in the clk commands. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20210615141641.31577-2-s.hauer@pengutronix.de Link: https://lore.barebox.org/20210621092802.27275-2-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/riscv'Sascha Hauer2021-07-189-1/+422
|\ \
| * | clk: starfive-jh7100: Fix duplicate numbersGeert Uytterhoeven2021-06-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Fixes: 6f92e74e5b94d8e6 ("clk: add initial StarFive clock support") Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Tested-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210624150931.891123-1-geert@linux-m68k.org Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>