platform/kernel/u-boot.git
4 years agonet: Drop dm.h header file in eth_phy.h
Simon Glass [Sun, 19 Jul 2020 16:15:57 +0000 (10:15 -0600)]
net: Drop dm.h header file in eth_phy.h

This header file should not be included in other header files. Remove it
and use a forward declaration instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agoclk: Drop dm.h header file in clk-provider.h
Simon Glass [Sun, 19 Jul 2020 16:15:56 +0000 (10:15 -0600)]
clk: Drop dm.h header file in clk-provider.h

This header file should not be included in other header files. Remove it
and use a forward declaration and un-inlining of dev_get_clk_ptr()
instead.

Fix up the kendryte header files to avoid build errors.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
4 years agousb: Drop dm.h header file
Simon Glass [Sun, 19 Jul 2020 16:15:55 +0000 (10:15 -0600)]
usb: Drop dm.h header file

This header file should not be included in other header files. Remove it
and use a forward declaration instead.

Also move the inline function out into a C file. We should not include C
code in headers.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agoufs: Drop dm.h header file
Simon Glass [Sun, 19 Jul 2020 16:15:54 +0000 (10:15 -0600)]
ufs: Drop dm.h header file

This header file should not be included in other header files. Remove it
and use a forward declaration instead.

Also drop asm/io.h

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agonand: Drop dm.h header file
Simon Glass [Sun, 19 Jul 2020 16:15:53 +0000 (10:15 -0600)]
nand: Drop dm.h header file

This header file should not be included in other header files. Remove it
and use a forward declaration instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agoadc: Drop dm.h header file
Simon Glass [Sun, 19 Jul 2020 16:15:52 +0000 (10:15 -0600)]
adc: Drop dm.h header file

This header file should not be included in other header files. Remove it
and use a forward declaration instead.

Drop the common.h inclusion also.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agomscc: Drop dm.h header file
Simon Glass [Sun, 19 Jul 2020 16:15:51 +0000 (10:15 -0600)]
mscc: Drop dm.h header file

This header file should not be included in other header files. Remove it
from each one and use a forward declaration instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agomediatek: Drop dm.h header file
Simon Glass [Sun, 19 Jul 2020 16:15:50 +0000 (10:15 -0600)]
mediatek: Drop dm.h header file

This header file should not be included in other header files. Remove it
and use a forward declaration instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agopci: Drop dm.h inclusion from header file
Simon Glass [Sun, 19 Jul 2020 16:15:49 +0000 (10:15 -0600)]
pci: Drop dm.h inclusion from header file

The layerscape header should not include dm.h so remove it.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agoliebherr: Drop duplicate dm.h inclusion
Simon Glass [Sun, 19 Jul 2020 16:15:48 +0000 (10:15 -0600)]
liebherr: Drop duplicate dm.h inclusion

We only need to include this header once. Drop the duplicate.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agoti: am654: Drop duplicate dm.h inclusion
Simon Glass [Sun, 19 Jul 2020 16:15:47 +0000 (10:15 -0600)]
ti: am654: Drop duplicate dm.h inclusion

We only need to include this header once. Drop the duplicate.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agospi: Drop duplicate dm.h inclusion
Simon Glass [Sun, 19 Jul 2020 16:15:46 +0000 (10:15 -0600)]
spi: Drop duplicate dm.h inclusion

We only need to include this header once. Drop the duplicate.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agommc: Drop duplicate dm.h inclusion
Simon Glass [Sun, 19 Jul 2020 16:15:45 +0000 (10:15 -0600)]
mmc: Drop duplicate dm.h inclusion

We only need to include this header once. Drop the duplicate.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agopower: Tidy up inclusion of regulator_common.h
Simon Glass [Sun, 19 Jul 2020 16:15:44 +0000 (10:15 -0600)]
power: Tidy up inclusion of regulator_common.h

This file should not include common.h and dm.h so remove them. Also move
the inclusion of this file to after the normal includes.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
4 years agoefi: Tidy up header includes
Simon Glass [Sun, 19 Jul 2020 16:15:43 +0000 (10:15 -0600)]
efi: Tidy up header includes

Two files relies on efi_driver.h to include common.h and dm.h which is
incorrect. The former should always be included in a non-host C file and
the latter should be included if driver model is used.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agow1: Drop dm.h header file
Simon Glass [Sun, 19 Jul 2020 16:15:42 +0000 (10:15 -0600)]
w1: Drop dm.h header file

This header file should not be included in other header files. Remove it
and use a forward declaration instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agothermal: Drop dm.h header file
Simon Glass [Sun, 19 Jul 2020 16:15:41 +0000 (10:15 -0600)]
thermal: Drop dm.h header file

This header file should not be included in other header files. Remove it
and use a forward declaration instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agosf: Drop dm.h header file from spi_flash.h
Simon Glass [Sun, 19 Jul 2020 16:15:40 +0000 (10:15 -0600)]
sf: Drop dm.h header file from spi_flash.h

