summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next/rsa'Sascha Hauer5 days1-1/+6
|\
| * rsa: Add iterator for rsa keysSascha Hauer2022-05-041-0/+4
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * rsa: Collect keys on listSascha Hauer2022-05-041-1/+2
| | | | | | | | | | | | | | | | Currently there is no way to iterate over all available RSA keys. This patch collects all keys on a list so we can add an iterator in the next step. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/of-board'Sascha Hauer5 days2-0/+12
|\ \
| * | of: add generic of_prepend_machine_compatible()Oleksij Rempel2022-05-052-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | Add generic function to extend/fixup machine compatible. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.barebox.org/20220503091220.3871612-4-o.rempel@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | common: add $global.serial_number with device tree fixupAhmad Fatoum2022-05-051-0/+3
| |/ | | | | | | | | | | | | | | | | | | | | This new variable can be set by boards from C code or from the environment to change the serial number fixed up into the kernel device tree. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.barebox.org/20220503091220.3871612-2-o.rempel@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer5 days2-0/+50
|\ \ | |/ |/|
| * ata: disk_ata_drive: clean up code in ata_dump_id()Denis Orlov2022-04-291-0/+5
| | | | | | | | | | | | | | | | Add missing macros and fix misspellings. Signed-off-by: Denis Orlov <denorl2009@gmail.com> Link: https://lore.barebox.org/20220426123434.18865-1-denorl2009@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * video: omap-fb: Rework to enable COMPILE_TEST optionAlexander Shiyan2022-04-251-0/+45
| | | | | | | | | | | | | | | | | | | | | | To add a compilation check for the omap-fb driver, move the omap-fb.h header to a global location. The "omap_add_display" function is used only for legacy boards, so we will move it to a common place for such calls (omap_devices.c). Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com> Link: https://lore.barebox.org/20220422071158.14631-1-eagle.alexander923@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2022-04-212-0/+2
|\ \ | |/
| * libfile: implement new pread_fullAhmad Fatoum2022-03-281-0/+1
| | | | | | | | | | | | | | | | We already have pwrite_full, add pread_full for symmetry. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220318144942.498124-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * gpio: include header for BIT() used in <gpio.h>Ahmad Fatoum2022-03-281-0/+1
| | | | | | | | | | | | | | | | | | e.g. GPIOF_ACTIVE_HIGH/LOW uses currently depend on another header defining BIT(). Remedy this. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220321111115.1569232-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/dsa'Sascha Hauer2022-04-219-3/+1871
|\ \
| * | add ethlog commandOleksij Rempel2022-04-191-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is kind of tcpdump or tshark for barebox. Instead of starting application it will let barebox dump everything to the console by still allowing to use other application. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.barebox.org/20220413082205.429509-15-o.rempel@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | hexdump: provide support for dev_print_hex_dump()Oleksij Rempel2022-04-191-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | In some cases we need to know the interface name of dumped hex. So, provide optional device_d pointer and use it to get device name. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.barebox.org/20220413082205.429509-14-o.rempel@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: dsa: add KSZ9477 switch SPI driverOleksij Rempel2022-04-141-0/+1665
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for Microchip KSZ9477 switch. With this driver we will be able to use KSZ9477 switch as port multiplexer. This driver is partially based on u-boot v2022.04-rc5: drivers/net/ksz9477.c and on the kernel v5.17 code: drivers/net/dsa/microchip/ksz9477.c Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.barebox.org/20220413082205.429509-13-o.rempel@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | of_net: add rev-rmii supportOleksij Rempel2022-04-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for the revert RMII device tree property. It is needed for SJA1105 switch driver. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.barebox.org/20220413082205.429509-11-o.rempel@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: mdio: add MDIO_DEVAD_NONE defineOleksij Rempel2022-04-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | We need it for SJA11xx driver. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.barebox.org/20220413082205.429509-9-o.rempel@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | spi: port spi_sync_transfer() function from kernel v5.17Oleksij Rempel2022-04-141-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | This function is needed for SJA11xx switch driver Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.barebox.org/20220413082205.429509-8-o.rempel@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: port part of if_vlan header from kernel v5.17Oleksij Rempel2022-04-141-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | This header is needed for SJA11xx switch driver Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.barebox.org/20220413082205.429509-7-o.rempel@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | driver: add dev_get_priv() helperOleksij Rempel2022-04-141-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add dev_get_priv() to make driver porting easier. Needed for SJA11xx switch driver. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.barebox.org/20220413082205.429509-6-o.rempel@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: add DSA framework to support basic switch functionalityOleksij Rempel2022-04-141-0/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add DSA based port multiplexing functionality for barebox. With this framework we will be able to use different ports of as switch separately. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.barebox.org/20220413082205.429509-5-o.rempel@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: phy: export of_phy_register_fixed_link() functionOleksij Rempel2022-04-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | We will need this function by DSA framework Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.barebox.org/20220413082205.429509-4-o.rempel@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: add of_find_eth_device_by_node() functionOleksij Rempel2022-04-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | For DSA support we need to find MAC node by phandle from the switch port node. So, provide of_find_eth_device_by_node() to solve this task. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.barebox.org/20220413082205.429509-3-o.rempel@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: add RX preprocessor supportOleksij Rempel2022-04-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add callback for optional rx_preprocessor. This is needed to add DSA switch support and demultiplex traffic received from different switch ports. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.barebox.org/20220413082205.429509-2-o.rempel@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | mtd: peb: Add mtd_peb_read_file()Sascha Hauer2022-04-211-0/+2
|/ / | | | | | | | | | | Analog to mtd_peb_write_file() this adds a mtd_peb_read_file() Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | usb: gadget: mass-storage: reference count allocations used in bthreadAhmad Fatoum2022-03-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since 997cca0f15dc ("bthread: replace blocking bthread_stop with nonblocking bthread_cancel"), the bthread may survive longer than the multigadget unbind. This didn't cause issues so far, because the multi gadget unbind didn't call usb_put_function[_instance] for mass-storage (but did so for other functions), so we just leaked the memory. In preparation for fixing the memory leak, we will need to straighten out the mass storage cleanup. We do so by reference counting the two shared structures: If bthread runs before usb_put_function[_instance], it will not free them yet (avoiding a double free) and if bthread runs after usb_put_function[_instance], it will still be able to access them (avoiding a use-after-free). A cleaner way would've been to wait for bthread completion, but we can't do that here, because gadget could be unbound in a poller and bthreads are only scheduled in command context. Fixes: 997cca0f15dc ("bthread: replace blocking bthread_stop with nonblocking bthread_cancel") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220319110246.2850396-5-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | usb: gadget: implement and use system_partitions_get_nullAhmad Fatoum2022-03-281-0/+8
|/ | | | | | | | | | | | | system_partitions_get() clones the system partitions file list and returns the copy. usb multi gadget code expects disabled gadgets to have a NULL file list, not an empty one, so fastboot and DFU handle this case. Add a new system_partitions_get_null helper that can be used instead. This will be used for USB mass storage gadget as well in a follow-up commit. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220319110246.2850396-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/stm32'Sascha Hauer2022-03-1411-18/+1168
|\
| * clk: stm32mp1: sync with Linux v5.17-rc1Ahmad Fatoum2022-03-082-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | Linux has meanwhile extended the RCC driver to support both reset and clocks as well as peaceful co-existence with the SCMI driver. Import these changes into barebox and remove the reset controller handling from the old RCC reset driver. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220220124736.3052502-22-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * reset: add support for reset_control_statusAhmad Fatoum2022-03-082-0/+8
| | | | | | | | | | | | | | | | | | Driver code may want to query status of a reset line. Add an optional callback for drivers to provide this. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220220124736.3052502-21-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * clk: implement of_clk_hw_{onecell,simple}_getAhmad Fatoum2022-02-231-0/+17
| | | | | | | | | | | | | | | | These functions are easily implemented and make porting code easier. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220220124736.3052502-19-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * clk: accept const arguments in clk_to_clk_hw/clk_hw_to_clkAhmad Fatoum2022-02-231-4/+4
| | | | | | | | | | | | | | | | | | Driver code may want to pass const pointers into these functions. Change the implementation to support this. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220220124736.3052502-17-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * firmware: import Linux v5.13 SCMI supportAhmad Fatoum2022-02-235-0/+768
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ARM System Control and Management Interface (SCMI) is a standard way to offload handling of system resources like clocks, resets and power domain handling to the firmware. This should replace Silicon Provider specific conduits for new SoCs. Systems where this is already relevant: - STM32MP1: For trusted boot, the clock and reset controller are managed from secure world. This is not yet supported by barebox and must be disabled in TF-A - RK3568: At least the CPU clock is only controllable via SCMI - i.MX8X: Communication with the SCU occurs via SCMI Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220220124736.3052502-13-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: smccc: sync header with upstreamAhmad Fatoum2022-02-231-14/+349
| | | | | | | | | | | | | | | | | | For upcoming SCMI over SMC support, we'll need a newer version of the header. Import it from v5.13-rc1. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220220124736.3052502-12-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * filetype: detect TF-A Firmware Image Packages (FIP)Ahmad Fatoum2022-02-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | FIP is the new format for firmware loaded by ARM Trusted Firmware. It can contain non-secure firmware, hardware config (device tree), firmware config (configuration DT) and optionally OP-TEE. In future, we may want to mount FIP to chain boot barebox out of it, but for now, just let barebox filetype detect it correctly. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220220124736.3052502-6-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/of-deep-probe'Sascha Hauer2022-03-141-0/+21
|\ \
| * | of: platform: Ensure timers are probed earlySascha Hauer2022-03-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Timers are a very crucial resource and are needed early. Without them no delay function can work properly. With deep probe enabled they may be initialized very late in the initialization order. Make sure they are probed early. We do not know which device node provides the timer, so probe all nodes named "timer". Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | of: Add of_find_node_by_name() with Linux semanticsSascha Hauer2022-03-081-0/+20
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | of: rename of_find_node_by_name() to of_find_node_by_name_address()Sascha Hauer2022-03-081-8/+8
| |/ | | | | | | | | | | | | | | | | | | | | | | | | of_find_node_by_name() has the same name as the corresponding kernel function but a different semantics. A node name is comprised of the nodes name and a unit address, separated with '@'. Linux of_find_node_by_name() matches only the name before the '@' whereas the barebox function compares the full name. As several callers depend on the barebox semantics we can't just change the semantics, so rename the barebox function to of_find_node_by_name_address(). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | compiler: add support for fallthrough attributeAhmad Fatoum2022-03-081-0/+21
| | | | | | | | | | | | | | | | | | Use of it is enforced in Linux now, so code we'll port may contain it. Import the definition. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20220302201215.658986-1-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | phy: core: Make 'phy_optional_get' return NULL when not implementedDaniel Brát2022-03-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Make 'phy_optional_get' return NULL instead of ERR_PTR(-ENOSYS) when the CONFIG_GENERIC_PHY is not enabled. It makes more sense to return NULL instead of straight up throwing a error since the function has 'optional' in its name. This also fixes dwc2 usb driver which would previously fail inside its probe function despite being able to function without a phy just fine. Signed-off-by: Daniel Brát <danek.brat@gmail.com> Link: https://lore.barebox.org/20211020083954.3787-1-danek.brat@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | clk: Enable clk_bulk_* functions only with CONFIG_COMMON_CLKSascha Hauer2022-03-081-144/+149
|/ | | | | | | | | | | | | | | | | | Some architectures have CONFIG_HAVE_CLK defined, but have their own clk implementations instead of the generic one enabled with CONFIG_COMMON_CLK. The clk_bulk_* static inline stubs are only enabled with !CONFIG_HAVE_CLK. Trying to compile one of these architectures fails with undefined references to the clk_bulk_* functions when they are used, because they are not implemented on these architectures. Instead of letting the compilation fail let the clk_bulk_* functions depend on CONFIG_COMMON_CLk. This means these architectures compile with the static inline stubs which is enough to let for example the EHCI driver compile and work (because they don't need clks for the EHCI). Should one of these architectures really need working clk_bulk_* functions it should be converted to the common clk framework. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/video'Sascha Hauer2022-02-184-1/+282
|\
| * video: add MIPI DBI Type C Option 3 supportAhmad Fatoum2022-02-083-0/+275
| | | | | | | | | | | | | | | | | | Import the Linux v5.15 state of the driver to allow easy porting of MIPI-DBI displays like the Ilitek 9431 added in a follow-up commit. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220202223023.341817-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * gpiolib: implement gpiod_set_valueAhmad Fatoum2022-02-071-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Linux gpiod_set_value is silent if the GPIO descriptor is NULL, but barebox warns about it. Also having gpio_set_value not respect active low/high, while Linux gpiod_set_value respects it is error-prone. Add a new gpiod_set_value function that covers this. gpio == -ENOENT is taken as the dummy value for optional GPIOs. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220202223023.341817-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/tests'Sascha Hauer2022-02-181-1/+1
|\ \
| * | of: report whether of_diff found differences in return codeAhmad Fatoum2022-02-071-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | Tests may want to leverage of_diff to verify that fixups proceeded as expected. of_diff lends itself nicely to that by being silent in case of success and just reporting diff on error. Add a return code to make it usable in follow-up tests. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220207082801.1052894-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/stm32'Sascha Hauer2022-02-184-4/+147
|\ \
| * | clk: add clock driver for stm32f4 and stm32f7Ahmad Fatoum2022-02-012-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>