summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* fit: Use digest_verify() to verify hashesHEADmasterSascha Hauer5 days1-7/+1
| | | | | | | Use digest_verify() to verify hashes rather than open code it. This simplifies the code a bit. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* password: Use crypto_memneq() to compare hashesSascha Hauer5 days1-2/+3
| | | | | | | | Cryptographic verifications should be time-constant so that an attacker cannot get information about the secrets used by observing the system, so use crypto_memneq() rather than memcmp() to compare password hashes. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* crypto: digest: use crypto_memneq()Sascha Hauer5 days1-2/+5
| | | | | | | When verifying a digest it is important not to leak timing information through memcmp(). Use crypto_memneq() instead. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* crypto: add crypto_memneq()Sascha Hauer5 days3-0/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds crypto_memneq() from Linux for the same reason it is present in Linux. From the commit message adding it: When comparing MAC hashes, AEAD authentication tags, or other hash values in the context of authentication or integrity checking, it is important not to leak timing information to a potential attacker, i.e. when communication happens over a network. Bytewise memory comparisons (such as memcmp) are usually optimized so that they return a nonzero value as soon as a mismatch is found. E.g, on x86_64/i5 for 512 bytes this can be ~50 cyc for a full mismatch and up to ~850 cyc for a full match (cold). This early-return behavior can leak timing information as a side channel, allowing an attacker to iteratively guess the correct result. This patch adds a new method crypto_memneq ("memory not equal to each other") to the crypto API that compares memory areas of the same length in roughly "constant time" (cache misses could change the timing, but since they don't reveal information about the content of the strings being compared, they are effectively benign). Iow, best and worst case behaviour take the same amount of time to complete (in contrast to memcmp). Note that crypto_memneq (unlike memcmp) can only be used to test for equality or inequality, NOT for lexicographical order. This, however, is not an issue for its use-cases within the crypto API. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Revert "sandbox: hostfile: move initcall to earlier postcore level"Ahmad Fatoum2021-07-181-1/+1
| | | | | | | | | | | | | | The hostfile driver provides nvmem cells, which are consumed optionally by power and watchdog driver. Without deep probe there was no way to differentiate between a nvmem cell that has no provider at all and one with a provider that wasn't yet probed. The workaround is to move hostfile driver probe to an earlier initcall level. Now with deep probe support, this is no longer needed, thus revert commit 33be33ea617514df622a2a468b426e8a628c87e8. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210628064517.28636-8-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: turn into deep probe platformAhmad Fatoum2021-07-181-2/+14
| | | | | | | | | With previous commits sorting out the few remaining issues holding sandbox back from using deep probe, we can now enable it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210628064517.28636-7-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nvmem: support deep probeAhmad Fatoum2021-07-181-0/+13
| | | | | | | | | | | | | | | | With deep probe, drivers referencing nvmem-cells should make sure their providing nvmem device is already probed. The nvmem cell already takes care to find out the device node providing the cell. The real provider that should be probed is then either: - If the node is in a nvmem-cells partition, the provider is the parent node (skipping a possible fixed-partitions node in-between) - Otherwise, the provider is the parent node of the cell Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210628064517.28636-6-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* state: support deep probeAhmad Fatoum2021-07-181-0/+4
| | | | | | | | | | | | With deep probe, drivers registered before of_populate_initcall must themselves take care to ensure their dependencies had a chance to probe. For barebox-state, this means the backend partition provider must be probed. Do so by calling of_partition_ensure_probed on it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210628064517.28636-5-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: partition: implement of_partition_ensure_probedAhmad Fatoum2021-07-182-0/+17
| | | | | | | | | | | | | | The device tree nodes for both barebox environment and state can have phandles that reference partitions. Environment runs at late_initcall level, so deep probe will have populated the device by the time the probe is called. barebox-state however is probed at device_initcall level and thus must take care itself to ensure the partition provider is probed. Add a new of_partition_ensure_probed that does this. It can handle both legacy and new style (fixed) partitions. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210628064517.28636-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: fix probe order dependency between watchdog and powerAhmad Fatoum2021-07-181-8/+6
| | | | | | | | | | | | | | | | With incoming changes to enable deep probe for sandbox, watchdog driver may be probed before power driver, which so far didn't happen. Because the watchdog driver writes the same NVMEM cell read by the power driver, the original value of the nvmem cell (used for $global.system.reset) will be lost. Work around this by writing the WDG reset reason only at first watchdog enable which is guaranteed to happen after power driver probe. We don't need to reset the nvmem cell on watchdog disable, because all other reset methods will already overwrite the cell with the correct value. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210628064517.28636-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: power: set $global.system.reset=POR on poweroffAhmad Fatoum2021-07-181-3/+11
| | | | | | | | | | | | | | | | Now that the stickypage is a regular hostfile, it survives poweroff. This $global.system.reset will only be POR on first boot. For subsequent boots, the power driver must itself take care to write POR to the nvmem cell. While at it remove two minor issues: - src_offset is unused - len is used to store a length into. Its original value is unused Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210628064517.28636-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/zynqmp'Sascha Hauer2021-07-1810-0/+238
|\
| * Documentation: zynqmp: add some documentationMichael Tretter2021-06-251-0/+40
| | | | | | | | | | | | | | | | | | Add at least some information how Barebox can be used on the ZynqMP and what is required to create a bootable image. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Link: https://lore.barebox.org/20210624150054.1205422-8-m.tretter@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: zynqmp: defconfig: enable more featuresMichael Tretter2021-06-251-0/+23
| | | | | | | | | | | | | | | | | | Enable network, file system, and PSCI support in the defconfig to get a Barebox with a useful feature set when building the ZynqMP defconfig. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Link: https://lore.barebox.org/20210624150054.1205422-7-m.tretter@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: zynqmp: zcu104: register update handlerMichael Tretter2021-06-252-0/+19
| | | | | | | | | | | | | | | | | | | | | | As the zcu104 stores the environment in the same partition as the barebox image, the partition is already mounted in ENV_MNT_DIR ("/boot"). Therefore, the update handler has to use the already existing mount point for the update. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Link: https://lore.barebox.org/20210624150054.1205422-6-m.tretter@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: zynqmp: add update handlerMichael Tretter2021-06-253-0/+70
| | | | | | | | | | | | | | | | | | | | | | | | The ZynqMP boots from an SDHCI device by reading a boot.bin file from the FAT16/32 partition, which is the first partition in the MBR. The update handler copies a boot.bin image to this partition, which might be board specific. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Link: https://lore.barebox.org/20210624150054.1205422-5-m.tretter@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * dts: zcu104: add Barebox environmentMichael Tretter2021-06-251-0/+10
| | | | | | | | | | | | | | | | | | | | Use the same partition on the SD-card that is used by the ROM loader to find the BOOT.BIN (which contains the FSBL and Barebox) to store the Barebox environment. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Link: https://lore.barebox.org/20210624150054.1205422-4-m.tretter@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * clk: zynqmp: do not enable already enabled clocksMichael Tretter2021-06-251-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pmu fw manages the permissions who can enable/disable the clocks. There are a few clocks (TOPSW_LSBUS and LSBUS) which are exposed to Barebox and Barebox assumes that is has to enable the clocks. However, the pmu fw considers the clocks under its control and returns a permission denied for the clock enable request. Assume that clocks that are already enabled don't need to be enable by Barebox to avoid the permission denied errors. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Link: https://lore.barebox.org/20210624150054.1205422-3-m.tretter@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: zynqmp: set reset sourceMichael Tretter2021-06-252-0/+73
| | | | | | | | | | | | | | | | | | | | | | | | The reset reason is available in the APB register set on the ZynqMP. Read the reset reason and set the reset source accordingly. There might be multiple bits set in the APB register. Use the MSB for determining the actual reset source. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Link: https://lore.barebox.org/20210624150054.1205422-2-m.tretter@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/usb-gadget'Sascha Hauer2021-07-1827-148/+3621
|\ \
| * | bthread: add options to create and delete dummy bthreadsAhmad Fatoum2021-06-281-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With few bthread users currently, it can be useful to spin up some threads to test stuff. Add a new option to add one more thread into the mix and another to remove one of these dummy threads. Unlike the existing -v option that can also be stacked, these threads remain active after command termination unless explicitly removed. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210628070732.16812-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | bthread: replace blocking bthread_stop with nonblocking bthread_cancelAhmad Fatoum2021-06-284-44/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When bthread were first merged, they could be scheduled in any context and bthread_stop could just keep rescheduling until the bthread in question exits after which it would return the exit code. Now that bthreads are only scheduled in command context, bthread_stop also can only be scheduled in command context, making it much less useful and easier to shoot yourself in the foot with. Avoid this by introducing a bthread_cancel function instead that will asynchronously terminate the thread. For most purposes that should be fine, because bthread_stop is used to synchronize cleanup and we can move the cleanup into the thread instead. The only exception is the bthread command, which relies on being able to wait on bthreads to complete. For these __bthread_stop remains available, but should not be used in new code. This fixes a hang that is encountered when the usb mass storage gadget unbind is called from a poller leading barebox to wait indefinitely. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210628070732.16812-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | bthread: remove thread exit codesAhmad Fatoum2021-06-284-38/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow-up commit will replace blocking bthread_stop with non-blocking bthread_cancel. Prepare for this by dropping exit codes. This is not much of a loss, because most users of bthreads will only call bthread_stop at cleanup time. bthread command is an exception, so have it take manual care of passing around exit codes. As we touch the bthread_stop prototype anyway, rename it to __bthread_stop. This will make it clearer in the future, that it's not meant for driver use. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210628070732.16812-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | usbgadget: add support for USB mass storage gadgetAhmad Fatoum2021-06-2513-4/+3347
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This driver is based on the f_mass_storage drivers in Linux v5.11 and U-Boot v2021.01. Unlike the U-Boot version, it runs asynchronously without blocking the bootloader from doing other tasks, like exporting other USB gadgets at the same time or enabling shell access. With pollers and workqueues, enabling this would need a large rework of the code to be completely callback based, whenever the original Linux code sleeps waiting for events. With the new bthread support, we can actually sleep and handover control to other bthreads until there is actual work to do. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210622082617.18011-9-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | usbgadget: refactor usbgadget_register to accept arrayAhmad Fatoum2021-06-253-25/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | usbgadget_register currently takes 6 arguments. Instead of increasing them to 8 to support the new usb mass storage gadget, rewrite it to accept a pointer to a struct with all the options instead. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210622082617.18011-8-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | Documentation: devel: background-execution: update bthread docsAhmad Fatoum2021-06-251-23/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using bthreads throughout means we'll need finer grained locking across the code base, which is too big a commitment for now. Previous commit limited bthread_reschedule to only happen in command context, like how it is for workqueues. Adjust the docs appropriately. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210622082617.18011-7-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | bthread: implement basic Linux-like completion APIAhmad Fatoum2021-06-251-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far, completions made sense only in one direction: The main thread can wait for pollers, but the other way around didn't work. With the new bthread support, any bthread can wait for another to complete(). Wrap this up using the Linux completion API to make porting threaded code easier. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210622082617.18011-6-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | common: bthread: schedule only in command contextAhmad Fatoum2021-06-253-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Originally, I envisioned bthreads as replacement for pollers and workqueues. But even without preemption, having functions you call possibly accessing structures you are iterating over can corrupt memory. This problem exists with pollers as well, but because of their limited scope, it's harder to shoot your foot with them, as you don't keep implicit state between poller activations unlike bthreads, which maintain their stack across context switches. Limit bthread scope instead to be a replacement for workqueues. This still allows us to port some classes of state-machine-in-kthread kernel code, while avoding the aforementioned pitfalls. Cc: Jan Luebbe <j.luebbe@pengutronix.de> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210622082617.18011-5-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | common: move workqueue handling from poller_call() to sched()Ahmad Fatoum2021-06-257-27/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Workqueues are run out of poller_call, not because of a dependency, but because when they were added, poller_call was directly called from is_timeout. With the addition of bthreads, there is now a general resched() function that runs pollers and switches between bthreads. It makes sense to move workqueue handling there as well to keep scheduling matter contained in a single function. Do so. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210622082617.18011-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | bthread: add debug print for scheduler context switchesAhmad Fatoum2021-06-251-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When debugging around bthreads, it's often useful to log context switches. Make this easier by adding a ready-to-use pr_debug at the correct location. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210622082617.18011-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | input: virtio: poll from poller, not bthreadAhmad Fatoum2021-06-252-26/+22
| |/ | | | | | | | | | | | | | | | | | | | | With the upcoming move of bthreads to be scheduled only in command context, long running tasks (i.e. bareDOOM) may no longer process VirtIO input in a timely manner. Move the input polling into a poller, so input can once again be processed between frames. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210622082617.18011-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/usb'Sascha Hauer2021-07-182-2/+2
|\ \
| * | usb: ehci: Fix unitialized variableSascha Hauer2021-06-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | buffer_dma is not really used unitialized, but the compiler doesn't realize this. Initialize it explicitly. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20210617142545.7375-1-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | usb: storage: Improve messageSascha Hauer2021-06-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of printing a "Using index %d for the new disk" without any context, use dev_info() to print the device context and also "disk%d" which is the name of the new device. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20210617141452.3117-1-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/rockchip'Sascha Hauer2021-07-1854-79/+8456
|\ \ \
| * | | arm: rk3568-evb1: add support for Rockchip SARADCMichael Riesch2021-06-282-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net> Link: https://lore.barebox.org/20210624160915.21897-3-michael.riesch@wolfvision.net Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | aiodev: add driver for Rockchip SARADCMichael Riesch2021-06-283-0/+206
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds support for the Successive Approximation Register (SAR) ADCs that can be found in Rockchip SoCs, such as the RK3568. Signed-off-by: Michael Riesch <michael.riesch@wolfvision.net> Link: https://lore.barebox.org/20210624160915.21897-2-michael.riesch@wolfvision.net Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | ARM: rockchip_v8_defconfig Disable ARC_EMAC driverSascha Hauer2021-06-281-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ARC_EMAC driver uses 32bit DMA pointers and is not ready for compilation on 64bit platforms. It is not needed in the rockchip_v8_defconfig, so disable it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | pinctrl: rockchip: Register gpios as deviceSascha Hauer2021-06-281-50/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The gpio device nodes are subnodes of the pinctrl device node, so we can register a regular driver for it. With this deep-probe support finds a driver for the gpio device nodes and of_device_ensure_probed() can correctly work on the gpio nodes. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20210625140524.1584-1-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | ARM: Rockchip: rk3568 EVB: Add eMMC pinmuxSascha Hauer2021-06-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The eMMC relied on reset default pinmux. This doesn't work when not booting from eMMC, so add pinmux. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20210625065722.26149-1-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: dwc3: Use _io functions on dma coherent memorySascha Hauer2021-06-281-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On both ARM and ARM64 we map DMA coherent memory the same as IO memory. This has the effect that unaligned accesses are not possible on DMA coherent memory. The dwc3 gadget driver uses memset() and memcpy() on that memory which may generate unaligned accesses and result in data aborts. Use memcpy_fromio() and memset_io() instead which are desgined to work on IO space and thus do not generate unaligned accesses. The alternative would be to map DMA coherent memory as MT_NORMAL_NC instead of MT_DEVICE_nGnRnE, but that require us to add memory barriers to drivers which we currently do not have. SO instead of risking regressions in drivers we take the easy way out and avoid unaligned accesses in the dwc3 driver. In this concrete case the dwc3 driver generated unaligned accesses on a Rockchip RK3568 ARM64 system. The driver copies data out of the receive queue. In my case first 4 bytes were copied, both source and target were aligned. The second access then copied more data beginning at the place where the first memcpy stopped. On this 4byte aligned address memcpy generated an 8byte read access which resulted in a data abort. On an ARM32 system this might not be a problem as that place, while not 8byte aligned, is still 4byte aligned, enough for a 32bit system. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20210622074545.17059-1-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | ARM64: Implement mem*_*io()Sascha Hauer2021-06-282-1/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds memset_io(), memcpy_fromio() and memcpy_toio(). These have not been defined for ARM64 previously. The code is directly taken from the Kernel. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20210622075413.6659-1-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | ARM: Rockchip: rk3568 EVB: Add USB supportSascha Hauer2021-06-281-0/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable the USB nodes for the ports found on the rk3568 EVB board. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20210622064711.14058-5-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | ARM: Rockchip: rk3568: Add USB nodesSascha Hauer2021-06-281-0/+213
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The RK3568 has two DWC3 cores and two EHCI/OHCI cores. Add these nodes to the dtsi file. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20210622064711.14058-4-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | phy: rockchip: Add naneng-combphy supportSascha Hauer2021-06-283-0/+615
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds driver for the PCIe/USB3.0/SATA phy found on Rockchip RK3568 SoCs. The driver has been taken from the Rockchip downstream Kernel repository. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20210622064711.14058-3-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | phy: Rockchip: Add driver for usb2phySascha Hauer2021-06-285-0/+991
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a driver for the Rockchip usb2phy. The driver has been taken from U-Boot which has the same codebase as the Kernel driver, but is easier to port over. Some features like clk provider support have been added from the kernel then. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20210622064711.14058-2-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | usb: ehci: Handle clocks and physSascha Hauer2021-06-281-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The generic ehci binding also describes clocks and a phy. Add support for these properties to the driver. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20210622064711.14058-1-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | clk: rockchip rk3568: Register softrst handlerSascha Hauer2021-06-281-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | Register softrst handler to allow resetting the board. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | Add rockchip_v8_defconfigSascha Hauer2021-06-281-0/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a defconfig for the arm64 based Rockchip SoCs, currently only RK3568 Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20210615141641.31577-12-s.hauer@pengutronix.de Link: https://lore.barebox.org/20210621092802.27275-12-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | ARM: Rockchip: Add rk3568 evb board supportSascha Hauer2021-06-289-0/+631
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for the rk3568 evb board. Tested features so far are: - 1st stage booting - Network - SD card - eMMC The dts files are based on the ones posted on the mailing lists, they should be rebased on the upstream files once they show up in barebox. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20210615141641.31577-11-s.hauer@pengutronix.de Link: https://lore.barebox.org/20210621092802.27275-11-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>