summaryrefslogtreecommitdiffstats
path: root/scripts
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next/layerscape'Sascha Hauer2019-05-101-20/+16
|\
| * ARM: Layerscape: Add QSPI boot supportSascha Hauer2019-05-101-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Booting Layerscape from QSPI is a bit tricky and the approach we take is different from the one U-Boot has taken, so it's worth writing and reading the following explanation. The QSPI controller can map the Flash contents into the memory space (On LS1046a at 0x40000000). The PBL unit uses this to read the RCW from this memory window. The Layerscape SoCs have a PowerPC history, so it seemed appropriate for the designers to let the QSPI controller operate in big endian mode by default. To let the SoC see the correct RCW we have to write the RCW and PBI data with be64 endianess. Our PBL image tool pokes the initial binary into the SoC internal SRAM using PBI data as done with SD/MMC boot aswell. barebox then changes the QSPI controller endianess to le64 to properly read the barebox binary (placed at an flash offset of 128KiB, so found in memory at 0x40020000) into SDRAM and jumps to it. U-Boot has another approach. Here the initial binary is executed in place directly at 0x40100000. This means the QSPI controller endianess must be swapped inside the PBI data. This has the effect that the whole RCW/PBI data must be 64bit endianess swapped *except* the very last word of the PBI data which contains the CRC command and is read already with changed endianess. As a conclusion when porting QSPI PBI files from U-Boot to barebox skip commands changing the endianess in the QSPI controller and make sure the image is executed in internal SRAM and not in the Flash memory window. Lines like this should be removed: 09550000 000f400c This sets the binary execution address: 09570604 40100000 For barebox it should be changed to 0x10000000. As a result the PBI files can probably be unified between SD and QSPI boot. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * ARM: Layerscape: pblimage: Drop pbl end commandSascha Hauer2019-05-101-19/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The PBL image tool includes two commands into the image. These are executed after the initial image has been uploaded but before the final CRC check. These commands are "flush" and "wait". According to the reference manual a "flush" command can be used to read back the the value just written to CCSR register space in order to let the previous write complete. This seems unnecessary as the last write was never to the CCSR register space. The "wait" command also seems unnecessary as the time parameter is 0. As all this end_cmd stuff goes back to the PowerPC times and everything still seems to work on Arm let's just remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: i.MX: Add missing quotes to HAB specific definesSascha Hauer2019-04-231-1/+1
|/ | | | | | | | The Freescale Code Signing Tool (cst) needs quotes around the filenames passed in the csf file. Add these quotes when the CONFIG_HAB* variables are passed from the command line. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2019-04-091-1/+1
|\
| * treewide: surround Kconfig file paths with double quotesMasahiro Yamada2019-03-211-1/+1
| | | | | | | | | | | | | | | | | | Based on Linux commit 8636a1f9677db4f883f29a072f401303acfc2edd This will be needed when you sync Kconfig with Linux 5.0 or later. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/layerscape'Sascha Hauer2019-04-085-2/+479
|\ \
| * | scripts: Add Layerscape image toolSascha Hauer2019-03-132-0/+433
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the Layerscape image tool based on the corresponding U-Boot tool. PBL in the name is for "Pre-Boot Loader", just like the barebox PBL support, but here the name is for the Layerscape image format which has the same name. Layerscape SoCs load the initial image portion into SRAM, so only a fraction of the barebox image can initially be loaded. This tool expects the full barebox image and the size of the PBL part of this image specified to the -m option. The full barebox image is then placed in the output image at offset 128KiB. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | pbl multiimage: Allow to check image sizesSascha Hauer2019-03-133-2/+46
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PBL images are often constrained in size by limitations exposed by the SoCs SRAM size or partition sizes on the boot device. So far we tried to configure these limits in Kconfig, but with PBL multi images and thus different limitations for the different supported images this no longer works. This patch has another approach for it: During build time make variables containing the relevant sizes for each image are created. These are: PBL_CODE_SIZE_$(symbol) PBL_MEMORY_SIZE_$(symbol) PBL_IMAGE_SIZE_$(symbol) PBL_CODE_SIZE_$(symbol) contains the pure code size of the PBL, it should be smaller than the available SRAM during boot. Normally the PBL's bss segment also needs to be in the initial SRAM, for this case PBL_MEMORY_SIZE_$(symbol) is the relevant variable. PBL_IMAGE_SIZE_$(symbol) contains the full size of the PBL image including the compressed payload (but without any image headers created later by SoC specific image tools). $(symbol) is a placeholder for the start symbol used for this PBL image, thus for the i.MX53 QSB with entry start_imx53_loco PBL_CODE_SIZE_start_imx53_loco will be created. The images/Makefile.* can use these variables directly to check sizes or specify the same variables with a "MAX_" prefix. So when images/Makefile.imx specifies MAX_PBL_CODE_SIZE_start_imx53_loco = 0x10000 then the build system will make sure that the PBL code for the QSB will not get bigger than 64KiB. Also included in this patch are the size restrictions for the i.MX8MQ images as an example how to use this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / dtc: disable noisy warningsSascha Hauer2019-03-141-0/+4
|/ | | | | | | | | | | | | Disable the following warnings from dtc: -Wno-alias_paths -Wno-graph_child_address -Wno-simple_bus_reg -Wno-unique_unit_address This syncs the warning flags with the Kernel. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/imx'Sascha Hauer2019-03-071-6/+2
|\
| * imd: create new helper macro to add data from oftree to image meta dataUwe Kleine-König2019-02-251-6/+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/dtc'Sascha Hauer2019-03-0727-5488/+1713
|\ \
| * | scripts/dtc: Update to upstream version v1.4.7Ahmad Fatoum2019-02-2026-5476/+1702
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit was generated by running ./scripts/dtc/update-dtc-source.sh from the otherwise empty directory. Besides updating to the most recent dtc release (so that /omit-if-no-ref/ becomes available), it reinstates the dtc-lexer.l and dtc-parser.y files which were erroneously deleted in place of their pregenerated _shipped.c versions. Also removed are fdtputc.c and fdtdump.c, which aren't built or used anywhere. This adds the following commits from upstream: 88f18909db73 dtc: Bump version to v1.4.7 85bce8b2f06d tests: Correction to vg_prepare_blob() 57f7f9e7bc7c tests: Don't call memcmp() with NULL arguments c12b2b0c20eb libfdt: fdt_address_cells() and fdt_size_cells() 3fe0eeda0b7f livetree: Set phandle properties type to uint32 853649acceba pylibfdt: Support the sequential-write interface 9b0e4fe26093 tests: Improve fdt_resize() tests 1087504bb3e8 libfdt: Add necessary header padding in fdt_create() c72fa777e613 libfdt: Copy the struct region in fdt_resize() 32b9c6130762 Preserve datatype markers when emitting dts format 6dcb8ba408ec libfdt: Add helpers for accessing unaligned words 42607f21d43e tests: Fix incorrect check name 'prop_name_chars' 9d78c33bf8a1 tests: fix grep for checks error messages b770f3d1c13f pylibfdt: Support setting the name of a node 2f0d07e678e0 pylibfdt: Add functions to set and get properties as strings 354d3dc55939 pylibfdt: Update the bytearray size with pack() 3c374d46acce pylibfdt: Allow reading integer values from properties 49d32ce40bb4 pylibfdt: Use an unsigned type for fdt32_t 481246a0c13a pylibfdt: Avoid accessing the internal _fdt member in tests 9aafa33d99ed pylibfdt: Add functions to update properties 5a598671fdbf pylibfdt: Support device-tree creation/expansion 483e170625e1 pylibfdt: Add support for reading the memory reserve map 29bb05aa4200 pylibfdt: Add support for the rest of the header functions 582a7159a5d0 pylibfdt: Add support for fdt_next_node() f0f8c9169819 pylibfdt: Reorder functions to match libfdt.h 64a69d123935 pylibfdt: Return string instead of bytearray from getprop() 4d09a83420df fdtput: Add documentation e617cbe1bd67 fdtget: Add documentation 180a93924014 Use <inttypes.h> format specifiers in a bunch of places we should b9af3b396576 scripts/dtc: Fixed format mismatch in fprintf 4b8fcc3d015c libfdt: Add fdt_check_full() function c14223fb2292 tests: Use valgrind client requests for better checking 5b67d2b955a3 tests: Better handling of valgrind errors saving blobs e2556aaeb506 tests: Remove unused #define fb9c6abddaa8 Use size_t for blob lengths in utilfdt_read* 0112fda03bf6 libfdt: Add fdt_header_size() 6473a21d8bfe Consolidate utilfdt_read_len() variants d5db5382c5e5 libfdt: Safer access to memory reservations 719d582e98ec libfdt: Propagate name errors in fdt_getprop_by_offset() 70166d62a27f libfdt: Safer access to strings section eb890c0f77dc libfdt: Make fdt_check_header() more thorough 899d6fad93f3 libfdt: Improve sequential write state checking 04b5b4062ccd libfdt: Clean up header checking functions 44d3efedc816 Preserve datatype information when parsing dts f0be81bd8de0 Make Property a subclass of bytearray 24b1f3f064d4 pylibfdt: Add a method to access the device tree directly 84e414b0b5bc tests: Add a test case for the omit-if-no-ref keyword 4038fd90056e dtc: add ability to make nodes conditional on them being referenced e1f139ea4900 checks: drop warning for missing PCI bridge bus-range f4eba68d89ee checks: Print duplicate node name instead of parent name 46df1fb1b211 .travis.yml: Run valgrind checks via Travis 14a3002a1aee tests: Update valgrind suppressions for sw_tree1 02c5fe9debc0 tests: Remove valgrind error from tests/get_path df536831d02c checks: add graph binding checks 2347c96edcbe checks: add a check for duplicate unit-addresses of child nodes 8f1b35f88395 Correct overlay syntactic sugar for generating target-path fragments afbddcd418fb Suppress warnings on overlay fragments 119e27300359 Improve tests for dtc overlay generation aadd0b65c987 checks: centralize printing of property names in failure messages 88960e398907 checks: centralize printing of node path in check_msg f1879e1a50eb Add limited read-only support for older (V2 and V3) device tree to libfdt. 37dea76e9700 srcpos: drop special handling of tab 65893da4aee0 libfdt: overlay: Add missing license 962a45ca034d Avoid installing pylibfdt when dependencies are missing cd6ea1b2bea6 Makefile: Split INSTALL out into INSTALL_{PROGRAM,LIB,DATA,SCRIPT} 51b3a16338df Makefile.tests: Add LIBDL make(1) variable for portability sake 333d533a8f4d Attempt to auto-detect stat(1) being used if not given proper invocation Fixes: 273dbe5f87 ("kbuild: generate lexer and parser during build instead of shipping") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts/dtc: fix update-dtc-source.sh for barebox useAhmad Fatoum2019-02-201-12/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unlike Linux: - barebox' scripts/gen-dtb-s has a dependency on fdget, thus change the script to copy fdget.c as part of the update. - has the libfdt source files in the same directory as the rest - we don't have/need Makefile.libfdt Adjust the update-dtc-source.sh script to account for this, so it can be used to update the scripts/dtc directory. To do so, run the script while its directory is otherwise empty. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | defaultenv: Fix dependenciesSascha Hauer2019-02-271-1/+3
|/ / | | | | | | | | | | | | | | | | | | | | | | | | The defaultenv should be rebuilt once a file in it has changed. the genenv script always generates the environment file to a temporary file. Only if it has changed to the last target file the temporary file is moved over the target file. This means we always have to call genenv, thus replace "if_changed" with "cmd". With this dependencies are correctly tracked. New or changed files result in new image builds whereas unchanged environments do not unnecessarily result in new images. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / kbuild: Add missing semicolonSascha Hauer2019-02-141-2/+2
|/ | | | | | | | | | | | | | | | | Fixes: 4fafb35d925e5 ("kbuild: cherry-pick changes from Linux v5.0-rc3") The change cherry-picked from the Kernel commit 7d0ea2524202 ("kbuild: use 'else ifeq' for checksrc to improve readability") also removed the trailing semicolons from the cmd_*checksrc lines. These were removed in kernel commit e5d289100d ("kbuild: remove trailing semicolon from cmd_* passed to if_changed_rule"), but seems the barebox Kbuild version is not yet ready for this change. Without the semicolons a make C=1 build fails with: No such file: echo Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
* Merge branch 'for-next/misc'Sascha Hauer2019-02-134-293/+4
|\
| * 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/kbuild'Sascha Hauer2019-02-136-305/+157
|\ \
| * | scripts: fixdep: update to v5.0-rc3Masahiro Yamada2019-01-221-207/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous sync was commit c478aa16b191 ("scripts: fixdep: update from v3.10-rc1"). This updates it to Linux 5.0-rc3. It works for barebox as is. The code is much cleaner and optimized. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | kbuild: cherry-pick changes from Linux v5.0-rc3Masahiro Yamada2019-01-225-98/+33
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not synced completely. Just cherry-picking low-hanging fruits. 0b35786d77ba kbuild: call make once for all targets when O=.. is used 5e54d5e5fbc1 kbuild: kill EXTRA_ARFLAGS 836caba77c29 kbuild: kill backward compatibility checks 3156fd0529b5 kbuild: fix some minor typoes b8b0618cf6fa kbuild: remove extra ifdef/endif of top Makefile 16f890988114 kbuild: Remove reference to uninitialised variable 9319f4539c18 kbuild: support simultaneous "make %config" and "make all" 9d5db8949f1e scripts/Makefile.clean: clean also $(extra-m) and $(extra-) a4954fd7724c kbuild: remove obj-n and lib-n handling 371fdc77af44 kbuild: collect shorthands into scripts/Kbuild.include a29b82326ed4 kbuild: Remove duplicate $(cmd) definition in Makefile.clean a1e7b7bb1ab5 Makefile: sort list of defconfig targets in make help output 34948e0bbf98 kbuild: Drop support for clean-rule 4218affdf57f kbuild: remove warning about "make depend" 9c8fa9bc08f6 kbuild: fix if_change and friends to consider argument order 39a33ff80a25 kbuild: remove cc-option-align a7f924190924 kbuild: add %.dtb.S and %.dtb to 'targets' automatically 54a702f70589 kbuild: mark $(targets) as .SECONDARY and remove .PRECIOUS markers 9564a8cf422d Kbuild: fix # escaping in .cmd files for future Make bd412d81b7ea kbuild: .PHONY is not a variable, but PHONY is 6916162c7308 kbuild: remove duplicated comments about PHONY d6c6ab93e17f kbuild: remove deprecated host-progs variable 7d0ea2524202 kbuild: use 'else ifeq' for checksrc to improve readability 3f80babd9ca4 kbuild: remove unused cc-fullversion variable bd352a739fde kbuild: remove unused baseprereq b421b8a6cb87 kbuild: remove unused archmrproper Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/imx'Sascha Hauer2019-02-131-17/+23
|\ \
| * | scripts: imx-image: make read_file behaviour consistentSascha Hauer2019-02-111-13/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When read_file fails then it exits the program in most cases. Let's exit the program when stat() fails aswell, so that we *always* exit the program on failure. Drop all error handling for read_file since that's no longer necessary and rename the function to xread_file to make clear it won't fail. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: imx-image: Be more informative on open errorsSascha Hauer2019-02-111-4/+12
| |/ | | | | | | | | | | | | | | When opening a file fails then consistently print a message which file we cannot open and why. In one place no error checking was done at all, so add this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Revert "images: Drop unnecessary fix_size"Sascha Hauer2019-02-131-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 5c0e16591d9471a345b77a41fde76de34f301f6b. The fix_size scripts is not necessary for newer ARM toolchains, it is however necessary for the older ARM toolchains (gcc-5 and older). The original reason to drop fix_size was that it doesn't work on MIPS. With this patch we add the -i flag so that we ignore unknown images and can succesfully build MIPS images. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts: bareboxenv.c: fix warning: ‘xstrdup’ defined but not usedOleksij Rempel2019-01-291-10/+0
|/ | | | | Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> 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>