[PATCH v4 13/22] sandbox: Add a DSA sandbox driver and unit test

2021-03-14 Thread Bin Meng
From: Claudiu Manoil The DSA sandbox driver is used for unit testing the DSA class code. It implements a simple 2 port switch plus 1 CPU port, and uses a very simple tag to identify the ports. The DSA sandbox device is connected via CPU port to a regular Ethernet sandbox device, called

[PATCH v4 12/22] net: tsec: Use dm_eth_phy_connect() directly for the DM case

2021-03-14 Thread Bin Meng
From: Vladimir Oltean Now that the fixed phy driver has been fully adapted to OF APIs, and dm_eth_phy_connect() already can handle the fixed phy, call dm_eth_phy_connect() directly in the DM tsec driver. Signed-off-by: Vladimir Oltean Reviewed-by: Bin Meng Tested-by: Bin Meng Message-Id:

[PATCH v4 11/22] net: phy: fixed: Support the old DT binding

2021-03-14 Thread Bin Meng
Update fixedphy_probe() to support the old DT binding. Signed-off-by: Bin Meng Reviewed-by: Ramon Fried Reviewed-by: Vladimir Oltean --- (no changes since v3) Changes in v3: - sort variable definitions by line length drivers/net/phy/fixed.c | 26 +++--- 1 file changed,

[PATCH v4 10/22] net: phy: fixed: Add the missing ending newline

2021-03-14 Thread Bin Meng
The printf statement doesn't end with a newline. Add it. Signed-off-by: Bin Meng Reviewed-by: Ramon Fried Reviewed-by: Vladimir Oltean --- (no changes since v1) drivers/net/phy/fixed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/phy/fixed.c

[PATCH v4 14/22] test: dm: Add a case to test ofnode_phy_is_fixed_link()

2021-03-14 Thread Bin Meng
This adds a test case to test the new ofnode_phy_is_fixed_link() API. Both the new and old DT bindings are covered. Signed-off-by: Bin Meng Reviewed-by: Simon Glass Reviewed-by: Vladimir Oltean --- (no changes since v3) Changes in v3: - reuse the sandbox dsa nodes for the fixed-link testing

[PATCH v4 00/22] ppc: qemu: Add eTSEC support

2021-03-14 Thread Bin Meng
QEMU ppce500 machine can dynamically instantiate an eTSEC device if "-device eTSEC" is given to QEMU. This series updates the fixed-link ethernet PHY driver as well as the Freescale eTSEC driver to support the QEMU ppce500 board. 3 patches related to fixed phy in v1 are dropped in v2 as the

[PATCH v4 01/22] dt-bindings: net: Add the old DT bindings for "fixed-link"

2021-03-14 Thread Bin Meng
Per the upstream Linux kernel doc: Documentation/devicetree/bindings/net/ethernet-controller.yaml There are two ways to describe a fixed PHY attached to an Ethernet device. This updates our dt-bindings doc to add the old DT bindings. Signed-off-by: Bin Meng Reviewed-by: Ramon Fried

[PATCH 1/6 v3] efi_selftest: Remove loadfile2 for initrd selftests

2021-03-14 Thread Ilias Apalodimas
We are redefining how u-boot locates the initrd to load via the kernel LoadFile2 protocol. This selftest is not relevant any more, so remove it. A new one will be added later Signed-off-by: Ilias Apalodimas Reviewed-by: Heinrich Schuchardt --- lib/efi_selftest/Makefile | 1

[PATCH 0/6 v3] Loadfile2 for initrd loading

2021-03-14 Thread Ilias Apalodimas
Hi! This is v2 of [1] Changes since v2: - Lengths checks when interpreting a device path, to make sure we aren't going out of bounds - renamed efi_get_file_size -> efi_file size and moved it itn efi_file.c - Fix uninitialized variable related errors reported by Cppcheck - Fixed various

[PATCH] efi_loader: fix memory type for memory reservation block

2021-03-14 Thread Mark Kettenis
The devicetree specification clearly states that: As with the /reserved-memory node, when booting via UEFI entries in the Memory Reservation Block must also be listed in the system memory map obtained via the GetMemoryMap() toi protect against allocations by UEFI applications. The memory

Re: [PATCH] efi_loader: fix memory type for memory reservation block

