summaryrefslogtreecommitdiffstats
path: root/scripts
Commit message (Collapse)AuthorAgeFilesLines
* gen-dtb-s: annotate magic values with their meaningUwe Kleine-König2019-01-281-2/+2
| | | | | | | | | This helps understand how the imd stuff works because now $(git grep IMD_TYPE_OF_COMPATIBLE) also matches the critical code location that creates the imd entry. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* treewide: Remove trailing whitespaces and tabsAlexander Shiyan2019-01-212-2/+2
| | | | | | | Just a cleanup over barebox tree Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* kconfig: remove unused zconf.hash.cMasahiro Yamada2019-01-211-289/+0
| | | | | | | | | | For some reasons, I missed to delete this file in commit 997b70f585ef ("kconfig: sync to Linux 4.20"). Now really synced with Linux 4.20. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/risc-V'Sascha Hauer2019-01-151-0/+10
|\
| * RISC-V: erizo: add nmon image creationAntony Pavlov2019-01-071-0/+10
| | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2019-01-151-1/+1
|\ \
| * | scripts/mkcompile_h: Remove trailing spaces from compiler versionAntony Pavlov2018-12-171-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an adoption of the linux kernel commit | commit adcc3f7cee29eb831f79f4ac7ba6a0fbce7ac936 | Author: Jonathan Liu <net147@gmail.com> | Date: Mon Jun 12 18:23:17 2017 +1000 | | scripts/mkcompile_h: Remove trailing spaces from compiler version | | Improves the output of "cat /proc/version" by getting rid of the | trailing space at the end of the compiler version when the kernel | is compiled using GCC. | | Signed-off-by: Jonathan Liu <net147@gmail.com> | Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/kconfig'Sascha Hauer2019-01-15112-8007/+4251
|\ \
| * | kbuild: remove unnecessary LEX_PREFIX and YACC_PREFIXMasahiro Yamada2019-01-031-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because the latest Kconfig uses the default 'yy' prefix, this is no longer unneeded. Based on Linux commit eea199b445f6 ("kbuild: remove unnecessary LEX_PREFIX and YACC_PREFIX"). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | kconfig: sync to Linux 4.20Masahiro Yamada2019-01-0399-2186/+4202
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous sync was commit 18895514dc5e ("kconfig: update to v3.18-rc6"). Some commits were applied on top of that since then, but equivalent fixups were done in Linux. So, this commit overwrites everything scripts/kconfig/ with the one from Linux 4.20 Highlights: - 'silentoldconfig' has been renamed to 'syncconfig' (the top Makefile needs to be adjusted) - 'testconfig' target has been added for unit-tests (the top Makefile needs to export PYTHON3 because the test frame relies on Python3 and pytest) - The perfect hash table generated by gperf has been removed - The localization support has been removed - The 'option env=VAR' has been replaced with more generic variable reference syntax $(VAR) (./Kconfig and common/Kconfig need to be adjusted) Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | kbuild: generate lexer and parser during build instead of shippingMasahiro Yamada2019-01-035-5802/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recent kernel versions run flex and bison to generate lexers and parsers from real source files such as *.l and *.y . This provides better maintainability than version-controlling pre-generated C files with a "_shipped" suffix. This commit imports flex and bison rules from Linux, and deletes pre-generated parsers and lexers. Refer to the following commits in Linux: - 033dba2ec06c ("kbuild: prepare to remove C files pre-generated by flex and bison") - 29c833061c1d ("kconfig: generate lexer and parser during build instead of shipping") - e039139be8c2 ("scripts/dtc: generate lexer and parser during build instead of shipping") Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | kbuild: rename HOSTLOADLIBES_* to HOSTLDLIBS_*Masahiro Yamada2019-01-035-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is needed to resync kconfig to the latest Linux. Refer to Linux commit 8377bd2b9ee1 ("kbuild: Rename HOST_LOADLIBES to KBUILD_HOSTLDLIBS"). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | kbuild: clean up *.lex.c and *.tab.[ch] patterns from top-level MakefileMasahiro Yamada2019-01-032-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux commit 9a8dfb394c046742b2ac7444ba42272e11e9989d Files suffixed by .lex.c, .tab.[ch] are generated lexers, parsers, respectively. Clean them up globally from the top Makefile. Some of the final host programs those lexer/parser are linked into are necessary for building external modules, but the intermediates are unneeded. They can be cleaned away by 'make clean' instead of 'make mrproper'. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | .gitignore: move *.lex.c *.tab.[ch] patterns to the top-level .gitignoreMasahiro Yamada2019-01-032-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux commit 598893002745690e57692ca5bf6fb9ff04604a1b These patterns are common to host programs that require lexer and parser. Move them to the top .gitignore. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | kbuild: add %.lex.c and %.tab.[ch] to 'targets' automaticallyMasahiro Yamada2019-01-031-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux commit b23d1a241f4eb44ae55785c9b65274717c8e2c1e (adjust commit log for barebox) This will be needed for Barebox to switch to the compile-time generation of lexers and parsers. Files generated by if_changed* must be added to 'targets' to include *.cmd files. Otherwise, they would be regenerated every time. The build system automatically adds objects to 'targets' where appropriate, such as obj-y, extra-y, etc. but does nothing for intermediate files. So, each Makefile needs to add them by itself. There are some common cases where objects are generated by chained rules. Lexers and parsers are compiled like follows: %.lex.o <- %.lex.c <- %.l %.tab.o <- %.tab.c <- %.y They are common patterns, so it is reasonable to take care of them in the core Makefile instead of requiring each Makefile to do so. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | kbuild: add .SECONDARY special targetMasahiro Yamada2019-01-031-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on the following Linux commits: - 54a702f70589 ("kbuild: mark $(targets) as .SECONDARY and remove .PRECIOUS markers") - 8e9b61b293d9 ("kbuild: move .SECONDARY special target to Kbuild.include") This consolidates those two commits and adjusts commit log for barebox. GNU Make automatically deletes intermediate files that are updated in a chain of pattern rules. Example 1) %.dtb.o <- %.dtb.S <- %.dtb <- %.dts Example 2) %.o <- %.c <- %.c_shipped arch/arm/crypto/Makefile marks such targets as .PRECIOUS to prevent Make from deleting them, but the correct way is to use .SECONDARY. .SECONDARY Prerequisites of this special target are treated as intermediate files but are never automatically deleted. .PRECIOUS When make is interrupted during execution, it may delete the target file it is updating if the file was modified since make started. If you mark the file as precious, make will never delete the file if interrupted. Both can avoid deletion of intermediate files, but the difference is the behavior when Make is interrupted; .SECONDARY deletes the target, but .PRECIOUS does not. The use of .PRECIOUS is relatively rare since we do not want to keep partially constructed (possibly corrupted) targets. .SECONDARY with no prerequisites causes all targets to be treated as secondary. This agrees the policy of Kbuild. scripts/Kbuild.include seems a suitable place to add it because it is included from almost all sub-makes. I deleted 'SECONDARY' (no dot) from images/Makefile, which I guess a typo. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | kbuild: add .DELETE_ON_ERROR special targetMasahiro Yamada2019-01-031-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux commit 9c2af1c7377a8a6ef86e5cabf80978f3dbbb25c0 If Make gets a fatal signal while a shell is executing, it may delete the target file that the recipe was supposed to update. This is needed to make sure that it is remade from scratch when Make is next run; if Make is interrupted after the recipe has begun to write the target file, it results in an incomplete file whose time stamp is newer than that of the prerequisites files. Make automatically deletes the incomplete file on interrupt unless the target is marked .PRECIOUS. The situation is just the same as when the shell fails for some reasons. Usually when a recipe line fails, if it has changed the target file at all, the file is corrupted, or at least it is not completely updated. Yet the file’s time stamp says that it is now up to date, so the next time Make runs, it will not try to update that file. However, Make does not cater to delete the incomplete target file in this case. We need to add .DELETE_ON_ERROR somewhere in the Makefile to request it. scripts/Kbuild.include seems a suitable place to add it because it is included from almost all sub-makes. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | kbuild: filter-out PHONY targets from "targets"Masahiro Yamada2019-01-031-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux commit 591f66899784ae0afa13ff9a3eb5ce0a4358e48b The variable "targets" contains object paths for which existing .*.cmd files should be included. scripts/Makefile.build automatically adds $(MAKECMDGOALS) to "targets" as follows: targets += $(extra-y) $(MAKECMDGOALS) $(always) The $(MAKECMDGOALS) is a PHONY target in several places. PHONY targets never create .*.cmd files. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | recursive_action: add ACTION_SORT flagBaeuerle, Florian2019-01-082-0/+16
| | | | | | | | | | | | | | | | | | | | | | Add a flag to sort directory entries before recursing into them. Since this part of lib/ is used inside barebox as well as in scripts/bareboxenv.c, we cannot easily use stringlists from lib/, which would have made the code a bit nicer. Signed-off-by: Florian Bäuerle <florian.baeuerle@allegion.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts: Make list implementation usableSascha Hauer2019-01-032-2/+2
|/ | | | | | | | The list implementation in scripts/ includes poison.h which doesn't exist. Remove the inclusion and add the defines from poison.h that we need. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/imx'Sascha Hauer2018-12-072-3/+32
|\
| * scripts: imx-image: fix build with OpenSSL < 1.1.0Lucas Stach2018-12-071-0/+8
| | | | | | | | | | | | | | | | | | | | When adding support for OpenSSL 1.1.x it was missed that EVP_PKEY_get0_RSA is only available with that version. Earlier versions don't provide a fully equivalent function, so add it to the compatibility helpers. Fixes: 542a50d4eb (scripts: imx-image: fix build with OpenSSL 1.1.x) Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * scripts: imx-image: Add support for max_load_size optionSascha Hauer2018-11-302-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | When an image is loaded to SRAM we can normally only load a part of the full image, limited by the available space in SRAM. We currently load the pblb image which is the executable part of the PBL without the compressed barebox payload. We are going to link the compressed barebox image into the pbl image though, so we can't see the desired load size from outside the image anymore. This adds a max_load_size option to set this size explicitly. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * scripts: imx-image: Fix typos in commentsSascha Hauer2018-11-301-2/+2
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | checkpatch.pl: check for #if 0/#if 1Antony Pavlov2018-12-061-3/+8
| | | | | | | | | | | | | | | | | | | | | | The #if 0 or #if 1 is used to toggle features. Warn if #if 0 or #if 1 is present and suggest that they can be removed. Based on 60f890105547f7a4 ("checkpatch: check for #if 0/#if 1") Linux kernel commit. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | checkpatch.pl: use SPDX tagAntony Pavlov2018-12-061-1/+3
| | | | | | | | | | | | | | | | | | | | Also add Joe's copyright. Based on Linux kernel commit 882ea1d64eb3956 ("scripts: use SPDX tag in get_maintainer and checkpatch"). Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | checkpatch.pl: check for common memset parameter issues against statementsAntony Pavlov2018-12-061-0/+22
| | | | | | | | | | | | | | | | | | | | Based on these Linux kernel commits > 309c00c73f053a90 checkpatch: warn about memset with swapped arguments > 554e165cf32610ec checkpatch: check for common memset parameter issues against statments Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | checkpatch.pl: add ability to ignore various messagesAntony Pavlov2018-12-061-139/+336
|/ | | | | | | | | | | | | Based on commit 000d1cc1829f938c ("checkpatch.pl: add ability to ignore various messages") from Linux kernel. This simplifies current linux kernel checkpatch.pl commit adoption for barebox due to conversion of 1-argument ERROR($1), WARN($1) and CHK($1) subs into 2-argument ERROR($1, $2), WARN($1, $2) and CHK($1, $2) subs. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/imx'Sascha Hauer2018-11-092-1/+7
|\
| * scripts: imx-image: fix first instruction in i.MX8MQ headerLucas Stach2018-11-092-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The instruction being patched in was a branch to 0x24000, instead of the intended 0x9000. This doesn't matter when starting the image from a regular boot source, but breaks starting the image via bootm, as we rely on the jump in the first header instruction taking us to the actual code. As the code offset changes depending on the presence of the signed HDMI firmware, compute the offet dynamically while building the image. Fixes: 6d2132a9ded7 (scripts: imx-image: Add i.MX8MQ support) Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | kconfig: Avoid format overflow warning from GCC 8.1Sascha Hauer2018-11-021-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | Linux commit 2ae89c7a82ea9d81a19b4fc2df23bef4b112f24e adapted for barebox: In file included from scripts/kconfig/zconf.tab.c:2485: scripts/kconfig/confdata.c: In function ‘conf_write’: scripts/kconfig/confdata.c:773:22: warning: ‘%s’ directive writing likely 7 or more bytes into a region of size between 1 and 4097 [-Wformat-overflow=] sprintf(newname, "%s%s", dirname, basename); ^~ scripts/kconfig/confdata.c:773:19: note: assuming directive output of 7 bytes sprintf(newname, "%s%s", dirname, basename); ^~~~~~ scripts/kconfig/confdata.c:773:2: note: ‘sprintf’ output 1 or more bytes (assuming 4104) into a destination of size 4097 sprintf(newname, "%s%s", dirname, basename); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ scripts/kconfig/confdata.c:776:23: warning: ‘.tmpconfig.’ directive writing 11 bytes into a region of size between 1 and 4097 [-Wformat-overflow=] sprintf(tmpname, "%s.tmpconfig.%d", dirname, (int)getpid()); ^~~~~~~~~~~ scripts/kconfig/confdata.c:776:3: note: ‘sprintf’ output between 13 and 4119 bytes into a destination of size 4097 sprintf(tmpname, "%s.tmpconfig.%d", dirname, (int)getpid()); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Increase the size of tmpname and newname to make GCC happy. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: imx-usb-loader: list_imx_device_types(): move variable declaration ↵Marc Kleine-Budde2018-10-261-1/+3
| | | | | | | | | | | | | | | | out of for() loop On older compilers this causes the following error: | scripts/imx/imx-usb-loader.c: In function 'list_imx_device_types': | scripts/imx/imx-usb-loader.c:252:2: error: 'for' loop initial declarations are only allowed in C99 mode | for (int i = 0; i < ARRAY_SIZE(imx_ids); i++) { | ^ | scripts/imx/imx-usb-loader.c:252:2: note: use option -std=c99 or -std=gnu99 to compile your code Fixes: bcc2df673cdb ("scripts: imx-usb-loader: allow use of unknown USB IDs") Reported-by: Niklas Reisser <Niklas.Reisser@de.bosch.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/ratp'Sascha Hauer2018-10-093-0/+313
|\
| * bbremote: implement support for GPIO operationsAleksander Morgado2018-09-173-0/+166
| | | | | | | | | | Signed-off-by: Aleksander Morgado <aleksander@aleksander.es> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * bbremote: implement i2c read/write supportAleksander Morgado2018-09-173-0/+147
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend the bbremote script with operations to perform binary i2c read/write operations. E.g.: barebox:/ i2c_read -b 0 -a 0x68 -r 0x06A0 -c 4 -w 0x8f 0x30 0x00 0x00 barebox:/ i2c_write -b 0 -a 0x68 -r 0x06A0 -w 0x87 0x30 0x00 0x00 barebox:/ i2c_read -b 0 -a 0x68 -r 0x06A0 -c 4 -w 0x87 0x30 0x00 0x00 barebox:/ i2c_write -b 0 -a 0x68 -r 0x06A0 -w 0x8f 0x30 0x00 0x00 barebox:/ i2c_read -b 0 -a 0x68 -r 0x06A0 -c 4 -w 0x8f 0x30 0x00 0x00 =================================================================== $ ./scripts/bbremote --port /dev/ttyUSB2 i2c-read 0x00 0x68 0x06A0 0x01 4 8f300000 $ ./scripts/bbremote --port /dev/ttyUSB2 i2c-write 0x00 0x68 0x06A0 0x01 "87300000" 4 bytes written $ ./scripts/bbremote --port /dev/ttyUSB2 i2c-read 0x00 0x68 0x06A0 0x01 4 87300000 $ ./scripts/bbremote --port /dev/ttyUSB2 i2c-write 0x00 0x68 0x06A0 0x01 "8f300000" 4 bytes written $ ./scripts/bbremote --port /dev/ttyUSB2 i2c-read 0x00 0x68 0x06A0 0x01 4 8f300000 Signed-off-by: Aleksander Morgado <aleksander@aleksander.es> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | checkpatch: don't check TODO file presenceAntony Pavlov2018-09-181-1/+1
|/ | | | | | | | | | The commit b3baf2d86149 ("TODO: remove unused file") drops the TODO file. Alas scripts/checkpatch.pl checks TODO file presence in top_of_kernel_tree(). Without TODO checkpatch.pl exits with 'Must be run from the top-level dir. of a kernel tree'. Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/mxs'Sascha Hauer2018-09-111-20/+33
|\
| * scripts: mxsimage: Allow unencrypted imagesSascha Hauer2018-08-141-20/+33
| | | | | | | | | | | | | | | | | | | | | | Normally MXS SoCs only allow to boot images which have been encrypted with a zero key. If the ENABLE_UNENCTRYPTED_BOOT fuse is blown then the SoC also allows to boot unencrypted images. Add an option to the mxsimage tool to generate such images. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2018-09-111-0/+1
|\ \
| * | scripts/dtc: add fdtget to .gitignorePeter Mamonov2018-08-141-0/+1
| |/ | | | | | | | | Signed-off-by: Peter Mamonov <pmamonov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/imx-hab'Sascha Hauer2018-09-112-12/+221
|\ \
| * | scripts: imx: Support encrypted boot with HABv4Marcin Niestroj2018-09-042-11/+174
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | .imxcfg configuration files support few more commands, all starting with "hab_encrypt" string. That way it is possible to easily ignore these commands, when image encryption was not requested. Hence, we can use single .imxcfg file to generate signed and encrypted images in the same build. Images are encrypted in place by Freescale Code Signing Tool (cst), using Data Encryption Key (DEK). This key needs to be encapsulated by processor's hardware encryption engine to produce DEK blob, which is unique for each device. DEK blob needs to be part of CSF area, so we make enough space on the end of image to simply append it later, e.g. during device flash procedure. Introduced code was developed and tested on NXP i.MX6UL platform. Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: imx: add optional argument to hab_blocks commandMarcin Niestroj2018-09-041-3/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | hab_blocks command is used to specify image authentication blocks for HAB. Currently it was configured to authenticate full barebox image. However in case of booting from SD card and adding MBR partition table, HAB authentication fails, as final boot image is modified. Add an optional argument to hab_blocks command, to select between 3 types of authentication areas: - full: whole barebox image will be authenticated (this is default to keep compatibility), - from-dcdofs: image area up to dcdofs is not authenticated, so any changes up to dcdofs are possible, - skip-mbr: image area from 440 to 512 bytes is excluded from beeing authenticated, which allows to add / modify MBR partition table after building barebox image. Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts imx-image: add support for newer versions of "cst"Marc Kleine-Budde2018-09-041-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | Older versions of "cst" want to read the CSF from STDIN, while newer versions want to read the CSF from a file. Sadly, the "-i" option doesn't understand "-i -" to read from STDIN, so we give it "/dev/stdin" instead. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | ARM: i.MX: make HAB certificate pathes explicitly overwritableSascha Hauer2018-09-071-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When building HAB images for i.MX we have to specify some pathes to the certificates. This can be done with Kconfig variables. For better build system integration we also want to be able to specify the pathes in environment variables. This currently doesn't work as we specify the variables from the environment with the -D option to cpp, but also include generated/autoconf.h which overwrites the variables with the values from Kconfig. To overcome this introduce a Kconfig switch that explcitly selects whether we want to have the variables from Kconfig or the environment. Also, only pass the variables from the environment when explicitly wanted. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | scripts: imx-usb-loader: make i.MX6SoloX better to typeRoland Hieber2018-09-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Now that users can select the device type on the command line, having a name without whitespace makes input for that device type easier. Signed-off-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | scripts: imx-usb-loader: allow use of unknown USB IDsRoland Hieber2018-09-071-7/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some vendors fuse their devices so that the IMX USB ROM loader identifies itself with a different Vendor and Product ID on USB enumeration. Currently, imx-usb-loader will refuse to detect and work with such devices, so let's teach it. Because we cannot easily detect the device type from the USB ID in this case, introduce the new command line parameter -d <type> to specify the device type to use on the device path specified with -p <path>, even if the VID/PID pair of that device is unknown. The device name is sourced from the "name" field of the imx_ids array of known devices at the top of the file. Using "-d list" will print a list of known device types. Using -d without -p will not do anything useful, except generate a warning. Signed-off-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | scripts: imx-usb-loader: fail early if the USB device path does not matchRoland Hieber2018-09-071-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | find_imx_dev() loops through all USB devices, tries to open them, and then compares the chosen device path (given with -p on the command line) to the path of the currently opened device. The device path can be checked earlier, opening the device is not neccessary. We fail early here because in the next commit we want to enable the user to force using a device by specifying its path. Opening every single device available on the system then leads to unnecessary error messages for all devices that do not match the provided path. Signed-off-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | scripts: imx-usb-loader: rename imx_device() to imx_device_by_usb_id()Roland Hieber2018-09-071-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | Make its purpose more clear when we introduce other similar functions in one of the next commits. Signed-off-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | scripts: imx: Add support for signed HDMI firmwareAndrey Smirnov2018-09-042-5/+69
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | Boot header on i.MX8MQ SoC allows embedding signed HDMI firmware images that are used by mask ROM code during the very early stages of boot. Since providing that firmware appear to be necessary to enable SoC's HDMI/DP functionality extend imx-image tool to support this feature. To do that add code implementing "signed_hdmi_firmware" keyword, which allows users to specify a path to a binary blob containing all of the necessary headers and footers as well firmware data and code sections (this is how such images are provieded by NXP) Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>