]> git.ipfire.org Git - thirdparty/u-boot.git/log
thirdparty/u-boot.git
3 years agoARM: renesas: Propagate RPC-IF enablement to subsequent software
Geert Uytterhoeven [Tue, 29 Mar 2022 12:19:08 +0000 (14:19 +0200)] 
ARM: renesas: Propagate RPC-IF enablement to subsequent software

As the Renesas Reduced Pin Count Interface may be locked by TF-A, it is
disabled by default[1].  When unlocked, TF-A passes a DT fragment to
enable it, which is applied to the U-Boot DT[2].

Unlike the memory layout, the RPC-IF enablement is not propagated to
subsequent software.  Hence e.g. Linux cannot know if the RPC-IF is
locked or not, and will lock-up when trying to access the RPC-IF when
locked.

Fix this by checking if the RPC-IF is enabled in the TF-A DT fragment, and
setting the status of the RPC-IF device node in the target DT, if
present, to "okay".  Do this only when a "flash" subnode is found, to
avoid errors in subsequent software when the RPC-IF is not intended to
be used.

Note that this requires the status of the RPC-IF node to be set to
"disabled" in the target DT, just like in the U-Boot DT.

[1] commit 3d5f45c95c9db73d ("ARM: dts: rmobile: Disable RPC HF by
    default")
[2] commit 361377dbdbc9f0f5 ("ARM: rmobile: Merge prior-stage firmware
    DT fragment into U-Boot DT on Gen3")

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
3 years agoARM: dts: rmobile: Fix RPC-IF device node names
Geert Uytterhoeven [Tue, 29 Mar 2022 12:19:07 +0000 (14:19 +0200)] 
ARM: dts: rmobile: Fix RPC-IF device node names

According to the Generic Names Recommendation in the Devicetree
Specification Release v0.3, and the DT Bindings for the Renesas Reduced
Pin Count Interface, the node name for a Renesas RPC-IF device should be
"spi".  Especially on R-Car Gen3 and RZ/G2, the node name matters, as
the node is enabled by passing a DT fragment from TF-A to U-Boot, and
from U-Boot to subsequent software.

Fix this by renaming the device nodes from "rpc" to "spi".

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
3 years agoARM: imx6: dh-imx6: Enable d-cache early in SPL
Marek Vasut [Wed, 17 Aug 2022 13:07:14 +0000 (15:07 +0200)] 
ARM: imx6: dh-imx6: Enable d-cache early in SPL

Enable d-cache early in SPL right after DRAM is started up.
This reduces U-Boot proper load time by 650ms when loaded
from SPI NOR.

Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Philip Oberfichtner <pro@denx.de>
3 years agoARM: cache: Allow SPL to build cache-pl310.c
Philip Oberfichtner [Wed, 17 Aug 2022 13:07:13 +0000 (15:07 +0200)] 
ARM: cache: Allow SPL to build cache-pl310.c

Introduce the new Kconfig symbol CONFIG_SPL_SYS_L2_PL310 to allow the
SPL to build cache-pl310.c.

Before this commit, the SPL could enable the PL310 L2 cache [1], but the
cache maintenance functions from cache-pl310.c were only useable for
non-SPL builds.

After enabling the cache one must be able to flush it, too. Thus this
commit allows cache-pl310.c to be included in the SPL build.

[1] See for example arch/arm/mach-imx/cache.c: v7_outer_cache_enable()

Signed-off-by: Philip Oberfichtner <pro@denx.de>
3 years agoConvert CONFIG_SYS_L2_PL310 to Kconfig
Philip Oberfichtner [Wed, 17 Aug 2022 13:07:12 +0000 (15:07 +0200)] 
Convert CONFIG_SYS_L2_PL310 to Kconfig

This converts CONFIG_SYS_L2_PL310 to Kconfig.

For omap2 and mvebu the 'select SYS_L2_PL310' locations were
determined using ./tools/moveconfig -i CONFIG_SYS_L2_PL310.

For mx6 I manually chose ARCH_MX6 as 'select' location. The
correctness has been verified using

$ ./tools/moveconfig.py -f ARCH_MX6 ~SYS_L2_PL310 ~SYS_L2CACHE_OFF
0 matches

That means whenever an ARCH_MX6 board had SYS_L2_PL310 disabled, this
was correctly reflected in SYS_L2CACHE_OFF. Thus it's safe to insert
the 'select' statement under ARCH_MX6.

Signed-off-by: Philip Oberfichtner <pro@denx.de>
3 years agoRemove CONFIG_SYS_I2C_EEPROM_PAGE_WRITE_BITS et al
Tom Rini [Wed, 10 Aug 2022 14:29:28 +0000 (10:29 -0400)] 
Remove CONFIG_SYS_I2C_EEPROM_PAGE_WRITE_BITS et al

This removes the following symbols:
   CONFIG_SYS_I2C_EEPROM_PAGE_WRITE_BITS
   CONFIG_SYS_I2C_EEPROM_PAGE_WRITE_DELAY_MS
   CONFIG_SYS_I2C_LDI_ADDR
   CONFIG_SYS_I2C_DVI_ADDR
   CONFIG_SYS_I2C_DVI_BUS_NUM

They are unused by any code in tree at this time.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoConvert CONFIG_SYS_I2C_EEPROM_CCID et al to Kconfig
Tom Rini [Wed, 10 Aug 2022 14:29:27 +0000 (10:29 -0400)] 
Convert CONFIG_SYS_I2C_EEPROM_CCID et al to Kconfig

This converts the following to Kconfig:
   CONFIG_SYS_I2C_EEPROM_CCID
   CONFIG_SYS_I2C_EEPROM_NXID
   CONFIG_SYS_EEPROM_BUS_NUM

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agobinman: bintool: bzip2: fix version function on non-Debian-based systems
Quentin Schulz [Thu, 1 Sep 2022 15:51:43 +0000 (17:51 +0200)] 
binman: bintool: bzip2: fix version function on non-Debian-based systems

Upstream bzip2 1.0.x actually is stuck when running bzip2 -V and
redirecting the output. This is fixed in Debian for about a decade
already in
https://git.launchpad.net/ubuntu/+source/bzip2/tree/debian/patches/20-legacy.patch?h=ubuntu/jammy
and in bzip2 1.1.x (no release yet, see
https://gitlab.com/bzip2/bzip2/-/commit/65179284ceddc43e6388bf4ed8c2d85cf16e1b2f
).

Fedora notably does not have such a patch.

Since bzip2 --help actually prints the version number too, let's use it
instead so that binman works fine on (hopefully) all distributions.

Fixes: 45aa2798008c ("binman: Add bzip2 bintool")
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agobinman: btool: futility: use Bintool.version
Quentin Schulz [Thu, 1 Sep 2022 15:51:42 +0000 (17:51 +0200)] 
binman: btool: futility: use Bintool.version

Bintool.version can now be passed the binary argument to return the
version text, so there's no need to override it in futility anymore.

Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agobinman: btool: fiptool: use Bintool.version
Quentin Schulz [Thu, 1 Sep 2022 15:51:41 +0000 (17:51 +0200)] 
binman: btool: fiptool: use Bintool.version

Bintool.version can now be passed the binary argument to return the
version text, so there's no need to override it in fiptool anymore.

Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agobinman: bintool: parametrize args to pass to binary for returning version
Quentin Schulz [Thu, 1 Sep 2022 15:51:40 +0000 (17:51 +0200)] 
binman: bintool: parametrize args to pass to binary for returning version

The code to check the version is very similar between binaries, the most
likely only needed variables are the regex to find the version (already
supported) and the args to pass to the binary so that it prints this
version (e.g. --version, -V or similar).

Let's make it a parameter of Bintool so that code duplication can be
avoided for simple changes.

Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
3 years agobinman: btool: mkimage: use Bintool.version
Quentin Schulz [Thu, 1 Sep 2022 15:51:39 +0000 (17:51 +0200)] 
binman: btool: mkimage: use Bintool.version

Bintool.version already contains everything required to get the version
out of mkimage binary so let's not override it with its own
implementation.

Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agobinman: btool: lz4: use Bintool.version
Quentin Schulz [Thu, 1 Sep 2022 15:51:38 +0000 (17:51 +0200)] 
binman: btool: lz4: use Bintool.version

Bintool.version already contains everything required to get the version
out of lz4 binary so let's not override it with its own implementation.

Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agobinman: bintool: move version check implementation into bintool class
Quentin Schulz [Thu, 1 Sep 2022 15:51:37 +0000 (17:51 +0200)] 
binman: bintool: move version check implementation into bintool class

Version checking has nothing specific to compression/decompression tools
so let's move it to the Bintool class.

Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agobinman: btool: gzip: fix packer name so that binary can be found
Quentin Schulz [Wed, 31 Aug 2022 15:55:14 +0000 (17:55 +0200)] 
binman: btool: gzip: fix packer name so that binary can be found

The binary is looked on the system by the suffix of the packer class.
This means binman was looking for btool_gzip on the system and not gzip.

Therefore, let's pass "gzip" as the name so that it can be found and
used.

Fixes: 0f369d79925a ("binman: Add gzip bintool")
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agodt/bindings: Add bindings for FWU Metadata mtd storage
Sughosh Ganu [Fri, 22 Jul 2022 17:43:15 +0000 (12:43 -0500)] 
dt/bindings: Add bindings for FWU Metadata mtd storage

Add bindings needed for accessing the FWU metadata regions.
These include the compatible string which point to the access
method, the actual device which stores the FWU metadata and
the offsets for both metadata regions.

The current patch adds basic bindings needed for accessing the
metadata structure on non-GPT mtd regions.

Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
3 years agogithub: Update PR template for new "Patches" content
Tom Rini [Mon, 29 Aug 2022 16:59:35 +0000 (12:59 -0400)] 
github: Update PR template for new "Patches" content

The old "Patches" wiki page is not available anymore. Now that the
content has been integrated with the submitting_patches document,
reference that instead.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agodoc: process, sending_patches: Update and correct the old "Patches" content
Tom Rini [Mon, 29 Aug 2022 16:59:34 +0000 (12:59 -0400)] 
doc: process, sending_patches: Update and correct the old "Patches" content

- Use gender-neutral language to refer to the user, consistently.
- Reference the checkpatch document.
- Move the section on commit message tags to the process document and
  reference this in sending_patches.rst.
  - Reword the custodian workflow process section to refer to this new
    section, integrate some of the wording from there in this new section.
- Update the comment about GPLv2 applying to August 2022, to be clear
  this still is correct.
- Reword the section about MAKEALL to talk about local build testing and
  link to the CI document.
- Reference the system_configuration document for the note about
  modifying existing code.
- Reword the patchwork flow section.

Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agodoc: sending_patches.rst: Incorporate the old "Patches" wiki content
Tom Rini [Mon, 29 Aug 2022 16:59:33 +0000 (12:59 -0400)] 
doc: sending_patches.rst: Incorporate the old "Patches" wiki content

Import as-is much of the old "Patches" wiki page to the current
sending_patches.rst file. This means we need to move patman to being
included in the higher level ToC and add a reference for "Custodians" in
the process document. A very minimal amount of content changing and
rewording is done here as part of the import, in order to make the
conversion easier.

Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agodoc: Add gpio status output fields description
Patrice Chotard [Tue, 30 Aug 2022 14:56:28 +0000 (16:56 +0200)] 
doc: Add gpio status output fields description

Add gpio status output fields description and one output example.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tweak the formatting.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
3 years agoefi_loader: ensure all block devices are probed
Heinrich Schuchardt [Wed, 31 Aug 2022 14:37:35 +0000 (16:37 +0200)] 
efi_loader: ensure all block devices are probed

Only probed block devices are available in the UEFI sub-system. Multiple
block devices may be involved in the boot process. So we have to make sure
that all block devices are probed. Another reason is that we store UEFI
variables on the ESP which may be on any block device.

On the sandbox before the patch:

=> efidebug devices
No EFI system partition
Device           Device Path
================ ====================
000000001b027c70 /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)
000055d078bc1ae0 /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/Uart(0,0,D,D)
000000001b22e0b0 /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/MAC(020011223344,1)

After the patch:

=> efidebug devices
No EFI system partition
Device           Device Path
================ ====================
000000001b027c70 /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)
000055bdac8ddae0 /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/Uart(0,0,D,D)
000000001b230920 /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(2)/SD(0)
000000001b233ac0 /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(1)/SD(1)
000000001b233b80 /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(1)/SD(1)/HD(1,GPT,d0a914ee-a71c-fc1e-73f0-7e302b0e6c20,0x30,0x1)
000000001b234110 /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(1)/SD(1)/HD(2,GPT,9330a0ea-8aff-f67a-294c-fa05d60896c3,0x31,0x1)
000000001b22f0e0 /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/SD(0)/SD(2)
000000001b238df0 /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/MAC(020011223344,1)