2021-03-14 Thread Peter Robinson
On Sun, Mar 14, 2021 at 7:04 PM Mark Kettenis wrote: > > The devicetree specification clearly states that: > > As with the /reserved-memory node, when booting via UEFI > entries in the Memory Reservation Block must also be listed > in the system memory map obtained via the GetMemoryMap()

[PATCH v4 19/22] test: dm: Add a test case for simple-bus

2021-03-14 Thread Bin Meng
This adds a test case to verify reading of a simple-bus is working as expected. Signed-off-by: Bin Meng Reviewed-by: Simon Glass --- (no changes since v2) Changes in v2: - default y if SANDBOX for CONFIG_SIMPLE_BUS_CORRECT_RANGE drivers/core/Kconfig | 1 + test/dm/Makefile | 1 +

[PATCH v4 20/22] ppc: qemu: Create a virtual memory mapping of the platform bus

2021-03-14 Thread Bin Meng
QEMU ppce500 target can dynamically instantiate an eTSEC device on a platform bus if "-device eTSEC" is given to QEMU. It is presented as a "simple-bus" in the device tree, with an additional compatible string "qemu,platform". Let's create a virtual memory mapping for it in misc_init_r(), in

[PATCH v4 17/22] net: tsec: Support property from the subnode "queue-group"

2021-03-14 Thread Bin Meng
At present the tsec driver uses a non-standard DT bindings to get its base / size. The upstream Linux kernel seems to require the base / size to be put under a subnode of the eTSEC node with a name prefix "queue-group". This is not documented in the kernel DT bindings, but it looks every dtsi

[PATCH v4 16/22] dt-bindings: net: Update Freescale TSEC to support "queue-group"

2021-03-14 Thread Bin Meng
At present the Freescale TSEC node DT bindings doc requires a property in the TSEC node. But this might not always be the case. In the upstream Linux kernel, there is no DT bindings doc for it but the kernel driver tests a subnode of a name prefixed with "queue-group", as we can see from

[PATCH v4 18/22] dm: core: Correctly read of simple-bus

2021-03-14 Thread Bin Meng
At present we decode simple bus using the following assumption: - parent #address-cells 1 - child #address-cells 1 - child #size-cells 1 However this might not always be the case. Update to use fdt_addr_t and fdt_size_t in 'struct simple_bus_plat', and use fdt_read_ranges() to correctly decode

[PATCH v4 15/22] net: tsec: Use map_physmem() directly instead of dev_remap_addr()

