oweals/u-boot.git
4 years agoboard_r: Detect ifc-nor flash at run-time
Pankit Garg [Thu, 30 Apr 2020 10:24:05 +0000 (15:54 +0530)]
board_r: Detect ifc-nor flash at run-time

CONFIG_MTD_NOR_FLASH flag needs to be enable for all
boot sources,as all flash drivers need to compile in
TFA Boot.Probe ifc nor flash only when there is nor
flash available on board.So needs to detect ifc-nor
flash at run-time for probing.

Signed-off-by: Pankit Garg <pankit.garg@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoconfigs: lx2160aqds_tfa_defconfig: enable DM_ETH and related
Ioana Ciornei [Mon, 27 Apr 2020 12:21:17 +0000 (15:21 +0300)]
configs: lx2160aqds_tfa_defconfig: enable DM_ETH and related

Enable CONFIG_DM_ETH and CONFIG_DM_MDIO and related configs for the
LX2160AQDS board.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Razvan Ionut Cirjan <razvanionut.cirjan@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoboard: lx2160aqds: implement board_fit_config_name_match
Ioana Ciornei [Mon, 27 Apr 2020 12:21:16 +0000 (15:21 +0300)]
board: lx2160aqds: implement board_fit_config_name_match

In case CONFIG_DM_ETH and CONFIG_MULTI_DTB_FIT are enabled implement the
board_fit_config_name_match() function in order to choose the
appropriate DTS for the current SERDES protocol configuration.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Razvan Ionut Cirjan <razvanionut.cirjan@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoboard: lx2160aqds: transition to DM_ETH
Ioana Ciornei [Mon, 27 Apr 2020 12:21:15 +0000 (15:21 +0300)]
board: lx2160aqds: transition to DM_ETH

In case CONFIG_DM_ETH is enabled, no hardcoding is necessary for DPAA2
Ethernet devices. Compile out any unnecessary setup when CONFIG_DM_ETH
is activated.  Also, force the PCI devices to be enumerated at probe
time.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Razvan Ionut Cirjan <razvanionut.cirjan@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoarm: dts: lx2160aqds: add nodes describing possible mezzanine cards
Ioana Ciornei [Mon, 27 Apr 2020 12:21:14 +0000 (15:21 +0300)]
arm: dts: lx2160aqds: add nodes describing possible mezzanine cards

Add device trees describing possible uses of mezzanine cards depending
on the SERDES protocol employed.

This patch adds DPAA2 networking support for the following protocols on
each SERDES block:
 * SD #1: 3, 7, 19, 20
 * SD #2: 11

Each SERDES block has a different device tree file per protocol
supported, where the IO SLOTs used are enabled and PHYs located on the
mezzanine cards are described. Also, dpmac nodes are edited and their
associated phy-connection-type and phy-handle are added.

Top DTS files are also added for each combination of protocol on the 3
SERDES blocks.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Razvan Ionut Cirjan <razvanionut.cirjan@nxp.com>
[Rebased]
Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoarm: dts: lx2160aqds: add MDIO slots
Ioana Ciornei [Mon, 27 Apr 2020 12:21:13 +0000 (15:21 +0300)]
arm: dts: lx2160aqds: add MDIO slots

The LX2160A processor has two external MDIO interfaces, described in the
DTS as emdio1 and emdio2.

On the LX2160AQDS board EMDIO1 is used with two onboard RGMII PHYs
(Realtek RTL8211FD-CG), as well as eight input/output connectors for
mezzanine cards. Configuration signals from the Qixis FPGA control the
routing of the external MDIOs.

Register 0x54 of the Qixis FPGA controls the routing of the EMDIO1 one
of the 8 IO slots. As a consequence, a new node is added to
describe register 0x54 as a MDIO mux controlled with child nodes
describing all the IO slots as MDIO buses.

Also, DPMAC 17 and 18 are updated to reference the on-board PHYs.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Razvan Ionut Cirjan <razvanionut.cirjan@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoarm: dts: lx2160a: add noted for dpmacs 1, 2, 5-6
Ioana Ciornei [Mon, 27 Apr 2020 12:21:12 +0000 (15:21 +0300)]
arm: dts: lx2160a: add noted for dpmacs 1, 2, 5-6

Add nodes for DPMACs 1, 2 and 5-6 which were missing from the
description. These will be later used on the LX2160AQDS specific DTS.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Razvan Ionut Cirjan <razvanionut.cirjan@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agodrivers: net: fsl-mc: fixup msi-map property
Laurentiu Tudor [Mon, 4 May 2020 11:47:11 +0000 (14:47 +0300)]
drivers: net: fsl-mc: fixup msi-map property

Similarly to iommu-map, the msi-map property must also be fixed up
in the device tree, in order for the icid -> streamid translation
be possible in the MSI case as well.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Reviewed-by: Diana Craciun <diana.craciun@oss.nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agodriver: net: fm: minor fix in DM ETH support
Madalin Bucur [Mon, 4 May 2020 10:09:12 +0000 (13:09 +0300)]
driver: net: fm: minor fix in DM ETH support

Bus callback functions for read/write/reset need to be set only for
DM_ETH, moving endif a bit lower.

Signed-off-by: Madalin Bucur <madalin.bucur@oss.nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoconfigs: ls1012a: Unset ENV_ADDR value
Kuldeep Singh [Mon, 4 May 2020 06:04:55 +0000 (11:34 +0530)]
configs: ls1012a: Unset ENV_ADDR value

LS1012A-FRWY and LS1012A-RDB crashes in flash environment when
CONFIG_ENV_ADDR value is set. Unset the config value in *_tfa_defconfig*
to resolve booting crash.

Following crash is observed:
    Using SERDES1 Protocol: 13576 (0x3508)
    "Synchronous Abort" handler, esr 0x96000006
    elr: 00000000820452c0 lr : 0000000082013f54 (reloc)
    elr: 00000000b7b932c0 lr : 00000000b7b61f54
    x0 : 0000000000000000 x1 : 000000007604e004
    x2 : 0000000000000001 x3 : 0000000000000000
    ...
    Code: 54ffff80 9100c000 17fffff7 f9402241 (3860c820)
    Resetting CPU ...

Signed-off-by: Kuldeep Singh <kuldeep.singh@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoconfigs: nxp: Enable CONFIG_SYS_RELOC_GD_ENV_ADDR
Kuldeep Singh [Sat, 14 Dec 2019 14:02:56 +0000 (19:32 +0530)]
configs: nxp: Enable CONFIG_SYS_RELOC_GD_ENV_ADDR

