platform/kernel/u-boot.git
2 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)

2 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

2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 years agoConvert CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT to Kconfig
Tom Rini [Sat, 21 Aug 2021 17:50:19 +0000 (13:50 -0400)]
Convert CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT to Kconfig

This converts the following to Kconfig:
   CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agonxp: Migrate a number of DDR related symbols to Kconfig
Tom Rini [Sat, 21 Aug 2021 17:50:18 +0000 (13:50 -0400)]
nxp: Migrate a number of DDR related symbols to Kconfig

- Guard most of the options in drivers/ddr/fsl/Kconfig with
  SYS_FSL_DDR || SYS_FSL_MMDC.
- Migrate FSL_DMA, DDR_ECC, DDR_ECC_CMD, and ECC_INIT_VIA_DDRCONTROLLER
  to Kconfig.
- Clean up the logic for including the DDR_ECC_CMD code.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agonxp: Migrate CONFIG_DDR_CLK_FREQ to Kconfig
Tom Rini [Sat, 21 Aug 2021 17:50:17 +0000 (13:50 -0400)]
nxp: Migrate CONFIG_DDR_CLK_FREQ to Kconfig

As this symbol can either be a fixed value or the function
get_board_ddr_clk, migration is tricky.  Introduce a choice of DYNAMIC
or STATIC_DDR_CLK_FREQ.  If DYNAMIC, we continue to use the board
defined get_board_ddr_clk function.  If STATIC, set CONFIG_DDR_CLK_FREQ
to that value and now include/clock_legacy.h contains the function
prototype or defines get_board_ddr_clk() to that static value.  Update
callers to test for DYNAMIC or STATIC.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoddr: Migrate DDR_SPD to Kconfig
Tom Rini [Sat, 21 Aug 2021 17:50:16 +0000 (13:50 -0400)]
ddr: Migrate DDR_SPD to Kconfig

Move the symbol that controls building some JEDEC SPD support functions
to Kconfig.  This is required on the TI keystone 2 platforms and very
frequently (but not always) used on large number of Freescale/NXP
platforms, so use imply there.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agomvebe: Migrate CONFIG_DDR_LOG_LEVEL to Kconfig
Tom Rini [Sat, 21 Aug 2021 17:50:15 +0000 (13:50 -0400)]
mvebe: Migrate CONFIG_DDR_LOG_LEVEL to Kconfig

Move this specific option to Kconfig.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agomvebu: ddr: Rename CONFIG_DDR_FIXED_SIZE to CONFIG_SYS_SDRAM_SIZE
Tom Rini [Sat, 21 Aug 2021 17:50:14 +0000 (13:50 -0400)]
mvebu: ddr: Rename CONFIG_DDR_FIXED_SIZE to CONFIG_SYS_SDRAM_SIZE

We have a number of CONFIG symbols to express the fixed size of system
memory.  For now, rename CONFIG_DDR_FIXED_SIZE to CONFIG_SYS_SDRAM_SIZE
and adjust usage to match that CONFIG_SYS_SDRAM_SIZE expects the entire
size rather than MiB.

Cc: Marek Behún <marek.behun@nic.cz>
Cc: Stefan Roese <sr@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Marek Behún <marek.behun@nic.cz>
2 years agomvebu: Migrate CONFIG_DDR_32BIT/64BIT to Kconfig
Tom Rini [Sat, 21 Aug 2021 17:50:13 +0000 (13:50 -0400)]
mvebu: Migrate CONFIG_DDR_32BIT/64BIT to Kconfig

Move CONFIG_DDR_32BIT/64BIT to Kconfig as a choice for Armada XP
platforms.  Make 64bit the default as this mirrors the current code.

Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agosandbox: add test of wdt-uclass' watchdog_reset()
Rasmus Villemoes [Thu, 19 Aug 2021 09:57:06 +0000 (11:57 +0200)]
sandbox: add test of wdt-uclass' watchdog_reset()

Check that the watchdog_reset() implementation in wdt-uclass behaves
as expected:

- resets all activated watchdog devices
- leaves unactivated/stopped devices alone
- that the rate-limiting works, with a per-device threshold

Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2 years agosandbox: add test of wdt_gpio driver
Rasmus Villemoes [Thu, 19 Aug 2021 09:57:05 +0000 (11:57 +0200)]
sandbox: add test of wdt_gpio driver

It seems that no other test has claimed gpio_a:7 yet, so use that.

The only small wrinkle is modifying the existing wdt test to use
uclass_get_device_by_driver() since we now have two UCLASS_WDT
instances in play, so it's a little more robust to fetch the device by
driver and not merely uclass+index.

Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2 years agowatchdog: add gpio watchdog driver
Rasmus Villemoes [Thu, 19 Aug 2021 09:57:04 +0000 (11:57 +0200)]
watchdog: add gpio watchdog driver

A rather common kind of external watchdog circuit is one that is kept
alive by toggling a gpio. Add a driver for handling such a watchdog.

The corresponding linux driver apparently has support for some
watchdog circuits which can be disabled by tri-stating the gpio, but I
have never actually encountered such a chip in the wild; the whole
point of adding an external watchdog is usually that it is not in any
way under software control. For forward-compatibility, and to make DT
describe the hardware, the current driver only supports devices that
have the always-running property. I went a little back and forth on
whether I should fail ->probe or only ->start, and ended up deciding
->start was the right place.

