platform/kernel/u-boot.git
16 months agotools: add fdt_add_pubkey
Roman Kopytin [Wed, 8 Mar 2023 01:13:41 +0000 (01:13 +0000)]
tools: add fdt_add_pubkey

Having to use the -K option to mkimage to populate U-Boot's .dtb with the
public key while signing the kernel FIT image is often a little
awkward. In particular, when using a meta-build system such as
bitbake/Yocto, having the tasks of the kernel and U-Boot recipes
intertwined, modifying deployed artifacts and rebuilding U-Boot with
an updated .dtb is quite cumbersome. Also, in some scenarios one may
wish to build U-Boot complete with the public key(s) embedded in the
.dtb without the corresponding private keys being present on the same
build host.

So this adds a simple tool that allows one to disentangle the kernel
and U-Boot builds, by simply copy-pasting just enough of the mkimage
code to allow one to add a public key to a .dtb. When using mkimage,
some of the information is taken from the .its used to build the
kernel (algorithm and key name), so that of course needs to be
supplied on the command line.

Signed-off-by: Roman Kopytin <Roman.Kopytin@kaspersky.com>
Signed-off-by: Ivan Mikhaylov <fr0st61te@gmail.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
16 months agobinman: add tests for sign option
Ivan Mikhaylov [Wed, 8 Mar 2023 01:13:40 +0000 (01:13 +0000)]
binman: add tests for sign option

Add the test which provides sequence of actions:
  1. create the image from binman dts
  2. create public and private keys
  3. add public key into dtb with fdt_add_pubkey
  4. 1. sign FIT container with new sign option with extracting from
        image
     2. sign exact FIT container with replacing of it in image
  5. check with fit_check_sign

Signed-off-by: Ivan Mikhaylov <fr0st61te@gmail.com>
Renumber test file from 277 to 280;
   Move UpdateSignatures() to Entry base class;
   Don't allow missing mkimage as it doesn't make sense;
   Propagate --toolpath for CI;
   Call mark_build_done() to avoid regenerating FIT:
Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobinman: add sign option for binman
Ivan Mikhaylov [Wed, 8 Mar 2023 01:13:39 +0000 (01:13 +0000)]
binman: add sign option for binman

Introduce proof of concept for binman's new option which provides sign
and replace FIT containers in binary images.

Usage as example:

from:
mkimage -G privateky -r -o sha256,rsa4096 -F fit
binman replace -i flash.bin -f fit.fit fit

to:
binman sign -i flash.bin -k privatekey -a sha256,rsa4096 -f fit.fit fit

and to this one if it's need to be extracted, signed with key and put it
back in image:
binman sign -i flash.bin -k privatekey -a sha256,rsa4096 fit

Signed-off-by: Ivan Mikhaylov <fr0st61te@gmail.com>
16 months agobinman: add documentation for binman sign option
Ivan Mikhaylov [Wed, 8 Mar 2023 01:13:38 +0000 (01:13 +0000)]
binman: add documentation for binman sign option

Add the documentation about binman sign option and providing an
example.

Signed-off-by: Ivan Mikhaylov <fr0st61te@gmail.com>
Add a section about 'binman sign' at the bottom:
Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agotest: cmd: fdt: Test fdt apply
Marek Vasut [Thu, 2 Mar 2023 03:08:44 +0000 (04:08 +0100)]
test: cmd: fdt: Test fdt apply

Add 'fdt chosen' test which works as follows:
- Create basic DT, map it to sysmem
- Apply DTO which adds single property via fragment (without address spec)
- Apply DTO which adds more properties (string, u32, empty) and a subnode,
  with phandle via frament@0 and thus tests /__symbols__ node
- Apply DTO which modifies property of the previous DTO via phandle and thus
  tests the /__fixups__ node
- Print modified DT, verify it contains updates from DTOs

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>
16 months agotest: cmd: fdt: Test fdt chosen
Marek Vasut [Thu, 2 Mar 2023 03:08:43 +0000 (04:08 +0100)]
test: cmd: fdt: Test fdt chosen