Commit 323d3af59fe4 ("configs: ls1012ardb: Enable
CONFIG_SYS_RELOC_GD_ENV_ADDR") enables the config only for LS1012ARDB.

Apart from LS1012A-RDB, other platforms such as LS1012A-FRWY, LS2088A
and LS1046A-RDB/FRWY also require this config to be enabled. This also
helps in resolving booting crash observed in flash environment.

Signed-off-by: Kuldeep Singh <kuldeep.singh@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoconfigs: ls1012a: Reduce CONFIG_ENV_SIZE to 0x2000
Ashish Kumar [Wed, 29 Apr 2020 12:12:03 +0000 (17:42 +0530)]
configs: ls1012a: Reduce CONFIG_ENV_SIZE to 0x2000

All LS1012A board variants have same CONFIG_ENV_SECT_SIZE and
CONFIG_ENV_SIZE values. If both config values are same, flash
environment cannot be saved. Since, CONFIG_ENV_SECT_SIZE needs to be
same as that of flash sector size, this entry cannot be changed.
Reduce CONFIG_ENV_SIZE value to 0x2000. This also helps in making config
value aligned with other boards environemt size.

Signed-off-by: Kuldeep Singh <kuldeep.singh@nxp.com>
Signed-off-by: Ashish Kumar <Ashish.kumar@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoconfigs: ls1012a: Increase CONFIG_SYS_MALLOC_LEN size
Kuldeep Singh [Tue, 12 May 2020 09:28:51 +0000 (14:58 +0530)]
configs: ls1012a: Increase CONFIG_SYS_MALLOC_LEN size

CONFIG_SYS_MALLOC_LEN is currently set to low value and leaves very less
space to do malloc in flash environmet. Increase the value to get more
memory and also make it align with other boards(ls1046a, ls1043a etc.)
config values.

Signed-off-by: Kuldeep Singh <kuldeep.singh@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoconfigs: ls2080ardb: Make BOOT command access flash memory as per spi-mem
Kuldeep Singh [Fri, 7 Feb 2020 16:45:18 +0000 (22:15 +0530)]
configs: ls2080ardb: Make BOOT command access flash memory as per spi-mem

BOOT command currently access spi-nor flash memory directly. As per spi-mem
framework, flash memory access via absolute addresses is no more possible.
Use flash APIs to access memory instead of directly using it.

Signed-off-by: Kuldeep Singh <kuldeep.singh@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoconfigs: ls2080ardb: Make MC_INIT access flash memory as per spi-mem
Kuldeep Singh [Fri, 7 Feb 2020 16:39:09 +0000 (22:09 +0530)]
configs: ls2080ardb: Make MC_INIT access flash memory as per spi-mem

MC_INIT command currently access spi-nor flash memory directly. As per
spi-mem framework, flash memory access via absolute addresses is no more
possible. Use flash APIs to access memory instead of directly using it.

Signed-off-by: Kuldeep Singh <kuldeep.singh@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoconfigs: ls1046a: Define ENV_ADDR value
Kuldeep Singh [Tue, 12 May 2020 09:09:46 +0000 (14:39 +0530)]
configs: ls1046a: Define ENV_ADDR value

CONFIG_ENV_ADDR helps in picking environment from flash before DDR init.
The macro value is already defined in ls1046ardb_tfa_defconfig, also
define the value as 0x40300000 in qspi_defconfig.

ls1046aqds has one spansion flash "S25FL128S_64K" of size 16M with
sector size 64K. Correct ENV_ADDR and ENV_SECT_SIZE value for QSPI and
TFA defconfigs of the board.

Signed-off-by: Kuldeep Singh <kuldeep.singh@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoconfigs: ls2080a: Correct ENV_ADDR value
Kuldeep Singh [Tue, 11 Feb 2020 09:26:42 +0000 (14:56 +0530)]
configs: ls2080a: Correct ENV_ADDR value

CONFIG_ENV_ADDR helps in picking environment from flash before DDR init.
QSPI region in LS2088ARDB and LS2088AQDS starts from 0x20000000 offset.
Correct the config value i.e 0x80500000 -> 0x20500000.

Also, define config value as 0x20300000 in qspi defconfig.

Signed-off-by: Kuldeep Singh <kuldeep.singh@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoconfigs: ls1088a: Correct ENV_ADDR value
Kuldeep Singh [Tue, 11 Feb 2020 09:21:35 +0000 (14:51 +0530)]
configs: ls1088a: Correct ENV_ADDR value

CONFIG_ENV_ADDR helps in picking environment from flash before DDR init.
QSPI region starts from 0x20000000 offset.
Correct the config value i.e 0x80500000 -> 0x20500000.

Signed-off-by: Kuldeep Singh <kuldeep.singh@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agotreewide: Update fsl qspi node dt properties as per spi-mem driver
Kuldeep Singh [Thu, 12 Dec 2019 06:19:24 +0000 (11:49 +0530)]
treewide: Update fsl qspi node dt properties as per spi-mem driver

According to new qspi driver, some properties like "bus-num, num-cs,
big-endian" are no longer used. Device endiannes can be determined from
device-type data in driver.

Now use board specific compatibles, generic node names and specific
labels to align with linux device-tree properties.

Also consolidate spi-max-frequency to 50Mhz treewide.

Signed-off-by: Kuldeep Singh <kuldeep.singh@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoconfigs: ls1046a: Move SPI_FLASH_SPANSION to defconfig
Kuldeep Singh [Tue, 12 May 2020 09:02:39 +0000 (14:32 +0530)]
configs: ls1046a: Move SPI_FLASH_SPANSION to defconfig

Enable CONFIG_SPI_FLASH_SPANSION in defconfigs of LS1046ARDB and
LS1046AQDS which have two spansion flases i.e s25fs512s each of size
64M.

Signed-off-by: Kuldeep Singh <kuldeep.singh@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoconfigs: ls1012a: Enable CONFIG_SPI_FLASH_SPANSION in defconfigs
Kuldeep Singh [Tue, 12 May 2020 09:01:07 +0000 (14:31 +0530)]
configs: ls1012a: Enable CONFIG_SPI_FLASH_SPANSION in defconfigs

Since CONFIG_FSL_QSPI is already enabled for LS1012A in defconfigs. Also
enable CONFIG_SPI_FLASH_SPANSION for LS1012A boards having spansion
flashes.

Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
Signed-off-by: Kuldeep Singh <kuldeep.singh@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoconfigs: ls1043a: Move CONFIG_FSL_QSPI and SPI_FLASH_SPANSION to defconfig
Kuldeep Singh [Tue, 12 May 2020 08:58:56 +0000 (14:28 +0530)]
configs: ls1043a: Move CONFIG_FSL_QSPI and SPI_FLASH_SPANSION to defconfig

Move CONFIG_FSL_QSPI to the board defconfigs and while at it also move
CONFIG_SPI_FLASH_SPANSION for LS1043AQDS.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Kuldeep Singh <kuldeep.singh@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agotreewide: Remove unused FSL QSPI config options for Layerscape platforms
Kuldeep Singh [Tue, 12 May 2020 07:24:07 +0000 (12:54 +0530)]
treewide: Remove unused FSL QSPI config options for Layerscape platforms

Some of these options are not used by the driver anymore and some of
them are obsolete as the information is gathered from the dt. Also
consolidating defines in common headers.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Signed-off-by: Ashish Kumar <Ashish.Kumar@nxp.com>
Signed-off-by: Kuldeep Singh <kuldeep.singh@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
4 years agoMerge tag 'efi-2020-07-rc3' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Mon, 18 May 2020 12:17:29 +0000 (08:17 -0400)]
Merge tag 'efi-2020-07-rc3' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi

