summaryrefslogtreecommitdiffstats
path: root/scripts
Commit message (Collapse)AuthorAgeFilesLines
* mxs: always build mxsimage and mxsboot toolsRoland Hieber2020-11-092-10/+1
| | | | | | | | | Both tools are used unconditionally by images/Makefile.mxs. Always build them for ARCH_MXS, and remove their prompt in the host tools section, as they are not really useful as stand-alone tools. Signed-off-by: Roland Hieber <rhi@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/sandbox' into masterSascha Hauer2020-10-141-3/+3
|\
| * gen-dtb-s: support x86 and other platforms with 16-bit .wordAhmad Fatoum2020-10-121-3/+3
| | | | | | | | | | | | | | | | | | | | | | On ARM, .word is 32-bit as expected in the script, but on x86 it's 16-bit, which leads to truncation. .int on the other hand is 32-bit both on ARM and x86 and very likely all other platforms we support, so change the .word to .int. 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-10-142-2/+2
|\ \
| * | scripts: kwboot: allow piping full buffer size at onceAhmad Fatoum2020-10-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While buf == _buf, their type and sizeof differ. The read syscall should have the buffer size as argument, but instead got the pointer's size. This likely doesn't change high-level behavior, because read was called in a loop, so fix this. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts/dtc: only append to HOST_EXTRACFLAGS instead of overwritingUwe Kleine-König2020-10-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This corresponds to Linux commit 7e2521a85c98 (that currently sits in linux-next) with the same short log. When building with $ HOST_EXTRACFLAGS=-g make the expectation is that host tools are built with debug informations. This however doesn't happen if the Makefile assigns a new value to the HOST_EXTRACFLAGS instead of appending to it. So use += instead of := for the first assignment. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/buildsystem-version' into masterSascha Hauer2020-10-141-0/+3
|\ \ \ | |_|/ |/| |
| * | Makefile: add buildsystem version variableSteffen Trumtrar2020-09-251-0/+3
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* / scripts: kwbimage: fix wrong return values on some errorsAhmad Fatoum2020-10-021-2/+2
|/ | | | | | | | | | Coccinelle detected that bootfrom and nandeccmode are unsigned, but check to be less than zero. Both are only used to hold the return value of functions that either return up to 0xFF on success and a negative error code otherwise. It's thus safe to make them signed. Do so. 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-2531-527/+499
|\
| * scripts: compiler.h: include <sys/types.h>Robert Karszniewicz2020-09-211-0/+1
| | | | | | | | | | | | | | ulong is not a standard type, so it has to be defined explicitly. Signed-off-by: Robert Karszniewicz <avoidr@posteo.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * scripts/imx: fix typo "unkown" -> "unknown"Uwe Kleine-König2020-09-181-1/+1
| | | | | | | | | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * scripts: tegra: Add missing includeSascha Hauer2020-09-151-0/+1
| | | | | | | | | | | | | | Include context.h to get the prototypes for the functions defined in context.c Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * scripts: Make locally used functions staticSascha Hauer2020-09-1511-38/+38
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * kconfig: update to Linux 5.9-rc2Masahiro Yamada2020-09-1417-488/+458
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous sync was Linux 5.7-rc2. Resync scripts/kconfig/ and scripts/Kconfig.include with Linux 5.9-rc2. Highlights: - fix and improve 'make xconfig' - remove '---help---' keyword - forbid nested 'choice' blocks Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/license' into masterSascha Hauer2020-09-254-25/+12
|\ \
| * | scripts/mxsimage: relicense to allow distribution of binary linked with OpenSSLUwe Kleine-König2020-09-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The GPL (both, versions 2 and 3) are incompatible with the OpenSSL license. According to the Free Software Foundation the copyright holders of GPL software have to provide an exception to allow this linkage. This is effectively a license change and so needs confirmation by all copyright holders. Acked-by: Marek Vasut <marex@denx.de> Cc: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts/rsatoc: relicense to allow distribution of binary linked with OpenSSLUwe Kleine-König2020-09-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The GPL (both, versions 2 and 3) are incompatible with the OpenSSL license. According to the Free Software Foundation the copyright holders of GPL software have to provide an exception to allow this linkage. This is effectively a license change and so needs confirmation by all copyright holders. Acked-by: Marc Kleine-Budde <mkl@pengutronix.de> Cc: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: convert imx-image and mxsimage to SPDXUwe Kleine-König2020-09-212-21/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | To simplify automatic license and copyright determination use SPDX tags and remove the license boiler plate. Reviewed-by: Roland Hieber <rhi@pengutronix.de> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | LICENSES: add used licenses to make spdxcheck happyUwe Kleine-König2020-09-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are copied from the Linux kernel (5.9-rc3). From the Linux-syscall-note exception a few items had to be removed from the SPDX-Licenses: list to make spdxcheck happy. Also drop deprecated names like LGPL-2.1 (use LGPL-2.1-only instead) and LGPL-2.1+ (use LGPL-2.1-or-later instead). Also drop the LGPL-2.1-or-later file, this license is handled in the LGPL-2.1 file. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts/spdxcheck: fix usage of non-existing variablesUwe Kleine-König2020-09-211-2/+2
| |/ | | | | | | | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/kbuild' into masterSascha Hauer2020-09-2510-50/+52
|\ \
| * | kbuild: introduce hostprogs-always-y and userprogs-always-yMasahiro Yamada2020-09-1510-49/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux commit faabed295cccc2aba2b67f2e7b309f2892d55004 You can use: hostprogs-always-y += foo as a shorthand for: hostprogs += foo always-y += foo Likewise, userprogs-always-y += foo as a shorthand for: userprogs += foo always-y += foo Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: remove redundant setupmbr addition to subdir-Masahiro Yamada2020-08-191-1/+1
| |/ | | | | | | | | | | | | | | | | | | This has already been added to subdir-$(CONFIG_X86) a few lines above. 'make mrproper' correctly descends into scripts/setupmbr/. Remove the redundant addition. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/kasan' into masterSascha Hauer2020-09-252-0/+27
|\ \
| * | Add KASan supportSascha Hauer2020-09-222-0/+27
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* / scripts/imx-usb-loader: Drop duplicate definition of ALIGNUwe Kleine-König2020-09-231-2/+0
|/ | | | | | | | | | | | | | | This fixes: scripts/imx/imx-usb-loader.c:42: warning: "ALIGN" redefined #define ALIGN(x, a) (((x) + (a) - 1) & ~((a) - 1)) In file included from scripts/imx/imx-usb-loader.c:35: scripts/include/linux/kernel.h:10: note: this is the location of the previous definition #define ALIGN(x, a) __ALIGN_MASK(x, (typeof(x))(a) - 1) Fixes: a876d16e6ad3 ("scripts: define ALIGN(x) in scripts' <linux/kernel.h>") Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc' into masterSascha Hauer2020-08-181-0/+1
|\
| * dtc_cpp: allow to pass options per targetDenis Osterland-Heim2020-08-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds support to pass extra option per target to DTC CPP. For example: DTC_CPP_FLAGS_my-board-name.dtb := -DMY_DEFINE=extra lwl-dtb-$(CONFIG_MACH_MY_BOARD_NAME) += my-board-name.dtb.o Signed-off-by: Denis Osterland-Heim <Denis.Osterland@diehl.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts/rsatoc: fix printing of error message, if environment variable ↵Marc Kleine-Budde2020-08-031-2/+4
|/ | | | | | | | doen't contain a path Fixes: 128ad3cbe043 ("scripts: Add rsatoc tool") Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/kbuild'Sascha Hauer2020-07-278-20/+66
|\
| * scripts: use 'userprogs' to build programs for targetMasahiro Yamada2020-06-235-19/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use 'userprogs' syntax to build standalone programs for the target architecture (i.e. the same architecture as the barebox). This changes the compiler flags passed to the target programs. Previously, it used $(KBUILD_CFLAGS), which contains the same compiler flags as used for the barebox space. Going forward, it will use $(KBUILD_USERCFLAGS), which contains smaller set of compiler flags because there is no need to add low-level options for userspace builds. The shortlog will be annotated with [U]. CC [U] scripts/bareboxenv-target CC [U] scripts/kernel-install-target CC [U] scripts/bareboxcrc32-target CC [U] scripts/bareboximd-target Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * kbuild: add infrastructure to build userspace programsMasahiro Yamada2020-06-233-1/+52
| | | | | | | | | | | | | | Import Linux commit 7f3a59db274c3e3d884c785e363a054110f1c266 Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts: imx-image: throw descriptive error on encountering dcdofsAhmad Fatoum2020-07-141-0/+9
| | | | | | | | | | | | | | | | | | With dcdofs renamed to ivtofs, out-of-tree boards will start to fail. Make the migration easier by suggesting what needs to be changed on stderr. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts: imx-image: Add i.MX8MP supportSascha Hauer2020-07-142-1/+9
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts: imx-image: rename dcdofs to ivtofsSascha Hauer2020-07-143-4/+4
| | | | | | | | | | | | | | | | | | This renames the dcdofs config option in the imx-image tool to ivtofs. dcdofs is a misnomer. The DCD (Device Configuration Data) is only one part of the data linked into the IVT (Image Vector Table), but the meaning of the option is really the latter, not the former. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts: imx-image: rename image_dcd_offset to image_ivt_offsetSascha Hauer2020-07-142-15/+15
| | | | | | | | | | | | | | | | | | image_dcd_offset is a misnomer, it should really be image_ivt_offset. The DCD (Device Configuration Data) is only one part of the data linked into the IVT (Image Vector Table), but the meaning of the variable is really the latter, not the former. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts: imx-image: Fix writing image with IVT offset = 0Sascha Hauer2020-07-141-10/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we have written the barebox header the next thing we do is to lseek forward by the size of the header gap. This means our position is already inside of the rest of the image and we have to skip this offset from the rest of the image. This only works when the rest of the image doesn't have anything needed in the first few bytes. Some newer SoCs have the IVT at offset 0 though, so with the current approach we skip writing the IVT. Instead of doing this we should lseek to the end of the header gap. With this we are at the right position to just write the full image containing the IVT. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts: imx-image: exit with error when barebox header conflicts with IVTSascha Hauer2020-07-141-0/+6
| | | | | | | | | | | | | | When the IVT is right at the beginning of the image it conflicts with the barebox header. Bail out with an error when this happens. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts: imx-image: Add extra code path for i.MX35Sascha Hauer2020-07-141-4/+7
| | | | | | | | | | | | | | | | | | The i.MX35 writes two copies of the header at the beginning of the image. This is written in a loop right now. Make the i.MX35 an extra code path so that it is out of the way for the changes in the next patches. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts: imx-image: exit on read/write failuresSascha Hauer2020-07-141-54/+23
| | | | | | | | | | | | | | | | When xread/xwrite fails the caller bails out of the program with an error. We can drop all the error handling by letting xread/xwrite call exit() themselves. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts: imx-image: Only set DCD pointer when we have DCD dataSascha Hauer2020-07-141-6/+8
|/ | | | | | | When we do not have any DCD data we can set the pointer to the data to NULL. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/sandbox-compile-test'Sascha Hauer2020-06-113-0/+82
|\
| * sandbox: define CONFIG_64BIT as appropriateAhmad Fatoum2020-06-031-0/+9
| | | | | | | | | | | | | | | | | | | | | | All 64-bit architectures are supposed to define CONFIG_64BIT to support the relevant 64-bit MMIO accessors. The sandbox architecture is a bit of a special case, because barebox uses the toolchain default and doesn't force a bitness. Add 64BIT as promptless symbol, which reflects the pointer size of the target platform. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * scripts: import Linux Kconfig.includeAhmad Fatoum2020-06-032-0/+73
| | | | | | | | | | | | | | | | | | | | | | | | With this include, we can have goodies like $(cc-option ...) and $(success ...) inside our Kconfig files. gcc-version also now becomes available. While unused for now, it can allow us to selectively turn on warnings on new GCC versions, which were previously disabled because of their too high false positive rate. 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-0/+1
|\ \ | |/ |/|
| * scripts: .gitignore: ignore mvebuimg binaryAhmad Fatoum2020-06-031-0/+1
| | | | | | | | | | | | | | | | If selected, we generate a mvebuimg binary that should be ignored by version control. Add .gitignore entry to do so. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | kbuild: switch over to thin archiveMasahiro Yamada2020-05-252-18/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | kbuild: unify barebox and pbl build commandsMasahiro Yamada2020-05-252-29/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current Linux uses the unified build command for built-in objects and module objects. This is possible because part-of-module is set to y when the target is being built for a module. If so, quiet_modtag is set to [M], and modkern_cflags is set to KBUILD_CFLAGS_MODULE instead of KBUILD_CFLAGS_KERNEL. Currently, barebox uses a separate build command for pbl, but the difference between cmd_cc_o_c and cmd_pbl_cc_o_c is just "-D__PBL__ $(PBL_CPPFLAGS)". By using the same approach as Linux, they can be unified. Set part-of-pbl flag to y when the target is being built for pbl. Merge cmd_as_o_S and cmd_link_o_target as well. This also changes the shortlog style as follows: PBLCC -> CC [P] PBLAS -> AS [P] PBLLD -> LD [P] This is more consistent with the policy in the Linux build system. In Linux, a capital letter enclosed square blackets indicates which target the object is being built for. CC object built for built-in CC [M] object built for modules CC [U] object built for userspace (proposed for Linux 5.8-rc1) The idea behind this is we use the same compiler $(CC) for them. Only the difference is the compiler flags. On the other hand, host programs are compiled by a different tool, $(HOSTCC), hence the shortlog is 'HOSTCC'. Barebox supports module builds (it seems), but the [P] notation does not conflict with [M] because pbl has a limited memory footprint. We never expect pbl can support the module feature. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | kbuild: resync modkern_{c, a}flags and quiet_modtag with Linux 5.7-rc6Masahiro Yamada2020-05-202-27/+20
| | | | | | | | | | | | | | | | | | | | The latest Linux calculates them more simply; part-of-module is set when the target is being built for a module. Also, rename real-objs-{y,m} to real-obj-{y,m}. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>