Re: [PATCH] arm: omap3: Make try_unlock_memory() static

2021-03-14 Thread Lokesh Vutla
On 07/03/21 9:23 am, Adam Ford wrote: > try_unlock_memory() is only used in one file, so make it static > in that file and remove it from the sys_proto header file. This > may help with some further optimization in the future. > > Signed-off-by: Adam Ford one of omap3 board is failing to buil

Re: [PATCH v4 2/2] x86: coral: Show memory config and SKU ID on startup

2021-03-14 Thread Simon Glass
Hi Bin, On Tue, 9 Mar 2021 at 15:34, Bin Meng wrote: > > Hi Simon, > > On Sun, Feb 7, 2021 at 12:13 AM Simon Glass wrote: > > > > Provide the model information through sysinfo so that it shows up on > > boot. For memconfig 4 pins are provided, for 16 combinations. For SKU > > ID there are two op

Re: [PATCH] fdt_support.c: Allow late kernel cmdline modification

2021-03-14 Thread Simon Glass
Hi Niko, On Thu, 11 Mar 2021 at 20:34, Niko Mauno wrote: > > On 2/25/21 6:09 PM, Niko Mauno wrote: > > On 2/24/21 3:51 PM, Tom Rini wrote: > >> On Tue, Feb 23, 2021 at 08:33:36AM +0200, Niko Mauno wrote: > >>> On 2/22/21 10:21 PM, Tom Rini wrote: > On Mon, Feb 22, 2021 at 07:18:51PM +, N

Re: [PATCH] sandbox: add FAT to the list of usable env drivers

2021-03-14 Thread Simon Glass
On Fri, 5 Mar 2021 at 07:28, Heinrich Schuchardt wrote: > > Add the FAT environment driver to the priority list. > > When testing the UEFI sub-system the EFI system partition is formatted with > FAT so it is reasonable to store the environment there. > > Signed-off-by: Heinrich Schuchardt > --- >

[PATCH 19/19] sandbox: Correct uninit conflict

2021-03-14 Thread Simon Glass
It is not possible to remove the state before driver model is uninited, since the devices are allocated in the memory buffer. Also it is not possible to uninit driver model afterwards, since the RAM has been freed. Drop the uninit altogether, since it is not actually necessary. Signed-off-by: Sim

[PATCH 17/19] bloblist: Make BLOBLIST_TABLES depend on BLOBLIST

2021-03-14 Thread Simon Glass
Add an extra condition here since we cannot put x86 tables in a bloblist when bloblists are not supported. Signed-off-by: Simon Glass --- lib/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Kconfig b/lib/Kconfig index b35a71ac368..705196aef89 100644 --- a/lib/Kco

[PATCH 18/19] bootm: Skip command-line substitution if !CONFIG_CMDLINE

2021-03-14 Thread Simon Glass
When there is no command line, we cannot enable this feature. Add a check to avoid a build error. Signed-off-by: Simon Glass --- common/bootm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/bootm.c b/common/bootm.c index dab7c3619fd..ea71522d0c9 100644 --- a/commo

[PATCH 15/19] doc: Convert Chromium OS docs to rst

2021-03-14 Thread Simon Glass
Move this documentation over to reST. Move the example files into a files/ directory so they are still separate. Do a few minor updates while we are here: - Tidy up sandbox build instructions - Update my github account name - Add some talks and links Signed-off-by: Simon Glass --- .../chainloa

[PATCH 16/19] command: Fix operation of !CONFIG_CMDLINE

2021-03-14 Thread Simon Glass
The U_BOOT_CMDREP_COMPLETE() macro produces a build error if CONFIG_CMDLINE is not enabled. Fix this by updating the macro to provide the 'repeatable' arugment in this case. Signed-off-by: Simon Glass --- include/command.h | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --

[PATCH 14/19] malloc: Export malloc_simple_info()

2021-03-14 Thread Simon Glass
Export this function always so it can be used behind IS_ENABLED() instead of requiring an #ifdef. Signed-off-by: Simon Glass --- include/malloc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/malloc.h b/include/malloc.h index e15e528a2e3..024b18be00e 100644 --- a

[PATCH 13/19] cpu: Rename SPL_CPU_SUPPORT to SPL_CPU

2021-03-14 Thread Simon Glass
The _SUPPORT suffix is from an earlier time and interferes with use of the CONFIG_IS_ENABLED() macro. Rename the option to drop the suffix. Tidy up the TODO that prompted this. Signed-off-by: Simon Glass --- arch/riscv/cpu/ax25/Kconfig | 2 +- arch/riscv/cpu/fu540/Kconfig| 2 +-

[PATCH 12/19] sf: Support querying write-protect