2021-03-14 Thread Bin Meng
dev_remap_addr() eventually calls dev_read_addr_index(), while pdata->iobase holds the return value of dev_read_addr() that calls dev_read_addr_index() too. Such duplication can be avoided by using map_physmem() directly. Signed-off-by: Bin Meng Reviewed-by: Vladimir Oltean --- (no changes

Re: [PATCH 1/1] efi_selftest: illegal cast to pointer in initrddump

2021-03-14 Thread Ilias Apalodimas
On Sun, Mar 14, 2021 at 10:19:39AM +0100, Heinrich Schuchardt wrote: > On 32bit systems u64 cannot directly be cast to void *. > > Signed-off-by: Heinrich Schuchardt > --- > lib/efi_selftest/initrddump.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git

Re: [PATCH 1/2] net: jr2: Reset switch

2021-03-14 Thread Ramon Fried
On Wed, Mar 10, 2021 at 10:33 AM Horatiu Vultur wrote: > > Make sure to reset the switch core at probe time. > > Signed-off-by: Horatiu Vultur > --- > arch/mips/dts/mscc,jr2.dtsi | 6 -- > drivers/net/mscc_eswitch/jr2_switch.c | 16 +++- > 2 files changed, 19

Re: [PATCH 2/2] net: jr2: Fix Serdes6G configuration

2021-03-14 Thread Ramon Fried
On Wed, Mar 10, 2021 at 10:33 AM Horatiu Vultur wrote: > > Sometimes no traffic was getting out on the ports, the root cause was > a wrong configuration of the Serdes6G, which is used on jr2 pcb111. > This patch fixes this issue by applying the correct configuration. > > Fixes: 5e1d417bec92ac

Re: [PATCH 7/7] drivers: net: macb: add fu740 support

2021-03-14 Thread Ramon Fried
On Thu, Mar 11, 2021 at 3:36 PM Green Wan wrote: > > Add fu740 support to macb ethernet driver > > Signed-off-by: Green Wan > --- > drivers/net/macb.c | 8 +++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/macb.c b/drivers/net/macb.c > index 57ea45e..df65d82

Re: [PATCH v2 6/6] log: Convert log values to printf() if not enabled

2021-03-14 Thread Tom Rini
On Wed, Jan 20, 2021 at 08:10:57PM -0700, Simon Glass wrote: > At present if logging not enabled, log_info() becomes a nop. But we want > log output at the 'info' level to be akin to printf(). Update the macro to > pass the output straight to printf() in this case. > > This mimics the behaviour

Re: [PATCH v2 6/6] log: Convert log values to printf() if not enabled

2021-03-14 Thread Simon Glass
Hi Tom, On Sun, 14 Mar 2021 at 12:33, Tom Rini wrote: > > On Wed, Jan 20, 2021 at 08:10:57PM -0700, Simon Glass wrote: > > > At present if logging not enabled, log_info() becomes a nop. But we want > > log output at the 'info' level to be akin to printf(). Update the macro to > > pass the output

[PATCH 3/6 v3] efi_loader: Add helper functions for EFI

2021-03-14 Thread Ilias Apalodimas
A following patch introduces a different logic for loading initrd's based on the EFI_LOAD_FILE2_PROTOCOL. Since similar logic can be applied in the future for other system files (i.e DTBs), let's add some helper functions which will retrieve and parse file paths stored in EFI variables.

[PATCH 4/6 v3] efi_loader: Replace config option for initrd loading

2021-03-14 Thread Ilias Apalodimas
Up to now we install EFI_LOAD_FILE2_PROTOCOL to load an initrd unconditionally. Although we correctly return various EFI exit codes depending on the file status (i.e EFI_NO_MEDIA, EFI_NOT_FOUND etc), the kernel loader, only falls back to the cmdline interpreted initrd if the protocol is not

[PATCH 5/6 v3] efidebug: add multiple device path instances on Boot####

2021-03-14 Thread Ilias Apalodimas
The UEFI spec allows a packed array of UEFI device paths in the FilePathList[] of an EFI_LOAD_OPTION. The first file path must describe the loaded image but the rest are OS specific. Previous patches parse the device path and try to use the second member of the array as an initrd. So let's modify

[PATCH 6/6 v3] doc: Update uefi documentation for initrd loading options

2021-03-14 Thread Ilias Apalodimas
Document the command line options for efidebug and initrd loading Signed-off-by: Ilias Apalodimas --- doc/uefi/uefi.rst | 22 +- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/doc/uefi/uefi.rst b/doc/uefi/uefi.rst index b3494c22e073..d92a32016ec0 100644 ---

[PATCH 2/6 v3] efi_loader: Add device path related functions for initrd via Boot####

2021-03-14 Thread Ilias Apalodimas
On the following patches we allow for an initrd path to be stored in Boot variables. Specifically we encode in the FIlePathList[] of the EFI_LOAD_OPTIONS for each Boot variable. The FilePathList[] array looks like this: kernel - 0xff - VenMedia(initrd GUID) - initrd1 - 0x01 initrd2 -

[PATCH v4 02/22] of: extra: Introduce ofnode_phy_is_fixed_link() API

2021-03-14 Thread Bin Meng
Introduce a helper API ofnode_phy_is_fixed_link() to detect whether the ethernet controller connects to a fixed-link pseudo-PHY device. Note there are two ways to describe a fixed PHY attached to an Ethernet device: - the new DT binding, where 'fixed-link' is a sub-node of the Ethernet device

[PATCH v4 03/22] dm: mdio: Use ofnode_phy_is_fixed_link() API

2021-03-14 Thread Bin Meng
Switch to use the ofnode_phy_is_fixed_link() API which can support both the new and old DT bindings. Signed-off-by: Bin Meng Reviewed-by: Ramon Fried Reviewed-by: Vladimir Oltean --- (no changes since v1) net/mdio-uclass.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH v4 06/22] net: phy: xilinx: Be compatible with live OF tree

