]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
3 years agoDockerfile: Update to latest "focal" tag
Tom Rini [Sat, 11 Sep 2021 14:36:48 +0000 (10:36 -0400)]
Dockerfile: Update to latest "focal" tag

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoMerge branch '2021-09-07-ATAGs-and-related-migration' into next
Tom Rini [Wed, 8 Sep 2021 02:29:57 +0000 (22:29 -0400)]
Merge branch '2021-09-07-ATAGs-and-related-migration' into next

- Merge ATAGs and MACH_ID options to Kconfig, and then disable them for
  nearly all platforms.  A small number of platforms actively require
  this support still, and have it still enabled.  Otherwise, it's migrated
  and disabled.

3 years agoarm: Finish migration of CONFIG_MACH_TYPE
Tom Rini [Mon, 30 Aug 2021 13:16:32 +0000 (09:16 -0400)]
arm: Finish migration of CONFIG_MACH_TYPE

As this is only useful when booting with ATAGs, which are now largely
disabled, remove this value for the remaining platforms.  We have a few
places in the code that had been testing for MACH_TYPE as a sort of
internal logic.  Update those to use different but still correct CONFIG
symbols.

Cc: Phil Sutter <phil@nwl.cc>
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoarm: Add Kconfig entry for MACH_TYPE
Tom Rini [Mon, 30 Aug 2021 13:16:31 +0000 (09:16 -0400)]
arm: Add Kconfig entry for MACH_TYPE

As part of migrating support for ATAGs to Kconfig, add an option for
setting and passing MACH_TYPE.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoarm: Disable ATAGs support
Tom Rini [Mon, 30 Aug 2021 13:16:30 +0000 (09:16 -0400)]
arm: Disable ATAGs support

With the exceptions of ds109, ds414, icnova-a20-swac, nokia_rx51 and
stemmy, disable ATAG support.  A large number of platforms had enabled
support but never supported a kernel so old as to require it.  Further,
some platforms are old enough to support both, but are well supported by
devicetree booting, and have been for a number of years.  This is
because some of the ATAGs related functions have been re-used to provide
the same kind of information, but for devicetree or just generally to
inform the user.  When needed still, rename these functions to
get_board_revision() instead, to avoid conflicts.  In other cases, these
functions were simply unused, so drop them.

Cc: Andre Przywara <andre.przywara@arm.com>
Cc: Jagan Teki <jagan@amarulasolutions.com>
Cc: Phil Sutter <phil@nwl.cc>
Cc: Stefan Bosch <stefan_b@posteo.net>
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoimx: Convert SERIAL_TAG support to ENV_VARS_UBOOT_RUNTIME_CONFIG
Tom Rini [Mon, 30 Aug 2021 13:16:29 +0000 (09:16 -0400)]
imx: Convert SERIAL_TAG support to ENV_VARS_UBOOT_RUNTIME_CONFIG

No iMX platforms have supported ATAG-based booting.  They have however
re-used the CONFIG_SERIAL_TAG option as a way to enable support of
reading the OTP fuses and setting the serial# environment variable in
some cases.  Change the warp7 support to use this symbol, use this for
updating the rest of the imx7 code, and update the imx8 conditionals.

Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: NXP i.MX U-Boot Team <uboot-imx@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoConvert CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG to Kconfig
Tom Rini [Mon, 30 Aug 2021 13:16:28 +0000 (09:16 -0400)]
Convert CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG to Kconfig

This converts the following to Kconfig:
   CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoconfigs: Resync with savedefconfig
