summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-01-26tools: Improve comments in signing functionsSimon Glass
Add some more comments to explain what is going on in the signing functions. Fix two repeated typos. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-26tools: Avoid leaving extra data at the end of copied filesSimon Glass
The copyfile() implementation has strange behaviour if the destination file already exists. Update it to ensure that any existing data in the destination file is dropped. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-26tools: Move copyfile() into a common fileSimon Glass
This function is useful in other places. Move it to a common file. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-26fit_check_sign: Update help to mention the key is in a dtbSimon Glass
The key is inside a dtb file, so tweak the help to make that clear. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-26rsa: Add debugging for failure casesSimon Glass
Add some more debugging to make it easier to see what is being tried and what fails. Fix a few comment styles while here. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: doc: fix typo for u-boot-tplHeiko Thiery
Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Document the __bss_size symbol errorSimon Glass
Add a note about the message so it is clear why it occurs. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25sandbox: eth-raw: fix building with musl libraryHeinrich Schuchardt
The definition of struct udphdr in include netinet/udp.h in the musl library differs from the definition in the glibc library. To use the same definition with musl the symbol _GNU_SOURCE has to be defined. Reported-by: Milan P. Stanić <mps@arvanta.net> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Tested-by: Milan P. Stanić <mps@arvanta.net>
2022-01-25sandbox: sandbox_serial_pending depends on DM_VIDEOHeinrich Schuchardt
When building sandbox_defconfig with CONFIG_DM_VIDEO=n a link time error occurs: in function `sandbox_serial_pending': drivers/serial/sandbox.c:101: undefined reference to `video_sync_all' video_sync_all() is only defined if we have CONFIG_DM_VIDEO=y. Calling this function in a serial driver looks quite hackish but at least let's add the missing build constraint. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Add documentation for bintoolsSimon Glass
Add this documention to explain how bintools are used and which ones are available. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Add a command to generate bintool docsSimon Glass
Each bintool has some documentation which can be useful for the user. Add a new command that collects this and writes it into a .rst file. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Complete test coverage of comp_utilSimon Glass
Drop the unused gzip code, update comments and add a test for an invalid algorithm. The temporary file is not needed now, so drop that also. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Plumb in support for missing bintoolsSimon Glass
Bintools can be missing, in which case binman continues operation but reports an invalid image. Plumb in support for this and add tests for entry types which use bintools. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Convert to using the lzma_alone bintoolSimon Glass
Update the code to use this bintool, instead of running lzma_alone directly. This simplifies the code and provides more consistency. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Add a bintool implementation for lzma_aloneSimon Glass
Add a Bintool for this, which is used to compress and decompress data. It supports the features needed by binman as well as installing via the lzma-alone package. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Convert to using the lz4 bintoolSimon Glass
Update the code to use this bintool, instead of running lz4 directly. This simplifies the code and provides more consistency. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Add a bintool implementation for lz4Simon Glass
Add a Bintool for this, which is used to compress and decompress data. It supports the features needed by binman as well as installing via the lz4 package. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Tidy up pylint warnings in comp_utilSimon Glass
Tweak some naming and comments to resolve these. Use WriteFile() to write the file. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Move compression into binmanSimon Glass
The compression functions are not actually used by patman, so we don't need then in the tools module. Also we want to change them to use bintools, which patman will not support. Move these into a new comp_util module, within binman. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Convert to using the mkimage bintoolSimon Glass
Update the fit and mkimage entry types to use this bintool, instead of running mkimage directly. This simplifies the code and provides more consistency as well as supporting missing bintools. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Convert to using the ifwitool bintoolSimon Glass
Update the ifwi entry type to use this bintool, instead of running ifwitool directly. This simplifies the code and provides more consistency as well as supporting missing bintools. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Convert to using the futility bintoolSimon Glass
Update the GBB and vblock entry types to use this bintool, instead of running futility directly. This simplifies the code and provides more consistency as well as supporting missing bintools. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Convert to using the FIP bintoolSimon Glass
Update the FIP tests to use this bintool, instead of running fiptool directly. This simplifies the code and provides more consistency as well as supporting missing bintools. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Convert to using the CBFS bintoolSimon Glass
Update the CBFS tests to use this bintool, instead of running cbfstool directly. This simplifies the overall code and provides more consistency, as well as supporting missing bintools. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Enable bintool tests including cmdline processingSimon Glass
The tests rely on having at least 5 bintool implementions. Now that we have this, enable them. Add tests for the binman 'tool' subcommand. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Add a bintool implementation for mkimageSimon Glass
Add a Bintool for this, which is used to build images for use by U-Boot. It supports the features needed by binman as well as installing via the u-boot-tools packages. Although this is built in the U-Boot tree, it is still useful to install a binary on the system. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Add a bintool implementation for ifwitoolSimon Glass
Add a Bintool for this, which is used to build Intel IFWI images. It supports the features needed by the tests as well as downloading a binary from Google Drive. Although this is built in the U-Boot tree, it is not currently included with u-boot-tools, so it may be useful to install a binary on the system. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Add a bintool implementation for futilitySimon Glass
Add a Bintool for this, which is used to sign Chrome OS images and build the Google Binary Block (GBB). It supports the features needed by binman as well as fetching a binary from Google Drive. Building it from source is possible but is left for another time, as it requires at least one other library. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Add a bintool implementation for fiptoolSimon Glass
Add a Bintool for this, which is used to run FIP tests. It supports the features needed by the tests as well as building a binary from the git tree. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Add a bintool implementation for cbfstoolSimon Glass
Add a Bintool for this, which is used to run CBFS tests. It supports the features needed by the tests as well as fetching a binary from Google Drive. Building it from source is very slow since it is not separately supported by the coreboot build system and it builds an entire gcc toolchain before starting. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Add tests for bintoolSimon Glass
Add tests to cover the bintool functionality. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Plumb in support for bintoolsSimon Glass
Support collecting the available bintools needed by an image, by scanning the entries in the image. Also add a command-line interface to access the basic bintool features, such as listing the bintools and fetching them if needed. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Add support for bintoolsSimon Glass
Binman requires various tools to actually work, such as 'lz4' to compress data and 'futility' to sign Chrome OS firmware. At present these are handled in an ad-hoc manner and there is no easy way to find out what tools are needd to build an image, nor where to obtain them. Add an implementation of 'bintool', a base class which implements this functionality. When a bintool is required, it can be requested from this module, then executed. When the tool is missing, it can provide a way to obtain it. Note that this uses Command directly, not the tools.Run() function. This allows proper handling of missing tools and avoids needing to catch and re-raise exceptions. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Add installation instructionsSimon Glass
Explain how to install binman, since it is not obvious. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Correct path for fip_utilSimon Glass
This should be imported from the binman module. Fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Allow faked blobs in blob-ext-listSimon Glass
Since this is a list of blobs, each blob should have the ability to be faked, as with blob-ext. Update the Entry base class to set allow_fake and use the base class in the section code also, so that this propagagtes to blob-ext-list, which is not a section. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Drop the image name from the fake-blob messageSimon Glass
This is not really needed and it makes the message different from the missing-blob message. Update it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25patman: Add a function to find a tool on the pathSimon Glass
The Run() function automatically uses the PATH variable to locate a tool when running it. Add a function that does this manually, so we don't have to run a tool to find out if it is present. This is needed by the new Bintool class, which wants to check which tools are present. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25patman: Tidy up the download function a littleSimon Glass
Reverse the order of the return tuple, so that the filename is first. This seems more obvious than putting the temporary directory first. Correct a bug that leaves a space on the final line. Allow the caller to control the name of the temporary directory. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25buildman: Move the download function to toolsSimon Glass
This function is handy for binman as well. Move it into the shared 'tools' module. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25patman: Allow running a tool and returning the full resultSimon Glass
Add a new function which returns the entire result from running a tool, not just stdout. Update Run() to use this and to return stdout on error, if stderr is empty, since some unfortunate tools write their error output to stdout rather than stderr. Move building of the PATH to a separate function. Make the exception catching more specific, to catch just ValueError, since broad exceptions are a pain to debug. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Expand the external FIT test a littleSimon Glass
At present this does not check that the external data is in the expected place. Use a non-zero offset for the external data and check it. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25mkimage: Show the external-offset errorSimon Glass
This is a debug message at present, which is not very helpful. Print out the error so that action can be taken. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25binman: Tweak elf tests for a toolchain changeSimon Glass
Some newer toolchains do not create a symbol for the .ucode section that this test relies on. Update the test to use the symbol that is explicitly created, instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25Makefile: Fake external blobs by default with binmanSimon Glass
This behaviour is necessary with boards where the binman description requires processing external blobs, since these may be missing. Enable it by default, so that CI is happy. Warnings indicate that a valid image is not produced, as with the --allow-missing option. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25dm: Fix OF_BAD_ADDR definitionPatrice Chotard
When OF_LIVE flag is enabled on a 64 bits platform, there is an issue when dev_read_addr() is called and need to perform an address translation using __of_translate_address(). In case of error, __of_translate_address() return's value is OF_BAD_ADDR (wich is defined in include/dm/of.h to ((u64)-1) = 0xffffffffffffffff). The return value of dev_read_addr() is often compared to FDT_ADDR_T_NONE which is defined as (-1U) = 0xffffffff. In this case the comparison is always false. To fix this issue, define FDT_ADDR_T_NONE to (ulong)(-1) in case of AARCH64. Update accordingly related tests. Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-01-25introduce CONFIG_DEVICE_TREE_INCLUDESRasmus Villemoes
The build system already automatically looks for and includes an in-tree *-u-boot.dtsi when building the control .dtb. However, there are some things that are awkward to maintain in such an in-tree file, most notably the metadata associated to public keys used for verified boot. The only "official" API to get that metadata into the .dtb is via mkimage, as a side effect of building an actual signed image. But there are multiple problems with that. First of all, the final U-Boot (be it U-Boot proper or an SPL) image is built based on a binary image, the .dtb, and possibly some other binary artifacts. So modifying the .dtb after the build requires the meta-buildsystem (Yocto, buildroot, whatnot) to know about and repeat some of the steps that are already known to and handled by U-Boot's build system, resulting in needless duplication of code. It's also somewhat annoying and inconsistent to have a .dtb file in the build folder which is not generated by the command listed in the corresponding .cmd file (that of course applies to any generated file). So the contents of the /signature node really needs to be baked into the .dtb file when it is first created, which means providing the relevant data in the form of a .dtsi file. One could in theory put that data into the *-u-boot.dtsi file, but it's more convenient to be able to provide it externally: For example, when developing for a customer, it's common to use a set of dummy keys for development, while the consultants do not (and should not) have access to the actual keys used in production. For such a setup, it's easier if the keys used are chosen via the meta-buildsystem and the path(s) patched in during the configure step. And of course, nothing prevents anybody from having DEVICE_TREE_INCLUDES point at files maintained in git, or for that matter from including the public key metadata in the *-u-boot.dtsi directly and ignore this feature. There are other uses for this, e.g. in combination with ENV_IMPORT_FDT it can be used for providing the contents of the /config/environment node, so I don't want to tie this exclusively to use for verified boot. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Fix doc formatting error (make htmldocs) Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25usb: Use the first available device for ehci_gadgetSean Anderson
For whatever reason, usb_setup_ehci_gadget removes and probes USB device 0. However, not all systems have a device 0. Use the first device instead. The device probed should probably have something to do with the controller (as specified by e.g. ums <controller> or fastboot <controller>). In fact, I find it odd that we probe the USB device in the first place, because this is just to set up the gadget itself. Presumably, the controller should be probed by usb_gadget_initialize somehow. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-01-25acpi: Add myself as maintainerSimon Glass
Add myself as maintainer of the generic ACPI code, until someone else steps up to take it on. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-01-25acpi: Add some tables needed by ARM devicesSimon Glass
Add some tables needed for ARM devices, including more MADT subtables, a CSRT descriptor, GTDT and PPTT. WIP: This needs comments added. Signed-off-by: Simon Glass <sjg@chromium.org>