summaryrefslogtreecommitdiffstats
path: root/Makefile
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next/riscv'Sascha Hauer2022-01-191-0/+5
|\
| * RISC-V: add stacktrace support via frame pointer walkingAhmad Fatoum2022-01-121-0/+5
| | | | | | | | | | | | | | | | | | Make debugging more convenient by implementing stack_dump() and changing exception handlers to print stack trace along with the register dump. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220108171524.587144-8-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Release v2022.01.0v2022.01.0Sascha Hauer2022-01-181-2/+2
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/efi'Sascha Hauer2021-12-151-1/+1
|\
| * 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>
* | Release v2021.12.0v2021.12.0Sascha Hauer2021-12-151-1/+1
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Release v2021.11.0v2021.11.0Sascha Hauer2021-11-151-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/targettools'Sascha Hauer2021-10-071-1/+8
|\
| * scripts: allow building USB loader tools for target as wellAhmad Fatoum2021-10-021-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently build the USB loader tools only for the host (build) system, but it can be useful to cross compile them as well for the target. We already have some target tools, but support for those is easier, because they don't link against libraries. We use pkg-config to get cc and ld flags, but we always assume that pkg-config is for the host system and there is no well-defined way to request pkg-config for the target system. Support this by introducing a new CROSS_PKG_CONFIG. This will be consulted only for target tools and default to $(CROSS_COMPILE)pkgconfig. Users can override it as necessary, for example, with Yocto, pkg-config will be for the cross environment, so target tools can now be built with: export ARCH=sandbox CROSS_COMPILE=aarch64-linux-gnu- export CROSS_PKG_CONFIG=pkg-config scripts make targettools_defconfig make scripts Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210917174127.23345-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Release v2021.10.0v2021.10.0Sascha Hauer2021-10-071-1/+1
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Release v2021.08.0v2021.08.0Sascha Hauer2021-08-231-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/nvmem'Sascha Hauer2021-07-181-1/+1
|\
| * sandbox: ship sample environmentAhmad Fatoum2021-07-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea of the stickypage was to have a 4K memory region persistent over resets. This region was implemented as mmap of a temporary hostfile, which was created on first barebox start and maintained over resets. Usability was a bit lacking however: - The temporary files weren't deleted - state always showed warnings and errors on first boot. The banner telling users to ignore this wasn't best user experience - In the same vein, the power driver had logic to handle a fresh (zeroed) stickypage and interpret that as POR boot We can avoid all that, by just shipping a default stickypage and referencing that from DT. Do that. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210629063730.7001-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Release v2021.07.0v2021.07.0Sascha Hauer2021-07-181-1/+1
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/testing'Sascha Hauer2021-06-161-1/+27
|\
| * test: add basic barebox self-test infrastructureAhmad Fatoum2021-06-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Self tests is code written to run within barebox to exercise functionality. They offer flexibility to test specific units of barebox instead of the program as a whole. Add a very simple infrastructure for registering and executing self-tests. This is based on the Linux kselftest modules. We don't utilize modules for this, however, because we only have module support on ARM, but we need a generic solution. Selftests can be enabled individually and even tested without shell support to allow tests to happen for size-restricted barebox images as well. Acked-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210604084704.17410-8-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * kbuild: add ARCH=um alias for sandboxAhmad Fatoum2021-06-091-0/+4
| | | | | | | | | | | | | | | | | | | | ARCH=um (User Mode) is the Linux kernel counterpart to our sandbox architecture. Add um as an alias, so we can interoperate with tools that handle ARCH=um specially. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210604084704.17410-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * kbuild: add ARCH={i386, x86_64} as aliases for x86Ahmad Fatoum2021-06-091-0/+8
| | | | | | | | | | | | | | | | | | Linux already does this. Follow suit so we can interoperate with tools that assume Linux-like Kbuild structure. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210604084704.17410-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * kbuild: add install targetAhmad Fatoum2021-06-091-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For CI, it would be useful to have the barebox build install the artifacts into a directory. Add an install target that does this. Example usage: make install INSTALL_PATH=install/ Unlike Linux, we don't set INSTALL_PATH to a default value, because most barebox-enabled boards don't have barebox in a file system. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210604084704.17410-2-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/kconfig'Sascha Hauer2021-06-161-6/+7
|\ \
| * | kconfig: update to Linux 5.13-rc1Masahiro Yamada2021-05-311-6/+7
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous sync was Linux 5.9-rc2. Resync scripts/kconfig/ with Linux 5.13-rc1. Highlights: - make header names in include/config/ and CONFIG symbols match (scripts/basic/fixdep.c was adjusted) - remove all 'option' syntax (common/Kconfig was adjusted) - introduce KCONFIG_DEFCONFIG_LIST instead of 'option defconfig_list' - bug fixes and cleanups of nconfig - drop Qt4 support from xconfig - bug fixes, improvements, cleanups of xconfig - print a short log for syncconfig Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Link: https://lore.barebox.org/20210530145842.2610109-2-masahiroy@kernel.org Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / Release v2021.06.0v2021.06.0Sascha Hauer2021-06-161-1/+1
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Release v2021.05.0v2021.05.0Sascha Hauer2021-05-171-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2021-04-151-28/+6
|\
| * common: add option for shipping KCONFIG_CONFIG as /env/data/configAhmad Fatoum2021-04-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Add a new option that enables access to the barebox configuration file through /env/data/config. This can be useful in environments where a fatter barebox can be tolerated (like on an EFI system partition). It could also be used to conditionally skip tests on disabled functionality in the future. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Tested-by: Roland Hieber <rhi@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * kbuild: add -Wtype-limits to compile flagsAhmad Fatoum2021-03-251-0/+3
| | | | | | | | | | | | | | | | | | | | Not warning about e.g. comparisons of unsigned integers with 0 can introduce nasty bugs around error handling especially. Enable the warning to be able to identify these issues in future. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * x86: drop legacy (PC BIOS) boot in favor of EFIAhmad Fatoum2021-03-251-28/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Release v2021.04.0v2021.04.0Sascha Hauer2021-04-151-1/+1
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* RISC-V: erizo: migrate to PBLAhmad Fatoum2021-03-231-0/+1
| | | | | | | | | | We now have everything in place to migrate erizo to PBL. As currently, this is the only board, we can drop all non-PBL support in the same go. Cc: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2021-03-231-0/+7
|\
| * kbuild: add '-fcf-protection=none' to barebox build optionsAhmad Fatoum2021-03-171-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ubuntu 19.10 enables this by default for x86 architectures. The option instructs the compiler to generate special nop instruction at all places where execution may jump to. This not only means the incoming setjmp implementations will need to be adjusted[1], but in case the option is extended to expose similar features of other microarches, this could lead to breakages there with newer compilers. Only safe way to use it seems to disable it wholesale and enable it selectively for platforms that are aware of it. So do the disabling part. [1]: https://github.com/ipxe/ipxe/commit/e8393c372 Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * kbuild: add '-fno-stack-check' to barebox build optionsAhmad Fatoum2021-03-171-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This ports over Linux commit 3ce120b16cc5 ("kbuild: add '-fno-stack-check' to kernel build options"): Author: Linus Torvalds <torvalds@linux-foundation.org> kbuild: add '-fno-stack-check' to kernel build options It appears that hardened gentoo enables "-fstack-check" by default for gcc. That doesn't work _at_all_ for the kernel, because the kernel stack doesn't act like a user stack at all: it's much smaller, and it doesn't auto-expand on use. So the extra "probe one page below the stack" code generated by -fstack-check just breaks the kernel in horrible ways, causing infinite double faults etc. [ I have to say, that the particular code gcc generates looks very stupid even for user space where it works, but that's a separate issue. ] Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> I am porting it, because it may become more acute with the incoming support for multiple stacks (via initjmp). Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Release v2021.03.0v2021.03.0Sascha Hauer2021-03-221-1/+1
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/virtio'Sascha Hauer2021-02-221-1/+9
|\
| * kbuild: add include/uapi to pathAhmad Fatoum2021-02-221-1/+9
| | | | | | | | | | | | | | | | | | | | | | Import the necessary bits out of the Linux Makefile, so include/uapi goes into the path. This allows importing Linux headers without changing the includes too much. Like with Linux <linux/*.h> is first searched in include/, then include/uapi. Code that explicitly needs the uapi header can include <uapi/linux/*.h>. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2021-02-221-2/+14
|\ \
| * | Kbuild: add compile_commands.json targetAhmad Fatoum2021-02-161-2/+14
| |/ | | | | | | | | | | | | | | | | | | | | | | | | The JSON compilation database format specification describes a compile_commands.json file that lists how translation units are compiled by a build system. This makes integration of external tools, like IDEs, LSP servers and static analyzers easier. Import the Linux bits. The database can now be manually generated with make compile_commands.json. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / Release v2021.02.0v2021.02.0Sascha Hauer2021-02-221-1/+1
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Release v2021.01.0v2021.01.0Sascha Hauer2021-01-181-2/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Release v2020.12.0v2020.12.0Sascha Hauer2020-12-111-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/sandbox'Sascha Hauer2020-11-101-0/+3
|\
| * kbuild: force compiler to assume two's complementAhmad Fatoum2020-10-191-0/+3
| | | | | | | | | | | | | | | | | | The kernel is compiled with this option and kernel code we port assumes that integer types are two's complement, so play it safe and disable optimizations that are possibly buggy in respect to barebox. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Release v2020.11.0v2020.11.0Sascha Hauer2020-11-091-1/+1
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc' into masterSascha Hauer2020-10-141-0/+20
|\
| * kbuild: add dtbs target for building all dtbs of an ARCHAhmad Fatoum2020-10-071-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | As described in the documentation, upstream device trees extended by barebox should take care to cause compile errors, not runtime errors, when the paths they extend disappear. This way, breakage can be easily detected when synchronizing the dts/ directory and fixed right then. Make this process easier by providing a dtbs target that builds all device trees available in arch/$(SRCARCH)/dts/. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/buildsystem-version' into masterSascha Hauer2020-10-141-1/+2
|\ \
| * | Makefile: add buildsystem version variableSteffen Trumtrar2020-09-251-1/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a new variable to store a buildsystem version information. The exact information that is stored here (git commit, git tag,...) is defined by the buildsystem. It is intended to have the possibility to get information about the exact barebox binary, environment and configuration. The variable is utilized the same as KERNELVERSION for linux: make BUILDSYSTEM_VERSION=$COMMITISH Via scripts/mkcompile_h this information is injected into the barebox codebase. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / Release v2020.10.0v2020.10.0Sascha Hauer2020-10-141-1/+1
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/kasan' into masterSascha Hauer2020-09-251-1/+5
|\
| * Add KASan supportSascha Hauer2020-09-221-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | KernelAddressSANitizer (KASAN) is a dynamic memory error detector. It provides a fast and comprehensive solution for finding use-after-free and out-of-bounds bugs. This adds support for KASan to barebox. It is basically a stripped down version taken from the Linux Kernel as of v5.9-rc1. Quoting the initial Linux commit 0b24becc810d ("kasan: add kernel address sanitizer infrastructure") describes what KASan does: | KASAN uses compile-time instrumentation for checking every memory access, | therefore GCC > v4.9.2 required. v4.9.2 almost works, but has issues with | putting symbol aliases into the wrong section, which breaks kasan | instrumentation of globals. | | Basic idea: | | The main idea of KASAN is to use shadow memory to record whether each byte | of memory is safe to access or not, and use compiler's instrumentation to | check the shadow memory on each memory access. | | Address sanitizer uses 1/8 of the memory addressable in kernel for shadow | memory and uses direct mapping with a scale and offset to translate a | memory address to its corresponding shadow address. | | For every 8 bytes there is one corresponding byte of shadow memory. | The following encoding used for each shadow byte: 0 means that all 8 bytes | of the corresponding memory region are valid for access; k (1 <= k <= 7) | means that the first k bytes are valid for access, and other (8 - k) bytes | are not; Any negative value indicates that the entire 8-bytes are | inaccessible. Different negative values used to distinguish between | different kinds of inaccessible memory (redzones, freed memory) (see | mm/kasan/kasan.h). | | To be able to detect accesses to bad memory we need a special compiler. | Such compiler inserts a specific function calls (__asan_load*(addr), | __asan_store*(addr)) before each memory access of size 1, 2, 4, 8 or 16. | | These functions check whether memory region is valid to access or not by | checking corresponding shadow memory. If access is not valid an error | printed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>