Pull request for UEFI sub-system for efi-2020-07-rc3

A series of patches introduces the possibility to manage UEFI variables
via an OP-TEE module. CONFIG_EFI_MM_COMM_TEE enables this. If this
option is not specified the U-Boot behavior remains unchanged. A defconfig
is provided for compile testing (lx2160ardb_tfa_stmm_defconfig).

An incorrect UEFI memory allocation for fsl-layerscape is fixed

4 years agodts: nxp2160ardb: add op-tee node
Ilias Apalodimas [Sun, 17 May 2020 19:25:49 +0000 (22:25 +0300)]
dts: nxp2160ardb: add op-tee node

A defconfig is added on lx2160ardb which allows UEFI variable management
via OP-TEE. Enable the the node in the relevant DTS file.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
4 years agoconfigs: lx2160a: Add default config for lx2160a using StMM in OP-TEE
Ilias Apalodimas [Sun, 17 May 2020 19:25:48 +0000 (22:25 +0300)]
configs: lx2160a: Add default config for lx2160a using StMM in OP-TEE

Previous patches allow UEFI secure variables to be stored in an RPMB
device using OPTEE. Add a config for the lx2160a hardware so the feature
gets at least compiled.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Remove superfluous differences to lx2160ardb_tfa_defconfig.
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agodoc: uefi.rst: Add OP-TEE variable storage config options
Ilias Apalodimas [Sun, 17 May 2020 19:25:47 +0000 (22:25 +0300)]
doc: uefi.rst: Add OP-TEE variable storage config options

If OP-TEE is compiled with an EDK2 application running in secure world
it can process and store UEFI variables in an RPMB.
Add documentation for the config options enabling this.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoMAINTAINERS: Add maintainer for EFI variables via OP-TEE
Ilias Apalodimas [Sun, 17 May 2020 19:25:46 +0000 (22:25 +0300)]
MAINTAINERS: Add maintainer for EFI variables via OP-TEE

Add myself as maintainer for the OP-TEE related UEFI variable storage.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agocmd: efidebug: Add support for querying UEFI variable storage
Ilias Apalodimas [Sun, 17 May 2020 19:25:45 +0000 (22:25 +0300)]
cmd: efidebug: Add support for querying UEFI variable storage

With the previous patches that use OP-TEE and StandAloneMM for UEFI
variable storage we've added functionality for efi_query_variable_info.
So let's add the relevant command to efidebug and retrieve information
about the container used to store UEFI variables

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
4 years agoefi_loader: Implement EFI variable handling via OP-TEE
Ilias Apalodimas [Sun, 17 May 2020 19:25:44 +0000 (22:25 +0300)]
efi_loader: Implement EFI variable handling via OP-TEE

In OP-TEE we can run EDK2's StandAloneMM on a secure partition.
StandAloneMM is responsible for the UEFI variable support. In
combination with OP-TEE and it's U-Boot supplicant, variables are
authenticated/validated in secure world and stored on an RPMB partition.

So let's add a new config option in U-Boot implementing the necessary
calls to OP-TEE for the variable management.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Pipat Methavanitpong <pipat1010@gmail.com>
Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: Add headers for EDK2 StandAloneMM communication
Sughosh Ganu [Sun, 17 May 2020 19:25:43 +0000 (22:25 +0300)]
efi_loader: Add headers for EDK2 StandAloneMM communication

In Arm devices OP-TEE has the ability to run StandAloneMM (from EDK2)
in a separate partition and handle UEFI variables.
A following patch introduces this functionality.

Add the headers needed for OP-TEE <--> StandAloneMM communication

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoefi_loader: round the memory area in efi_add_memory_map()
Michael Walle [Sun, 17 May 2020 10:29:19 +0000 (12:29 +0200)]
efi_loader: round the memory area in efi_add_memory_map()

Virtually all callers of this function do the rounding on their own.
Some do it right, some don't. Instead of doing this in each caller,
do the rounding in efi_add_memory_map(). Change the size parameter
to bytes instead of pages and remove aligning and size calculation in
all callers.

There is no more need to make the original efi_add_memory_map() (which
takes pages as size) available outside the module. Thus rename it to
efi_add_memory_map_pg() and make it static to prevent further misuse
outside the module.

Signed-off-by: Michael Walle <michael@walle.cc>
Add missing comma in sunxi_display.c.
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agoMerge branch '2020-05-15-kconfig-migrations'
Tom Rini [Sat, 16 May 2020 01:44:46 +0000 (21:44 -0400)]
Merge branch '2020-05-15-kconfig-migrations'

- Convert CONFIG_DELAY_ENVIRONMENT to Kconfig and update initr_pci to be
  Kconfig'd.

4 years agoqemu-x86*_defconfig: Enable CONFIG_PCI_INIT_R
Ovidiu Panait [Wed, 6 May 2020 17:38:47 +0000 (20:38 +0300)]
qemu-x86*_defconfig: Enable CONFIG_PCI_INIT_R

Enable CONFIG_PCI_INIT_R for qemux86 and qemux86-64 pci enumeration during
boot in order to eliminate the custom preboot commands in
include/configs/qemu-x86.h.

Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
4 years agoqemu_arm_defconfig: Enable CONFIG_PCI_INIT_R
Ovidiu Panait [Wed, 6 May 2020 17:38:46 +0000 (20:38 +0300)]
qemu_arm_defconfig: Enable CONFIG_PCI_INIT_R

Replace the "pci enum" preboot sequence with CONFIG_PCI_INIT_R=y.

Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
4 years agoqemu_arm64_defconfig: Enable CONFIG_PCI_INIT_R
Ovidiu Panait [Wed, 6 May 2020 17:38:45 +0000 (20:38 +0300)]
qemu_arm64_defconfig: Enable CONFIG_PCI_INIT_R