2021-03-14 Thread Simon Glass
This feature was dropped from U-Boot some time ago: f12f96cfaf5 (sf: Drop spl_flash_get_sw_write_prot") However, we do need a way to see if a flash device is write-protected, since if it is, it may not be possible to write to do (i.e. failing to write is expected). I am not sure of the correc

[PATCH 11/19] bootstage: Warning if space is exhausted

2021-03-14 Thread Simon Glass
At present bootstage silently ignores new records if it runs out of space. It is sometimes obvious by looking at the report, but the IDs are not contiguous, so it is easy to miss. Aad a message so that action can be taken. Signed-off-by: Simon Glass --- common/bootstage.c | 18

[PATCH 10/19] spl: Split out bootstage ID into a function

2021-03-14 Thread Simon Glass
We have two separate places that need to figure out the bootstage ID to use. Put this code in a function so that the logic is in one place. Signed-off-by: Simon Glass --- common/spl/spl.c | 23 +++ 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/common/spl/spl

[PATCH 09/19] binman: Show a message when changing subnodes

2021-03-14 Thread Simon Glass
This change seems important enough to warrant a visible message. Change the log_debug() to log_info(). Signed-off-by: Simon Glass --- lib/binman.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/binman.c b/lib/binman.c index 6040ec89241..530df6a4b4c 100644 --- a/lib/

[PATCH 07/19] sandbox: image: Allow sandbox to load any image

2021-03-14 Thread Simon Glass
Sandbox is special in that it is used for testing and it does not match any particular target architecture. Allow it to load an image from any architecture, so that 'bootm' can be used as needed. Signed-off-by: Simon Glass --- common/image-fit.c | 4 include/image.h| 5 + 2 files c

[PATCH 08/19] test: Silenece the echo and print tests

2021-03-14 Thread Simon Glass
These tests current produce unwanted output on sandbox. Use the correct functions to controller console output, to avoid this. Signed-off-by: Simon Glass --- test/cmd/test_echo.c | 3 ++- test/lib/test_print.c | 8 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/test/cm

[PATCH 06/19] sandbox: Provide a way to bind fixed/removeable devices

2021-03-14 Thread Simon Glass
At present when a file is bound to a host device it is always marked as removeable. Arguably the device is removeable, since it can be unbound at will. However while it is bound, it is not considered removable by the user. Also it is useful to be able to model both fixed and removeable devices for

[PATCH 04/19] sandbox: Disintangle declarations in do_host_bind()

2021-03-14 Thread Simon Glass
This function has a strange mix of declarations and argument parsing which is a bit hard to follow and harder to modify. Separate out the declarations at the start of the function and adjust the ordering of the code slightly. Signed-off-by: Simon Glass --- cmd/host.c | 13 + 1 file

[PATCH 05/19] sandbox: Update do_host_bind() argument counting

2021-03-14 Thread Simon Glass
Remove the 'bind' subcommand before processing the arguments. This will make it easier to add an optional flag. Signed-off-by: Simon Glass --- cmd/host.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cmd/host.c b/cmd/host.c index 927c23d0d9d..847bb1d3b5f 100644 --

[PATCH 03/19] sandbox: cros_ec: Only write EC state when the EC is probed

2021-03-14 Thread Simon Glass
This can crash if the EC has not yet been probed. Add a check to prevent this. Signed-off-by: Simon Glass --- drivers/misc/cros_ec_sandbox.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/misc/cros_ec_sandbox.c b/drivers/misc/cros_ec_sandbox.c index cb8adc4495a..bc01df0904e 100

[PATCH 02/19] sandbox: Only delete the executable if requested

2021-03-14 Thread Simon Glass
At present sandbox removes its executable after failing to run it, since there is no other way that it would get cleaned up. However, this is actually only wanted if the image was created within sandbox. For the case where the image was generated by the build system, such as u-boot-spl, we don't w

[PATCH 01/19] sandbox: Only call timer_timebase_fallback() if present

2021-03-14 Thread Simon Glass
This function only exists if CPU is enabled. Update the code to take account of this, so that it does not have to be enabled on all sandbox builds. Signed-off-by: Simon Glass --- drivers/timer/sandbox_timer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/timer/sa

[PATCH 34/34] x86: coreboot: Don't setup MTRR when booting from coreboot

2021-03-14 Thread Simon Glass
This currently hangs and it is not necessary in any case. Drop the code when booting from coreboot. Signed-off-by: Simon Glass --- arch/x86/lib/init_helpers.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/lib/init_helpers.c b/arch/x86/lib/init_helpers.c inde

[PATCH 33/34] x86: fsp: Don't notify if booted from coreboot

2021-03-14 Thread Simon Glass
When booting from coreboot there is no need to notify the FSP of anything, since coreboot has already done it. Nor it is possible, since the FSP details are not provided by coreboot. Skip it in this case. Signed-off-by: Simon Glass --- arch/x86/lib/fsp2/fsp_support.c | 4 1 file changed,

[PATCH 32/34] x86: coral: Fall back to coreboot video when FSP missing

2021-03-14 Thread Simon Glass
When booting from coreboot the FSP video information is no-longer available. Enable the coreboot driver so that we can get some sort of display in this case. Signed-off-by: Simon Glass --- arch/x86/dts/chromebook_coral.dts | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/x86/dts/ch

[PATCH 31/34] x86: coral: Allow init of debug UART in U-Boot proper

2021-03-14 Thread Simon Glass
At present the debug UART is only set up in SPL, on the assumption that the boot flow will always pass through there. When booting from coreboot, SPL is not used, so the debug UART is not available. Move the code into a common place so that it can be used in U-Boot proper also. Add the required in

[PATCH 29/34] dm: core: Add CBFS support to flashmap

2021-03-14 Thread Simon Glass
Allow referencing a CBFS file in the flashmap, so that it is possible to boot from coreboot, where files are not available from binman. Signed-off-by: Simon Glass --- include/dm/of_extra.h | 8 1 file changed, 8 insertions(+) diff --git a/include/dm/of_extra.h b/include/dm/of_extra.h

[PATCH 30/34] x86: coral: Avoid build error with !CONFIG_ACPIGEN

2021-03-14 Thread Simon Glass
When CONFIG_ACPIGEN is not enabled the CPU code does not build. Fix this by moving things around. Signed-off-by: Simon Glass --- arch/x86/cpu/apollolake/cpu.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/arch/x86/cpu/apollolake/cpu.c b/arch/x86/cpu/apollola

[PATCH 28/34] x86: fsp: Don't enable FSP graphics if booted from coreboot

2021-03-14 Thread Simon Glass
This driver cannot work when booted from coreboot, since the FSP information is not available. Disable it in that case, so that the coreboot video driver can be used instead. Signed-off-by: Simon Glass --- arch/x86/lib/fsp/fsp_graphics.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) di

