[PATCH v4 06/41] doc: Document how sandbox_spl_tests are run

2021-02-06 Thread Simon Glass
Add a few notes about the sandbox_spl tests, since they are special. Signed-off-by: Simon Glass Acked-by: Pratyush Yadav --- Changes in v4: - Fix 'of-pldata' typo Changes in v3: - Reword the SPL tests section for clarity Changes in v2: - Add a note that SPL tests can in fact be run

Re: [PATCH 1/2] dm: core: Fix allocation of empty of-platdata

2021-02-06 Thread Simon Glass
With of-platdata we always have a dtv struct that holds the platform data provided by the driver_info record. However, this struct can be empty if there are no actual devicetree properties provided. The upshot of empty platform data is that it will end up as a zero-size member in the BSS section,

Re: [PATCH v2 06/33] dtoc: Support scanning of uclasses

2021-02-06 Thread Simon Glass
Uclasses can have per-device private / platform data so dtoc needs to scan these drivers. This allows it to find out the size of this data so it can be allocated a build time. Add a parser for uclass information, similar to drivers. Keep a dict of the uclasses that were found. Signed-off-by:

Re: [PATCH v2 16/33] dtoc: Support headers needed for drivers

2021-02-06 Thread Simon Glass
Typically dtoc can detect the header file needed for a driver by looking for the structs that it uses. For example, if a driver as a .priv_auto that uses 'struct serial_priv', then dtoc can search header files for the definition of that struct and use the file. In some cases, enums are used in

Re: [PATCH v2 12/33] dtoc: Process nodes to set up required properties

