summaryrefslogtreecommitdiffstats
path: root/arch/x86
Commit message (Collapse)AuthorAgeFilesLines
* ARM64: add optional EFI stubAhmad Fatoum2024-03-051-0/+1
| | | | | | | | | | | While very recent binutils releases have dedicated efi-*-aarch targets, we may want to support older toolchains. For this reason, we import the kernel's EFI stub PE fakery, so the same barebox-dt-2nd.img may be loaded as if it were a "normal" or an EFI-stubbed kernel. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240304190038.3486881-87-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: payload: suppress EFI payload initcalls when not EFI-loadedAhmad Fatoum2024-03-051-2/+2
| | | | | | | | | | | | For development, it has proven very useful to be able to load the same barebox binary both as EFI loader and EFI payload and debug the interaction. For this to work, we need to mark all current EFI payload initcalls as such to avoid running them when barebox is not running as EFI payload. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240304190038.3486881-63-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: don't hide structs, enums or unions behind _tAhmad Fatoum2024-03-051-1/+1
| | | | | | | | | | | | | | Kernel coding style is to usually not hide the fact that a type is a struct or enum behind a typedef. Follow that in the EFI code. Besides being more descriptive, this also allows forward declarations, so <efi.h> doesn't have to be included everywhere. No functional change. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240304190038.3486881-53-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* efi: payload: rename CONFIG_EFI_BOOTUP to CONFIG_EFI_PAYLOADAhmad Fatoum2024-03-051-1/+1
| | | | | | | | | | The symbol is internal, so we don't break anything by renaming it. CONFIG_EFI_PAYLOAD is clearer in intent, as BOOTUP doesn't clearly indificate whether barebox would act as EFI payload or as EFI loader. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20240304190038.3486881-9-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>
* include: import Linux word-at-a-time.hAhmad Fatoum2023-11-231-0/+73
| | | | | | | | | | | | | | | | | | | 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>
* x86: efi: add IMD data to the EFI binaryMichael Olbrich2023-11-102-1/+3
| | | | | | | | | | | | It it currently missing so the imd command and the bareboximd tool do not work. Add the .barebox_imd section to the linker script and copy it to the EFI binary. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Link: https://lore.barebox.org/20231103155831.152488-1-m.olbrich@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* x86: setjmp: set base pointer to zero in initjmpAhmad Fatoum2023-10-122-0/+2
| | | | | | | | | | | Initializing the frame points to a known-bad value like zero makes it easier for code unwinding the stack to know when to stop. Thus initialize the stack pointer in initjmp-initialized jump buffers to zero. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20231009115051.1931562-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* x86: lib: setjmp: fix stack alignmentAhmad Fatoum2023-10-122-1/+5
| | | | | | | | | | | | | | | | x86 stack is expected to be 16-byte aligned to allow for instructions like movaps that involve xmm operands to directly use the stack. However the 16-byte alignment is what's expected at startup time. All later functions will have the stack misaligned by a pointer size's worth because call pushes the return address to the call stack. Add the missing (mis)alignment. This fixes a segmentation fault observed using initjmp on x86_64. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20231009115051.1931562-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* 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>
* 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>
* Rename struct device_d to deviceSascha Hauer2023-01-101-1/+1
| | | | | | | | | | | | | 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>
* treewide: rename CONFIG_HAS_ARCH_SJLJ to CONFIG_ARCH_HAS_SJLJAhmad Fatoum2022-12-071-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>
* lds: move OUTPUT_FORMAT/ARCH definition into headerAhmad Fatoum2022-10-113-4/+12
| | | | | | | | | | 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-113-2/+5
| | | | | | | | | | | | | | 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>
* 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>
* dma: avoid clash between static inline and extern dma_alloc declarationsAhmad Fatoum2022-06-171-0/+4
| | | | | | | | | | | | | | 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>
* Merge branch 'for-next/spdx'Sascha Hauer2022-01-1920-3/+39
|\
| * arch: add SPDX-License-Identifier to all .c filesAhmad Fatoum2022-01-052-0/+3
| | | | | | | | | | | | | | | | | | 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-052-0/+4
| | | | | | | | | | | | | | | | | | 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-0511-0/+22
| | | | | | | | | | | | | | | | | | 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-054-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge branch 'for-next/misc'Sascha Hauer2022-01-191-1/+0
|\ \
| * | x86: remove reference to empty fileAhmad Fatoum2022-01-051-1/+0
| |/ | | | | | | | | | | | | | | | | This might have been needed in the past when there was legacy boot machine support. Now there isn't, so we can just delete it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220103115824.1725086-5-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / x86: <asm/io.h>: fix outl/outsl access sizeAhmad Fatoum2022-01-101-2/+2
|/ | | | | | | | | | | | | | | | | | | | | | | outl so far behaved like outb, probably due to a copy-paste error when it was first added. We have three users in-tree for outl: * drivers/serial/serial_ns16550_pci.c only for handling a Quatech qurik, which probably no one ever needed * drivers/serial/serial_ns16550.c For platform drivers with a 4 byte I/O port resource. Only possible user is x86 and that has a 1 byte I/O port resource. Thus no one used this either. * drivers/watchdog/itco_wdt.c Here it indeed triggers a bug, although in my testing the WDAT was functional without. Fix this up so new code doesn't have to track this down. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220107063644.22595-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/x86'Sascha Hauer2021-12-153-22/+11
|\
| * x86_64: do not pass the EFI image handle or system table to relocationMasahiro Yamada2021-11-172-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | The _reloc() function in reloc_x86_64.c is passed with the EFI image handle and system table, but they are unrelated to the relocation. In fact, they are not used at all. Remove them and clean up the assembler code as well. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Link: https://lore.barebox.org/20211117034918.1226358-6-masahiroy@kernel.org Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * x86: reuse cmd_objcopy to generate barebox.efiMasahiro Yamada2021-11-171-6/+5
| | | | | | | | | | | | | | | | | | | | The objcopy rule is defined in scripts/Makefile.lib Reuse it. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Link: https://lore.barebox.org/20211117034918.1226358-5-masahiroy@kernel.org Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * x86: stop copying unneeded sections to barebox.efiMasahiro Yamada2021-11-171-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Stop copying the following sections: __barebox_initcalls __barebox_exitcalls __barebox_cmd .barebox_magic Such sections do not exist. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Link: https://lore.barebox.org/20211117034918.1226358-4-masahiroy@kernel.org Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * x86: remove x86-specific cmd_barebox__Masahiro Yamada2021-11-171-8/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | The difference from cmd_barebox__ in the top Makefile is: -shared -Bsymbolic -znocombreloc Put the flags to LDFLAGS_barebox, and remove the x86-specific cmd_barebox__. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Link: https://lore.barebox.org/20211117034918.1226358-3-masahiroy@kernel.org Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * kbuild: remove unneeded -nostdlib flagMasahiro Yamada2021-11-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | kbuild: force 16-bit wchar_t treewideAhmad Fatoum2021-11-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | -fshort-wchar ensures L"" expands to code units of 16-bit each. We already enforce this on x86, but as a small step towards ARM and RISC-V EFI support in barebox, enable it globally. We already treat wchar_t as 16-bit everywhere where it's used (It's typedef'ed in <linux/nls.h> and <linux/stddef.h>. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211122084732.2597109-16-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | drivers: efi: move Kconfig options to new menuAhmad Fatoum2021-11-251-3/+0
|/ | | | | | | | | CONFIG_EFI_BOOTUP isn't really a driver option and we got a new menu now for all things EFI, so let's move it there. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211122084732.2597109-12-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* x86: define phys_to_virt and virt_to_physAhmad Fatoum2021-08-231-0/+10
| | | | | | | | Some PCI drivers use those, so provide 1:1 implementations. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210812121944.4419-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* watchdog: add support for Intel TCO watchdog timerAhmad Fatoum2021-05-031-0/+1
| | | | | | | | | | | | | | | | | | Variants of the iTCO are integrated into many Intel southbridges. They are most often accessed via PCI. Add a driver for the variant found in the q35 QEMU machine. It should be straight forward to extend the itco_chipset_info array to support more variants in future as the need arises. To test, use: qemu-system-x86_64 -M q35 -global ICH9-LPC.noreboot=false The last option corresponds to a pin strap option, which can't be influenced from within the VM. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20210416062436.332665-5-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* pci: add EFI PCI root bridge IO protocol driverAhmad Fatoum2021-05-032-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | UEFI specifies two protocols for abstracting both the PCI host bus controller and for PCI devices. The protocol for PCI devices provides function pointers for accessing IO Port, Memory and PCI configuration space, among others. The protocol for bus controllers provides the ability to read the root bridge's PCI configuration space and to query resources. In barebox, we would want to reuse existing PCI drivers unmodified, so we utilize the root bridge protocol, unlike most other EFI payloads. We still utilize the PCI (device) IO protocol, but not for core functionality: EFI has already enumerated the bus for us and allocated the EFI handles. It thus makes sense to have the new pci device have the EFI handle as parent and the controller as grand parent instead of being sibling with the EFI handles. This is done with an early PCI fixup that patches the device's parent pointer after consulting the PCI IO GetLocation. Driver is written from scratch and hasn't seen heavy usage yet, so it should be used with care. It was written while consulting the UEFI 2.1D specification. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20210416062436.332665-4-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* x86: add DMA supportAhmad Fatoum2021-05-032-1/+36
| | | | | | | | | | | | | | | | | | | Both interconnect and PCI are cache coherent on x86, so we shouldn't need any special CPU barriers for DMA. Indeed, Linux defined neither ARCH_HAS_SYNC_DMA_FOR_CPU nor ARCH_HAS_SYNC_DMA_FOR_DEVICE on x86. It thus seems that the only reordering we need to take care of is compiler-induced reordering. The Linux memory model that barebox adheres to as well demands that all accesses to shared data are volatile. volatile accesses are already guarnateed to not be reordered against each other, so we don't even need an explicit barrier(), which is already the case on other architectures that have a disabled MMU. Cc: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20210416062436.332665-2-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* resource: enable use of iomem command on EFI systemsAhmad Fatoum2021-04-131-0/+3
| | | | | | | | | | | | iomem was so far unimplemented for EFI, because barebox didn't know what to put there as the UEFI implementation does the heavy lifting. Add an initcall that uses the EFI get_memory_map entry point to remedy this. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.pengutronix.de/20210410110355.2105448-1-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* x86: drop legacy (PC BIOS) boot in favor of EFIAhmad Fatoum2021-03-2540-2091/+12
| | | | | | | | | | | | | The 16-bit port has experienced bitrot and failed to compile with more recent linkers for at least a year. Fixing the linker error is insufficient to restore a barebox that can boot to shell. This continued breakage likely means that there are no users interested in updating. As new x86 projects should be using MACH_EFI_GENERIC anyway, retire support for 16-bit legacy boot (MACH_X86_GENERIC). Acked-by: Juergen Borleis <jbe@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* x86: implement setjmp/longjmp/initjmpAhmad Fatoum2021-03-175-0/+169
| | | | | | | | For use with bthreads, implement CONFIG_HAS_ARCH_SJLJ. Code is taken from U-Boot, itself based on the Linux ARCH=um. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* x86: configs: efi: enable some more useful optionsAhmad Fatoum2020-10-211-0/+18
| | | | | | | Enable some more options to make the defconfig more widely applicable. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc' into masterSascha Hauer2020-09-251-2/+0
|\
| * x86/config/efi: drop DRIVER_SERIAL_NS16550Uwe Kleine-König2020-09-231-1/+0
| | | | | | | | | | | | | | | | | | For most machines having DRIVER_SERIAL_NS16550 and DRIVER_SERIAL_EFI_STDIO both enabled results in the output appearing twice on the serial output. So remove disable the lowlevel driver and rely on the EFI bios for serial. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * Regenerate defconfig filesUwe Kleine-König2020-09-231-1/+0
| | | | | | | | | | | | | | | | Done with the same script used to generate commit d952a0eeba37 ("Regenerate defconfig files"). Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | arch/x86: Replace license and copyright boilerplate by SPDX identfiersUwe Kleine-König2020-09-2132-434/+91
|/ | | | | | | | Converts the files that licensecheck can determine the license for. Additionally some minor code reformatting is done. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* x86: Kconfig: specify sizeof(dma_addr_t) == 8 for 64BITAhmad Fatoum2020-07-141-0/+1
| | | | | | | | | This shouldn't introduce any functional change, because we don't yet do any DMA on EFI. For now it suppresses warnings about mismatched pointer and integer sizes when compile testing. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2020-06-111-40/+2
|\
| * arch: include <asm-generic/int-ll64.h> from <asm/types.h>Masahiro Yamada2020-05-181-40/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many architectures duplicate the same fixed type definitions as in <asm-generic/int-ll64.h>. Include <asm-generic/int-ll64.h> from <asm/types.h>, and remove the duplicated code. Note: Linux commit 0c79a8e29b5f ("asm/types.h: Remove include/asm-generic/int-l64.h") unified the kernel space definition into int-ll64.h. Barebox also adopts int-ll64. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | kbuild: switch over to thin archiveMasahiro Yamada2020-05-251-2/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Starting v4.13, Linux always uses thin archive instead of relocatable ELF to combine builtin objects. The thin archive is basically a text file that only contains paths to object files. As Linux commit 98ced886dd79 mentioned, this has a lot of benefits: - save disk space for builds - speed-up building a little - fix some issues when liking a giant executable (for example, allyesconfig on ARM Linux) - work better with dead code elimination The last one is important for barebox because pbl highly relies on the dead code elimination (-f{function,data}-sections and --gc-sections) dropping symbols that are unreachable from the linker's entry point. The dead code elimination does not work if the same symbol names are used in the pevious incremental link mechanism because the same name symbols all go into the same section. Commit a83c97f2a406 ("ARM: socfpga: generate smaller images when multiple boards are selected") worked around it by giving a dedicate section to each of the same name symbols. This workaround can go away. built-in.o was renamed to built-in.a since it is now an archive. built-in-pbl.o was renamed to built-in.pbl.a for consistency. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>