Commit graph

84982 commits

Author SHA1 Message Date
Marek Vasut
45d20f55a1 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>
2023-03-08 11:40:57 -08:00
Marek Vasut
56915fa4cc 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>
2023-03-08 11:40:56 -08:00
Simon Glass
c21a5286af 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>
2023-03-08 11:40:56 -08:00
Simon Glass
6608acb29d 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>
2023-03-08 11:40:56 -08:00
Simon Glass
7b7f1bf30d 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>
2023-03-08 11:40:56 -08:00
Simon Glass
ada5e2f978 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>
2023-03-08 11:40:56 -08:00
Simon Glass
8de6adbf4a 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>
2023-03-08 11:40:56 -08:00
Simon Glass
94bb5cd2f9 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>
2023-03-08 11:40:56 -08:00
Simon Glass
952a61adb4 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>
2023-03-08 11:40:49 -08:00
Simon Glass
77b3ccb89a 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>
2023-03-08 11:40:49 -08:00
Simon Glass
1688d6ca0e 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>
2023-03-08 11:40:49 -08:00
Simon Glass
b3f5474077 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>
2023-03-08 11:40:49 -08:00
Simon Glass
ab9272b804 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>
2023-03-08 11:40:49 -08:00
Simon Glass
0de2ffe717 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>
2023-03-08 11:40:49 -08:00
Simon Glass
d85f7909f8 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>
2023-03-08 11:40:49 -08:00
Simon Glass
8dd7be7e28 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>
2023-03-08 11:40:49 -08:00
Simon Glass
5cfb73b590 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>
2023-03-08 11:40:49 -08:00
Simon Glass
793aa17619 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>
2023-03-08 11:40:49 -08:00
Simon Glass
30eb11ae04 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>
2023-03-08 11:40:49 -08:00
Simon Glass
a545dc1db9 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>
2023-03-08 11:40:49 -08:00
Simon Glass
75554dfac2 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>
2023-03-08 11:40:49 -08:00
Simon Glass
cd5f997a9c 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>
2023-03-08 11:40:49 -08:00
Simon Glass
4583c00236 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>
2023-03-08 11:40:49 -08:00
Simon Glass
00290d6a5b 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>
2023-03-08 11:40:49 -08:00
Simon Glass
6811fea705 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 ebcaafcded.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08 11:40:49 -08:00
Simon Glass
7c4027af48 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>
2023-03-08 11:40:49 -08:00
Simon Glass
47dd6b4d7d 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>
2023-03-08 11:40:49 -08:00
Simon Glass
4f806f31fc 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>
2023-03-08 11:40:49 -08:00
Simon Glass
fe7e9245c5 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>
2023-03-08 11:40:49 -08:00
Simon Glass
932e40d0b5 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>
2023-03-08 11:40:49 -08:00
Simon Glass
00f674db2d 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>
2023-03-08 11:40:49 -08:00
Simon Glass
fbb0e48032 binman: Update bintools documentation
This was not regenerated with recent changes. Update it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08 11:38:48 -08:00
Simon Glass
6569cb8e1f binman: Correct an 'aot' typo
Fix this typo.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08 11:38:48 -08:00
Simon Glass
bfb708ad99 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>
2023-03-08 11:38:48 -08:00
Simon Glass
93202d72d7 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>
2023-03-08 11:38:48 -08:00
Simon Glass
cd37d5bccf buildman: Write out the build command used
It is sometimes useful to see the exact 'make' command used by buildman
for a commit. Add an output file for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08 11:38:48 -08:00
Simon Glass
5a93c15743 buildman: Add a note about the out-env file
This file holds the environment used when doing a build. Add a note
about it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08 11:38:48 -08:00
Jonas Karlman
e389d445c7 binman: Use correct argument name in docstrings
Use correct argument name in docstrings.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-08 11:38:48 -08:00
Jonas Karlman
dd4bdad4c1 binman: Fix spelling of nodes in code comments
Replace notes with nodes in code comments and docstrings.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-08 11:38:48 -08:00
Jonas Karlman
cbe429bc97 binman: Remove redundant SetAllowFakeBlob from blob-ext entry
Entry_blob_ext contains an implementation of SetAllowFakeBlob that is
identical to the one in the base Entry class, remove it.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-08 11:38:48 -08:00
Simon Glass
9dbb02b9d1 binman: Support marking FMAP areas as preserved
Add an entry flag called 'preserve' to indicate that an entry should be
preserved by firmware updates. Propagate this to FMAP too.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08 11:38:48 -08:00
Simon Glass
139c464c2a binman: Avoid requiring a home directory on startup
This is needed to download tools, but we may not need to do this. At
present binman fails to start if HOME is not set.