This header file should not be included in other header files. Remove it
and use a forward declaration instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agonet: Drop dm.h header file from phy.h
Simon Glass [Sun, 19 Jul 2020 16:15:39 +0000 (10:15 -0600)]
net: Drop dm.h header file from phy.h

This header file should not be included in other header files. Remove it
and use other headers and C inclusions instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agofs: fs-loader: Drop dm.h header file
Simon Glass [Sun, 19 Jul 2020 16:15:38 +0000 (10:15 -0600)]
fs: fs-loader: Drop dm.h header file

This header file should not be included in other header files. Remove it
and use a forward declaration instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agodm: core: Drop header files from dm/test.h
Simon Glass [Sun, 19 Jul 2020 16:15:37 +0000 (10:15 -0600)]
dm: core: Drop header files from dm/test.h

These header file should not be included in other header files. Remove
them and add to each individual file. Add test/test.h to test/ui.h since
that is a reasonable place.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agodm: core: Drop dm.h header file from dm-demo.h
Simon Glass [Sun, 19 Jul 2020 16:15:36 +0000 (10:15 -0600)]
dm: core: Drop dm.h header file from dm-demo.h

This header file should not be included in other header files. Remove it
and add it to the cmd file instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agomtd: spi: Drop SPI_XFER_MMAP*
Simon Glass [Sun, 19 Jul 2020 16:15:35 +0000 (10:15 -0600)]
mtd: spi: Drop SPI_XFER_MMAP*

These two defines are no-longer supported. Drop them.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agomtd: spi-mem: Drop dm.h header file
Simon Glass [Sun, 19 Jul 2020 16:15:34 +0000 (10:15 -0600)]
mtd: spi-mem: Drop dm.h header file

This header file should not be included in other header files. Remove it
and use a forward declaration instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agowdt: Drop dm.h header file
Simon Glass [Sun, 19 Jul 2020 16:15:33 +0000 (10:15 -0600)]
wdt: Drop dm.h header file

This header file should not be included in other header files. Remove it
and use a forward declaration instead.

Also remove the other headers that are not needed, since the inline code
was removed in a recent commit:

   b4d9452c4 ("watchdog: move initr_watchdog() to wdt-uclass.c")

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agomtd: spi-nor: Tidy up error handling / debug code
Simon Glass [Sun, 19 Jul 2020 16:15:32 +0000 (10:15 -0600)]
mtd: spi-nor: Tidy up error handling / debug code

The -ENODEV error value in spi_nor_read_id() is incorrect since there
clearly is a device - it just cannot be supported. Use -ENOMEDIUM instead
which has the virtue of being less common.

Fix the return value in spi_nor_scan().

Also there are a few printf() statements which should be debug() since
they bloat the code with unused strings at present. Fix those while here.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agospi: Allow separate control of SPI_FLASH_TINY for SPL/TPL
Simon Glass [Sun, 19 Jul 2020 16:15:31 +0000 (10:15 -0600)]
spi: Allow separate control of SPI_FLASH_TINY for SPL/TPL