2021-03-14 Thread Bin Meng
Following the same updates that were done to the fixed phy driver, use ofnode_ APIs instead of fdt_ APIs so that the Xilinx PHY driver can support live DT. Signed-off-by: Bin Meng --- (no changes since v2) Changes in v2: - move device tree parsing from xilinxgmiitorgmii_probe() to

[PATCH v4 08/22] net: phy: Simplify the logic of phy_connect_fixed()

2021-03-14 Thread Bin Meng
Simplify the logic of phy_connect_fixed() by using the new API ofnode_phy_is_fixed_link(), which brings additional bonus of supporting the old DT bindings. Signed-off-by: Bin Meng Reviewed-by: Ramon Fried Reviewed-by: Vladimir Oltean --- (no changes since v1) drivers/net/phy/phy.c | 16

[PATCH v4 04/22] net: phy: fixed: Be compatible with live OF tree

2021-03-14 Thread Bin Meng
From: Vladimir Oltean On systems that use CONFIG_OF_LIVE, the "ofnode" type is defined as const struct device_node *np, while on the flat DT systems it is defined as a long of_offset into gd->fdt_blob. It is desirable that the fixed PHY driver uses the higher-level ofnode abstraction instead of

[PATCH v4 07/22] net: phy: xilinx: Drop #ifdef CONFIG_DM_ETH around phy_connect_gmii2rgmii()

2021-03-14 Thread Bin Meng
At present phy_connect_gmii2rgmii() is implemented using a DM API dev_of_offset() hence it cannot support a non-DM configuration. Remove the non-DM version prototype of phy_connect_gmii2rgmii() and make the driver depend on CONFIG_DM_ETH. Signed-off-by: Bin Meng Acked-by: Michal Simek

[PATCH v4 09/22] net: phy: fixed: Make driver ops static

2021-03-14 Thread Bin Meng
The PHY driver ops should be made static. Signed-off-by: Bin Meng Reviewed-by: Ramon Fried Reviewed-by: Vladimir Oltean --- (no changes since v1) drivers/net/phy/fixed.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/phy/fixed.c

[PATCH v4 05/22] net: phy: fixed: Drop #ifdef CONFIG_DM_ETH around phy_connect_fixed

2021-03-14 Thread Bin Meng
From: Vladimir Oltean In drivers/net/phy/Kconfig, CONFIG_PHY_FIXED already depends on CONFIG_DM_ETH, so the function prototype definition when CONFIG_DM_ETH=n does nothing, so it can be dropped. It is also never reachable, since the whole function is already under #ifdef CONFIG_PHY_FIXED (which

Re: [PATCH] net: gem: Fix setting PCS auto-negotiation state

2021-03-14 Thread Ramon Fried
On Fri, Mar 12, 2021 at 12:56 AM Robert Hancock wrote: > > The code was trying to disable PCS auto-negotiation when a fixed-link node > is present and enable it otherwise. However, the PCS registers were being > written before the PCSSEL bit was set in the network configuration > register, and it

Re: [PATCH v6 2/4] test: qemu: add qfw sandbox driver, dm tests, qemu tests

2021-03-14 Thread Tom Rini
On Sun, Mar 07, 2021 at 02:59:57PM +1100, Asherah Connor wrote: > A sandbox driver and test are added for the qfw uclass, and a test in > QEMU added for qfw functionality to confirm it doesn't break in real > WORld use. > > Signed-off-by: Asherah Connor > Reviewed-by: Simon Glass A small

[PATCH v4 22/22] doc: board: qemu-ppce500: Document eTSEC usage

2021-03-14 Thread Bin Meng
Document how to launch a QEMU session with eTSEC as a network device. Signed-off-by: Bin Meng Reviewed-by: Vladimir Oltean --- (no changes since v1) doc/board/emulation/qemu-ppce500.rst | 5 + 1 file changed, 5 insertions(+) diff --git a/doc/board/emulation/qemu-ppce500.rst

[PATCH v4 21/22] ppc: qemu: Enable eTSEC support

2021-03-14 Thread Bin Meng
QEMU ppce500 target can dynamically instantiate an eTSEC device if "-device eTSEC" is given to QEMU. This commit enables eTSEC driver and the required fixed PHY driver to create a usable network configuration using eTSEC. Unlike a real world 85xx board that usually stores the eTSEC MAC address in