Add 'fdt chosen' test which works as follows:
- Create basic DT, map it to sysmem
- Print /chosen node, verify it is nonexistent
- Create chosen node
- Print /chosen node, verify it contains only version
- Create /chosen node with initrd entries
- Print /chosen node, verify it contains version and initrd entries

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>
16 months agotest: cmd: fdt: Test fdt rsvmem
Marek Vasut [Thu, 2 Mar 2023 03:08:42 +0000 (04:08 +0100)]
test: cmd: fdt: Test fdt rsvmem

Add 'fdt rsvmem' test which works as follows:
- Create custom FDT with single reserved memory (rsvmem) entry, map it to sysmem
- Add new rsvmem entry
- Delete existing older rsvmem entry
- Add new rsvmem entry again
- Always print the rsvmem list and validate it

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>
16 months agotest: cmd: fdt: Test fdt memory
Marek Vasut [Thu, 2 Mar 2023 03:08:41 +0000 (04:08 +0100)]
test: cmd: fdt: Test fdt memory

Add 'fdt memory' test which works as follows:
- Create custom FDT with /memory node, with select #*cells, map it to sysmem
- Perform memory fixup
- Read back the /memory node and validate its content

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>
16 months agotest: cmd: fdt: Test fdt header
Marek Vasut [Thu, 2 Mar 2023 03:08:39 +0000 (04:08 +0100)]
test: cmd: fdt: Test fdt header

Add 'fdt header' test which works as follows:
- Create basic FDT, map it to sysmem
- Print the FDT header
- Get all members of the FDT header into variable and
  verify the variables contain correct data

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>
Merged in test: cmd: fdt: Drop unused fdt_test_header_get() fdt parameter:
Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agotest: cmd: fdt: Test fdt print and list
Marek Vasut [Thu, 2 Mar 2023 03:08:32 +0000 (04:08 +0100)]
test: cmd: fdt: Test fdt print and list

Add 'fdt print' and 'fdt list' test which works as follows:
- Create fuller FDT, map it to sysmem
- Print the entire FDT, parts of the FDT and select properties
- Compare output from the print or list

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>
16 months agocmd: fdt: Drop the 0x prefix
Marek Vasut [Thu, 2 Mar 2023 03:04:40 +0000 (04:04 +0100)]
cmd: fdt: Drop the 0x prefix

The 'fdt get addr' is always assumed to be hex value, drop the prefix.
Since this might break existing users who depend on the existing
behavior with 0x prefix, this is a separate patch. Revert if this
breaks anything.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
16 months agoconsole: Use only 0x00 as line separator for console recording
Marek Vasut [Mon, 27 Feb 2023 19:55:39 +0000 (20:55 +0100)]
console: Use only 0x00 as line separator for console recording

In case character 0x20 (space) is used as line separator,
character 0x9 (tab) is treated end of line. Commands which
output a lot of tabs, i.e. various tree printing commands
like 'fdt print' then end up generating a lot of newlines
in the recorded output, and the recorded output is corrupted.

Use character 0x00 (NUL) as separator instead to treat the
tabs as valid part of recorded line.

Suggested-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agotest: cmd: fdt: Drop new unneeded curly brackets
Marek Vasut [Fri, 10 Mar 2023 03:33:14 +0000 (04:33 +0100)]
test: cmd: fdt: Drop new unneeded curly brackets

Drop no longer needed { } around ut_assert*() functions in FDT test.
No functional change.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
16 months agotest: Wrap assert macros in ({ ... }) and fix missing semicolons
Marek Vasut [Fri, 10 Mar 2023 03:33:13 +0000 (04:33 +0100)]
test: Wrap assert macros in ({ ... }) and fix missing semicolons

Wrap the assert macros in ({ ... }) so they can be safely used both as
right side argument as well as in conditionals without curly brackets
around them. In the process, find a bunch of missing semicolons, fix
them.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
16 months agoMerge branch '2023-03-14-revert-two-TI-patches' into next
Tom Rini [Tue, 14 Mar 2023 14:53:50 +0000 (10:53 -0400)]
Merge branch '2023-03-14-revert-two-TI-patches' into next

Per request of the author, these two patches weren't quite ready to be
applied yet, so revert them.