Replace the "pci enum" preboot sequence with CONFIG_PCI_INIT_R=y.

Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
4 years agoboard_r: Introduce CONFIG_PCI_INIT_R Kconfig option
Ovidiu Panait [Wed, 6 May 2020 17:38:44 +0000 (20:38 +0300)]
board_r: Introduce CONFIG_PCI_INIT_R Kconfig option

With CONFIG_DM_PCI enabled, PCI buses are not enumerated at boot, as they
are without that config option enabled. However, there are cases such as DM
PCI-based Ethernet devices that need the PCI bus enumerated so that they
can be discovered by their drivers.

Currently, to solve this, some boards enumerate the pci bus using
"pci enum" preboot command, while others do it manually in board files
(in board_init/board_late_init/etc. functions).

In order to possibly make the pci enumeration process uniform across all
boards, introduce CONFIG_PCI_INIT_R Kconfig option.

This change also preserves the current behavior in the !DM_PCI case
(pci_init is run unconditionally at boot).

Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
4 years agoboard_r: env: Use IS_ENABLED() instead of #ifdefs
Ovidiu Panait [Wed, 6 May 2020 17:38:43 +0000 (20:38 +0300)]
board_r: env: Use IS_ENABLED() instead of #ifdefs

Use IS_ENABLED() instead of #ifdef in should_load_env and initr_env
functions.

No functional change intended.

Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
4 years agoenv: Convert CONFIG_DELAY_ENVIRONMENT to Kconfig
Ovidiu Panait [Wed, 6 May 2020 17:38:42 +0000 (20:38 +0300)]
env: Convert CONFIG_DELAY_ENVIRONMENT to Kconfig