[PATCH 27/34] x86: video: Allow coreboot video to be used on any x86 board

2021-03-14 Thread Simon Glass
When booting from coreboot we need this driver for the video to work. Update the driver to be usable on any board. The driver disables itself if it sees that is not booted from coreboot. Signed-off-by: Simon Glass --- drivers/video/Kconfig| 2 +- drivers/video/coreboot.c | 16

[PATCH 26/34] video: Fix video on coreboot with the copy buffer

2021-03-14 Thread Simon Glass
The copy buffer, if enabled, prevents booting from coreboot correctly, since no memory is allocated for it. Allow it to fall back to disabled in this situation. This ensures that a console is displayed, even if it is slow. Signed-off-by: Simon Glass --- drivers/pci/pci_rom.c | 7 ++- 1 file

[PATCH 22/34] x86: coreboot: Update parsing of the latest sysinfo

2021-03-14 Thread Simon Glass
Quite a few new tag types have been added over the years. Bring these into U-Boot so that all required tags can be parsed. Add a proper comment to struct sysinfo_t while we are here, since many of the meanings are not obvious. Signed-off-by: Simon Glass --- arch/x86/include/asm/cb_sysinfo.h

[PATCH 25/34] cmd: Add missing check for CONFIG_SYS_LONGHELP

2021-03-14 Thread Simon Glass
Two commands are missing this check, so compilation fails when building without CONFIG_CMDLINE. Add it. Signed-off-by: Simon Glass --- cmd/acpi.c | 2 ++ cmd/bloblist.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/cmd/acpi.c b/cmd/acpi.c index 157261bffbe..e5b9a1752bc 100644 --- a

[PATCH 24/34] x86: Add a command to display coreboot sysinfo

2021-03-14 Thread Simon Glass
This information is interesting to look at and can be important for debugging and inspection. Add a command to display it in a helpful format. Signed-off-by: Simon Glass --- cmd/Kconfig | 9 + cmd/x86/Makefile| 1 + cmd/x86/cbsysinfo.c | 394 +

[PATCH 23/34] x86: Allow installing an e820 when booting from coreboot

2021-03-14 Thread Simon Glass
Move this code into a generic location so that it can be used by other x86 boards which want to boot from coreboot. Also ensure that this is called if booting from coreboot. Signed-off-by: Simon Glass --- arch/x86/cpu/coreboot/sdram.c | 27 +--- arch/x86/include/asm/e820.h

[PATCH 21/34] x86: Move coreboot sysinfo parsing into generic x86 code

2021-03-14 Thread Simon Glass
It is useful to be able to parse coreboot tables on any x86 build which is booted from coreboot. Add a new Kconfig option to enable this feature and move the code so it can be used on any board, if enabled. Signed-off-by: Simon Glass --- arch/x86/Kconfig | 21 ++

[PATCH 20/34] x86: coreboot: Sync up timestamp codes