16 months agoRevert "configs: j721s2: merge HS and non-HS defconfigs"
Tom Rini [Tue, 14 Mar 2023 14:53:44 +0000 (10:53 -0400)]
Revert "configs: j721s2: merge HS and non-HS defconfigs"

This reverts commit c714045cc3c0c36bc836c909e74db3273a7dd390.

Signed-off-by: Tom Rini <trini@konsulko.com>
16 months agoRevert "configs: j7200: Merge HS and non-HS defconfigs"
Tom Rini [Tue, 14 Mar 2023 14:53:38 +0000 (10:53 -0400)]
Revert "configs: j7200: Merge HS and non-HS defconfigs"

This reverts commit e352e1061f4c9a8adb70b6ff819890c42e5b3ef7.

Signed-off-by: Tom Rini <trini@konsulko.com>
16 months agoMerge tag 'efi-next-20230313' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Mon, 13 Mar 2023 19:36:52 +0000 (15:36 -0400)]
Merge tag 'efi-next-20230313' of https://source.denx.de/u-boot/custodians/u-boot-efi into next

Pull request efi-next-20230313

UEFI:

* Improve graphics support in EFI app

Others:

* x86: Add a few more items to bdinfo
* video: Remove duplicate cursor-positioning function
* video: Clear the vidconsole rather than the video

16 months agovideo: Add a note about the broken implementation
Simon Glass [Fri, 10 Mar 2023 20:47:23 +0000 (12:47 -0800)]
video: Add a note about the broken implementation

The cls command is broken. Previous discussion about this was at [1] and
[2]. For now, add a note to the source code.

[1] https://patchwork.ozlabs.org/project/uboot/patch/
       20221022092058.106052-1-heinrich.schuchardt@canonical.com/
[2] https://patchwork.ozlabs.org/project/uboot/patch/
       20230106145243.411626-12-sjg@chromium.org/

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agoefi: Add dhrystone, dcache and scroll lines to app
Simon Glass [Fri, 10 Mar 2023 20:47:22 +0000 (12:47 -0800)]
efi: Add dhrystone, dcache and scroll lines to app

Add these options to provide some performance measurement, see cache
status and slightly speed up the appallingly slow console.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agovideo: Clear the vidconsole rather than the video
Simon Glass [Fri, 10 Mar 2023 20:47:21 +0000 (12:47 -0800)]
video: Clear the vidconsole rather than the video

It is better to clear the console device rather than the video device,
since the console has the text display. We also need to reset the cursor
position with the console, but not with the video device.

Add a new function to handle this and update the 'cls' command to use it.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agovideo: Remove duplicate cursor-positioning function
Simon Glass [Fri, 10 Mar 2023 20:47:20 +0000 (12:47 -0800)]
video: Remove duplicate cursor-positioning function

There are two functions for positioning the cursor on the console. Remove
one of them.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agoefi: Adjust script to show pre-relocation output on terminal
Simon Glass [Fri, 10 Mar 2023 20:47:19 +0000 (12:47 -0800)]
efi: Adjust script to show pre-relocation output on terminal

When running with video enabled, the pre-relocation output of U-Boot is
currently lost. Add a -serial flag to show it on the terminal.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobbinfo: Show the size of the copy framebuffer
Simon Glass [Fri, 10 Mar 2023 20:47:18 +0000 (12:47 -0800)]
bbinfo: Show the size of the copy framebuffer

If the copy framebuffer is enabled, show its size.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agovideo: Allow a copy framebuffer with pre-allocated fb
Simon Glass [Fri, 10 Mar 2023 20:47:17 +0000 (12:47 -0800)]
video: Allow a copy framebuffer with pre-allocated fb

At present it is not possible for the video driver to use a pre-allocated
frame buffer (such as is done with EFI) with the copy framebuffer. This
can be useful to speed up the display.

Adjust the implementation so that copy_size can be set to the required
size, with this being allocated if the normal framebuffer size is 0.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agoefi: Support copy framebuffer
Simon Glass [Fri, 10 Mar 2023 20:47:16 +0000 (12:47 -0800)]
efi: Support copy framebuffer

