summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* dts: update to v5.13-rc3Sascha Hauer2021-05-2528-34/+98
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: dns: use correct nameserver var name in error messageAntony Pavlov2021-05-251-1/+1
| | | | | | | | | | The commit d5d342d26368c1 ("net: Make domainname and nameserver globalvars") changes net.nameserver variable name to global.net.nameserver. This commit changes the variable name in the error message too. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Link: https://lore.barebox.org/20210525062133.5458-1-antonynpavlov@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: i.MX: nitrogen6x: delete wrong memory node from dtsSascha Hauer2021-05-251-0/+2
| | | | | | | | | | | | | | The nitrogen6x comes in different memory configurations. Remove the hardcoded 1G memory node from the upstream device tree. This fixes booting the 2G variants which otherwise complain with: CRITICAL: mmu: Critical Error: Can't request SDRAM region for ttb at 8ffe4000 Reported-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Tested-by: Michael Olbrich <m.olbrich@pengutronix.de> Link: https://lore.barebox.org/20210525055007.9207-1-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: spi-nor: Add support for gd25q16Michael Olbrich2021-05-251-0/+1
| | | | | | | | | | | | The entry is imported from Linux v5.12. It can befound on new versions of the Boundary Devices i.MX6 Quad Nitrogen6x boards. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210520154929.25131-1-m.olbrich@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Documentation: Update env sources documentationTrent Piepho2021-05-251-6/+10
| | | | | | | | | | | Add CONFIG_DEFAULT_ENVIRONMENT_PATH to the list in the proper place. Update the board env to follow the new pattern for naming and note that, unlike the other directories, one must add code to get this directory in the environment. Link: https://lore.barebox.org/20210519060134.2976676-1-tpiepho@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: protonic: vicut1: disable on-die termination to fix PHY bootstrappingOleksij Rempel2021-05-251-1/+0
| | | | | | | | | | | | | | | | | | | If on-die termination is enabled, the RXC pin of iMX6 will be pulled high. Since we already have an 10K pull-down on board, the RXC level on PHY reset will be ~800mV, which is mostly interpreted as 1. On some reboots we get 0 instead and kernel can't detect the PHY properly. Since the default 0x020e07ac value is 0, it is sufficient to remove this entry from the affected imxcfg files. Since we get stable 0 on pin PHYADDR[2], the PHY address is changed from 4 to 0. Reported-by: Robin van der Gracht <robin@protonic.nl> Fixes: 00adc1e33ef8 ("ARM: add imx6 based Protonic boads") Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.barebox.org/20210518083707.15428-1-o.rempel@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: dwc2: more precise and helpful message for dr_mode config issuesEnrico Jorns2021-05-181-2/+2
| | | | | | | | | | | | | | | | | | | With the previous message I misunderstood that the 'configuration mismatch' was caused by any entity forcing the dr_mode to 'host'/'device'. The actual intention however is to tell the user that the selected 'dr_mode' does not match the capabilities provided by the controller or the selected driver parts (USB_DWC2_HOST/USB_DWC2_GADGET). The updated warning message attempts to reflect this more explicitly. Also rename 'device' to 'peripheral' as it is named both in dtb and in macros that way. Signed-off-by: Enrico Jorns <ejo@pengutronix.de> Acked-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210517124941.31301-1-ejo@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* usb: dwc2: do no print error message with dwc2_warn() macroEnrico Jorns2021-05-181-1/+1
| | | | | | | | | dwc2_warn() is intended for printing 'warning' messages and should thus call dev_warn() instead of dev_err(). Signed-off-by: Enrico Jorns <ejo@pengutronix.de> Link: https://lore.barebox.org/20210517114519.28451-1-ejo@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/x86'Sascha Hauer2021-05-1716-38/+1187
|\
| * watchdog: add support for Intel TCO watchdog timerAhmad Fatoum2021-05-034-0/+365
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Variants of the iTCO are integrated into many Intel southbridges. They are most often accessed via PCI. Add a driver for the variant found in the q35 QEMU machine. It should be straight forward to extend the itco_chipset_info array to support more variants in future as the need arises. To test, use: qemu-system-x86_64 -M q35 -global ICH9-LPC.noreboot=false The last option corresponds to a pin strap option, which can't be influenced from within the VM. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20210416062436.332665-5-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * pci: add EFI PCI root bridge IO protocol driverAhmad Fatoum2021-05-037-0/+700
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | UEFI specifies two protocols for abstracting both the PCI host bus controller and for PCI devices. The protocol for PCI devices provides function pointers for accessing IO Port, Memory and PCI configuration space, among others. The protocol for bus controllers provides the ability to read the root bridge's PCI configuration space and to query resources. In barebox, we would want to reuse existing PCI drivers unmodified, so we utilize the root bridge protocol, unlike most other EFI payloads. We still utilize the PCI (device) IO protocol, but not for core functionality: EFI has already enumerated the bus for us and allocated the EFI handles. It thus makes sense to have the new pci device have the EFI handle as parent and the controller as grand parent instead of being sibling with the EFI handles. This is done with an early PCI fixup that patches the device's parent pointer after consulting the PCI IO GetLocation. Driver is written from scratch and hasn't seen heavy usage yet, so it should be used with care. It was written while consulting the UEFI 2.1D specification. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20210416062436.332665-4-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * PCI: support PCI BIOS preassigned busesAhmad Fatoum2021-05-034-37/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When running under UEFI, barebox should no redo PCI enumeration, because the UEFI implementation will likely already have drivers that won't cope with e.g. BAR addresses changing. The user-visible effect of this is that likely the framebuffer will stop working because the UEFI driver won't be able to access it any longer. Support this configuration by changing the PCI code to consult the new pcibios_assign_all_busses(). When it's true, there is no change to previous behavior. When it's false, reconfiguration is omitted and instead current configuration is read back from the bus. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20210416062436.332665-3-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * x86: add DMA supportAhmad Fatoum2021-05-032-1/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both interconnect and PCI are cache coherent on x86, so we shouldn't need any special CPU barriers for DMA. Indeed, Linux defined neither ARCH_HAS_SYNC_DMA_FOR_CPU nor ARCH_HAS_SYNC_DMA_FOR_DEVICE on x86. It thus seems that the only reordering we need to take care of is compiler-induced reordering. The Linux memory model that barebox adheres to as well demands that all accesses to shared data are volatile. volatile accesses are already guarnateed to not be reordered against each other, so we don't even need an explicit barrier(), which is already the case on other architectures that have a disabled MMU. Cc: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20210416062436.332665-2-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/usb-gadget'Sascha Hauer2021-05-1731-88/+573
|\ \
| * | fs: error out when writing on read-only file systemAhmad Fatoum2021-05-121-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On an ext4 partition, Running echo -a /mnt/disk0.0/file test will crash barebox because fsdrv->truncate in __write is NULL. Don't let it come to this and verify earlier that the FS implements ->write. While at it, explicitly compare with O_RDONLY (== 0) for clarity. Fixes: b3fbfad7aeaf ("fs: dentry cache implementation") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210503114901.13095-17-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | file_list: add file_list_detect_all()Ahmad Fatoum2021-05-122-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a common theme along the code that uses file_lists. Add a function that abstracts it. This could later be used to simplify this operation in the fastboot code. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210503114901.13095-15-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | bbu: add function to directly add handlers into file_listAhmad Fatoum2021-05-123-29/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bbu_handlers_iterate() is only used for merging handlers into a file_list. This can be useful for other update mechanisms as well. Export a bbu_append_handlers_to_file_list that does this. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210503114901.13095-14-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | fastboot/dfu: use system partitions as fall backAhmad Fatoum2021-05-127-37/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the new system partitions infrastructure to have fastboot and DFU fall back to using the same partitions if the global.usbgadget.dfu_function and global.fastboot_partitions are not set, respectively. No functional change intended for configurations that have SYSTEM_PARTITIONS disabled. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210503114901.13095-13-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | file_list: make freeing a NULL pointer a no-opAhmad Fatoum2021-05-122-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | This makes code added into usbgadget in a later commit less verbose. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210503114901.13095-12-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | usbgadget: allow DFU and Fastboot functions to coexistAhmad Fatoum2021-05-121-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the commit, one upon a time the fastboot client tool did not support a device that exports DFU as well. It does nowadays, and while dfu-util 0.9 doesn't, it might some day. Because these host tools are outside of barebox' control, allow both to coexist and just throw a warning that dfu-util might not work. With the new system partitions support, enabled fastboot and DFU mean that autostart would start both as part of the same multi-gadget. This would've failed, but would now just emit a warning. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210503114901.13095-11-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | usbgadget: autostart: fix indeterminism around usbgadget.autostartAhmad Fatoum2021-05-121-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The setter for usbgadget.autostart evaluates other device paramaters, so it must happen postenvironment, otherwise it could run too early and not see the device parameters it depends on. This was observed with usbgadget.dfu_function, which wasn't loaded from the environment early enough, but it now does. While at it, remove some more wonkyness: - usbgadget_autostart_set is only ever called when the IS_ENABLED(CONFIG_USB_GADGET_AUTOSTART), so drop the check - There is no need to make usbgadget.acm specific to autostart. It's behavior now is counter intuitive (enable Kconfig symbol, but don't set global variable and it will have an effect. Disable CONFIG_USB_GADGET_AUTOSTART, which looks completely unrelated and it no longer works. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210503114901.13095-10-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | usb: gadget: dfu: change status message to info log levelAhmad Fatoum2021-05-121-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This used to be a printf, but was changed to pr_err in f6f521ec38ea ("usb: gadget: dfu: Rework print messages"). This is likely unintended as this is an expected output. Change it to pr_info. Fixes: f6f521ec38ea ("usb: gadget: dfu: Rework print messages") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210503114901.13095-9-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | fastboot: handle ill-named partitions gracefullyAhmad Fatoum2021-05-121-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Users can configure a partition name of bbu-something that would conflict at fastboot init time with a barebox update "something" handler. Current behavior is to silently ignore all remaining barebox update handlers. It would be better to complain loudly and to skip only the entries actually conflicting. Do so. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210503114901.13095-8-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | common: add generic system partitions interfaceAhmad Fatoum2021-05-126-0/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both Fastboot and DFU have their own global variables that allow specifying the partitions that can be flashed via the environment. With the upcoming addition of the USB mass storage gadget, we will need some way to define the partitions there as well. Instead of adding yet another way download method-specific variable, add a generic global.system.partitions variable that can be specified on a per-board basis and can be used for all methods. Existing variables will still remain for backwards-compatibility, but when unset, it should fall back to this new parameter. This is done in the follow-up patches. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210503114901.13095-7-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | param: introduce file-list parameter typeAhmad Fatoum2021-05-126-0/+184
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DFU, fastboot and incoming mass storage support all use file lists as input, but individually check syntax correctness only on use. A dedicated file list parameter would improve the user experience and makes the code using it easier to handle: the struct file_list can be passed around directly instead of having to parse it first on use. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210503114901.13095-6-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | common: make FILE_LIST feature unconditionalAhmad Fatoum2021-05-124-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CONFIG_FILE_LIST controls whether the file_list_* family of functions are compiled. common/file-list.o does not register any initcalls and there is no code that is dependent on it being available: it's selected as required. This means linker GC can completely get rid of it if required, so drop the symbol. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210503114901.13095-16-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | vsprintf: introduce %m shorthand for "%s", strerror(errno)Ahmad Fatoum2021-05-031-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have many places across the code base that use either do printf("%s..", errno_str()) or printf("%s..", strerror(errno). We already have %pe support for printing arbitrary errors and it's not much work to add %m to print errno as well. Do so. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210503114901.13095-5-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | string: implement strstarts along with strendsAhmad Fatoum2021-05-033-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Both can be useful when parsing file paths. They are added to different files, because only one of them is available in upstream <linux/string.h>. The other we add to <string.h>, which contains more barebox-specific string functions. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210503114901.13095-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | common: console: add log_writefile to write log into new fileAhmad Fatoum2021-05-032-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It can be useful to dump the log into the file, e.g. when doing an update from a USB flash drive with no serial peer attached. Add a function to facilitate this. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210503114901.13095-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | show_progress: add system wide progress stage notifierAhmad Fatoum2021-05-033-0/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use case is e.g. board code that wants to register a client to light status LEDs to indicate system state when no serial output is available. This functionality doesn't increase code size due to linker GC when CONFIG_PROGRESS_NOTIFIER is disabled. There is a generic progress notifier provided that just logs the status. This could be shared with the booted kernel via pstore or the log as a whole written to a system setup USB drive. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210503114901.13095-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/riscv'Sascha Hauer2021-05-1762-342/+2886
|\ \ \
| * | | RISC-V: add Linux kernel boot supportAhmad Fatoum2021-05-172-0/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Linux kernel RISC-V header has the same structure as on ARM64. The barebox header for the architecture also follows the same structure. Add the architecture-specific glue for barebox to be able to boot both RISC-V Linux and barebox. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210504104513.2640-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | RISC-V: asm: barebox-riscv-head: use load-offset of 0Ahmad Fatoum2021-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Incoming RISC-V bootm implementation will use the same bootm handler for booting both kernel and barebox. For this to work, the load offset in the header needs to make sense. As non-generic DT barebox images have enough knowledge about the platform to know where to place the stack, they don't require a load offset, thus set it to zero. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210504104513.2640-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | bootm: move ARM64 Linux image parsing to common directoryAhmad Fatoum2021-05-174-70/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux on RISC-V adopts the same structure as on ARM64 for both 32- and 64-bit kernel images and it's likely future architectures will as well. In preparation for adding RISC-V Linux boot support, move the bulk of the code to a common location for reusability. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210504104513.2640-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | RISC-V: sifive: add HiFive board supportAhmad Fatoum2021-05-1711-0/+207
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the recently added SiFive support, we now have enough functionality to boot a HiFive board to shell: qemu-system-riscv64 -M sifive_u serial_stdio \ -kernel./images/barebox-hifive-unleashed.img Some more drivers need to be ported for this to be useful: - sifive,spi0 needed for talking to SD-Card - clocksource The riscv-timer seems to be 10x too fast Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210427202309.32077-12-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | gpio: add SiFive GPIO controller supportAhmad Fatoum2021-05-103-0/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The SiFive GPIO controller is a straight forward generic gpio-mmio controller. Only difference is that the number of GPIOs is described by the number of interrupts in the device tree. Import the Linux v5.12 driver to support it. Tested with gpio-restart on qemu-system-riscv64 -M sifive_u. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210427202309.32077-10-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | gpio: generic: sync with upstream Linux gpio-mmio driverAhmad Fatoum2021-05-104-116/+337
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The gpio-mmio driver in Linux v5.12 has evolved quite a bit since the last sync. It now supports big endian byte order, 64-bit registers as well as controllers that have both a dirin and dirout register. The latter is particularly interesting, because it's required for the SiFive GPIO controller ported in a later patch. This commit also touches gpio-mpc8xxx used on the LS1046A. Because bit and byte endianness can now be configured separately, the driver needs adjustment. We don't seem to support any boards that have the peripheral as little-endian, but this is fixed by this commit. Comparing other bgpio_init users with Linux shows no need for further fixups. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210427202309.32077-9-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | gpio: gpio-generic-platform: remove unused non-DT supportAhmad Fatoum2021-05-101-21/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have nothing in-tree matching against either "basic-mmio-gpio" or "basic-mmio-gpio-be" and none should be added, because new platforms should probe from device tree. Remove the unused the non-DT support. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210427202309.32077-8-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | RISC-V: add SBI based cpuinfoAhmad Fatoum2021-05-105-6/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SBI appeared to be especially useful to implement a generic console driver. However, SBI v0.2 removes these services without substitute. We might find other use for it later, but for now, add the bare minimum of querying the version of the running SBI implementation. The cpuinfo command is intentionally kept generic. It can later be extended to support CONFIG_RISCV_M_MODE as well. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210427202309.32077-7-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | RISC-V: erizo: drop mach-erizo directoryAhmad Fatoum2021-05-107-29/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the recent changes, we can now delete mach-erizo. Do so. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210427202309.32077-6-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | RISC-V: erizo: restrict to RV32IAhmad Fatoum2021-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Erizo is a RISC-V 32-bit softcore. Because ARCH_RV32I can be selected independently, a 64-bit barebox images could be built, but the image produced would be useless. Avoid this by not showing the SOC_ERIZO prompt when compiling for 64-bit. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210427202309.32077-5-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | RISC-V: support multi-image for all machinesAhmad Fatoum2021-05-037-43/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We already got rid of arch/riscv/mach-virt. Now do the same for arch/riscv/mach-erizo. This will enable us to build images for all RISC-V boards at once. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210427202309.32077-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | debug_ll: support <asm/debug_ll.h> to get rid of mach directoriesAhmad Fatoum2021-05-032-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux support has no arch/riscv/mach-* directories. If we can get rid of them, we could multi-image build all images at once. Only thing holding us back is <mach/debug_ll.h>. Add <asm/debug_ll.h> as alternative. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210427202309.32077-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | serial: implement SiFive UART supportAhmad Fatoum2021-05-033-0/+181
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Import serial driver from Linux v5.11. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210427202309.32077-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | clk: add SiFive PRCI clock controller supportAhmad Fatoum2021-05-0313-0/+1597
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Import U74 and U54 clock controller support from Linux v5.12. Unlike Linux, dependency wrpll-cln28hpc.c is compiled in unconditionally. Linker garbage collection will take care to omit it if unreferenced. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210427202309.32077-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | RISC-V: delete unused mach-virt subdirectoryAhmad Fatoum2021-05-033-29/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code within was unused and was kept only to make patching the machine for DEBUG_LL easier. Now that we have PBL console support, this is no longer needed, so remove it. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20210410110638.2106658-4-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | RISC-V: board-dt-2nd: add PBL console support for virtAhmad Fatoum2021-05-031-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Virt machine has a ns16550a UART at address 0x10000000. As we reuse the generic DT image for this platform, we can't use either DEBUG_LL or pbl_console as we would need to hardcode information on what UART is available where, which wouldn't be correct for other boards. However, if we parse the board compatible, we could match it with the appropriate PBL console implementation without sacrificing portability. Do so. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20210410110638.2106658-3-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | RISC-V: debug_ll: ns16550: split off debug_ll from generic partsAhmad Fatoum2021-05-032-32/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The early NS16550 code is written for DEBUG_LL and can't be directly used with pbl_set_putc if it's disabled. Split off the generic parts into a new header that can be used by the virt board for PBL console. DEBUG_LL functionality is unaffected. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20210410110638.2106658-2-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | PBL: fdt: implement fdt_device_get_match_dataAhmad Fatoum2021-05-033-0/+56
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the generic DT image can't properly have a PBL console, because it's only known at runtime what system we are running on. As we already parse the FDT in the PBL to get the memory regions, we could extract the board compatible as well and determine which UART to use. Add a helper to achieve this. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20210410110638.2106658-1-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/misc'Sascha Hauer2021-05-178-23/+39
|\ \ \