Re: [PATCH 5/6 v2] efidebug: add multiple device path instances on Boot####

2021-03-14 Thread Heinrich Schuchardt
On 3/14/21 10:27 AM, Heinrich Schuchardt wrote: On 3/13/21 10:47 PM, Ilias Apalodimas wrote: The UEFI spec allow a packed array of UEFI device paths in the %s/allow/allows/ FilePathList[] of an EFI_LOAD_OPTION. The first file path must describe the loaded image but the rest are OS specific.

Re: [PATCH 5/6 v2] efidebug: add multiple device path instances on Boot####

2021-03-14 Thread Ilias Apalodimas
On Sun, Mar 14, 2021 at 10:42:06AM +0100, Heinrich Schuchardt wrote: > On 3/14/21 10:27 AM, Heinrich Schuchardt wrote: > > On 3/13/21 10:47 PM, Ilias Apalodimas wrote: > > > The UEFI spec allow a packed array of UEFI device paths in the > > > > %s/allow/allows/ > > > > > FilePathList[] of an

Re: [PATCH 4/6 v2] efi_loader: Replace config option for initrd loading

2021-03-14 Thread Heinrich Schuchardt
On 3/13/21 10:47 PM, Ilias Apalodimas wrote: Up to now we install EFI_LOAD_FILE2_PROTOCOL to load an initrd unconditionally. Although we correctly return various EFI exit codes depending on the file status (i.e EFI_NO_MEDIA, EFI_NOT_FOUND etc), the kernel loader, only falls back to the cmdline

Re: [PATCH 4/6 v2] efi_loader: Replace config option for initrd loading

2021-03-14 Thread Heinrich Schuchardt
On 3/13/21 10:47 PM, Ilias Apalodimas wrote: Up to now we install EFI_LOAD_FILE2_PROTOCOL to load an initrd unconditionally. Although we correctly return various EFI exit codes depending on the file status (i.e EFI_NO_MEDIA, EFI_NOT_FOUND etc), the kernel loader, only falls back to the cmdline

Re: [PATCH 5/6 v2] efidebug: add multiple device path instances on Boot####

2021-03-14 Thread Heinrich Schuchardt
On 3/13/21 10:47 PM, Ilias Apalodimas wrote: The UEFI spec allow a packed array of UEFI device paths in the FilePathList[] of an EFI_LOAD_OPTION. The first file path must describe the loaded image but the rest are OS specific. Previous patches parse the device path and try to use the second

Re: [PATCH 4/6 v2] efi_loader: Replace config option for initrd loading

2021-03-14 Thread Heinrich Schuchardt
On 3/13/21 10:47 PM, Ilias Apalodimas wrote: Up to now we install EFI_LOAD_FILE2_PROTOCOL to load an initrd unconditionally. Although we correctly return various EFI exit codes depending on the file status (i.e EFI_NO_MEDIA, EFI_NOT_FOUND etc), the kernel loader, only falls back to the cmdline

Re: [PATCH v8 03/28] bus: ti: add minimal sysc interconnect target driver

2021-03-14 Thread Simon Glass
Hi Dario, On Wed, 30 Dec 2020 at 12:08, Dario Binacchi wrote: > > We can handle the sysc interconnect target module in a generic way for > many TI SoCs. Initially let's just enable domain clocks before the > children are probed. > > The code is loosely based on the drivers/bus/ti-sysc.c of the

[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.

[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

[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

[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 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

[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 00/42] dm: Implement OF_PLATDATA_INST in driver model (part E)

2021-03-14 Thread Simon Glass
This series builds on the recent dtoc implementation of build-time device instantiation. It adds the required driver model support, which is basically a few more data structures. With this, sandbox_spl and chromebook_coral both use the new feature. For coral TPL there is a 1.5KB code-size

[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 |

[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 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

[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 ++

[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 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

[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 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 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

[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 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 ---

[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 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

[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 +++

[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

[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 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

[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

[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

[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

[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

[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

[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 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 +++

[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 ---

[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 ---

[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 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

[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 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 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 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

[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

[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)

[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 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

[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 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

[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

[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

[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

[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

[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

[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

[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 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

  1   2   >