Add support for this to EFI in case it becomes useful. At present it just
slows things down. You can enable CONFIG_VIDEO_COPY to turn it on.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agoefi: Use a fixed value for the timer clock
Simon Glass [Fri, 10 Mar 2023 20:47:15 +0000 (12:47 -0800)]
efi: Use a fixed value for the timer clock

It is not yet clear how to read the timer via EFI. The current value seems
much too high on a Framework laptop I tried. Adjust it to a lower
hard-coded value for now.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agox86: Add a few more items to bdinfo
Simon Glass [Fri, 10 Mar 2023 20:47:14 +0000 (12:47 -0800)]
x86: Add a few more items to bdinfo

Add the timer and vendor/model information.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agoefi: Support a 64-bit frame buffer address
Simon Glass [Fri, 10 Mar 2023 20:47:13 +0000 (12:47 -0800)]
efi: Support a 64-bit frame buffer address

The current vesa structure only provides a 32-bit value for the frame
buffer. Many modern machines use an address outside the range.

It is still useful to have this common struct, but add a separate
frame-buffer address as well.

Add a comment for vesa_setup_video_priv() while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agoefi: video: Return mode info for app also
Simon Glass [Fri, 10 Mar 2023 20:47:12 +0000 (12:47 -0800)]
efi: video: Return mode info for app also

The mode info is currently not initialised for the app. Fix this by
returning it from the function.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agoefi: video: Move payload code into a function
Simon Glass [Fri, 10 Mar 2023 20:47:11 +0000 (12:47 -0800)]
efi: video: Move payload code into a function

Put this into a function, as we have done for the app implementation.
Comment both functions. FOr now the app still does not access it
correctly.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agoMerge tag 'dm-next-9mar23' of https://source.denx.de/u-boot/custodians/u-boot-dm...
Tom Rini [Thu, 9 Mar 2023 16:22:50 +0000 (11:22 -0500)]
Merge tag 'dm-next-9mar23' of 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

16 months agobinman: Support generation of x509 certificates
Simon Glass [Fri, 3 Mar 2023 00:02:45 +0000 (17:02 -0700)]
binman: Support generation of x509 certificates

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>
16 months agobinman: Support updating section contents
Simon Glass [Fri, 3 Mar 2023 00:02:44 +0000 (17:02 -0700)]
binman: Support updating section contents

Implement this feature since it is useful for updating FITs within an
image.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobinman: Handle missing bintools correctly in fit
Simon Glass [Fri, 3 Mar 2023 00:02:43 +0000 (17:02 -0700)]
binman: Handle missing bintools correctly in fit

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>
16 months agobinman: Allow preserving the output dir when replacing
Simon Glass [Fri, 3 Mar 2023 00:02:42 +0000 (17:02 -0700)]
binman: Allow preserving the output dir when replacing

Add these flags for the 'replace' subcommand too, to aid debugging.

Signed-off-by: Simon Glass <sjg@chromium.org>
44 2023 -0700