In some cases SPL needs to be able to erase but TPL just needs to read.
Allow these to have separate settings for SPI_FLASH_TINY.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-x86
Tom Rini [Mon, 3 Aug 2020 14:25:47 +0000 (10:25 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-x86

- ApolloLake: add u64 parameters support for FSP2 bindings
- ApolloLake: add missing parameters to support full configuration of
  the latest FSP MR6 release
- Append appropriate suffixes in various assembly codes

4 years agoMerge tag 'efi-2020-10-rc2' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Mon, 3 Aug 2020 12:01:08 +0000 (08:01 -0400)]
Merge tag 'efi-2020-10-rc2' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi

Pull request for UEFI sub-system for efi-2020-10-rc2

This series comprises error corrections for the UEFI subsystem:

* make the memory size reserved for the U-Boot stack customizable
  and reduce it for the MAIX board
* correct build dependencies for UEFI unit test
* enable read-only UEFI variable are enabled with the TEE backend
* add 10 ms wait to sysreset to fix a problem with unit testing

4 years agox86: call32: Append appropriate suffixes
Andy Shevchenko [Tue, 28 Jul 2020 09:56:26 +0000 (12:56 +0300)]
x86: call32: Append appropriate suffixes

Assembler is not happy:

arch/x86/cpu/call32.S: Assembler messages:
arch/x86/cpu/call32.S:36: Warning: no instruction mnemonic suffix given and no register operands; using default for `retf'

Fix this by adding appropriate suffixes to the assembler commands.

Fixes: 6f92ed8f1abf ("x86: Add a way to call 32-bit code from 64-bit mode")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agox86: sipi_vector: Append appropriate suffixes
Andy Shevchenko [Tue, 28 Jul 2020 09:56:25 +0000 (12:56 +0300)]
x86: sipi_vector: Append appropriate suffixes

Assembler is not happy:

arch/x86/cpu/sipi_vector.S: Assembler messages:
arch/x86/cpu/sipi_vector.S:134: Warning: no instruction mnemonic suffix given and no register operands; using default for `cmp'
arch/x86/cpu/sipi_vector.S:139: Warning: no instruction mnemonic suffix given and no register operands; using default for `bts'
arch/x86/cpu/sipi_vector.S:157: Warning: no instruction mnemonic suffix given and no register operands; using default for `cmp'

Fix this by adding appropriate suffixes to the assembler commands.

Fixes: 45b5a37836d5 ("x86: Add multi-processor init")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agoarch: x86: apl: Update FSP parameters
Bernhard Messerklinger [Wed, 22 Jul 2020 07:29:39 +0000 (09:29 +0200)]
arch: x86: apl: Update FSP parameters

Add missing parameters to support full configuration of the latest FSP
MR6 release.

Signed-off-by: Bernhard Messerklinger <bernhard.messerklinger@br-automation.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agox86: apl: fsp_bindings: Add support for u64 parameters
Bernhard Messerklinger [Wed, 22 Jul 2020 07:29:38 +0000 (09:29 +0200)]
x86: apl: fsp_bindings: Add support for u64 parameters

Add FSP_UINT64 read support as preparation for FSP-M and FSP-S parameter
update.

Signed-off-by: Bernhard Messerklinger <bernhard.messerklinger@br-automation.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agox86: irq: Fix some typos
Wolfgang Wallner [Tue, 21 Jul 2020 11:01:45 +0000 (13:01 +0200)]
x86: irq: Fix some typos

Fix some typos in arch/x86/include/asm/irq.h.

Signed-off-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
4 years agoefi_selftest: block device test requires CONFIG_DOS_PARTITION
Heinrich Schuchardt [Wed, 29 Jul 2020 10:43:41 +0000 (12:43 +0200)]
efi_selftest: block device test requires CONFIG_DOS_PARTITION

Do not execute the block device test if CONFIG_DOS_PARTITION=n.

Imply CONFIG_DOS_PARTITION in Kconfig.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_selftest: SNP test depends on network
Heinrich Schuchardt [Wed, 29 Jul 2020 10:32:49 +0000 (12:32 +0200)]
efi_selftest: SNP test depends on network

If CONFIG_NET=n, testing the simple network protocol makes no sense.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agodm: sysreset: wait after reset message
Heinrich Schuchardt [Wed, 29 Jul 2020 10:13:41 +0000 (12:13 +0200)]
dm: sysreset: wait after reset message

In our Python tests we expect to see the word "resetting". It may be
truncated if we reset before the serial console buffer is transferred.

Wait for 100 ms between the "resetting ..." message and the actual reset
like we do when powering off.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoconfigs: reduce stack size of Sipeed MAIX
Heinrich Schuchardt [Wed, 29 Jul 2020 10:53:05 +0000 (12:53 +0200)]
configs: reduce stack size of Sipeed MAIX

The K210 has only 8 MiB RAM thereof 2 MiB reserved for AI.

Allow only 1 MiB for the stack.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: use CONFIG_STACK_SIZE in the UEFI sub-system
Heinrich Schuchardt [Wed, 29 Jul 2020 10:37:35 +0000 (12:37 +0200)]
efi_loader: use CONFIG_STACK_SIZE in the UEFI sub-system

The Kconfig symbol CONFIG_STACK_SIZE is used both by ARM and Microblaze
with the same meaning. Move it to menu 'General setup' so that we can use
it for all architectures.

Use the value of CONFIG_STACK_SIZE instead of a hard coded 16 MiB value for
reserving memory in the UEFI sub-system.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agox86: rename CONFIG_STACK_SIZE
Heinrich Schuchardt [Wed, 29 Jul 2020 10:31:17 +0000 (12:31 +0200)]
x86: rename CONFIG_STACK_SIZE

Configuration variables should have the same meaning independent of the
architecture. x86 and ARM both use CONFIG_STACK_SIZE:

* x86: U-Boot's runtime stack size during reboot
* ARM: max stack size that can be used by U-Boot

Rename the x86 configuration variable to CONFIG_STACK_SIZE_REBOOT

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: Enable run-time variable support for tee based variables
Ilias Apalodimas [Thu, 23 Jul 2020 12:49:49 +0000 (15:49 +0300)]
efi_loader: Enable run-time variable support for tee based variables

We recently added functions for storing/restoring variables
from a file to a memory backed buffer marked as __efi_runtime_data
commit f1f990a8c958 ("efi_loader: memory buffer for variables")
commit 5f7dcf079de8 ("efi_loader: UEFI variable persistence")

Using the same idea we now can support GetVariable() and GetNextVariable()
on the OP-TEE based variables as well.

So let's re-arrange the code a bit and move the commmon code for
accessing variables out of efi_variable.c. Create common functions for
reading variables from memory that both implementations can use on
run-time. Then just use those functions in the run-time variants of the
OP-TEE based EFI variable implementation and initialize the memory
buffer on ExitBootServices()

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: Trim output buffer size correctly for tee variables
Ilias Apalodimas [Tue, 21 Jul 2020 22:50:37 +0000 (01:50 +0300)]
efi_loader: Trim output buffer size correctly for tee variables

The current code does not trim the output buffer correctly.
In fact it doesn't trim the buffer at all, since it calculates a wrong
value for it, which isn't even applied.
So let's remove the unused temporary size variable and trim the buffer
correctly.
Since we are editing efi_get_next_variable_name_int(), fix an indentation
error along the way.

Fixes: f042e47e8fb43 ("efi_loader: Implement EFI variable handling via OP-TEE")
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Remove superfluous conversion to (u8 *) for memcpy argument.
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoMerge branch '2020-07-31-more-env-updates'
Tom Rini [Fri, 31 Jul 2020 14:13:07 +0000 (10:13 -0400)]
Merge branch '2020-07-31-more-env-updates'

- Fix EFI selftest to not force setting serial# environment (and also
  get the U-Boot prompt dynamically).