2021-03-14 Thread Simon Glass
Add new timestamp codes that are present in coreboot, so that we can decode these in U-Boot. At present TS_U_BOOT_START_KERNEL is used twice. It should only be used just before jumping to Linux, so update the other call site to use TS_START_KERNEL. Signed-off-by: Simon Glass --- arch/x86/inclu

[PATCH 19/34] x86: Move coreboot timestamp info into coreboot_tables.h

2021-03-14 Thread Simon Glass
This all relates to the sysinfo structure provided by coreboot. Put the timestamp definitions into the same file as the others. Tidy up a few comments at the same time. Signed-off-by: Simon Glass --- arch/x86/cpu/coreboot/timestamp.c | 12 -- .../x86/include/asm/arch-coreboot/ti

[PATCH 18/34] x86: Make coreboot sysinfo available to any x86 board

2021-03-14 Thread Simon Glass
It is possible to boot U-Boot for chromebook_coral either 'bare metal' or from coreboot. In the latter case we want to provide access to the coreboot sysinfo tables. Move the definitions into a file available to any x86 board. Signed-off-by: Simon Glass --- arch/x86/cpu/coreboot/coreboot.c

[PATCH 17/34] cbfs: Drop unnecessary cast in file_cbfs_fill_cache()

2021-03-14 Thread Simon Glass
The results of malloc() are a void * and so this cast is unnecessary. Drop it. Signed-off-by: Simon Glass --- fs/cbfs/cbfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/cbfs/cbfs.c b/fs/cbfs/cbfs.c index 443a148e3f1..415ea28b871 100644 --- a/fs/cbfs/cbfs.c +++ b/fs/

[PATCH 16/34] cbfs: Support reading compression information

2021-03-14 Thread Simon Glass
CBFS now supports compressed filed. Add support for reading this information so that the correct decompression can be applied. The decompression itself is not implemented in CBFS. Signed-off-by: Simon Glass --- fs/cbfs/cbfs.c | 22 ++ include/cbfs.h | 11 +++ 2 files

[PATCH 14/34] cbfs: Factor out filling a cache node into a new function

2021-03-14 Thread Simon Glass
The file_cbfs_next_file() function is already fairly long. Before expanding it further, move the core part into a separate function. Signed-off-by: Simon Glass --- fs/cbfs/cbfs.c | 45 + 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/

[PATCH 15/34] cbfs: Simplify file iteration

2021-03-14 Thread Simon Glass
In file_cbfs_next_file() there is a lot of complicated code to move to the next file. Use the ALIGN() macros to simplify this. Signed-off-by: Simon Glass --- fs/cbfs/cbfs.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/fs/cbfs/cbfs.c b/fs/cbfs/cbfs.c index a93dc3d0c1

[PATCH 13/34] cbfs: Allow file traversal with any CBFS

2021-03-14 Thread Simon Glass
The file traversal functions currently use a single global CBFS. In some cases we need to access multiple CBFSs to obtain different files. Add new functions to support this. Signed-off-by: Simon Glass --- fs/cbfs/cbfs.c | 11 +++ include/cbfs.h | 19 +-- 2 files changed,

[PATCH 12/34] cbfs: Allow access to CBFS without a header

2021-03-14 Thread Simon Glass
In some cases CBFS does not start with a header but is just a collection of files. It is possible to support this so long as the size of the CBFS is provided. Update the cbfs_init_mem() function to support this. Signed-off-by: Simon Glass --- arch/x86/lib/fsp2/fsp_init.c | 3 ++- fs/cbfs/cbfs

[PATCH 11/34] smbios: Allow writing to the coreboot version string

2021-03-14 Thread Simon Glass
When U-Boot is booted from coreboot the SMBIOS tables are written by coreboot, not U-Boot. The existing method of updating the BIOS version string does not work in that case, since gd->smbios_version is only set when U-Boot writes the tables. Add a new function which allows the version to be updat

[PATCH 10/34] cbfs: Rename new_node to node

2021-03-14 Thread Simon Glass
Rename this variable since there is no need to distinguish it from an old node. Signed-off-by: Simon Glass --- fs/cbfs/cbfs.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/fs/cbfs/cbfs.c b/fs/cbfs/cbfs.c index abc43ad33f6..c9323a562c6 100

[PATCH 09/34] cbfs: Add support for attributes

2021-03-14 Thread Simon Glass
CBFS now supports attributes for things that cannot fit in the header as originally conceived. Add the structures for these. Also rename attributes_offset to something shorter, to ease code readability. Signed-off-by: Simon Glass --- fs/cbfs/cbfs.c | 2 +- include/cbfs.h | 39

[PATCH 08/34] mmc: pci_mmc: Set up the card detect

2021-03-14 Thread Simon Glass
The driver currently reads the card-detect but does not register it with the MMC stack. Update this so that card-detect works as expected. Signed-off-by: Simon Glass --- drivers/mmc/pci_mmc.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/pci_mmc.c b/driver

