summaryrefslogtreecommitdiffstats
path: root/arch/mips
Commit message (Collapse)AuthorAgeFilesLines
...
| * MIPS: pbl: use o32/n64 compatible register definitionsDenis Orlov2023-06-092-19/+19
| | | | | | | | | | | | | | | | | | | | This allows to compile PBL code with n64 ABI, which we use when CONFIG_64BIT is set. Signed-off-by: Denis Orlov <denorl2009@gmail.com> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230605202634.42175-6-denorl2009@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * MIPS: o32: provide ta0..ta3 register definitionsDenis Orlov2023-06-091-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | This allows to write generic assembly code that will compile under both o32 and n64 ABIs, as otherwise the register definitions would conflict. Taken from Linux kernel sources, commit 'MIPS: O32: Provide definition of registers ta0 .. ta3.' (3ba1e543ab4b02640d396098f2f6a199560d5f2d). Signed-off-by: Denis Orlov <denorl2009@gmail.com> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230605202634.42175-5-denorl2009@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * MIPS: reloc: fix relocation with CONFIG_64BIT enabledDenis Orlov2023-06-091-4/+3
| | | | | | | | | | | | | | | | | | | | | | Use CKSEG instead of KSEG, allowing it to compile on 64BIT configurations. Also make sure that we do not truncate target relocation address by writing it into a 32-bit wide variable. Signed-off-by: Denis Orlov <denorl2009@gmail.com> Reviewd-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230605202634.42175-4-denorl2009@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * MIPS: malta: use CKSEG instead of KSEG macrosDenis Orlov2023-06-092-3/+3
| | | | | | | | | | | | | | | | | | KSEG macro is not available when compiling with CONFIG_64BIT enabled, so use CKSEG instead. Signed-off-by: Denis Orlov <denorl2009@gmail.com> Link: https://lore.barebox.org/20230605202634.42175-3-denorl2009@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * MIPS: malta: allow to choose MIPS64 target CPU in configDenis Orlov2023-06-091-0/+3
| | | | | | | | | | | | | | | | | | | | | | QEMU is able to emulate malta machine with a variety of MIPS CPUs, including MIPS64 ones, so allow to compile barebox for such configurations. Signed-off-by: Denis Orlov <denorl2009@gmail.com> Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230605202634.42175-2-denorl2009@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/dma-streaming-interface'Sascha Hauer2023-06-221-9/+9
|\ \
| * | dma: rework dma_sync_single_for_*() interfaceDenis Orlov2023-06-061-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-131-0/+1
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | MIPS: longsoon: restart: hide access to zero pageAhmad Fatoum2023-06-061-3/+7
| | | | | | | | | | | | | | | | | | Watchdog on Longsoon appears to be at address 0. Let's use OPTIMIZER_HIDE_VAR, so GCC doesn't warn about it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230605062939.242063-6-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | MIPS: boot: main_entry: use malloc_end instead of _stextAhmad Fatoum2023-06-061-1/+1
|/ | | | | | | | | | GCC is not fond of subtracting from array base address. The code already defines and uses a malloc_end pointer, so let's use that instead to rid us of the warning. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230605062939.242063-5-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/mips' into nextSascha Hauer2023-03-162-22/+24
|\
| * MIPS: bootm: remove unnecessary phys/virt conversionsDenis Orlov2023-03-161-2/+2
| | | | | | | | | | | | | | | | | | They are not doing anything there - we should already have proper virtual addresses represented by those pointers. Signed-off-by: Denis Orlov <denorl2009@gmail.com> Link: https://lore.barebox.org/20230315085953.4094660-4-denorl2009@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * MIPS: bootm: do not leak memory on error in of_overlay_load_firmware()Denis Orlov2023-03-161-1/+1
| | | | | | | | | | | | Signed-off-by: Denis Orlov <denorl2009@gmail.com> Link: https://lore.barebox.org/20230315085953.4094660-3-denorl2009@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * MIPS: bootm: do not free fdt pointer that contains an errorDenis Orlov2023-03-161-2/+2
| | | | | | | | | | | | | | | | Also add a proper error message. Signed-off-by: Denis Orlov <denorl2009@gmail.com> Link: https://lore.barebox.org/20230315085953.4094660-2-denorl2009@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * MIPS: dma-default: do not flush caches in dma_sync_single_* excessivelyDenis Orlov2023-03-141-19/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the logic to be different depending on whether we are doing synchronization for a cpu or a device. This gets rid of unnecessary cache flushing in some cases. While at it, also simplify code a bit, collapsing two cases with the same code in a switch statement in dma_sync_single_for_device(). The functional change itself is taken from Linux commit 'MIPS: make dma_sync_*_for_cpu a little less overzealous' (hash: cbf1449ba5aec9cf4c68b69f899391a8d42e9b8f). Signed-off-by: Denis Orlov <denorl2009@gmail.com> Link: https://lore.barebox.org/20230313105308.3108127-4-denorl2009@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * MIPS: dma-default: use virtual addresses when flushing cachesDenis Orlov2023-03-141-2/+6
| | | | | | | | | | | | | | | | | | | | | | Cache flushing functions expect virtual addresses, so make sure those are properly converted from the physical ones in dma_sync_single_for_*. QEMU doesn't care as it ignores cache instructions, but without such change this code would result in TLB exceptions on real hardware. Signed-off-by: Denis Orlov <denorl2009@gmail.com> Link: https://lore.barebox.org/20230313105308.3108127-3-denorl2009@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: drop CONFIG_HAS_ASM_DEBUG_LLSascha Hauer2023-03-031-0/+6
|/ | | | | | | | | | | 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>
* Merge branch 'for-next/mips'Sascha Hauer2023-02-233-49/+42
|\
| * MIPS: dma: simplify source structureDenis Orlov2023-02-142-41/+30
| | | | | | | | | | | | | | | | | | There is no reason to keep code from 'dma-mapping.h' in a separate file, so merge it into 'dma.h'. Signed-off-by: Denis Orlov <denorl2009@gmail.com> Link: https://lore.barebox.org/20230210144745.915720-5-denorl2009@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * MIPS: dma: add arch-specific dma_alloc() implementationDenis Orlov2023-02-131-0/+12
| | | | | | | | | | | | | | | | | | | | | | DMA allocations should be aligned on a cache line size, at least on cache non-coherent MIPS systems. Instead of using some hardcoded value for an alignment from a generic implementation (which may be wrong for us), we can get cache info from 'current_cpu_data' variable, so use it. Signed-off-by: Denis Orlov <denorl2009@gmail.com> Link: https://lore.barebox.org/20230210144745.915720-4-denorl2009@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * MIPS: dma: remove unnecessary ifdefsDenis Orlov2023-02-131-8/+0
| | | | | | | | | | | | | | | | | | We do not support any MIPS CPUs that are not MIPS32/MIPS64, so there is no reason to check for those. Signed-off-by: Denis Orlov <denorl2009@gmail.com> Link: https://lore.barebox.org/20230210144745.915720-3-denorl2009@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * MIPS: dma: fix nullptr handling in dma_free_coherentDenis Orlov2023-02-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | It is not an error to pass a null pointer to free() and as such it seems that dma_free_coherent() should be able to handle this situation too. Currently, if CONFIG_MMU option is enabled, we would convert this null pointer into a pointer to the beginning of CKSEG0 memory segment before passing it to free(), actually trying to deallocate stuff. Signed-off-by: Denis Orlov <denorl2009@gmail.com> Link: https://lore.barebox.org/20230210144745.915720-2-denorl2009@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | MIPS: dts: ath79: ar9331: use path references when extending nodesAhmad Fatoum2023-02-222-17/+11
|/ | | | | | | | | | LED heartbeat already broke, because upstream renamed the node name. Fix that and let's use references, so we get errors if an upstream DT update breaks our usage. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230217173057.1839835-6-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Rename struct driver_d to driverSascha Hauer2023-01-102-2/+2
| | | | | | | | | | | 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-103-5/+5
| | | | | | | | | | | | | 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-101-2/+2
| | | | | | | | | | | | | | | | | | | | 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-072-2/+2
| | | | | | | | | 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>
* Treewide: Reference environment partitions by phandleSascha Hauer2022-10-197-14/+14
| | | | | | | | | | Where possible reference the environment partitions directly by phandle instead of referencing the physical device and describing the partition by "partname:xxx". This is one step to deprecate the "partname:xxx" binding. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* lds: move OUTPUT_FORMAT/ARCH definition into headerAhmad Fatoum2022-10-114-3/+5
| | | | | | | | | | In order to allow us having architecture-indepenent linker scripts, move the definition for the format and the architecture into the new <asm/barebox.lds.h> header file. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20221010061122.2084009-7-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* lds: introduce <asm/barebox.lds.h>Ahmad Fatoum2022-10-114-3/+6
| | | | | | | | | | | | | | 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>
* pbl: replace __piggydata_end with __image_endAhmad Fatoum2022-08-221-1/+2
| | | | | | | | | | | | | | | __piggydata_end and __image_end used to be synonyms before the addition of external firmware. Now that external firmware is located after __piggydata_end, code using it needs to be revisited. There's no reason to have code reference __piggydata_end. Either they want all the rest of the image, so they should use __image_end instead or they want just the piggy data, in which case they can read the data size embedded into the piggydata itself. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220818050447.2072932-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2022-08-113-1/+16
|\
| * asm-generic: provide phys_to_virt() and virt_to_phys()Antony Pavlov2022-08-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * MIPS: asm: add get_runtime_offset stubAhmad Fatoum2022-08-081-0/+14
| | | | | | | | | | | | | | | | | | | | MIPS' relocation setup differs from ARM and RISC-V, but as it always happen within assembly, we can assume C code to always be relocated, which allows a trivial implementation of get_runtime_offset(). Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220805074237.1148255-3-a.fatoum@pengutronix.de 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>
* | kbuild: gen-dtb-s: use Makefile.lib instead of duplicating cmd_lzoAhmad Fatoum2022-07-141-1/+1
|/ | | | | | | | | | | | | | We call lzop in two places: in gen-dtb-s to generate a compressed device tree symbol and in Makefile.lib, which is used everywhere else. Replace the duplication in gen-dtb-s by compressing the DT outside with the existing cmd_lzo command. This will come in handy later when extending gen-dtb-s to support multiple compression formats. No functional change intended. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220713095730.1878941-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* dma: avoid clash between static inline and extern dma_alloc declarationsAhmad Fatoum2022-06-171-0/+2
| | | | | | | | | | | | | | 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>
* clocksource: assign non-zero priorities to all clocksourcesAhmad Fatoum2022-04-252-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* MIPS: fix optimised memset returning garbageDenis Orlov2022-03-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a subtle bug in arch/mips/lib/memset.S, used if option MIPS_OPTIMIZED_STRING_FUNCTIONS is enabled, which results in not writing the correct return value into v0 register if the value to fill memory with is 0. The bug stems from a missing '.set noreorder' directive before the first beqz instruction. This results in an assembler stuffing a 'nop' instruction in the beqz delay slot instead of an instruction writing the return value into v0 register that was supposed to go there. That leads to an error that appears when reading memory from SPI Flash and that was mentioned here: http://lists.infradead.org/pipermail/barebox/2021-June/036557.html There are a few ways of fixing this bug. The directive '.set noreorder' that shows up a bit later in code could be moved up and placed right before the memset label (as it was originally in Linux codebase - see a583158c9ce822c96a718fbf877cec1e5f9ad75d). Or, rather, the move and the branch instruction could be swapped, thus allowing the assembler to properly place move in delay slot (as it is done in Linux now - see 68dec269ee29c3abfd09596fbee7e40d875a6ab3) - that is what is done in this patch. Signed-off-by: Denis Orlov <denorl2009@gmail.com> Link: https://lore.barebox.org/20220310204206.31942-1-denorl2009@gmail.com Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arch: add SPDX-License-Identifier to all .c filesAhmad Fatoum2022-01-057-0/+14
| | | | | | | | | 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-056-0/+12
| | | | | | | | | 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-0515-0/+30
| | | | | | | | | 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-052-0/+4
| | | | | | | | | 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-0532-3/+63
| | | | | | | | | | | | | | | 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>
* kbuild: remove unneeded -nostdlib flagMasahiro Yamada2021-11-171-2/+0
| | | | | | | | | | | | | | | | | | The -nostdlib option requests the compiler to not use the standard system startup files or libraries when linking. arch/kvm/Makefile adds it to KBUILD_CFLAGS/AFLAGS, but it does not make sense because those are unrelated to linking. arch/{mips,riscv,x86}/Makefile passes it to the linker, but it is not sensible either. As noted above, adding -nostdlib makes sense only when $(CC) is used as a linker driver, but $(LD) is directly used for linking barebox. (ld.bfd/ld.lld recognizes the -nostdlib flag, but its behavior is obscure, and unneeded here.) Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Link: https://lore.barebox.org/20211117034918.1226358-2-masahiroy@kernel.org Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* blspec: Rework firmware loadSascha Hauer2021-06-281-0/+4
| | | | | | | | | | | | | | | | Applying overlays in blspec currently works in two steps. First of_firmware_load_overlay() is called which doesn't load an overlay, but instead loads firmware when one is needed by the overlay. This is done on the live tree, because that was needed to find the firmware manager. The second step is to call of_register_overlay() to apply the overlay to the kernel device tree when the fixups are executed. Instead of using a separate step to load the firmware, load the firmware as part of the of_fixups. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20210624085223.14616-14-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: warn about of_add_memory_bank errorsAhmad Fatoum2021-06-021-3/+6
| | | | | | | | | | | | Now that errors from of_probe are propagated to the respective initcalls registering the device tree, propagate of_add_memory_bank errors as well. This ensures that clashes of device-tree added regions with previous ones don't go unnoticed. This can e.g. be the case if a device tree happens to have both /memory@X { }; and /memory { }; nodes. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210531071239.30653-5-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* of: propagate errors inside barebox_register_{of, fdt} into initcallsAhmad Fatoum2021-06-021-3/+1
| | | | | | | | | | | | | | | Errors during device tree registration, while uncommon, are really annoying, because the system may limp along and it's not clear where the misbehavior originates from. Failing the initcall of the device tree would improve user experience in that error case. There is intentionally no early exit on error cases to give barebox a chance to probe the serial driver to actually report errors when DEBUG_LL is disabled. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210531071239.30653-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/x86'Sascha Hauer2021-05-171-0/+7
|\
| * PCI: support PCI BIOS preassigned busesAhmad Fatoum2021-05-031-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When running under UEFI, barebox should no redo PCI enumeration, because the UEFI implementation will likely already have drivers that won't cope with e.g. BAR addresses changing. The user-visible effect of this is that likely the framebuffer will stop working because the UEFI driver won't be able to access it any longer. Support this configuration by changing the PCI code to consult the new pcibios_assign_all_busses(). When it's true, there is no change to previous behavior. When it's false, reconfiguration is omitted and instead current configuration is read back from the bus. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20210416062436.332665-3-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>