- Support for append only environment and other related features.
- Improved ext4 environment support
- Fix the case of fw_setenv being used on flash devices that were not
  already locked.

4 years agofw_setenv: lock the flash only if it was locked before
Ivan Mikhaylov [Fri, 10 Jul 2020 16:54:18 +0000 (19:54 +0300)]
fw_setenv: lock the flash only if it was locked before

With current implementation of fw_setenv, it is always locks u-boot-env
region if lock interface is implemented for such mtd device. You can
not control lock of this region with fw_setenv, there is no option for
it in config or in application itself. Because of this situation may
happen problems like in this thread on xilinx forum:
https://forums.xilinx.com/t5/Embedded-Linux/Flash-be-locked-after-use-fw-setenv-from-user-space
/td-p/1027851

A short summary of that link is: some person has issue with some spi
chip which has lock interface but doesn't locks properly which leads to
lock of whole flash memory on lock of u-boot-env region. As resulted
solution hack was added into spi-nor.c driver for this chip with lock
disablement.

Instead fix this problem by adding logic to fw_setenv only lock the
flash if it was already locked when we attempted to use it.

Signed-off-by: Ivan Mikhaylov <fr0st61te@gmail.com>
4 years agoenv: Add support for explicit write access list
Marek Vasut [Tue, 7 Jul 2020 18:51:39 +0000 (20:51 +0200)]
env: Add support for explicit write access list

This option marks any U-Boot variable which does not have explicit 'w'
writeable flag set as read-only. This way the environment can be locked
down and only variables explicitly configured to be writeable can ever
be changed by either 'env import', 'env set' or loading user environment
from environment storage.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agoenv: Add option to only ever append environment
Marek Vasut [Tue, 7 Jul 2020 18:51:38 +0000 (20:51 +0200)]
env: Add option to only ever append environment

Add configuration option which prevents the environment hash table to be
ever cleared and reloaded with different content. This is useful in case
the first environment loaded into the hash table contains e.g. sensitive
content which must not be dropped or reloaded.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agoenv: Discern environment coming from external storage
Marek Vasut [Tue, 7 Jul 2020 18:51:35 +0000 (20:51 +0200)]
env: Discern environment coming from external storage

Add another custom environment flag which discerns environment coming
from external storage from environment set by U-Boot itself.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agoenv: Add H_DEFAULT flag
Marek Vasut [Tue, 7 Jul 2020 18:51:34 +0000 (20:51 +0200)]
env: Add H_DEFAULT flag

Add another internal environment flag which indicates that the operation
is resetting the environment to the default one. This allows the env code
to discern between import of external environment and reset to default.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agoenv: Warn on force access if ENV_ACCESS_IGNORE_FORCE set
Marek Vasut [Tue, 7 Jul 2020 18:51:33 +0000 (20:51 +0200)]
env: Warn on force access if ENV_ACCESS_IGNORE_FORCE set

If the ENV_ACCESS_IGNORE_FORCE is set, inform user that the variable
cannot be force-set if such attempt happens.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 years agotest: sandbox: add test for erase command
Patrick Delaunay [Tue, 28 Jul 2020 09:51:27 +0000 (11:51 +0200)]
test: sandbox: add test for erase command

Add test for the erase command tested on ENV in EXT4.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoenv: ext4: add support of command env erase
Patrick Delaunay [Tue, 28 Jul 2020 09:51:26 +0000 (11:51 +0200)]
env: ext4: add support of command env erase

Add support of opts erase for env in ext4,
this opts is used by command 'env erase'.