16 months agobuildman: Correct CROSS_COMPILE output for sandbox
Simon Glass [Thu, 2 Mar 2023 13:11:44 +0000 (06:11 -0700)]
buildman: Correct CROSS_COMPILE output for sandbox

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>
16 months agopatman: Check patches in parallel
Simon Glass [Wed, 8 Mar 2023 18:52:55 +0000 (10:52 -0800)]
patman: Check patches in parallel

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>
16 months agopatman: Run get_maintainer.pl in parallel
Simon Glass [Wed, 8 Mar 2023 18:52:54 +0000 (10:52 -0800)]
patman: Run get_maintainer.pl in parallel

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>
16 months agopatman: Refactor MakeCcFile() into two functions
Simon Glass [Wed, 8 Mar 2023 18:52:53 +0000 (10:52 -0800)]
patman: Refactor MakeCcFile() into two functions

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>
16 months agopatman: Drop an incorrect comment about git am
Simon Glass [Wed, 8 Mar 2023 18:52:52 +0000 (10:52 -0800)]
patman: Drop an incorrect comment about git am

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>
16 months agotest: cmd: fdt: Add list of remaining missing tests
Marek Vasut [Thu, 2 Mar 2023 03:08:45 +0000 (04:08 +0100)]
test: cmd: fdt: Add list of remaining missing tests

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>
16 months agotest: cmd: fdt: Test fdt bootcpu
Marek Vasut [Thu, 2 Mar 2023 03:08:40 +0000 (04:08 +0100)]
test: cmd: fdt: Test fdt bootcpu

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>
16 months agotest: cmd: fdt: Test fdt rm
Marek Vasut [Thu, 2 Mar 2023 03:08:38 +0000 (04:08 +0100)]
test: cmd: fdt: Test fdt rm

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>
16 months agotest: cmd: fdt: Test fdt mknode
Marek Vasut [Thu, 2 Mar 2023 03:08:37 +0000 (04:08 +0100)]
test: cmd: fdt: Test fdt mknode

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>
16 months agotest: cmd: fdt: Test fdt set
Marek Vasut [Thu, 2 Mar 2023 03:08:36 +0000 (04:08 +0100)]
test: cmd: fdt: Test fdt set

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>
16 months agotest: cmd: fdt: Test fdt get size
Marek Vasut [Thu, 2 Mar 2023 03:08:35 +0000 (04:08 +0100)]
test: cmd: fdt: Test fdt get size

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>
16 months agotest: cmd: fdt: Test fdt get addr
Marek Vasut [Thu, 2 Mar 2023 03:08:34 +0000 (04:08 +0100)]
test: cmd: fdt: Test fdt get addr

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>
16 months agotest: cmd: fdt: Test fdt get name
Marek Vasut [Thu, 2 Mar 2023 03:08:33 +0000 (04:08 +0100)]
test: cmd: fdt: Test fdt get name

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>
16 months agotest: cmd: fdt: Test fdt resize
Marek Vasut [Thu, 2 Mar 2023 03:08:31 +0000 (04:08 +0100)]
test: cmd: fdt: Test fdt resize

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>
16 months agotest: cmd: fdt: Test fdt move
Marek Vasut [Thu, 2 Mar 2023 03:08:30 +0000 (04:08 +0100)]
test: cmd: fdt: Test fdt move

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>
16 months agotest: cmd: fdt: Test both string and integer arrays in 'fdt get value'
Marek Vasut [Thu, 2 Mar 2023 03:08:29 +0000 (04:08 +0100)]
test: cmd: fdt: Test both string and integer arrays in 'fdt get value'

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>
16 months agotest: cmd: fdt: Test alias resolution in 'fdt get value'
Marek Vasut [Thu, 2 Mar 2023 03:08:28 +0000 (04:08 +0100)]
test: cmd: fdt: Test alias resolution in 'fdt get value'

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>
16 months agotest: cmd: fdt: Generate fuller DT internally and switch fdt get value to it
Marek Vasut [Thu, 2 Mar 2023 03:08:27 +0000 (04:08 +0100)]
test: cmd: fdt: Generate fuller DT internally and switch fdt get value to it

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>
16 months agotest: cmd: fdt: Rename fdt_test_get() to fdt_test_get_value()
Marek Vasut [Thu, 2 Mar 2023 03:08:26 +0000 (04:08 +0100)]
test: cmd: fdt: Rename fdt_test_get() to fdt_test_get_value()

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>
16 months agotest: cmd: fdt: Rename fdt_test_resize() to fdt_test_addr_resize()
Marek Vasut [Thu, 2 Mar 2023 03:08:25 +0000 (04:08 +0100)]
test: cmd: fdt: Rename fdt_test_resize() to fdt_test_addr_resize()

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>
16 months agotest: Add ut_assert_nextline_empty() empty line helper
Marek Vasut [Thu, 2 Mar 2023 03:08:24 +0000 (04:08 +0100)]
test: Add ut_assert_nextline_empty() empty line helper

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>
16 months agocmd: fdt: Add support for integer arrays in fdt get value with index
Marek Vasut [Thu, 2 Mar 2023 03:08:23 +0000 (04:08 +0100)]
cmd: fdt: Add support for integer arrays in fdt get value with index

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>
16 months agocmd: fdt: Map address returned from fdt get addr to sysmem
Marek Vasut [Thu, 2 Mar 2023 03:08:22 +0000 (04:08 +0100)]
cmd: fdt: Map address returned from fdt get addr to sysmem

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>
16 months agocmd: fdt: Handle 64bit pointers in fdt get addr
Marek Vasut [Thu, 2 Mar 2023 03:08:21 +0000 (04:08 +0100)]
cmd: fdt: Handle 64bit pointers in fdt get addr

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>
16 months agocmd: fdt: Align checksign parameter names in help text
Marek Vasut [Thu, 2 Mar 2023 03:08:20 +0000 (04:08 +0100)]
cmd: fdt: Align checksign parameter names in help text

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>
16 months agocmd: fdt: Check argc before accessing argv in fdt memory
Marek Vasut [Thu, 2 Mar 2023 03:08:19 +0000 (04:08 +0100)]
cmd: fdt: Check argc before accessing argv in fdt memory

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>
16 months agocmd: fdt: Check argc before accessing argv in fdt bootcpu
Marek Vasut [Thu, 2 Mar 2023 03:08:18 +0000 (04:08 +0100)]
cmd: fdt: Check argc before accessing argv in fdt bootcpu

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>
16 months agocmd: fdt: Fix fdt rsvmem behavior on non-existent index and error message space
Marek Vasut [Thu, 2 Mar 2023 03:08:17 +0000 (04:08 +0100)]
cmd: fdt: Fix fdt rsvmem behavior on non-existent index and error message space

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>
16 months agocmd: fdt: Fix fdt rm behavior on non-existent property and error message space
Marek Vasut [Thu, 2 Mar 2023 03:08:16 +0000 (04:08 +0100)]
cmd: fdt: Fix fdt rm behavior on non-existent property and error message space

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>
16 months agocmd: fdt: Fix handling of empty properties for fdt get addr and fdt get size
Marek Vasut [Thu, 2 Mar 2023 03:08:15 +0000 (04:08 +0100)]
cmd: fdt: Fix handling of empty properties for fdt get addr and fdt get size

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>
16 months agocmd: fdt: Import is_printable_string() from DTC to fix u32 misprint
Marek Vasut [Thu, 2 Mar 2023 03:08:14 +0000 (04:08 +0100)]
cmd: fdt: Import is_printable_string() from DTC to fix u32 misprint

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>
16 months agoCI: Add a check for building tools for PyPi
Simon Glass [Fri, 24 Feb 2023 01:18:24 +0000 (18:18 -0700)]
CI: Add a check for building tools for PyPi

