platform/kernel/u-boot.git
21 months agoMerge branch '2022-08-04-Kconfig-migrations'
Tom Rini [Thu, 4 Aug 2022 20:53:39 +0000 (16:53 -0400)]
Merge branch '2022-08-04-Kconfig-migrations'

- Further migrations to Kconfig and associated dead code removal.

21 months agoConvert CONFIG_SYS_FSL_DDR_INTLV_256B to Kconfig
Tom Rini [Sat, 23 Jul 2022 17:05:12 +0000 (13:05 -0400)]
Convert CONFIG_SYS_FSL_DDR_INTLV_256B to Kconfig

This converts the following to Kconfig:
   CONFIG_SYS_FSL_DDR_INTLV_256B

Signed-off-by: Tom Rini <trini@konsulko.com>
21 months agoConvert CONFIG_SYS_FSL_CORES_PER_CLUSTER to Kconfig
Tom Rini [Sat, 23 Jul 2022 17:05:11 +0000 (13:05 -0400)]
Convert CONFIG_SYS_FSL_CORES_PER_CLUSTER to Kconfig

This converts the following to Kconfig:
   CONFIG_SYS_FSL_CORES_PER_CLUSTER

As part of this, correct the dependencies on SYS_FSL_THREADS_PER_CORE.

Signed-off-by: Tom Rini <trini@konsulko.com>
21 months agoConvert CONFIG_FSL_MEMAC et al to Kconfig
Tom Rini [Sat, 23 Jul 2022 17:05:10 +0000 (13:05 -0400)]
Convert CONFIG_FSL_MEMAC et al to Kconfig

This converts the following to Kconfig:
   CONFIG_FSL_MEMAC
   CONFIG_SYS_MEMAC_LITTLE_ENDIAN

Signed-off-by: Tom Rini <trini@konsulko.com>
21 months agoConvert CONFIG_SYS_FSL_CCSR_GUR_BE et al to Kconfig
Tom Rini [Sat, 23 Jul 2022 17:05:09 +0000 (13:05 -0400)]
Convert CONFIG_SYS_FSL_CCSR_GUR_BE et al to Kconfig

This converts the following to Kconfig:
   CONFIG_SYS_FSL_CCSR_GUR_BE
   CONFIG_SYS_FSL_CCSR_SCFG_BE
   CONFIG_SYS_FSL_ESDHC_BE
   CONFIG_SYS_FSL_IFC_BE
   CONFIG_SYS_FSL_PEX_LUT_BE
   CONFIG_SYS_FSL_CCSR_GUR_LE
   CONFIG_SYS_FSL_CCSR_SCFG_LE
   CONFIG_SYS_FSL_ESDHC_LE
   CONFIG_SYS_FSL_IFC_LE
   CONFIG_SYS_FSL_PEX_LUT_LE

Signed-off-by: Tom Rini <trini@konsulko.com>
21 months agoConvert CONFIG_FSL_CORENET to Kconfig
Tom Rini [Sat, 23 Jul 2022 17:05:08 +0000 (13:05 -0400)]
Convert CONFIG_FSL_CORENET to Kconfig

This converts the following to Kconfig:
   CONFIG_FSL_CORENET

Signed-off-by: Tom Rini <trini@konsulko.com>
21 months agoconfigs: Remove a number of unreferenced CONFIG options.
Tom Rini [Sat, 23 Jul 2022 17:05:07 +0000 (13:05 -0400)]
configs: Remove a number of unreferenced CONFIG options.

There are a large number of options under CONFIG_SYS (but some of these
are elsewhere, spotted while cleaning CONFIG_SYS) that are never
referenced, or only used slightly later in the config file.  Remove or
restructure these.

Signed-off-by: Tom Rini <trini@konsulko.com>
21 months agoConvert CONFIG_SYS_FMAN_V3 to Kconfig
Tom Rini [Sat, 23 Jul 2022 17:05:06 +0000 (13:05 -0400)]
Convert CONFIG_SYS_FMAN_V3 to Kconfig

This converts the following to Kconfig:
   CONFIG_SYS_FMAN_V3

Signed-off-by: Tom Rini <trini@konsulko.com>
21 months agoConvert CONFIG_SYS_FLASH_QUIET_TEST to Kconfig
Tom Rini [Sat, 23 Jul 2022 17:05:05 +0000 (13:05 -0400)]
Convert CONFIG_SYS_FLASH_QUIET_TEST to Kconfig

This converts the following to Kconfig:
   CONFIG_SYS_FLASH_QUIET_TEST

Signed-off-by: Tom Rini <trini@konsulko.com>
21 months agoConvert CONFIG_SYS_MAX_FLASH_SECT to Kconfig
Tom Rini [Sat, 23 Jul 2022 17:05:04 +0000 (13:05 -0400)]
Convert CONFIG_SYS_MAX_FLASH_SECT to Kconfig

This converts the following to Kconfig:
   CONFIG_SYS_MAX_FLASH_SECT

Signed-off-by: Tom Rini <trini@konsulko.com>
21 months agoAudit <flash.h> inclusion
Tom Rini [Sat, 23 Jul 2022 17:05:03 +0000 (13:05 -0400)]
Audit <flash.h> inclusion

A large number of files include <flash.h> as it used to be how various
SPI flash related functions were found, or for other reasons entirely.
In order to migrate some further CONFIG symbols to Kconfig we need to
not include flash.h in cases where we don't have a NOR flash of some
sort enabled.  Furthermore, in cases where we are in common code and it
doesn't make sense to try and further refactor the code itself in to new
files we need to guard this inclusion.

Signed-off-by: Tom Rini <trini@konsulko.com>
21 months agoConvert CONFIG_FLASH_CFI_LEGACY to Kconfig
Tom Rini [Sat, 23 Jul 2022 17:05:02 +0000 (13:05 -0400)]
Convert CONFIG_FLASH_CFI_LEGACY to Kconfig

This converts the following to Kconfig:
   CONFIG_FLASH_CFI_LEGACY

Signed-off-by: Tom Rini <trini@konsulko.com>
21 months agoflash: Remove pic32_flash.c
Tom Rini [Sat, 23 Jul 2022 17:05:01 +0000 (13:05 -0400)]
flash: Remove pic32_flash.c

As the only pic32 platform does not enable flash, this is dead code.
Remove it.

