summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* 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>
| * | ARM: Rockchip: Add rk3568 specific barebox entry functionSascha Hauer2023-04-032-0/+21
| | | | | | | | | | | | | | | | | | | | | Add a rk3568 specific barebox entry function to simplify board code. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: Rockchip: implement memory read out from controllerAhmad Fatoum2023-04-036-0/+311
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a driver to read out the amount of memory from the DDR controller. The decoding of the registers has been taken from U-Boot. Currently supported are the RK3399 and the RK3568, but decoding should work on other Rockchip SoCs as well. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | ARM: dts: rk356x: Add DMC controller nodeSascha Hauer2023-03-281-0/+5
| | | | | | | | | | | | | | | | | | | | | There's currently no DMC controller node in the upstream dtsi file. Add one until it's there. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | Documentation: booting-linux: document booting specific FIT configurationAhmad Fatoum2023-03-281-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | Apparently, this was so far undocumented, but it's useful in some setups where board type is detected dynamically. Document it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230326112211.2900004-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/misc'Sascha Hauer2023-04-19138-645/+1485
|\ \ \
| * | | ARM: rpi: fixup prefix property from VideoCore FDTAhmad Fatoum2023-04-171-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | barebox will warn about lack of these properties when network booting. To make network booted barebox behave identically to flashed barebox, let's unconditionally copy them from VideoCore FDT into fixed up FDT. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230414183545.2039170-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | of: implement of_copy_propertyAhmad Fatoum2023-04-173-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For use in fixups, it can be useful to copy a property verbatim from the barebox DT to the kernel DT. Add a helper that does just that. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230414183545.2039170-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | net: designware: eqos: pass physical device to DMA APIAhmad Fatoum2023-04-171-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Ethernet interface device is just a child of the physical device with no DT node assigned. As such, it lacks all DMA settings that may be set in the DT. Fix this by using the hardware device instead. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230414145259.3644816-6-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | firmware: zynqmp-fpga: pass physical device to DMA APIAhmad Fatoum2023-04-171-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The manager device is just a child of the physical device with no DT node assigned. As such, it lacks all DMA settings that may be set in the DT. Fix this by using the hardware device instead. Cc: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230414145259.3644816-5-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | net: rtl8169: pass physical device for DMA APIAhmad Fatoum2023-04-171-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It shouldn't matter for now, but DMA API should always be called for the physical device, i.e. the struct device underlying the struct pci_device. This the Ethernet device interface parent, so use that instead. Cc: Denis Orlov <denorl2009@gmail.com> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230414145259.3644816-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: xhci: pass physical device to DMA APIAhmad Fatoum2023-04-172-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The xHCI device is just a child of the DWC3 with no DT node assigned. As such, it lacks all DMA settings that may be set in the DT. Fix this by using the hardware device instead in case the xHCI lacks its own DT node. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230414145259.3644816-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: dwc3: populate parent of xHCI devAhmad Fatoum2023-04-173-8/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reparent xHCIs instantiated from DWC3 controllers to their parents instead of them being direct children of the bus. Apart from improving devinfo/drvinfo output, this should introduce no functional change. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230414145259.3644816-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: misc: onboard_hub: sync compatibles with kernelAhmad Fatoum2023-04-171-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A couple more USB hub compatibles ave been added to the kernel in the meantime, so let's import them. While at it, make onboard_hub_match static. It's not used anywhere else. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230414141703.3112251-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | kbuild: drop reliance on echo -e extension for DT fragmentsAhmad Fatoum2023-04-171-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We are using echo -e, so the \n in the string being echo'd are interpreted. As -e is not POSIX and dash doesn't provide it, we use a strange /usr/bin/env echo -e construct hoping that whatever non-builtin echo is first in the search path supports -e. As the new lines are just used to separate CPP directives, we can just pass the directives as $(CPP) flags. This has the same result, but is portable and avoids NixOS complaining when building barebox. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
| * | | commands: menu: enable help text parsing for sphinx docsAhmad Fatoum2023-04-171-53/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use of the macros is required, so Documentation/gen_commands.py may format it into ReST for the documentation. Reported-by: Leonard Göhrs <l.goehrs@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
| * | | Documentation: barebox environment: recommend a partition type GUID for GPT ↵Marco Felsch2023-04-171-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | partitions The partition type GUID was generated randomly. Having a defined GUID should reduce the risk of collisions in the future. The GUID and a phandle reference to the storage medium could be used as replacement for device-path if the medium supports GPT. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230327131218.247157-1-m.felsch@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | video: fbconsole: implement non-fullscreen fbconsolePhilipp Zabel2023-04-171-14/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let fbconsole cover only part of the screen. Configurable via margin.{left,top,right,bottom} device parameters. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Link: https://lore.barebox.org/20230405130645.2407719-1-p.zabel@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | clock: implement CLOCKSOURCE_MASK in terms of GENMASK_ULLAhmad Fatoum2023-04-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clang doesn't like our implementation of CLOCKSOURCE_MASK: common/clock.c:33:10: warning: shift count >= width of type [-Wshift-count-overflow] .mask = CLOCKSOURCE_MASK(64), ^~~~~~~~~~~~~~~~~~~~ include/clock.h:8:63: note: expanded from macro 'CLOCKSOURCE_MASK' #define CLOCKSOURCE_MASK(bits) (uint64_t)((bits) < 64 ? ((1ULL<<(bits))-1) : -1) So the bits < 64 check we have is apparently not enough to suppress the warning when built with clang. Let's do what the kernel does and use GENMASK_ULL instead to get rid of the last remaining warning when building ARCH=sandbox targettools_defconfig with clang version 16.0.1. Not functional change intended. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230404101914.2244083-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | treewide: remove no-longer needed IMD_USED_OFAhmad Fatoum2023-04-1712-35/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that a __dtb* reference automatically pulls in the IMD tag if support is compiled in, we can drop all IMD_USED_OF and turn the macro into a no-op until we remove it completely. Theoretically, an out-of-tree board could reference a DT via IMD_USED_OF and not actually reference it via __dtb_*_start. So instead of makign IMD_USED_OF a no-top, let's print a warning for a few releases until we remove it completely. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230404101706.2237453-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | scripts: gen-dtb-s: reference OF IMD entries automaticallyAhmad Fatoum2023-04-172-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently require IMD_OF_USED to get the DT compatible into the barebox image data meta section. As the PBL is already referencing the DT to pass it along to barebox proper, let's add a reference from the DT to the image data section to make IMD_OF_USED unnecessary. -- v1 -> v2: - use dword, to fix build for 64-bit (Sascha) - place IMD reference before STRUCT_ALIGNMENT Suggested-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230404101706.2237453-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>