Fixes: a9bf024b2933 ("efi_loader: disk: a helper function to create efi_disk objects from udevice")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
3 years agoMerge branch '2022-08-31-assorted-fixes'
Tom Rini [Wed, 31 Aug 2022 23:32:31 +0000 (19:32 -0400)] 
Merge branch '2022-08-31-assorted-fixes'

- Assorted bugfixes including re-working the i2c command CVE and fixing
  some TI reference platforms with different EEPROMs.

3 years agoarm: smh: Fix uninitialized parameters with newer GCCs
Sean Anderson [Tue, 30 Aug 2022 20:32:27 +0000 (16:32 -0400)] 
arm: smh: Fix uninitialized parameters with newer GCCs

Newer versions of GCC won't initialize parts of structures which don't
appear to be used. This results in uninitialized semihosting parameters
passed via R1. Fix this by marking the inline assembly as clobbering
memory.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
3 years agotools: mkimage: fix build with recent LibreSSL
Mark Kettenis [Mon, 29 Aug 2022 11:34:01 +0000 (13:34 +0200)] 
tools: mkimage: fix build with recent LibreSSL

LibreSSL 3.5.0 and later (also shipped as part of OpenBSD 7.1 and
and later) have an opaque RSA object and do provide the
RSA_get0_* functions that OpenSSL provides.

