[PATCH 6/7] dtoc: Correct remaining pylint problems in test_fdt

2022-07-30 Thread Simon Glass
Fix various camel-case and other naming problems. Update the pylint base file to avoid regressions. Signed-off-by: Simon Glass --- scripts/pylint.base| 2 +- tools/dtoc/test_fdt.py | 254 +++-- 2 files changed, 142 insertions(+), 114 deletions(-) diff

[PATCH 7/7] fdt: Move to setuptools

2022-07-30 Thread Simon Glass
The distutils package is deprecated. The upstream libfdt repo uses setuptools for building the pylibfdt module, so bring in that code, suitably modified for U-Boot. Also bring in the README. The modifications include setting the version correctly, making use of the environment variables provided b

[PATCH 5/7] test_fdt: Convert to use argparse

2022-07-30 Thread Simon Glass
Drop the deprecated OptionParser. Signed-off-by: Simon Glass --- tools/dtoc/test_fdt.py | 39 --- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/tools/dtoc/test_fdt.py b/tools/dtoc/test_fdt.py index e10fb528e81..c38158edf32 100755 --- a/tools

[PATCH 4/7] dtoc: Move main program into its own function

2022-07-30 Thread Simon Glass
Use a function for the main program so everything there doesn't look like a global variable to pylint. Signed-off-by: Simon Glass --- tools/dtoc/test_fdt.py | 44 +++--- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/tools/dtoc/test_fdt.py b/

[PATCH 3/7] dtoc: Fix fdt test coverage

2022-07-30 Thread Simon Glass
Fix a bug that the --processes option was ignored, thus resulting in no test coverage information being generated. Signed-off-by: Simon Glass Fixes: 42ae363ddd9 ("dtoc: Update fdt tests to use test_util") --- tools/dtoc/test_fdt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --g

[PATCH 2/7] dtoc: Tidy up fdt_tests RunTests()

2022-07-30 Thread Simon Glass
Pass the options args in rather than using the global variables. Use snake case, fix up comments and use a ternary operator to make pylint happy. Signed-off-by: Simon Glass --- tools/dtoc/test_fdt.py | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tools/dtoc/

[PATCH 1/7] dtoc: Tidy up fdt_tests RunTestCoverage() args

2022-07-30 Thread Simon Glass
Pass the options args in rather than using the global various. Use snake case and fix up comments to make pylint happy. Signed-off-by: Simon Glass --- tools/dtoc/test_fdt.py | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/dtoc/test_fdt.py b/tools/dtoc/test

[PATCH 0/7] fdt: Fix up tests and build warnings on newer distros

2022-07-30 Thread Simon Glass
At present the code coverage for test_fdt is not working. This series fixes that and takes the opportunity to fix the pylint warnings in that file. Some newer Linux distributions are producing warnings about using distutils, so this series moves things over to setuptools. Simon Glass (7): dtoc

Re: [PATCH v2 0/7] Add support for cyclic function execution infrastruture

2022-07-30 Thread Simon Glass
Hi Stefan, On Thu, 28 Jul 2022 at 01:09, Stefan Roese wrote: > > This patchset adds the basic infrastructure to periodically execute > code, e.g. all 100ms. Examples for such functions might be LED blinking > etc. The functions that are hooked into this cyclic list should be > small timewise as o

Re: Replace make-fit-atf.py with binman. Was: migrate u-boot-rockchip.bin to binman and generate an image for SPI

2022-07-30 Thread Simon Glass
Hi Quentin, On Wed, 27 Jul 2022 at 04:34, Quentin Schulz wrote: > > Hi Simon, > > On 7/26/22 21:58, Simon Glass wrote: > > Hi Quentin, > > > > On Tue, 26 Jul 2022 at 03:08, Quentin Schulz > > wrote: > >> > >> Hi Xavier, > >> > >> On 7/25/22 19:33, Xavier Drudis Ferran wrote: > >>> El Mon, Jul 25

Re: [RFCv1] doc: develop: Describe using CONFIG vs CFG for values

2022-07-30 Thread Simon Glass
Hi Tom, On Thu, 28 Jul 2022 at 07:20, Tom Rini wrote: > > Document how and when to use CONFIG or CFG namespace for options. There > are times where Kconfig is not a great fit for our needs, so we want to > use the CFG namespace instead. > > Signed-off-by: Tom Rini > --- > RFCv1: > - This is ess