This converts ad-hoc CONFIG_DELAY_ENVIRONMENT to Kconfig.

Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
4 years agoconfigs: Resync with savedefconfig
Tom Rini [Fri, 15 May 2020 20:49:11 +0000 (16:49 -0400)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
4 years agoMerge branch '2020-05-15-misc-bugfixes'
Tom Rini [Fri, 15 May 2020 20:42:06 +0000 (16:42 -0400)]
Merge branch '2020-05-15-misc-bugfixes'

- A number of symbol name consistency updates
- JFFS2 bugfix
- Use /* fallthrough */ for now to help at least gcc know when we're
  intentionally not 'break;'ing in a switch statement, we'll adopt
  fallthrough; later on.
- Assorted other fixes

4 years agolib: rsa: avoid overriding the object name when already specified
Jan Luebbe [Wed, 13 May 2020 10:26:24 +0000 (12:26 +0200)]
lib: rsa: avoid overriding the object name when already specified

If "object=" is specified in "keydir" when using the pkcs11 engine do
not append another "object=<key-name-hint>". This makes it possible to
use object names other than the key name hint. These two string
identifiers are not necessarily equal.

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Bastian Krause <bst@pengutronix.de>
Reviewed-by: George McCollister <george.mccollister@gmail.com>
4 years agoMAINTAINERS: POWERPC MPC8XX: Update email address
Christophe Leroy [Wed, 13 May 2020 05:30:03 +0000 (05:30 +0000)]
MAINTAINERS: POWERPC MPC8XX: Update email address

Our email addresses have changed from @c-s.fr to @csgroup.eu

Update entry in MAINTAINERS

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
4 years agotools: ftdgrep: use /* fallthrough */ as needed
Heinrich Schuchardt [Sat, 9 May 2020 15:12:42 +0000 (17:12 +0200)]
tools: ftdgrep: use /* fallthrough */ as needed

GCC recognizes /* fallthrough */ if -Wimplicit-fallthrough=3 is enabled.
Let's use it consistently.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agotools: mkimage: use /* fallthrough */ as needed
Heinrich Schuchardt [Sat, 9 May 2020 15:10:41 +0000 (17:10 +0200)]
tools: mkimage: use /* fallthrough */ as needed

GCC recognizes /* fallthrough */ if -Wimplicit-fallthrough=3 is enabled.
Let's use it consistently.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 years agocommon/board_f: avoid -Wtype-limits warning
Heinrich Schuchardt [Sat, 9 May 2020 19:21:14 +0000 (21:21 +0200)]
common/board_f: avoid -Wtype-limits warning

CONFIG_SYS_SDRAM_BASE maybe zero. Avoid a build warning when compiling with
-Wtype-limits.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agospl: Always define preloader_console_init
Samuel Holland [Thu, 7 May 2020 23:08:10 +0000 (18:08 -0500)]
spl: Always define preloader_console_init

A large number of boards call preloader_console_init unconditionally.
Currently, they fail to build with CONFIG_SPL_SERIAL=n, because the
function is undefined in that case. To fix the build, always define
preloader_console_init, but make it no-op when CONFIG_SPL_SERIAL=n.

For the few boards that did check for CONFIG_SPL_SERIAL before calling
preloader_console_init, remove the checks, since the function can now
be called unconditionally.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
4 years agolib: rsa: Also check for presence of r-squared property
Jan Kiszka [Thu, 7 May 2020 18:36:13 +0000 (20:36 +0200)]
lib: rsa: Also check for presence of r-squared property

Better than crashing later if it is missing.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
4 years agoMakefile: add file 'defconfig' to clean target
Heinrich Schuchardt [Thu, 7 May 2020 16:09:22 +0000 (18:09 +0200)]
Makefile: add file 'defconfig' to clean target

File 'defconfig' is a build artifact of 'make savedefconfig'.
Remove it when cleaning.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 years agoJFFS2: Add useful fields into lists
Petr Borsodi [Thu, 7 May 2020 10:25:56 +0000 (12:25 +0200)]
JFFS2: Add useful fields into lists

The inode list uses version and ino, the dirent list uses version and pino.
This information is collected during scanning, reducing accesses to flash
and significantly speeding up ls and read.

Signed-off-by: Petr Borsodi <petr.borsodi@i.cz>
4 years agoJFFS2: Process obsolete nodes as well as accurate ones
Petr Borsodi [Thu, 7 May 2020 10:25:55 +0000 (12:25 +0200)]
JFFS2: Process obsolete nodes as well as accurate ones

Obsolete nodes (ie. without the JFFS2_NODE_ACCURATE flag) were ignored
because they had seemingly invalid crc. This could lead to finding
the phantom node header in obsolete node data.

Signed-off-by: Petr Borsodi <petr.borsodi@i.cz>
4 years agodrivers/reset/Kconfig: fix typo
Trevor Woerner [Wed, 6 May 2020 12:02:43 +0000 (08:02 -0400)]
drivers/reset/Kconfig: fix typo

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
4 years agorename symbol: CONFIG_STM32 -> CONFIG_ARCH_STM32
Trevor Woerner [Wed, 6 May 2020 12:02:42 +0000 (08:02 -0400)]
rename symbol: CONFIG_STM32 -> CONFIG_ARCH_STM32

Have this symbol follow the pattern of all other such symbols.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
4 years agorename symbol: CONFIG_TEGRA -> CONFIG_ARCH_TEGRA
Trevor Woerner [Wed, 6 May 2020 12:02:41 +0000 (08:02 -0400)]
rename symbol: CONFIG_TEGRA -> CONFIG_ARCH_TEGRA

Have this symbol follow the pattern of all other such symbols.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
4 years agorename symbol: CONFIG_KIRKWOOD -> CONFIG_ARCH_KIRKWOOD
Trevor Woerner [Wed, 6 May 2020 12:02:40 +0000 (08:02 -0400)]
rename symbol: CONFIG_KIRKWOOD -> CONFIG_ARCH_KIRKWOOD

Have this symbol follow the pattern of all other such symbols.
This patch also removes a TODO from the code.

Reviewed-by: Chris Packham <judge.packham@gmail.com>
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
4 years agoarm: orion5x: finish moving SoC to mach-orion5x
Trevor Woerner [Wed, 6 May 2020 12:02:39 +0000 (08:02 -0400)]
arm: orion5x: finish moving SoC to mach-orion5x

The SPL linker script had been left in arch/$(ARCH)/cpu/$(CPU)/$(SOC);
therefore move it to the already-established arch/$(ARCH)/mach-$(SOC)
location.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
4 years agorename symbol: CONFIG_ORION5X -> CONFIG_ARCH_ORION5X
Trevor Woerner [Wed, 6 May 2020 12:02:38 +0000 (08:02 -0400)]
rename symbol: CONFIG_ORION5X -> CONFIG_ARCH_ORION5X

Have this symbol follow the pattern of all other such symbols.
This patch removes a TODO from the code.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
4 years agoarch/arm/Makefile: sort machine names
Trevor Woerner [Wed, 6 May 2020 12:02:37 +0000 (08:02 -0400)]
arch/arm/Makefile: sort machine names

The comment immediately above the block of machine directory names implored
users to keep the macro names sorted, but, alas, this is no longer the case.

Put the list of machine directory names back in alphanumerical order by
CONFIG_* macro name, as the comment asks. Sort all the symbols as though they
all followed the convention of having the string "ARCH_" in the middle of
their definitions.

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
4 years agoarm: lpc32xx: move SoC to mach-lpc32xx
Trevor Woerner [Wed, 6 May 2020 12:02:36 +0000 (08:02 -0400)]
arm: lpc32xx: move SoC to mach-lpc32xx

Following the example of most other SoCs in arch/$(ARCH)/cpu/$(CPU)/$(SOC)
move the lpc32xx code from arch/arm/cpu/arm926ejs/lpc32xx to
arch/arm/mach-lpc32xx.

Following the checklist from
commit 01f14456306c ("ARM: prepare for moving SoC sources into mach-*"):

    [1] move files from arch/arm/cpu/arm926ejs/lpc32xx to arch/arm/mach-lpx32xx
    [2] add machine entry to arch/arm/Makefile
    [3] remove "obj-y += ..." from arch/arm/cpu/arm926ejs/Makefile
    [4] fix the Kconfig file path in arch/arm/Kconfig
    [5] (no MAINTAINERS update)

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
4 years agorsa: don't use malloc.h in rsa-sign.c
Jonathan Gray [Fri, 15 May 2020 12:20:34 +0000 (22:20 +1000)]
rsa: don't use malloc.h in rsa-sign.c

stdlib.h is the header for malloc since at least c89/c90.
There is no system malloc.h on OpenBSD and trying to use malloc.h here
falls back to the U-Boot malloc.h breaking the build of qemu_arm64.

Fixes: 336d4615f8 ("dm: core: Create a new header file for 'compat' features")
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
4 years agoconfigs: mt7629: support usb host and udisk
Chunfeng Yun [Thu, 14 May 2020 05:56:19 +0000 (13:56 +0800)]
configs: mt7629: support usb host and udisk

Enable modules to support download image from usb

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
4 years agoMakefile: remove m68k GCC 3.4 workaround
Masahiro Yamada [Thu, 14 May 2020 02:38:20 +0000 (11:38 +0900)]
Makefile: remove m68k GCC 3.4 workaround

This code dates back to 2006, commit 483a0cf804df ("Fixes for gcc 3.4
based m68k toolchain,").

GCC 3.4 is so old. We do not support it.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
4 years agolib: Allow MD5 to be enabled in SPL
Simon Glass [Wed, 6 May 2020 14:03:56 +0000 (08:03 -0600)]
lib: Allow MD5 to be enabled in SPL

At present the MD5 option cannot be enabled by board configs since it has
no Kconfig name. It is generally enabled, so long as FIT support is
present. But not all boards use FIT, particularly in SPL

Fix this and add an option for SPL as well. This allows board code to call
md5() even if FIT support is not enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agopci: Fix typo in definition for PCI_DEV
Simon Glass [Sun, 10 May 2020 16:26:54 +0000 (10:26 -0600)]
pci: Fix typo in definition for PCI_DEV

Fix a typo in the comment.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 years agousb: Update struct usb_device to indicate speed enum
Simon Glass [Sun, 10 May 2020 16:26:53 +0000 (10:26 -0600)]
usb: Update struct usb_device to indicate speed enum

The speed member actually uses an enum, so add this to the comment.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Marek Vasut <marex@denx.de>
4 years agokbuild: spl: Add shrunk arch-dtbs to targets list
Jan Kiszka [Mon, 4 May 2020 12:38:31 +0000 (14:38 +0200)]
kbuild: spl: Add shrunk arch-dtbs to targets list

This avoids needless rebuilding.

Fixes: 2f57c95100f2 ("spl: dm: Make it possible for the SPL to pick its own DTB from a FIT")
CC: Jean-Jacques Hiblot <jjhiblot@ti.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
4 years agokbuild: spl: Fix parallel build
Jan Kiszka [Mon, 4 May 2020 12:38:30 +0000 (14:38 +0200)]
kbuild: spl: Fix parallel build

The dts dir must exists when running this rule.

That missing dependency broke e.g. "make -j" for the am65x targets.

Fixes: 2f57c95100f2 ("spl: dm: Make it possible for the SPL to pick its own DTB from a FIT")
CC: Jean-Jacques Hiblot <jjhiblot@ti.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
4 years agoMerge tag 'u-boot-stm32-20200514' of https://gitlab.denx.de/u-boot/custodians/u-boot-stm
Tom Rini [Thu, 14 May 2020 12:44:06 +0000 (08:44 -0400)]
Merge tag 'u-boot-stm32-20200514' of https://gitlab.denx.de/u-boot/custodians/u-boot-stm

- stm32mp1: migrate MTD and DFU configuration in Kconfig
- stm32mp1: add command stm32prog
- stm32mp1: several board and arch updates
- stm32mp1: activate data cache in SPL and before relocation
- Many improvment for AV96 board and DHCOR SoM
  (add new defconfig, DDR3 coding on DHCOR SoM, split between board and SOM
   Synchronize DDR setttings on DH SoMs, setting for I2C EEPROM)
- clk: stm32mp1: fix CK_MPU calculation
- DT alignment of stm32mp1 device tree with Linux 5.7-rc2

4 years agoMerge tag 'rpi-next-2020.07' of https://gitlab.denx.de/u-boot/custodians/u-boot-raspb...
Tom Rini [Thu, 14 May 2020 12:43:33 +0000 (08:43 -0400)]
Merge tag 'rpi-next-2020.07' of https://gitlab.denx.de/u-boot/custodians/u-boot-raspberrypi

- fix phy configuration for RPi4's bcmgenet
- sync RPi4's env size with other RPi configs
- add kconfig option to reserver more pages in the EFI mem map
- add support for SDMA which is used by RPi4
- fix corner case boot bug for RPi3 32-bit

4 years agoARM: dts: stm32mp1: DT alignment with Linux 5.7-rc2
Patrick Delaunay [Thu, 30 Apr 2020 13:52:46 +0000 (15:52 +0200)]
ARM: dts: stm32mp1: DT alignment with Linux 5.7-rc2

DT alignment with Linux 5.7-rc2, including the kernel commits

431c89e6f323 ARM: dts: stm32: use correct vqmmc regu for eMMC on stm32mp1 ED1/EV1 boards
79e965053872 ARM: dts: stm32: add disable-wp property for SD-card on STM32MP1 boards
877db62ea516 ARM: dts: stm32: add cd-gpios properties for SD-cards on STM32MP1 boards
7519e95ba5f8 ARM: dts: stm32: Do clean up in stmpic nodes on stm32mp15 boards
f68e2dbc591a ARM: dts: stm32: Rename stmfx joystick pins on stm32mp157c-ev1
d6210da4f8bf ARM: dts: stm32: add cpu clock-frequency property on stm32mp15x
b65b6fc56925 ARM: dts: stm32: add wakeup-source in all I2C nodes of stm32mp157c
1c1cf5996cfb ARM: dts: stm32: add i2c4 sleep pinctrl on stm32mp157c-ed1
bef15fc0fad9 ARM: dts: stm32: add i2c2/i2c5 sleep pinctrl on stm32mp157c-ev1
b7fc0a87b9ac ARM: dts: stm32: add i2c4 sleep pinctrl on stm32mp15xx-dkx
a5e557655285 ARM: dts: stm32: set i2c4 bus freq to 400KHz on stm32mp15 DK boards
8bc631b650a6 ARM: dts: stm32: set i2c4 bus freq to 400KHz on stm32mp157c-ed1
fccd6a577bb3 ARM: dts: stm32: Correct stmfx node name on stm32mp157c-ev1 board
cc775a83db65 ARM: dts: stm32: add resets property on all DMA nodes on stm32mp151
c5fae093511b ARM: dts: stm32: enable USB OTG Dual Role on stm32mp157c-ev1
9879e2165758 ARM: dts: stm32: add USB OTG pinctrl to stm32mp15
82ac8a81f985 ARM: dts: stm32: add USB OTG full support on stm32mp151
8714b26e2863 ARM: dts: stm32: remove useless properties in stm32mp157a-avenger96 stmpic node
a7959919709e ARM: dts: stm32: Add UART8 pins A pinmux entry on stm32mp1
4d7c53a684da ARM: dts: stm32: Add USART3 pins A pinmux entry on stm32mp1
80ab128332ee ARM: dts: stm32: Add SAI2A pins B pinmux entry on stm32mp1
ab7f98c0c546 ARM: dts: stm32: Add Ethernet0 RMII pins A pinmux entry on stm32mp1

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoclk: stm32mp1: fix CK_MPU calculation
Lionel Debieve [Fri, 24 Apr 2020 13:47:57 +0000 (15:47 +0200)]
clk: stm32mp1: fix CK_MPU calculation

When the CK_MPU used PLL1_MPUDIV, the current rate is
wrong. The clock must use stm32mp1_mpu_div as a shift
value. Fix the check value used to enter PLL_MPUDIV.

Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agommc: stm32_sdmmc2: change the displayed config name
Patrick Delaunay [Thu, 30 Apr 2020 07:52:13 +0000 (09:52 +0200)]
mmc: stm32_sdmmc2: change the displayed config name

Change the mmc displayed name in U-Boot for stm32_sdmmc2 driver to
“STM32 SD/MMC”.

This stm32_sdmmc2 driver is for version 2 of the ST HW IP SDMMC but the
displayed name "STM32 SDMMC2" is confusing for user, between the
instance of SDMMC and the device identifier of MMC.

For example on EV1 board, we have:

STM32MP1> mmc list
 STM32 SDMMC2: 0 (SD)
 STM32 SDMMC2: 1 (eMMC)

Changed to more clear:

STM32MP1> mmc list
 STM32 SD/MMC: 0 (SD)
 STM32 SD/MMC: 1 (eMMC)

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoarm: stm32mp: activate data cache on DDR in SPL
Patrick Delaunay [Thu, 30 Apr 2020 14:30:21 +0000 (16:30 +0200)]
arm: stm32mp: activate data cache on DDR in SPL

Activate cache on DDR to improve the accesses to DDR used by SPL:
- CONFIG_SPL_BSS_START_ADDR
- CONFIG_SYS_SPL_MALLOC_START

Cache is configured only when DDR is fully initialized,
to avoid speculative access and issue in get_ram_size().
Data cache is deactivated at the end of SPL, to flush the data cache
and the TLB.

Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoarm: stm32mp: activate data cache in SPL and before relocation
Patrick Delaunay [Thu, 30 Apr 2020 14:30:20 +0000 (16:30 +0200)]
arm: stm32mp: activate data cache in SPL and before relocation

Activate the data cache in SPL and in U-Boot before relocation.

In arch_cpu_init(), the function early_enable_caches() sets the early
TLB, early_tlb[] located .init section, and set cacheable:
- for SPL, all the SYSRAM
- for U-Boot, all the DDR

After relocation, the function enable_caches() (called by board_r)
reconfigures the MMU with new TLB location (reserved in
board_f.c::reserve_mmu) and re-enable the data cache.

This patch allows to reduce the execution time, particularly
- for the device tree parsing in U-Boot pre-reloc stage
  (dm_extended_scan_fd =>dm_scan_fdt)
- in I2C timing computation in SPL (stm32_i2c_choose_solution())

For example, the result on STM32MP157C-DK2 board is:
   1,6s gain for trusted boot chain with TF-A
   2,2s gain for basic boot chain with SPL

For information, as TLB is added in .data section, the binary size
increased and the SPL load time by ROM code increased (30ms on DK2).

But early malloc can't be used for TLB because arch_cpu_init()
is executed before the early poll initialization done in spl_common_init()
called by spl_early_init() So it too late for this use case.
And if I initialize the MMU and the cache after this function it is
too late, as dm_init_and_scan and fdt parsing is also called in
spl_common_init().

And .BSS can be used in board_init_f(): only stack and global can use
before BSS init done in board_init_r().

So .data is the better solution without hardcoded location but if you
have size issue for SPL you can deactivate cache for SPL only
(with CONFIG_SPL_SYS_DCACHE_OFF).

Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoARM: stm32: Hog GPIO PF7 high on DHCOM to unlock SPI NOR nWP
Marek Vasut [Mon, 27 Apr 2020 10:26:43 +0000 (12:26 +0200)]
ARM: stm32: Hog GPIO PF7 high on DHCOM to unlock SPI NOR nWP

The SPI NOR nWP line is connected to GPIO PF7 on the SoM,
pull the GPIO line high by default to clear SPI NOR WP.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Patrick Delaunay <patrick.delaunay@st.com>
Cc: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoARM: stm32: Define I2C EEPROM bus and address on DHCOM
Marek Vasut [Mon, 27 Apr 2020 10:26:42 +0000 (12:26 +0200)]
ARM: stm32: Define I2C EEPROM bus and address on DHCOM

Define I2C EEPROM bus and address, so that the 'eeprom' command uses
the correct ones and does not generate the following error:
    eeprom_rw_block: Cannot find udev for a bus 0

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Patrick Delaunay <patrick.delaunay@st.com>
Cc: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoARM: dts: stm32: Synchronize DDR setttings on DH SoMs
Marek Vasut [Wed, 29 Apr 2020 13:08:38 +0000 (15:08 +0200)]
ARM: dts: stm32: Synchronize DDR setttings on DH SoMs

Add custom DDR DRAM settings for the DHCOR and DHCOM SoMs and put them
into use by the board file instead of the default ones. These new DRAM
settings are a better fit for the SoMs.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Patrick Delaunay <patrick.delaunay@st.com>
Cc: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoARM: dts: stm32: Fix AV96 and DHCOR split
Marek Vasut [Mon, 27 Apr 2020 11:16:02 +0000 (13:16 +0200)]
ARM: dts: stm32: Fix AV96 and DHCOR split

The commit 132e5b68986d ("ARM: dts: stm32: Split AV96 into DHCOR SoM
and AV96 board") was not applied correctly and in full, and omitted
an important split of the SoM into 3V3 and 1V8 options. The Avenger96
board is based on the 1V8 IO option of the DHCOR SoM, however this is
an optional modification of the 3V3 IO DHCOR SoM with extra on-SoM
regulator to cater for the 96boards 1V8 IO requirements.

Reinstate the split between the 1V8 and 3V3 IO variants.

Fixes: 132e5b68986d ("ARM: dts: stm32: Split AV96 into DHCOR SoM and AV96 board")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Cc: Patrick Delaunay <patrick.delaunay@st.com>
Cc: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agostm32mp1: Fix warning display when 1.5A power supply is used
Patrice Chotard [Thu, 30 Apr 2020 16:41:05 +0000 (18:41 +0200)]
stm32mp1: Fix warning display when 1.5A power supply is used

On DK1/2 board, when a 1.5A power supply is detected, a warning
message is displayed. In this message, "1.5mA" is displayed instead
of "1.5A".

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoconfigs: stm32mp1: activate CONFIG_ERRNO_STR
Patrick Delaunay [Wed, 22 Apr 2020 12:29:20 +0000 (14:29 +0200)]
configs: stm32mp1: activate CONFIG_ERRNO_STR

Add support of errno_str, used in command pmic and regulator.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoconfigs: stm32mp1: activate Ethernet PHY Realtek
Christophe Roullier [Wed, 22 Apr 2020 12:29:19 +0000 (14:29 +0200)]
configs: stm32mp1: activate Ethernet PHY Realtek

Need Realtek driver to manage in RTL8211F the configuration of the LED.
Initialize LCR (LED Control Register) to configure green LED for Link,
yellow LED for Active

Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Christophe Roullier <christophe.roullier@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoARM: dts: stm32mp15: use DDR3 files generated by STM32CubeMX
Patrick Delaunay [Wed, 22 Apr 2020 12:29:18 +0000 (14:29 +0200)]
ARM: dts: stm32mp15: use DDR3 files generated by STM32CubeMX

Use the DDR3 dtsi files generated by STM32CubeMX 5.6.0
Speed Bin Grade = using DDR3-1066G / 8-8-8 and all others
parameters at default value.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agogpio: stm32: support gpio ops in SPL
Patrick Delaunay [Wed, 22 Apr 2020 12:29:17 +0000 (14:29 +0200)]
gpio: stm32: support gpio ops in SPL

The GPIO support is needed in SPL to managed the SD cart detect
used on stm32mp157c-ev1 and dk2 board.
So this patch activates the associated code in stm32_gpio.c.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoboard: stm32mp1: add timeout for I/O compensation ready
Patrick Delaunay [Wed, 22 Apr 2020 12:29:16 +0000 (14:29 +0200)]
board: stm32mp1: add timeout for I/O compensation ready

This patch avoids infinite loop when I/O compensation failed,
it adds a 1s timeout to detect error.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoboard: stm32mp1: remove bootdelay configuration for usb or serial boot
Patrick Delaunay [Wed, 22 Apr 2020 12:29:15 +0000 (14:29 +0200)]
board: stm32mp1: remove bootdelay configuration for usb or serial boot

It is not allowed to change the user setting of bootdelay, so
remove the check of the boot-source to disable it dynamically
in board_late_init()

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoboard: stm32mp1: set environment variable fdtfile
Patrick Delaunay [Wed, 22 Apr 2020 12:29:14 +0000 (14:29 +0200)]
board: stm32mp1: set environment variable fdtfile

For booting Linux in the generic distro mechanism and support of
FDTDIR in extlinux.conf , cmd/pxe.c retrieves the FDT file name
from "fdtfile" environment variable.

Dynamically build this variable with compatible of STMicroelectronics
boards.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoboard: stm32mp1: gt9147 IRQ before reset on EV1
Patrick Delaunay [Wed, 22 Apr 2020 12:29:13 +0000 (14:29 +0200)]
board: stm32mp1: gt9147 IRQ before reset on EV1

Software workaround for I2C issue on EV1 board,
configure the IRQ line for touchscreen before LCD reset
to fix the used I2C address.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agoboard: stm32mp1: update management of boot-led
Patrick Delaunay [Wed, 22 Apr 2020 12:29:12 +0000 (14:29 +0200)]
board: stm32mp1: update management of boot-led

Force boot-led ON and no more rely on default-state.
This patch avoid device-tree modification for U-Boot.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoboard: stm32mp1: Keep error led ON in case of low power detection
Patrice Chotard [Wed, 22 Apr 2020 12:29:11 +0000 (14:29 +0200)]
board: stm32mp1: Keep error led ON in case of low power detection

Since commit commit dd2810851eb1 ("stm32mp1: board: support of
error led on ed1/ev1 board") the attended behavior was no more
respected in case of low power source detection on DK2.

The expected behavior is either the error LED keeps blinking for ever,
or blinks 2 or 3 times and must stay ON.

Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoarm: stm32mp: spl: update error management in board_init_f
Patrick Delaunay [Wed, 22 Apr 2020 12:29:10 +0000 (14:29 +0200)]
arm: stm32mp: spl: update error management in board_init_f

Call hang when an error is detected for probe of any driver
needed for console or DDR init: clk, reset and pincontrol

NB: previous behavior with a return in board_init_f() was not correct;
    DDR is not initialized and SPL execution can't continue

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
4 years agoarm: stm32mp: remove dependency for STM32KEY
Patrick Delaunay [Wed, 22 Apr 2020 12:29:09 +0000 (14:29 +0200)]
arm: stm32mp: remove dependency for STM32KEY

This command is not more depending on fuse command, but have
direct access to BSEC misc driver, so the dependency with
can be removed CMD_FUSE

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agostm32mp: stm32prog: add support of RAM target
Patrick Delaunay [Wed, 18 Mar 2020 08:25:03 +0000 (09:25 +0100)]
stm32mp: stm32prog: add support of RAM target

Add support of RAM target in flashlayout to load kernel image
("system") and device tree ("filesystem") in DDR with DFU and
start these images.

The flashlayout.tsv is:

- 0x01 fsbl Binary none 0x00000000 tf-a.stm32
- 0x03 ssbl Binary none 0x00000000 u-boot.stm32
P 0x10 kernel System ram0 0xC2000000 uImage.bin
P 0x11 dtb FileSystem ram0 0xC4000000 dtb.bin

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agostm32mp: stm32prog: support for script
Patrick Delaunay [Wed, 18 Mar 2020 08:25:02 +0000 (09:25 +0100)]
stm32mp: stm32prog: support for script

Support an U-Boot script included in uimage instead of flashlayout file
(text file in tsv format).

This feature is used to execute this script directly when U-Boot is
loaded in DDR (for update without STM32CubeProgrammer for example).

A simple example with dfu-util only is:

$> echo "dfu 0" > script.cmd
$> mkimage -C none -A arm -T script -d script.cmd script.uimg
$> mkimage -T stm32image -a 0xC0000000 -e 0xC0000000 -d script.uimg \
  script.stm32

$> dfu-util -d 0483:df11 -a 1 -D tf-a.stm32
$> dfu-util -d 0483:df11 -a 0 -D script.stm32
$> dfu-util -d 0483:df11 -a 0 -D u-boot.stm32
$> dfu-util -d 0483:df11 -a 0 -e

Then you can used dfu-utils to update your device

To increase speed, you can also switch to fastboot protocol with:
  echo "fastboot 0" > script.cmd

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agostm32mp: stm32prog: enable videoconsole
Patrick Delaunay [Wed, 18 Mar 2020 08:25:01 +0000 (09:25 +0100)]
stm32mp: stm32prog: enable videoconsole

Enable the videoconsole during the stm32prog command execution
to have information without UART.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agostm32mp: stm32prog: add serial link support
Patrick Delaunay [Wed, 18 Mar 2020 08:25:00 +0000 (09:25 +0100)]
stm32mp: stm32prog: add serial link support

Add a support of UART, using the same protocol than MCU STM32.

See "AN5275: USB DFU/USART protocols used in STM32MP1 Series
bootloaders" for details.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agostm32mp: stm32prog: add pmic NVM update support
Patrick Delaunay [Wed, 18 Mar 2020 08:24:59 +0000 (09:24 +0100)]
stm32mp: stm32prog: add pmic NVM update support

Add a virtual partition to update the pmic non volatile memory.
(on ST board, STPMIC1).

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agostm32mp: stm32prog: add otp update support
Patrick Delaunay [Wed, 18 Mar 2020 08:24:58 +0000 (09:24 +0100)]
stm32mp: stm32prog: add otp update support

Add a virtual partition to update the STM32MP15x OTP based
on SMC service provided by TF-A.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agostm32mp: stm32prog: add support for delete option in flashlayout
Patrick Delaunay [Wed, 18 Mar 2020 08:24:57 +0000 (09:24 +0100)]
stm32mp: stm32prog: add support for delete option in flashlayout

Add support for delete option 'D' in flashlayout for
full device or for partitions

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agostm32mp: stm32prog: add support of ssbl copy
Patrick Delaunay [Wed, 18 Mar 2020 08:24:56 +0000 (09:24 +0100)]
stm32mp: stm32prog: add support of ssbl copy

For reliability of boot from NAND/SPI-NAND (with read-disturb issue)
the SSBL can be present several time, when it is indicated in the
flashlayout with "Binary(X)".
The received binary is copied X times by U-Boot on the target.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
4 years agostm32mp: stm32prog: adapt the MTD partitions
Patrick Delaunay [Wed, 18 Mar 2020 08:24:55 +0000 (09:24 +0100)]
stm32mp: stm32prog: adapt the MTD partitions

Dynamically adapt the MTD partitions in NOR/NAND/SPI-NAND when stm32prog
command detects in the parsed flash layout files:
- a fsbl partition in NOR.
- a tee partition in NOR/NAND/SPI-NAND

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>