This command only fill the env file (CONFIG_ENV_EXT4_FILE)
with 0, the CRC and the saved environment becomes invalid.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoenv: ext4: introduce new function env_ext4_save_buffer
Patrick Delaunay [Tue, 28 Jul 2020 09:51:25 +0000 (11:51 +0200)]
env: ext4: introduce new function env_ext4_save_buffer

Split the function env_ext4_save to prepare the erase support.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agotest: environment in ext4
Patrick Delaunay [Tue, 28 Jul 2020 09:51:24 +0000 (11:51 +0200)]
test: environment in ext4

Add basic test to persistent environment in ext4:
save and load in host ext4 file 'uboot.env'.

On first execution an empty EXT4 file system is created in
persistent data dir: env.ext4.img.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoconfigs: sandbox: activate command env select and env load
Patrick Delaunay [Tue, 28 Jul 2020 09:51:23 +0000 (11:51 +0200)]
configs: sandbox: activate command env select and env load

Add support of environment location with the new env command:
'env select' and 'env load'

The ENV backend is selected by priority order
- 0 = "nowhere" (default at boot)
- 1 = "EXT4"

To test EXT4 env support, this backend is selected by name:
> env select EXT4

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoconfigs: sandbox: activate env in ext4 support
Patrick Delaunay [Tue, 28 Jul 2020 09:51:22 +0000 (11:51 +0200)]
configs: sandbox: activate env in ext4 support

Activate ENV in EXT4 support in sandbox.

The sandbox behavior don't change; the default environment with
the nowhere backend (CONFIG_ENV_IS_NOWHERE)is still used:
the weak function env_get_location() return ENVL_NOWHERE for priority 0.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agocmd: env: add env select command
Patrick Delaunay [Tue, 28 Jul 2020 09:51:21 +0000 (11:51 +0200)]
cmd: env: add env select command

Add the new command 'env select' to force the persistent storage
of environment, saved in gd->env_load_prio.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agocmd: env: add env load command
Patrick Delaunay [Tue, 28 Jul 2020 09:51:20 +0000 (11:51 +0200)]
cmd: env: add env load command

Add the new command env load to load the environment from
the current location gd->env_load_prio.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoenv: the ops driver load becomes mandatory in struct env_driver
Patrick Delaunay [Tue, 28 Jul 2020 09:51:19 +0000 (11:51 +0200)]
env: the ops driver load becomes mandatory in struct env_driver

The ops driver load becomes mandatory in struct env_drive,
change the comment for this ops and remove unnecessary test.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoenv: nowhere: add .load ops
Patrick Delaunay [Tue, 28 Jul 2020 09:51:18 +0000 (11:51 +0200)]
env: nowhere: add .load ops

Add the ops .load for nowhere ENV backend to load the
default environment.

This ops is needed for the command 'env load'

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoenv: correctly handle env_load_prio
Patrick Delaunay [Tue, 28 Jul 2020 09:51:17 +0000 (11:51 +0200)]
env: correctly handle env_load_prio

Only update gd->env_load_prio in generic function env_load()
and no more in the weak function env_get_location() which is
called in many place (for example in env_driver_lookup, even
for ENVOP_SAVE operation).

This patch is a preliminary step to use env_driver_lookup()/
env_get_location() in new function env_select() without
updating gd->env_load_prio.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoenv: sf: avoid space in backend name
Patrick Delaunay [Tue, 28 Jul 2020 09:51:16 +0000 (11:51 +0200)]
env: sf: avoid space in backend name

Remove space in ENV backend name for SPI Flash (SF)
to avoid issue with env select command.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoenv: ext4: set gd->env_valid
Patrick Delaunay [Tue, 28 Jul 2020 09:51:15 +0000 (11:51 +0200)]
env: ext4: set gd->env_valid

Add a missing initialization of gd->env_valid in env_ext4_load
as it is already done in some other env device.

Set gd->env_valid = ENV_VALID in env_ext4_save() and env_ext4_load().

This patch allows to have a correct information in 'env info' command.

Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoenv: add absolute path at CONFIG_ENV_EXT4_FILE
Patrick Delaunay [Tue, 28 Jul 2020 09:51:14 +0000 (11:51 +0200)]
env: add absolute path at CONFIG_ENV_EXT4_FILE

Add the absolute path to the default value of
CONFIG_ENV_EXT4_FILE = "/uboot.env".

This patch avoid the error :
  Saving Environment to EXT4... File System is consistent
  Please supply Absolute path

Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoenv: add prototypes for weak function
Patrick Delaunay [Mon, 15 Jun 2020 14:52:17 +0000 (16:52 +0200)]
env: add prototypes for weak function

This patch adds prototypes for several weak functions:
- env_ext4_get_intf
- env_ext4_get_dev_part
- env_get_location

It solves the following warnings when compiling with W=1
on stm32mp1 board:

board/st/stm32mp1/stm32mp1.c:849:19: warning: no previous prototype for 'env_get_location' [-Wmissing-prototypes]
 enum env_location env_get_location(enum env_operation op, int prio)
                   ^~~~~~~~~~~~~~~~
