summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* powerpc: Kconfig: fix reference to unknown symbolHEADmasterAntony Pavlov2023-05-121-1/+1
| | | | | | | | | | In Kconfig files, the symbols don't have a CONFIG_ prefix. Fix an unknown Kconfig symbol introduced in d3b8a88d34 ("treewide: rename CONFIG_HAS_ARCH_SJLJ to CONFIG_ARCH_HAS_SJLJ"). Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Link: https://lore.barebox.org/20230512023838.1255762-1-antonynpavlov@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* video: bochs: fix IOMEM usageDenis Orlov2023-05-123-4/+4
| | | | | | | | | | | | | | | | | For the PCI version of the driver, we end up calling IOMEM() twice on both the fb_map and mmio pointers. This happens because we first use pci_iomap() on PCI resources in the bochs_pci_probe() and then explicitly call IOMEM() in the bochs_hw_probe(). However, judging from the parameters of the latter function having __iomem attributes, we should not be remapping them. So, remove those IOMEM calls and instead do explicit remapping in bochs_isa_detect(), which was missing it. Also fix bochs_hw_probe() declaration missing one __iomem. Signed-off-by: Denis Orlov <denorl2009@gmail.com> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230511124743.2878952-1-denorl2009@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mfd: syscon: Remove unused helper syscon_base_lookup_by_pdevnameAlexander Shiyan2023-05-092-21/+0
| | | | | | | | | Nobody uses the exported helper syscon_base_lookup_by_pdevname, to lookup a syscon by device name. Let us remove it. Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com> Link: https://lore.barebox.org/20230505061245.463528-1-eagle.alexander923@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* net: dsa: realtek: fix Kconfig selectsAhmad Fatoum2023-05-091-2/+1
| | | | | | | | | | Unlike Linux, barebox has no CONFIG_FIXED_PHY or CONFIG_IRQ_DOMAIN. The former is implied by CONFIG_PHYLIB and the latter is unneeded, so revise the Kconfig option accordingly. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230503100609.1522959-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: rockchip: bbu: Fix getting active boot slotSascha Hauer2023-05-091-9/+2
| | | | | | | | | | | | | With some TF-A versions the IRAM where the boot information is stored cannot be accessed in normal mode. We therefore copy the information to another place before starting the TF-A. This copy is used for the boot source detection logic, but not yet for the barebox update code which still uses the original information from IRAM. Use the already existing rockchip_bootsource_get_active_slot() to avoid data aborts when trying to detect the active boot slot. Link: https://lore.barebox.org/20230509045055.601772-1-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* block: refuse registering block devices with absurdly large blocksAhmad Fatoum2023-05-081-0/+5
| | | | | | | | | | | Block layer caching can't work if a block is bigger than BUFSIZE which is used for the caching chunks. Instead of ending up with a rdbufsize of 0, which leads to strange errors on device access, just refuse this outright. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230508074612.3313870-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fs: fail gracefully in get_mounted_path/get_cdev_by_mountpathAhmad Fatoum2023-05-081-0/+4
| | | | | | | | | | get_fsdevice_by_path will return NULL if no file system was mounted at location. Returned pointer was dereferenced unconditionally, potentially leading to null pointer dereference. Fix this. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230508074612.3313870-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pcie-designware: Fix dev_get_resource_by_name error checkSascha Hauer2023-05-031-1/+1
| | | | | | | dev_get_resource_by_name() returns an error pointer, fix the check accordingly. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: rockchip: bootm: move image to 4k alignmentSascha Hauer2023-05-031-1/+2
| | | | | | | | The new barebox must be 4k aligned which is not always the case when we skip over the SDRAM initialisation binary. memmove to a suitable place. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: NXP i.MX8MN EVK: Drop unnecessary IMD_USED_OFSascha Hauer2023-05-021-3/+0
| | | | | | | IMD tags are now automatically referenced when the DT itself is referenced. IMD_USED_OF is no longer needed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: rkimage: Use non-deprecated functions for sha256/512Sascha Hauer2023-05-021-9/+13
| | | | | | | SHA256_Init() and SHA512_Init() are deprecated since OpensSSL 3.0. Use EVP functions instead to calculate hashes. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* lib: genalloc: drop reliance on mmio-sram driverAhmad Fatoum2023-05-021-4/+6
| | | | | | | | | | | | The barebox mmio-sram driver just makes SRAMs available as /dev/sramX devices. The genalloc stub depended on it without selecting CONFIG_SRAM. Instead of making this dependency explicit, just call of_address_to_resource and have no dependency on CONFIG_SRAM at all. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230417125158.882170-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: i.MX: bbu: fix compilation without CONFIG_BAREBOX_UPDATEAndreas Kemnade2023-05-021-1/+1
| | | | | | | | | | | Fix include/mach/imx/bbu.h:208:1: error: expected identifier or ‘(’ before ‘{’ token Signed-off-by: Andreas Kemnade <andreas@kemnade.info> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Fixes: 6e0cb133be ("ARM: i.MX: bbu: add FlexSPI update handler") Link: https://lore.barebox.org/20230420195255.1153119-1-andreas@kemnade.info Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* defconfigs: usb-a9g20: update to a working versionWolfram Sang2023-05-021-9/+6
| | | | | | | | | | | | | The defconfig needs to be updated to get a usable barebox: We need bigger malloc because of the increasing kernel size, soft ECC so NAND will work, ifup and relocatable for easier development. Fix the prompt while here. Sadly, because of size restrictions, FAT, NFS, menus, netconsole, and SHA1 have to go. Signed-off-by: Wolfram Sang <wsa@kernel.org> Link: https://lore.barebox.org/20230427184718.105393-3-wsa@kernel.org Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: at91: usb-a926x: remove nand partitions from configWolfram Sang2023-05-021-4/+0
| | | | | | | | | | | | | | We define partitions as well in the board file. Leading to: New partition nand0.at91bootstrap (0x00000000-0x0001ffff) on nand0 overlaps with partition at91bootstrap_raw (0x00000000-0x0001ffff), not creating it cannot create nand0.at91bootstrap: Invalid argument addpart: Invalid argument So, remove it from the config file. Signed-off-by: Wolfram Sang <wsa@kernel.org> Link: https://lore.barebox.org/20230427184718.105393-2-wsa@kernel.org Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: use non-executable stack annotations for blobsAhmad Fatoum2023-05-024-0/+5
| | | | | | | | | | | | | | | | | | | | | | We are building the non-sandbox platforms with -z noexecstack, because the ELF section attributes don't matter. This is different for sandbox, where we compile assembly files directly only for embedding blobs. This currently yields a build warning: binutils-2.39/bin/ld: warning: defaultenv/defaultenv-2-reboot-mode.bbenv.gz.o: missing .note.GNU-stack section implies executable stack binutils-2.39/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker Let's add the non-executable stack annotations, so sandbox may run with non-executable stack. This way we are left with a single linker warning that needs to be resolved: binutils-2.39/bin/ld: warning: barebox has a LOAD segment with RWX permissions Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20230424115548.114858-2-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* test: self: printf: compile test with -Wno-format-securityAhmad Fatoum2023-05-021-0/+1
| | | | | | | | | | | | | For testing purposes, the test code uses a variable for the format string at places, which -Wformat-security doesn't like. The printf test was copied over from the kernel, which sets -Wno-format-security globally. This may not be needed for barebox yet, but let's set at least for this one file. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20230424115548.114858-1-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: multi_v7_defconfig: Enable BCM283X Pinctrl/GPIO driverSascha Hauer2023-05-021-0/+1
| | | | | | | multi_v7_defconfig has everything necessary to build for Rasperry Pi, but the BCM283X Pinctrl/GPIO driver is missing. Enable it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: imx-esdhc: add uSDHC eMMC DDR52 supportAhmad Fatoum2023-04-213-6/+54
| | | | | | | | | | | | | | | | | | The uSDHC available with the i.MX6/7/8 SoCs has support for DDR clock operation. This is enabled by flipping a bit in IMX_SDHCI_MIXCTRL and adjusting the clock divider calculation to account for the automatic internal halving of the clock. Let's do that to speed up boot from eMMC. How much effect this has in practice is not constant. Comparing two Kingston eMMCs: DDR on the older v4.5 connected to an i.MX6 did not yield any difference. On the newer v5.1 one connected to an i.MX8MM, I observe a 70% improvement in sequential read throughput: from 40MiB/s to 69.5 MiB/s. Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230418093040.1865982-5-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: add eMMC DDR52 supportAhmad Fatoum2023-04-212-9/+70
| | | | | | | | | | | | | | | | | | | The maximum card frequency that can be configured by barebox currently is 50MHz for SD and 52MHz for eMMC. Higher speed modes require runtime voltage switching or tuning sequences, which are not yet implemented. Only exception is eMMC's DDR52: This mode was first introduced with MMC 4.4 and can be used even at 3.3V. This commit adds DDR52 support to the core. This introduces no functional change, because host controllers must opt-in by setting the appropriate host capabilities. In cases where it's enabled, bus width determination happens as usual and then if possible, the resulting bus width will be attempted with DDR. If that fails, we revert back to SDR. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230418093040.1865982-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: core: factor out MMC bus width selection for reuseAhmad Fatoum2023-04-211-31/+64
| | | | | | | | | | | Higher speed modes like DDR52 and HS200 can operate at both 8-bit and 4-bit bus widths. To make it easier to support these, split up mci_startup_mmc, so the refactored parts can be called with different timings later on. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230418093040.1865982-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: introduce new dedicated enum mmc_bus_width typeAhmad Fatoum2023-04-212-13/+13
| | | | | | | | | To make it clearer that a bus width of 8 is not equal to integer 8, let's give it a dedicated type. No functional change. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230418093040.1865982-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: core: drop unused DDR/SDR constantsAhmad Fatoum2023-04-211-6/+0
| | | | | | | | | These macros are unused and will be replaced by their Linux counterparts in a follow up patch, so drop them. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230418093040.1865982-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/usb'Sascha Hauer2023-04-19131-3112/+7184
|\
| * usb: gadget: fastboot: Do not dequeue idle requestSascha Hauer2023-03-241-1/+0
| | | | | | | | | | | | | | | | | | | | In fastboot_disable() all endpoints are disabled which will complete all outstanding requests with -ESHUTDOWN. fastboot_unbind() is called after that, so we do not need to deqeueue any requests there. Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20230324082748.987672-1-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: rockchip_v8_defconfig: Enable some commandsSascha Hauer2023-03-241-0/+4
| | | | | | | | | | | | Enable some useful commands, like 'wd', 'usbgadget and 'led' Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: xhci-hcd: Give it some more time to stopSascha Hauer2023-03-241-4/+2
| | | | | | | | | | | | | | | | | | | | On a RK3568 SoC with DWC3 controller it takes about 17us for the controller to halt. Increase the timeout accordingly to avoid warning messages. While at it, remove the duplicate definition of XHCI_MAX_HALT_USEC. Link: https://lore.barebox.org/20230322135055.4093677-1-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: gadget multi: support USB Super SpeedSascha Hauer2023-03-241-1/+1
| | | | | | | | | | | | | | Now that all function drivers support super speed, propagate super speed support in the multi function gadget as well.. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: gadget: u_serial: Put back to list if shutdownSascha Hauer2023-03-241-2/+3
| | | | | | | | | | | | | | We have to put the requests back to the read pool, even if they are shut down, otherwise they are lost. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: gadget: mass storage: Add super speed descriptorsSascha Hauer2023-03-243-14/+74
| | | | | | | | | | | | | | Add super speed descriptors to the USB fastboot gadget. The necessary bits and pieces are taken from Linux-6.3-rc2. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: gadget: fastboot: Add super speed descriptorsSascha Hauer2023-03-241-1/+33
| | | | | | | | | | | | | | Add super speed descriptors to the fastboot gadget. These are taken from U-Boot v2023.04-rc4. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: gadget: dfu: Assign super speed descriptorsSascha Hauer2023-03-241-1/+1
| | | | | | | | | | | | | | DFU uses the same descriptors for full speed and high speed already, just use them for super speed (plus) as well. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: dwc3: sync with Linux-6.3-rc2Sascha Hauer2023-03-247-1646/+3201
| | | | | | | | | | | | | | | | | | | | | | | | Our DWC3 driver is based on a relatively old Kernel driver. Although it is updated from Linux-5.2 once, it still shows traces of an U-Boot driver taken from Linux-3.19. The driver misbehaves in gadget mode, like for example it gets stuck when the USB cable is unplugged and plugged again. Do a fresh port from Linux-6.3-rc2. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * Add dev_WARN_ONCE()Sascha Hauer2023-03-241-0/+13
| | | | | | | | | | | | | | dev_WARN_ONCE() is like WARN_ONCE(), but with a struct device *argument to print device context. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: gadget: update composite.c from Linux-6.3-rc2Sascha Hauer2023-03-245-187/+1275
| | | | | | | | | | | | Sync composite.c with Linux-6.3-rc2. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: gadget: Add super-speed-plus descriptorsSascha Hauer2023-03-248-7/+15
| | | | | | | | | | | | | | Linux upstream usb_assign_descriptors() now takes four sets of descriptors. Add the missing super speed plus descriptors. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * uuid.h: sync with Linux-6.3-rc2Sascha Hauer2023-03-242-35/+40
| | | | | | | | | | | | | | We'll need some things from recent upstream Linux for the upcoming usb update. Just sync with Linux-6.3-rc2. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: gadget: Update core to Linux-6.3-rc2Sascha Hauer2023-03-2410-668/+1725
| | | | | | | | | | | | Our usbgadget stack is quite outdated. Sync core.c with Linux-6.3-rc2. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * driver: Add unregister_driver()Sascha Hauer2023-03-212-0/+19
| | | | | | | | | | | | | | Registering drivers is one thing, getting rid of them another. Add unregister_driver() which is used in the coming USB gadget update. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * phy: Add mode setting supportSascha Hauer2023-03-202-0/+56
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: ch9: Update from Linux KernelSascha Hauer2023-03-205-1022/+1296
| | | | | | | | | | | | | | | | Update ch9.h from Linux-6.3-rc2. Linux has split up the file into a kernel and a uapi portion. We do the same for barebox for easier updating in the future. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: move include files to place where Linux has themSascha Hauer2023-03-20105-156/+156
| | | | | | | | | | | | | | | | | | For easier patch merging and comparison with Linux move the usb gadget files to where Linux has them. For now do a plain git mv include/usb include/linux/usb, eventhough there might be some files which are purely barebox specific. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: gadget: move files to place where Linux has themSascha Hauer2023-03-2022-10/+26
| | | | | | | | | | | | | | For easier patch merging and comparison with Linux move the usb gadget files to where Linux has them. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: gadget: drop gadget_chips.hSascha Hauer2023-03-205-100/+1
| | | | | | | | | | | | | | | | gadget_chips.h is mostly unused and no longer present in upstream Linux, so drop it from barebox as well. The only thing we still need is gadget_is_pxa() which is added to epautoconf.c directly. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * usb: gadget: fastboot: Allocate IN requests when neededSascha Hauer2023-03-201-34/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | fastboot_download_finished() calls fastboot_tx_print() two times in a row and waits for completion in between. Additionally this is called from the completion function from another request. This seems to work for example on the fsl_udc driver, but leads to problems on the DWC3 controller. Instead of re-using the same request over and over again, just allocate a new request when needed. This way we no longer have to poll for its completion before starting a new request. While fixing fastboot on the DWC3 controller this also makes the lifetime of a request clearer. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/rockchip'Sascha Hauer2023-04-1928-116/+621
|\ \
| * | arm: rockchip: add support for CM3 on IO boardRouven Czerwinski2023-04-0510-0/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Working: - RKBIN DDR training (rk3566_ddr_1056MHz_v1.13.bin) - RKBIN TF-A (v1.34) from RKBIN - Environment storage - DHCP, ping and link detection Signed-off-by: Rouven Czerwinski <rouven@czerwinskis.de> Link: https://lore.barebox.org/20230330161101.58529-1-r.czerwinski@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: Rockchip: Do not pass device tree to TF-ASascha Hauer2023-04-051-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The downstream TF-A doesn't cope with our device tree when CONFIG_OF_OVERLAY_LIVE is enabled, supposedly because it is too big for some reason. Otherwise it doesn't have any visible effect if we pass a device tree or not, except that the TF-A fills in the ethernet MAC address into the device tree. The upstream TF-A doesn't use the device tree at all. Pass NULL for now until we have a good reason to pass a real device tree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: Rockchip: make bootsource logic generic to all SoCsAhmad Fatoum2023-04-056-28/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Decoding of the bootsource from the register value can be shared across multiple Rockchip SoCs. Move the code to a common place to allow for that. At least with some TF-A versions the IRAM where the bootsource is stored cannot not be accessed in normal mode, so read it out before we start the TF-A. For this the scratch space is used. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: Rockchip: rk3568: use rk3568_barebox_entry()Sascha Hauer2023-04-054-88/+14
| | | | | | | | | | | | | | | | | | | | | There is a rk3568 specific entry function for barebox now, switch the existing boards over to use it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>