The compatible string is probably a little odd as it has nothing to do
with linux per se - however, I chose that to make .dts snippets
reusable between device trees used with U-Boot and linux, and this is
the (only) compatible string that linux' corresponding driver and DT
binding accepts. I have asked whether one should/could add "wdt-gpio"
to that binding, but the answer was no:

  https://lore.kernel.org/lkml/CAL_JsqKEGaFpiFV_oAtE+S_bnHkg4qry+bhx2EDs=NSbVf_giA@mail.gmail.com/

If someone feels strongly about this, I can certainly remove the
"linux," part from the string - it probably wouldn't the only place where
one can't reuse a DT snippet as-is between linux and U-Boot.

Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2 years agowatchdog: wdt-uclass.c: handle all DM watchdogs in watchdog_reset()
Rasmus Villemoes [Thu, 19 Aug 2021 09:57:03 +0000 (11:57 +0200)]
watchdog: wdt-uclass.c: handle all DM watchdogs in watchdog_reset()

A board can have and make use of more than one watchdog device, say
one built into the SOC and an external gpio-petted one. Having
wdt-uclass only handle the first is both a little arbitrary and
unexpected.

So change initr_watchdog() so we visit (probe) all DM watchdog
devices, and call the init_watchdog_dev helper for each.

Similarly let watchdog_reset() loop over the whole uclass - each
having their own ratelimiting metadata, and a separate "is this device
running" flag.

This gets rid of the watchdog_dev member of struct global_data.  We
do, however, still need the GD_FLG_WDT_READY set in
initr_watchdog(). This is because watchdog_reset() can get called
before DM is ready, and I don't think we can call uclass_get() that
early.

The current code just returns 0 if "getting" the first device fails -
that can of course happen because there are no devices, but it could
also happen if its ->probe call failed. In keeping with that, continue
with the handling of the remaining devices even if one fails to
probe. This is also why we cannot use uclass_probe_all().

If desired, it's possible to later add a per-device "u-boot,autostart"
boolean property, so that one can do CONFIG_WATCHDOG_AUTOSTART
per-device.

Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2 years agoboard: x530: switch to wdt_stop_all()
Rasmus Villemoes [Thu, 19 Aug 2021 09:57:02 +0000 (11:57 +0200)]
board: x530: switch to wdt_stop_all()

Since the gd->watchdog_dev member is going away, switch to using the
new wdt_stop_all() helper.

While here, clean up the preprocessor conditional: The ->watchdog_dev
member is actually guarded by CONFIG_WDT [disabling that in
x530_defconfig while keeping CONFIG_WATCHDOG breaks the build], and in
the new world order so is the existence of the wdt_stop_all()
function.

Actually, existence of wdt_stop_all() depends on CONFIG_${SPL_}WDT, so
really spell the condition using CONFIG_IS_ENABLED, and make it a C
rather than cpp if.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2 years agowatchdog: wdt-uclass.c: add wdt_stop_all() helper
Rasmus Villemoes [Thu, 19 Aug 2021 09:57:01 +0000 (11:57 +0200)]
watchdog: wdt-uclass.c: add wdt_stop_all() helper

Since the watchdog_dev member of struct global_data is going away in
favor of the wdt-uclass handling all watchdog devices, prepare for
that by adding a helper to call wdt_stop() on all known devices.

If an error is encountered, still do wdt_stop() on remaining devices,
but remember and return the first error seen.

Initially, this will only be used in one single
place (board/alliedtelesis/x530/x530.c).

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2 years agosandbox: disable CONFIG_WATCHDOG_AUTOSTART
Rasmus Villemoes [Thu, 19 Aug 2021 09:57:00 +0000 (11:57 +0200)]
sandbox: disable CONFIG_WATCHDOG_AUTOSTART

For the unit tests, it is more convenient if the tests are in charge
of when the watchdog devices are started and stopped, so prevent
wdt-uclass from doing it automatically.

Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2 years agowatchdog: wdt-uclass.c: keep track of each device's running state
Rasmus Villemoes [Thu, 19 Aug 2021 09:56:59 +0000 (11:56 +0200)]
watchdog: wdt-uclass.c: keep track of each device's running state

As a step towards handling all DM watchdogs in watchdog_reset(), use a
per-device flag to keep track of whether the device has been started
instead of a bit in gd->flags.

We will still need that bit to know whether we are past
initr_watchdog() and hence have populated gd->watchdog_dev -
incidentally, that is how it was used prior to commit 9c44ff1c5f3c.

Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2 years agowatchdog: wdt-uclass.c: refactor initr_watchdog()
Rasmus Villemoes [Thu, 19 Aug 2021 09:56:58 +0000 (11:56 +0200)]
watchdog: wdt-uclass.c: refactor initr_watchdog()

In preparation for handling all DM watchdogs in watchdog_reset(), pull
out the code which handles starting (or not) the gd->watchdog_dev
device.

Include the device name in various printfs.

Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2 years agowatchdog: wdt-uclass.c: neaten UCLASS_DRIVER definition
Rasmus Villemoes [Thu, 19 Aug 2021 09:56:57 +0000 (11:56 +0200)]
watchdog: wdt-uclass.c: neaten UCLASS_DRIVER definition