board/st/stm32mp1/stm32mp1.c:876:13: warning: no previous prototype for 'env_ext4_get_intf' [-Wmissing-prototypes]
 const char *env_ext4_get_intf(void)
             ^~~~~~~~~~~~~~~~~
board/st/stm32mp1/stm32mp1.c:889:13: warning: no previous prototype for 'env_ext4_get_dev_part' [-Wmissing-prototypes]
 const char *env_ext4_get_dev_part(void)
             ^~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agotest: efi_selftest: Do not force serial# setting
Tom Rini [Fri, 31 Jul 2020 13:45:02 +0000 (09:45 -0400)]
test: efi_selftest: Do not force serial# setting

As part of the EFI self test we set and check the serial# variable.
However, we should not be forcing this setting.  In the case where we
are allowed to change the variable it will change, and we will pass the
test.  In the case where we cannot change it, force may or may not be
allowed, depending on further environment restrictions.  Drop the -f
flag here as we do not need it.

Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agotest: do not rely on => being the prompt
Heinrich Schuchardt [Fri, 24 Jul 2020 18:55:37 +0000 (20:55 +0200)]
test: do not rely on => being the prompt

In our tests we should use the customized prompt for testing.

Reported-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Tested-by: Tom Rini <trini@konsulko.com>
4 years agoMerge tag 'dm-pull-28jul20' of git://git.denx.de/u-boot-dm
Tom Rini [Thu, 30 Jul 2020 01:16:08 +0000 (21:16 -0400)]
Merge tag 'dm-pull-28jul20' of git://git.denx.de/u-boot-dm

Use binman instead of one of the Rockchip build scripts
Refactor to allow any arch to create SPI-flash images
New button uclass

