summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next/ssd1307'Sascha Hauer2022-01-192-0/+15
|\
| * i2c: stub device_i2c_driver if I2C is disabledMichael Tretter2022-01-031-0/+5
| | | | | | | | | | | | | | | | | | This allows drivers that support multiple buses to keep the code for registering their I2C variant even if I2C is disabled. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Link: https://lore.barebox.org/20211223160404.119970-4-m.tretter@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * spi: add to_spi_device helperMichael Tretter2022-01-031-0/+5
| | | | | | | | | | | | | | | | | | Port the helper to get the spi_device from the device_d from Linux. This macro makes SPI device drivers look a bit nicer. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Link: https://lore.barebox.org/20211223160404.119970-3-m.tretter@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * spi: stub device_spi_driver if SPI is disabledMichael Tretter2022-01-031-0/+5
| | | | | | | | | | | | | | | | | | This allows drivers that support multiple buses to keep the code for registering their SPI variant even if SPI is disabled. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Link: https://lore.barebox.org/20211223160404.119970-2-m.tretter@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/spdx'Sascha Hauer2022-01-19141-1/+281
|\ \
| * | include: add SPDX-License-IdentifierAhmad Fatoum2022-01-05140-1/+279
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | treewide: add SPDX-License-Identifier for .gitignoreAhmad Fatoum2022-01-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Makes the files not appear when searching for files that lack SPDX-License-Identifier. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220103120539.1730644-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/misc'Sascha Hauer2022-01-1915-17/+134
|\ \ \
| * | | regmap: Implement regmap_[set|clear]_bits()Sascha Hauer2022-01-181-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | regmap_[set|clear]_bits() are useful shortcuts to regmap_update_bits(). Implement them. 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>
| * | | pinctrl: stm32: replace magic values with defines for STM32_PINMODEAhmad Fatoum2022-01-141-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Makes the code easier to follow and allows using the new macros in PBL code for early pinmuxing of e.g. the debug UART. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20220114065943.698337-1-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | commands: add new devunbind debugging commandAhmad Fatoum2022-01-141-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Memory corruption around device removal may go unnoticed, because barebox is shutting down anyway and doing no new allocations. Add a new devunbind command that should help with debugging such issues by allowing selective unbinding and removal of devices. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220113160414.3943151-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | tlsf: dump stack on assertion failureAhmad Fatoum2022-01-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We only support AddressSanitizer on ARM, ARM64 and sandbox. For other platforms TLSF assertions may detect some nconsistency, like some double frees. Make the reports more useful by dumping stack in that case. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220113160414.3943151-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | commands: add new tutorial commandAhmad Fatoum2022-01-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have a web demo at http://barebox.org/jsbarebox and it would be nice to have a tutorial there. Add a new tutorial command that cycles through a number of tips. Tutorial will follow later. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220108171555.588426-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | fs: implement pushd/popd chdir wrappersAhmad Fatoum2022-01-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We don't have dirfd's, so running operations relative to the current working directory always involves some allocation/freeing boilerplate. Add pushd/popd helpers to move the boilerplate out of the callsites. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220108171555.588426-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | include <printk.h>: include <linux/types.h> for size_t definitionAhmad Fatoum2022-01-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | size_t is used without previous definition relying on header include order. Fix that up. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220108171437.586532-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | acpi.h: add defines for adr_space and gasSteffen Trumtrar2022-01-101-0/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >From linux v5.15-rc1. Signed-off-by: Steffen Trumtrar <str@pengutronix.de> Link: https://lore.barebox.org/20220107134219.1031552-1-s.trumtrar@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | drivers: virtio: import list of newer Virtio IDsAhmad Fatoum2022-01-101-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are unused now. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20220107080104.135200-1-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | parseopt: drop unused, duplicate, parseopt_u16Ahmad Fatoum2022-01-051-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We always have sizeof(unsigned short) == sizeof(uint16_t), so parseopt_u16() is exactly equivalent to parseopt_hu(). The former is unused anyway, so just drop it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220103120205.1728778-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | x86: remove reference to empty fileAhmad Fatoum2022-01-051-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This might have been needed in the past when there was legacy boot machine support. Now there isn't, so we can just delete it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220103115824.1725086-5-a.fatoum@pengutronix.de 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/kvx'Sascha Hauer2022-01-191-0/+1
|\ \ \
| * | | common: elf: add elf_load_binaryClement Leger2022-01-181-0/+1
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | In order to load elf from a binary buffer, add elf_load_binary. This will be used by FIT support to allow loading an elf from FIT. Signed-off-by: Clement Leger <clement.leger@bootlin.com> Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu> Link: https://lore.barebox.org/20220117221917.26970-5-jmaselbas@kalray.eu Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / | Revert "clk: handle CLK_OF_DECLARE in deep probe"Sascha Hauer2022-01-181-6/+0
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | This issue is now solved differently in: | commit 2f9aeab92f51d7b224468f6cd62d7cbbb05ceb1e (master) | Author: Lucas Stach <dev@lynxeye.de> | Date: Sun Jan 16 22:32:19 2022 +0100 | | clk: ignore of_device_ensure_probed error in clock lookup This reverts commit bd516e38dd1490cb83b58f8f7914912f3a702978. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / regulator: respect "regulator-always-on" propertyEnrico Jorns2022-01-051-1/+2
|/ | | | | | | | | | | | As barebox ignored this property, a regulator could have been disabled even if it should not have been. By taking the same path as for 'regulator-boot-on', we ensure always holding an enable count > 0 on the regulator. Signed-off-by: Enrico Jorns <ejo@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220103115718.1723730-6-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2021-12-155-2/+34
|\
| * crypto: crc32: add big endian CRC implementationAhmad Fatoum2021-12-131-0/+1
| | | | | | | | | | | | | | | | | | This implementation is a straight copy of the tableless implementation inside Linux' lib/crc32.c Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211209105832.3518384-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * 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>
| * debug_ll: ns16550: Fix interrupt disable on initJules Maselbas2021-11-221-1/+1
| | | | | | | | | | | | | | | | | | | | The debug_ll_write_reg function takes first the register and secondly the value to write, which in this call were inverted. Fix the argument order. Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu> Link: https://lore.barebox.org/20211004073842.14809-1-jmaselbas@kalray.eu Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/efi'Sascha Hauer2021-12-1515-47/+695
|\ \
| * | of: implement new of_property_sprintfAhmad Fatoum2021-12-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Board code may compute values for device tree properties and write them as strings. Make this easier by adding a of_property_write_string variant that does formatted output. This also saves an allocation, because asprintf buffer is reused. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211209105708.3517684-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | efi: add efi_device hook to be called before an image is startedSascha Hauer2021-12-131-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | boot_services::open_protocol supports opening protocols exclusively. A protocol that is opened exclusively can not be used anymore by an application that is called via boot_services::start_image. We want to open the SNP protocol exclusively in the next step. That would mean a chainloaded barebox could no longer use the SNP protocol because it's exclusively opened by the current barebox already. To work around this a efi_drv::dev_pause and efi_drv::dev_continue is introduced. The former is called before an application is started and the latter right after an application has exited. This will be used by the SNP network driver to enter/leave exclusive mode. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | efi: Implement device_path_to_subtype()Sascha Hauer2021-12-131-0/+1
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | efi: move device-path defines and types to header fileSascha Hauer2021-12-131-0/+388
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | partitions: efi: move header to central locationAhmad Fatoum2021-12-131-0/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | The header contains GUIDs and definitions that will become applicable outside of the GPT partition parser as well, so move them out. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211122084732.2597109-27-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | efi: define and use new EFI_ERROR_MASK macroAhmad Fatoum2021-12-131-32/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | Future code may want to differentiate between warnings and errors, so add a new macro for the error mask and use it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211122084732.2597109-24-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | efi: make efi_main __noreturnAhmad Fatoum2021-12-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | The function never returns, so mark it as such. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211122084732.2597109-23-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | lib: implement wcsnlenAhmad Fatoum2021-11-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | This will come in handy for implementing %ls in the follow up commit. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211122084732.2597109-19-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | lib: wchar: add wctomb and mbtowcAhmad Fatoum2021-11-251-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently convert wchar_t to char by truncating to 8-bit. In future, we may want to do UTF-16 to UTF-8 conversion. Prepare for this by wrapping each conversion direction in a function. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211122084732.2597109-18-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | 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>
| * | efi: centralize efivarfs_parse_filenameAhmad Fatoum2021-11-251-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Turning an EFI varfs filename into its components will be useful for the EFI loader as well, so factor that out. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211122084732.2597109-15-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | efi: rename <efi/efi.h> to <efi/efi-payload.h>Ahmad Fatoum2021-11-252-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The split between <efi.h> and <efi/efi.h> is confusing: The former contains universal definitions, while the latter contains barebox utilities on top. To make the distinction clear, rename <efi/efi.h> to <efi/efi-payload.h> as it's used for EFI payloads. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211122084732.2597109-14-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | efi: factor out errno translationAhmad Fatoum2021-11-252-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | The errno translation will come in handy for the EFI loader support, so factor that out. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211122084732.2597109-13-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | efi: use SPDX-License-Identifier where appropriateAhmad Fatoum2021-11-253-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Couple of files lack an explicit embedded license or contain boilerplate. Replace with the appropriate SPDX-License-Identifier. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211122084732.2597109-11-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | serial: efi-stdio: move efi-stdio.h header to central locationAhmad Fatoum2021-11-251-0/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | EFI loader will provide simple text input/output protocols, so it makes sense to reuse the same definitions for both loader and payload. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211122084732.2597109-10-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | asm-generic: move sync_caches_for_execution declaration to <asm/cache.h>Ahmad Fatoum2021-11-251-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have three architectures defining sync_caches_for_execution(). Have them all do so in a header of the same name to allow using it in common code later on, like in an EFI image loading routine. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211122084732.2597109-8-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>