The addition of .pre_probe and .per_device_auto made this look
bad. Fix it.

Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2 years agowatchdog: wdt-uclass.c: introduce struct wdt_priv
Rasmus Villemoes [Thu, 19 Aug 2021 09:56:56 +0000 (11:56 +0200)]
watchdog: wdt-uclass.c: introduce struct wdt_priv

As preparation for having the wdt-uclass provided watchdog_reset()
function handle all DM watchdog devices, and not just the first such,
introduce a uclass-owned struct to hold the reset_period and
next_reset, so these become per-device instead of being static
variables.

No functional change intended.

Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2 years agowatchdog: wdt-uclass.c: use wdt_start() in wdt_expire_now()
Rasmus Villemoes [Thu, 19 Aug 2021 09:56:55 +0000 (11:56 +0200)]
watchdog: wdt-uclass.c: use wdt_start() in wdt_expire_now()

wdt_start() does the "no ->start? return -ENOSYS" check, don't
open-code that in wdt_expire_now().

Also, wdt_start() maintains some global (and later some per-device)
state, which would get out of sync with this direct method call - not
that it matters much here since the board is supposed to reset very
soon.

Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2 years agoglobal: Remove unused or unnecessary CONFIG symbols related to DDR
Tom Rini [Sat, 21 Aug 2021 17:50:12 +0000 (13:50 -0400)]
global: Remove unused or unnecessary CONFIG symbols related to DDR

These symbols are now either unused or were only used within the config
file to determine other logic, which could be done in a way that doesn't
further pollute the CONFIG namespace.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoMerge branch '2021-08-30-kconfig-migrations-part1' into next
Tom Rini [Mon, 30 Aug 2021 20:44:54 +0000 (16:44 -0400)]
Merge branch '2021-08-30-kconfig-migrations-part1' into next

- Begin merging some Kconfig migration, and CONFIG namespace cleanup
  series in.  This gives us:
  - A number of I2C symbols migrated over
  - DWC2, i8042, altera_spi and a few other areas updated to use CFG not
    CONFIG for the concept of "configuration space" defines.
  - Rename CONFIG_EXTRA_ENV_BOARD_SETTINGS to EXTRA_ENV_BOARD_SETTINGS
  - Some dead code removal.
  - Rename a number of CONFIG symbols that were only referenced within
    the config header to not use CONFIG as a prefix.

2 years agoKconfig: Use spaces not tabs in Kconfig entires
Tom Rini [Thu, 19 Aug 2021 20:23:58 +0000 (16:23 -0400)]
Kconfig: Use spaces not tabs in Kconfig entires

While the Kconfig language seems to accept either form of whitespace, we
use a space throughout the project, except in these spots.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoastro_mcf5373l: Rework ASTRO_ID logic
Tom Rini [Thu, 19 Aug 2021 19:16:15 +0000 (15:16 -0400)]
astro_mcf5373l: Rework ASTRO_ID logic

Rather than using CONFIG namespace for logic internal to
include/configs/astro_mcf5373l.h to select ASTRO_ID (and populate the
default environment), strip CONFIG from the various options used and
set.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agompc83xx: Update comment
Tom Rini [Thu, 19 Aug 2021 19:15:06 +0000 (15:15 -0400)]
mpc83xx: Update comment

Update the comment here to refer to PCI_CONFIG_ADDRESS rather than
CONFIG_ADDRESS.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agospi: altera_spi: Do not abuse CONFIG namespace
Tom Rini [Thu, 19 Aug 2021 19:06:54 +0000 (15:06 -0400)]
spi: altera_spi: Do not abuse CONFIG namespace

The value CONFIG_ALTERA_SPI_IDLE_VAL is never re-defined by a board.
Rename this to ALTERA_SPI_IDLE_VAL.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agovideo: Remove ati_radeon_fb
Tom Rini [Thu, 19 Aug 2021 19:06:01 +0000 (15:06 -0400)]
video: Remove ati_radeon_fb

This driver is currently unused.  Remove.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agoglobal: Remove dead code that starts with CONFIG_[0-9A]
Tom Rini [Thu, 19 Aug 2021 19:02:35 +0000 (15:02 -0400)]
global: Remove dead code that starts with CONFIG_[0-9A]

This removes a number of spots of dead code based on symbols that start
with CONFIG_[0-9] or CONFIG_A.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoi8042: Do not abuse CONFIG namespace
Tom Rini [Thu, 19 Aug 2021 18:58:00 +0000 (14:58 -0400)]
i8042: Do not abuse CONFIG namespace

This driver uses the CONFIG namespace to set the chips internal CONFIG
namespace related bits.  However, CONFIG is reserved for the top-level
Kconfig based configuration system.  Use CFG as the namespace here
instead to avoid pollution.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agoppc: Rework some hard-coded BOOTCOMMANDS
Tom Rini [Thu, 19 Aug 2021 18:29:00 +0000 (14:29 -0400)]
ppc: Rework some hard-coded BOOTCOMMANDS

There are an assortment of hard-coded CONFIG_BOOTCOMMAND options in some
board headers.  Rework these so that they do not add to the CONFIG
namespace.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoarm: Migrate GICV2 / GICV3 to Kconfig
Tom Rini [Thu, 19 Aug 2021 18:19:39 +0000 (14:19 -0400)]
arm: Migrate GICV2 / GICV3 to Kconfig