4 years agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-stm
Tom Rini [Wed, 29 Jul 2020 20:30:45 +0000 (16:30 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-stm

- fix SPL boot issue due to early dbgmcu_init() call
- fix SPL boot issue due to dcache memory region configuration
- add support of CONFIG_ENV_IS_IN_MMC
- add specific SD/eMMC partition for U-Boot enviromnent
- enable env in SPL
- use "env info -q" to remove log during boot
- remove env location override for dh_stm32mp1
- update management of misc_read
- check result of find_mmc_device in stm32prog
- use regulator_set_enable_if_allowed for disabling vdd supply in usbphyc
- enable CMD_ADTIMG flag to handle Android images
- device tree alignment with Linux Kernel v5.8-rc1
- remove hnp-srp-disable for usbotg on dk1
- add reset support to uart nodes on stm32mp15x
- use correct weak function name spl_board_prepare_for_linux
- use cd-gpios for ST and DHSOM boards
- add seeed studio odyssey-stm32mp157c board support
- move ethernet PHY into SoM DT
- add DHSOM based DRC02 board support

4 years agoMerge branch '2020-07-29-add-brcm-ns3-support'
Tom Rini [Wed, 29 Jul 2020 18:24:17 +0000 (14:24 -0400)]
Merge branch '2020-07-29-add-brcm-ns3-support'

- Add initial Broadcom NS3 SoC support.

4 years agoarch: arm: use dt and UCLASS_SYSCON to get gic lpi details
Rayagonda Kokatanur [Sun, 26 Jul 2020 17:07:33 +0000 (22:37 +0530)]
arch: arm: use dt and UCLASS_SYSCON to get gic lpi details

Use device tree and UCLASS_SYSCON driver to get
Generic Interrupt Controller (GIC) lpi address and
maximum GIC redistributors count.

Also update Kconfig to select REGMAP and SYSCON when
GIC_V3_ITS is enabled.

Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoarch: arm: use dt and UCLASS_IRQ to get gic details
Rayagonda Kokatanur [Sun, 26 Jul 2020 17:07:32 +0000 (22:37 +0530)]
arch: arm: use dt and UCLASS_IRQ to get gic details

Use device tree and UCLASS_IRQ driver to get following
Generic Interrupt Controller (GIC) details,

-GIC Distributor interface (GICD) base address and
-GIC Redistributors (GICR) base address.

Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoconfigs: ns3: enable tee and optee driver
Rayagonda Kokatanur [Wed, 15 Jul 2020 17:27:20 +0000 (22:57 +0530)]
configs: ns3: enable tee and optee driver

Enable tee and optee drivers.

Signed-off-by: Vikas Gupta <vikas.gupta@broadcom.com>
Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agodrivers: tee: broadcom: add optee based bnxt fw load driver
Vikas Gupta [Wed, 15 Jul 2020 17:27:19 +0000 (22:57 +0530)]
drivers: tee: broadcom: add optee based bnxt fw load driver

Add optee based bnxt fw load driver.
bnxt is Broadcom NetXtreme controller Ethernet card.
This driver is used to load bnxt firmware binary using OpTEE.

Signed-off-by: Vikas Gupta <vikas.gupta@broadcom.com>
Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoboard: ns3: add development keys used in FIT
Pramod Kumar [Wed, 15 Jul 2020 17:25:41 +0000 (22:55 +0530)]
board: ns3: add development keys used in FIT

Add development keys used in FIT.

Signed-off-by: Pramod Kumar <pramod.kumar@broadcom.com>
Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoboard: ns3: add FIT image its file
Pramod Kumar [Wed, 15 Jul 2020 17:25:40 +0000 (22:55 +0530)]
board: ns3: add FIT image its file

Add FIT image its file.

Signed-off-by: Pramod Kumar <pramod.kumar@broadcom.com>
Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoconfigs: ns3: enable FIT config
Rayagonda Kokatanur [Wed, 15 Jul 2020 17:25:39 +0000 (22:55 +0530)]
configs: ns3: enable FIT config

Enable FIT config for NS3.

Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoconfigs: ns3: enable sp805 watchdog driver
Rayagonda Kokatanur [Wed, 15 Jul 2020 17:23:07 +0000 (22:53 +0530)]
configs: ns3: enable sp805 watchdog driver

Enable sp805 watchdog driver for ns3.

Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoconfigs: ns3: enable EXT4 and FAT fs support
Rayagonda Kokatanur [Wed, 15 Jul 2020 17:23:06 +0000 (22:53 +0530)]
configs: ns3: enable EXT4 and FAT fs support

Enable EXT4 and FAT fs support for ns3.

Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoconfigs: ns3: enable gpt commands
Rayagonda Kokatanur [Wed, 15 Jul 2020 17:23:05 +0000 (22:53 +0530)]
configs: ns3: enable gpt commands

Enable gpt commands for ns3.

Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoconfigs: ns3: enable mmc commands
Rayagonda Kokatanur [Wed, 15 Jul 2020 17:23:04 +0000 (22:53 +0530)]
configs: ns3: enable mmc commands

Enable mmc commands for NS3.

Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoconfigs: ns3: enable BCM IPROC mmc driver
Rayagonda Kokatanur [Wed, 15 Jul 2020 17:23:03 +0000 (22:53 +0530)]
configs: ns3: enable BCM IPROC mmc driver

Enable BCM IPROC mmc driver ns3.
Enable DMA for MMC Host to have better reads and writes.

Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agodt-bindings: pinctrl: add ns3 pads definition
Rayagonda Kokatanur [Wed, 15 Jul 2020 17:23:02 +0000 (22:53 +0530)]
dt-bindings: pinctrl: add ns3 pads definition

Add NS3 pads definitions.

Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoconfigs: ns3: enable pinctrl driver
Rayagonda Kokatanur [Wed, 15 Jul 2020 17:23:01 +0000 (22:53 +0530)]
configs: ns3: enable pinctrl driver

Enable pinctrl driver for ns3.

Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agogpio: do not include <asm/arch/gpio.h> on TARGET_BCMNS3
Rayagonda Kokatanur [Tue, 5 May 2020 17:56:47 +0000 (23:26 +0530)]
gpio: do not include <asm/arch/gpio.h> on TARGET_BCMNS3

As no gpio.h is defined for this architecture, to avoid
compilation failure, do not include <asm/arch/gpio.h> for
arch bcmns3.

Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agodrivers: gpio: add broadcom iproc gpio driver support
Rayagonda Kokatanur [Tue, 5 May 2020 17:56:46 +0000 (23:26 +0530)]
drivers: gpio: add broadcom iproc gpio driver support

Add gpio driver support for Broadcom iproc-based socs.

Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Signed-off-by: Sheetal Tigadoli <sheetal.tigadoli@broadcom.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoMAINTAINERS: update maintainers for broadcom ns3 platform
Rayagonda Kokatanur [Wed, 15 Jul 2020 17:19:09 +0000 (22:49 +0530)]
MAINTAINERS: update maintainers for broadcom ns3 platform

Update MAINTAINERS for broadcom ns3 platform (TARGET_NS3).

Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agodoc: add README doc for bcmns3 platform
Rayagonda Kokatanur [Wed, 15 Jul 2020 17:19:08 +0000 (22:49 +0530)]
doc: add README doc for bcmns3 platform

Add README doc for bcmns3 platform.

Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoinclude/configs: ns3: add support for flashing images
Bharat Gooty [Wed, 15 Jul 2020 17:19:07 +0000 (22:49 +0530)]
include/configs: ns3: add support for flashing images

Add support for flashing images into QSPI and eMMC.

Signed-off-by: Bharat Gooty <bharat.gooty@broadcom.com>
Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoinclude/configs: ns3: add env variables for Linux boot
Bharat Gooty [Wed, 15 Jul 2020 17:19:06 +0000 (22:49 +0530)]
include/configs: ns3: add env variables for Linux boot

Add env variables and commands for booting Linux.

Signed-off-by: Bharat Gooty <bharat.gooty@broadcom.com>
Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoboard: ns3: limit U-boot relocation within 16MB memory
Bharat Kumar Reddy Gooty [Wed, 15 Jul 2020 17:19:05 +0000 (22:49 +0530)]
board: ns3: limit U-boot relocation within 16MB memory

By default relocation happens to a higher address of DDR,
i.e, DDR start + DDR size.

U-Boot shall be used to collect the ramdump.
Restrict U-Boot to use only the 16MB memory, so that this
memory can be reserved. Limit relocation to happen within
16MB memory, start 0xFF00_0000 and end 0x1_0000_0000

Signed-off-by: Bharat Kumar Reddy Gooty <bharat.gooty@broadcom.com>
Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoboard: ns3: define ddr memory layout
Rayagonda Kokatanur [Wed, 15 Jul 2020 17:19:04 +0000 (22:49 +0530)]
board: ns3: define ddr memory layout

Add both DRAM banks memory information and
the corresponding MMU page table mappings.

Signed-off-by: Bharat Kumar Reddy Gooty <bharat.gooty@broadcom.com>
Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agodt-bindings: memory: ns3: add ddr memory definition
Rayagonda Kokatanur [Wed, 15 Jul 2020 17:19:03 +0000 (22:49 +0530)]
dt-bindings: memory: ns3: add ddr memory definition

Add ddr memory definitions.

Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoconfigs: ns3: enable GIC_V3 ITS
Rayagonda Kokatanur [Wed, 15 Jul 2020 17:19:02 +0000 (22:49 +0530)]
configs: ns3: enable GIC_V3 ITS

Enables the Generic Interrupt Controller (GIC) V3
Interrupt Translation Service (ITS) Locality-specific Peripheral
Interrupts (LPI) configuration table and LPI table.

Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Signed-off-by: Bharat Kumar Reddy Gooty <bharat.gooty@broadcom.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoboard: ns3: program GIC LPI tables
Rayagonda Kokatanur [Wed, 15 Jul 2020 17:19:01 +0000 (22:49 +0530)]
board: ns3: program GIC LPI tables

U-boot programs the GIC LPI configuration tables and enables
the LPI table.

Signed-off-by: Bharat Kumar Reddy Gooty <bharat.gooty@broadcom.com>
Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoboard: ns3: default reset type to L3
Rayagonda Kokatanur [Wed, 15 Jul 2020 17:19:00 +0000 (22:49 +0530)]
board: ns3: default reset type to L3

Default "reset" from U-Boot to L3 reset.
"reset" command with argument will trigger L1 reset.

Signed-off-by: Rajesh Ravi <rajesh.ravi@broadcom.com>
Signed-off-by: Bharat Kumar Reddy Gooty <bharat.gooty@broadcom.com>
Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoboard: ns3: add api to save boot parameters passed from BL31
Abhishek Shah [Wed, 15 Jul 2020 17:18:59 +0000 (22:48 +0530)]
board: ns3: add api to save boot parameters passed from BL31

Add API to save boot parameters passed from BL31

Use assembly implementation of save_boot_params instead of c function.
Because generally ATF does not set up SP_EL2 on exiting.
Thus, usage of a C function immediately after exiting with no stack
setup done by ATF explicitly, may cause SP_EL2 to be not sane,
which in turn causes a crash if this boot was not lucky to get
an SP_EL2 in valid range. Replace C implementation with assembly one
which does not use stack this early, and let u-boot to set up its stack
later.

Signed-off-by: Abhishek Shah <abhishek.shah@broadcom.com>
Signed-off-by: Rajesh Ravi <rajesh.ravi@broadcom.com>
Signed-off-by: Vladimir Olovyannikov <vladimir.olovyannikov@broadcom.com>
Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agodt-bindings: memory: ns3: add memory definitions
Rayagonda Kokatanur [Wed, 15 Jul 2020 17:18:58 +0000 (22:48 +0530)]
dt-bindings: memory: ns3: add memory definitions

Add NS3 memory definitions.

Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoconfigs: ns3: enable clock subsystem
Rayagonda Kokatanur [Wed, 15 Jul 2020 17:18:57 +0000 (22:48 +0530)]
configs: ns3: enable clock subsystem

Enable clock subsystem for ns3.

Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoarm: cpu: armv8: add L3 memory flush support
Rayagonda Kokatanur [Wed, 15 Jul 2020 17:18:56 +0000 (22:48 +0530)]
arm: cpu: armv8: add L3 memory flush support

Add L3 memory flush support for NS3.

Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoboard: ns3: add support for Broadcom Northstar 3
Rayagonda Kokatanur [Wed, 15 Jul 2020 17:18:55 +0000 (22:48 +0530)]
board: ns3: add support for Broadcom Northstar 3

Add support for Broadcom Northstar 3 SoC.
NS3 is a octo-core 64-bit ARMv8 Cortex-A72 processors
targeting a broad range of networking applications.

Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>
Reviewed-by: Simon Glass <sjg@chromium.org>