Add a simple check that the PyPi packages can be built.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agodoc: Add notes on how to install patman and binman
Simon Glass [Fri, 24 Feb 2023 01:18:23 +0000 (18:18 -0700)]
doc: Add notes on how to install patman and binman

These can be installed with 'pip' now. Add the details for those who are
interested.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agotest: Add concurrencytest to the requirements
Simon Glass [Fri, 24 Feb 2023 01:18:22 +0000 (18:18 -0700)]
test: Add concurrencytest to the requirements

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>
16 months agobinman: Add support for building a binmanu PyPi package
Simon Glass [Fri, 24 Feb 2023 01:18:21 +0000 (18:18 -0700)]
binman: Add support for building a binmanu PyPi package

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>
16 months agobinman: Use importlib to find the help
Simon Glass [Fri, 24 Feb 2023 01:18:20 +0000 (18:18 -0700)]
binman: Use importlib to find the help

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>
16 months agobinman: Hide the 'test' command unless test code is available
Simon Glass [Fri, 24 Feb 2023 01:18:19 +0000 (18:18 -0700)]
binman: Hide the 'test' command unless test code is available

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>
16 months agobinman: Move the main code into a function
Simon Glass [Fri, 24 Feb 2023 01:18:18 +0000 (18:18 -0700)]
binman: Move the main code into a function