Migrate CONFIG_GICV2 and CONFIG_GICV3 to Kconfig.  We still have the GIC
related registers that need to be handled more cleanly but start by
moving this symbol to Kconfig.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agonand: vf610_nfc: Do not abuse CONFIG namespace
Tom Rini [Thu, 19 Aug 2021 17:56:20 +0000 (13:56 -0400)]
nand: vf610_nfc: Do not abuse CONFIG namespace

This driver uses the CONFIG namespace to set the chips internal CONFIG
namespace related bits.  However, CONFIG is reserved for the top-level
Kconfig based configuration system.  Use CFG as the namespace here
instead to avoid pollution.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agovarisys: Remove dead code
Tom Rini [Thu, 19 Aug 2021 03:12:39 +0000 (23:12 -0400)]
varisys: Remove dead code

The platforms this code was for have been removed, drop this support
code as well.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoREADME: Remove some old i2c related text
Tom Rini [Thu, 19 Aug 2021 03:12:38 +0000 (23:12 -0400)]
README: Remove some old i2c related text

These sections are no longer relevant, remove.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Minkyu Kang <mk7.kang@samsung.com>
2 years agoConvert CONFIG_I2C_SET_DEFAULT_BUS_NUM et al to Kconfig
Tom Rini [Thu, 19 Aug 2021 03:12:37 +0000 (23:12 -0400)]
Convert CONFIG_I2C_SET_DEFAULT_BUS_NUM et al to Kconfig

This converts the following to Kconfig:
   CONFIG_I2C_SET_DEFAULT_BUS_NUM
   CONFIG_I2C_DEFAULT_BUS_NUMBER

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agotegra: Cleanup I2C support
Tom Rini [Thu, 19 Aug 2021 03:12:36 +0000 (23:12 -0400)]
tegra: Cleanup I2C support

Remove the irrelevant section from the README and remove the
non-functional SPL-undef section.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoi2c: fsl_i2c: Migrate to Kconfig
Tom Rini [Thu, 19 Aug 2021 03:12:35 +0000 (23:12 -0400)]
i2c: fsl_i2c: Migrate to Kconfig

- As there are no boards that use different values for speed / slave on
  different buses, use a single option.
- Switch to using the common SYS_I2C_SPEED / SYS_I2C_SLAVE options.
- Introduce _HAS_ options for additional buses as only the first one is
  common to all users.
- Convert all remaining symbols to Kconfig.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agorcar: i2c: Migrate SYS_I2C_SH to Kconfig
Tom Rini [Thu, 19 Aug 2021 03:12:34 +0000 (23:12 -0400)]
rcar: i2c: Migrate SYS_I2C_SH to Kconfig

- Migrate SYS_I2C_SH and related defines to Kconfig
- Remove currently unused SYS_I2C_SH related defines
- Cleanup related README section.

Cc: Marek Vasut <marek.vasut+renesas@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_SYS_I2C_MXC et al to Kconfig
Tom Rini [Thu, 19 Aug 2021 03:12:33 +0000 (23:12 -0400)]
Convert CONFIG_SYS_I2C_MXC et al to Kconfig

This converts the following to Kconfig:
   CONFIG_SYS_I2C_MXC
   CONFIG_SYS_I2C_MXC_I2C1
   CONFIG_SYS_I2C_MXC_I2C2
   CONFIG_SYS_I2C_MXC_I2C3
   CONFIG_SYS_I2C_MXC_I2C4

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_SYS_I2C_SPEED et al to Kconfig
Tom Rini [Thu, 19 Aug 2021 03:12:32 +0000 (23:12 -0400)]
Convert CONFIG_SYS_I2C_SPEED et al to Kconfig

This converts the following to Kconfig:
   CONFIG_SYS_I2C_SPEED
   CONFIG_SYS_I2C_SLAVE

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agocmd/i2c.c: Remove unused legacy code
Tom Rini [Thu, 19 Aug 2021 03:12:31 +0000 (23:12 -0400)]
cmd/i2c.c: Remove unused legacy code

There are no longer any cases where we are neither SYS_I2C_LEGACY nor
DM_I2C.  Remove these code paths.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoi2c: Remove non-DM code from ihs_i2c.c
Tom Rini [Thu, 19 Aug 2021 03:12:30 +0000 (23:12 -0400)]
i2c: Remove non-DM code from ihs_i2c.c

This driver and it's only user are converted to DM_I2C, remove legacy
code.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoti: i2c: Convert CONFIG_SYS_OMAP24_I2C to CONFIG_SYS_I2C namespace
Tom Rini [Thu, 19 Aug 2021 03:12:29 +0000 (23:12 -0400)]
ti: i2c: Convert CONFIG_SYS_OMAP24_I2C to CONFIG_SYS_I2C namespace

The omap24xx I2C driver uses its own CONFIG namespace for common I2C
variables.  Rather than convert more of them to Kconfig, rename these to
the common I2C ones and remove the entirely unused functionality.  As
part of this, we make the am335x_shc platforms consistent with their
intended speed values.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoam43xx: Drop non-DM_I2C code
Tom Rini [Thu, 19 Aug 2021 03:12:28 +0000 (23:12 -0400)]
am43xx: Drop non-DM_I2C code

On this platform, we have DM_I2C and SPL_DM_I2C always enabled.
Remove legacy options.