Cc: Purna Chandra Mandal <purna.mandal@microchip.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
21 months agoConvert CONFIG_SYS_FLASH_ERASE_TOUT et al to Kconfig
Tom Rini [Sat, 23 Jul 2022 17:05:00 +0000 (13:05 -0400)]
Convert CONFIG_SYS_FLASH_ERASE_TOUT et al to Kconfig

This converts the following to Kconfig:
   CONFIG_SYS_FLASH_ERASE_TOUT
   CONFIG_SYS_FLASH_LOCK_TOUT
   CONFIG_SYS_FLASH_UNLOCK_TOUT
   CONFIG_SYS_FLASH_WRITE_TOUT

In practice, for two m68k platforms we move to hard-coding with a
comment the timeout values, rather than try and make convoluted Kconfig
logic.  We add options for the write and erase options to the pic32
flash driver, as this driver does make use of them.  Everywhere else
these are unreferenced values.

Signed-off-by: Tom Rini <trini@konsulko.com>
21 months agoConvert CONFIG_SYS_FLASH_CHECKSUM to Kconfig
Tom Rini [Sat, 23 Jul 2022 17:04:59 +0000 (13:04 -0400)]
Convert CONFIG_SYS_FLASH_CHECKSUM to Kconfig

This converts the following to Kconfig:
   CONFIG_SYS_FLASH_CHECKSUM

Signed-off-by: Tom Rini <trini@konsulko.com>
21 months agoP1010RDB: Drop support for not-CONFIG_SYS_DDR_RAW_TIMING
Tom Rini [Sat, 23 Jul 2022 17:04:58 +0000 (13:04 -0400)]
P1010RDB: Drop support for not-CONFIG_SYS_DDR_RAW_TIMING

All platforms today define CONFIG_SYS_DDR_RAW_TIMING, so drop the code
for this option being unset.

Cc: Qiang Zhao <qiang.zhao@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
21 months agomalta: Switch to using CONFIG_SYS_SDRAM_SIZE
Tom Rini [Sat, 23 Jul 2022 17:04:57 +0000 (13:04 -0400)]
malta: Switch to using CONFIG_SYS_SDRAM_SIZE

This is the only platform defining and using CONFIG_SYS_MEM_SIZE, switch
to using CONFIG_SYS_SDRAM_SIZE for consistency.

Cc: Paul Burton <paul.burton@mips.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
21 months agopowerpc: Move CONFIG_SYS_DDR_SIZE to CONFIG_SYS_SDRAM_SIZE
Tom Rini [Sat, 23 Jul 2022 17:04:56 +0000 (13:04 -0400)]
powerpc: Move CONFIG_SYS_DDR_SIZE to CONFIG_SYS_SDRAM_SIZE

We have a number of CONFIG_SYS_xxx_SIZE options to describe the amount
main memory available.  Rework CONFIG_SYS_DDR_SIZE, which described a
size in number of MiB to use CONFIG_SYS_SDRAM_SIZE which is most often
used as a number of bytes.  Use shifts of this option when required.

Signed-off-by: Tom Rini <trini@konsulko.com>
21 months agoConvert CONFIG_SYS_FLASH_EMPTY_INFO to Kconfig
Tom Rini [Sat, 23 Jul 2022 17:04:55 +0000 (13:04 -0400)]
Convert CONFIG_SYS_FLASH_EMPTY_INFO to Kconfig

This converts the following to Kconfig:
   CONFIG_SYS_FLASH_EMPTY_INFO

Signed-off-by: Tom Rini <trini@konsulko.com>
21 months agonet: Remove CONFIG_SYS_DIRECT_FLASH_TFTP
Tom Rini [Sat, 23 Jul 2022 17:04:54 +0000 (13:04 -0400)]
net: Remove CONFIG_SYS_DIRECT_FLASH_TFTP

No platforms enable the functionality to tftp directly to NOR flash, and
this is discouraged by the documentation.  Remove this code.  Further,
this highlights an oddity of the code.  Un-indent the start of this
function.

Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
21 months agosh: Remove unused code in arch/sh/lib/bootm.c
Tom Rini [Sat, 23 Jul 2022 17:04:53 +0000 (13:04 -0400)]
sh: Remove unused code in arch/sh/lib/bootm.c

There are no callers of the hexdump function that is guarded by
CONFIG_SYS_DEBUG, so remove the section.

Signed-off-by: Tom Rini <trini@konsulko.com>
21 months agoMerge branch '2022-08-04-assorted-fixed'
Tom Rini [Thu, 4 Aug 2022 20:02:42 +0000 (16:02 -0400)]
Merge branch '2022-08-04-assorted-fixed'

- Assorted TI, aspeed, xen updates
- Assorted return / error checking fixes in commands
- SPL MMC bugfix to get the correct device in some cases
- SPL related depends fixes
- Remove deprecated LCD command
- Some tool fixes

21 months agotools: mkimage: fix build with LibreSSL
Michal Vasilek [Fri, 22 Jul 2022 17:55:53 +0000 (19:55 +0200)]
tools: mkimage: fix build with LibreSSL

RSA_get0_* functions are not available in LibreSSL

Signed-off-by: Michal Vasilek <michal.vasilek@nic.cz>
Reviewed-by: Simon Glass <sjg@chromium.org>
21 months agotools: kwboot: use pkg-config to get -ltinfo
Heiko Thiery [Wed, 20 Jul 2022 10:31:35 +0000 (12:31 +0200)]
tools: kwboot: use pkg-config to get -ltinfo

Instead of hardcoding -ltinfo as the flags needed to build
kwboot, use pkg-config when available.

We gracefully fallback on the previous behavior of hardcoding -ltinfo
if pkg-config is not available or fails with an error.

Reviewed-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
21 months agotools: mkeficapsule: use pkg-config to get -luuid and -lgnutls
Heiko Thiery [Wed, 20 Jul 2022 10:31:33 +0000 (12:31 +0200)]
tools: mkeficapsule: use pkg-config to get -luuid and -lgnutls

Instead of hardcoding -luuid -lgnutls as the flags needed to build
mkeficapsule, use pkg-config when available.

We gracefully fallback on the previous behavior of hardcoding -luuid
-lgnutls if pkg-config is not available or fails with an error.

Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
21 months agoarm: mach-k3: security: Remove certificate if detected on GP device
Andrew Davis [Fri, 15 Jul 2022 16:34:35 +0000 (11:34 -0500)]
arm: mach-k3: security: Remove certificate if detected on GP device

If the device is a GP and we detect a signing certificate then remove it.
It would fail to authenticate otherwise as the device is GP and has no
secure authentication services in SYSFW.