Fixes: 2ecc354b8e46 ("tools: mkimage: fix build with LibreSSL")
Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Jonathan Gray <jsg@jsg.id.au>
3 years agobootm: Fix upper bound of FDT overlap checks
Pali Rohár [Sat, 27 Aug 2022 12:48:10 +0000 (14:48 +0200)] 
bootm: Fix upper bound of FDT overlap checks

FTD blob can be put immediately after the OS image.
So use strict inequality for start address check.

Fixes: fbde7589ce30 ("common: bootm: add checks to verify if ramdisk / fdtimage overlaps OS image")
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoimage-fit: don't set compression if it can't be read
Daniel Golle [Sat, 27 Aug 2022 03:17:28 +0000 (04:17 +0100)] 
image-fit: don't set compression if it can't be read

fit_image_get_comp() should not set value -1 in case it can't read
the compression node. Instead, leave the value untouched in that case
as it can be absent and a default value previously defined by the
caller of fit_image_get_comp() should be used.

As a result the warning message
WARNING: 'compression' nodes for ramdisks are deprecated, please fix your .its file!
no longer shows if the compression node is actually absent.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agobootm: fix typo imape_comp -> image_comp
Daniel Golle [Sat, 27 Aug 2022 03:14:42 +0000 (04:14 +0100)] 
bootm: fix typo imape_comp -> image_comp

Change variable name 'imape_comp' to the supposedly intended name
'image_comp'.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agocorenet_ds.h: Remove
Tom Rini [Fri, 26 Aug 2022 14:53:36 +0000 (10:53 -0400)] 
corenet_ds.h: Remove

This was missed when removing the platform.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoi2c: fix stack buffer overflow vulnerability in i2c md command
Marek Vasut [Fri, 26 Aug 2022 21:15:56 +0000 (23:15 +0200)] 
i2c: fix stack buffer overflow vulnerability in i2c md command

