summaryrefslogtreecommitdiffstats
path: root/arch/sandbox
Commit message (Collapse)AuthorAgeFilesLines
* block: record block device typeAhmad Fatoum2024-03-051-0/+1
| | | | | | | | | | Software running under EFI can query the type of a block device. For barebox to be able to report this, start assigning types to all block devices it can create. No functional change yet. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240304190038.3486881-24-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* cdev: implement setter/getter for cdev device nodeAhmad Fatoum2024-03-051-1/+1
| | | | | | | | | | | | | A cdev has two device tree node pointers, one directly at struct cdev.device_node and another indirectly via cdev.dev->device_node. We may want to remove cdev::device_node in future, but till then to avoid users having to guess, which device_node is the correct one, add a helper to set and get the device tree node. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240304190038.3486881-19-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2024-01-231-5/+1
|\
| * sandbox: set DMA_ALIGNMENT instead of defining dma_allocAhmad Fatoum2024-01-111-5/+1
| | | | | | | | | | | | | | | | | | | | <dma.h> will take care to define dma_alloc with DMA_ALIGNMENT as alignment. As 32 is the default and we for some reason, use 64 for sandbox, define DMA_ALIGNMENT and drop the now duplicate code. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240108102438.1318473-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | dma: select ARCH_DMA_DEFAULT_COHERENT for x86 and sandboxAhmad Fatoum2024-01-111-0/+1
|/ | | | | | | | | | | | | | | | | | Linux only considers the value of CONFIG_ARCH_DMA_DEFAULT_COHERENT if the architecture also defines either of: - CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE - CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU - CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU_ALL We don't have those in barebox and also have less architectures to support, so we'll just select ARCH_DMA_DEFAULT_COHERENT from all architectures where this applies to: x86, sandbox and RISC-V. RISC-V already selects it, so we add it to the other two. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240110160112.4134162-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/prepare-optee'Sascha Hauer2023-11-271-0/+2
|\
| * include: import Linux word-at-a-time.hAhmad Fatoum2023-11-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Linux <linux/word-at-a-time.h> interface is used to optimize searching for bytes in strings by doing word-size comparisons. This will be used in the implementation of strscpy in a follow-up commit, so import the generic version here. A good overview on the interface is available at LWN[1]. Note that it discuss Linux v3.5. The asm-generic version imported here works also on little-endian and not only big-endian[2]. [1]: https://lwn.net/Articles/501492/ [2]: Linux kernel commit a6e2f029ae34 ("Make asm/word-at-a-time.h available on all architectures"). Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20231122172951.376531-9-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | sandbox: libc_malloc: populate barebox errno on errorAhmad Fatoum2023-11-231-4/+24
| | | | | | | | | | | | | | | | | | TLSF already populates errno on errors, so do likewise for the allocators that don't. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20231122170007.3849506-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | console: move ARCH_HAS_CTRLC into KconfigAhmad Fatoum2023-11-212-2/+1
|/ | | | | | | | | | We should do away altogether with <asm/common.h>, so prepare for doing that in the future by moing the only content it has on sandbox into Kconfig. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20231109124326.1499612-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: move sandbox-specific options into menuAhmad Fatoum2023-10-131-6/+10
| | | | | | | | | | The two sandbox related options are shown in the top-level menu. Move them into an architecture-specific menu instead as done for other architectures. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20231009115201.2210460-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: add empty <asm/linkage.h>Ahmad Fatoum2023-10-131-0/+8
| | | | | | | | | Sandbox code including <linux/linkage.h> will trip over this file being missing, so add an empty stub. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20231009115201.2210460-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2023-08-232-4/+4
|\
| * Makefile: allow setting pkg-config binary via PKG_CONFIGAhmad Fatoum2023-07-282-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unlike Linux, barebox build system does build both host and target tools in the same build, each using a different pkg-config. This is done by using `pkg-config` for the host tools and `$CROSS_PKG_CONFIG` for the target tools. In Yocto, `pkg-config` is for target tools and `pkg-config-native` is for host tools, which we can't represent with the current scheme. The usual work around that Yocto employs for the kernel is to override PKG_CONFIG_PATH to always point into the native sysroot and resetting PKG_CONFIG_SYSROOT_DIR, but this breaks build of target tools that use pkg-config. Fix this by providing a PKG_CONFIG variable that can be overridden when necessary. This intentionally skips the scripts/kconfig directory to make it easier to sync with the kernel. While we should eventually switch that over to use PKG_CONFIG as well, Yocto will set PKG_CONFIG_PATH and PKG_CONFIG_SYSROOT_DIR appropriately in cm1.bbclass' do_menuconfig, so this can wait until the change is done to the kernel and synced back. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230727084812.880438-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | sandbox: store stickypage in runtime dirAhmad Fatoum2023-08-188-36/+85
|/ | | | | | | | | | | | | | | | | | The stickypage is a hack to have a 4K hostfile persist over reboot. This was so far done by compiling the stickypage separately and referencing it from the device tree via the magic $build variable that expands to the working directory. This breaks a number of assumptions: - KBUILD_IMAGE: should only have a single entry, e.g. barebox-flash-images ends up with two files per one line - stickypage must be writable, which may fail if barebox is installed, e.g. in r/o Nix Store Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230817073941.1261154-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: dts: skip reboot mode without hostfileAhmad Fatoum2023-07-032-2/+2
| | | | | | | | | | | | | The stickypage hostfile won't probe if the file is missing, yet because it's compatible to simple-mfd, its child nodes will be probed and fail their probe, because the hostfile itself was missing. Fix this by only probing hostfile children if the parent probe concludes successfully. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230703093655.2073607-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/state'Sascha Hauer2023-06-221-4/+0
|\
| * block: parse partition table on block device registrationAhmad Fatoum2023-06-121-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Every instance of block device registration is followed by an attempt to parse the partition table. Thus move partition table parsing into blockdevice_register. We do away with the warning print as it's superfluous: parse_partition_table doesn't return an error if partition table is missing and all other errors already result in an error message. Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230607120714.3083182-13-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/dma-streaming-interface'Sascha Hauer2023-06-221-6/+6
|\ \
| * | dma: rework dma_sync_single_for_*() interfaceDenis Orlov2023-06-061-6/+6
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, a lot of code handles dma_addr_t values as if they actually hold CPU addresses. However, this is not always true. For example, MIPS architecture requires an explicit conversion from the physical address space to some virtual address space segment to get a valid CPU-side pointer. Another issue is that DMA ranges that may be specified in a device tree will not work this way. To get from a virtual address to a dma handle and vice versa we need to add/subtract some offset, which is calculated from "dma-ranges" property. Only dma_map_single() was doing this, but dma_sync_single_for_*() also should. Improve the interface by adding 'struct device' as the first argument to the dma_sync_single_for_*(). This allows to do cpu_to_dma/dma_to_cpu() conversions in common code and call into arch-specific code with proper cpu-side addresses. To make things more clear, make the virtual address argument of those arch-side functions be properly represented with a void* type. Apply the required changes in device drivers that use the affected functions, making them pass the appropriate device pointer. Signed-off-by: Denis Orlov <denorl2009@gmail.com> Link: https://lore.barebox.org/20230604215002.20240-2-denorl2009@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / treewide: add MODULE_DEVICE_TABLE markersAhmad Fatoum2023-06-134-0/+4
|/ | | | | | | | | | | | | | | | Syncing device trees with Linux upstream can lead to breakage, when the device trees are switched to newer bindings, which are not yet supported in barebox. To make it easier to spot such issues, we want to start applying some heuristics to flag possibly problematic DT changes. One step towards being able to do that is to know what nodes barebox actually consumes. Most of the nodes have a compatible entry, which is matched by an array of of_device_id, so let's have MODULE_DEVICE_TABLE point at it for future extraction. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230612125908.1087340-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: hostfile: add feature controller supportAhmad Fatoum2023-05-023-3/+33
| | | | | | | | | | | | | | | Keeping the tradition of making the sandbox more complex than it needs to in order to exercise more parts of barebox, let's allow hostfiles to be feature controllers: This allows specifying optional hostfiles in the DT: If the hostfile is unavailable, the nodes pointing at the hostfile can be gated by it, so they behave as if they were disabled. This is useful for the stickypage, which results in a number of ugly errors whenever it's unavailable. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20230424121805.150434-7-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: hostfile: don't warn on failed hostfile fixupAhmad Fatoum2023-05-021-13/+4
| | | | | | | | | | The node is not deleted, so the hostfile driver will probe the node in any case and error will just be printed twice. Thus drop the checks from the fixup. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20230424121805.150434-3-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: power: handle missing stickypage gracefullyAhmad Fatoum2023-05-021-6/+8
| | | | | | | | | | | | To enable simulation of $global.system.reset in sandbox, the power driver writes the reset-source into the stickypage for readout during subsequent barebox startup. This is an optional feature, so it should happen before watchdog registration, but not break watchdog operation if not available. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20230424121805.150434-2-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: watchdog: handle missing stickypage gracefullyAhmad Fatoum2023-05-022-18/+26
| | | | | | | | | | | | To enable simulation of $global.system.reset in sandbox, the watchdog driver writes the reset-source into the stickypage for readout during subsequent barebox startup. This is an optional feature, so it should happen before watchdog registration, but not break watchdog operation if not available. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20230424121805.150434-1-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: drop CONFIG_HAS_ASM_DEBUG_LLSascha Hauer2023-03-031-1/+1
| | | | | | | | | | | When CONFIG_HAS_ASM_DEBUG_LL is set then include/debug_ll.h includes asm/debug_ll.h, otherwise it includes mach/debug_ll.h. Drop this option and instead always include asm/debug_ll.h and include mach/debug_ll.h from there if necessary. This also adds the missing asm/debug_ll.h for architectures which previously did not have that file. Link: https://lore.barebox.org/20230302111606.1054037-6-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Revert "sandbox: fix linker warnings with newer ld"Sascha Hauer2023-02-221-1/+0
| | | | | | | | | | | cc-option calls gcc with -c, so doesn't link internally. It is not suitable for testing linker flags. We use gcc for linking, so we need -Wl, for passing linker flags. ld-option doesn't work either, because it expects and outputs linker options directly without -Wl. There is no easy solution to this, so revert the patch for now. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: fix linker warnings with newer ldAhmad Fatoum2023-02-211-0/+1
| | | | | | | | | | | | | | | | | | | Building with a newer ld results in two warnings: 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 binutils-2.39/bin/ld: warning: barebox has a LOAD segment with RWX permissions This is already fixed for the non-sandbox platform with a4b49c69c3ad ("Kbuild: link with -z noexecstack and --no-warn-rwx-segments"), but sandbox has its own cmd_barebox__, so add the equivalent to the sandbox Makefile as well. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20230221065047.1114231-1-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Rename struct driver_d to driverSascha Hauer2023-01-105-5/+5
| | | | | | | | | | | The '_d' suffix was originally meant to distinguish barebox struct names from Linux struct names. struct driver doesn't exist in Linux, so we can rename it and remove the meaningless suffix. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20221214123512.189688-4-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Rename struct device_d to deviceSascha Hauer2023-01-108-16/+16
| | | | | | | | | | | | | The '_d' suffix was originally introduced in case we want to import Linux struct device as a separate struct into barebox. Over time it became clear that this won't happen, instead barebox struct device_d is basically the same as Linux struct device. Rename the struct name accordingly to make porting Linux code easier. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20221214123512.189688-3-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Rename device_d::device_node to device_d::of_nodeSascha Hauer2023-01-104-5/+7
| | | | | | | | | | | | | | | | | | | | Linux struct device has the member of_node for the device_node pointer. Rename this in barebox accordingly to minimize the necessary changes when porting Linux code. This was done with the semantic patch: @@ struct device_d E; @@ - E.device_node + E.of_node @@ struct device_d *E; @@ - E->device_node + E->of_node Plus some manual adjustments. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Reviewed-by: Marco Felsch <m.felsch@pengutronix.de> Link: https://lore.barebox.org/20221214123512.189688-2-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: rename CONFIG_HAS_ARCH_SJLJ to CONFIG_ARCH_HAS_SJLJAhmad Fatoum2022-12-071-1/+1
| | | | | | | | | We have 9 symbols beginning with ARCH_HAS, but only with HAS_ARCH. Change it over for symmetry. No functional change. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221205133033.3008535-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* kvx,openrisc,riscv,sandbox/dts: harmonize clean-files definitionUwe Kleine-König2022-12-021-1/+1
| | | | | | | | | | | | I noticed while playing around with the sandbox that the mrproper make target doesn't remove arch/sandbox/dts/sandbox.dtb.z. Fix all dts clean-files defintion to match arm's defintion which seems to be the most complete one. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.barebox.org/20221202082954.3413605-1-u.kleine-koenig@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: configs: enable new uptime commandAhmad Fatoum2022-11-021-1/+1
| | | | | | | | | | Foe testing the new uptime command, enable it in the sandbox defconfig. The config regeneration drops the CONFIG_PNG symbol, because it's now selected by CONFIG_LODEPNG. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221101063757.3225283-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* lds: introduce <asm/barebox.lds.h>Ahmad Fatoum2022-10-112-1/+4
| | | | | | | | | | | | | | We have a separate linker script for each architecture and one more for PBL if supported. All linker scripts include <asm-generic/barebox.lds.h>. In future, we may want to use a linker script common to more than one architecture. Prepare for this by having each architecture define a <asm/barebox.lds.h>. Currently, these files contain little more than 1-2 #include directives, but this will change in later commits. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221010061122.2084009-6-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: implement DEBUG_LL supportAhmad Fatoum2022-10-053-1/+19
| | | | | | | | | | | | We can't currently debug malloc() or early parts of the driver model on sandbox, because we require both to allocate the sandbox console device. To make debugging such early startup easier in future, add some simple DEBUG_LL support. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221004154800.3457742-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* asm-generic: provide phys_to_virt() and virt_to_phys()Antony Pavlov2022-08-081-10/+0
| | | | | | | | | | | | | | | | | The arm, riscv, sandbox and x86 architectures use just the same phys_to_virt()/virt_to_phys() implementation. Only the mips architecture has its own special implementation. So we can move phys_to_virt() and virt_to_phys() generic implementation to include/asm-generic/io.h. Use override functions way introduced in the 9216efafc52ff99e ("asm-generic/io.h: Reconcile I/O accessor overrides") linux kernel commit. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Link: https://lore.barebox.org/20220726102412.1104232-1-antonynpavlov@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* gitignore: add device tree blobs to top-level .gitignoreAhmad Fatoum2022-08-081-1/+0
| | | | | | | | | We have device trees outside of the usual directories, e.g. for overlays, so move the .gitignore rule to top-level. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220805085314.3404920-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/rpi4'Sascha Hauer2022-06-291-0/+5
|\
| * dma: avoid clash between static inline and extern dma_alloc declarationsAhmad Fatoum2022-06-171-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | dma_alloc/dma_sync/dma_free can be either either static inline definitions usually supplied per arch or extern definitions that can be either generic or supplied per arch. To avoid clashes, expect static inline definitions to define a preprocessor symbol for now. There is much duplication in the static inline helpers, which we can remove in future. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220614091556.1018102-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | treewide: Remove duplicate incudesAlexander Shiyan2022-06-103-4/+0
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix warning fwterated by checkincludes.pl: ./net/nfs.c: libgen.h is included more than once. ./net/ifup.c: globalvar.h is included more than once. ./crypto/rsa.c: asm/types.h is included more than once. ./lib/decompress_unlz4.c: linux/decompress/mm.h is included more than once. ./scripts/stb_image.h: stdio.h is included more than once. ./scripts/kwbimage.c: unistd.h is included more than once. ./scripts/common.c: sys/types.h is included more than once. ./scripts/bareboximd.c: sys/types.h is included more than once. ./scripts/bareboximd.c: sys/mman.h is included more than once. ./fs/pstore/ram_core.c: linux/rslib.h is included more than once. ./fs/pstore/fs.c: fs.h is included more than once. ./fs/pstore/fs.c: linux/pstore.h is included more than once. ./fs/nfs.c: fs.h is included more than once. ./fs/uimagefs.c: fs.h is included more than once. ./fs/fs.c: command.h is included more than once. ./arch/sandbox/board/hostfile.c: linux/err.h is included more than once. ./arch/sandbox/board/devices.c: mach/linux.h is included more than once. ./arch/sandbox/os/common.c: signal.h is included more than once. ./arch/arm/boards/zii-imx51-rdu1/board.c: envfs.h is included more than once. ./arch/arm/boards/imx233-olinuxino/imx23-olinuxino.c: generated/mach-types.h is ./arch/arm/mach-stm32mp/ddrctrl.c: mach/stm32.h is included more than once. ./arch/arm/mach-imx/cpu_init.c: common.h is included more than once. ./arch/arm/mach-imx/imx8m.c: mach/imx8m-ccm-regs.h is included more than once. ./common/efi/payload/init.c: efi.h is included more than once. ./common/state/backend_format_raw.c: common.h is included more than once. ./common/state/backend_format_raw.c: crc.h is included more than once. ./common/hush.c: libbb.h is included more than once. ./drivers/spi/atmel-quadspi.c: linux/clk.h is included more than once. ./drivers/spi/atmel-quadspi.c: linux/err.h is included more than once. ./drivers/net/virtio.c: net.h is included more than once. ./drivers/net/phy/phy.c: linux/phy.h is included more than once. ./drivers/net/cpsw.c: net.h is included more than once. ./drivers/virtio/virtio_pci_common.h: linux/list.h is included more than once. ./drivers/usb/host/ohci-hcd.c: dma.h is included more than once. ./drivers/usb/gadget/fsl_udc.c: dma.h is included more than once. ./drivers/nvmem/eeprom_93xx46.c: spi/spi.h is included more than once. ./drivers/nvmem/eeprom_93xx46.c: of.h is included more than once. ./drivers/video/imx-ipu-v3/imx-ldb.c: linux/clk.h is included more than once. ./drivers/video/imx-ipu-v3/imx-hdmi.c: linux/clk.h is included more than once. ./drivers/video/omap.c: common.h is included more than once. ./drivers/mtd/nand/nand_s3c24xx.c: asm/sections.h is included more than once. ./drivers/clk/imx/clk-imx6sx.c: linux/clk.h is included more than once. ./drivers/clk/imx/clk-imx6sl.c: linux/clk.h is included more than once. ./commands/bootm.c: of.h is included more than once. Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com> Link: https://lore.barebox.org/20220607051957.2497-1-eagle.alexander923@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* clocksource: assign non-zero priorities to all clocksourcesAhmad Fatoum2022-04-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most barebox clocksources have a zero priority and if multiple of them exist, but no higher priority ones, the first to call init_clock wins. Some supported boards like the Raspberry Pi additionally depended on initcall ordering to favor one zero-priority clocksource over another. With the move to deep probe and with Commit b641580deb8c ("of: platform: Ensure timers are probed early"), device tree blob iteration order could now dictate which clocksource is ultimately used. This led to a 20 times slower clock source being chosen on the Raspberry Pi, because the ARM architected timer was taken instead of the bcm2835 timer. Fix the root cause by assigning priorities to all clocksource drivers. Priorities chosen are: 50: device_initcall 60: coredevice_initcall 70: postcore_initcall 80: core_initcall These priorities are all below 100, which was previously the lowest positive priority and as they are positive, they win against the dummy clocksource. This should ensure no priority inversion happens. Fixes: b641580deb8c ("of: platform: Ensure timers are probed early") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220425094857.674044-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: board: add stickypage.bin into .gitignoreAhmad Fatoum2022-03-281-0/+1
| | | | | | | | Otherwise, it shows up in version control for in-tree builds. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220318153047.733241-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: symlink stickypage.bin into build directoryAhmad Fatoum2022-02-071-0/+6
| | | | | | | | | | Sandbox will try to access a stickypage.bin in the same directory if possible. Instead of relying on users to copy it there, just create a symlink. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220207075604.1014259-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arch: add SPDX-License-Identifier to all .c filesAhmad Fatoum2022-01-053-0/+6
| | | | | | | | | Record GPL-2.0-only as license for all files lacking an explicit license statement. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220103120539.1730644-11-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arch: add SPDX-License-Identifier to all .S filesAhmad Fatoum2022-01-051-0/+2
| | | | | | | | | Record GPL-2.0-only as license for all files lacking an explicit license statement. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220103120539.1730644-10-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arch: add SPDX-License-Identifier to all headersAhmad Fatoum2022-01-0514-0/+28
| | | | | | | | | Record GPL-2.0-only as license for all files lacking an explicit license statement. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220103120539.1730644-9-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: add SPDX-License-Identifier for .gitignoreAhmad Fatoum2022-01-051-0/+2
| | | | | | | | | Makes the files not appear when searching for files that lack SPDX-License-Identifier. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220103120539.1730644-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: add SPDX-License-Identifier for Kbuild/KconfigAhmad Fatoum2022-01-056-0/+12
| | | | | | | | | | | | | | | To verify only Kconfig/Makefile is touched: git show --numstat --format=oneline HEAD | grep -v 'Kconfig\|Makefile' will print only arch/powerpc/Kbuild. To verify nothing unexpected is added: git show -U0 | grep '^-[^-]\|^+[^+]' | sort -u Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220103120539.1730644-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: add target tool for rk-usb-loaderAhmad Fatoum2021-11-101-0/+1
| | | | | | | | Having rk-usb-loader as a target tool as well makes it easy to cross-compile it. Add the boilerplate. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: Add rk-usb-loader toolSascha Hauer2021-11-101-0/+1
| | | | | | | | | This adds a tool suitable for bootstrapping barebox on Rockchip RK3568 SoCs. It has been tested on this SoC only. It might or might not work with minor adjustments on other SoCs. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Tested-by: Michael Riesch <michael.riesch@wolfvision.net>