summaryrefslogtreecommitdiffstats
path: root/include/linux
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next/stm32'Sascha Hauer2022-02-183-4/+143
|\
| * clk: add clock driver for stm32f4 and stm32f7Ahmad Fatoum2022-02-011-0/+5
| | | | | | | | | | | | | | | | | | Port over the Linux v5.16 state of the clock driver. Tested on a STM32F429. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220131075725.1873026-13-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * clk: gate: add clk_hw registration functionsAhmad Fatoum2022-02-011-0/+11
| | | | | | | | | | | | | | | | | | | | Save users the hassle of opencoding by providing wrappers with the same Linux semantics: names are duplicated, same arguments and struct clk_hw is returned. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220131075725.1873026-11-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * clk: implement of_clk_add_hw_providerAhmad Fatoum2022-02-011-0/+13
| | | | | | | | | | | | | | | | New Linux drivers rather use of_clk_add_hw_provider, so port it over. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220131075725.1873026-10-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * clk: mux: export clk_mux_round_rateAhmad Fatoum2022-02-011-0/+3
| | | | | | | | | | | | | | | | | | Clock drivers may want to implement round rate for their custom clocks in term of clk_mux_round_rate. Export the function to facilitate this. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220131075725.1873026-9-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * clk: mux: add clk_hw registration functionsAhmad Fatoum2022-02-011-0/+27
| | | | | | | | | | | | | | | | | | | | Save users the hassle of opencoding by providing wrappers with the same Linux semantics: names are duplicated, same arguments and struct clk_hw is returned. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220131075725.1873026-8-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * clk: define clk_hw_registerAhmad Fatoum2022-02-011-0/+5
| | | | | | | | | | | | | | | | | | Save users the hassle of opencoding by providing a wrapper with the same Linux semantics: same arguments and return type. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220131075725.1873026-7-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * clk: clk-fixed: add clk_hw registration functionsAhmad Fatoum2022-02-011-0/+4
| | | | | | | | | | | | | | | | | | | | Save users the hassle of opencoding by providing wrappers with the same Linux semantics: names are duplicated, same arguments and struct clk_hw is returned. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220131075725.1873026-6-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * clk: fixed-factor: add clk_hw registration functionsAhmad Fatoum2022-02-011-0/+4
| | | | | | | | | | | | | | | | | | | | Save users the hassle of opencoding by providing wrappers with the same Linux semantics: names are duplicated, same arguments and struct clk_hw is returned. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220131075725.1873026-5-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * clk: divider: add clk_hw registration functionsAhmad Fatoum2022-02-011-0/+11
| | | | | | | | | | | | | | | | | | | | Save users the hassle of opencoding by providing wrappers with the same Linux semantics: names are duplicated, same arguments and struct clk_hw is returned. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220131075725.1873026-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * clk: composite: add clk_hw registration functionsAhmad Fatoum2022-02-011-0/+8
| | | | | | | | | | | | | | | | | | | | Save users the hassle of opencoding by providing wrappers with the same Linux semantics: names are duplicated, same arguments and struct clk_hw is returned. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220131075725.1873026-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * clk: Move clk_hw_get_num_parents out of ifdefSascha Hauer2022-02-011-5/+5
| | | | | | | | | | | | | | clk_hw_get_num_parents() is defined inside without OF support. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * string: define new memdup_arrayAhmad Fatoum2022-01-311-0/+3
| | | | | | | | | | | | | | | | | | This will come in handy later for duplicating parent arrays when doing clock registration. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220131075725.1873026-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * reset: add simple reset controller supportAhmad Fatoum2022-01-311-0/+45
| | | | | | | | | | | | | | | | | | Incoming STM32 MCU support will leverage this driver, so port it over from Linux v5.16. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220131075338.1869305-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | compiler: fix __attribute__((format(printf, sandbox incompatibilityAhmad Fatoum2022-02-071-2/+2
|/ | | | | | | | | | | | | | | | | On sandbox, we define printf to barebox_printf for the non-sandbox specific parts to avoid clashing with the libc-provided symbol. This is substituted into the definition of __printf, leading to test/self/printf.c:37:1: warning: ‘barebox_printf’ is an unrecognized format function type [-Wformat=] Avoid this by using the equivalent reserved keyword, which doesn't clash. While at it, be a little future proof and do the same for scanf as well. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220207075604.1014259-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/spdx'Sascha Hauer2022-01-1969-0/+138
|\
| * include: add SPDX-License-IdentifierAhmad Fatoum2022-01-0569-0/+138
| | | | | | | | | | | | | | | | | | All these files lack a license statement, so add the default GPL-2.0-only. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220103120539.1730644-7-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | clk: propagate error pointers in clk_hw_to_clk and clk_to_clk_hwAhmad Fatoum2022-01-141-2/+2
| | | | | | | | | | | | | | | | | | This will make porting helpers easier, because it's harder to miss error checking. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20220114065953.698483-2-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | clk: change clk_get_num_parents into clk_hw_get_num_parentsAhmad Fatoum2022-01-141-2/+2
| | | | | | | | | | | | | | | | | | | | There is no clk_get_num_parents in Linux, but clk_hw_get_num_parents. Our only users uses it with a clk_hw, so adjust the function accordingly. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20220114065953.698483-1-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | include: <linux/compiler.h>: delete __ADDRESSABLE macroAhmad Fatoum2022-01-051-10/+0
| | | | | | | | | | | | | | | | | | | | The macro is non-functional, because it requires linker script changes. Instead of doing those and risking breakage, just drop it. These can be done when the macro is actually needed. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220103115824.1725086-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | include: spinlock.h: define dummy for DEFINE_SPINLOCKAhmad Fatoum2022-01-051-0/+2
| | | | | | | | | | | | | | | | This allows easier porting of code that uses spinlocks. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220103115824.1725086-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | include: <linux/overflow.h>: add missing includeAhmad Fatoum2022-01-051-0/+1
|/ | | | | | | | | SIZE_MAX needs to be defined for functions defined inline within the header. Include appropriate header. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220103115824.1725086-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2021-12-152-0/+31
|\
| * include: <linux/build_bug.h>: define static_assertAhmad Fatoum2021-12-131-0/+19
| | | | | | | | | | | | | | | | | | BUILD_BUG_ON can't be used outside of a function, unlike static_assert. Import the macro definition. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211209105817.3518258-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * driver: implement dev_err_probe()Ahmad Fatoum2021-11-251-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | The function like it's Linux equivalent is meant to be used during driver probe whenever an error occurs that would lead to aborting the probe. This allows moving EPROBE_DEFER checks out of drivers and in future could allow selectively compiling out only error probe messages, as they are mainly interesting during bring up. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211030175926.2277259-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/efi'Sascha Hauer2021-12-153-5/+4
|\ \
| * | include: <linux/nls.h>: remove duplicate wchar_t typedefAhmad Fatoum2021-11-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | We already define it in <linux/stddef.h> as typedef of an unsigned short. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211122084732.2597109-17-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 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>
* | 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-011-0/+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: add dedicated header for printf/printkAhmad Fatoum2021-11-013-15/+175
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* Merge branch 'for-next/misc'Sascha Hauer2021-10-071-2/+5
|\
| * net: add virtio network driverAhmad Fatoum2021-10-051-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge branch 'for-next/layerscape'Sascha Hauer2021-10-071-0/+305
|\ \
| * | 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>
* / 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>
* Merge branch 'for-next/usb-gadget'Sascha Hauer2021-07-181-0/+55
|\
| * 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>
* | Merge branch 'for-next/rockchip'Sascha Hauer2021-07-181-0/+4
|\ \
| * | 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-181-0/+7
|\ \
| * | reset: add device_reset_all helperAhmad Fatoum2021-06-241-0/+7
| |/ | | | | | | | | | | | | | | | | | | | | Some StarFive peripherals have 5 resets that need to be triggered in order. Add a helper to simplify this. The Linux way of doing this would be to import the reset_control_array API, but device_reset_all as implemented here saves us from this boilerplate. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210619045055.779-27-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/nvmem'Sascha Hauer2021-07-182-0/+10
|\ \
| * | nvmem: add command to list nvmem devicesAhmad Fatoum2021-06-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When doing development around nvmem devices, it can be useful to list which ones exist. Add a command to facilitate this. It can be extended in future as the need arises (e.g.export cells into the environment?). Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210619034516.6737-10-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | nvmem: add support for nvmem-cells bindingAhmad Fatoum2021-06-211-0/+8
| |/ | | | | | | | | | | | | | | | | | | | | | | Recently, nvmem cell and MTD partition bindings were made to coexist: Partitions can now be compatible = "nvmem-cells"; which registers a NVMEM provider and interprets its child nodes as cells. Teach barebox about this. This allows fetching NVMEM cells from MTD partitions and hostfiles. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210619034516.6737-5-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>