Tom Rini [Sat, 4 Sep 2021 19:47:53 +0000 (15:47 -0400)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoMerge branch '2021-09-04-makefile-cleanups-part-b' into next
Tom Rini [Sat, 4 Sep 2021 19:43:59 +0000 (15:43 -0400)]
Merge branch '2021-09-04-makefile-cleanups-part-b' into next

- Further Makefile/Kconfig namespace cleanups from Simon.  This migrates
  a number of symbols to Kconfig and replaces some inconsistencies
  between CONFIG_FOO and CONFIG_SPL_FOO_SUPPORT/CONFIG_TPL_FOO_SUPPORT.

3 years agonet: Move network rules to drivers/net
Simon Glass [Sun, 8 Aug 2021 18:20:31 +0000 (12:20 -0600)]
net: Move network rules to drivers/net

The code under drivers/net is related to ethernet networking drivers, in
some fashion or another.  Drop these from the top-level Makefile and
also move the phy rule into drivers/net/Makefile which is where it
belongs.  Make the new rule for drivers/net check for the build-stage
relevant ETH symbol.

Fix up some Kconfig dependencies while we're here to mirror how the
Makefile logic now works.

Signed-off-by: Simon Glass <sjg@chromium.org>
[trini: Introduce ETH, Kconfig dependency changes, am43xx fix]
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agonet: Rename SPL_NET_SUPPORT to SPL_NET
Simon Glass [Sun, 8 Aug 2021 18:20:30 +0000 (12:20 -0600)]
net: Rename SPL_NET_SUPPORT to SPL_NET

Rename this option so that CONFIG_IS_ENABLED can be used with it.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agopower: Refactor Makefile rules
Simon Glass [Sun, 8 Aug 2021 18:20:29 +0000 (12:20 -0600)]
power: Refactor Makefile rules

Move the power/ rules into drivers/power to avoid clutter in the Makefile
and drivers/Makefile files.

We must select SPL_POWER if SPL_POWER_DOMAIN is used, since the two are
currently independent and boards do not necessarily enable SPL_POWER.

Add a TPL_POWER as well, as that is used by one board.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agopower: Add a POWER config
Simon Glass [Sun, 8 Aug 2021 18:20:28 +0000 (12:20 -0600)]
power: Add a POWER config

At present we have SPL_POWER but not piain POWER. This works because
there is a special build rule in Makefile that always includes the
drivers/power directory.

It is better to have all driver directories included by drivers/Makefile
and there is already a rule in there for this purpose. It just needs a
Kconfig for U-Boot proper, so add one.

Update the pmic.h header file so that it defines the old pmic struct
always, when driver model is not in use. That will avoid build errors
for boards which enable POWER but not DM_PMIC.

Enable this option always. That seems strange at first sight, but it
actually but mimics the current Makefile behaviour. Once we can drop the
old PMICs it should be easy enough to rename DM_PMIC to POWWER, or
something similar.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agoi2c: Convert CONFIG_POWER_I2C et al to Kconfig
Simon Glass [Sun, 8 Aug 2021 18:20:27 +0000 (12:20 -0600)]
i2c: Convert CONFIG_POWER_I2C et al to Kconfig

This converts the following to Kconfig:
   CONFIG_POWER_I2C
   CONFIG_POWER_LEGACY

They are handled at the same time due to a dependency between them.
Update the Makefile rule to use legacy power only in U-Boot proper.
Unfortunately a separate rule is needed in SPL to be able to build
legacy power.  Add SPL related symbols for both, to allow for SPL-only
usage.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
[trini: More SPL related cleanups, reword commit message]
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agopower: Rename CONFIG_POWER to CONFIG_POWER_LEGACY
Simon Glass [Sun, 8 Aug 2021 18:20:26 +0000 (12:20 -0600)]
power: Rename CONFIG_POWER to CONFIG_POWER_LEGACY

This option is used in pre-driver model code and much of it has never
been converted to driver model.

We want to add a new option to enable power support, so we can use a
simple rule in the Makefile. Rename this one, which is really about
a particular implementation of power.

Also update the pmic.h header file so it either includes the legacy
API or the driver model one.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
3 years agopower: Tidy up #undef of CONFIG_DM_PMIC
Simon Glass [Sun, 8 Aug 2021 18:20:25 +0000 (12:20 -0600)]
power: Tidy up #undef of CONFIG_DM_PMIC

Add a proper Kconfig option for SPL so we can remove the hack in some of
the board config files.

This involves adding CONFIG_SPL_DM_PMIC to some of the configs as well
as updateing the Makefile rule for PMIC_RK8XX to exclude SPL.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
[trini: Add SPL_PMIC_RK8XX, enable when needed, handle undef of
        CONFIG_DM_PMIC_PFUZE100 as well]
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agogpio: Add a GPIO config
Simon Glass [Sun, 8 Aug 2021 18:20:24 +0000 (12:20 -0600)]
gpio: Add a GPIO config

At present we have SPL_GPIO and TPL_GPIO but not piain GPIO. This
works because there is a special build rule in Makefile that always
includes the drivers/gpio directory.

It is better to have all driver directories included by drivers/Makefile
and there is already a rule in there for this purpose. It just needs a
Kconfig for U-Boot proper, so add one.

Enable the option always for now, since this mimics current behaviour.
This can be updated once DM_GPIO is used everywhere.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agotegra: gpio: Drop use of CONFIG_xxx variables
Simon Glass [Sun, 8 Aug 2021 18:20:23 +0000 (12:20 -0600)]
tegra: gpio: Drop use of CONFIG_xxx variables

It is not a good idea to use things called CONFIG_xxx in the source code
since this prefix is reserved for use by Kconfig. Rename these variables.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agoMakefile: Move drivers/dma/ into drivers/Makefile
Simon Glass [Sun, 8 Aug 2021 18:20:22 +0000 (12:20 -0600)]
Makefile: Move drivers/dma/ into drivers/Makefile

This rule should not be in the top-level Makefile. Move it, making use
of the new LEGACY_DMA Kconfig.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agoConvert CONFIG_DMA_LPC32XX to Kconfig
Simon Glass [Sun, 8 Aug 2021 18:20:21 +0000 (12:20 -0600)]
Convert CONFIG_DMA_LPC32XX to Kconfig

This converts the following to Kconfig:
   CONFIG_DMA_LPC32XX

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agoti: Convert CONFIG_TI_EDMA3 to Kconfig
Simon Glass [Sun, 8 Aug 2021 18:20:20 +0000 (12:20 -0600)]
ti: Convert CONFIG_TI_EDMA3 to Kconfig

This converts the following to Kconfig:
   CONFIG_TI_EDMA3

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
3 years agodma: Add a Kconfig for legacy DMA
Simon Glass [Sun, 8 Aug 2021 18:20:19 +0000 (12:20 -0600)]
dma: Add a Kconfig for legacy DMA

We cannot use the existing DMA config for the MCD driver because it is
not migrated to driver model. In order to move it to drivers/Makefile
we need some sort of option for it. Add a new DMA_LEGACY option, which
also acts as a signal that it should be migrated.

Enable this for devkit3250 which uses CONFIG_DMA_LPC32XX which is not
converted to Kconfig.

For now this is not used in the Makefile. That update happens in a
following patch.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agoMakefile: Unify the rules for BOOTCOUNT_LIMIT
Simon Glass [Sun, 8 Aug 2021 18:20:18 +0000 (12:20 -0600)]
Makefile: Unify the rules for BOOTCOUNT_LIMIT

Use a single rule that works for all phases.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agosata: Rename SATA_SUPPORT to SATA
Simon Glass [Sun, 8 Aug 2021 18:20:17 +0000 (12:20 -0600)]
sata: Rename SATA_SUPPORT to SATA

Rename this options so that CONFIG_IS_ENABLED can be used with it.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agoppc: Rename MPC8XXX_INIT_DDR_SUPPORT to MPC8XXX_INIT_DDR
Simon Glass [Sun, 8 Aug 2021 18:20:16 +0000 (12:20 -0600)]
ppc: Rename MPC8XXX_INIT_DDR_SUPPORT to MPC8XXX_INIT_DDR

Rename these options so that CONFIG_IS_ENABLED can be used with them.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agoRename CACHE_SUPPORT to CACHE
Simon Glass [Sun, 8 Aug 2021 18:20:15 +0000 (12:20 -0600)]
Rename CACHE_SUPPORT to CACHE

Rename this option so that CONFIG_IS_ENABLED can be used with it.

Oddly there is already an SPL_CACHE option. Drop it in favour of this one.

Drop the special SPL Makefile rule which is now superfluous.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agospi: Rename SPI_SUPPORT to SPI
Simon Glass [Sun, 8 Aug 2021 18:20:14 +0000 (12:20 -0600)]
spi: Rename SPI_SUPPORT to SPI

Rename these options so that CONFIG_IS_ENABLED can be used with them.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agoserial: Add a SERIAL config
Simon Glass [Sun, 8 Aug 2021 18:20:13 +0000 (12:20 -0600)]
serial: Add a SERIAL config

At present we have SPL_SERIAL and TPL_SERIAL but not piain SERIAL. This
works because there is a special build rule in Makefile that always
includes the drivers/serial directory.

It is better to have all driver directories included by drivers/Makefile
and there is already a rule in there for this purpose. It just needs a
Kconfig for U-Boot proper, so add one.

It is always enabled, for now, since that mimics the current behaviour.
It should be possible to drop the strange 'SERIAL_PRESENT' option at some
point and use SERIAL instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agoserial: Rename SERIAL_SUPPORT to SERIAL
Simon Glass [Sun, 8 Aug 2021 18:20:12 +0000 (12:20 -0600)]
serial: Rename SERIAL_SUPPORT to SERIAL

Rename these options so that CONFIG_IS_ENABLED can be used with them.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agortc: Rename RTC_SUPPORT to RTC
Simon Glass [Sun, 8 Aug 2021 18:20:11 +0000 (12:20 -0600)]
rtc: Rename RTC_SUPPORT to RTC

Rename these options so that CONFIG_IS_ENABLED can be used with them.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agopch: Rename PCH_SUPPORT to PCH
Simon Glass [Sun, 8 Aug 2021 18:20:10 +0000 (12:20 -0600)]
pch: Rename PCH_SUPPORT to PCH

Rename these options so that CONFIG_IS_ENABLED can be used with them.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agommc: Rename MMC_SUPPORT to MMC
Simon Glass [Sun, 8 Aug 2021 18:20:09 +0000 (12:20 -0600)]
mmc: Rename MMC_SUPPORT to MMC

Rename these options so that CONFIG_IS_ENABLED can be used with them.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
[trini: Fixup some incorrect renames]
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoMerge branch '2021-09-03-xyz-modem-fixes' into next
Tom Rini [Fri, 3 Sep 2021 21:15:44 +0000 (17:15 -0400)]
Merge branch '2021-09-03-xyz-modem-fixes' into next

- Assorted x/y/z modem fixes from Pali

3 years agoxyz-modem: Allow to cancel transfer also by CTRL+C
Pali Rohár [Tue, 3 Aug 2021 14:28:44 +0000 (16:28 +0200)]
xyz-modem: Allow to cancel transfer also by CTRL+C

Currently it is possible to cancel loadx and loady commands by pressing
CTRL+X (CAN character) at least 3 times quickly.

All other U-Boot commands, including loadb and loads can be cancelled by
CTRL+C. So allow it also in xyz-modem code used by loadx and loady
commands. Implement it by handling CTRL+C (ETX character) in the same way
as CTRL+X (CAN character).

Due to how x/y-modem protocol works, it is required to press
CTRL+C or CTRL+X at least 3 times quickly.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoxyz-modem: Show information about finished transfer
Pali Rohár [Tue, 3 Aug 2021 14:28:43 +0000 (16:28 +0200)]
xyz-modem: Show information about finished transfer

Show "## Start Addr" or "## Binary (...) download aborted" information like
in Kermit "loadb" command.

Signed-off-by: Pali Rohár <pali@kernel.org>
3 years agoxyz-modem: Properly abort/terminate transfer on error
Pali Rohár [Tue, 3 Aug 2021 14:28:42 +0000 (16:28 +0200)]
xyz-modem: Properly abort/terminate transfer on error

Transfer termination tries to instruct sender that transfer was terminated.

Print error message and indicates aborted transfer in return value.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoxyz-modem: Close stream after processing/sending terminate sequence
Pali Rohár [Tue, 3 Aug 2021 14:28:41 +0000 (16:28 +0200)]
xyz-modem: Close stream after processing/sending terminate sequence

Obviously it is not possible to send terminate sequence over stream after
closing stream.

Signed-off-by: Pali Rohár <pali@kernel.org>
3 years agoxyz-modem: Put xyzModem_stream_close debug diagnostic message into ZM_DEBUG()
Pali Rohár [Tue, 3 Aug 2021 14:28:40 +0000 (16:28 +0200)]
xyz-modem: Put xyzModem_stream_close debug diagnostic message into ZM_DEBUG()

This is how all other debug / diagnostic messages are handled.

Signed-off-by: Pali Rohár <pali@kernel.org>
3 years agoxyz-modem: Fix x-modem "xyzModem_eof error" at the end of file
Pali Rohár [Tue, 3 Aug 2021 14:28:39 +0000 (16:28 +0200)]
xyz-modem: Fix x-modem "xyzModem_eof error" at the end of file

In x-modem protocol EOF is not an error state at the end of file.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoxyz-modem: Fix crash after cancelling transfer
Pali Rohár [Tue, 3 Aug 2021 14:28:38 +0000 (16:28 +0200)]
xyz-modem: Fix crash after cancelling transfer

Variable xyz.len is set to -1 on error. At the end xyzModem_stream_read()
function calls memcpy() with length from variable xyz.len. If this variable
is set to -1 then value passed to memcpy is casted to unsigned value, which
means to copy whole address space. Which then cause U-Boot crash. E.g. on
arm64 it cause CPU crash: "Synchronous Abort" handler, esr 0x96000006

Fix this issue by checking that value stored in xyz.len is valid prior
trying to use it.

Signed-off-by: Pali Rohár <pali@kernel.org>
Acked-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
3 years agoRevert most of the series for adding vexpress_aemv8r support
Tom Rini [Fri, 3 Sep 2021 14:40:28 +0000 (10:40 -0400)]
Revert most of the series for adding vexpress_aemv8r support

Per a request from Andre Przywara and agreed with by Peter Hoyes, the
vexpress aemv8r support wasn't quite ready to be merged, but the
discussion had moved off list.  We should keep the first patch in the
series for now, but revert the rest.  This reverts the following
commits:

e0bd6f31ce41 doc: Add documentation for the Arm vexpress board configs
30e5a449e8c7 arm: Use armv8_switch_to_el1 env to switch to EL1
b53bbca63bf4 vexpress64: Add BASER_FVP vexpress board variant
2f5b7b74903f armv8: Add ARMv8 MPU configuration logic
37a757e227cc armv8: Ensure EL1&0 VMSA is enabled

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoMerge branch '2021-09-02-assorted-platform-and-bugfixes' into next
Tom Rini [Thu, 2 Sep 2021 22:39:28 +0000 (18:39 -0400)]
Merge branch '2021-09-02-assorted-platform-and-bugfixes' into next

- Add position independent execution support for ARMv7
- Snapdragon, synquacer, vexpress64 fixes / improvements
- Prevent NEON register use on ARMv8
- Other assorted fixes

3 years agotools: env: Handle shorter read calls
Thibault Ferrante [Tue, 24 Aug 2021 15:29:50 +0000 (17:29 +0200)]
tools: env: Handle shorter read calls

On some cases, the actual number of bytes read can be shorter
than what was requested. This can be handled gracefully by
taking this difference into account instead of exiting.

Signed-off-by: Thibault Ferrante <thibault.ferrante@gmail.com>
3 years agopsci: fix double declaration
Oleksandr Suvorov [Mon, 23 Aug 2021 21:55:39 +0000 (00:55 +0300)]
psci: fix double declaration

The prototype of psci_features() duplicated. Remove extra declaration.

Fixed: e21e3ffdd1 ("psci: Fix warnings when compiling with W=1")
Reported-by: Michael Scott <mike@foundries.io>
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
3 years agopci: iproc: fix compilation errors and warnings
Bharat Gooty [Mon, 23 Aug 2021 09:27:24 +0000 (14:57 +0530)]
pci: iproc: fix compilation errors and warnings

Signed-off-by: Bharat Gooty <bharat.gooty@broadcom.com>
3 years agomailmap: Update e-mail for Jernej Skrabec
Jernej Skrabec [Sun, 22 Aug 2021 05:23:48 +0000 (07:23 +0200)]
mailmap: Update e-mail for Jernej Skrabec

Old address doesn't exist anymore. Map it to new one.

Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Acked-by: Andre Przywara <andre.przywara@arm.com>
3 years agoARM: Prevent the compiler from using NEON registers
Samuel Holland [Sun, 22 Aug 2021 00:54:02 +0000 (19:54 -0500)]
ARM: Prevent the compiler from using NEON registers

For ARMv8-A, NEON is standard, so the compiler can use it even when no
special target flags are provided. For example, it can use stores from
NEON registers to zero-initialize large structures. GCC 11 decides to
do this inside the DRAM init code for the Allwinner H6.

However, GCC 11 has a bug where it generates misaligned NEON register
stores even with -mstrict-align. Since the MMU is not enabled this early
in SPL, the misaligned store causes an exception and breaks booting.

Work around this issue by restricting the compiler to using GPRs only,
not vector registers. This prevents any future surprises relating to
NEON use as well.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Acked-by: Andre Przywara <andre.przywara@arm.com>
3 years agodoc: Add documentation for the Arm vexpress board configs
Peter Hoyes [Thu, 19 Aug 2021 15:53:14 +0000 (16:53 +0100)]
doc: Add documentation for the Arm vexpress board configs

Create a new documentation section for Arm Ltd boards with a sub-page
for the vexpress board (FVP-A, FVP-R and Juno).

Document how the armv8_switch_to_el1 environment variable can be used
to switch between booting from S-EL2/S-EL1 at runtime on the BASER_FVP.

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
3 years agoarm: Use armv8_switch_to_el1 env to switch to EL1
Peter Hoyes [Thu, 19 Aug 2021 15:53:13 +0000 (16:53 +0100)]
arm: Use armv8_switch_to_el1 env to switch to EL1

Use the environment variable armv8_switch_to_el1 to determine whether
to switch to EL1 at runtime. This is an alternative to the
CONFIG_ARMV8_SWITCH_TO_EL1 compile-time option.

The environment variable will be ineffective if the ARMV8_MULTIENTRY
config is used.

This is required by the Armv8r64 architecture, which must be able to
boot at S-EL1 for Linux but may need to boot at other ELs for other
systems.

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
3 years agovexpress64: Add BASER_FVP vexpress board variant
Peter Hoyes [Thu, 19 Aug 2021 15:53:12 +0000 (16:53 +0100)]
vexpress64: Add BASER_FVP vexpress board variant

The BASER_FVP board variant is implemented on top of the BASE_FVP board
config (which, in turn, is based on the Juno Versatile Express board
config). They all share a similar memory map - for BASER_FVP the map is
inverted from the BASE_FVP
(https://developer.arm.com/documentation/100964/1114/Base-Platform/Base---memory/BaseR-Platform-memory-map)

 * Create new TARGET_VEXPRESS64_BASER_FVP target, which uses the same
   board config as BASE_FVP and JUNO
 * Adapt vexpress_aemv8a.h header file to support BASER_FVP (and rename
   to vexpress_aemv8.h)
 * Enable config to switch to EL1 for the BASER_FVP
 * Create vexpress_aemv8r defconfig
 * Provide an MPU memory map for the BASER_FVP

For now, only single core boot is supported.

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
[trini: Add MAINTAINERS, move BOOTCOMMAND to defconfig]
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoarmv8: Add ARMv8 MPU configuration logic
Peter Hoyes [Thu, 19 Aug 2021 15:53:11 +0000 (16:53 +0100)]
armv8: Add ARMv8 MPU configuration logic

Armv8r64 is the first Armv8 platform that only has a PMSA at the
current exception level. The architecture supplement for Armv8r64
describes new fields in ID_AA64MMFR0_EL1 which can be used to detect
whether a VMSA or PMSA is present. These fields are RES0 on Armv8a.

Add logic to read these fields and, for the protection of the memory
used by U-Boot, initialize the MPU instead of the MMU during init, then
clear the MPU regions before transition to the next stage.

Provide a default (blank) MPU memory map, which can be overridden by
board configurations.

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
3 years agoarmv8: Ensure EL1&0 VMSA is enabled
Peter Hoyes [Thu, 19 Aug 2021 15:53:10 +0000 (16:53 +0100)]
armv8: Ensure EL1&0 VMSA is enabled

On Armv8-R, the EL1&0 memory system architecture is configurable as a
VMSA or PMSA, and resets to an "architecturally unknown" value.

Add code to armv8_switch_to_el1_m which detects whether the MSA at
EL1&0 is configurable using the id_aa64mmfr0_el1 register MSA fields.
If it is we must ensure the VMSA is enabled so that a rich OS can boot.

The MSA and MSA_FRAC fields are described in the Armv8-R architecture
profile supplement (section G1.3.7):
https://developer.arm.com/documentation/ddi0600/latest/

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
3 years agoarmv8: Disable pointer authentication traps for EL1
Peter Hoyes [Thu, 19 Aug 2021 15:53:09 +0000 (16:53 +0100)]
armv8: Disable pointer authentication traps for EL1

The use of ARMv8.3 pointer authentication (PAuth) is governed by fields
in HCR_EL2, which trigger a 'trap to EL2' if not enabled. The reset
value of these fields is 'architecturally unknown' so we must ensure
that the fields are enabled (to disable the traps) if we are entering
the kernel at EL1.

The APK field disables PAuth instruction traps and the API field
disables PAuth register traps

Add code to disable the traps in armv8_switch_to_el1_m. Prior to doing
so, it checks fields in the ID_AA64ISAR1_EL1 register to ensure pointer
authentication is supported by the hardware.

The runtime checks require a second temporary register, so add this to
the EL1 transition macro signature and update 2 call sites.

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
3 years agoRevert "configs: synquacer: Make U-Boot binary position independent"
Masami Hiramatsu [Thu, 19 Aug 2021 13:15:25 +0000 (22:15 +0900)]
Revert "configs: synquacer: Make U-Boot binary position independent"

This reverts commit f7e16bb0c5362c9b01d7e6e96bf6c77fd6b3d89e, since
the U-Boot doesn't boot if it is booted directly from SPI-NOR with
CONFIG_POSITION_INDEPENDENT=y. Unless fixing this issue, it is better
to revert this change.

Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
3 years agolib: add crc16.o if CONFIG_MMC_SPI_CRC_ON for SPL build
Andreas Schwab [Tue, 17 Aug 2021 10:51:34 +0000 (12:51 +0200)]
lib: add crc16.o if CONFIG_MMC_SPI_CRC_ON for SPL build

CONFIG_MMC_SPI_CRC_ON needs the crc16 functions, but it was not included
in an SPL build.  For non-SPL builds, crc16.o is already added
unconditionally.  This also removes CONFIG_SPL_YMODEM_SUPPORT from the
sifive board configs, which is only relevant for some ARM boards and was
only set for its side effect of adding crc16.o.

3 years agocmd/part: correct alignment of partition list
Heinrich Schuchardt [Thu, 5 Aug 2021 22:51:46 +0000 (00:51 +0200)]
cmd/part: correct alignment of partition list

When running 'part list' for an ISO partition the numbers are not under the
labels.

Correct the alignment of the ISO partition list. With the patch the
output looks like:

    Part   Start     Sect x Size Type
      1     3720     5024    512 U-Boot

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 years agoarm: mach-snapdrgon: misc: Simplify msm_generate_mac_addr()
Stephan Gerhold [Tue, 3 Aug 2021 10:12:38 +0000 (12:12 +0200)]
arm: mach-snapdrgon: misc: Simplify msm_generate_mac_addr()

The logic in msm_generate_mac_addr() was originally taken from the LK
bootloader where the serial number is a string and must be parsed first.
However, in U-Boot msm_board_serial() returns an u32 and
msm_generate_mac_addr() has quite complicated code that will first
print it as a hex string and then immediately parse it again.

What this function actually does at the end is to put the serial number
encoded as big endian (the order used for the hex string) into the u8 *mac.
Use put_unaligned_be32() to do that with bit shifts instead of going
through the string format.

This should be slightly more efficient and cleaner but does not result
in any functional difference.

Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
3 years agoarm: mach-snapdragon: misc: Initialize eMMC if necessary
Stephan Gerhold [Tue, 3 Aug 2021 10:12:37 +0000 (12:12 +0200)]
arm: mach-snapdragon: misc: Initialize eMMC if necessary

At the moment U-Boot produces an empty MAC address (02:00:00:00:00:00)
if the eMMC is not used by anything in U-Boot (e.g. with
CONFIG_ENV_IS_NOWHERE=y instead of having the environment on eMMC).
This happens because then there is nothing that actually initializes
the eMMC and reads the "cid" that is later accessed.

To fix this, call mmc_init() to ensure the eMMC is initialized.
There is no functional difference if the eMMC is already initialized
since then mmc_init() will just return without doing anything.

Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
3 years agoarmv7: Add Position Independent Execution support
Chia-Wei Wang [Tue, 3 Aug 2021 02:50:10 +0000 (10:50 +0800)]
armv7: Add Position Independent Execution support

A U-Boot image could be loaded and executed at a different
location than it was linked at.

For example, Aspeed takes a stable release version of U-Boot image
as the golden one for recovery purposes. When the primary storage
such as flash is corrupted, the golden image would be loaded to any
SRAM/DRAM address on demands through ethernet/UART/etc and run for
rescue.

To deal with this condition, the PIE is needed as there is only one
signed, golden image, which could be however executed at different
places.

This patch adds the PIE support for ARMv7 platform.

Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
3 years agoarm: Fix option dependency with Kconfig language
Chia-Wei Wang [Tue, 3 Aug 2021 02:50:09 +0000 (10:50 +0800)]
arm: Fix option dependency with Kconfig language

Use Kconfig 'depends on' instead of #if macro to
express the option depdencies.

Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
3 years agoMerge branch '2021-09-02-assorted-fixes' into next
Tom Rini [Thu, 2 Sep 2021 13:25:43 +0000 (09:25 -0400)]
Merge branch '2021-09-02-assorted-fixes' into next

- Drop old OpenSSL support
- Add DM_HASH support, use it.
- Assorted "stemmy" platform updates
- Various bugfixes

3 years agoata: ahci-pci: Add new option CONFIG_SPL_AHCI_PCI
Pali Rohár [Sun, 15 Aug 2021 14:27:37 +0000 (16:27 +0200)]
ata: ahci-pci: Add new option CONFIG_SPL_AHCI_PCI

This new option allows to disable ahci-pci driver in SPL. Disabling it is
needed when SPL_PCI is not enabled as ahci-pci depends on PCI.

This change fixes following compile error when CONFIG_SPL_SATA_SUPPORT is
enabled and SPL_PCI is disabled.

    LD      spl/u-boot-spl
  arm-linux-gnueabihf-ld.bfd: drivers/ata/ahci.o: in function `ahci_probe_scsi_pci':
  drivers/ata/ahci.c:1205: undefined reference to `dm_pci_map_bar'
  arm-linux-gnueabihf-ld.bfd: drivers/ata/ahci.c:1215: undefined reference to `dm_pci_read_config16'
  arm-linux-gnueabihf-ld.bfd: drivers/ata/ahci.c:1216: undefined reference to `dm_pci_read_config16'
  arm-linux-gnueabihf-ld.bfd: drivers/ata/ahci.c:1220: undefined reference to `dm_pci_map_bar'
  make[1]: *** [scripts/Makefile.spl:512: spl/u-boot-spl] Error 1
  make: *** [Makefile:1977: spl/u-boot-spl] Error 2

    LD      spl/u-boot-spl
  arm-linux-gnueabihf-ld.bfd: drivers/ata/ahci-pci.o: in function `ahci_pci_probe':
  drivers/ata/ahci-pci.c:21: undefined reference to `ahci_probe_scsi_pci'
  make[1]: *** [scripts/Makefile.spl:512: spl/u-boot-spl] Error 1
  make: *** [Makefile:1977: spl/u-boot-spl] Error 2

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoata: ahci-pci: Fix dependency on DM_PCI
Pali Rohár [Sun, 15 Aug 2021 14:27:36 +0000 (16:27 +0200)]
ata: ahci-pci: Fix dependency on DM_PCI

File drivers/ata/ahci-pci.c calls function ahci_probe_scsi_pci() which is
compiled only when DM_PCI is enabled. So add missing dependency into
Kconfig.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agortc: ds1307: Fix incorrect clock reset for DS13xx
Callum Sinclair [Tue, 10 Aug 2021 02:51:15 +0000 (14:51 +1200)]
rtc: ds1307: Fix incorrect clock reset for DS13xx

The ds1307 driver also supports the DS1339 and DS1340.
However, in ds1307_rtc_reset the register writes assume that the chip
is a DS1307. This is evident in the writing of bits SQWE, RS1, RS0 to
the control register. While this applies correctly to the DS1307, on a
DS1340 the control register doesn't contain those bits (instead, the
register is used for clock calibration). By writing these bits the
clock calibration will be changed and the chip can become
non-functional after a reset call.

Signed-off-by: Callum Sinclair <callum.sinclair@alliedtelesis.co.nz>
3 years agoarm: u8500: Prefer building in thumb mode by default
Stephan Gerhold [Sat, 7 Aug 2021 13:07:24 +0000 (15:07 +0200)]
arm: u8500: Prefer building in thumb mode by default

Enabling CONFIG_SYS_THUMB_BUILD produces a significantly smaller
U-Boot binary (250 KiB vs 320 KiB) that still seems to be fully
functional. Make use of that by default but keep it as "imply" so it
can be disabled for testing in case this causes trouble for someone.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
3 years agoboard: stemmy: Update documentation
Stephan Gerhold [Sat, 7 Aug 2021 13:07:23 +0000 (15:07 +0200)]
board: stemmy: Update documentation

Over the time, the "stemmy" U-Boot board was tested on several other
Samsung smartphones based on ST-Ericsson NovaThor Ux500. Convert the
documentation to reStructuredText at doc/board/ste/stemmy.rst and
make the device list complete. Also note that the board now boots
into USB Fastboot instead of just ending up at the U-Boot prompt.

The device table is mostly taken from the postmarketOS wiki article
(https://wiki.postmarketos.org/wiki/ST-Ericsson_NovaThor_U8500).
All the newly added devices were tested by Linus Walleij.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
3 years agoboard: stemmy: Add basic Fastboot support
Stephan Gerhold [Sat, 7 Aug 2021 13:07:22 +0000 (15:07 +0200)]
board: stemmy: Add basic Fastboot support

Make use of the new drivers for ARM U8500 introduced in the U-Boot
2021.10 merge window by adding basic support for USB Fastboot with
the "stemmy" board. As a first step this will always boot directly
into USB Fastboot for now with the console displayed on the screen
to make that obvious.

Samsung uses quite strange GPT partition labels on these boards,
so also add a bunch of fastboot_partition_alias_* to make this more
easy to use.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
3 years agoarm: dts: u8500: u-boot: Add fixed clock for eMMC
Stephan Gerhold [Sat, 7 Aug 2021 13:07:21 +0000 (15:07 +0200)]
arm: dts: u8500: u-boot: Add fixed clock for eMMC

So far there is no need for a clock driver in U-Boot because the
previous boot stage leaves all the necessary clocks on. However,
some drivers in U-Boot (e.g. arm_pl180_mmci) depend on having a clock
driver to obtain the clock frequency.

Setting up the clock drivers properly is a bit tricky on U8500,
so for now add a simple fixed-clock for the eMMC that allows obtaining
the clock frequency. This should be replaced eventually if some board
actually requires enabling some of the clocks.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
3 years agoarm: dts: u8500: Update from Linux ux500-dts-for-v5.15
Stephan Gerhold [Sat, 7 Aug 2021 13:07:20 +0000 (15:07 +0200)]
arm: dts: u8500: Update from Linux ux500-dts-for-v5.15

Update ste-dbx5x0.dtsi, ste-ab8500.dtsi and ste-ab8505.dtsi with
the changes made in upstream Linux. They are taken from
https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik.git/
branch "ux500-dts-for-v5.15" (pending merge for Linux 5.15).

The only relevant change for U-Boot here is
"ARM: dts: ux500: ab8500: Link USB PHY to USB controller node" [1]
which links the USB PHY to the USB controller. This is necessary on
U-Boot because the PHY driver is implemented as part of the generic
PHY subsystem that makes use of these bindings.

[1]: https://lore.kernel.org/linux-arm-kernel/20210709182234.47232-1-stephan@gerhold.net/

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
3 years agoarm: u8500: Imply options for new drivers
Stephan Gerhold [Sat, 7 Aug 2021 13:07:19 +0000 (15:07 +0200)]
arm: u8500: Imply options for new drivers

Imply the options for new drivers added for ARM U8500 during the
U-Boot 2021.10 merge window. Adding these as "imply" in the Kconfig
avoids having to add them to all the board defconfigs but still allows
disabling them if wanted.

Also select DM_USB_GADGET if DM_USB is selected because otherwise
the Ux500 MUSB glue driver does not show up in the configuration.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
3 years agoMAINTAINERS: Add new drivers for ARM U8500
Stephan Gerhold [Sat, 7 Aug 2021 13:07:18 +0000 (15:07 +0200)]
MAINTAINERS: Add new drivers for ARM U8500

Update MAINTAINERS with various drivers for ARM U8500 that were
added during the U-Boot 2021.10 merge window.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
3 years agoloadb: Properly indicate aborted kermit transfer
Pali Rohár [Fri, 6 Aug 2021 16:07:39 +0000 (18:07 +0200)]
loadb: Properly indicate aborted kermit transfer

When k_recv() returns zero it indicates that kermit transfer was aborted.
Function do_load_serial_bin() (caller of load_serial_bin()) interprets
value ~0 as aborted transfer, so properly propagates information about
aborted transfer from k_recv() to do_load_serial_bin().

Signed-off-by: Pali Rohár <pali@kernel.org>
3 years agoscripts/checkpatch.pl: Resync with v5.13
Tom Rini [Tue, 3 Aug 2021 12:31:56 +0000 (08:31 -0400)]
scripts/checkpatch.pl: Resync with v5.13

This resyncs us with the version found in v5.13 of the Linux kernel with
the following exceptions:
- Keep our u-boot specific tests / code area.
- Change the location of checkpatch.rst (which we now import)
- Drop the "use strscpy" test as we don't have that, but do have strlcpy
  and want that used now.
- Keep debug/printf in the list for $logFunctions

And note that we now also include the spdxcheck.py tool that
checkpatch.pl supports calling out to, and include upstream's
checkpatch.rst in our develop section of the documentation.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agomkimage: clarify error message for empty input files
Thomas Hebb [Sun, 1 Aug 2021 22:23:13 +0000 (15:23 -0700)]
mkimage: clarify error message for empty input files

Currently, an empty imput file causes `mmap()` to fail, and you get an
error like "mkimage: Can't read file.img: Invalid argument", which is
extremely unintuitive and hard to diagnose if you don't know what to
look for. Add an explicit check for an empty file and provide a clear
error message instead.

We already bounds check the image size when listing and re-signing
existing images, so we only need this check here, when opening data
files going into a image.

Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agolib: -Wformat-truncation in rsa_engine_get_priv_key
Heinrich Schuchardt [Fri, 30 Jul 2021 15:05:07 +0000 (17:05 +0200)]
lib: -Wformat-truncation in rsa_engine_get_priv_key

With glibc 2.33 (Ubuntu package glibc6 2.33-0ubuntu9) building
sifive_unmatched_defconfig results in:

In file included from /usr/include/stdio.h:866,
                  from ././include/compiler.h:26,
                  from <command-line>:
In function ‘snprintf’,
     inlined from ‘rsa_engine_get_priv_key’ at ./tools/../^:273:4:
/usr/include/riscv64-linux-gnu/bits/stdio2.h:71:10: warning:
‘%s’ directive argument is null [-Wformat-truncation=]
    71 |   return __builtin___snprintf_chk (__s, __n,
__USE_FORTIFY_LEVEL - 1,
       |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    72 |        __glibc_objsize (__s), __fmt,
       |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    73 |        __va_arg_pack ());
       |        ~~~~~~~~~~~~~~~~~

Avoid passing a NULL string.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agofit: Use DM hash driver if supported
Chia-Wei Wang [Fri, 30 Jul 2021 01:08:05 +0000 (09:08 +0800)]
fit: Use DM hash driver if supported

Calculate hash using DM driver if supported.
For backward compatibility, the call to legacy
hash functions is reserved.

Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
3 years agocrypto: hash: Add software hash DM driver
Chia-Wei Wang [Fri, 30 Jul 2021 01:08:04 +0000 (09:08 +0800)]
crypto: hash: Add software hash DM driver

Add purely software-implmented drivers to support multiple
hash operations including CRC, MD5, and SHA family.

This driver is based on the new hash uclass.

Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
3 years agodm: hash: Add new UCLASS_HASH support
Chia-Wei Wang [Fri, 30 Jul 2021 01:08:03 +0000 (09:08 +0800)]
dm: hash: Add new UCLASS_HASH support

Add UCLASS_HASH for hash driver development. Thus the
hash drivers (SW or HW-accelerated) can be developed
in the DM-based fashion.

Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
3 years agolib/md5: Export progressive APIs
Chia-Wei Wang [Fri, 30 Jul 2021 01:08:02 +0000 (09:08 +0800)]
lib/md5: Export progressive APIs

Export the MD5 hash init/update/finish progressive APIs
for better flexibility.

Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
3 years agolib/rsa: Remove support for OpenSSL < 1.1.0 and libressl < 2.7.0
Alexandru Gagniuc [Thu, 29 Jul 2021 18:31:21 +0000 (13:31 -0500)]
lib/rsa: Remove support for OpenSSL < 1.1.0 and libressl < 2.7.0

Older OpenSSL and libressl versions have a slightly different API.
This require #ifdefs to support. However, we still can't support it
because the ECDSA path does not compile with these older versions.
These #ifdefs are truly a vestigial appendage.

Alternatively, the ECDSA path could be updated for older libraries,
but this requires significant extra code, and #ifdefs. Those libraries
are over three years old, and there concerns whether it makes sense to
build modern software for real world use against such old libraries.

Thusly, remove #ifdefs and code for old OpenSSL and LibreSSL support.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
3 years agoMerge branch 'next' of https://gitlab.denx.de/u-boot/custodians/u-boot-marvell into...
Tom Rini [Tue, 31 Aug 2021 23:11:15 +0000 (19:11 -0400)]
Merge branch 'next' of https://gitlab.denx.de/u-boot/custodians/u-boot-marvell into next

- Handling all DM watchdogs in watchdog_reset() (Rasmus)

3 years agoMerge branch '2021-08-31-kconfig-migrations-part2' into next
Tom Rini [Tue, 31 Aug 2021 21:52:28 +0000 (17:52 -0400)]
Merge branch '2021-08-31-kconfig-migrations-part2' into next

- Further CONFIG to Kconfig migrations
  - Some DDR related symbols
  - CONFIG_SYS_LOAD_ADDR moved, loadaddr always set in environment now.
  - Finish MX7D, convert IMX_CONFIG
  - Some RAMBOOT related options
  - L1 cache size converted and named consistently for all arches.  A
    further follow-up to rename things for even better clarity is welcome.
  - CONFIG_SKIP_LOWLEVEL_INIT, CONFIG_SYS_MALLOC_LEN

3 years agoKconfig: Remove all default n/no options
Michal Simek [Fri, 27 Aug 2021 06:48:10 +0000 (08:48 +0200)]
Kconfig: Remove all default n/no options

default n/no doesn't need to be specified. It is default option anyway.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
[trini: Rework FSP_USE_UPD portion]
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoConvert CONFIG_SYS_MALLOC_LEN to Kconfig
Tom Rini [Sun, 29 Aug 2021 01:34:49 +0000 (21:34 -0400)]
Convert CONFIG_SYS_MALLOC_LEN to Kconfig

This converts the following to Kconfig:
   CONFIG_SYS_MALLOC_LEN

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Rick Chen <rick@andestech.com>
3 years agoConvert CONFIG_SKIP_LOWLEVEL_INIT et al to Kconfig
Tom Rini [Sat, 28 Aug 2021 01:18:30 +0000 (21:18 -0400)]
Convert CONFIG_SKIP_LOWLEVEL_INIT et al to Kconfig

This converts the following to Kconfig:
   CONFIG_SKIP_LOWLEVEL_INIT
   CONFIG_SKIP_LOWLEVEL_INIT_ONLY

In order to do this, we need to introduce SPL and TPL variants of these
options so that we can clearly disable these options only in SPL in some
cases, and both instances in other cases.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoFinish converting CONFIG_SYS_CACHELINE_SIZE to Kconfig
Tom Rini [Thu, 26 Aug 2021 15:47:59 +0000 (11:47 -0400)]
Finish converting CONFIG_SYS_CACHELINE_SIZE to Kconfig

We move the SYS_CACHE_SHIFT_N options from arch/arm/Kconfig to
arch/Kconfig, and introduce SYS_CACHE_SHIFT_4 to provide a size of 16.
Introduce select statements for other architectures based on current
usage.  For MIPS, we take the existing arch-specific symbol and migrate
to the generic symbol.  This lets us remove a little bit of otherwise
unused code.

Cc: Alexey Brodkin <alexey.brodkin@synopsys.com>
Cc: Anup Patel <anup.patel@wdc.com>
Cc: Atish Patra <atish.patra@wdc.com>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: Leo <ycliang@andestech.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Sean Anderson <seanga2@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Rick Chen <rick@andestech.com>
3 years agols1046ardb_qspi*: Enable RAMBOOT_PBL
Tom Rini [Wed, 25 Aug 2021 03:11:50 +0000 (23:11 -0400)]
ls1046ardb_qspi*: Enable RAMBOOT_PBL

Based on include/configs/ls1046ardb.h it seems that CONFIG_RAMBOOT_PBL
should have been enabled, but was not.  Enable and migrate the values to
Kconfig.

Cc: Mingkai Hu <mingkai.hu@nxp.com>
Cc: Rajesh Bhagat <rajesh.bhagat@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoConvert CONFIG_RAMBOOT_PBL et al to Kconfig
Tom Rini [Wed, 25 Aug 2021 03:11:49 +0000 (23:11 -0400)]
Convert CONFIG_RAMBOOT_PBL et al to Kconfig

This converts the following to Kconfig:
   CONFIG_RAMBOOT_PBL
   CONFIG_SYS_FSL_PBL_PBI
   CONFIG_SYS_FSL_PBL_RCW

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoConvert CONFIG_QSPI_BOOT to Kconfig
Tom Rini [Wed, 25 Aug 2021 01:19:12 +0000 (21:19 -0400)]
Convert CONFIG_QSPI_BOOT to Kconfig

This converts the following to Kconfig:
   CONFIG_QSPI_BOOT

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoConvert CONFIG_SYS_FSL_DDR4 to Kconfig
Tom Rini [Wed, 25 Aug 2021 00:47:06 +0000 (20:47 -0400)]
Convert CONFIG_SYS_FSL_DDR4 to Kconfig

This converts the following to Kconfig:
   CONFIG_SYS_FSL_DDR4

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoconfigs: Remove unused IMX_NAND symbol
Tom Rini [Wed, 25 Aug 2021 00:41:04 +0000 (20:41 -0400)]
configs: Remove unused IMX_NAND symbol

The symbol CONFIG_IMX_NAND is not referenced in the code, remove it.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agonitrogen6x: Populate FDTFILE at build-time for all platforms
Tom Rini [Wed, 25 Aug 2021 00:41:03 +0000 (20:41 -0400)]
nitrogen6x: Populate FDTFILE at build-time for all platforms

Rather than using CONFIG_SABRELITE to set FDTFILE for only that
platform, switch to always setting this based on
CONFIG_DEFAULT_DEVICE_TREE as this should always match the kernel
device tree name anyhow.

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Troy Kisky <troy.kisky@boundarydevices.com>
3 years agonitrogen6x: Migrate DDR_MB to Kconfig
Tom Rini [Wed, 25 Aug 2021 00:41:02 +0000 (20:41 -0400)]
nitrogen6x: Migrate DDR_MB to Kconfig

Move the CONFIG_DDR_MB symbol to Kconfig.  A later clean-up would be to
make dynamic memory size detection work based on how this is done on
other i.MX6 platforms.

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Troy Kisky <troy.kisky@boundarydevices.com>
3 years agoConvert CONFIG_SPL to Kconfig
Tom Rini [Wed, 25 Aug 2021 00:41:01 +0000 (20:41 -0400)]
Convert CONFIG_SPL to Kconfig

This converts the following to Kconfig:
   CONFIG_SPL

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoimx: Finish migration of IMX_CONFIG to Kconfig
Tom Rini [Wed, 25 Aug 2021 00:41:00 +0000 (20:41 -0400)]
imx: Finish migration of IMX_CONFIG to Kconfig

- Provide a default Kconfig value of the default script
- Largely continue to define this via the board Kconfig file
- For the boards that select a script based on defconfig rather than
  TARGET, keep this within the defconfig.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoimx: Introduce CONFIG_MACH_IMX
Tom Rini [Wed, 25 Aug 2021 00:40:59 +0000 (20:40 -0400)]
imx: Introduce CONFIG_MACH_IMX

Currently, there is no over-arching symbol for access to
arch/arm/mach-imx nor the CONFIG symbols that are common over all of
these related platforms.  This new CONFIG symbol will allow us to start
down this path.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoConvert CONFIG_MX7D to Kconfig
Tom Rini [Mon, 23 Aug 2021 20:35:25 +0000 (16:35 -0400)]
Convert CONFIG_MX7D to Kconfig

This converts the following to Kconfig:
   CONFIG_MX7D

Cc: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoConvert CONFIG_SYS_LOAD_ADDR to Kconfig
Tom Rini [Mon, 23 Aug 2021 14:25:31 +0000 (10:25 -0400)]
Convert CONFIG_SYS_LOAD_ADDR to Kconfig

Now that we have consistent usage, migrate this symbol to Kconfig.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Rick Chen <rick@andestech.com>
3 years agoglobal: Convert CONFIG_LOADADDR to CONFIG_SYS_LOADADDR
Tom Rini [Mon, 23 Aug 2021 14:25:30 +0000 (10:25 -0400)]
global: Convert CONFIG_LOADADDR to CONFIG_SYS_LOADADDR

- In most of the codebase, we reference CONFIG_SYS_LOAD_ADDR and not
  CONFIG_LOADADDR.
- Generally, CONFIG_SYS_LOADADDR is set to CONFIG_LOADADDR and then as
  noted, we use CONFIG_SYS_LOADADDR.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoqfw: Switch to CONFIG_SYS_LOAD_ADDR from CONFIG_LOADADDR
Tom Rini [Mon, 23 Aug 2021 14:25:29 +0000 (10:25 -0400)]
qfw: Switch to CONFIG_SYS_LOAD_ADDR from CONFIG_LOADADDR

All platforms define CONFIG_SYS_LOAD_ADDR, but only some define
CONFIG_LOADADDR.  Very very rarely are these not the same address, and
qemu-ppce500 is one such case.  However, based on reading the history of
the code, this mismatched value was simply a copy-paste from other
PowerPC platforms where it is this unused currently.  Switch the code to
use CONFIG_SYS_LOAD_ADDR and update the documentation.

Cc: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>