Cc: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Lokesh Vutla <lokeshvutla@ti.com>
2 years agoam335x: Drop non-DM_I2C code
Tom Rini [Thu, 19 Aug 2021 03:12:27 +0000 (23:12 -0400)]
am335x: Drop non-DM_I2C code

On this platform, we have DM_I2C and SPL_DM_I2C always enabled.  Remove
legacy options.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoi2c: designware: Remove unused non-DM functionality
Tom Rini [Thu, 19 Aug 2021 03:12:26 +0000 (23:12 -0400)]
i2c: designware: Remove unused non-DM functionality

There are no users of more than 1 i2c bus in the non-DM case currently.
Remove the additional defines for this.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_SYS_I2C_EARLY_INIT to Kconfig
Tom Rini [Thu, 19 Aug 2021 03:12:25 +0000 (23:12 -0400)]
Convert CONFIG_SYS_I2C_EARLY_INIT to Kconfig

Convert SYS_I2C_EARLY_INIT to Kconfig, and make it depend on
SPL_SYS_I2C_LEGACY.  Remove the weak implementation as it's either
something that needs to exist for real, or shouldn't be called.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_SYS_I2C_LEGACY to Kconfig and add CONFIG_[ST]PL_SYS_I2C_LEGACY
Tom Rini [Thu, 19 Aug 2021 03:12:24 +0000 (23:12 -0400)]
Convert CONFIG_SYS_I2C_LEGACY to Kconfig and add CONFIG_[ST]PL_SYS_I2C_LEGACY

First, we convert CONFIG_SYS_I2C_LEGACY to Kconfig.  Next, as you cannot
have SYS_I2C_LEGACY and DM_I2C at the same time, introduce
CONFIG_SPL_SYS_I2C_LEGACY so that we can enable the legacy option only
in SPL.  Finally, for some PowerPC cases we also need
CONFIG_TPL_SYS_I2C_LEGACY support.  Convert all of the existing users to
one or more symbols.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoi2c: Remove unused additional legacy soft i2c bus support
Tom Rini [Tue, 17 Aug 2021 21:59:48 +0000 (17:59 -0400)]
i2c: Remove unused additional legacy soft i2c bus support

Currently the legacy software i2c support is only used for a single bus.
Remove all of the extra and unused support.  Also update the README to
not reference that, and finish removing some already badly auto-edited
related text.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_SYS_I2C_MVTWSI to Kconfig
Tom Rini [Tue, 17 Aug 2021 21:59:47 +0000 (17:59 -0400)]
Convert CONFIG_SYS_I2C_MVTWSI to Kconfig

This converts the following to Kconfig:
   CONFIG_SYS_I2C_MVTWSI

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_SYS_I2C_SOFT et al to Kconfig
Tom Rini [Tue, 17 Aug 2021 21:59:46 +0000 (17:59 -0400)]
Convert CONFIG_SYS_I2C_SOFT et al to Kconfig

This converts the following to Kconfig:
   CONFIG_SYS_I2C_SOFT
   CONFIG_SYS_I2C_SOFT_SPEED
   CONFIG_SYS_I2C_SOFT_SLAVE

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_SYS_I2C_EEPROM_ADDR et al to Kconfig
Tom Rini [Tue, 17 Aug 2021 21:59:45 +0000 (17:59 -0400)]
Convert CONFIG_SYS_I2C_EEPROM_ADDR et al to Kconfig

- Rename usages of CONFIG_SYS_DEF_EEPROM_ADDR to CONFIG_SYS_I2C_EEPROM_ADDR
  based on current usage.
- Convert CONFIG_SYS_I2C_EEPROM_ADDR, CONFIG_SYS_I2C_EEPROM_ADDR_LEN,
  CONFIG_SYS_I2C_EEPROM_BUS, CONFIG_CONFIG_SYS_EEPROM_SIZE
  CONFIG_SYS_EEPROM_PAGE_WRITE_BITS and CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS
  to Kconfig.  We move these symbols around a bit and add appropriate
  dependencies to them.  In some cases, we now add a correct default value
  as well.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoeeprom: Drop CONFIG_ENV_EEPROM_IS_ON_I2C usage
Tom Rini [Tue, 17 Aug 2021 21:59:44 +0000 (17:59 -0400)]
eeprom: Drop CONFIG_ENV_EEPROM_IS_ON_I2C usage

At this point in time, there's no systems with "U-Boot environment
exists on an EEPROM which is accessed over the I2C bus" that sets this
option.  Drop it.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agocl-som-imx7: Enable CMD_EEPROM
Tom Rini [Tue, 17 Aug 2021 21:59:43 +0000 (17:59 -0400)]
cl-som-imx7: Enable CMD_EEPROM

This platform defines everything needed to be able to use the
eeprom command.  In addition, board/compulab/common/eeprom.c is required
by the platform, and does not use CONFIG_ID_EEPROM to enable/disable
builing of it.  In order to migrate CONFIG symbols to Kconfig and to not
have to add complex logic to handle this case, enable CMD_EEPROM on this
board.

Cc: Uri Mashiach <uri.mashiach@compulab.co.il>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoi2c: S3C24X0: Finish Kconfig migration
Tom Rini [Tue, 17 Aug 2021 21:59:42 +0000 (17:59 -0400)]
i2c: S3C24X0: Finish Kconfig migration