[PATCH 07/34] tegra: i2c: Drop LOG_DEBUG

2021-03-14 Thread Simon Glass
We should not enable debugging by default. Drop this. Signed-off-by: Simon Glass --- drivers/sound/tegra_i2s.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/sound/tegra_i2s.c b/drivers/sound/tegra_i2s.c index 5cf82250da2..932f737900e 100644 --- a/drivers/sound/tegra_i2s.c +++ b/dri

[PATCH 06/34] x86: coral: Update the SD card-detect GPIO

2021-03-14 Thread Simon Glass
Since the recent bug fix, it doesn't matter which GPIO phandle is used so long as the GPIO number is right. Still, we may as well use the correct one to avoid confusion. Signed-off-by: Simon Glass --- arch/x86/dts/chromebook_coral.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH 05/34] x86: coral: Put the eMMC first

2021-03-14 Thread Simon Glass
At present the eMMC device does not have an alias so it appears after the SD card which is device 1. There is no device 0 which is odd. Make the eMMC device be the first one. Update the boot script to use the new device. Signed-off-by: Simon Glass --- arch/x86/dts/chromebook_coral.dts | 1 +

[PATCH 04/34] x86: Probe device if needed in intel_gpio_xlate()

2021-03-14 Thread Simon Glass
The Intel GPIO binding allows GPIOs to be globally numbered, so that it does not matter which GPIO bank is specified in the device tree. This is convenient and avoid confusion since the banks do not have the same number of GPIOs and the numbering is not sequential. The GPIO uclass ensures that the

[PATCH 02/34] x86: coral: Add information about building / running

2021-03-14 Thread Simon Glass
Add detailed information on how to build the coral image, since it needs binary blobs. Provide a way to avoid the memory-training delay. Also show the console output from a sample run. Signed-off-by: Simon Glass --- doc/board/google/chromebook_coral.rst | 234 -- 1 file

[PATCH 03/34] x86: p2sb: Drop LOG_DEBUG

2021-03-14 Thread Simon Glass
We should not enable debugging by default. Drop this. Signed-off-by: Simon Glass --- drivers/misc/p2sb_emul.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/misc/p2sb_emul.c b/drivers/misc/p2sb_emul.c index 973d02d6785..51f87161d5b 100644 --- a/drivers/misc/p2sb_emul.c +++ b/drivers

[PATCH 00/34] x86: Enhancements for booting from coreboot

2021-03-14 Thread Simon Glass
This series contains various changes to improve U-Boots Coreboot Filesystem (CBFS) implementation and the overall booting of U-Boot from coreboot: - CBFS compression, bare CBFSs - More coreboot sysinfo parsing - Command to display coreboot sysinfo - Various other minor things - Additional features

[PATCH 01/34] x86: coral: Free the ACPI GPIOs after using them

2021-03-14 Thread Simon Glass
These GPIOs are needed later if Chromium OS verified boot is running, so free them after use. Signed-off-by: Simon Glass --- board/google/chromebook_coral/coral.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/board/google/chromebook_coral/coral.c b/board/google/chromebook_coral/coral.c

[PATCH v4 42/42] x86: apl: Use read-only SPL and new of-platdata

2021-03-14 Thread Simon Glass
With Apollo Lake, SPL is placed in read-only memory. Set this new option so that OF_PLATDATA_INST can be used. Signed-off-by: Simon Glass --- Changes in v4: - Rebase to -next arch/x86/cpu/apollolake/Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/cpu/apollolake/Kconfig b

[PATCH v4 41/42] x86: coral: Drop TPM and ACPI interrupts from TPL

2021-03-14 Thread Simon Glass
These devices are not actually built in TPL but are currently active in the TPL devicetree. For of-platdata-inst this means that we will try to generate devices for them, which fails. Update them to be active only in U-Boot proper. Signed-off-by: Simon Glass --- (no changes since v3) Changes i

[PATCH v4 40/42] x86: coral: Drop ACPI properties from of-platdata

2021-03-14 Thread Simon Glass
We don't use these in TPL or SPL, so drop them. Signed-off-by: Simon Glass --- (no changes since v3) Changes in v3: - Don't drop 'ranges' since we use the full PCI driver in SPL configs/chromebook_coral_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/chromebook_coral_def

[PATCH v4 39/42] x86: Don't include reset driver in SPL

2021-03-14 Thread Simon Glass
We don't normally need this driver in TPL/SPL, so drop it for now. It can be enabled by individual boards if needed. Signed-off-by: Simon Glass --- (no changes since v1) arch/x86/dts/reset.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/dts/reset.dtsi b/arch/x

[PATCH v4 38/42] x86: Support a fake PCI device with of-platdata-inst

