summaryrefslogtreecommitdiffstats
path: root/scripts
Commit message (Collapse)AuthorAgeFilesLines
* dtc: remove redundant YYLOC global declarationLucas Stach2020-04-271-1/+0
| | | | | | | Same as the upstream fix for building dtc with gcc 10. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/zynq'Sascha Hauer2020-04-161-2/+7
|\
| * scripts: zynq_mkimage: remove compiler warningMichael Graichen2020-04-141-2/+7
| | | | | | | | | | | | | | | | | | Fixes a warning while compiling zynq_mkimage.c scripts/zynq_mkimage.c:312:2: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result] fread returns the number bytes read, if it is not equal to st_size some error has happend Signed-off-by: Michael Graichen <michael.graichen@hotmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | fixdep: update to Linux 5.7-rc1Masahiro Yamada2020-04-153-33/+49
| | | | | | | | | | | | | | | | | | scripts/basic/ works for barebox as drop-in. Update scripts/basic/ to Linux 5.7-rc1. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | kbuild: update flex and bison rules to Linux 5.7-rc1Masahiro Yamada2020-04-152-23/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | Import the following commits from Linux, and re-sync. - 6ba7dc6616ce "kbuild: make bison create C file and header in a single pattern rule" - cf8dfd15e5fb "kbuild: move flex and bison rules to Makefile.host" Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | kbuild: rename hostprogs-y/always to hostprogs/always-yMasahiro Yamada2020-04-154-9/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ Linux commit 5f2fb52fac15a8a8e10ce020dd532504a8abfc4e ] In old days, the "host-progs" syntax was used for specifying host programs. It was renamed to the current "hostprogs-y" in 2004. It is typically useful in scripts/Makefile because it allows Kbuild to selectively compile host programs based on the kernel configuration. This commit renames like follows: always -> always-y hostprogs-y -> hostprogs So, scripts/Makefile will look like this: always-$(CONFIG_BUILD_BIN2C) += ... always-$(CONFIG_KALLSYMS) += ... ... hostprogs := $(always-y) $(always-m) I think this makes more sense because a host program is always a host program, irrespective of the kernel configuration. We want to specify which ones to compile by CONFIG options, so always-y will be handier. The "always", "hostprogs-y", "hostprogs-m" will be kept for backward compatibility for a while. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | checkpatch.pl: Update DT vendor prefix checkAntony Pavlov2020-04-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | In commit 796af3473b82 ("dts: update to v5.2-rc1") vendor-prefixes.txt has been converted to a DT schema. Update the checkpatch.pl DT check to extract vendor prefixes from the new vendor-prefixes.yaml file. Based on this linux kernel commit 852d095d16a6 ("checkpatch.pl: Update DT vendor prefix check"). Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | kconfig: update to Linux 5.5Masahiro Yamada2020-03-267-11/+38
| | | | | | | | | | | | | | The previous sync was Linux 5.3-rc3. This updates Kconfig to Linux 5.5. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | kbuild: change *FLAGS_<basetarget>.o to take the path relative to $(obj)Masahiro Yamada2020-03-263-14/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ Linux commit 54b8ae66ae1a3454a7645d159a482c31cd89ab33 ] Kbuild provides per-file compiler flag addition/removal: CFLAGS_<basetarget>.o CFLAGS_REMOVE_<basetarget>.o AFLAGS_<basetarget>.o AFLAGS_REMOVE_<basetarget>.o CPPFLAGS_<basetarget>.lds HOSTCFLAGS_<basetarget>.o HOSTCXXFLAGS_<basetarget>.o The <basetarget> is the filename of the target with its directory and suffix stripped. This syntax comes into a trouble when two files with the same basename appear in one Makefile, for example: obj-y += foo.o obj-y += dir/foo.o CFLAGS_foo.o := <some-flags> Here, the <some-flags> applies to both foo.o and dir/foo.o The real world problem is: scripts/kconfig/util.c scripts/kconfig/lxdialog/util.c Both files are compiled into scripts/kconfig/mconf, but only the latter should be given with the ncurses flags. It is more sensible to use the relative path to the Makefile, like this: obj-y += foo.o CFLAGS_foo.o := <some-flags> obj-y += dir/foo.o CFLAGS_dir/foo.o := <other-flags> At first, I attempted to replace $(basetarget) with $*. The $* variable is replaced with the stem ('%') part in a pattern rule. This works with most of cases, but does not for explicit rules. For example, arch/ia64/lib/Makefile reuses rule_as_o_S in its own explicit rules, so $* will be empty, resulting in ignoring the per-file AFLAGS. I introduced a new variable, target-stem, which can be used also from explicit rules. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | kbuild: remove clean-dirs syntaxMasahiro Yamada2020-03-262-15/+2
|/ | | | | | | | | | | | [ Linux comit 1634f2bfdb846ed0a8b73131a9dff7c420fb3fe1 ] The only the difference between clean-files and clean-dirs is the -r option passed to the 'rm' command. You can always pass -r, and then remove the clean-dirs syntax. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2020-03-181-1/+1
|\
| * scripts/bareboximd: add mode argument to open callFranck Jullien2020-03-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Newer gcc complain about missing mode argument when a new file is created. This is an extract of man-pages: "The mode argument specifies the file mode bits be applied when a new file is created. This argument must be supplied when O_CREAT or O_TMPFILE is specified in flags" Signed-off-by: Franck Jullien <franck.jullien@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/imx'Sascha Hauer2020-03-184-13/+64
|\ \ | |/ |/|
| * scripts: imx-usb-loader: Fix i.MX8MMSascha Hauer2020-02-244-9/+13
| | | | | | | | | | | | | | | | | | Most things valid for the i.MX8MQ are needed for the i.MX8MM as well, so add a common macro which returns true for both SoCs and use it where appropriate. Also we have to search for the i.MX header in a bigger area as it is at offset 33KiB. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * scripts: imx-image: Add i.MX8MM supportSascha Hauer2020-02-191-0/+1
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * scripts: imx-usb-loader: Add i.MX8MM supportSascha Hauer2020-02-191-1/+8
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * scripts: imx-usb-loader: Add 2nd stage loading supportSascha Hauer2020-02-191-3/+42
| | | | | | | | | | | | | | | | This adds the host part for 2nd stage uploading in case the RAM setup is done in code. This works in conjunction with "usb: gadget: fsl_udc: Add PBL image loading support". Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts: imd: remove duplicate macro definitionsAhmad Fatoum2020-02-191-4/+0
| | | | | | | | | | | | | | | | | | include/scripts/linux/kernel.h included via #include <linux/kernel.h> later on already defines these three macros. Remove them here to avoid the warnings about the duplicate macro definition. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts: define ALIGN(x) in scripts' <linux/kernel.h>Ahmad Fatoum2020-02-191-0/+2
|/ | | | | | | | | To make code sharing between utilities in scripts/ and barebox easier, define ALIGN in the scripts/include/linux/kernel.h as well for compatibility with the barebox include/linux/kernel.h. 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-02-181-1/+0
|\
| * scripts: imx: Remove unused variableSascha Hauer2020-02-101-1/+0
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/imx'Sascha Hauer2020-02-181-42/+12
|\ \
| * | scripts: imx-usb-loader: dladdr is unused, remove itSascha Hauer2020-02-131-21/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | The download address is the same as the place we put the header to, so we can drop the calculation of dladdr and use header_addr directly. Tested on i.MX51, i.MX53 and i.MX6 Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: imx-usb-loader: download address is always the header addressSascha Hauer2020-02-131-17/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We always have to upload the image beginning with the header, we have to skip everything that is before the header. In MODE_BULK this is explicit, but in HID mode this is obfuscated by doing several calculations with helper variables. Drop this and simplify code. Tested on i.MX51, i.MX53 and i.MX6 Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: imx-usb-loader: remove unnecessary checkSascha Hauer2020-02-131-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | file_base is the address where the image would be loaded to if we were not skipping the unused space before the header in the image. I can't see any reason why this should be higher than the download address. Drop this superfluous check. Tested on i.MX51, i.MX53 and i.MX6 Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: imx-usb-loader: Accept new header versionSascha Hauer2020-02-131-1/+1
| |/ | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / imd: add support for checksum generation/verificationSteffen Trumtrar2020-02-101-0/+34
|/ | | | | | | | | | Add a new imd type "checksum". This type consists of the CRC32 checksum of the whole barebox image minus the checksum itself. The checksum can be written to the imd field with the bareboximd host-tool. It can be verified with said tool or with "imd" on the target. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2020-01-151-0/+1
|\
| * Allow usage of default environment without environment file storageAlbert Schwarzkopf2019-12-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the default environment is only used when the barebox environment on the persistent store is not valid or when ENVFS_FLAGS_FORCE_BUILT_IN is set in the super block. However, ENVFS_FLAGS_FORCE_BUILT_IN can be cleared and the environmnet variables in the persistent store will be used again. This may not be desirable. This patch allows building CONFIG_DEFAULT_ENVIRONMENT independent of CONFIG_ENV_HANDLING. This can be useful if you never want to load or write values from the persistent store and you only need to read environment variables from your default environment. If CONFIG_ENV_HANDLING is not set, a message will be printed to the user indicating that changes to non-volatile variables won't be persisted. Move envfs functions that are needed when CONFIG_DEFAULT_ENVIRONMENT and/or CONFIG_ENV_HANDLING is set to a new file common/envfs-core.c. Signed-off-by: Albert Schwarzkopf <a.schwarzkopf@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | habv4: imx change signing area from full to the executed imageMaik Otto2020-01-081-24/+7
|/ | | | | | | | | | the whole barebox with mbr and partition table were be signed by default. change the signing to the executed image without signing the mbr, partition table and header_gap by imx8mq additional delete option full, from-dcdofs and skip-mbr Signed-off-by: Maik Otto <m.otto@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/zynq'Sascha Hauer2019-12-102-17/+258
|\
| * ARM: zynq: add size check in zynq_mkimageLucas Stach2019-11-111-0/+5
| | | | | | | | | | | | | | | | | | Currently Barebox does not support 2 stage loading on Zynq, so the image must fit into the free OCRAM area. Add a check to the mkimage tool to validate this. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: zynq: move header generation to zynq_mkimageLucas Stach2019-11-112-11/+222
| | | | | | | | | | | | | | | | | | | | Instead of generating a suitable image header with linker magic, move all of this into zynq_mkimage. The configuration file format and parsing is based on imx-image. This gets us one step further on the road to proper multi-image support. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: zynq: use getopt in zynq_mkimageLucas Stach2019-11-111-9/+34
| | | | | | | | | | | | | | Makes extending the command line much easier. Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/shebang'Sascha Hauer2019-12-109-9/+11
|\ \
| * | scripts: use #!/usr/bin/env bash shebang instead of #!/bin/bashFlorian Klink2019-12-069-9/+11
| |/ | | | | | | | | | | | | | | | | | | Some distributions might not have bash in /bin, but in $PATH. Using #!/usr/bin/env bash solves this, and is consistent with how the perl and python shebangs look like in the tree. Signed-off-by: Florian Klink <flokli@flokli.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / scripts: imx: report file where error occurredAhmad Fatoum2019-12-021-5/+18
|/ | | | | | | | | | | | | | | | | | | Especially when using #include directives in imxcfg files, error messages can be hard to follow because line numbers differ between preprocessor and source files. Teach the imx image generation tool about preprocessing line number / file name directive, so it can give more useful error messages. Instead of: error in line 11: Invalid argument It now says: $barebox/arch/arm/boards/$som/flash-header-$board.imxcfg:5: Invalid argument No change in compiled barebox binaries. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* kbuild: remove ar-optionMasahiro Yamada2019-10-181-5/+0
| | | | | | | | | | Linux commit 13dc8c029cab ("kbuild: remove ar-option and KBUILD_ARFLAGS") removed this already. Barebox has never used this macro. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/rsa'Sascha Hauer2019-10-175-0/+556
|\
| * rsa: Allow to directly compile in rsa public keysSascha Hauer2019-10-151-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | So far we relied on the U-Boot mkimage tool to generate us device tree snippets containing rsa public keys which we then compiled into barebox. Make this easier and allow to directly specify a filename or PKCS#11 URI in Kconfig. With this we no longer need the U-Boot mkimage tool here and no more external steps to prepare device tree snippets. With this rsa public keys can be directly compiled as C structs into barebox which is much more direct than putting it into the device tree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * scripts: Add rsatoc toolSascha Hauer2019-10-153-0/+490
| | | | | | | | | | | | | | | | The rsatoc tool converts rsa public keys into C structs suitable to compile with barebox. Most of the openssl rsa related stuff has been taken from the U-Boot mkimage tool. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * Kbuild: Add config_filename macro from kernelSascha Hauer2019-10-151-0/+49
| | | | | | | | | | | | | | The config_filename allows to extract a filename from a Kconfig string option. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/of-overlay'Sascha Hauer2019-10-171-0/+4
|\ \
| * | dtc: optionally add add __symbols__ to build-in devicetreeMichael Tretter2019-09-161-0/+4
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The devicetree overlay driver requires the __symbols__ node to resolve phandles to the base devicetree. If Barebox has to apply the overlay to the live devicetree, the build-in devicetree must be built with the __symbols__ node. It is configurable, because adding __symbols__ significantly increases the size of the devicetree binary. When configuring Barebox, a developer should be able to enable or disable devicetree overlay support and as this only affects the build-in devicetree, which is linked to the image anyway, use a Kconfig item for configuring the __symbols__. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2019-10-171-3/+3
|\ \
| * | kbuild, LLVMLinux: Add -Werror to cc-option to support clangMark Charlebois2019-10-141-3/+3
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clang will warn about unknown warnings but will not return false unless -Werror is set. GCC will return false if an unknown warning is passed. Adding -Werror make both compiler behave the same. [arnd: it turns out we need the same patch for testing whether -ffunction-sections works right with gcc. I've build tested extensively with this patch applied, so let's just merge this one now.] Signed-off-by: Mark Charlebois <charlebm@gmail.com> Signed-off-by: Behan Webster <behanw@converseincode.com> Reviewed-by: Jan-Simon Möller <dl9pf@gmx.de> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Kees Cook <keescook@chromium.org> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> [afa: ported to barebox from upstream c3f0d0bc5b01ad9] Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/layerscape'Sascha Hauer2019-10-171-1/+1
|\ \
| * | scripts: pblimage: explicitly set architecture to ARMAhmad Fatoum2019-09-181-1/+1
| |/ | | | | | | | | | | | | | | | | architecture is statically initialized to zero, which happens to be ARCH_ARM as it's the first enum constant. Make this a bit clearer by explicitly assigning ARCH_ARM to architecture. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/dtc'Sascha Hauer2019-10-1733-916/+819
|\ \
| * | scripts/dtc: Update to upstream version v1.5.1Ahmad Fatoum2019-10-0231-923/+435
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the following commits from upstream dtc: 60e0db3d65a1 Ignore phandle properties in /aliases 95ce19c14064 README: update for Python 3 5345db19f615 livetree: simplify condition in get_node_by_path b8d6eca78210 libfdt: Allow #size-cells of 0 184f51099471 Makefile: Add EXTRA_CFLAGS variable 812b1956a076 libfdt: Tweak data handling to satisfy Coverity 5c715a44776a fdtoverlay: Ignore symbols in overlays which don't apply to the target tree b99353474850 fdtoverlay: Allow adding labels to __overlay__ nodes in overlays d6de81b81b68 pylibfdt: Add support for fdt_get_alias() 1c17714dbb3a pylibfdt: Correct the FdtSw example ad57e4574a37 tests: Add a failed test case for 'fdtoverlay' with long target path bbe3b36f542b fdtoverlay: Rework output allocation 6c2e61f08396 fdtoverlay: Improve error messages 297f5abb362e fdtoverlay: Check for truncated overlay blobs 702c1b6c0e73 README.license: Update to reflect SPDX tag usage 4097bbffcf1d dtc: Add GPLv2 SPDX tags to files missing license text 94f87cd5b7c5 libfdt: Add dual GPL/BSD SPDX tags to files missing license text c4ffc05574b1 tests: Replace license boilerplate with SPDX tags a5ac29baacd2 pylibfdt: Replace dual GPLv2/BSD license boilerplate with SPDX tags 7fb0f4db2eb7 libfdt: Replace GPL/BSD boilerplate/reference with SPDX tags acfe84f2c47e dtc: Replace GPLv2 boilerplate/reference with SPDX tags 87963ee20693 livetree: add missing type markers in generated overlay properties 825146d13dc0 Fix typos in various documentation and source files 25bb080c18d1 Update the GPL2 text to the latest revision 243176c4ce84 Fix bogus error on rebuild ce01b21098a4 libfdt: Add FDT_CREATE_FLAG_NO_NAME_DEDUP flag that trades size for speed fbb62754ce45 libfdt: Introduce fdt_create_with_flags() 228a44cce857 libfdt: Ensure fdt_add_property frees allocated name string on failure 8f695676227b Avoid assertion in check_interrupts_property() 5c3513f68921 Link tools and tests against libfdt shared library 00f9febf9c16 tests: Rename tests.sh to testutils.sh c5d45188f923 Clean up LDLIBS handling 6ef8fcd05b74 Rebuild libfdt shared object if versioning linker script changes 26ee65a16c38 Use Python3 by default cca6546244cb libfdt: Make fdt_get_max_phandle() an inline 730875016a6a libfdt: Add phandle generation helper 7dfb61ba96b1 libfdt: Use fdt_find_max_phandle() 2bc5b66d7f6c libfdt: Add new maximum phandle lookup function 7fcf8208b8a9 libfdt: add fdt_append_addrrange() ae795b2db7a4 checks: Do not omit nodes with labels if symbol generation is requested eac2ad495b29 Update version.lds again f67b47135523 Revert "libfdt: Add phandle generation helper" 54ea41c22415 libfdt: Add phandle generation helper 4762ad051ee0 checks: Fix spelling in check_graph_endpoint Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>