This reinstates fix from commit 8f8c04bf1ebb ("i2c: fix stack buffer
overflow vulnerability in i2c md command") without the changes unrelated
to the actual fix. Avoid the underflow by setting only nbytes and
linebytes as unsigned integers.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Nicolas Iooss <nicolas.iooss+uboot@ledger.fr>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tim Harvey <tharvey@gateworks.com>
Acked-by: Tim Harvey <tharvey@gateworks.com>
3 years agoRevert "i2c: fix stack buffer overflow vulnerability in i2c md command"
Marek Vasut [Fri, 26 Aug 2022 21:15:55 +0000 (23:15 +0200)] 
Revert "i2c: fix stack buffer overflow vulnerability in i2c md command"

This reverts commit 8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409.

The commit is largely wrong and breaks most of i2c command functionality.
The problem described in the aforementioned commit commit message is valid,
however the commit itself does many more changes unrelated to fixing that
one problem it describes. Those extra changes, namely the handling of i2c
device address length as unsigned instead of signed integer, breaks the
expectation that address length may be negative value. The negative value
is used by DM to indicate that address length of device does not change.

The actual bug documented in commit 8f8c04bf1ebbd2f72f1643e7ad9617dafa6e5409
can be fixed by extra sanitization in separate patch.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Nicolas Iooss <nicolas.iooss+uboot@ledger.fr>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agospl: ahci: Fix dependency for SPL_AHCI_PCI
Oleksandr Suvorov [Thu, 25 Aug 2022 17:03:51 +0000 (20:03 +0300)] 
spl: ahci: Fix dependency for SPL_AHCI_PCI

The option SPL_SATA_SUPPORT is renamed to SPL_SATA. Fix the option
name.

Fixes: 73059529b20 ("ata: ahci-pci: Add new option CONFIG_SPL_AHCI_PCI")
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Acked-by: Pali Rohár <pali@kernel.org>
3 years agofs: fix comment typo
Roger Knecht [Thu, 25 Aug 2022 12:12:01 +0000 (12:12 +0000)] 
fs: fix comment typo

Fix typo in include/fs.h

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Roger Knecht <rknecht@pm.me>
3 years agokbuild: add KBUILD_HOSTLDFLAGS to cmd_host-csingle
Heiko Thiery [Wed, 24 Aug 2022 08:37:23 +0000 (10:37 +0200)] 
kbuild: add KBUILD_HOSTLDFLAGS to cmd_host-csingle

When compiling executables from a single.c file, the linker is also
invoked. Pass the flags like the other linker commands.

cherry-pick kbuild change from Linux:

63185b46cdb3 (kbuild: use HOSTLDFLAGS for single .c executables)

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoboard: ti: common: board_detect: Fix EEPROM read quirk
Matwey V. Kornilov [Tue, 23 Aug 2022 16:05:34 +0000 (19:05 +0300)] 
board: ti: common: board_detect: Fix EEPROM read quirk

There are three different kinds of EEPROM possibly present on boards.
  1. 1byte address. For those we should avoid 2byte address in order
     not to rewrite the data. Second byte of the address can potentially
     be interpreted as the data to write.
  2. 2byte address with defined behaviour. When we try to use 1byte
     address they just return "FF FF FF FF ... FF"
  3. 2byte address with undefined behaviour (for instance, 24LC32AI).
     When we try to use 1byte address, then their internal read
     pointer is changed to some value. Subsequential reads may be
     broken.

To gracefully handle both case #1 and case #3 we read all required
data from EEPROM at once (about 80 bytes). So either all the data is
valid or we fallback to 2byte address.

Cc: Nishanth Menon <nm@ti.com>
Fixes: a58147c2dbbf ("board: ti: common: board_detect: Do 1byte address checks first.")
Reference: https://lore.kernel.org/all/CAJs94Ebdd4foOjhGFu9Bop0v=B1US9neDLxfhgcY23ukgLzFOQ@mail.gmail.com/
Signed-off-by: Matwey V. Kornilov <matwey.kornilov@gmail.com>
Acked-by: Nishanth Menon <nm@ti.com>
3 years agogitlab-ci: Update comment about the Dockerfile
Joel Stanley [Tue, 23 Aug 2022 06:18:26 +0000 (16:18 +1000)] 
gitlab-ci: Update comment about the Dockerfile

It's found in the u-boot tree now.

Signed-off-by: Joel Stanley <joel@jms.id.au>
3 years agocommon/console.c: prevent pre-console buffer contents from being added to itself
Rasmus Villemoes [Tue, 3 May 2022 13:13:27 +0000 (15:13 +0200)] 
common/console.c: prevent pre-console buffer contents from being added to itself

I do not have any non-serial output devices, so a
print_pre_console_buffer(PRE_CONSOLE_FLUSHPOINT2_EVERYTHING_BUT_SERIAL)
does nothing for me.

However, I was manually inspected the pre-console buffer using md.b,
and I noticed that the early part of it was repeated. The reason is
that the first call of print_pre_console_buffer(), from
console_init_f(), ends up invoking puts() with the contents of the
buffer at that point, and puts() at that point ends up in the else
branch of

if (gd->flags & GD_FLG_DEVINIT) {
/* Send to the standard output */
fputs(stdout, s);
} else {
/* Send directly to the handler */
pre_console_puts(s);
serial_puts(s);
}

so indeed the contents is added again.

That can be somewhat confusing (both when reading the buffer manually,
but also if it did actually come out on some device). So disable all
use of the pre-console buffer while print_pre_console_buffer() is
emitting it.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoMerge tag 'dm-pull-26aug22' of https://source.denx.de/u-boot/custodians/u-boot-dm
Tom Rini [Sat, 27 Aug 2022 12:07:09 +0000 (08:07 -0400)] 
Merge tag 'dm-pull-26aug22' of https://source.denx.de/u-boot/custodians/u-boot-dm

binman/patman documentation improvements
other minor fixes

3 years agoMerge branch '2022-08-26-assorted-fixes'
Tom Rini [Sat, 27 Aug 2022 12:05:15 +0000 (08:05 -0400)] 
Merge branch '2022-08-26-assorted-fixes'

- PCIe, NVMe and 2 UBIFS related fixes

3 years agodistroboot: ubifs: Add support for specifying UBI header offset
Pali Rohár [Sun, 7 Aug 2022 19:04:22 +0000 (21:04 +0200)] 
distroboot: ubifs: Add support for specifying UBI header offset

Some UBI partitions may use non-standard UBI header offset. For attaching
these UBI partitions it is required to pass second argument with offset to
"ubi part" command.

Therefore extend distroboot to allow specifying additional optional 6th
argument with UBI header offset. This offset is set in new distroboot
variable ${bootubioff} which may be used by distroboot script to e.g.
properly pass this value to linux kernel command line for proper mounting
of rootfs by kernel. This variable is set to empty string (cleared) when
UBI header offset is not specified into distroboot BOOT_TARGET_DEVICES
macro.

Usage of helper macro BOOTENV_DEV_UBIFS_BOOTUBIOFF in this change is there
as a type check. It ensures that in BOOT_TARGET_DEVICES macro was specified
UBIFS func with either 5 or 6 arguments. If not then cpp throws compile
error.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
3 years agoRename disto_[pxe_]getfile to distro_[pxe_]getfile
Dario Binacchi [Fri, 26 Aug 2022 13:15:41 +0000 (15:15 +0200)] 
Rename disto_[pxe_]getfile to distro_[pxe_]getfile

Replace 'disto' with 'distro' since they are all functions about distro
booting.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
3 years agovbe: Enable command only with BOOTSTD_FULL
Simon Glass [Tue, 23 Aug 2022 17:14:05 +0000 (10:14 -0700)] 
vbe: Enable command only with BOOTSTD_FULL

Avoid enabling this command by default. This saves about 1KB of code
space.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 years agobinman: Sort tests and rework test-file numbers
Stefan Herbrechtsmeier [Tue, 23 Aug 2022 10:46:09 +0000 (12:46 +0200)] 
binman: Sort tests and rework test-file numbers

Tests should be in order of the test-file numbers. Sort the tests
according to the test-file numbers and rework the test-file numbers to
eliminate duplicate numbers.

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agobinman: Document how to handle dependent images
Simon Glass [Thu, 18 Aug 2022 08:16:46 +0000 (02:16 -0600)] 
binman: Document how to handle dependent images

Binman does not support this properly at present. Add documentation about
it including a work-around.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agobinman: Mention split-elf in the main docs
Simon Glass [Thu, 18 Aug 2022 08:16:45 +0000 (02:16 -0600)] 
binman: Mention split-elf in the main docs

Since we are talking about ATF, add mention of this new feature too.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agopatman: Tidy up unnecessary blank lines and numbers
Simon Glass [Wed, 17 Aug 2022 18:47:07 +0000 (12:47 -0600)] 
patman: Tidy up unnecessary blank lines and numbers

Quite a few blank lines are not needed here. Drop these and use the #
mechanism to number paragraphs.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agopatman: Fix version table
Simon Glass [Wed, 17 Aug 2022 18:47:06 +0000 (12:47 -0600)] 
patman: Fix version table

One of the changes to the version table was made by mistake. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agoboot: simplify bootmeth_vbe_simple_ft_fixup()
Heinrich Schuchardt [Tue, 23 Aug 2022 08:31:56 +0000 (10:31 +0200)] 
boot: simplify bootmeth_vbe_simple_ft_fixup()

Don't assign a value to a variable if it is not used afterwards.
Move variables to the code fragment where they are used.

Addresses-Coverity: CID 356243 ("Code maintainability issues (UNUSED_VALUE)")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agoboot: fix vbe_find_first_device()
Heinrich Schuchardt [Tue, 23 Aug 2022 08:25:25 +0000 (10:25 +0200)] 
boot: fix vbe_find_first_device()

uclass_find_first_device() may return NULL if no device for the uclass
exists. Handle this case gracefully.

Addresses-Coverity: CID 356244 ("Null pointer dereferences (FORWARD_NULL)")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agodm: core: fix a typo in help text
Sergei Antonov [Sun, 21 Aug 2022 13:45:08 +0000 (16:45 +0300)] 
dm: core: fix a typo in help text

Signed-off-by: Sergei Antonov <saproj@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 years agodoc: Build documentation in parallel
Simon Glass [Sat, 13 Aug 2022 17:40:40 +0000 (11:40 -0600)] 
doc: Build documentation in parallel

With the addition of the revision stats this now takes over a minute. Use
a parallel build to reduce it a bit (24 seconds for me).

Series-changes; 2
- Use '-j auto' instead

Signed-off-by: Simon Glass <sjg@chromium.org>
3 years agodisk: part: remove dependency to ubifs for spl
Stefan Herbrechtsmeier [Mon, 8 Aug 2022 14:45:17 +0000 (16:45 +0200)] 
disk: part: remove dependency to ubifs for spl

The spl doesn't support ubifs and thereby doesn't provide the
ubifs_is_mounted function. Remove the dependency to ubifs for the spl.

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
3 years agonvme: Do a clean NVMe shutdown
Hector Martin [Sun, 31 Jul 2022 06:31:31 +0000 (15:31 +0900)] 
nvme: Do a clean NVMe shutdown

The brute-force controller disable method can end up racing controller
initialization and causing a crash when we shut down Apple ANS2 NVMe
controllers. Do a proper controlled shutdown, which does block until
things are quiesced properly. This is nicer in general for all
controllers.

Signed-off-by: Hector Martin <marcan@marcan.st>
Tested-by: Mark Kettenis <kettenis@openbsd.org> (firefly-rk3399)
3 years agopci: Add checks to prevent config space overflow
Pali Rohár [Sun, 3 Jul 2022 10:48:06 +0000 (12:48 +0200)] 
pci: Add checks to prevent config space overflow

PCIe config space has address range 0-4095. So do not allow reading from
addresses outside of this range. Lot of U-Boot drivers do not expect that
passed value is not in this range. PCI DM read function is extended to
fill read value to all ones or zeros when it fails as U-Boot callers
ignores return value.

Calling U-Boot command 'pci display.b 0.0.0 0 0x2000' now stops printing
config space at the end (before 0x1000 address).

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoMerge branch '2022-08-26-assorted-platform-updates' into next
Tom Rini [Fri, 26 Aug 2022 18:47:48 +0000 (14:47 -0400)] 
Merge branch '2022-08-26-assorted-platform-updates' into next

- Assorted Arm, TI and Qualcomm platform updates

3 years agofirmware: ti_sci: Move ACK checking to ti_sci_do_xfer() function
Andrew Davis [Tue, 26 Jul 2022 01:25:06 +0000 (20:25 -0500)] 
firmware: ti_sci: Move ACK checking to ti_sci_do_xfer() function

We can check if the message was acknowledged in the common
ti_sci_do_xfer() which lets us remove it from after each call to this
function. This simplifies the code and reduces binary size.

Signed-off-by: Andrew Davis <afd@ti.com>
3 years agofirmware: ti_sci: Remove inline keyword from functions
Andrew Davis [Tue, 26 Jul 2022 01:25:05 +0000 (20:25 -0500)] 
firmware: ti_sci: Remove inline keyword from functions

The inline hint is not needed here, the compiler will do the right thing
based on if we are compiling for speed or for code size. In this case the
inline causes this function to be placed inside each callsite which is
not the right thing to do for either speed nor size. There is no
performance benefit to this due to the larger function size reducing
cache locality, but there is a huge size penalty. Remove inline keyword.

Signed-off-by: Andrew Davis <afd@ti.com>
3 years agofirmware: ti_sci: Factor out message alloc failed message
Andrew Davis [Tue, 26 Jul 2022 01:25:04 +0000 (20:25 -0500)] 
firmware: ti_sci: Factor out message alloc failed message

We don't need to print the same message in every location, just
print it in the function that fails and remove all the extra
message printouts.

Signed-off-by: Andrew Davis <afd@ti.com>
3 years agofirmware: ti_sci: Reduce output on ti_sci_do_xfer error
Andrew Davis [Tue, 26 Jul 2022 01:25:03 +0000 (20:25 -0500)] 
firmware: ti_sci: Reduce output on ti_sci_do_xfer error

This ti_sci_do_xfer() function already prints out the reason for the
failure, and the caller of each of these functions should also notify
the user of the failed task. Remove this extra level of error message.

Signed-off-by: Andrew Davis <afd@ti.com>
3 years agoarm: dts: qcom: Sync pinctrl DT nodes with Linux bindings
Sumit Garg [Wed, 27 Jul 2022 08:22:04 +0000 (13:52 +0530)] 
arm: dts: qcom: Sync pinctrl DT nodes with Linux bindings

Currently for all Qcom SoCs/boards there are separate compatibles for
GPIO and pinctrl. But this is inconsistent with official (upstream) Linux
bindings which requires only a single compatible "qcom,<SoC name>-pinctrl"
and there is no such compatible property as "qcom,tlmm-<SoC name>".

So fix this inconsistency for Qcom SoCs in order to comply with upstream
DT bindings. This is done via removing compatibles from "msm_gpio" driver
and via binding to "msm_gpio" driver from pinctrl driver in case
"gpio-controller" property is specified for pinctrl node.

Suggested-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
3 years agopinctrl: sdm845: Remove redundant CONFIG_SDM845 check
Sumit Garg [Wed, 27 Jul 2022 08:22:03 +0000 (13:52 +0530)] 
pinctrl: sdm845: Remove redundant CONFIG_SDM845 check

DT compatible is sufficient to make platform specific differentiation,
so remove redundant CONFIG_SDM845 check.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
3 years agoqcs404evb_defconfig: Enable USB configs
Sumit Garg [Thu, 4 Aug 2022 14:27:21 +0000 (19:57 +0530)] 
qcs404evb_defconfig: Enable USB configs

Enable USB config options along with its dependencies like PHY, RESET,
PMIC GPIO etc. config options.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
3 years agoboard: qcs404-evb: Enable USB3 specific PMIC GPIO
Sumit Garg [Thu, 4 Aug 2022 14:27:20 +0000 (19:57 +0530)] 
board: qcs404-evb: Enable USB3 specific PMIC GPIO

For USB3 host controller to detect devices on the bus it is required to
enable a PMIC GPIO: usb_vbus_boost_pin. So enable that during board
specific initialization.

And since this PMIC GPIO parsing is quite u-boot specific, so add a
DT override to qcs404-evb-uboot.dtsi to represent usb_vbus_boost_pin.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
3 years agodts: qcs404-evb: Add PMIC GPIO controller node
Sumit Garg [Thu, 4 Aug 2022 14:27:19 +0000 (19:57 +0530)] 
dts: qcs404-evb: Add PMIC GPIO controller node

PMIC GPIOs are special GPIOs which are accessible through SPMI bus. So
add corresponding DT nodes.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
3 years agogpio: qcom_pmic: Add support for GPIO LV/MV subtype
Sumit Garg [Thu, 4 Aug 2022 14:27:18 +0000 (19:57 +0530)] 
gpio: qcom_pmic: Add support for GPIO LV/MV subtype

GPIO LV (low voltage)/MV (medium voltage) subtypes have different
features and register mappings than 4CH/8CH subtypes. Add support
for LV and MV subtypes.

With GPIO LV/MV subtype available, add "qcom,pms405-gpio" compatible
which requires support for GPIO MV subtype.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
3 years agopmic: Convert pm8916 driver to a generic Qcom PMIC driver
Sumit Garg [Thu, 4 Aug 2022 14:27:17 +0000 (19:57 +0530)] 
pmic: Convert pm8916 driver to a generic Qcom PMIC driver

Since both pm8916.c and pm8916_gpio.c are already supporting multiple
Qcom SoCs, it makes sense to rename these drivers to pmic_qcom.c and
qcom_pmic_gpio.c respectively. Also, these driver can be extended to
support additional functionality if required for other Qcom SoCs.

Along with this import latest DT binding: qcom,spmi-pmic.txt from Linux
kernel and thereby remove pm8916.txt.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
3 years agodts: qcs404-evb: Add USB controller and PHY nodes
Sumit Garg [Thu, 4 Aug 2022 14:27:16 +0000 (19:57 +0530)] 
dts: qcs404-evb: Add USB controller and PHY nodes

QCS404 SoC provides support for two USB controllers: one USB3 and the
other one being USB2. The USB3 controller supports further 2 PHY: one high
speed PHY and the other super speed PHY. The USB2 controller supports a
single high speed PHY. So add corresponding DT nodes.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
3 years agoclocks: qcs404: Add support for USB clocks
Sumit Garg [Thu, 4 Aug 2022 14:27:15 +0000 (19:57 +0530)] 
clocks: qcs404: Add support for USB clocks

Add support for USB controller and PHY clocks for QCS404 SoC.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
3 years agoclocks: qcom: Add clock enable callback support
Sumit Garg [Thu, 4 Aug 2022 14:27:14 +0000 (19:57 +0530)] 
clocks: qcom: Add clock enable callback support

Drivers like USB, ethernet etc. uses ".enable" hook to enable clocks.
So add corresponding support for Qcom clock drivers.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
3 years agodts: qcs404-evb: Add reset controller node
Sumit Garg [Thu, 4 Aug 2022 14:27:13 +0000 (19:57 +0530)] 
dts: qcs404-evb: Add reset controller node

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
3 years agoreset: qcom: Add support for QCS404 SoC reset table
Sumit Garg [Thu, 4 Aug 2022 14:27:12 +0000 (19:57 +0530)] 
reset: qcom: Add support for QCS404 SoC reset table

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
3 years agoreset: Convert ipq4019 driver to a generic Qcom driver
Sumit Garg [Thu, 4 Aug 2022 14:27:11 +0000 (19:57 +0530)] 
reset: Convert ipq4019 driver to a generic Qcom driver

Since the base functionality remains the same for a reset driver on Qcom
SoCs, so leverage that to convert ipq4019 specific reset driver to a
generic Qcom reset driver. With that one just need to provide SoC specific
reset table.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
3 years agophy: Add support for drivers to enable USB on QCS404 SoC
Sumit Garg [Thu, 4 Aug 2022 14:27:10 +0000 (19:57 +0530)] 
phy: Add support for drivers to enable USB on QCS404 SoC

QCS404 SoC supports two types of PHY, one supports high speed mode or
USB2 PHY and the other supports super speed mode or USB3 PHY. So add
corresponding PHY drivers.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
3 years agophy: Move qcom SoCs specific phy drivers to qcom folder
Sumit Garg [Thu, 4 Aug 2022 14:27:09 +0000 (19:57 +0530)] 
phy: Move qcom SoCs specific phy drivers to qcom folder

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
3 years agoarm: total_compute: enable psci
Davidson K [Tue, 9 Aug 2022 10:26:52 +0000 (15:56 +0530)] 
arm: total_compute: enable psci

psci is used for system reset

Signed-off-by: Davidson K <davidson.kumaresan@arm.com>
3 years agoconfigs: j721s2_evm_a72_defconfig: fix the bootcmd
Jayesh Choudhary [Tue, 2 Aug 2022 13:08:14 +0000 (18:38 +0530)] 
configs: j721s2_evm_a72_defconfig: fix the bootcmd

Remove the main_cpsw0_qsgmii_phyinit variable from the boot
command as there is no ethernet firmware in j721s2.

Fixes: 8886341aa670 ('configs: j721s2_evm_a72_defconfig: Add A72 specific defconfig')
Signed-off-by: Jayesh Choudhary <j-choudhary@ti.com>
3 years agoMerge commit 'ac30d240dbb520d0980f0687630feb702a14f51a' of https://source.denx.de...
Tom Rini [Wed, 24 Aug 2022 21:30:29 +0000 (17:30 -0400)] 
Merge commit 'ac30d240dbb520d0980f0687630feb702a14f51a' of https://source.denx.de/u-boot/custodians/u-boot-nand-flash into next

Re-sync again on some linux part, add some fixes for fsl_elbc from
Pali and switch
imx8mn bsh to use nand base ident

For nand subsystem tested on:
 - imx8mn  Macronix MX30LF4G18AC
 - P2020 based board Turris 1.1 for fsl_elbc

3 years agoMerge https://source.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Tue, 23 Aug 2022 19:44:54 +0000 (15:44 -0400)] 
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell

- kirkwood: pogo_v4 & nsa310s: Add distro boot (Tony)
- kirkwood: add DM timer support and use it on lsxl boards (Michael)
- kirkwood: convert the Buffalo Linkstation LS-CHLv2 and XHL boards
  to DM (Michael)
- mvebu: turris_mox/omnia: misc improments (Pali)
- mvebu: mbus: Fix mbus driver to work also after U-Boot relocation (Pali)

3 years agoconfigs: Resync with savedefconfig
Tom Rini [Tue, 23 Aug 2022 19:24:14 +0000 (15:24 -0400)] 
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
3 years agoboard: lsxl: update the README
Michael Walle [Wed, 17 Aug 2022 19:38:09 +0000 (21:38 +0200)] 
board: lsxl: update the README

Update the board's README to reflect all the recent changes.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoboard: lsxl: disable eth0
Michael Walle [Wed, 17 Aug 2022 19:38:08 +0000 (21:38 +0200)] 
board: lsxl: disable eth0

The board has only one network interface. The linux kernel will
gracefully skip a the ethernet interface if no connected PHY could be
probed. u-boot on the other hand will throw an error message. The kernel
device tree is about to be fixed. For now, just disable the ethernet
interface in our -u-boot.dtsi.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoboard: lsxl: convert to CONFIG_TIMER
Michael Walle [Wed, 17 Aug 2022 19:38:07 +0000 (21:38 +0200)] 
board: lsxl: convert to CONFIG_TIMER

Enable the orion timer driver and we are good.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoboard: lsxl: convert to DM_SERIAL
Michael Walle [Wed, 17 Aug 2022 19:38:06 +0000 (21:38 +0200)] 
board: lsxl: convert to DM_SERIAL

DM_SERIAL needs early malloc. The on-chip RAM is pretty tight, it's only
2kiB, with DM_SERIAL enabled, this doesn't work anymore. Fortunately for
us, we don't need the on-chip RAM because the DRAM is already
initialized before u-boot starts. Just put the early malloc area there
and use the default early malloc size.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoboard: lsxl: convert to DM_ETH
Michael Walle [Wed, 17 Aug 2022 19:38:05 +0000 (21:38 +0200)] 
board: lsxl: convert to DM_ETH

Just enabling the Kconfig option for DM_ETH and DM_MDIO is enough.
Additionally, we can remove the old hardcoded config.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoboard: lsxl: convert to DM_GPIO
Michael Walle [Wed, 17 Aug 2022 19:38:04 +0000 (21:38 +0200)] 
board: lsxl: convert to DM_GPIO

Use the new mvebu GPIO driver and convert all the function calls to the
former kirkwood GPIO driver. This means that we are now using the LED
uclass and the regulator uclass. Unfortunately, the GPIO LED doesn't
offer a blinking method. Thus we are now stuck with solid on and off
states, which makes debugging a bit harder. Also, there is no GPIO fan
driver for now.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoboard: lsxl: make last resort recovery more reliable
Michael Walle [Wed, 17 Aug 2022 19:38:03 +0000 (21:38 +0200)] 
board: lsxl: make last resort recovery more reliable

If something is wrong with the environment, we cannot rely on a proper
u-boot operation anymore. In fact, it is possible, that we never reach
misc_init_r() with a broken environment.

Also don't enable the netconsole by environment settings. This way the
user don't have to reconfigure the environment. Instead the network
console is only enabled when the push button is pressed during boot.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoboard: lsxl: enable ATAGS support
Michael Walle [Wed, 17 Aug 2022 19:38:02 +0000 (21:38 +0200)] 
board: lsxl: enable ATAGS support

We still need to be able to boot legacy images. Esp. the debian
installer will have a kernel with an appended DTB.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoboard: lsxl: use proper *_r variables
Michael Walle [Wed, 17 Aug 2022 19:38:01 +0000 (21:38 +0200)] 
board: lsxl: use proper *_r variables

Use the common kernel_addr_r, ramdisk_addr_r and fdt_addr_r variable
names.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoboard: lsxl: reorder image loading and remove ramdisk_len
Michael Walle [Wed, 17 Aug 2022 19:38:00 +0000 (21:38 +0200)] 
board: lsxl: reorder image loading and remove ramdisk_len

We can load the ramdisk as the last step. This way we don't have to set
the intermediate variable 'ramdisk_len' and can remove it.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoboard: lsxl: use CONFIG_DEFAULT_FDT_FILE
Michael Walle [Wed, 17 Aug 2022 19:37:59 +0000 (21:37 +0200)] 
board: lsxl: use CONFIG_DEFAULT_FDT_FILE

Drop our own CONFIG_FDTFILE handling in favor of the generic
CONFIG_DEFAULT_FDT_FILE one.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoboard: lsxl: automatically select CONFIG_MISC_INIT_R
Michael Walle [Wed, 17 Aug 2022 19:37:58 +0000 (21:37 +0200)] 
board: lsxl: automatically select CONFIG_MISC_INIT_R

The board code needs this to be set. Otherwise, the recovery mechanism
doesn't work. Therefore, select this option automatically with the
board.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoboard: lsxl: remove unused header files
Michael Walle [Wed, 17 Aug 2022 19:37:57 +0000 (21:37 +0200)] 
board: lsxl: remove unused header files

Cleanup the included header files in the board code. These are all
leftovers from earlier days.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoboard: lsxl: remove CONFIG_ENV_OVERWRITE
Michael Walle [Wed, 17 Aug 2022 19:37:56 +0000 (21:37 +0200)] 
board: lsxl: remove CONFIG_ENV_OVERWRITE

This is not needed. The user can force setting the variables with
"setenv -f".

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoboard: lsxl: remove eraseenv script
Michael Walle [Wed, 17 Aug 2022 19:37:55 +0000 (21:37 +0200)] 
board: lsxl: remove eraseenv script

This is not needed. The user can do a "env default -f -a".

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoboard: lsxl: remove unused features
Michael Walle [Wed, 17 Aug 2022 19:37:54 +0000 (21:37 +0200)] 
board: lsxl: remove unused features

Make the binary smaller by removing unused features.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoboard: lsxl: limit size to 384kiB
Michael Walle [Wed, 17 Aug 2022 19:37:53 +0000 (21:37 +0200)] 
board: lsxl: limit size to 384kiB

The board only has a 4Mbit flash and two sectors are reserved for the
u-boot environment and the device tree.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agobutton: gpio: add DM_GPIO dependency
Michael Walle [Wed, 17 Aug 2022 19:37:52 +0000 (21:37 +0200)] 
button: gpio: add DM_GPIO dependency

The gpio-button driver depends on DM_GPIO, add it to Kconfig to avoid
build errors.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agotimer: add orion-timer support
Michael Walle [Wed, 17 Aug 2022 19:37:51 +0000 (21:37 +0200)] 
timer: add orion-timer support

Add timer support for Kirkwood and MVEBU devices.

Cc: Pali Rohár <pali@kernel.org>
Signed-off-by: Michael Walle <michael@walle.cc>
Acked-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: kirkwood: make it CONFIG_TIMER aware
Michael Walle [Wed, 17 Aug 2022 19:37:50 +0000 (21:37 +0200)] 
arm: kirkwood: make it CONFIG_TIMER aware

If we switch to CONFIG_TIMER, we don't need the legacy timer macros and
functions anymore. Add the proper guards to exclude them from compiling.

Cc: Pali Rohár <pali@kernel.org>
Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agoarm: kirkwood: 88f6281: Detect CONFIG_SYS_TCLK from SAR register
Pali Rohár [Wed, 17 Aug 2022 19:37:49 +0000 (21:37 +0200)] 
arm: kirkwood: 88f6281: Detect CONFIG_SYS_TCLK from SAR register

Bit 21 in SAR register specifies if TCLK is running at 166 MHz or 200 MHz.
This information is undocumented in public Marvell Kirkwood Functional
Specifications [2], but is available in Linux v3.15 kirkwood code [1].

Commit 8ac303d49f89 ("arm: kirkwood: Do not overwrite CONFIG_SYS_TCLK")
broke support for Marvell 88F6281 SoCs because it was expected that all
those SoCs have TCLK running at 200 MHz as specified in Marvell 88F6281
Hardware Specifications [3].

Fix broken support for 88F6281 by detecting CONFIG_SYS_TCLK from SAR
register, like it was doing Linux v3.15.

[1] - https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/arch/arm/mach-kirkwood/common.c?h=v3.15#n542
[2] - https://web.archive.org/web/20130730091033/http://www.marvell.com/embedded-processors/kirkwood/assets/FS_88F6180_9x_6281_OpenSource.pdf
[3] - https://web.archive.org/web/20120620073511/http://www.marvell.com/embedded-processors/kirkwood/assets/HW_88F6281_OpenSource.pdf

Update by Stefan 2022-08-23:
- Fix compilation error for ds109

Fixes: 8ac303d49f89 ("arm: kirkwood: Do not overwrite CONFIG_SYS_TCLK")
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
3 years agotime: move the CONFIG_SYS_TIMER_RATE handling to the compiler
Michael Walle [Wed, 17 Aug 2022 19:37:48 +0000 (21:37 +0200)] 
time: move the CONFIG_SYS_TIMER_RATE handling to the compiler

CONFIG_SYS_TIMER_RATE might be a dynamic value, i.e. a function call
instead of a static value, thus it has to be evaluated at runtime. If it
is a static value, the compiler should be able to optimize the unused
branches out.

This will be needed for kirkwoods dynamic CONFIG_SYS_TCLK setting.

Cc: Pali Rohár <pali@kernel.org>
Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>