Finish moving this driver to Kconfig.
- Update the dependency logic for Exynos5 too
- Remove the unused CONFIG_SYS_I2C_S3C24X0_SPEED variable
- Drop CONFIG_SYS_I2C_S3C24X0_SLAVE as it's always set to 0.
- Move the internal SYS_I2C_S3C24X0_SLAVE define closer to the only user.

Cc: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Minkyu Kang <mk7.kang@samsung.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2 years agoConvert CONFIG_ID_EEPROM to Kconfig
Tom Rini [Tue, 17 Aug 2021 21:59:41 +0000 (17:59 -0400)]
Convert CONFIG_ID_EEPROM to Kconfig

This converts the following to Kconfig:
   CONFIG_ID_EEPROM

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agosiemens: Move CONFIG_SYS_I2C_EEPROM_ADDR usage out of CONFIG namespace
Tom Rini [Tue, 17 Aug 2021 21:59:40 +0000 (17:59 -0400)]
siemens: Move CONFIG_SYS_I2C_EEPROM_ADDR usage out of CONFIG namespace

The instances of CONFIG_SYS_I2C_EEPROM_ADDR on these platforms doesn't
match up with the rest of the EERPOM related defines in U-Boot.  Move
these out of the CONFIG namespace rather than make complex Kconfig
logic.

Cc: Samuel Egli <samuel.egli@siemens.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
2 years agokeymile: Use CONFIG_SYS_IVM_EEPROM_ADR
Tom Rini [Tue, 17 Aug 2021 21:59:39 +0000 (17:59 -0400)]
keymile: Use CONFIG_SYS_IVM_EEPROM_ADR

As the code reads now, making this code path use
CONFIG_SYS_IVM_EEPROM_ADR rather than CONFIG_SYS_I2C_EEPROM_ADDR seems
to make sense as the rest of the EEPROM infrastructure isn't used on
these platforms.

Cc: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachi-powergrids.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Aleksandar Gerasimovski <aleksandar.gerasimovski@hitachi-powergrids.com>
2 years agoarm: shc: Change CONFIG_SYS_I2C_EEPROM_ADDR to EEPROM_ADDR
Tom Rini [Tue, 17 Aug 2021 21:59:38 +0000 (17:59 -0400)]
arm: shc: Change CONFIG_SYS_I2C_EEPROM_ADDR to EEPROM_ADDR

The shc platforms do not make use of the rest of the EEPROM
infrastructure.  Rather than make more elaborate Kconfig logic, remove
this setting from the CONFIG namespace.

Cc: Heiko Schocher <hs@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
2 years agodavinci: Drop CONFIG_MAC_ADDR_IN_EEPROM
Tom Rini [Tue, 17 Aug 2021 21:59:37 +0000 (17:59 -0400)]
davinci: Drop CONFIG_MAC_ADDR_IN_EEPROM

Looking over the current boards, there are no users of
CONFIG_MAC_ADDR_IN_EEPROM.  Further, omapl138_lcdk uses
CONFIG_NET_RANDOM_ETHADDR.  Drop various unused code paths.

Cc: Adam Ford <aford173@gmail.com>
Cc: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agokp_imx53: Switch to using a local namespace for ID EEPROM
Tom Rini [Tue, 17 Aug 2021 21:59:36 +0000 (17:59 -0400)]
kp_imx53: Switch to using a local namespace for ID EEPROM

This platform does not use any of the standard EEPROM functionality and
instead provides its own.  Use a local namespace for the I2C related
defines to access the EEPROM.

Cc: Lukasz Majewski <lukma@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Lukasz Majewski <lukma@denx.de>
2 years agopowerpc: Remove unused FCC ethernet code
Tom Rini [Wed, 11 Aug 2021 12:26:52 +0000 (08:26 -0400)]
powerpc: Remove unused FCC ethernet code

This code is no longer used, remove it.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoexynos: Update environment macros a bit
Tom Rini [Tue, 10 Aug 2021 21:34:22 +0000 (17:34 -0400)]
exynos: Update environment macros a bit

Rework the default environment a bit to not use non-standard
CONFIG_ENV_... names and similar one-off CONFIG names.

Cc: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2 years agoarm: keystone2: Rename CONFIG_ENV_KS2_BOARD_SETTINGS
Tom Rini [Tue, 10 Aug 2021 21:34:21 +0000 (17:34 -0400)]
arm: keystone2: Rename CONFIG_ENV_KS2_BOARD_SETTINGS

Rename CONFIG_ENV_KS2_BOARD_SETTINGS to ENV_KS2_BOARD_SETTINGS so that
it better fits with the rest of the environment addition macros.

Cc: Vitaly Andrianov <vitalya@ti.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoaristainetos2: Rename CONFIG_EXTRA_ENV_BOARD_SETTINGS
Tom Rini [Tue, 10 Aug 2021 21:34:20 +0000 (17:34 -0400)]
aristainetos2: Rename CONFIG_EXTRA_ENV_BOARD_SETTINGS

Rename CONFIG_EXTRA_ENV_BOARD_SETTINGS to EXTRA_ENV_BOARD_SETTINGS in
order to not further add to the CONFIG namespace.