Put this code into a function so it is easy for it be run when packaged.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agodtoc: Add support for building a dtoc PyPi package
Simon Glass [Fri, 24 Feb 2023 01:18:17 +0000 (18:18 -0700)]
dtoc: Add support for building a dtoc PyPi package

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>
16 months agodtoc: Use pathlib to find the test directory
Simon Glass [Fri, 24 Feb 2023 01:18:16 +0000 (18:18 -0700)]
dtoc: Use pathlib to find the test directory

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>
16 months agodtoc: Move the main code into a function
Simon Glass [Fri, 24 Feb 2023 01:18:15 +0000 (18:18 -0700)]
dtoc: Move the main code into a function

Put this code into a function so it is easy for it be run when packaged.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agodtoc: Hide the test options unless test code is available
Simon Glass [Fri, 24 Feb 2023 01:18:14 +0000 (18:18 -0700)]
dtoc: Hide the test options unless test code is available

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>
16 months agobuildman: Add support for building a buildman PyPi package
Simon Glass [Fri, 24 Feb 2023 01:18:13 +0000 (18:18 -0700)]
buildman: Add support for building a buildman PyPi package

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>
16 months agobuildman: Use importlib to find the help
Simon Glass [Fri, 24 Feb 2023 01:18:12 +0000 (18:18 -0700)]
buildman: Use importlib to find the help

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>
16 months agobuildman: Fix use of a type as a variable
Simon Glass [Fri, 24 Feb 2023 01:18:11 +0000 (18:18 -0700)]
buildman: Fix use of a type as a variable

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>
16 months agobuildman: Hide the test options unless test code is available
Simon Glass [Fri, 24 Feb 2023 01:18:10 +0000 (18:18 -0700)]
buildman: Hide the test options unless test code is available

It doesn't make much sense to expose tests when buildman is running
outside of the U-Boot git checkout. Hide the option in this case

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobuildman: Move the main code into a function
Simon Glass [Fri, 24 Feb 2023 01:18:09 +0000 (18:18 -0700)]
buildman: Move the main code into a function

Put this code into a function so it is easy for it be run when packaged.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agopatman: Add support for building a patman PyPi package
Simon Glass [Fri, 24 Feb 2023 01:18:08 +0000 (18:18 -0700)]
patman: Add support for building a patman PyPi package

Create the necessary files to build this new package.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agopatman: Avoid importing test_checkpatch before it is needed
Simon Glass [Fri, 24 Feb 2023 01:18:07 +0000 (18:18 -0700)]
patman: Avoid importing test_checkpatch before it is needed

Tests are not packaged with patman so this file will not be accessible
when installing with pip. Move the import later in the file, when we
know the file is present.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agopatman: Add support for building a u_boot_tools PyPi package
Simon Glass [Fri, 24 Feb 2023 01:18:06 +0000 (18:18 -0700)]
patman: Add support for building a u_boot_tools PyPi package

Create the necessary files to build this new package.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agoscript: Add a script to build a PyPi package
Simon Glass [Fri, 24 Feb 2023 01:18:05 +0000 (18:18 -0700)]
script: Add a script to build a PyPi package

Create a script which can package a tool for use with PyPi and the 'pip'
tool. This involves quite a few steps so is best automated. Future work
will enable use of this for some of the tools in U-Boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agopatman: Move library functions into a library directory
Simon Glass [Fri, 24 Feb 2023 01:18:04 +0000 (18:18 -0700)]
patman: Move library functions into a library directory

The patman directory has a number of modules which are used by other tools
in U-Boot. This makes it hard to package the tools using pypi since the
common files must be copied along with the tool that uses them.

To address this, move these files into a new u_boot_pylib library. This
can be packaged separately and listed as a dependency of each tool.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agoRemove concurrencytest
Simon Glass [Fri, 24 Feb 2023 01:18:03 +0000 (18:18 -0700)]
Remove concurrencytest

While our version is better, it is tricky to use it when we are trying
to package things with pip. Drop it.

Somewhat reduced functionality is provided by the upstream version[1],
along with a rather annoying message each time it is used[2] [3].

[1] pip install concurrencytest
[2] https://github.com/cgoldberg/concurrencytest/issues/12
[3] https://github.com/cgoldberg/concurrencytest/pull/14

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agoRevert "patman: test_util: Print test stdout/stderr within test summaries"
Simon Glass [Fri, 24 Feb 2023 01:18:02 +0000 (18:18 -0700)]
Revert "patman: test_util: Print test stdout/stderr within test summaries"