Re: [PATCH v2] boot: allow bootmeth-distro without CONFIG_NET

2022-07-30 Thread Simon Glass
On Thu, 28 Jul 2022 at 04:19, John Keeping wrote: > > Remove the dependency on CMD_PXE from BOOTMETH_DISTRO by introducing a > new hidden kconfig symbol to control whether pxe_utils is compiled, > allowing bootstd's distro method to be compiled without needing > networking support enabled. > > Sig

Re: [PATCH] bootstd: doc: Fix typos

2022-07-30 Thread Simon Glass
On Fri, 29 Jul 2022 at 07:32, Paul Barker wrote: > > These typos were found while reading the docs. > > Signed-off-by: Paul Barker > --- > doc/develop/bootstd.rst | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) Reviewed-by: Simon Glass Thank you. > > diff --git a/doc/develop/b

Re: [PATCH v2] spl: fit: Report fdt error for loading u-boot

2022-07-30 Thread Simon Glass
Hi Bao Cheng, On Sat, 30 Jul 2022 at 03:05, Su, Bao Cheng wrote: > > Commit 71551055cbdb ("spl: fit: Load devicetree when a Linux payload is > found") made a change to not report the spl_fit_append_fdt error at all > if next-stage image is u-boot. > > However for u-boot image without CONFIG_OF_EM

Re: [PATCH] Revert "fdtdec: drop needlessly convoluted CONFIG_PHANDLE_CHECK_SEQ"

2022-07-30 Thread Simon Glass
Hi Tom, On Tue, 5 Jul 2022 at 10:42, Simon Glass wrote: > > Hi Rasmus, > > On Tue, 5 Jul 2022 at 07:47, Rasmus Villemoes > wrote: > > > > On 05/07/2022 11.47, Simon Glass wrote: > > > Hi Tom, > > > > > > On Sun, 3 Jul 2022 at 06:43, Tom Rini wrote: > > >> > > >> On Sun, Jul 03, 2022 at 02:32:42

Re: [MVEBU] SPI flash offset was depecrated?

2022-07-30 Thread Tony Dinh
Hi Pali, Flashed to SPI and booted successfully! With CONFIG_SPL_SPI=y so SPL loads u-boot payload. My observation: dm-preloc is also required using SPL SPI driver method: &spi0 { u-boot,dm-pre-reloc; }; Perhaps it should be implied in Kconfig with a DM_xxx symbol if possible. Thanks, Tony On

Re: [MVEBU] SPI flash offset was depecrated?

2022-07-30 Thread Tony Dinh
Hi Pali, "flash u-boot.bin or spl.bin separately" That's what we used to do many years ago! glad that we have a single flashable image now, much more robust. Thanks for a clear and detailed explanation! Tony On Sat, Jul 30, 2022 at 3:41 PM Pali Rohár wrote: > > On Saturday 30 July 2022 15:13:0

Re: [MVEBU] SPI flash offset was depecrated?

2022-07-30 Thread Pali Rohár
On Saturday 30 July 2022 15:13:05 Tony Dinh wrote: > Hi Stefan and Pali, > > Sorry the question might be a bit trivial, but I could not find it in > the source tree. It's been a long time and I'm not up to date on this > subject. I recall a long time ago we needed to specify a SPI flash > offset f

[MVEBU] SPI flash offset was depecrated?

2022-07-30 Thread Tony Dinh
Hi Stefan and Pali, Sorry the question might be a bit trivial, but I could not find it in the source tree. It's been a long time and I'm not up to date on this subject. I recall a long time ago we needed to specify a SPI flash offset for the u-boot image so SPL would know where to load it from. I

[PATCH v2 35/35] vbe: Add a new vbe command

2022-07-30 Thread Simon Glass
Add a command to look at VBE methods and their status. Provide a test for all of this as well. Signed-off-by: Simon Glass --- Changes in v2: - Make VBE a global bootmeth - Introduce the concept of global bootmeths (various patches) - Correct the clang / LTO / event bug from v1 cmd/Kconfig

[PATCH v2 34/35] bootstd: Check building without global bootmeths

2022-07-30 Thread Simon Glass
Use the sandbox_flattree build to check that everything works correctly with BOOTMETH_GLOBAL disabled. Update the tests as needed. Signed-off-by: Simon Glass --- (no changes since v1) configs/sandbox_flattree_defconfig | 2 ++ test/boot/bootflow.c | 7 +++ test/boot/bootme