Use the current directory as a default to avoid this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-03-08 11:38:48 -08:00
Tom Rini
70ed05ce6c - video console refactoring and optimization
- support for fonts wider than 1 byte
  - use named header for 8x16 font data
  - support multiple fonts configuration
  - move get_font_size() to truetype driver ops
  - support font size configuration at runtime
  - add 16x32 Terminus font from linux
  - add 12x22 Sun font from linux
  - add 12x22 console simple font test
 -----BEGIN PGP SIGNATURE-----
 
 iGwEABECACwWIQSC4hxrSoIUVfFO0kRM6ATMmsalXAUCZAdiLw4cYWd1c3RAZGVu
 eC5kZQAKCRBM6ATMmsalXDtGAJ9ZjsnfneJpUjwYJWOw2ibnm9Dh2QCfVCAy+Bxa
 YfqV8y7TbOuCQKTEY1s=
 =FJhw
 -----END PGP SIGNATURE-----

Merge tag 'next-20230307' of https://source.denx.de/u-boot/custodians/u-boot-video into next

 - video console refactoring and optimization
 - support for fonts wider than 1 byte
 - use named header for 8x16 font data
 - support multiple fonts configuration
 - move get_font_size() to truetype driver ops
 - support font size configuration at runtime
 - add 16x32 Terminus font from linux
 - add 12x22 Sun font from linux
 - add 12x22 console simple font test
2023-03-07 12:54:01 -05:00
Tom Rini
36bb622df5 Merge branch '2023-03-06-assorted-platform-updates' into next
- semihosting updates for arm and riscv, assorted arm64 core updates,
  assorted ast2600 updates, remove some more unused code, some TI K3
  defconfig and DTS updates, uniphier DTS updates, mpc83xx Kconfig
  cleanup, re-add fttmr010 driver with an update to use DM.
2023-03-07 10:42:22 -05:00
Dzmitry Sankouski
72471620e8 video console: add 12x22 console simple font test
Tests fonts wider than a byte.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-07 16:00:18 +01:00
Dzmitry Sankouski
0ed6ce2f04 video console: sandbox: add 12x22 font defconfigs
Add 12x22 font in order to write a test for it.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-07 16:00:11 +01:00
Dzmitry Sankouski
0d6c089f84 video console: add 16x32 Terminus font from linux
Modern mobile phones typically have high pixel density.
Bootmenu is hardly readable on those with 8x16 font.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-07 15:59:58 +01:00
Dzmitry Sankouski
e24db8645f video console: add 12x22 Sun font from linux
Modern mobile phones typically have high pixel density.
Bootmenu is hardly readable on those with 8x16 font.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-07 15:59:47 +01:00
Dzmitry Sankouski
e7ee1fd567 video console: allow font size configuration at runtime
Allow font size configuration at runtime for console_simple.c
driver. This needed for unit testing different fonts.

Configuring is done by `font` command, also used for font
selection in true type console.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-07 15:59:35 +01:00
Dzmitry Sankouski
4f6e34811d video console: move vidconsole_get_font_size() logic to driver ops
Since multiple vidconsole drivers exists, vidconsole_get_font_size()
implementation cannot longer live in vidconsole_uclass.c file.

Move current vidconsole_get_font_size logic to truetype driver ops.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-03-07 15:59:21 +01:00