This shouldn't happen often as trying to boot signed images on GP devices
doesn't make much sense, but if we run into a signed image we should at
least try to ignore the certificate and boot the image anyway. This could
help with users of GP devices who only have HS images available.

If this does happen, print a nice big warning.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
21 months agoarm: mach-k3: security: Bypass image signing at runtime for GP devices
Andrew Davis [Fri, 15 Jul 2022 16:34:34 +0000 (11:34 -0500)]
arm: mach-k3: security: Bypass image signing at runtime for GP devices

We can skip the image authentication check at runtime if the device is GP.
This reduces the delta between GP and HS U-Boot builds. End goal is
to re-unify the two build types into one build that can run on all
device types.

Signed-off-by: Andrew Davis <afd@ti.com>
21 months agoarm: mach-k3: security: Allow signing bypass if type is HS-FS
Andrew Davis [Fri, 15 Jul 2022 16:34:33 +0000 (11:34 -0500)]
arm: mach-k3: security: Allow signing bypass if type is HS-FS

On HS-FS devices signing boot images is optional. To ease use
we check if we are HS-FS and if no certificate is attached
to the image we skip the authentication step with a warning
that this will fail when the device is set to security enforcing.

Signed-off-by: Andrew Davis <afd@ti.com>
21 months agoarm: mach-k3: Add support for device type detection
Andrew Davis [Fri, 15 Jul 2022 16:34:32 +0000 (11:34 -0500)]
arm: mach-k3: Add support for device type detection

K3 SoCs are available in a number of device types such as
GP, HS-FS, EMU, etc. Like OMAP SoCs we can detect this at runtime
and should print this out as part of the SoC information line.
We add this as part of the common.c file as it will be used
to also modify our security state early in the device boot.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
21 months agocmd: remove deprecated LCD support
Heinrich Schuchardt [Thu, 14 Jul 2022 06:53:46 +0000 (08:53 +0200)]
cmd: remove deprecated LCD support

No board uses lcd_clear() anymore. So we can remove support for it.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
21 months agovpl: fix reference in comment to non-existing SPL_SERIAL_SUPPORT
Quentin Schulz [Tue, 12 Jul 2022 15:44:22 +0000 (17:44 +0200)]
vpl: fix reference in comment to non-existing SPL_SERIAL_SUPPORT

Since commit 2a7360666871 ("serial: Rename SERIAL_SUPPORT to SERIAL")
SPL_SERIAL_SUPPORT is named SPL_SERIAL. So let's update the comment to
point to the correct Kconfig option in the comment of VPL_SERIAL.

Fixes: 747093dd408 ("vpl: Add Kconfig options for VPL")
Cc: Quentin Schulz <foss+uboot@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
21 months agoimx: imx8mp_rsb3720a1: fix incorrect ifdef check on SPL_MMC
Quentin Schulz [Tue, 12 Jul 2022 15:44:21 +0000 (17:44 +0200)]
imx: imx8mp_rsb3720a1: fix incorrect ifdef check on SPL_MMC

Since commit 103c5f180694 ("mmc: Rename MMC_SUPPORT to MMC"),
SPL_MMC_SUPPORT is named SPL_MMC, so let's fix the ifdef.

Fixes: fbc6b1414342 ("imx: imx8mp_rsb3720a1: convert to DM_SERIAL")
Cc: Quentin Schulz <foss+uboot@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
21 months agomx7ulp_com: fix incorrect select for SPL options
Quentin Schulz [Tue, 12 Jul 2022 15:44:20 +0000 (17:44 +0200)]
mx7ulp_com: fix incorrect select for SPL options