2021-03-14 Thread Simon Glass
With TPL we don't need full PCI support and it adds to code size. Instead, a simple_bus driver is good enough to be able to read and write the PCI config and do a little basic setup. So at present there are two drivers in U-Boot called pci_x86. One is in UCLASS_PCI, used in SPL and U-Boot proper.

[PATCH v4 37/42] x86: itss: Tidy up bind() for of-platdata-inst

2021-03-14 Thread Simon Glass
With the standard of-platdata we must fix up driver_data manually. With of-platadata-inst this is not necessary, since it is added to the device by dtoc. Update the code to handle this. Signed-off-by: Simon Glass --- (no changes since v1) arch/x86/cpu/intel_common/itss.c | 5 +++-- 1 file cha

[PATCH v4 36/42] x86: apl: Tell of-platdata about a required header file

2021-03-14 Thread Simon Glass
This enum is needed to generate build-time devices. Tell dtoc where to find the header, to avoid compile errors in the generated code. Signed-off-by: Simon Glass --- (no changes since v1) arch/x86/cpu/apollolake/punit.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/cpu/apollolak

[PATCH v4 35/42] x86: apl: Fix the header order in pmc

2021-03-14 Thread Simon Glass
The dm.h header should come first. In fact it needs to, since otherwise the driver model definitions are not available to dt-structs.h Fix this, since it causes problems with OF_PLATDATA_INST. Signed-off-by: Simon Glass --- (no changes since v1) arch/x86/cpu/apollolake/pmc.c | 2 +- 1 file ch

[PATCH v4 33/42] dm: doc: Add documentation for of-platdata-inst

2021-03-14 Thread Simon Glass
Add a description of the new features, along with internal technical documentation. Signed-off-by: Simon Glass --- (no changes since v3) Changes in v3: - Add documentation for of-platdata-inst doc/driver-model/of-plat.rst | 587 +++ 1 file changed, 587 insertio

[PATCH v4 34/42] x86: Define a region for device priv/plat data

2021-03-14 Thread Simon Glass
Collect this together in one place, so driver model can access set it up in a new place if needed. Signed-off-by: Simon Glass --- (no changes since v1) arch/x86/cpu/u-boot-spl.lds | 8 1 file changed, 8 insertions(+) diff --git a/arch/x86/cpu/u-boot-spl.lds b/arch/x86/cpu/u-boot-spl.

[PATCH v4 32/42] dm: doc: Tidy up of-platdata docs

2021-03-14 Thread Simon Glass
This doc has a few pieces that are out-of-date. Fix these. Also we have started to use 'devicetree' instead of 'device tree' or 'device-tree' since it is easier to see as a single term, so replace all ocurrences accordingly. Also move the caveats to the end, since this is a fairly solid part of U-

[PATCH v4 31/42] dm: core: Add warnings to private / platform setters

2021-03-14 Thread Simon Glass
Add a warning to each of these functions so that people do not attempt to use them outside driver model. Signed-off-by: Simon Glass --- (no changes since v3) Changes in v3: - Aew patch with warnings for private / platform setters include/dm/device-internal.h | 18 ++ include/d

[PATCH v4 30/42] dm: core: Use separate priv/plat data region

2021-03-14 Thread Simon Glass
Make use of the new priv/plat data region if enabled. This is implemented as a simple offset from the position set up by dtoc to the new position. So long as all access goes through dm_priv_to_rw() this is safe. Signed-off-by: Simon Glass --- (no changes since v1) drivers/core/device.c | 12 +

[PATCH v4 29/42] sandbox: Define a region for device priv/plat data

2021-03-14 Thread Simon Glass
Collect this together in one place, so driver model can access set it up in a new place if needed. Signed-off-by: Simon Glass --- (no changes since v1) arch/sandbox/cpu/u-boot-spl.lds | 8 1 file changed, 8 insertions(+) diff --git a/arch/sandbox/cpu/u-boot-spl.lds b/arch/sandbox/cpu

[PATCH v4 28/42] dm: core: Allow storing priv/plat data separately

2021-03-14 Thread Simon Glass
At present the device priv/data data allocated by dtoc is stored in the data section along with other variables. On some platforms it is better to allocate space for it separately, e.g. if SPL is running from read-only memory. Create a new space with the same size as that allocated by dtoc, ready

[PATCH v4 27/42] dm: core: Move flags to device-runtime info

2021-03-14 Thread Simon Glass
When of-platdata-inst is active, use the flags in the new udevice_rt table, dropping them from the main struct udevice. This ensures that the latter is not updated at runtime. Signed-off-by: Simon Glass --- (no changes since v2) Changes in v2: - Leave the flags_ memeber in the same struct posit

[PATCH v4 26/42] dm: core: Create a struct for device runtime info

2021-03-14 Thread Simon Glass
At present when driver model needs to change a device it simply updates the struct udevice structure. But with of-platdata-inst most of the fields are not modified at runtime. In fact, typically only the flags need to change. For systems running SPL from read-only memory it is convenient to separa