Cc: Heiko Schocher <hs@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
2 years agousb: dwc2: Rename CONFIG_DWC2 namespace to DWC2
Tom Rini [Tue, 10 Aug 2021 20:17:55 +0000 (16:17 -0400)]
usb: dwc2: Rename CONFIG_DWC2 namespace to DWC2

There are a number of DWC2 configuration options that are set in dwc2.h
and referenced in dwc2.c only.  Move these out of the CONFIG_DWC2
namespace and in to the DWC2 namespace.  Note that hikey was defining an
option that was already always enabled, so we can remove that hunk.

Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoPrepare v2021.10-rc3
Tom Rini [Mon, 30 Aug 2021 16:45:46 +0000 (12:45 -0400)]
Prepare v2021.10-rc3

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoconfigs: Resync with savedefconfig
Tom Rini [Mon, 30 Aug 2021 16:40:24 +0000 (12:40 -0400)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoMerge tag 'xilinx-for-v2021.10-rc3' of https://gitlab.denx.de/u-boot/custodians/u...
Tom Rini [Fri, 27 Aug 2021 12:33:02 +0000 (08:33 -0400)]
Merge tag 'xilinx-for-v2021.10-rc3' of https://gitlab.denx.de/u-boot/custodians/u-boot-microblaze

Xilinx changes for v2021.10-rc3

xilinx:
- Disable CONFIG_ARCH_FIXUP_FDT_MEMORY
- Print information about cpu via soc drivers and enable DISPLAY_CPUINFO
- Wire infrastructure for DTB_RESELECT and MULTI_DTB_FIT

zynq:
- Wire single QSPI
- Use power-source instead of io-standard properties
- Enable nor on zc770-xm012

zynqmp:
- Change handling around multi_boot()
- Setup offset for u-boot.itb in spi
- Generate run time dfu_alt_info for capsule update
- Use explicit values for enums (zynqmp_firmware.h)
- Enable RTC/SHA1/BUTTON/BUTTON_GPIO command
- Disable WDT driver by default
- Bind usb/scsi via preboot because of EFI
- DT updates/fixes
- Add soc driver
- Fix SPL SPI boot mode

versal:
- Add soc driver

sdhci:
- Update tap delay programming for zynq_sdhci driver

cmd:
- Fix RTC uclass handling in date command
- Update pwm help message
- Update reset help message

watchdog:
- Fix wwdt compilation

rtc:
- Deal with seq alias in rtc uclass
- Add zynqmp RTC driver

fdt:
- Add kernel-doc for fdt_fixup_memory_banks()

2 years agoxilinx: zynqmp: Enable stack relocation to DDR
Michal Simek [Tue, 24 Aug 2021 12:56:47 +0000 (14:56 +0200)]
xilinx: zynqmp: Enable stack relocation to DDR

There is no space in OCM for SPL stack because the space in OCM is occupied
by TF-A. That's why move relocate stack to DDR to 0x18000000 address
and also enable SPL_SIZE_LIMIT not to be more then 0xfffea000 which is
default address for TFA.

It is good to summarize current DDR usage in SPL flow.
0-0x80000 is used for BSS
 (CONFIG_SPL_BSS_START_ADDR, CONFIG_SPL_BSS_MAX_SIZE)
0x100000 is used for DTB passing address
 (CONFIG_XILINX_OF_BOARD_DTB_ADDR)
0x17fffe70 - CONFIG_SPL_STACK_R_ADDR - is used for GD
0x18000000 is used for SPL stack
 (CONFIG_SPL_STACK_R_ADDR)
0x20000000-0x21000000 is used for SPL malloc area
 (CONFIG_SYS_SPL_MALLOC_START, CONFIG_SYS_SPL_MALLOC_SIZE)

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2 years agoxilinx: zynqmp: Update descriptions for u-boot.its
Michal Simek [Thu, 19 Aug 2021 12:17:37 +0000 (14:17 +0200)]
xilinx: zynqmp: Update descriptions for u-boot.its

Use TF-A instead of ATF in description. And update generic description with
removing ATF because also configurations without it are supported.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2 years agoxilinx: common: Enabling generic function for DT reselection
Michal Simek [Wed, 11 Aug 2021 12:23:54 +0000 (14:23 +0200)]
xilinx: common: Enabling generic function for DT reselection

U-Boot support board detection at run time and based on it change DT.
This feature is implemented for SOM Kria platforms which contain two
eeproms which contain information about SOM module and CC (Carrier card).
Full U-Boot starts with minimal DT file defined by
CONFIG_DEFAULT_DEVICE_TREE which is available in multi DTB fit image.
It is using default setup of board_name variable initializaed to
DEVICE_TREE which corresponds to CONFIG_DEFAULT_DEVICE_TREE option.

When DTB_RESELECT is enabled board_detection() is called. Keep it your mind
that this code is called before relocation. board_detection() is calling
xilinx_read_eeprom() which fills board_info (xilinx_board_description)
structure which are parsed in board_name_decode().
Based on DT configuration and amount of nvmemX aliases name of the board is
composed by concatenating CONFIG_SYS_BOARD "-" <board_name> "-rev"
<board_revision> "-" <cc_name> "-rev" <cc_revision>.

If CC is not present or more are available it keeps going.

When board name is composed and returned from board_name_decode() it is
assigned to board_name variable which is used by
board_fit_config_name_match() which is called via fdtdec_setup() when it
goes over config options in multi dtb FIT image.

From practical point of view multi DTB image is key point here which has to
contain configs for detected combinations. Unfortunately as of now they
have to be full DTBs and DTBOs are not supported.

That's why configuration like:
config_X {
description = "zynqmp-board-cc";
fdt = "board", "cc";
};

needs to be squashed together with:
fdtoverlay -o zynqmp-board-cc -i arch/arm/dts/zynqmp-board.dtb \
arch/arm/dts/zynqmp-cc.dtbo

and only one dtb is in fit:
config_X {
description = "zynqmp-board-cc";
fdt = "board-cc";
};

For creating multi DTBs fit image use mkimage -E, e.g.:
mkimage -E -f all.its all.dtb

When DTB_RESELECT is enabled xilinx_read_eeprom() is called before
relocation and it uses calloc for getting a buffer. Because this is dynamic
memory it is not relocated that's why xilinx_read_eeprom() is called again
as the part of board_init(). This second read with calloc buffer placed in
proper position board_late_init_xilinx() can setup u-boot variables as
before.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2 years agoxilinx: zynqmp: Generate different u-boot.itb for MULTI_DTB_FIT
Michal Simek [Thu, 19 Aug 2021 10:02:57 +0000 (12:02 +0200)]
xilinx: zynqmp: Generate different u-boot.itb for MULTI_DTB_FIT

When MULTI_DTB_FIT is enabled fit-dtb.blob fit image is created which
contain all DTBs listed by CONFIG_OF_LIST. And with DTB_RELESELECT there is
a need to handle it as one file with DTBs in it not as separate DTBs in
u-boot.its/itb.
That's why extend mkimage_fit_atf.sh to generate u-boot.itb correctly.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2 years agoarm64: dts: Make sure that all DTBs are 64bit aligned
Michal Simek [Thu, 19 Aug 2021 09:29:41 +0000 (11:29 +0200)]
arm64: dts: Make sure that all DTBs are 64bit aligned

Start of DTB should be 64bit aligned that's why also make sure that end is
also 64bit aligned. It is not required but it is nice thing to do.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2 years agoMakefile: Align fit-dtb.blob and u-boot.itb by 64bits
Michal Simek [Thu, 19 Aug 2021 09:09:37 +0000 (11:09 +0200)]
Makefile: Align fit-dtb.blob and u-boot.itb by 64bits

Enabling MULTI_DTB_FIT and DTB_RESELECT can end up with multi DTBs in FIT
image placed and aligned only by 32bits (4bytes). Based on device tree
specification:
"Specifically, the memory reservation block shall be aligned to an 8-byte boundary
and the structure block to a 4-byte boundary."
is 64bit (8bytes) alignment required. That's why make sure that
fit-dtb.blob and u-boot.itb as our primary target images for Xilinx ZynqMP
are all 64bit aligned.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
2 years agoxilinx: zynqmp: Check that DT is 64bit aligned
Michal Simek [Thu, 19 Aug 2021 09:07:59 +0000 (11:07 +0200)]
xilinx: zynqmp: Check that DT is 64bit aligned

DT needs to be 64bit aligned. If it is not fdt64_to_cpu will fail when try
to read information about reserved memory. The system ends in exception
without any clue what's going it. That's why detect not aligned DT and
panic to show where the issue is coming from.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2 years agoxilinx: Add support for generic board detection
Michal Simek [Fri, 23 Jul 2021 07:59:59 +0000 (09:59 +0200)]
xilinx: Add support for generic board detection

Add support for changing DT at run time. It is done via board_detection()
which returns platform_id and platform_version which can be used via
board_name_decode() to compose board_local_name string which corresponds
with DT which is should be used.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2 years agoxilinx: common: Free allocated structure
Michal Simek [Fri, 13 Aug 2021 07:17:10 +0000 (09:17 +0200)]
xilinx: common: Free allocated structure

There is no need to keep fru_content around. Free this space.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2 years agoxilinx: common: Change board_info[] handling
Michal Simek [Thu, 12 Aug 2021 10:30:36 +0000 (12:30 +0200)]
xilinx: common: Change board_info[] handling

Origin code was allocating only pointers to struct xilinx_board_description
and there was separate allocation for structure self and freeing in case of
failure.
The code is directly allocating space for all structures by one calloc to
simlify logic.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2 years agoxilinx: Use variable for passing board_name
Michal Simek [Fri, 23 Jul 2021 07:55:59 +0000 (09:55 +0200)]
xilinx: Use variable for passing board_name

Use variable which points to DEVICE_TREE by default. The reason for this
change is to enable DTB_RESELECT and MULTI_DTB_FIT where board detection
can be used for change DTB at run time. That's why there must be reference
in board_fit_config_name_match() via variable instead of hardcoding it
which is sufficient for that use case.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2 years agoxilinx: fru: Replace spaces with \0 in detected name
Michal Simek [Thu, 12 Aug 2021 09:03:49 +0000 (11:03 +0200)]
xilinx: fru: Replace spaces with \0 in detected name

FRU spec expected \0 for unused symbols but unfortunately a lot of boards
are using spaces instead of \0. That's why after saving it to desc->name
name is checked again and all spaces are converted to \0. This will ensure
that names can be used for string manipulations like concatenation.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>