summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2022-03-18binman: Tweak collect_contents_to_file() and docsSimon Glass
Update the return value of this function, fix the 'create' typo and update the documentation for clarity. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Alper Nebi Yasak <[email protected]> Suggested-by: Alper Nebi Yasak <[email protected]>
2022-03-18elf: Rename load_segments() and module failureSimon Glass
Rename this function to make it clear that it only reads loadable segments. Also update the error for missing module to better match the message emitted by Python. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Alper Nebi Yasak <[email protected]> Suggested-by: Alper Nebi Yasak <[email protected]>
2022-03-18dtoc: Tidy up implementation of AddStringList()Simon Glass
Refactor this to avoid a loop. Also add a test for an empty string. Signed-off-by: Simon Glass <[email protected]> Suggested-by: Alper Nebi Yasak <[email protected]> Reviewed-by: Alper Nebi Yasak <[email protected]>
2022-03-18moveconfig: Use re.fullmatch() to avoid extra checkSimon Glass
Simplify the code by using the available function. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Alper Nebi Yasak <[email protected]>
2022-03-18moveconfig: Remove remove_defconfig()Simon Glass
This is not necessary if simpler code is used. Use the split function and drop the unnecessary [] Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Alper Nebi Yasak <[email protected]> Suggested-by: Alper Nebi Yasak <[email protected]>
2022-03-18dtoc: Make GetArgs() more flexibleSimon Glass
At present it is not possible to have arguments which include spaces. Update the function to only split the args if the property is a single string. This is a bit inconsistent, but might still be useful. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Alper Nebi Yasak <[email protected]> Suggested-by: Alper Nebi Yasak <[email protected]>
2022-03-18patman: Define Commit.path in the constructorSimon Glass
It is good practice to init all variables in the constructor and pylint sometimes checks this. Fix it. Signed-off-by: Simon Glass <[email protected]> Reported-by: Tom Rini <[email protected]>
2022-03-18binman: Include also subnodes in generator nodesJan Kiszka
This allows to prefill fdt and config nodes with hash and signature subnodes. It's just important to place the child nodes last so that hashes do not come before the data - would be disliked by mkimage. Signed-off-by: Jan Kiszka <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2022-03-18tools: binman: main.py: add build-sandbox in sys.pathPhilippe Reynes
Adds build-sandbox in sys.path to look for libfdt, otherwise py_test can't use binman. Signed-off-by: Philippe Reynes <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2022-03-18binman: Complete elf test coverageSimon Glass
Add coverage for the new elf functions needed for the event_dump.py script. Signed-off-by: Simon Glass <[email protected]>
2022-03-15test/py: Add tests for the erofsHuang Jianan
Add Python scripts to test 'ls' and 'load' commands, as well as test related filesystem functions. Signed-off-by: Huang Jianan <[email protected]>
2022-03-15CI, Docker: Update to latest focal tagTom Rini
Signed-off-by: Tom Rini <[email protected]>
2022-03-14Merge tag 'v2022.04-rc4' into nextTom Rini
Prepare v2022.04-rc4
2022-03-14tools: kwboot: Allow to mix positional arguments with option -bPali Rohár
Commit 9e6d71d2b55f ("tools: kwboot: Allow to use -b without image path as the last getopt() option") broke usage of kwboot with following arguments: kwboot -t -B 115200 /dev/ttyUSB0 -b u-boot-spl.kwb Fix parsing of option -b with optional argument again. Fixes: 9e6d71d2b55f ("tools: kwboot: Allow to use -b without image path as the last getopt() option") Signed-off-by: Pali Rohár <[email protected]> Reported-by: Tony Dinh <[email protected]> Tested-by: Tony Dinh <mibodhi at gmail.com> Reviewed-by: Stefan Roese <[email protected]>
2022-03-14tools: kwboot: Check if baudrate value is supported before sending imagePali Rohár
Call kwboot_open_tty() which baudrate value which was specified at the command line by option -B. This function returns error if baudrate is not supported by selected tty device. Initial baudrate for image transfer is always 115200, so call kwboot_tty_change_baudrate() with value 115200 immediately after kwboot_open_tty() if baudrate specified by option -B is different than 115200. This makes kwboot fail immediately, informing that baudrate is unsupported, instead of failing only after the first part of image is already sent. Signed-off-by: Pali Rohár <[email protected]> Reviewed-by: Stefan Roese <[email protected]>
2022-03-14tools: kwboot: Allow to specify custom baudrate only in supported operationsPali Rohár
Custom baudrate different than 115200 may be specified only when kwboot is not going to send boot/debug message pattern or when it is going to send boot message pattern with image file (in which case baudrate change happens after sending kwbimage header). BootROM detects boot/debug message pattern only at baudrate 115200. Signed-off-by: Pali Rohár <[email protected]> Reviewed-by: Stefan Roese <[email protected]>
2022-03-10binman: Expand elf support a littleSimon Glass
Allow finding a symbol by its address. Also export the function to get the file offset of a particular address, so it can be used by a script to be added. Signed-off-by: Simon Glass <[email protected]>
2022-03-04mkimage: error handling for FIT imageHeinrich Schuchardt
If parameter -F is given but FIT support is missing, a NULL pointer might dereferenced (Coverity CID 350249). If incorrect parameters are given, provide a message and show usage. Signed-off-by: Heinrich Schuchardt <[email protected]>
2022-03-04tools: kwboot: Update references with public linksPali Rohár
Public documents about BootROM of some Marvell SoCs are available in the public Web Archive. Put this information into source code. Signed-off-by: Pali Rohár <[email protected]> Reviewed-by: Stefan Roese <[email protected]> Tested-by: Stefan Roese <[email protected]>
2022-03-04tools: kwboot: Update doc about AvantaPali Rohár
Testes proved that current kwboot version supports also Avanta SoCs. It looks like that Avanta SoCs are using same kwbimage format as Armada. Signed-off-by: Pali Rohár <[email protected]> Tested-by: Tony Dinh <[email protected]> Reviewed-by: Stefan Roese <[email protected]> Tested-by: Stefan Roese <[email protected]>
2022-03-04tools: kwboot: Update usagePali Rohár
Add all supported Armada SoCs and document -b and -d options in usage. Signed-off-by: Pali Rohár <[email protected]> Reviewed-by: Stefan Roese <[email protected]> Tested-by: Stefan Roese <[email protected]>
2022-03-04tools: kwboot: Add support for backspace key in mini terminalPali Rohár
Marvell BootROM recognize only '\b' byte as backspace. Use terminfo for retrieving current backspace sequence and replace any occurrence of backspace sequence by the '\b' byte. Reading terminfo database is possible via tigetstr() function from system library libtinfo.so.*. So link kwboot with -ltinfo. Normally terminfo functions are in <term.h> system header file. But this header file conflicts with U-Boot "termios_linux.h" header file. So declare terminfo functions manually. Signed-off-by: Pali Rohár <[email protected]> Reviewed-by: Stefan Roese <[email protected]> Tested-by: Stefan Roese <[email protected]>
2022-03-04tools: kwboot: Fix sending and processing debug message pattern (-d option)Pali Rohár
-d option is currently broken. In most cases BootROM does not detect this message pattern. For sending debug message pattern it is needed to do same steps as for boot message pattern. Implement sending debug message pattern via same separate thread like it is for boot message pattern. Checking if BootROM entered into UART debug mode is different than detecting UART boot mode. When in boot mode, BootROM sends xmodem NAK bytes. When in debug mode, BootROM activates console echo and reply back every written byte (extept \r\n which is interpreted as executing command and \b which is interpreting as removing the last sent byte). So in kwboot, check that BootROM send back at least 4 debug message patterns as a echo reply for debug message patterns which kwboot is sending in the loop. Then there is another observation, if host writes too many bytes (as command) then BootROM command line buffer may overflow after trying to execute such long command. To workaround this overflow, it is enough to remove bytes from the input line buffer by sending 3 \b bytes for every sent character. So do it. With this change, it is possbile to enter into the UART debug mode with kwboot -d option. Signed-off-by: Pali Rohár <[email protected]> Reviewed-by: Stefan Roese <[email protected]> Tested-by: Stefan Roese <[email protected]>
2022-03-04tools: kwboot: Use separate thread for sending boot message patternPali Rohár
After BootROM successfully detects boot message pattern on UART it waits until host stop sending data on UART. For example Armada 385 BootROM requires that host does not send anything on UART at least 24 ms. If host is still sending something then BootROM waits (possibly infinitely). BootROM successfully detects boot message pattern if it receives it in small period of time after power on. So to ensure that host put BootROM into UART boot mode, host must send continuous stream of boot message pattern with a small gap (for A385 at least 24 ms) after series of pattern. But this gap cannot be too often or too long to ensure that it does not cover whole BootROM time window when it is detecting for boot message pattern. Therefore it is needed to do following steps in cycle without any delay: 1. send series of boot message pattern over UART 2. wait until kernel transmit all data 3. sleep small period of time At the same time, host needs to monitor input queue, data received on the UART and checking if it contains NAK byte by which BootROM informs that xmodem transfer is ready. But it is not possible to wait until kernel transmit all data on UART and at the same time in the one process to also wait for input data. This is limitation of POSIX tty API and also by linux kernel that it does not provide asynchronous function for waiting until all data are transmitted. There is only synchronous variant tcdrain(). So to correctly implement this handshake on systems with linux kernel, it is needed to use tcdrain() in separate thread. Implement sending of boot message pattern in one thread and reading of reply in the main thread. Use pthread library for threads. This change makes UART booting on Armada 385 more reliable. It is possible to start kwboot and power on board after minute and kwboot correctly put board into UART boot mode. Old implementation without separate thread has an issue that it read just one byte from UART input queue and then it send 128 message pattern to the output queue. If some noise was on UART then kwboot was not able to read BootROM response as its input queue was just overflowed and kwboot was sending more data than receiving. This change basically fixed above issue too. Signed-off-by: Pali Rohár <[email protected]> Reviewed-by: Stefan Roese <[email protected]> Tested-by: Stefan Roese <[email protected]>
2022-03-04tools: kwboot: Cleanup bootmsg and debugmsg variablesPali Rohár
Function kwboot_debugmsg() is always called with kwboot_msg_debug as msg and function kwboot_bootmsg() with kwboot_msg_debug as msg. Function kwboot_bootmsg() is never called with NULL msg. Simplify, cleanup and remove dead code. No functional change. Signed-off-by: Pali Rohár <[email protected]> Reviewed-by: Stefan Roese <[email protected]> Tested-by: Stefan Roese <[email protected]>
2022-03-04tools: kwboot: Remove msg_req_delayPali Rohár
Variable msg_req_delay is set but never used. So completely remove it. Signed-off-by: Pali Rohár <[email protected]> Reviewed-by: Stefan Roese <[email protected]> Tested-by: Stefan Roese <[email protected]>
2022-03-04tools: kwboot: Check for return value of kwboot_tty_send() and tcflush()Pali Rohár
Failure of kwboot_tty_send() and tcflush() functions is fatal, it does not make sense to continue. So return error back to the caller like in other places where are called these functions. Signed-off-by: Pali Rohár <[email protected]> Reviewed-by: Stefan Roese <[email protected]> Tested-by: Stefan Roese <[email protected]>
2022-03-04tools: kwboot: Fix quitting terminalPali Rohár
Sometimes kwboot after quitting terminal prints error message: terminal: Bad address This is caused by trying to call write() syscall with count of (size_t)-1 bytes. When quit sequence is split into more read() calls then number of input bytes (nin) at the end of cycle can underflow and be negative. Fix it. Fixes: de7514046ea5 ("tools: kwboot: Fix detection of quit esc sequence") Signed-off-by: Pali Rohár <[email protected]> Reviewed-by: Stefan Roese <[email protected]>
2022-03-03Merge https://gitlab.denx.de/u-boot/custodians/u-boot-fsl-qoriqTom Rini
Update and fixes for sl28, lx2, pblimage generation for some powerpc products
2022-03-02buildman: Update default config to build for sandboxSimon Glass
At present the default .buildman file written by buildman does not specify a default toolchain. Add an 'other' line so this works correctly and sandbox builds run as expected. Signed-off-by: Simon Glass <[email protected]>
2022-03-02moveconfig: Correct pylint errorsSimon Glass
Fix two pylint errors in this file. Note ACTION_SPL_NOT_EXIST is not defined so the dead code can be removed. Signed-off-by: Simon Glass <[email protected]>
2022-03-02binman: Correct pylint errorsSimon Glass
Fix pylint errors that can be fixed and mask those that seem to be incorrect. A complication with binman is that it tries to avoid importing libfdt (or anything that imports it) unless needed, so that things like help still work if it is missing. Note that two tests are duplicated in binman and two others have duplicate names, so both of these issues are fixed also. Signed-off-by: Simon Glass <[email protected]>
2022-03-02dtoc: Correct pylint errorsSimon Glass
Fix pylint errors in this directory. Signed-off-by: Simon Glass <[email protected]>
2022-03-02buildman: Correct pylint errorsSimon Glass
Fix pylint errors that can be fixed and mask those that seem to be incorrect. Signed-off-by: Simon Glass <[email protected]>
2022-03-02patman: Correct pylint errorsSimon Glass
Fix pylint errors that can be fixed and mask those that seem to be incorrect. Signed-off-by: Simon Glass <[email protected]>
2022-02-28tools: mkimage/dumpimage: Allow to use -l with -TPali Rohár
Currently -l option for mkimage and dumpimage ignores option -T and always tries to autodetect image type. With this change it is possible to tell mkimage and dumpimage to parse image file as specific type (and not random autodetected type). This allows to use mkimage -l or dumpimage -l as tool for validating image. params.type for -l option is now by default initialized to zero (IH_TYPE_INVALID) instead of IH_TYPE_KERNEL. imagetool_get_type() for IH_TYPE_INVALID returns NULL, which is assigned to tparams. mkimage and dumpimage code is extended to handle tparams with NULL for -l option. And imagetool_verify_print_header() is extended to do validation via tparams if is not NULL. Signed-off-by: Pali Rohár <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2022-02-28tools: pblimage: fix image header verification functionHou Zhiqiang
The Layerscape platforms have different RCW header value from FSL PowerPC platforms, the current image header verification callback is only working on PowerPC, it will fail on Layerscape, this patch is to fix this issue. This is a historical problem and exposed by the following patch: http://patchwork.ozlabs.org/project/uboot/patch/[email protected] Signed-off-by: Hou Zhiqiang <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2022-02-26tools: mkeficapsule: remove duplicated codeAKASHI Takahiro
That code is mistakenly duplicated due to copy-and-paste error. Just remove it. Fixes: CID 348360 Signed-off-by: AKASHI Takahiro <[email protected]> Reviewed-by: Heinrich Schuchardt <[email protected]>
2022-02-22binman: Allow different operations in FIT generator nodesSimon Glass
At present we only support expanding out FDT nodes. Make the operation into an @operation property, so that others can be supported. Re-arrange and tidy up the documentation so that it has separate headings for each topic. Signed-off-by: Simon Glass <[email protected]>
2022-02-22binman: Tidy up the docs a little with fitSimon Glass
Add a few quotes and clarify the data property. Signed-off-by: Simon Glass <[email protected]>
2022-02-22binman: fit: Refactor to reduce function sizeSimon Glass
Split subnode and property processing into separate functions to make the _AddNode() function a little smaller. Tweak a few comments. This does not change any functionality. Signed-off-by: Simon Glass <[email protected]>
2022-02-22binman: Move entry-data collection into a Entry methodSimon Glass
Collecting the data from a list of entries and putting it in a file is a useful operation that will be needed by other entry types. Put this into a method in the Entry class. Add some documentation about how to collect data for an entry type. Signed-off-by: Simon Glass <[email protected]>
2022-02-22binman: Add a ELF test file with disjoint text sectionsSimon Glass
Add a file that has two text sections at different addresses, so we can test this behaviour in binman, once added. Signed-off-by: Simon Glass <[email protected]>
2022-02-22binman: Support a list of strings with the mkimage etypeSimon Glass
At present the 'args' property of the mkimage entry type is a string. This makes it difficult to include CONFIG options in that property. In particular, this does not work: args = "-n CONFIG_SYS_SOC -E" since the preprocessor does not operate within strings, nor does this: args = "-n" CONFIG_SYS_SOC" "-E" since the device tree compiler does not understand string concatenation. With this new feature, we can do: args = "-n", CONFIG_SYS_SOC, "-E"; Signed-off-by: Simon Glass <[email protected]>
2022-02-22binman: Add to the TODOSimon Glass
Add some ideas that have come to mind recently. Signed-off-by: Simon Glass <[email protected]>
2022-02-22binman: Add support for TEE BL32Roger Quadros
Add an entry for OP-TEE Trusted OS 'BL32' payload. This is required by platforms using Cortex-A cores with TrustZone technology. Signed-off-by: Roger Quadros <[email protected]> Reviewed-by: Simon Glass <[email protected]> Add missing-blob-help, renumber the test file, update entry-docs: Signed-off-by: Simon Glass <[email protected]>
2022-02-22elf: Add a way to read segment information from an ELF fileSimon Glass
Add a function which reads the segments and the entry address. Also fix a comment nit in the tests while we are here. Signed-off-by: Simon Glass <[email protected]>
2022-02-22binman: Update docs to indicate mkimage is supportedSimon Glass
Now that there is a mkimage entry-type, update the docs to remove the future reference. Signed-off-by: Simon Glass <[email protected]>
2022-02-22dtoc: Support reading a list of argumentsSimon Glass
It is helpful to support a string or stringlist containing a list of space-separated arguments, for example: args = "-n fred", "-a", "123"; This resolves to the list: -n fred -a 123 which can be passed to a program as arguments. Add a helper to do the required processing. Signed-off-by: Simon Glass <[email protected]>
2022-02-22dtoc: Allow deleting nodes and adding them in the same syncSimon Glass
This does not work at present, since the current algorithm assumes that either there are no nodes or all nodes have an offset. If a node is new, but an old node is still in the tree, then syncing fails due to this assumption. Fix it and add a test. Signed-off-by: Simon Glass <[email protected]>