SPL_GPIO_SUPPORT is named SPL_GPIO since commit 83061dbd1c89 ("Rename
GPIO_SUPPORT to GPIO"), SPL_MMC_SUPPORT is named SPL_MMC since commit
103c5f180694 ("mmc: Rename MMC_SUPPORT to MMC"), SPL_SERIAL_SUPPORT is
named SPL_SERIAL since commit 2a7360666871 ("serial: Rename
SERIAL_SUPPORT to SERIAL") so let's select the correct Kconfig options.

Fixes: 8b71576f3842 ("mx7ulp_com: add support for SPL")
Cc: Quentin Schulz <foss+uboot@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
21 months agogpio: fix incorrect depends on for SPL_GPIO_HOG
Quentin Schulz [Tue, 12 Jul 2022 15:44:19 +0000 (17:44 +0200)]
gpio: fix incorrect depends on for SPL_GPIO_HOG

Since commit 83061dbd1c89 ("Rename GPIO_SUPPORT to GPIO"),
SPL_GPIO_SUPPORT has been renamed to SPL_GPIO, meaning that SPL_GPIO_HOG
can never be enabled.

Let's fix this by using the proper name for the Kconfig option.

Fixes: 1d99e673c752 ("gpio: Enable hogging support in SPL")
Cc: Quentin Schulz <foss+uboot@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
21 months agoARM: dts: npcm7xx: add npcm750 full function node
Jim Liu [Tue, 12 Jul 2022 09:24:07 +0000 (17:24 +0800)]
ARM: dts: npcm7xx: add npcm750 full function node

add npcm750 BMC full function node

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
21 months agocmd: undefined return value of do_extension_apply()
Heinrich Schuchardt [Mon, 11 Jul 2022 18:01:12 +0000 (20:01 +0200)]
cmd: undefined return value of do_extension_apply()

If 'extension apply all' is executed and no extension is found, the return
value of do_extension_apply() is undefined. Return CMD_RET_FAILURE in this
case.

Fixes: 2f84e9cf06d3 ("cmd: add support for a new "extension" command")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>
21 months agospl: mmc: Use correct MMC device when loading image
Harald Seiler [Mon, 11 Jul 2022 12:35:32 +0000 (14:35 +0200)]
spl: mmc: Use correct MMC device when loading image

When attempting to load images from multiple MMC devices in sequence,
spl_mmc_load() chooses the wrong device from the second attempt onwards.

The reason is that MMC initialization is only done on its first call and
spl_mmc_load() will then continue using this same device for all future
calls.

Fix this by checking the devnum of the "cached" device struct against
the one which is requested.  If they match, use the cached one but if
they do not match, initialize the new device.

This fixes specifying multiple MMC devices in the SPL's boot order to
fall back when U-Boot Proper is corrupted or missing on the first
attempted MMC device.

Fixes: e1eb6ada4e38 ("spl: Make image loader infrastructure more universal")
Signed-off-by: Harald Seiler <hws@denx.de>
21 months agodrivers: xen: events: fix build issues with disabled Xen HVC
Dmytro Firsov [Mon, 4 Jul 2022 12:05:38 +0000 (12:05 +0000)]
drivers: xen: events: fix build issues with disabled Xen HVC

Some setups do not use Xen hypervisor console for logging, e.g. they
use emulated PL011 hardware or shared peripherals (real UART). In such
cases Xen HVC will be disabled on a build time and will cause issues in
current driver implementation.

This commit fixes build issues in Xen event channel driver, caused
by absense of console event channel, that is not available when console
config is disabled. Now console related code will be removed when
Xen HVC is turned off.

Signed-off-by: Dmytro Firsov <dmytro_firsov@epam.com>
Reviewed-by: Anastasiia Lukianenko <vicooodin@gmail.com>
Reviewed-by: Anastasiia Lukianenko <vicooodin@gmail.com<mailto:vicooodin@gmail.com>>
Signed-off-by: Dmytro Firsov <dmytro_firsov@epam.com<mailto:dmytro_firsov@epam.com>>
21 months agocmd: fix do_adc_single()
Vyacheslav Bocharov [Sun, 3 Jul 2022 12:49:09 +0000 (15:49 +0300)]
cmd: fix do_adc_single()

The source code contains an error:
- argv[2] contains <channel> arg, variable for env_set is in argv[3]
- number of args is 4

Revert 54d24d72601321f4470c4edf31c6b29adae424a7
  cmd: simplify do_adc_single()

Fixes 9de612ae4ded53f742f5f99929c06d0839471ced
  cmd: adc: Add support for storing ADC result in env variable
Reviewed-by: Simon Glass <sjg@chromium.org>
21 months agopwm: aspeed: Select SYSCON to get parent detail.
Billy Tsai [Fri, 29 Apr 2022 03:50:48 +0000 (11:50 +0800)]
pwm: aspeed: Select SYSCON to get parent detail.

To work correctly, this driver depends on SYSCON to get the base address
from the parent dts node.

Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
Reviewed-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
21 months agoMAINTAINERS: Change POWERPC MPC85XX maintainer to Marek Behún
Marek Behún [Mon, 25 Jul 2022 15:06:15 +0000 (17:06 +0200)]
MAINTAINERS: Change POWERPC MPC85XX maintainer to Marek Behún

After a discussion with Tom Rini, we've agreed that I am going to take
over custodianship of the MPC85XX platform, since it seems other people
do not have necessary interest or time and getting things done over
there takes too long.

Since I am only working on one MPC85XX board, Turris 1.x, and do not
have time to do thorough reviews of patches for this entire platform
(other than those concerning Turris 1.x board), for other boards I will
only run patches through CI and checkpatch, and then send them via PR
upwards to Tom.

Signed-off-by: Marek Behún <kabel@kernel.org>
Acked-by: Tom Rini <trini@konsulko.com>
21 months agoMerge tag 'fsl-qoriq-2022-7-29' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Mon, 1 Aug 2022 01:08:50 +0000 (21:08 -0400)]
Merge tag 'fsl-qoriq-2022-7-29' of https://source.denx.de/u-boot/custodians/u-boot-fsl-qoriq

mpc85xx: support for generating QorIQ pre-PBL eSDHC boot sector
p1_p2_rdb_pc: Remove I-flag from second L2 SRAM mapping
p1_p2_rdb_pc: Fix parsing inverted bits from boot input data
p1_p2_rdb_pc: Simplify SPL offset macros

21 months agoMerge tag 'doc-2022-10-rc2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Fri, 29 Jul 2022 17:24:11 +0000 (13:24 -0400)]
Merge tag 'doc-2022-10-rc2' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for doc-2022-10-rc2

Documentation:

* Detail how configuration signatures are calculated
* Further expand on Image locations and provide example
* Describe system configuration

21 months agodoc: develop: Describe system configuration
Tom Rini [Fri, 29 Jul 2022 16:07:38 +0000 (12:07 -0400)]
doc: develop: Describe system configuration

Start by describing in general the best practices for how to implement
configuration of some aspect of U-Boot.  This generally means finding
the right choices for when something should be static or dynamically
configured and enabled.  Then further document when to use CONFIG or CFG
namespaces for static configuration.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
21 months agoProvide more details of exactly how configuration signatures are calculated
Martin Bonner [Mon, 25 Jul 2022 07:45:59 +0000 (08:45 +0100)]
Provide more details of exactly how configuration signatures are calculated

Describe exactly which bytes are hashed and in what order
when signing a configuration.

Signed-off-by: Martin Bonner <martingreybeard@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
21 months agodoc: environment: Further expand on Image locations and provide example
Tom Rini [Mon, 11 Jul 2022 18:32:13 +0000 (14:32 -0400)]
doc: environment: Further expand on Image locations and provide example

Start by elaborating on what some of our constraints tend to be with
image location values, and document where these external constraints
can come from.  Provide a new subsection, an example based on the TI
ARMv7 OMAP2PLUS families of chips, that gives sample values and explains
why we use these particular values.  This is based on what is in
include/configs/ti_armv7_common.h as of fb3ad9bd923d ("TI: Add, use a
DEFAULT_LINUX_BOOT_ENV environment string") as this contains just the
values referenced in this document now and not some of the further
additions that are less generic.

Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
21 months agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Fri, 29 Jul 2022 12:08:33 +0000 (08:08 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-marvell

- mvebu: Add Armada 38x pin muxing support (Pali)
- a37xx: pinctrl: Fix requesting GPIOs and pinmux command (Pali)
- mvebu: pinctrl: apply SDHCI PHY config for A7K (Kosta)
- gpio: Add Turris Omnia MCU driver (Pali)
- cmd: mvebu/bubt: Improvements for image verification (Pali)
- mvebu: turris_omnia: Fix mpp26 pin name and comment (Marek)

21 months agoarm: mvebu: turris_omnia: Fix mpp26 pin name and comment
Marek Behún [Wed, 27 Jul 2022 13:00:27 +0000 (15:00 +0200)]
arm: mvebu: turris_omnia: Fix mpp26 pin name and comment

There is a bug in Turris Omnia's schematics, whereupon the MPP[26] pin,
which is routed to CN11 pin header, is documented as SPI CS1, but
MPP[26] pin does not support this function. Instead it controls chip
select 2 if in "spi0" mode.

Fix the name of the pin node in pinctrl node and fix the comment in SPI
node.

Signed-off-by: Marek Behún <kabel@kernel.org>
21 months agoarm: mvebu: Synchronize armada-385-turris-omnia with Linux v5.20
Pali Rohár [Wed, 27 Jul 2022 12:47:38 +0000 (14:47 +0200)]
arm: mvebu: Synchronize armada-385-turris-omnia with Linux v5.20

* Add SPDX-License-Identifier
* Add SFP and LED nodes
* Fix PHY nad NOR nodes
* Remove duplicates from u-boot.dtsi file

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agoarm: mvebu: Synchronize armada-385.dtsi with Linux v5.20
Pali Rohár [Wed, 27 Jul 2022 12:47:37 +0000 (14:47 +0200)]
arm: mvebu: Synchronize armada-385.dtsi with Linux v5.20

* Define PCIe interrupts

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agoarm: mvebu: Synchronize armada-38x.dtsi with Linux v5.20
Pali Rohár [Wed, 27 Jul 2022 12:47:36 +0000 (14:47 +0200)]
arm: mvebu: Synchronize armada-38x.dtsi with Linux v5.20

* Replace skeleton.dtsi by explicit #address-cells / #size-cells
* Add sdramc@1400 and phy@18300 nodes
* Remove (unused) timeout-ms i2c properties
* Fix compatible string for UARTs
* Add interrupts properties for watchdog

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agoarm: mvebu: Fix compatible string for nand controller
Pali Rohár [Wed, 27 Jul 2022 12:47:35 +0000 (14:47 +0200)]
arm: mvebu: Fix compatible string for nand controller

Linux kernel uses compatible string "marvell,armada370-nand-controller" for
nand controllers on Armada 370/XP/38x. U-Boot currently uses mix of
"marvell,armada370-nand" and "marvell,mvebu-pxa3xx-nand".

So unify it and use just Linux kernel compatible string.

Signed-off-by: Pali Rohár <pali@kernel.org>
Acked-by: Michael Trimarchi <michael@amarulasolutions.com>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agoboard: freescale: p1_p2_rdb_pc: Simplify SPL offset macros
Pali Rohár [Thu, 28 Jul 2022 03:10:12 +0000 (11:10 +0800)]
board: freescale: p1_p2_rdb_pc: Simplify SPL offset macros

Now when CONFIG_SYS_TEXT_BASE has sane value, use it for calculation of
other SPL offset values: CONFIG_SPL_MAX_SIZE, CONFIG_SYS_MMC_U_BOOT_* and
CONFIG_SYS_SPI_FLASH_U_BOOT_* macros.

No functional change.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
21 months agoboard: freescale: p1_p2_rdb_pc: Fix parsing inverted bits from boot input data
Pali Rohár [Thu, 28 Jul 2022 03:07:13 +0000 (11:07 +0800)]
board: freescale: p1_p2_rdb_pc: Fix parsing inverted bits from boot input data

On some boards upper 4 bits of i2c boot input data (register 0) are
inverted. Information which bits are inverted is stored in register 2.

So invert read input data back according to register 2 prior processing
them. This fixes printing "rom_loc: value" line during booting.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
21 months agoboard: freescale: p1_p2_rdb_pc: Remove I-flag from second L2 SRAM mapping
Pali Rohár [Wed, 27 Jul 2022 15:21:28 +0000 (17:21 +0200)]
board: freescale: p1_p2_rdb_pc: Remove I-flag from second L2 SRAM mapping

U-Boot for initial L2 SRAM uses L2 memory-mapping mode and not L2 with
locked lines. P2020 reference manual about L2 memory-mapping mode says:

  Accesses to memory-mapped SRAM are cacheable only in the corresponding
  e500 L1 caches.

So there is no need to set Caching-Inhibit I-bit for second part of initial
L2 SRAM mapping in TLB entry. Remove it. First part of initial L2 SRAM
mapping already does not have I-bit set.

For more details see also:
https://lore.kernel.org/u-boot/20220508150844.qqxg452rs4wtf5bs@pali/

Signed-off-by: Pali Rohár <pali@kernel.org>
21 months agopowerpc: mpc85xx: Add support for generating QorIQ pre-PBL eSDHC boot sector
Pali Rohár [Wed, 11 May 2022 18:57:31 +0000 (20:57 +0200)]
powerpc: mpc85xx: Add support for generating QorIQ pre-PBL eSDHC boot sector

QorIQ U-Boot binary for SD card booting compiled during build process
(either u-boot.bin or u-boot-with-spl.bin) cannot be directly loaded by
QorIQ pre-PBL BootROM. Compiled U-Boot binary first needs to be processed
by Freescale boot_format tool as described in doc/README.mpc85xx-sd-spi-boot

BootROM requires that image on SD card must contain special boot sector.
Implement support for generating this special boot sector directly in
U-Boot start code. Boot sector needs to be at the beginning of the image,
so when compiling only proper U-Boot without SPL then it needs to be in
proper U-Boot. When compiling SPL with proper U-Boot then it needs to be
only in SPL.

Support can be enabled by a new config option FSL_PREPBL_ESDHC_BOOT_SECTOR.
Via other two additional options FSL_PREPBL_ESDHC_BOOT_SECTOR_START and
FSL_PREPBL_ESDHC_BOOT_SECTOR_DATA it is possible to tune how final U-Boot
image could be stored on the SD card.

Signed-off-by: Pali Rohár <pali@kernel.org>
21 months agocmd: mvebu/bubt: Fix cmd main return value on error
Pali Rohár [Tue, 26 Jul 2022 14:11:59 +0000 (16:11 +0200)]
cmd: mvebu/bubt: Fix cmd main return value on error

Negative return value from cmd main function cause U-Boot to print criplic
error message: exit not allowed from main input shell.

Set return value on error to 1.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agocmd: mvebu/bubt: Add support for sha512 checksum validation for Armada 3700
Pali Rohár [Tue, 26 Jul 2022 14:11:58 +0000 (16:11 +0200)]
cmd: mvebu/bubt: Add support for sha512 checksum validation for Armada 3700

Armada 3700 BootROM supports also images with sha512 checksums and
mox-imager tool [1] generates such bootable images. Without sha512 support
U-Boot bubt command just prints error message:

  Error: Unsupported hash_algorithm_id = 64
  Error: Image header verification failed

This patch adds support for sha512 checksum validation for Armada 3700
images. With it bubt prints:

  Image checksum...OK!

[1] - https://gitlab.nic.cz/turris/mox-boot-builder.git

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agocmd: mvebu/bubt: Correctly propagate failure during tftp transport
Pali Rohár [Tue, 26 Jul 2022 14:11:57 +0000 (16:11 +0200)]
cmd: mvebu/bubt: Correctly propagate failure during tftp transport

net_loop() returns signed int type and negative value represents error.
tftp_read_file() returns unsigned size_t type and zero value represents
error. Casting signed negative value to unsigned size_t type cause losing
information about error and bubt thinks that no error happened, and
continue erasing SPI-NOR which cause malfunction device.

Fix this issue by correctly propagating failure during tftp transport.

With this change when there is no eth link, bubt does not erase SPI-NOR
anymore.

  => bubt
  Burning U-Boot image "flash-image.bin" from "tftp" to "spi"
  ethernet@30000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
  ethernet@30000: No link.
  Error: Failed to read file flash-image.bin from tftp

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agocmd: mvebu/bubt: Verify image type for all 32-bit Aramda SoCs and Armada 3700
Pali Rohár [Tue, 26 Jul 2022 14:11:56 +0000 (16:11 +0200)]
cmd: mvebu/bubt: Verify image type for all 32-bit Aramda SoCs and Armada 3700

Current image type verification code is specific to 32-bit Armada SoCs but
used only for Armada 38x. Implement image type verification for Armada 3700
and enable Armada 38x image verification for all 32-bit Armada SoCs.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agoarm: mvebu: turris_omnia: Add mcu node with gpio-controller
Pali Rohár [Thu, 28 Jul 2022 11:06:25 +0000 (13:06 +0200)]
arm: mvebu: turris_omnia: Add mcu node with gpio-controller

This allows U-Boot to register new Turris Omnia MCU driver.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agogpio: Add Turris Omnia MCU driver
Pali Rohár [Thu, 28 Jul 2022 11:06:24 +0000 (13:06 +0200)]
gpio: Add Turris Omnia MCU driver

This driver registers GPIO controller and allows U-Boot to control GPIO
pins on MCU which is connected to Turris Omnia via i2c.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agomvebu: pinctrl: apply SDHCI PHY config for A7K
Konstantin Porotchkin [Mon, 25 Jul 2022 12:13:02 +0000 (14:13 +0200)]
mvebu: pinctrl: apply SDHCI PHY config for A7K

Current pin control driver applies SDHCI PHY MUX selection
when board DT calls for eMMC function on MPP wires.
However, for CP side eMMC, only the "armada-8k-cpm-pinctrl"
compatibility string is taken into account, which causes
CP-SDHCI on Armada-7K boards to fail.
This patch adds "armada-7k-pinctrl" compatibility string
handling for the CP-SDHCI PHY configuration case.

Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
Reviewed-by: Igal Liberman <igall@marvell.com>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agoarm64: a37xx: pinctrl: Implement get_pins_count, get_pin_name and get_pin_muxing...
Pali Rohár [Mon, 25 Jul 2022 12:09:03 +0000 (14:09 +0200)]
arm64: a37xx: pinctrl: Implement get_pins_count, get_pin_name and get_pin_muxing functions

These functions are required for 'pinmux status -a' command to print
current configuration of each MPP pin.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agoarm64: a37xx: pinctrl: Implement gpio_request_enable for gpio functionality
Pali Rohár [Mon, 25 Jul 2022 12:09:02 +0000 (14:09 +0200)]
arm64: a37xx: pinctrl: Implement gpio_request_enable for gpio functionality

To automatically enable GPIO functionality of some MPP pin, it is required
to implement .gpio_request_enable and .gpio_disable_free callbacks in
pinctrl driver and set .request and .rfree callbacks in GPIO driver to
pinctrl_gpio_request / pinctrl_gpio_free functions.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agoarm64: a37xx: pinctrl: Add missing pinmuxes into the list
Pali Rohár [Mon, 25 Jul 2022 12:09:01 +0000 (14:09 +0200)]
arm64: a37xx: pinctrl: Add missing pinmuxes into the list

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agoarm64: a37xx: pinctrl: Mark all functions and structures as static
Pali Rohár [Mon, 25 Jul 2022 12:09:00 +0000 (14:09 +0200)]
arm64: a37xx: pinctrl: Mark all functions and structures as static

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agoarm64: a37xx: pinctrl: Remove duplicate info->groups and info->ngroups fields
Pali Rohár [Mon, 25 Jul 2022 12:08:59 +0000 (14:08 +0200)]
arm64: a37xx: pinctrl: Remove duplicate info->groups and info->ngroups fields

They are available in pin_data structure.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agoarm64: a37xx: pinctrl: Remove unused grp->pins fields
Pali Rohár [Mon, 25 Jul 2022 12:08:58 +0000 (14:08 +0200)]
arm64: a37xx: pinctrl: Remove unused grp->pins fields

grp->pins is just filled and never used. Remove it.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agoarm: mvebu: turris_omnia: Enable a38x pinctrl and gpio support
Pali Rohár [Mon, 25 Jul 2022 11:56:15 +0000 (13:56 +0200)]
arm: mvebu: turris_omnia: Enable a38x pinctrl and gpio support

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agogpio: mvebu_gpio: Set bank name to mvebu%d
Pali Rohár [Mon, 25 Jul 2022 11:56:14 +0000 (13:56 +0200)]
gpio: mvebu_gpio: Set bank name to mvebu%d

Currently bank name is just one alphabetical letter.
Change it to mvebu and number.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agogpio: mvebu_gpio: Read number of gpios from DT
Pali Rohár [Mon, 25 Jul 2022 11:56:13 +0000 (13:56 +0200)]
gpio: mvebu_gpio: Read number of gpios from DT

Device tree property "ngpios" contains number of gpios.
Use it when available.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agogpio: mvebu_gpio: Add .request and .rfree methods for Armada 38x
Pali Rohár [Mon, 25 Jul 2022 11:56:12 +0000 (13:56 +0200)]
gpio: mvebu_gpio: Add .request and .rfree methods for Armada 38x

To use particular pin GPIO, it needs to be first switched to GPIO by
pinctrl. Use pinctrl_gpio_request() and pinctrl_gpio_free() for this
purpose.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agopinctrl: Add third argument label for pinctrl_gpio_request() function
Pali Rohár [Mon, 25 Jul 2022 11:56:11 +0000 (13:56 +0200)]
pinctrl: Add third argument label for pinctrl_gpio_request() function

This change allows to use pinctrl_gpio_request() function as a direct
pointer for dm_gpio_ops's .request callback.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agoarm: mvebu: Add gpio-ranges into Armada 38x device tree file
Pali Rohár [Mon, 25 Jul 2022 11:56:10 +0000 (13:56 +0200)]
arm: mvebu: Add gpio-ranges into Armada 38x device tree file

This allows U-Boot mvebu-gpio.c driver to switch particular MPP pin into
GPIO mode and enable GPIO support.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agomvebu: pinctrl: Add Armada 38x driver
Pali Rohár [Mon, 25 Jul 2022 11:56:09 +0000 (13:56 +0200)]
mvebu: pinctrl: Add Armada 38x driver

This new Armada 38x driver is based on Linux kernel driver. It can set any
pin to any valid function specified in DT like Linux kernel, it provides
support for 'pinmux status -a' command and also for pinctrl_gpio_request().

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agopinctrl: Add new function pinctrl_generic_set_state_prefix()
Pali Rohár [Mon, 25 Jul 2022 11:56:08 +0000 (13:56 +0200)]
pinctrl: Add new function pinctrl_generic_set_state_prefix()

This new function pinctrl_generic_set_state_prefix() behaves like
pinctrl_generic_set_state() but it takes third string argument which is
used as the prefix for each device tree string property.

This is needed for Marvell pinctrl drivers, becase Linux device tree files
have pinmux properties prefixed by "marvell," string.

This change allows to use generic U-Boot pinctrl functions for Armada 38x
pinctrl driver without need to copy+paste of the majority U-Boot pinctrl
code.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
21 months agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-mmc
Tom Rini [Wed, 27 Jul 2022 11:00:54 +0000 (07:00 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-mmc

21 months agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-pmic
Tom Rini [Wed, 27 Jul 2022 11:00:24 +0000 (07:00 -0400)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-pmic

21 months agoMerge tag 'dm-pull-26jul22' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm.git
Tom Rini [Wed, 27 Jul 2022 10:59:55 +0000 (06:59 -0400)]
Merge tag 'dm-pull-26jul22' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm.git

minor dm- and fdt-related fixes
start of test for fdt command

21 months agommc: pci_mmc.c should build with ACPIGEN=n
Heinrich Schuchardt [Sun, 12 Jun 2022 12:53:48 +0000 (12:53 +0000)]
mmc: pci_mmc.c should build with ACPIGEN=n

sandbox_defconfig builds the PCI MMC driver. It should be possible to
build the sandbox without ACPI support.

ACPI support in the PCI MMC driver is only needed when creating an ACPI
table. Fix building with ACPIGEN=n.

Fixes: dba7ee419d9d ("acpi: mmc: Generate ACPI info for the PCI SD Card")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
21 months agocmd: mmc: allow to write protect single boot partition
Ying-Chun Liu (PaulLiu) [Mon, 25 Apr 2022 13:59:03 +0000 (21:59 +0800)]
cmd: mmc: allow to write protect single boot partition

add arguments for mmc wp to assign which boot partition to protect.

Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
21 months agodrivers: mmc: write protect single boot area
Ying-Chun Liu (PaulLiu) [Mon, 25 Apr 2022 13:59:02 +0000 (21:59 +0800)]
drivers: mmc: write protect single boot area

Add features to write protect single boot area rather than all boot
areas.

Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
21 months agommc: nuvoton: Add NPCM7xx mmc driver
Jim Liu [Tue, 24 May 2022 08:55:33 +0000 (16:55 +0800)]
mmc: nuvoton: Add NPCM7xx mmc driver

Add Nuvoton BMC NPCM750 mmc control driver.

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
21 months agommc: fsl_esdhc: Fix 'Internal clock never stabilised.' error
Pali Rohár [Fri, 29 Apr 2022 18:27:34 +0000 (20:27 +0200)]
mmc: fsl_esdhc: Fix 'Internal clock never stabilised.' error

Only newer eSDHC controllers set PRSSTAT_SDSTB flag. So do not wait until
flag PRSSTAT_SDSTB is set on old pre-2.2 controllers. Instead sleep for
fixed amount of time like it was before commit 6f883e501b65 ("mmc:
fsl_esdhc: Add emmc hs200 support").

This change fixes error 'Internal clock never stabilised.' which is printed
on P2020 board at every access to SD card.

Fixes: 6f883e501b65 ("mmc: fsl_esdhc: Add emmc hs200 support")
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
21 months agopmic: pca9450: permit config on all bucks and LDOs
Heiko Thiery [Mon, 20 Jun 2022 03:49:49 +0000 (05:49 +0200)]
pmic: pca9450: permit config on all bucks and LDOs

In order to have the possibility to configure the regulators at system
startup through DM support, all LDOs and bucks must be able to be
changeable. Currently there is a limitation to change the values when
the output is enabled. Since the driver is based on the ROHM BD71837 and a
comment that describes a limitation about switching while the output is
enabled can also be found there, the limitation probably comes from this type.

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
21 months agoARM: relocate: Fix Thumb code by using proper label type
Andre Przywara [Tue, 12 Jul 2022 11:00:23 +0000 (12:00 +0100)]
ARM: relocate: Fix Thumb code by using proper label type

The generic ARM relocate_code function was using its own function entry
point as a relocation base, and it was obtaining that address by using
the "adr" instruction on that entry point label.
However that label is not just an ordinary label, instead we explicitly
mark it as a function start address. Normally that doesn't change much
(other than for debugging), but when assembled in Thumb mode, newer
versions of the GNU assembler prepare everything for this address being
used as the argument to a "bx" call, so make sure bit 0 is set in there
to mark this function as Thumb code. Of course this doesn't end up very
well when we use this address for the ensuing memcpy operation.

To avoid this problem, and to solve it in a robust way, add an extra
label, which is not marked as a function entry, and use that for the adr
instruction. This lets all assemblers generate the right immediate offset
in the "adr" instruction.

This fixes in particular ARMv7-M ports when using GNU binutils v2.37 or
newer (commit d3e52e120b68 seems to trigger the change in behaviour).

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reported-by: Jesse Taube <mr.bossman075@gmail.com>
21 months agoMerge tag 'u-boot-imx-20220726' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
Tom Rini [Tue, 26 Jul 2022 14:26:00 +0000 (10:26 -0400)]
Merge tag 'u-boot-imx-20220726' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

u-boot-imx-20220726
-------------------

i.MX for 2022.10

- Added i.MX93 architecture

CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/12891

21 months agoMerge tag 'xilinx-for-v2022.10-rc2' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Tue, 26 Jul 2022 12:32:37 +0000 (08:32 -0400)]
Merge tag 'xilinx-for-v2022.10-rc2' of https://source.denx.de/u-boot/custodians/u-boot-microblaze

Xilinx changes for v2022.10-rc2

fpga:
- Convert SYS_FPGA_CHECK_CTRLC and SYS_FPGA_PROG_FEEDBACK to Kconfig
- Add support for secure bitstream loading

spi:
- xilinx_spi: Add support for memopers and supports_op
- zynq_qspi: Add support for supports_op/child_pre_probe
- zynq_qspi: Fix dummy cycle and qspi speed calculations

xilinx:
- Get rid of #stream-id-cells
- Use fixed partitions for SOM
- Add support for UUID reading from FRU
- Use strlcpy instead of strncpy
- Add reset driver support for ZynqMP and Versal
- Enable power domain driver in ZynqMP and Versal

zynqmp:
- Do no place BSS at 0 which have issue with NULL pointer
- Enable SLG gpio driver
- Disable LMB for mini configurations
- Remove duplicate PMIO_NODE_ID_BASE macro

versal:
- Add xlnx-versal-resets.h header

mmc:
- zynq_sdhci: Fix macro for MMC HS

relocate-rela:
- Fix support for BE hosts
- Define all macros for e_machine and reloc types

misc:
- Get rid of guard macros from ARM and RISC-V

lmb:
- Add support for disabling LMB

serial:
- zynq: Fix baudrate calculation

tests:
- Mark bind tests to run only on sandbox
- List also dm uclass and devres

21 months agoimx: imx8mm-icore: migrate to use BINMAN
Peng Fan [Tue, 26 Jul 2022 08:41:23 +0000 (16:41 +0800)]
imx: imx8mm-icore: migrate to use BINMAN

Use BINMAN instead of imx specific packing method.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
21 months agoarm: dts: imx8m: shrink ddr firmware size to actual file size
Peng Fan [Tue, 26 Jul 2022 08:41:22 +0000 (16:41 +0800)]
arm: dts: imx8m: shrink ddr firmware size to actual file size

After we switch to use BINMAN_SYMBOLS, there is no need to pad
the file size to 0x8000 and 0x4000. After we use BINMAN_SYMBOLS,
the u-boot-spl-ddr.bin shrink about 36KB with i.MX8MP-EVK.

Tested-by: Tim Harvey <tharvey@gateworks.com> #imx8m[m,n,p]-venice
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
21 months agoddr: imx8m: helper: load ddr firmware according to binman symbols
Peng Fan [Tue, 26 Jul 2022 08:41:21 +0000 (16:41 +0800)]
ddr: imx8m: helper: load ddr firmware according to binman symbols

By reading binman symbols, we no need hard coded IMEM_LEN/DMEM_LEN after
we update the binman dtsi to drop 0x8000/0x4000 length for the firmware.

And that could save binary size for many KBs.

Tested-by: Tim Harvey <tharvey@gateworks.com> #imx8m[m,n,p]-venice
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
[Alper: Check BINMAN_SYMS_OK instead]
Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
21 months agoarm: dts: imx8m: update binman ddr firmware node name
Peng Fan [Tue, 26 Jul 2022 08:41:20 +0000 (16:41 +0800)]
arm: dts: imx8m: update binman ddr firmware node name

We are migrating to use binman symbols, the current names are
inconsistent across different boards, so unify them.

Also add `type = "blob-ext";`, since the new names are not valid binman
types.

Tested-by: Tim Harvey <tharvey@gateworks.com> #imx8m[m,n,p]-venice
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
[Alper: Edit commit message]
Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
21 months agotools: image: support i.MX93
Peng Fan [Tue, 26 Jul 2022 08:41:19 +0000 (16:41 +0800)]
tools: image: support i.MX93

Support build i.MX93 container image with mkimage

Signed-off-by: Peng Fan <peng.fan@nxp.com>
21 months agoboard: freescale: imx93_evk: support ethernet
Peng Fan [Tue, 26 Jul 2022 08:41:18 +0000 (16:41 +0800)]
board: freescale: imx93_evk: support ethernet

Add ethernet support

Signed-off-by: Peng Fan <peng.fan@nxp.com>
21 months agonet: dwc_eth_qos: introduce eqos hook eqos_get_enetaddr
Peng Fan [Tue, 26 Jul 2022 08:41:17 +0000 (16:41 +0800)]
net: dwc_eth_qos: introduce eqos hook eqos_get_enetaddr

i.MX has specific hook to get MAC address, so introduce a hook and move
i.MX code to its own driver

Signed-off-by: Peng Fan <peng.fan@nxp.com>
21 months agonet: eqos: add function to get phy node and address
Ye Li [Tue, 26 Jul 2022 08:41:16 +0000 (16:41 +0800)]
net: eqos: add function to get phy node and address

Since new atheros PHY driver needs to access its PHY node through
phy device, we have to assign the phy node in ethernet controller
driver. Otherwise the PHY driver will fail to get some nodes
and properties.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
21 months agonet: dwc_eth_qos: move i.MX code out
Peng Fan [Tue, 26 Jul 2022 08:41:15 +0000 (16:41 +0800)]
net: dwc_eth_qos: move i.MX code out

Move i.MX code to a standalone file to make it easy for adding new
platform support

Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
21 months agonet: dwc_eth_qos: public some functions
Peng Fan [Tue, 26 Jul 2022 08:41:14 +0000 (16:41 +0800)]
net: dwc_eth_qos: public some functions

Move macros and structures to header file and make some functions
public, so that could used by other files, this is to
prepare split platform specific config to one file.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
21 months agonet: dwc_eth_qos: fix build break when CLK not enabled
Peng Fan [Tue, 26 Jul 2022 08:41:13 +0000 (16:41 +0800)]
net: dwc_eth_qos: fix build break when CLK not enabled

When CONFIG_CLK is not enabled, there will be buil break:
"error: ‘eqos’ undeclared (first use in this function)"

Take eqos definition out the CONFIG_CLK ifdef.

Signed-off-by: Peng Fan <peng.fan@nxp.com>