[PATCH v2 33/35] bootstd: Update documentation

2022-07-30 Thread Simon Glass
Add some documentation updates, particularly about global bootmeths. Signed-off-by: Simon Glass --- (no changes since v1) doc/develop/bootstd.rst| 88 +++--- doc/usage/cmd/bootmeth.rst | 9 ++-- 2 files changed, 68 insertions(+), 29 deletions(-) diff --git

[PATCH v2 31/35] vbe: Support VBE simple

2022-07-30 Thread Simon Glass
Add support for VBE simple, which permits firmware update of a single image stored in MMC or another block device. Signed-off-by: Simon Glass --- (no changes since v1) boot/Kconfig | 12 ++ boot/Makefile| 1 + boot/vbe_simple.c| 315 ++

[PATCH v2 32/35] bootstd: Add vbe bootmeth into sandbox

2022-07-30 Thread Simon Glass
Update sandbox to include the VBE bootmeth. Update a few existing tests to take account of this change, specifically that the new bootmeth now appears when scanning. Signed-off-by: Simon Glass --- (no changes since v1) arch/sandbox/dts/sandbox.dtsi | 13 ++ arch/sandbox/dts/test.dts

[PATCH v2 29/35] event: Add an event for device tree fixups

2022-07-30 Thread Simon Glass
At present there is a confusing array of functions that handle the device tree fix-ups needed for booting an OS. We should be able to switch to using events to clean this up. As a first step, create a new event type and call it from the standard place. Note that this event uses the ofnode interfa

[PATCH v2 28/35] event: Change EVENT_SPY to global

2022-07-30 Thread Simon Glass
This creates static records at present, but it causes a problem with clang and LTO: the linker list records are sometimes dropped from the image. Fix this by making the records global. Update to use __used while we are here. Signed-off-by: Simon Glass --- (no changes since v1) include/event.

[PATCH v2 27/35] bootstd: Drop the system bootdev