2021-02-06 Thread Simon Glass
Add logic to assign property values to nodes as required by dtoc. The references allow nodes to refer to each other in C code. The macros used by dtoc are not yet defined in driver model. They will be added along with the actual driver model implementation. Signed-off-by: Simon Glass --- (no

Re: [PATCH v2 09/33] dtoc: Rename sandbox_i2c_test and sandbox_pmic_test

2021-02-06 Thread Simon Glass
These have '_test' suffixes which are not present on the drivers in the source code. Drop the suffixes to avoid a mismatch when scanning. Signed-off-by: Simon Glass --- (no changes since v1) tools/dtoc/test/dtoc_test_simple.dts | 4 ++-- tools/dtoc/test_dtoc.py | 12 ++--

Re: [PATCH v2 13/33] dtoc: Track nodes which are actually used

2021-02-06 Thread Simon Glass
Mark all nodes that are actually used, so we can perform extra checks on them. Signed-off-by: Simon Glass --- (no changes since v1) tools/dtoc/dtb_platdata.py | 3 +++ tools/dtoc/src_scan.py | 25 ++--- tools/dtoc/test_dtoc.py | 11 +++

Re: [PATCH v2 15/33] Makefile: Pass the U-Boot phase to dtoc

2021-02-06 Thread Simon Glass
Pass the U-Boot phase as a parameter so dtoc can use it. At present it is ether "spl" or "tpl". Signed-off-by: Simon Glass --- (no changes since v1) scripts/Makefile.spl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Applied to u-boot-dm, thanks!

Re: [PATCH v2 31/33] dtoc: Generate a summary in the dt-plat.c file

2021-02-06 Thread Simon Glass
Add a summary to the top of the generated code, to make it easier to see what the file contains. Also add a tab to .plat so that its value lines up with the others. Signed-off-by: Simon Glass --- (no changes since v1) tools/dtoc/dtb_platdata.py | 20 +++- tools/dtoc/test_dtoc.py| 184

Re: [PATCH v2 23/33] dtoc: Support processing the root node

2021-02-06 Thread Simon Glass
The device for the root node is normally bound by driver model on init. With devices being instantiated at build time, we must handle the root device also. Add support for processing the root node, which may not have a compatible string. Signed-off-by: Simon Glass --- (no changes since v1)

Re: [PATCH v1] fix patman --limit-cc option

2021-02-06 Thread Simon Glass
Hi Bernhard, On Fri, 29 Jan 2021 at 07:10, Bernhard Kirchen wrote: > > patman's --limit-cc option parses its argument to an integer and uses > that to trim the list of CC recipients to a particular maximum. but that > only works if the cc variable is a list, which it is not. > > Signed-off-by:

Re: [PATCH v2 24/33] dtoc: Add an option for device instantiation

2021-02-06 Thread Simon Glass
Add an option to instantiate devices at build time. For now this just parses the option and sets up a few parameters. Signed-off-by: Simon Glass --- (no changes since v1) tools/dtoc/dtb_platdata.py | 17 +++-- tools/dtoc/main.py | 4 +++- tools/dtoc/test_dtoc.py| 37

Re: [PATCH v2 1/1] sandbox: host bind must close file descriptor

2021-02-06 Thread Simon Glass
On Tue, 2 Feb 2021 at 16:22, Heinrich Schuchardt wrote: > > Each invocation of the 'host bind' command with a file name argument opens > a file descriptor. The next invocation of the 'host bind' command destroys > the block device but the file descriptor remains open. The same holds true > for

Re: [PATCH v2 27/33] dtoc: Don't generate platform data with instantiation

2021-02-06 Thread Simon Glass
This file is not used when instantiating devices. Update dtoc to skip generating its contents and just add a comment instead. Also it is useful to see the driver name and parent for each device. Update the file to show that information, to avoid updating the same tests twice. Signed-off-by:

Re: [PATCH v2 04/33] dtoc: Ignore unwanted files when scanning for drivers

2021-02-06 Thread Simon Glass
We should ignore anything in the .git directory or any of the build-sandbox, etc. directories created by 'make check'. These can confuse dtoc. Update the code to ignore these. Signed-off-by: Simon Glass --- (no changes since v1) tools/dtoc/src_scan.py | 5 +

Re: [PATCH v2 29/33] sandbox: i2c: Rename driver names to work with of-platdata

2021-02-06 Thread Simon Glass
Some of these do not follow the rules. Make sure the driver name matches the compatible string in all cases. Signed-off-by: Simon Glass --- Changes in v2: - New patch arch/sandbox/dts/test.dts | 4 ++-- drivers/i2c/i2c-emul-uclass.c | 4 ++-- drivers/rtc/i2c_rtc_emul.c| 2 +- 3 files

Re: [PATCH v2 01/33] bootstage: Fix dependency for BOOTSTAGE_RECORD_COUNT

2021-02-06 Thread Simon Glass
At present these three Kconfigs exist even when bootstage is not enabled. This is not necessary since bootstage.c is only built if BOOTSTAGE is enabled. Make them conditional. Also fix up the overflow message to mention TPL. Signed-off-by: Simon Glass --- (no changes since v1)

Re: [PATCH v2 03/33] dtoc: Save scan information across test runs

2021-02-06 Thread Simon Glass
At present most of the tests scan the U-Boot source tree as part of their run. This information does not change across tests, so we can save time by remembering it. Add a way to set up this information and use it for each test, taking a copy first, so as not to mess up the original. This reduces

Re: [PATCH v2 02/33] dtoc: Scan drivers for available information

2021-02-06 Thread Simon Glass
At present we simply record the name of a driver parsed from its implementation file. We also need to get the uclass and a few other things so we can instantiate devices at build time. Add support for collecting this information. This requires parsing each driver file. Signed-off-by: Simon Glass

Re: [PATCH v2 05/33] dtoc: Collect priv/plat struct info from drivers

2021-02-06 Thread Simon Glass
In order to output variables to hold the priv/plat information used by each device, dtoc needs to know the struct for each. With this, it can declare this at build time: u8 xxx_priv [sizeof(struct )]; Collect the various struct names from the drivers. Signed-off-by: Simon Glass --- (no

Re: [PATCH v2 07/33] dtoc: Support scanning of structs in header files

2021-02-06 Thread Simon Glass
Drivers can have private / platform data contained in structs and these struct definitions are generally kept in header files. In order to generate build-time devices, dtoc needs to generate code that declares the data contained in those structs. This generated code must include the relevant

Re: [PATCH v2 28/33] sandbox: Make sandbox,emul more conventional

2021-02-06 Thread Simon Glass
At present this property is a phandle but does not have a #xxx-cells property to match it. Add one so that is works the same as gpio and clock phandles. Signed-off-by: Simon Glass --- (no changes since v1) arch/sandbox/dts/sandbox.dtsi | 6 +- doc/driver-model/pci-info.rst | 1 + 2 files

Re: [PATCH v2 08/33] dtoc: Move test files into a test/ directory

2021-02-06 Thread Simon Glass
It is confusing to have the test files in the same places as the implementation. Move them into a separate directory. Add a helper function for test_dtoc, to avoid repeating the same path. Signed-off-by: Simon Glass --- (no changes since v1) tools/dtoc/{ => test}/dtoc_test.dts | 0

Re: [PATCH v2 11/33] dtoc: Make use of node properties

2021-02-06 Thread Simon Glass
Now that we have these available, use them instead of recalculating things each time. Signed-off-by: Simon Glass --- (no changes since v1) tools/dtoc/dtb_platdata.py | 45 -- 1 file changed, 19 insertions(+), 26 deletions(-) Applied to u-boot-dm, thanks!

Re: [PATCH v2 10/33] dtoc: Add some extra properties to nodes

2021-02-06 Thread Simon Glass
It is convenient to attach drivers, etc. to nodes so that we can use the Node object as the main data structure in this module. Add a function which adds the new properties, along with documentation. Signed-off-by: Simon Glass --- (no changes since v1) tools/dtoc/dtb_platdata.py | 37

Re: [PATCH v2 14/33] dtoc: Support tracking the phase of U-Boot

2021-02-06 Thread Simon Glass
U-Boot operates in several phases, typically TPL, SPL and U-Boot proper. The latter does not use dtoc. In some rare cases different drivers are used for two phases. For example, in TPL it may not be necessary to use the full PCI subsystem, so a simple driver can be used instead. This works in

Re: [PATCH v2 19/33] dtoc: Read aliases for uclasses

2021-02-06 Thread Simon Glass
Scan the aliases in the device tree to establish the number of devices within each uclass, and the sequence number of each. Signed-off-by: Simon Glass --- (no changes since v1) tools/dtoc/dtb_platdata.py | 28 ++ tools/dtoc/src_scan.py | 32

Re: [PATCH v2 18/33] dtoc: Warn of duplicate drivers

2021-02-06 Thread Simon Glass
If drivers have the same name then we cannot distinguish them. This only matters if the driver is actually used by dtoc, but in that case, issue a warning. Signed-off-by: Simon Glass --- (no changes since v1) tools/dtoc/src_scan.py | 28 ++- tools/dtoc/test_src_scan.py | 95

Re: [PATCH v2 17/33] dtoc: Process driver aliases along with drivers

2021-02-06 Thread Simon Glass
Instead of using a separate step for this processing, handle it while scanning its associated driver. This allows us to drop the code coverage exception in this case. Note that only files containing drivers are scanned by dtoc, so aliases declared in a file that doesn't hold a driver will not be

Re: [PATCH v2 20/33] dtoc: Detect drivers only at the start of start of line

2021-02-06 Thread Simon Glass
If a driver declaration is included in a comment, dtoc currently gets confused. Update the parser to only consider declarations that begin at the start of a line. Since multi-line comments begin with an asterisk, this avoids the problem. Signed-off-by: Simon Glass --- Changes in v2: - New patch

Re: [PATCH v2 26/33] dtoc: Add support for decl file

2021-02-06 Thread Simon Glass
Add an option to generate the declaration file, which declares all drivers and uclasses, so references can be used in the code. Signed-off-by: Simon Glass --- (no changes since v1) tools/dtoc/dtb_platdata.py | 36 +++ tools/dtoc/test_dtoc.py| 91

Re: [PATCH v2 21/33] dtoc: Assign a sequence number to each node

2021-02-06 Thread Simon Glass
Now that we have the alias information we can assign a sequence number to each device in the uclass. Store this in the node associated with each device. This requires renaming the sandbox test drivers to have the right name. Note that test coverage is broken with this patch, but fixed in the next

Re: [PATCH v2 22/33] dtoc: Set up the uclasses that are used

2021-02-06 Thread Simon Glass
We only care about uclasses that are actually used. This is determined by the drivers that use them. Check all the used drivers and build a list of 'valid' uclasses. Also add references to the uclasses so we can generate C code that uses them. Attach a uclass to each valid driver. For the tests,

Re: [PATCH v2 25/33] dm: of-platadata: Add option for device instantiation

2021-02-06 Thread Simon Glass
Add Kconfig options to support build-time device instantiation. When fully implemented, this will allow dtoc to create U-Boot devices (i.e. struct udevice records) at build time, thus reducing code space in SPL. For now this defaults to off, but will be enabled when the rest of the implementation

Re: [PATCH v2 30/33] dtoc: Tidy up the list of supported phandle properties

2021-02-06 Thread Simon Glass
For now dtoc only supports a hard-coded list of phandle properties, to avoid any situation where it makes a mistake in its determination. Make this into a constant dict, recording both the phandle property name and the associated #cells property in the target node. This makes it easier to find

Re: [PATCH v2 32/33] dtoc: Generate uclass devices

2021-02-06 Thread Simon Glass
Add support for generating a file containing uclass instances. This avoids the need to create these at run time. Update a test uclass to include a 'priv_auto' member, to increase test coverage. Signed-off-by: Simon Glass --- (no changes since v1) drivers/misc/test_drv.c| 1 +

Re: [PATCH v2 33/33] dtoc: Generate device instances

2021-02-06 Thread Simon Glass
Add support for generating a file containing udevice instances. This avoids the need to create these at run time. Update a test uclass to include a 'per_device_plat_auto' member, to increase test coverage. Add another tab to the driver_info output so it lines up nicely like the device-instance

Re: [PATCH 1/2] lib: Fix BINMAN_FDT dependency

2021-02-06 Thread Simon Glass
On Wed, 3 Feb 2021 at 06:20, Bin Meng wrote: > > lib/binman.c references the following 3 ofnode APIs: > ofnode_first_subnode(), ofnode_path() and ofnode_read_bool(). > > These APIs get built only when DM is on. Fix the dependency then. > > Signed-off-by: Bin Meng > --- > > lib/Kconfig | 2 +- >

Re: [PATCH 2/2] dts: Fix OF_LIVE dependency

2021-02-06 Thread Simon Glass
On Wed, 3 Feb 2021 at 06:20, Bin Meng wrote: > > lib/of_live.c references the following 2 ofnode APIs: > of_alias_scan() and of_get_property(). > > These APIs get built only when DM is on. Fix the dependency then. > > Signed-off-by: Bin Meng > --- > > dts/Kconfig | 2 +- > 1 file changed, 1

Re: [PATCH] serial: ns16550: Handle zero value

2021-02-06 Thread Simon Glass
Hi Simon, On Thu, Feb 4, 2021 at 8:33 AM Simon Glass wrote: > > On Wed, 3 Feb 2021 at 17:20, Bin Meng wrote: > > > > Hi Simon, > > > > On Thu, Feb 4, 2021 at 5:42 AM Simon Glass wrote: > > > > > > Hi Bin, > > > > > > On Wed, 3 Feb 2021 at 07:42, Bin Meng wrote: > > > > > > > > A working

Re: [PATCH] serial: ns16550: Correct the base address type

2021-02-06 Thread Simon Glass
On Wed, 3 Feb 2021 at 06:22, Bin Meng wrote: > > Currently ns16550_serial_assign_base() treats the argument 'base' > with type `ulong`. This is incorrect because the base address was > obtained from device tree with type `fdt_addr_t` that can represent > a physical address larger than 32-bit in a

Re: [PATCH 2/2] dm: core: Add DM_DEVICE_REMOVE condition to all exit paths

2021-02-06 Thread Simon Glass
At present device_bind() does some unnecessary work if a device fails to bind in SPL. Add the missing conditions. Also fix a style nit in the same function while we are here. Signed-off-by: Simon Glass --- drivers/core/device.c | 19 +++ 1 file changed, 11 insertions(+), 8

Re: [PATCH v4 8/9] fastboot: Allow u-boot-style partitions

2021-02-06 Thread Sean Anderson
On 2/6/21 12:37 PM, Lukasz Majewski wrote: Hi Sean, On 2/5/21 9:46 AM, Lukasz Majewski wrote: > Hi Sean, > >> This adds support for partitions of the form "dev.hwpart:part" and >> "dev#partname". This allows one to flash to eMMC boot partitions >> without having to use

[PATCHv2 3/3] drivers: tee: sandbox: secure channel protocol control

2021-02-06 Thread Jorge Ramirez-Ortiz
Adds support for SCP03 emulation. Signed-off-by: Jorge Ramirez-Ortiz --- drivers/tee/optee/Kconfig | 6 drivers/tee/sandbox.c | 60 +-- 2 files changed, 64 insertions(+), 2 deletions(-) diff --git a/drivers/tee/optee/Kconfig

[PATCHv2 2/3] cmd: SCP03: enable and provision command

2021-02-06 Thread Jorge Ramirez-Ortiz
Enable and provision the SCP03 keys on a TEE controlled secured elemt from the U-Boot shell. Signed-off-by: Jorge Ramirez-Ortiz --- cmd/Kconfig | 9 cmd/Makefile | 3 +++ cmd/scp03.c | 64 3 files changed, 76 insertions(+)

[PATCHv2 1/3] common: SCP03 control (enable and provision of keys)

2021-02-06 Thread Jorge Ramirez-Ortiz
This Trusted Application allows enabling and provisioning SCP03 keys on TEE controlled secure element (ie, NXP SE050) For information on SCP03, check the Global Platform HomePage[1] [1] globalplatform.org Signed-off-by: Jorge Ramirez-Ortiz --- common/Kconfig | 8 ++

[PATCH 1/3] common: SCP03 control (enable and provision of keys)

2021-02-06 Thread Jorge Ramirez-Ortiz
This Trusted Application allows enabling and provisioning SCP03 keys on TEE controlled secure element (ie, NXP SE050) For information on SCP03, check the Global Platform HomePage[1] [1] globalplatform.org Signed-off-by: Jorge Ramirez-Ortiz --- common/Kconfig | 8 ++

[PATCH 3/3] drivers: tee: sandbox: secure channel protocol control

2021-02-06 Thread Jorge Ramirez-Ortiz
Adds support for SCP03 emulation. Signed-off-by: Jorge Ramirez-Ortiz --- drivers/tee/optee/Kconfig | 6 drivers/tee/sandbox.c | 60 +-- 2 files changed, 64 insertions(+), 2 deletions(-) diff --git a/drivers/tee/optee/Kconfig

[PATCH 2/3] cmd: SCP03: enable and provision command

2021-02-06 Thread Jorge Ramirez-Ortiz
Enable and provision the SCP03 keys on a TEE controlled secured elemt from the U-Boot shell. Signed-off-by: Jorge Ramirez-Ortiz --- cmd/Kconfig | 9 cmd/Makefile | 3 +++ cmd/scp03.c | 64 3 files changed, 76 insertions(+)

[PATCH] drivers: tee: sandbox: secure channel protocol control

2021-02-06 Thread Jorge Ramirez-Ortiz
Adds support for SCP03 emulation. Signed-off-by: Jorge Ramirez-Ortiz --- drivers/tee/optee/Kconfig | 6 drivers/tee/sandbox.c | 59 +-- 2 files changed, 63 insertions(+), 2 deletions(-) diff --git a/drivers/tee/optee/Kconfig

[PATCH v4 11/11] tpm: Allow disabling platform hierarchy with TPM2

2021-02-06 Thread Simon Glass
With TPM2 we don't actually lock the TPM once verified boot is finished. Instead we disable the platform hierarchy which serves the same purpose. Add an implementation of this so we can safely boot into the kernel. Signed-off-by: Simon Glass Acked-by: Ilias Apalodimas --- (no changes since v2)

[PATCH v4 05/11] tpm: Switch TPMv1 over to use the new API

2021-02-06 Thread Simon Glass
Take over the plain 'tpm_...' functions for use by the new TPM API. Rename all the TPMv1 functions so they are called from the API. Update the TPMv1 functions so that they are called from the API. Change existing users to use the tpm1_ prefix so they don't need to go through the API, which might

[PATCH v4 10/11] tpm: Add TPM2 support for write_lock

2021-02-06 Thread Simon Glass
Implement this API function for TPM2. Signed-off-by: Simon Glass Acked-by: Ilias Apalodimas --- (no changes since v1) include/tpm-v2.h | 12 lib/tpm-v2.c | 23 +++ lib/tpm_api.c| 2 +- 3 files changed, 36 insertions(+), 1 deletion(-) diff --git

[PATCH v4 09/11] tpm: Add TPM2 support for read/write values

2021-02-06 Thread Simon Glass
Implement this API function for TPM2. Signed-off-by: Simon Glass Acked-by: Ilias Apalodimas --- (no changes since v1) include/tpm-common.h | 3 ++ include/tpm-v2.h | 38 lib/tpm-v2.c | 84 lib/tpm_api.c|

[PATCH v4 08/11] tpm: Add an implementation of define_space

2021-02-06 Thread Simon Glass
Add support for this so that the TPM can be set up for use with Chromium OS verified boot. Signed-off-by: Simon Glass --- Changes in v4: - Drop unnecessary update of offset Changes in v3: - Add a comment to the offset and fix up the value include/tpm-v2.h | 18 ++

[PATCH v4 07/11] tpm: Reduce duplication in a few functions

2021-02-06 Thread Simon Glass
Update tpm2_clear() and tpm2_pcr_extend() so that the command size is not repeated twice. Add a small comment to the latter. Signed-off-by: Simon Glass Reviewed-by: Ilias Apalodimas --- (no changes since v2) Changes in v2: - Add comments for the offset value lib/tpm-v2.c | 13 -

[PATCH v4 04/11] tpm: Add an API that can support v1.2 and v2

2021-02-06 Thread Simon Glass
There are two different TPM standards. U-Boot supports both but each has its own set of functions. We really need a single TPM API that can call one or the other. This is not always possible as there are some differences between the two standards, but it is mostly possible. Add an API to handle

[PATCH v4 02/11] tpm: Use logging in the uclass

2021-02-06 Thread Simon Glass
Update this to use log_debug() instead of the old debug(). Signed-off-by: Simon Glass Reviewed-by: Ilias Apalodimas --- (no changes since v1) drivers/tpm/tpm-uclass.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/tpm/tpm-uclass.c

[PATCH v4 06/11] tpm: Add a basic API implementation for TPMv2

2021-02-06 Thread Simon Glass
Add support for TPMv2 versions of API functions. So far this is not complete as the standard is quite large, but it implements everything currently available for TPMv2 in U-Boot. Signed-off-by: Simon Glass Acked-by: Ilias Apalodimas --- (no changes since v1) lib/tpm_api.c | 84

[PATCH v4 03/11] tpm: Add debugging of request in tpm_sendrecv_command()

2021-02-06 Thread Simon Glass
The response is shown but not the request. Update the code to show both if debugging is enabled. Use a 'uint' type for size so it matches the register-word size on both 32- and 64-bit machines. Signed-off-by: Simon Glass --- Changes in v4: - Use uint type for size and explain it in the commit

[PATCH v4 01/11] tpm: Don't include cr50 in TPL/SPL

2021-02-06 Thread Simon Glass
At present the security chip is not used in these U-Boot phases. Update the Makefile to exclude it. Fix a few logging statements while we are here. Signed-off-by: Simon Glass Reviewed-by: Ilias Apalodimas --- (no changes since v1) drivers/tpm/Makefile | 2 +- drivers/tpm/cr50_i2c.c | 4

[PATCH v4 00/11] tpm: Support using TPM1 and TPM2 from a single API

2021-02-06 Thread Simon Glass
At present if an application wants to be written so it can work with both TPMv1.2 and TPM2 it must use two different APIs. This is inconvenient since it requires adding code to deal with the mismatch between the two. It would be better to have a common API that all boards could share. This series

Re: [PATCH v4 8/9] fastboot: Allow u-boot-style partitions

2021-02-06 Thread Lukasz Majewski
Hi Sean, > On 2/5/21 9:46 AM, Lukasz Majewski wrote: > > Hi Sean, > > > >> This adds support for partitions of the form "dev.hwpart:part" and > >> "dev#partname". This allows one to flash to eMMC boot partitions > >> without having to use CONFIG_FASTBOOT_MMC_BOOT1_SUPPORT. It also > >>

[PATCH v4 8/9] sandbox: Write out bloblist when exiting

2021-02-06 Thread Simon Glass
Sandbox provides a way to write out its emulated memory on exit. This makes it possible to pass a bloblist from one phase (e.g. SPL) to the next. However the bloblist is not closed off, so the checksum is generally invalid. Fix this by finishing up the bloblist before writing the memory file.

[PATCH v4 7/9] sandbox: Avoid using malloc() for system state

2021-02-06 Thread Simon Glass
This state is not accessible to the running U-Boot but at present it is allocated in the emulated SDRAM. This doesn't seem very useful. Adjust it to allocate from the OS instead. The RAM buffer is currently not freed, but should be, so add that into state_uninit(). Update the comment for

[PATCH v4 9/9] bootm: Fix duplicate debugging in bootm_process_cmdline()

2021-02-06 Thread Simon Glass
These two returns use the same string so are not distinguishable with LOG_ERROR_RETURN. Fix it. Signed-off-by: Simon Glass --- (no changes since v1) common/bootm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/bootm.c b/common/bootm.c index

[PATCH v4 5/9] s5p4418_nanopi2: Drop dead code

2021-02-06 Thread Simon Glass
This code is still using the old command typedef. It was not noticed since this file is not currently built. It is using a non-existent option in the Makefile. Drop this file since it is not needed for correct operation. Signed-off-by: Simon Glass --- (no changes since v2) Changes in v2: -

[PATCH v4 6/9] sandbox: Add os_realloc()

2021-02-06 Thread Simon Glass
We provide os_malloc() and os_free() but not os_realloc(). Add this, following the usual semantics. Also update os_malloc() to behave correctly when passed a zero size. Signed-off-by: Simon Glass Reviewed-by: Heinrich Schuchardt --- (no changes since v3) Changes in v3: - Add comments as to

[PATCH v4 3/9] doc: describe the md command

2021-02-06 Thread Simon Glass
Provide a man-page for the md command. Signed-off-by: Simon Glass --- (no changes since v3) Changes in v3: - Add new patch to describe the md command doc/Makefile| 1 - doc/usage/index.rst | 1 + doc/usage/md.rst| 96 + 3 files

[PATCH v4 2/9] binman: Indicate how to make binman verbose

2021-02-06 Thread Simon Glass
Add notes about how to make binman produce verbose logging when building. Add a comment on how to do this. Signed-off-by: Simon Glass --- (no changes since v1) Makefile| 1 + tools/binman/README | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile

[PATCH v4 4/9] doc: Add a note about producing 'md.b' output using hexdump

2021-02-06 Thread Simon Glass
Comparing a hex dump on the U-Boot command line with the contents of a file on the host system is fairly easy and convenient to do manually if it is small. But the format used hexdump by default differs from that shown by U-Boot. Add a note about how to make them the same. (For large dumps,

[PATCH v4 1/9] spl: Drop duplicate 'Jumping to U-Boot' message

2021-02-06 Thread Simon Glass
This is printed twice but we only need one message, since there is very little processing in between them. Drop the second one, since all branches of the switch() already have output. Update the U-Boot message to include the phase being jumped to. Signed-off-by: Simon Glass --- (no changes

[PATCH v4 0/9] Various minor fixes

2021-02-06 Thread Simon Glass
This series collects a few minor fixes and improvements that have been hanging around in a branch for a while. Changes in v4: - Indicate that hd does not show the offset correctly - Add an xxd + sed example too - Fix 'existing' typo Changes in v3: - Show phase only for IH_OS_U_BOOT, drop the

Re: [RESEND PATCH 12/16] arm: omap3: Compile lowlevel_init() function only when it is used

2021-02-06 Thread Marek Vasut
On 2/6/21 4:45 PM, Pali Rohár wrote: On Saturday 06 February 2021 16:40:18 Marek Vasut wrote: On 2/5/21 8:12 PM, Pali Rohár wrote: Function lowlevel_init() is called only from cpu_init_crit() and this function is wrapped into #if .. #endif section. So compile also lowlevel_init() function

Re: [PATCH v5 2/4] button: add a simple Analog to Digital Converter device based button driver

2021-02-06 Thread Simon Glass
Hi Marek, On Thu, 4 Feb 2021 at 03:36, Marek Szyprowski wrote: > > Hi Simon, > > On 01.02.2021 21:38, Simon Glass wrote: > > On Tue, 26 Jan 2021 at 06:03, Heinrich Schuchardt > > wrote: > >> On 26.01.21 12:25, Marek Szyprowski wrote: > >>> On 26.01.2021 12:10, Heinrich Schuchardt wrote: >

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

2021-02-06 Thread Simon Glass
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 options: - two pins provided in a ternary arrangement, for 9 combinations. - reading from the EC Add a binding doc and drop the unused

[PATCH v4 1/2] sysinfo: Allow showing model info from sysinfo

2021-02-06 Thread Simon Glass
Some boards may want to show the SKU ID or other information obtained at runtime. Allow this to come from sysinfo. The board can then provide a sysinfo driver to provide it. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v3) Changes in v3: - Rebase to master

[PATCH v4 0/2] x86: Minor improvements mostly for image loading

2021-02-06 Thread Simon Glass
This series provides a few improvements for loading of images. It also provides a way to show more detailed model information as well as an of-platdata fix noticed recently. Note that this series depends on the GPIO series here: http://patchwork.ozlabs.org/project/uboot/list/?series=226118

Re: [PATCH v2 3/3] fs: fat: remove trailing periods from long name

2021-02-06 Thread Simon Glass
On Thu, 4 Feb 2021 at 00:40, Heinrich Schuchardt wrote: > > The FAT32 File System Specification [1] requires leading and trailing > spaces as well as trailing periods of long names to be ignored. > > [1] > Microsoft Extensible Firmware Initiative > FAT32 File System Specification >

Re: [PATCH v2 2/3] fs: fat: must not write directory '.' and '..'

2021-02-06 Thread Simon Glass
On Thu, 4 Feb 2021 at 00:40, Heinrich Schuchardt wrote: > > Directories or files called '.' or '..' cannot be created or written to > in any directory. Move the test to normalize_longname() to check this > early. > > Signed-off-by: Heinrich Schuchardt > --- > v2: > check for file length

Re: [PATCH v3 0/2] x86: Minor improvements mostly for image loading

2021-02-06 Thread Simon Glass
Hi Bin, On Sat, 6 Feb 2021 at 04:24, Bin Meng wrote: > > Hi Simon, > > On Fri, Feb 5, 2021 at 12:18 PM Simon Glass wrote: > > > > This series provides a few improvements for loading of images. It also > > provides a way to show more detailed model information as well as an > > of-platdata fix

Re: [RESEND PATCH 12/16] arm: omap3: Compile lowlevel_init() function only when it is used

2021-02-06 Thread Pali Rohár
On Saturday 06 February 2021 16:40:18 Marek Vasut wrote: > On 2/5/21 8:12 PM, Pali Rohár wrote: > > Function lowlevel_init() is called only from cpu_init_crit() and this > > function is wrapped into #if .. #endif section. So compile also > > lowlevel_init() function under same #if condition. > >

Re: [RESEND PATCH 12/16] arm: omap3: Compile lowlevel_init() function only when it is used

2021-02-06 Thread Marek Vasut
On 2/5/21 8:12 PM, Pali Rohár wrote: Function lowlevel_init() is called only from cpu_init_crit() and this function is wrapped into #if .. #endif section. So compile also lowlevel_init() function under same #if condition. Signed-off-by: Pali Rohár ---

Re: [RESEND PATCH 16/16] Nokia RX-51: Enable usbtty serial console by default

2021-02-06 Thread Lukasz Majewski
On Fri, 5 Feb 2021 20:12:12 +0100 Pali Rohár wrote: > Now when usbtty serial console is fixed in U-Boot enable > CONFIG_USB_TTY for Nokia RX-51 board by default. > > Fix also USB product id as U-Boot ignores CONFIG_USBD_PRODUCTID macro > and include U-Boot string into USB product name to

Re: [RESEND PATCH 15/16] Nokia RX-51: Move content of rx51.h to rx51.c

2021-02-06 Thread Lukasz Majewski
On Fri, 5 Feb 2021 20:12:11 +0100 Pali Rohár wrote: > After removal of MUX configuration there is no need to have extra > rx51.h. > > Signed-off-by: Pali Rohár > --- > board/nokia/rx51/rx51.c | 17 - > board/nokia/rx51/rx51.h | 31 --- > 2 files

Re: [RESEND PATCH 14/16] Nokia RX-51: Remove function set_muxconf_regs()

2021-02-06 Thread Lukasz Majewski
On Fri, 5 Feb 2021 20:12:10 +0100 Pali Rohár wrote: > This function is not used and was never called. > > This board contains '#define CONFIG_SKIP_LOWLEVEL_INIT' because > X-Loader set everything up, including MUX configuration. > > Also this MUX configuration is incorrect and does not match

Re: [RESEND PATCH 13/16] arm: omap3: Compile s_init() function only when it is used

2021-02-06 Thread Lukasz Majewski
On Fri, 5 Feb 2021 20:12:09 +0100 Pali Rohár wrote: > Function s_init() is called only from lowlevel_init(). So compile it > only when function lowlevel_init() is compiled. > Reviewed-by: Lukasz Majewski > Signed-off-by: Pali Rohár > --- > arch/arm/mach-omap2/omap3/board.c | 3 +++ > 1

Re: [RESEND PATCH 12/16] arm: omap3: Compile lowlevel_init() function only when it is used

2021-02-06 Thread Lukasz Majewski
On Fri, 5 Feb 2021 20:12:08 +0100 Pali Rohár wrote: > Function lowlevel_init() is called only from cpu_init_crit() and this > function is wrapped into #if .. #endif section. So compile also > lowlevel_init() function under same #if condition. > > Signed-off-by: Pali Rohár > --- >

Re: [RESEND PATCH 11/16] usb: gadget: Use dbg_ep0() macro instead of serial_printf()

2021-02-06 Thread Lukasz Majewski
On Fri, 5 Feb 2021 20:12:07 +0100 Pali Rohár wrote: > All debug messages from ep0.c except a few are printed by dbg_ep0() > macro. So for remaining few exception use also dbg_ep0() instead of > serial_printf(). Reviewed-by: Lukasz Majewski > > Signed-off-by: Pali Rohár > --- >

Re: [RESEND PATCH 10/16] usb: musb: Ensure that we set musb dynamic FIFO buffer for every endpoint

2021-02-06 Thread Lukasz Majewski
On Fri, 5 Feb 2021 20:12:06 +0100 Pali Rohár wrote: > If we do not set FIFO buffer address and size for some endpoint which > is in use then default address 0x0 would be used which is in conflict > with FIFO buffer for endpoint 0 which is at fixed address 0x0. > Sharing address space between

Re: [RESEND PATCH 09/16] usb: musb: Fix handling interrupts for EP0 and SET ADDRESS commmand

2021-02-06 Thread Lukasz Majewski
On Fri, 5 Feb 2021 20:12:05 +0100 Pali Rohár wrote: > Interrupt for EP0 is indicated in intrtx register via first bit. It > is set for both RX and TX. First bit in intrrx register is reserved > and not set. > > So remove calling musb_peri_ep0() function at every iteration of > udc_irq() and

Re: [RESEND PATCH 08/16] usb: musb: Fix receiving of bigger buffers

2021-02-06 Thread Lukasz Majewski
On Fri, 5 Feb 2021 20:12:04 +0100 Pali Rohár wrote: > If musb_peri_rx_ep() was called to processed received HW buffer but > U-Boot cannot read it yet (e.g. because U-Boot SW buffer is full) > then interrupt was marked as processed but HW buffer stayed > unprocessed. > > U-Boot tried to process

Re: [RESEND PATCH 07/16] usb: musb: Fix transmission of bigger buffers

2021-02-06 Thread Lukasz Majewski
On Fri, 5 Feb 2021 20:12:03 +0100 Pali Rohár wrote: > If udc_endpoint_write() was called with bigger payload which does not > fit into one USB packet it needs to be transmitted in more USB > packets. First packet is transmitted by udc_endpoint_write() call > itself and other packets are put

Re: [RESEND PATCH 06/16] usb: musb: Read value of PERI_RXCSR to 16bit variable

2021-02-06 Thread Lukasz Majewski
On Fri, 5 Feb 2021 20:12:02 +0100 Pali Rohár wrote: > PERI_RXCSR is 16bit register so store its value into 16bit local > variable. > > Signed-off-by: Pali Rohár > --- > drivers/usb/musb/musb_udc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git

Re: [RESEND PATCH 05/16] usb: musb: Fix configuring FIFO for endpoints

2021-02-06 Thread Lukasz Majewski
On Fri, 5 Feb 2021 20:12:01 +0100 Pali Rohár wrote: > This patch fixes configuring FIFO for one-directional endpoints which > have either RX or TX queue and therefore only one FIFO. > > Size of FIFO buffer is 2^(idx+3) bytes and starting address is > 2^(addr+3). Moreover first 64 bytes are

Re: [RESEND PATCH 04/16] usb: musb: Always clear the data toggle bit when configuring ep

2021-02-06 Thread Lukasz Majewski
On Fri, 5 Feb 2021 20:12:00 +0100 Pali Rohár wrote: > Without this patch it was done only when U-Boot was compiled with > MUSB Host Controller. But it is needed also for MUSB Device > Controller, otherwise Device Controller does not work. > Reviewed-by: Lukasz Majewski > Signed-off-by: Pali

Re: [RESEND PATCH 03/16] usb: musb: Fix compilation of gadget code

2021-02-06 Thread Lukasz Majewski
On Fri, 5 Feb 2021 20:11:59 +0100 Pali Rohár wrote: > musb udc code depends on usb gadget code provided by > CONFIG_USB_DEVICE and defined in drivers/usb/gadget/Makefile. But > this Makefile is not included into U-Boot build when > CONFIG_USB_GADGET is not set. As CONFIG_USB_DEVICE cannot be

Re: [RESEND PATCH 02/16] serial: usbtty: Send urb data in correct order

2021-02-06 Thread Lukasz Majewski
On Fri, 5 Feb 2021 20:11:58 +0100 Pali Rohár wrote: > Function next_urb() selects the last urb data buffer from linked list > to which next data from usbtty puts should be appended. > > But to check if TX data still exists it is needed to look at the > first urb data buffer from linked list.

Re: [RESEND PATCH 01/16] serial: usbtty: Fix puts function

2021-02-06 Thread Lukasz Majewski
On Fri, 5 Feb 2021 20:11:57 +0100 Pali Rohár wrote: > This function has incorrect implementation of prepending CR prior LF. > Without this patch it prepended CR prior whole string which is going > to be written and let LF without leading CR. Fix this issue by > inserting CR at correct place to

Re: [PATCH v2 0/3] mmc: mmc_spi: Fix potential spec violation in receiving card response

2021-02-06 Thread Bin Meng
On Tue, Feb 2, 2021 at 10:48 AM Bin Meng wrote: > > > After command is sent and before card response shows up on the line, > there is a variable number of clock cycles in between called Ncr. > The spec [1] says the minimum is 1 byte and the maximum is 8 bytes. > > Current logic in

  1   2   >