Unfortunately this adds a new feature to concurrencytest and it has not
made it upstream to the project[1].

Drop it for now so we can use the upstream module. Once it is applied we
can bring this functionality back.

[1] https://github.com/cgoldberg/concurrencytest

This reverts commit ebcaafcded40da8ae6cb4234c2ba9901c7bee644.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobinman: Avoid unwanted output in testFitFirmwareLoadables()
Simon Glass [Fri, 24 Feb 2023 01:18:01 +0000 (18:18 -0700)]
binman: Avoid unwanted output in testFitFirmwareLoadables()

This prints a message about the missing tee-os generated by the test. This
is confusing, so suppress it.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobootstd: Replicate the dtb-filename quirks of distroboot
Simon Glass [Wed, 22 Feb 2023 19:17:04 +0000 (12:17 -0700)]
bootstd: Replicate the dtb-filename quirks of distroboot

For EFI, the distro boot scripts search in three different directories
for the .dtb file. The SOC-based filename fallback is supported only for
32-bit ARM.

Adjust the code to mirror this behaviour.

Also some boards can use a prior-stage FDT if one is not found in the
normal way. Support this and show a message in that case.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Mark Kettenis <kettenis@openbsd.org>
16 months agobootflow: Rename bootflow_flags_t
Simon Glass [Wed, 22 Feb 2023 19:17:03 +0000 (12:17 -0700)]
bootflow: Rename bootflow_flags_t

These flags actually relate to the iterator, not the bootflow struct
itself. Rename them.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobinman: Make the tooldir configurable
Simon Glass [Wed, 22 Feb 2023 19:14:49 +0000 (12:14 -0700)]
binman: Make the tooldir configurable

Add a command-line argument for setting the tooldir, so that the default
can be overridden. Add this directory to the toolpath automatically.
Create the directory if it does not already exist.

Put the default in the argument parser instead of the class, so that it
is more obvious.

Update a few tests that expect the utility name to be provided without
any path (e.g. 'futility'), so they can accept a path, e.g.
/path/to/futility

Update the documentation and add a few tests.

Improve the help for --toolpath while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobinman: Use a private directory for bintools
Simon Glass [Wed, 22 Feb 2023 19:14:48 +0000 (12:14 -0700)]
binman: Use a private directory for bintools

At present binman writes tools into the ~/bin directory. This is
convenient but some may be concerned about downloading unverified
binaries and running them. Place then in a special ~/.binman-tools
directory instead.

Mention this in the documentation.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
16 months agobinman: Move the tools directory into the Bintool class
Simon Glass [Wed, 22 Feb 2023 19:14:47 +0000 (12:14 -0700)]
binman: Move the tools directory into the Bintool class

We want to be able to change this directory. Use a class member to hold
the value, since changing a constant is not good.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobinman: Update bintools documentation
Simon Glass [Wed, 22 Feb 2023 19:14:46 +0000 (12:14 -0700)]
binman: Update bintools documentation

This was not regenerated with recent changes. Update it.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobinman: Correct an 'aot' typo
Simon Glass [Wed, 22 Feb 2023 19:14:45 +0000 (12:14 -0700)]
binman: Correct an 'aot' typo

Fix this typo.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobuildman: Add a flag for reproducible builds
Simon Glass [Tue, 21 Feb 2023 19:40:29 +0000 (12:40 -0700)]
buildman: Add a flag for reproducible builds

This is quite a useful thing to use when building since it avoids small
size changes between commits. Add a -r flag for it.

Also undefine CONFIG_LOCALVERSION_AUTO since this appends the git hash
to the version string, causing every build to be slightly different.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agobuildman: Support disabling LTO
Simon Glass [Tue, 21 Feb 2023 19:40:28 +0000 (12:40 -0700)]
buildman: Support disabling LTO

This cuts down build performance considerably and is not always needed,
when checking for build errors, etc.

Add a flag to disable it.

Signed-off-by: Simon Glass <sjg@chromium.org>