summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* stringlist: Add adding sort uniqSascha Hauer2021-03-161-0/+1
| | | | | | | Function to add an entry sorted to a string list only when it doesn't exist. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* video: add simplefb driverAhmad Fatoum2021-03-011-0/+46
| | | | | | | | | | | | barebox has support to fix up a framebuffer it has set up as simplefb into the device tree of a kernel it boots. Add the counterpart to this, so barebox itself can reuse an already set up frame buffer. This is done to support the framebuffer device on the tinyemu RISC-V machine. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/virtio'Sascha Hauer2021-02-2213-0/+1911
|\
| * block: add VirtIO block device driverAhmad Fatoum2021-02-221-0/+203
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this driver enabled, -device virtio-blk-device can now be passed to Qemu for barebox to detect a VirtIO block device mapping a host file or block device. If barebox is passed as argument to the Qemu -kernel option, no device tree changes are necessary. Example: $ qemu-system-arm -m 256M -M virt -nographic \ -kernel build/images/barebox-dt-2nd.img \ -device virtio-rng-device \ -drive if=none,file=/tmp/first.hdimg,format=raw,id=hd0 \ -device virtio-blk-device,drive=hd0 \ -drive if=none,file=/tmp/second.hdimg,format=raw,id=hd1 \ -device virtio-blk-device,drive=hd1 Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * serial: add basic VirtIO console driverAhmad Fatoum2021-02-221-0/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this driver enabled, -device virtio-serial-device can now be passed to Qemu for barebox to detect a VirtIO console device. If barebox is passed as argument to the Qemu -kernel option, no device tree changes are necessary. Example: $ qemu-system-arm -m 256M -M virt -nographic \ -kernel build/images/barebox-dt-2nd.img \ -device virtio-serial-device \ -chardev socket,path=/tmp/foo,server,nowait,id=foo \ -device virtconsole,chardev=foo,name=console.foo Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * drivers: add support for memory-mapped VirtIO paravirtualizationAhmad Fatoum2021-02-2211-0/+1630
| | | | | | | | | | | | | | | | | | | | | | Sandbox is only useful to test barebox in isolation. For interaction between barebox and firmware/OS, Qemu is the better choice. Qemu supports specifying VirtIO devices on the command line, which it automatically fixes up into the device tree. This is nice. Add support for that. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/usb'Sascha Hauer2021-02-221-6/+0
|\ \
| * | usb: host: ehci: remove duplicated usb_host_detect() callsAhmad Fatoum2021-02-011-6/+0
| |/ | | | | | | | | | | | | | | With the last patch adding a fallback detect, we no longer need the duplication in the host controller drivers. Drop them. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/sound'Sascha Hauer2021-02-224-0/+258
|\ \
| * | sound: add PWM beeper supportAhmad Fatoum2021-02-081-0/+33
| | | | | | | | | | | | | | | | | | | | | This driver can be used to drive a piezo-buzzer attached to a PWM. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | sound: add basic synthesizers for PCM beeper useAhmad Fatoum2021-02-082-0/+176
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For beeping on PCM sound cards, barebox will need to synthesize samples. Add basic sine and square wave synthesizers to achieve this. Client code can either call __synth_F to explicitly select synth F or synth_F, which depending on CONFIG_SYNTH_SQUARES may expand to either __synth_F or a gain-adjusted __synth_generate_square. The latter is mainly useful for slow systems that can't synthesize enough sine samples in a poller without impacting boot performance. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | drivers: add sound card driver supportAhmad Fatoum2021-02-082-0/+49
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add driver core boilerplate for sound support in barebox. Using the provided API in <sound.h>, consumers can play beeps for a fixed duration of time. Playing beeps is not blocking and new beeps can be enqueued while one is already playing. They will be played in succession by a poller, which will also turn off the sound card when the beep tune is over. API is also available for blocking until all beeps are played and for cancelling an underway beep tune. The API could be later extended for arbitrary PCM audio, should the need arise. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/nvmem'Sascha Hauer2021-02-221-5/+38
|\ \
| * | nvmem: make nvmem_device_write/read publicMarco Felsch2021-01-191-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | Those functions already export their symbols so make it public available. Compared to the nvmem_device_cell_read/write() APIs these functions are a bit easier to use. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | nvmem: add missing stubsMarco Felsch2021-01-191-0/+14
| | | | | | | | | | | | | | | | | | | | | Add missing stubs for nvmem_device_cell_read/write(). Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | nvmem: sync stub return values with linux codeMarco Felsch2021-01-191-5/+5
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on linux commit: 8<------------------------------------------------------------------------ commit 20167b70c894f20cd01e2579fad206de440816ef Author: Bartosz Golaszewski <bgolaszewski@baylibre.com> Date: Fri Sep 21 06:40:22 2018 -0700 nvmem: use EOPNOTSUPP instead of ENOSYS Checkpatch emits warnings when using ENOSYS. Some of the frameworks started using EOPNOTSUPP as return values for API functions when given subsystem is disabled in Kconfig. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> 8<------------------------------------------------------------------------ Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2021-02-223-1/+7
|\ \
| * | pbl: provide externally visible fdt_find_memAhmad Fatoum2021-02-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | of_find_mem can be used for generic DT images for other architectures as well. To support this, move the definition, so it can be used by others in the future. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | watchdog: Print seconds to expireSascha Hauer2021-02-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a parameter to the watchdog devices that shows what we think when the watchdog expires. The watchdog should reset the system once the counter hits zero. When the system resets earlier or the counter shows negative values then there might be problems with the watchdog. Useful for debugging watchdog related problems. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | efi: declare prototype for close_protocol BootServiceAhmad Fatoum2021-02-161-1/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | | | Sometimes, drivers need to probe whether the EFI device in front of them is the actual hardware they expect. If it's not, the driver should call close_protocol to leave the decision on whether to match this device to another driver. Use the correct type for close_protocol to facilitate this. No functional change, as no in-tree driver makes use of this yet. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/imx'Sascha Hauer2021-02-221-0/+80
|\ \
| * | ARM: i.MX: move BCB structures to header filePrimoz Fiser2021-02-011-0/+80
| |/ | | | | | | | | | | | | | | | | Move i.MX BCB related structures to header file so they can be used by others. Signed-off-by: Primoz Fiser <primoz.fiser@norik.com> Signed-off-by: Andrej Picej <andrej.picej@norik.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/ext4'Sascha Hauer2021-02-224-16/+14
|\ \
| * | copy_file: fix progress bar for files larger than 2GAhmad Fatoum2021-02-191-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Files larger than 2G cause the benign bug, that the progress bar is no longer accurate. Use loff_t to fix this. Note that printed % HASHES_PER_LINE in show_progress implies a 64-bit division. A previous commit changed the constant divisor to a power of two, so a division shouldn't be generated. The original multiplication and modulo operations are left as is for clarity. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | block: use 64-bit types for sector offset and count on all platformsAhmad Fatoum2021-02-183-14/+10
| |/ | | | | | | | | | | | | | | | | | | | | barebox' use of int for the sector offset puts an upper bound of 1TB on the size of supported block devices, which is already exceeded by common place USB mass storage. Increasing the sizes involved to 64 bit like Linux does won't magically add missing driver support, but it gives us at least a fighting chance. Do so. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/asm-io'Sascha Hauer2021-02-222-0/+83
|\ \
| * | printk: port over Linux print_hex_dump_bytes/print_hex_dump_debugAhmad Fatoum2021-02-041-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | print_hex_dump in barebox always prints a hex dump. Most users use it for debugging though, so import Linux helpers to do so to cut down on the #ifdef DEBUG. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | asm-generic: define fallback memcpy and memset for device I/OAhmad Fatoum2021-02-041-0/+55
| |/ | | | | | | | | | | | | | | | | The Atmel quadspi driver makes use of the memcpy_(to|from)io, but we don't define them on all platforms. Fix this to allow for easier porting of kernel code. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/asm-generic'Sascha Hauer2021-02-225-4/+219
|\ \
| * | include: asm-generic: don't do 64-bit soft division on 64-bit platformsAhmad Fatoum2021-02-191-1/+215
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | barebox implements do_div() as soft division unconditionally, even on 64-bit platforms that could use hardware 64-bit division directly. Import the whole Linux asm-generic/div64.h header to avoid this. This also has potential positive effect on 32-bit platforms: 64-bit division with constant divisors can now be optimized into multiplications and shifts at compile time. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | treewide: include <linux/math64.h> wrapper instead of <asm-generic/div64.h>Ahmad Fatoum2021-02-193-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | <asm-generic/div64.h> isn't meant for direct usage as <asm/div64.h> may override this on a per-architecture basis. We don't do that currently, but in the future we might. Include the <linux/math64.h> instead. No functional change. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | include: <linux/math64.h>: include header for __always_inline definitionAhmad Fatoum2021-02-191-0/+1
| |/ | | | | | | | | | | | | | | | | | | The Linux <linux/math64.h> depends on __always_inline being defined prior. Fix this at our side now to avoid a build failure when using it to replace <asm-generic/div64.h> later on. Fixes: f933da28cf3f ("include: <linux/math64.h>: sync with upstream") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | regulator: add driver for stm32-vrefbufAhmad Fatoum2021-02-101-0/+5
| | | | | | | | | | | | | | | | | | | | This driver supports STMicroelectronics STM32 VREFBUF (voltage reference buffer) which can be used as voltage reference for internal ADCs, DACs and also for external components through dedicated Vref+ pin. Ported from Linux v5.11-rc1. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | regulator: add support for struct regulator_desc::off_on_delayAhmad Fatoum2021-02-101-0/+2
| | | | | | | | | | | | | | | | We already honour the enable time in the device tree, read it out of a new regulator_desc::off_on_delay as well, same as Linux does. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | regulator: add regulator_get_voltage() to APIAhmad Fatoum2021-02-101-0/+21
|/ | | | | | | | | | | ADC drivers need to query their reference regulator's voltage to format their raw readings. Provide regulator_get_voltage() so ADC drivers need not hardcode a reference voltage. Regulator drivers that don't support this (i.e. nearly everything in-tree) will have the function return with -EINVAL. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2021-01-192-5/+211
|\
| * include: <linux/math64.h>: sync with upstreamAhmad Fatoum2021-01-071-5/+206
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The header implements definitions for the 64-bit division helpers on 64-bit builds only. For 32-bit builds, it can only provide prototypes and the actual implementation will need to come from elsewhere. We didn't have any out-of-line definitions in barebox with the result that functions like div_s64_rem() were so far only usable in 64-bit barebox builds. On 32-bit builds, they would result in a linker error. Import the Linux v5.11-rc1 generic out-of-line 64-bit math on 32-bit implementation to fix this. While at it, synchronize the header to reduce diff to upstream. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * driver: provide dev_request_mem_resource_by_name() helperAhmad Fatoum2021-01-051-0/+5
| | | | | | | | | | | | | | | | | | | | | | There are both dev_request_mem_resource() and dev_request_mem_region(), which return the struct resource and a IOMEM(.start) respectively. There is only dev_request_mem_region_by_name(), but no dev_request_mem_resource_by_name(), so add the latter for symmetry. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/imx'Sascha Hauer2021-01-192-9/+2
|\ \
| * | ddr: imx8m: remove bogus definesLucas Stach2021-01-061-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Most of those defines aren't used. Whether DDR_ONE_RANK should be defined is really dependent on the used DRAM on a specific board, so move this from the common header into the board DRAM setup. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ddr: imx8m: implement i.MX8MQ supportLucas Stach2021-01-061-2/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | The i.MX8MQ uses a different PLL type than the later i.MX8M family members, so the PLL setup did not actually work on this SoC. In U-Boot the used PLL setup routine is a compile time decision. As we want our DRAM init code to work for multi-image builds, this passes the SoC type through to the PLL init, so we can use the correct setup routine depending on the SoC we are running on. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | image-sparse: change retlen to size_tSteffen Trumtrar2021-01-131-1/+1
| | | | | | | | | | | | | | | | retlen can potentially overflow. Also, write_full() in fastboot_handle_sparse() expects size_t anyway. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | MIPS: ls1b200: move ls1b-clk.h to include/dt-bindingsSascha Hauer2021-01-071-0/+21
|/ | | | | | | | files in dts/ are overwritten with the next dts update. Move file that was accidently committed there to a place where it doesn't get overwritten. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/rpi'Sascha Hauer2020-12-111-0/+1
|\
| * ARM: rpi: Add Raspberry Pi Zero W mini-uart supportAhmad Fatoum2020-12-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Unlike the Raspberry Pi 1 and Raspberry Pi Zero, the Raspberry Pi Zero W has its console pins on the header connected to the mini-uart, not the PL011. The secondary PL011 UART is connected to the bluetooth module. Set the mini-uart as default console and disable the PL011. That way we can use the Raspberry Pi 1 image for the Zero W as well. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/mtd'Sascha Hauer2020-12-112-1/+19
|\ \
| * | mtd: Add hook to fix up kernel partitionsSascha Hauer2020-11-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Some drivers have special requirements for fixing up the partition nodes for the kernel. This adds a hook to struct mtd_info that can be used by drivers to replace the generic fixup with a special one. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | of: partitions: export of_fixup_partitionsSascha Hauer2020-11-251-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | of_partitions_register_fixup() tries to automatically determine the node to fixup. Sometimes this doesn't work, so add of_fixup_partitions() that can called at fixup time with a device node determined by subsystem or driver code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | of: Add no-op wrappers for of reproducible name functionsSascha Hauer2020-11-251-0/+11
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | mtd: Remove set but not used of_pathSascha Hauer2020-11-251-1/+0
| | | | | | | | | | | | | | | | | | struct mtd_info member of_path is set but not used, remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>