[PATCH v4 25/42] dm: core: Add an option to support SPL in read-only memory

2021-03-14 Thread Simon Glass
Some systems (e.g. x86 APL) run SPL from read-only memory. The device instances created by dtoc are therefore not writeable. To make things work we would need to copy the devices to read/write memory. To avoid this, add an option to use a separate runtime struct for devices, just as is done for dr

[PATCH v4 24/42] azure/gitlab: Add tests for sandbox_noinst

2021-03-14 Thread Simon Glass
Add this new board to the test plans. Travis-CI is left out, since it is being removed soon due to lack of capacity. Signed-off-by: Simon Glass --- (no changes since v1) .azure-pipelines.yml | 3 +++ .gitlab-ci.yml | 10 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff

[PATCH v4 23/42] test: Run sandbox_spl tests on sandbox_noinst

2021-03-14 Thread Simon Glass
Run the tests on this build too, to prevent regressions. Signed-off-by: Simon Glass --- (no changes since v1) test/run | 4 1 file changed, 4 insertions(+) diff --git a/test/run b/test/run index 735628e7e37..869406cd8d2 100755 --- a/test/run +++ b/test/run @@ -30,6 +30,10 @@ fi run_test

[PATCH v4 22/42] sandbox: Create a new sandbox_noinst build

2021-03-14 Thread Simon Glass
Move sandbox_spl over to use OF_PLATDATA_INST. Create a new board to test the case when this is not enabled, since we will be keeping that code around for several months and want to avoid regressions. Skip the dm_test_of_plat_dev() test since driver info is not available for OF_PLATDATA_INST. Sig

[PATCH v4 21/42] Revert "sandbox: Disable I2C emulators in SPL"

2021-03-14 Thread Simon Glass
With recent changes this can be supported again. Add it back. This reverts commit d85f2c4f2970d0ec2f5f075de734afd11200d153. Signed-off-by: Simon Glass --- (no changes since v1) arch/sandbox/dts/sandbox.dtsi | 10 +++--- configs/sandbox_spl_defconfig | 1 + drivers/i2c/Makefile |

[PATCH v4 20/42] sandbox: i2c: Support i2c emulation with of-platdata

2021-03-14 Thread Simon Glass
At present the i2c emulators require access to the devicetree, which is not possible (by design) with of-platdata. Add a way for drivers to record the of-platdata index of their emulator, so that we can still find the emulator. This allows i2c emulation to work with of-platdata. Signed-off-by: S

[PATCH v4 19/42] sandbox_spl: Increase SPL malloc() size

2021-03-14 Thread Simon Glass
The test framework reinits driver model tests before running each test. Since malloc_simple does not support free(), this eventually runs out of memory. Fix it for now by increasing the space to 32KB. Signed-off-by: Simon Glass Reviewed-by: Heinrich Schuchardt --- (no changes since v1) confi

[PATCH v4 18/42] dm: Rename device_get_by_driver_info_idx()

2021-03-14 Thread Simon Glass
This function finds a device by its driver_info index. With of-platdata-inst we do not use driver_info, but instead instantiate udevice records at build-time. However the semantics of using the function are the same in each case: the caller provides an index and gets back a device. So rename the

[PATCH v4 17/42] sandbox: i2c: Move platdata structs to header files

2021-03-14 Thread Simon Glass
At present the structs used by these drivers are declared in the C files and so are not accessible to dtoc. Move them to header files, as required. Signed-off-by: Simon Glass --- (no changes since v1) arch/sandbox/include/asm/i2c.h | 15 +++ arch/sandbox/include/asm/rtc.h | 24

[PATCH v4 16/42] dm: core: Drop uclass_find_device_by_phandle() with of-platdata

2021-03-14 Thread Simon Glass
At present this function is included in the build but with of-platdata it only services to produce a confusing link error complaining about a call to dev_read_u32_default(). Drop it so that any call to uclass_find_device_by_phandle() is flagged as an error, making it easier to see what is going on

[PATCH v4 15/42] dm: core: Drop device_get_by_driver_info()

2021-03-14 Thread Simon Glass
This function is now only used in a test. Drop it. Also drop DM_DRVINFO_GET() which was the only purpose for having the function. Signed-off-by: Simon Glass --- (no changes since v3) Changes in v3: - Drop DM_DRVINFO_GET() also drivers/core/device.c | 15 --- include/dm/device.h

[PATCH v4 14/42] clk: sandbox: Create a special fixed-rate driver

2021-03-14 Thread Simon Glass
Create a version of this driver for sandbox so that it can use the of-platdata struct. Signed-off-by: Simon Glass --- (no changes since v1) arch/sandbox/dts/sandbox.dtsi | 2 +- arch/sandbox/include/asm/clk.h | 8 drivers/clk/clk_sandbox.c | 33

