aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-03-09Merge tag 'dm-next-9mar23' of ↵WIP/09Mar2023-nextTom Rini132-823/+3074
https://source.denx.de/u-boot/custodians/u-boot-dm into next binman x509, separate tools dir and other improvements patman parallel patch generation fdt fixes and tests PyPi support for U-Boot tools buildman reproducible builds
2023-03-08binman: Support generation of x509 certificatesSimon Glass7-0/+333
And a new entry type which supports generation of x509 certificates. This uses a new 'openssl' btool with just one operation so far. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08binman: Support updating section contentsSimon Glass10-15/+287
Implement this feature since it is useful for updating FITs within an image. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08binman: Handle missing bintools correctly in fitSimon Glass2-1/+11
At present these are handled as if they are allowed to be missing, but this is only true if the -M flag is provided. Fix this and add a test. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08binman: Allow preserving the output dir when replacingSimon Glass3-7/+20
Add these flags for the 'replace' subcommand too, to aid debugging. Signed-off-by: Simon Glass <sjg@chromium.org> 44 2023 -0700
2023-03-08buildman: Correct CROSS_COMPILE output for sandboxSimon Glass1-2/+1
At present, 'buildman -A sandbox' adds the path containing the toolchain at present. We can assume that this is in the path and we don't want to set CROSS_COMPILE=/bin/ so change this to align with what MakeEnvironment() does. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08patman: Check patches in parallelSimon Glass1-20/+26
For large series this can take a while. Run checkpatch in parallel to try to reduce the time. The checkpatch information is still reported in sequential order, so a very slow patch at the start can still slow things down. But overall this gives good results. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Douglas Anderson <dianders@chromium.org>
2023-03-08patman: Run get_maintainer.pl in parallelSimon Glass2-3/+32
This script can take ages on some series. Try to limit the time by using threads. If a few stubborn patches remain, show progress so the user has some idea what is going on. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Douglas Anderson <dianders@chromium.org>
2023-03-08patman: Refactor MakeCcFile() into two functionsSimon Glass1-24/+57
This function is quite long. Moving the handling of a commit into a separate function. This will make it easier to do the work in parallel. Update function comments while we are here. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Douglas Anderson <dianders@chromium.org>
2023-03-08patman: Drop an incorrect comment about git amSimon Glass1-1/+1
Patman does not do this anymore, as of this commit: 7428dc14b0f ("patman: Remove the -a option") Drop the comment. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Douglas Anderson <dianders@chromium.org>
2023-03-08test: cmd: fdt: Add list of remaining missing testsMarek Vasut1-0/+7
Add list of missing tests for the 'fdt' command, currently the missing sandbox tests are only 'fdt boardsetup' and 'fdt checksign' . Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-08test: cmd: fdt: Test fdt bootcpuMarek Vasut1-0/+33
Add 'fdt bootcpu' test which works as follows: - Create basic FDT, map it to sysmem - Print the FDT bootcpu - Set the FDT bootcpu and read the value back using 'fdt header get' - Perform the previous step twice to validate bootcpu overwrite The test case can be triggered using: " ./u-boot -Dc 'ut fdt' " To dump the full output from commands used during test, add '-v' flag. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-08test: cmd: fdt: Test fdt rmMarek Vasut1-0/+84
Add 'fdt rm' test which works as follows: - Create fuller FDT, map it to sysmem - Selectively delete nodes or properties by both path and aliases - Verify created nodes or properties using fdt print command The test case can be triggered using: " ./u-boot -Dc 'ut fdt' " To dump the full output from commands used during test, add '-v' flag. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-08test: cmd: fdt: Test fdt mknodeMarek Vasut1-0/+68
Add 'fdt mknode' test which works as follows: - Create fuller FDT, map it to sysmem - Create node either in / or subnode - Attempt to create node over existing node, which fails - Attempt to create subnodes in non-existing nodes or aliases - Verify created nodes using fdt list command The test case can be triggered using: " ./u-boot -Dc 'ut fdt' " To dump the full output from commands used during test, add '-v' flag. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-08test: cmd: fdt: Test fdt setMarek Vasut1-0/+144
Add 'fdt set' test which works as follows: - Create fuller FDT, map it to sysmem - Set either existing property to overwrite it, or new property - Test setting both single properties as well as string and integer arrays - Test setting to non-existent nodes and aliases - Verify set values using 'fdt get value' The test case can be triggered using: " ./u-boot -Dc 'ut fdt' " To dump the full output from commands used during test, add '-v' flag. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-08test: cmd: fdt: Test fdt get sizeMarek Vasut1-0/+87
Add 'fdt get size' test which works as follows: - Create fuller FDT, map it to sysmem - Get size of various properties - Get node count of available nodes - Test non-existent nodes and properties The test case can be triggered using: " ./u-boot -Dc 'ut fdt' " To dump the full output from commands used during test, add '-v' flag. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-08test: cmd: fdt: Test fdt get addrMarek Vasut1-0/+67
Add 'fdt get addr' test which works as follows: - Create fuller FDT, map it to sysmem - Get address of various properties - Compare addresses calculated by UT and fdt command This test is special in that it has to go through gruesome remapping scheme where the test calculates: - pointer offsets of the generated FDT root and the property being tested - map_sysmem() result of environment variable "fdtaddr" and the one set by the test matching address of property being tested - difference between the later and the former, to obtain offset of the DT property from start of DT The offsets must match in both the UT and the tested U-Boot, if they do not, the test fails. The test case can be triggered using: " ./u-boot -Dc 'ut fdt' " To dump the full output from commands used during test, add '-v' flag. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-08test: cmd: fdt: Test fdt get nameMarek Vasut1-0/+79
Add 'fdt get name' test which works as follows: - Create fuller FDT, map it to sysmem - Get name of / node 0, 1 and /clk-test node 0 - Compare output and validate the node name - Get name of / node 2 and /clk-test node 1 - Compare output and validate the node is not present - Get name of / node -1 and /clk-test node -1 - Compare output and validate the node name equals node 0 name - Check nonexistent node, verify the command errors out The test case can be triggered using: " ./u-boot -Dc 'ut fdt' " To dump the full output from commands used during test, add '-v' flag. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-08test: cmd: fdt: Test fdt resizeMarek Vasut1-0/+24
Add 'fdt resize' test which works as follows: - Create simple FDT with extra size 0, map it to sysmem - 'resize' the FDT by 0x2000 bytes - Verify the new space has been added to the FDT The test case can be triggered using: " ./u-boot -Dc 'ut fdt' " To dump the full output from commands used during test, add '-v' flag. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-08test: cmd: fdt: Test fdt moveMarek Vasut1-0/+34
Add 'fdt move' test which works as follows: - Create simple FDT, map it to sysmem - 'move' the FDT into new zeroed out sysmem location - Verify newly active FDT is in the new location - Compare both locations The test case can be triggered using: " ./u-boot -Dc 'ut fdt' " To dump the full output from commands used during test, add '-v' flag. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-08test: cmd: fdt: Test both string and integer arrays in 'fdt get value'Marek Vasut1-16/+42
The 'fdt get value' subcommand now supports extraction of integer value from integer arrays, add test for it, including a test for special case unindexed integer array read, which is handled as hash and treated as a long string instead of integer. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-08test: cmd: fdt: Test alias resolution in 'fdt get value'Marek Vasut1-20/+45
The 'fdt' command help contains the following note: " Dereference aliases by omitting the leading '/', e.g. fdt print ethernet0. " Add test for it. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-08test: cmd: fdt: Generate fuller DT internally and switch fdt get value to itMarek Vasut1-13/+111
Implement function to generate internal test DT fragment and switch the 'fdt get value' test to this instead of depending on the sandbox DT. Rename clk-test node to test-node node. This FDT fragment will be reused by other tests. No functional change. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-08test: cmd: fdt: Rename fdt_test_get() to fdt_test_get_value()Marek Vasut1-3/+3
The 'fdt get' command has a 'get value' subcommand, rename the fdt_test_get() to fdt_test_get_value() to avoid confusion about what it is testing. There is currently no get 'get name', 'get addr', 'get size' subcommand test. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-08test: cmd: fdt: Rename fdt_test_resize() to fdt_test_addr_resize()Marek Vasut1-2/+2
The 'fdt' command has a 'resize' subcommand, rename the fdt_test_resize() to fdt_test_addr_resize() to avoid confusion about what it is testing. There is currently no resize test. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-08test: Add ut_assert_nextline_empty() empty line helperMarek Vasut1-0/+4
Add helper macro to test for empty lines, which is an inobvious wrapper around ut_assert_nextline("%s", "") . Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-08cmd: fdt: Add support for integer arrays in fdt get value with indexMarek Vasut1-2/+12
Currently any integer array value is set as long up-to-40 character hexadecimal string into environment variable when extracted from an FDT using 'fdt get value path prop index', because the support for handling integer arrays is not implemented, and fdt_value_env_set() code falls back into the hash handling behavior instead. Implement this support simply by checking whether user supplied any index. If index is set and the property length is multiple of four, then this is an integer array, and the code would extract value at specified index. There is a subtle change where default index is set to -1 instead of 0. This is OK, since the only place which checks for index to be less or equal zero is the string array handling code in fdt_value_env_set() and that code would work perfectly well with index -1 too. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-08cmd: fdt: Map address returned from fdt get addr to sysmemMarek Vasut1-1/+2
The address returned from 'fdt get addr' command must be mapped into sysmem, as this is a working FDT. Access to this address without mapping it would lead to crash e.g. in sandbox. The following command triggers the crash: " ./u-boot -Dc 'fdt addr $fdtcontroladdr ; fdt get addr var / compatible ; md $var' " Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-08cmd: fdt: Handle 64bit pointers in fdt get addrMarek Vasut1-2/+2
The command assumed 32bit pointers so far, with 64bit pointer the command would overwrite a piece of stack. Fix it by extending the array size to cater for 64bit pointer, and use snprintf() to avoid writing past the end of the array ever again. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-08cmd: fdt: Align checksign parameter names in help textMarek Vasut1-2/+2
The help text references 'addr' as an optional key start address, but the explanation references the same as 'start', make sure they both read as 'addr'. Also update the abbreviated 'addr' in the explanation to 'address'. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-08cmd: fdt: Check argc before accessing argv in fdt memoryMarek Vasut1-0/+4
On case 'fdt memory' is invoked without parameters, argv[2]/argv[3] is not valid and this command would SEGFAULT in sandbox environment. Add missing argc test to avoid the crash and rather print usage help message. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-08cmd: fdt: Check argc before accessing argv in fdt bootcpuMarek Vasut1-1/+6
On case 'fdt bootcpu' is invoked without parameters, argv[2] is not valid and this command would SEGFAULT in sandbox environment. Add missing argc test to avoid the crash and rather print usage help message. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-08cmd: fdt: Fix fdt rsvmem behavior on non-existent index and error message spaceMarek Vasut1-4/+4
In case 'fdt rsvmem delete index' is passed a non-existent index, one which does not exist in 'fdt rsvmem print', then the following command triggers a print of help message for 'fdt' command instead of erroring out: => fdt rsvmem delete 1234 This is because the subcommand errornously returns 'err' instead of CMD_RET_FAILURE, fix it. Furthermore, align the number of spaces past fdt_del_mem_rsv() and fdt_add_mem_rsv() in error message with the rest of the code. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-08cmd: fdt: Fix fdt rm behavior on non-existent property and error message spaceMarek Vasut1-4/+4
In case an FDT contains a node '/test-node@1234' , with no property called 'noprop' in that node, the following command triggers a print of help message for 'fdt' command instead of erroring out: => fdt rm /test-node@1234 noprop This is because the subcommand errornously returns 'err' instead of CMD_RET_FAILURE, fix it. Furthermore, align the number of spaces past fdt_delprop() in error message with the rest of the code. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-08cmd: fdt: Fix handling of empty properties for fdt get addr and fdt get sizeMarek Vasut1-5/+7
It is perfectly valid to request an address or size of FDT property without value, the only special case if requesting of the value of FDT property without value. Invert the test such, that properties without value still set the variable from 'fdt get addr/size' to address of the property or size of the property, where the later is 0. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-08cmd: fdt: Import is_printable_string() from DTC to fix u32 misprintMarek Vasut1-22/+14
Import is_printable_string() implementation from DTC 1.7.0 as of DTC commit 039a994 ("Bump version to v1.7.0") . This fixes a print of u32 property which so far used to be printed as string by U-Boot fdt print command. We might see the case where the parsed property value, in this case it is a 32-bit integer, identified as a printable string or a null byte (concatenated strings) because of its last character happens to be: 0x00 (null character), 0xB (vertical tab character) or 0x10 (line feed character) In this situation, if the string is identified as printable string, it will be displayed as character instead of hex value When the isprint() condition is true, there are two possibilities: 1) The character is ASCII character (except the first 32) 2) The character is extended ASCII character For example, NG property in device tree: clock-frequency = <16640000>; by default, would be displayed as clock-frequency = "", "ýè"; and with this patch applied, would be displayed as clock-frequency = <0x00fde800>; Full investigation was done by Nam and Hai, patch reworked by Marek to use common code from DTC. Signed-off-by: Hai Pham <hai.pham.ud@renesas.com> Signed-off-by: Nam Nguyen <nam.nguyen.yh@renesas.com> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-08CI: Add a check for building tools for PyPiSimon Glass2-0/+16
Add a simple check that the PyPi packages can be built. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08doc: Add notes on how to install patman and binmanSimon Glass2-0/+25
These can be installed with 'pip' now. Add the details for those who are interested. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08test: Add concurrencytest to the requirementsSimon Glass1-0/+1
This allows tests to run in parallel and speeds up some tests markedly, particularly with binman. Add it to the requirements. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08binman: Add support for building a binmanu PyPi packageSimon Glass2-0/+30
Create the necessary files to build this new package. It is not actually clear whether this is useful, since buildman has no purpose outside U-Boot. Move the main program into a function so that it can easily be called by the PyPi-created script. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08binman: Use importlib to find the helpSimon Glass1-3/+3
Use this function so that the help can be found even when binman is running from a package. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08binman: Hide the 'test' command unless test code is availableSimon Glass1-13/+21
It doesn't make much sense to expose tests when dtoc is running outside of the U-Boot git checkout. Hide the option in this case. Fix a long line while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08binman: Move the main code into a functionSimon Glass1-4/+8
Put this code into a function so it is easy for it be run when packaged. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08dtoc: Add support for building a dtoc PyPi packageSimon Glass3-0/+42
Create the necessary files to build this new package. This is needed for binman. Move the main program into a function so that it can easily be called by the PyPi-created script. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08dtoc: Use pathlib to find the test directorySimon Glass1-2/+4
Update this so that the directory being used is declared at the top of the file. Use pathlib as it seems to be more modern. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08dtoc: Move the main code into a functionSimon Glass1-48/+52
Put this code into a function so it is easy for it be run when packaged. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08dtoc: Hide the test options unless test code is availableSimon Glass1-6/+13
It doesn't make much sense to expose tests when dtoc is running outside of the U-Boot git checkout. Hide the option in this case. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08buildman: Add support for building a buildman PyPi packageSimon Glass2-0/+30
Create the necessary files to build this new package. It is not actually clear whether this is useful, since buildman has no purpose outside U-Boot. It is included for completeness, since adding this later would be more trouble. Move the main program into a function so that it can easily be called by the PyPi-created script. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08buildman: Use importlib to find the helpSimon Glass1-3/+3
Use this function so that the help can be found even when buildman is running from a package. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08buildman: Fix use of a type as a variableSimon Glass1-2/+2
Using 'str' as a variable makes it impossible to use it as a type in the same function. Fix this by using a different name. Signed-off-by: Simon Glass <sjg@chromium.org>