2022-07-30 Thread Simon Glass
This was a work-around for the fact that global bootmeths such as EFI bootmgr and VBE don't use a particular bootdev, or at least select it themselves so that we don't need to scan all bootdevs when using that bootmeth. Drop the system bootdev entirely. Signed-off-by: Simon Glass --- (no change

[PATCH v2 26/35] bootstd: Always create the EFI bootmgr bootmeth

2022-07-30 Thread Simon Glass
Now that we can separate this out from the normal bootmeths, update the code to create it always. We cannot rely on the device tree to create this, since the EFI project is quite opposed to having anything in the device tree that helps U-Boot with its processing. Signed-off-by: Simon Glass ---

[PATCH v2 22/35] bootstd: Tidy comments in bootflow_scan_bootdev()

2022-07-30 Thread Simon Glass
Fix a few nits in this function comment. Signed-off-by: Simon Glass --- (no changes since v1) include/bootflow.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/bootflow.h b/include/bootflow.h index c30ba042a48..4fa482a6784 100644 --- a/include/bootflow.h +++ b/

[PATCH v2 21/35] bootstd: Allow the bootdev to be optional in bootflows

2022-07-30 Thread Simon Glass
With global bootmeths we want to scan without a bootdev. Update the logic to allow this. Change the bootflow command to show the bootdev only when valid. Signed-off-by: Simon Glass --- (no changes since v1) boot/bootdev-uclass.c | 7 +-- boot/bootflow.c | 3 ++- cmd/bootflow.c

[PATCH v2 20/35] bootstd: Allow EFI bootmgr to support an invalid bootflow

2022-07-30 Thread Simon Glass
For most testing we don't want this bootmeth to actually do anything. For the one test where we do, add a test hook to obtain the correct behaviour. This will allow us to bind the device always, rather than just doing it for this test. Signed-off-by: Simon Glass --- (no changes since v1) arch/

[PATCH v2 30/35] vbe: Add initial support for VBE

2022-07-30 Thread Simon Glass
Create a new bootmeth for VBE along with a library to handle finding the VBE methods. Signed-off-by: Simon Glass --- (no changes since v1) boot/Kconfig | 10 boot/Makefile | 2 + boot/vbe.c| 119 ++ include/bootstd.h | 2 +

[PATCH v2 18/35] bootstd: Tidy up var naming in bootdev_setup_iter_order()

2022-07-30 Thread Simon Glass
Avoid using 'count' to mean either a count or an error, since this is confusing. In fact, the called function never return 0, since that is an error. Use 'ret' instead. Signed-off-by: Simon Glass --- (no changes since v1) boot/bootdev-uclass.c | 8 1 file changed, 4 insertions(+), 4

[PATCH v2 17/35] bootstd: Provide a bootmeth method to obtain state info

2022-07-30 Thread Simon Glass
Some bootmeths can provide information about what is available to boot. For example, VBE simple provides access to the firmware state. Add a new method for this, along with a sandbox test. Signed-off-by: Simon Glass --- (no changes since v1) boot/bootmeth-uclass.c | 10 ++ boot/bootme

[PATCH v2 16/35] bootstd: Detect empty bootmeth ordering

2022-07-30 Thread Simon Glass
If the ordering produces no entries, this is an error. Report it, so that the caller doesn't try to continue with a NULL bootmeth. This fixes a crash in the bootflow_iter test when running with the sandbox 'default' device tree, instead of the required 'test' one. Signed-off-by: Simon Glass ---

[PATCH v2 15/35] bootstd: Fix comment in bootmeth test

2022-07-30 Thread Simon Glass
Correct the comment at the top of this file. Signed-off-by: Simon Glass --- (no changes since v1) test/boot/bootmeth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/boot/bootmeth.c b/test/boot/bootmeth.c index 07776c5368d..81421f550b5 100644 --- a/test/boot/bootmeth.

[PATCH v2 13/35] dm: core: Support sandbox with read interface

2022-07-30 Thread Simon Glass
Update the 'read' command to work correctly with sandbox. Signed-off-by: Simon Glass --- (no changes since v1) cmd/read.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/read.c b/cmd/read.c index 99c7e3854e1..fecfadaa1fa 100644 --- a/cmd/read.c +++ b/cmd/read.c @@ -10

[PATCH v2 25/35] bootstd: Allow scanning for global bootmeths separately

2022-07-30 Thread Simon Glass
Typically we want to find and use global bootmeths first, since they have the best idea of how the system should boot. We then use normal bootmeths as a fallback. Add the logic for this, putting global bootmeths at the end of the ordering. We can then easily scan the global bootmeths first, then d

[PATCH v2 24/35] dm: core: Call dm_scan_other() when setting up for tests

2022-07-30 Thread Simon Glass
At present this function is not called, so tests miss out on any devices created by it. Add it in so that tests can rely on these extra devices. Signed-off-by: Simon Glass --- (no changes since v1) test/test-main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/tes

[PATCH v2 23/35] bootstd: Support bootflows with global bootmeths

2022-07-30 Thread Simon Glass
Add support for handling this concept in bootflows. Update the 'bootflow' command to allow only the normal bootmeths to be used. This alllows skipping EFI bootmgr and VBE, for example. Signed-off-by: Simon Glass --- (no changes since v1) boot/bootflow.c| 58

[PATCH v2 19/35] bootstd: Allow bootmeths to be marked as global

2022-07-30 Thread Simon Glass
The current way of handling things like EFI bootmgr is a bit odd, since that bootmeth handles selection of the bootdev itself. VBE needs to work the same way, so we should support it properly. Add a flag that indicates that the bootmeth is global, rather than being invoked on each bootdev. Provide

[PATCH v2 11/35] dm: core: Allow writing to a flat tree with ofnode

2022-07-30 Thread Simon Glass
In generally it is not permitted to implement an ofnode function only for flat tree or live tree. Both must be supported. Also the code for live tree access should be in of_access.c rather than ofnode.c which is really just for holding the API-conversion code. Update ofnode_write_prop() accordingl

[PATCH v2 14/35] bootstd: Drop delays in the tests

2022-07-30 Thread Simon Glass
Some tests go as far as booting a distribution. In this case a menu is presented to the user, with a two-second timeout. This adds a total of 12 seconds to the test runs at present. Avoid this by inserting a response using the console-recording feature. Signed-off-by: Simon Glass --- (no change

[PATCH v2 12/35] dm: core: Add support for writing u32 with ofnode

2022-07-30 Thread Simon Glass
Add a new function to write an integer to an ofnode (live tree or flat tree). Signed-off-by: Simon Glass --- (no changes since v1) drivers/core/ofnode.c | 15 +++ include/dm/ofnode.h | 10 ++ test/dm/ofnode.c | 16 3 files changed, 41 insertions(+)

[PATCH v2 10/35] dm: core: Prepare for updating the device tree with ofnode

2022-07-30 Thread Simon Glass
Add some documentation and a new flag so that we can safely enabled using the ofnode interface to write to the device tree. Signed-off-by: Simon Glass --- (no changes since v1) doc/develop/driver-model/livetree.rst | 26 ++ include/test/test.h | 2 ++

[PATCH v2 09/35] dm: core: Tidy up ofnode-writing test

2022-07-30 Thread Simon Glass
Update this test to use the livetree flag so that special check can be avoided. Also drop a few blank lines. Signed-off-by: Simon Glass --- (no changes since v1) test/dm/ofnode.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/test/dm/ofnode.c b/test/dm/ofnode.c

[PATCH v2 07/35] dm: core: Move ofnode-writing test to ofnode

2022-07-30 Thread Simon Glass
This fits better in the ofnode tests, so move it. Signed-off-by: Simon Glass --- (no changes since v1) test/dm/ofnode.c | 56 ++ test/dm/test-fdt.c | 53 --- 2 files changed, 56 insertions(+), 53 deletions(-)

[PATCH v2 08/35] dm: core: Swap parameters of ofnode_write_prop()

2022-07-30 Thread Simon Glass
It is normal for the length to come after the value in libfdt. Follow this same convention with ofnode. Signed-off-by: Simon Glass --- (no changes since v1) drivers/core/ofnode.c | 6 +++--- include/dm/ofnode.h | 6 +++--- test/dm/ofnode.c | 4 ++-- 3 files changed, 8 insertions(+), 8 d

[PATCH v2 06/35] dm: core: Introduce support for multiple trees

2022-07-30 Thread Simon Glass
At present ofnode only works with a single device tree, for the most part. This is the control FDT used by U-Boot. When booting an OS we may obtain a different device tree and want to modify it. Add some initial support for this into the ofnode API. Note that we don't permit aliases in this other

[PATCH v2 05/35] dm: core: Add a note about how livetree updates work

2022-07-30 Thread Simon Glass
The unflattening algorithm results in a single block of memory being allocated for the whole tree. When writing new properties, these are allocated new memory outside that block. When the block is freed, the allocated properties remain. Document how this works and the potential memory leak, as wel

[PATCH v2 04/35] dm: core: Split out the declaration of ofnode

2022-07-30 Thread Simon Glass
This is used by a lot of files, but ofnode.h needs to include a lot of header files. This can create dependency cycles, particularly with global_data.h which must include various declarations. Split the core delcarations into a separate file to fix this. Signed-off-by: Simon Glass --- (no chang

[PATCH v2 03/35] video: Rename structs and functions to avoid VBE

2022-07-30 Thread Simon Glass
Rename these to VESA, itself an abbreviation, to avoid a conflict with Verified Boot for Embedded. Rename this to avoid referencing VBE. Signed-off-by: Simon Glass --- (no changes since v1) arch/x86/lib/bios.c | 10 +- arch/x86/lib/fsp/fsp_graphics.c | 2 +- drivers/bios_

[PATCH v2 02/35] video: Renname vbe.h to vesa.h

2022-07-30 Thread Simon Glass
We want to use VBE to mean Verfiied Boot for Embedded in U-Boot. Rename the existing VBE (Vesa BIOS extensions) to allow this. Verified Boot for Embedded is documented doc/develop/vbe.rst Signed-off-by: Simon Glass --- Changes in v2: - Add a reference to VBE documentation in the header file and

[PATCH v2 01/35] vbe: Add some documentation

2022-07-30 Thread Simon Glass
Add a few links to documents about Verified Boot for Embedded (VBE). These will be expanded as development proceeds. Signed-off-by: Simon Glass --- Changes in v2: - Add new patch with some documentation and links for VBE doc/develop/bootstd.rst | 1 + doc/develop/index.rst | 1 + doc/devel

[PATCH v2 00/35] vbe: Verified Boot for Embedded initial support

2022-07-30 Thread Simon Glass
This adds the concept of a VBE method to U-Boot, along with an implementation of the 'VBE simple' method, basically a simple way of updating firmware in MMC from userspace and monitoring it from U-Boot. VBE simple is implemented in fwupd. U-Boot's role is to set up the device tree with the require