[PATCH v4 13/42] clk: fixed-rate: Export driver parts for OF_PLATDATA_INST

2021-03-14 Thread Simon Glass
We need to allow SoCs to create their own drivers for this so that they can use their own of-platdata structs. To minimise code duplication, export the driver operations and the ofdata_to_plat() setup function. Signed-off-by: Simon Glass --- (no changes since v1) drivers/clk/clk_fixed_rate.c |

[PATCH v4 12/42] clk: sandbox: Move priv/plat data to a header file

2021-03-14 Thread Simon Glass
At present the structs used by this driver are not accessible outside it, so cannot be used with OF_PLATDATA_INST. Move them to a header file to fix this. Signed-off-by: Simon Glass --- (no changes since v1) arch/sandbox/include/asm/clk.h | 16 drivers/clk/clk_sandbox.c |

[PATCH v4 11/42] dm: test: Avoid destroying uclasses with of-platdata-inst

2021-03-14 Thread Simon Glass
It is not possible to destroy the uclasses when they are created at build time. Skip this step so that SPL test can complete successfully. Signed-off-by: Simon Glass --- (no changes since v2) Changes in v2: - Update to deal with test refactoring series test/test-main.c | 30 ++

[PATCH v4 10/42] dm: core: Include dt-decl.h automatically

2021-03-14 Thread Simon Glass
When dt-structs.h is used, include the dt-decl.h header as well, so that these declarations are available. Signed-off-by: Simon Glass --- (no changes since v1) include/dt-structs.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/dt-structs.h b/include/dt-structs.h index f0e1c9cb9

[PATCH v4 09/42] dm: Add the new dtoc-generated files to the build

2021-03-14 Thread Simon Glass
Now that dtoc generates some new C files, add these to the build so that the instantiated devices and uclasses can be used. Signed-off-by: Simon Glass --- (no changes since v1) scripts/Makefile.spl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/Makefile.spl b/scr

[PATCH v4 07/42] dm: core: Set up driver model for OF_PLATDATA_INST

2021-03-14 Thread Simon Glass
With this we don't need to scan and bind drivers, not even the root device. We just need to locate the root device that was set up at build time, then set our root in global_data to point to it. Update the code to handle this case. Signed-off-by: Simon Glass --- (no changes since v1) drivers/

[PATCH v4 08/42] dm: core: Skip adding uclasses with OF_PLATDATA_INST

2021-03-14 Thread Simon Glass
There is no need to ever add new uclasses since these are set up at build time. Update the code to return an error if this is attempted. Signed-off-by: Simon Glass --- (no changes since v1) drivers/core/uclass.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/co

[PATCH v4 06/42] dm: core: Adjust uclass setup with of-platdata

2021-03-14 Thread Simon Glass
When OF_PLATDATA_INST is enabled we don't need to create the uclass list. Instead we just need to point to the existing list. Update the code accordingly. Signed-off-by: Simon Glass --- (no changes since v1) drivers/core/root.c | 8 ++-- include/dm/root.h | 3 +++ 2 files changed, 9 inse

[PATCH v4 05/42] dm: core: Allow dropping run-time binding of devices

2021-03-14 Thread Simon Glass
With OF_PLATDATA_INST devices are bound at build time. We should not need binding of devices at runtime in most cases. However it is inflexible to absolutely prohibit it, so add an option to control this. Update the driver model core so that it does not bind devices. Update device_bind() to return

[PATCH v4 04/42] dm: core: Add macros to access the new linker lists

2021-03-14 Thread Simon Glass
Add macros which work with instantiated devices and uclasses, as created at build time by dtoc. Include variants that can be used in data structures. These are mostly used by dtoc but it is worth documenting them fully for the occasional case where they might come up in user code. Signed-off-by:

[PATCH v4 02/42] sandbox: Drop debug message in os_spl_to_uboot()

2021-03-14 Thread Simon Glass
This is not needed in normal operation. Drop it. Signed-off-by: Simon Glass Reviewed-by: Heinrich Schuchardt --- (no changes since v1) arch/sandbox/cpu/os.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c index 2d9583c17ca..68825d28d6a 100644 -

[PATCH v4 03/42] linker_lists: Allow use in data structures

2021-03-14 Thread Simon Glass
At present linker lists are designed for use in code. They make use of statements within expressions ({...}), for example. It is possible to generate a reference to a linker_list entry that can be used in data structures, where such features are not permitted. It requires that the reference first

[PATCH v4 01/42] dtoc: Drop use of DECL() macros

2021-03-14 Thread Simon Glass
We can use extern instead, so let's drop these macros. It adds one more thing to learn about and doesn't make the code any clearer. Signed-off-by: Simon Glass --- (no changes since v3) Changes in v3: - Add new patch to drop DECL() macros from dtoc (to squash in) tools/dtoc/dtb_platdata.py |

  1   2   >