platform/kernel/u-boot.git
16 months agoarm: mxs: Add function to dump PMU registers
Lukasz Majewski [Tue, 9 May 2023 14:32:42 +0000 (16:32 +0200)]
arm: mxs: Add function to dump PMU registers

This commit provides function, which when debugging
output is enabled dumps the IMX28 PMU registers.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
16 months agoarm: mxs: Provide Kconfig option to not enable 4P2 regulator in IMX28 PMU
Lukasz Majewski [Tue, 9 May 2023 14:32:41 +0000 (16:32 +0200)]
arm: mxs: Provide Kconfig option to not enable 4P2 regulator in IMX28 PMU

The IMX28 PMU (Power Management Unit) has a dedicated Linear Regulator
to produce (by default) 4.2V output - available outside the chip as
VDD_4P2.

When system is supposed to not use VDD5V as a main power source - instead
the DCDC_BATT is used; it is safe to disable this regulator.

As the in-PMU DCDC switching regulator (from which DCDC_VDDA, DCDC_VDDIO
and DCDC_VDDD are generated) can be driven from DCDC_BATT or output
of this 4P2 regulator - by disabling the latter the use of the DCDC_BATT
is forced.

To be more specific - according to NXP's AN4199 the DCDC_BATT source is
preferred (over VDD5V), as more efficient and stable source for
industrial applications.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
16 months agoarm: mxs: Provide Kconfig option to disable battery charging at IMX28 PMU
Lukasz Majewski [Tue, 9 May 2023 14:32:40 +0000 (16:32 +0200)]
arm: mxs: Provide Kconfig option to disable battery charging at IMX28 PMU

This new Kconfig option allows disabling the in-PMU battery charging
block. This may be required when DCDC_BAT source is powered not from
battery, but from already regulated, good quality source.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
16 months agoarm: mxs: Provide Kconfig option to to not use VDD5V as IMX28 PMU source
Lukasz Majewski [Tue, 9 May 2023 14:32:39 +0000 (16:32 +0200)]
arm: mxs: Provide Kconfig option to to not use VDD5V as IMX28 PMU source

This option sets the current limit for 5V source to zero, so all
the PMU outputs are primarily powered from battery source (DCDC_BAT).

This option may be set on systems, where the 5V is NOT supposed to be
in any scenario powering the system - for example on systems where
DCDC_BAT is connected to fixed and regulated 4.2V source (so the
"battery" is not present).

Signed-off-by: Lukasz Majewski <lukma@denx.de>
16 months agopower: imx8m-power-domain: Add delay to align with kernel driver
Fabio Estevam [Sat, 6 May 2023 16:14:02 +0000 (13:14 -0300)]
power: imx8m-power-domain: Add delay to align with kernel driver

In the imx8m power domain kernel driver, there is an extra udelay(5)
prior to requesting the domain to power up:

https://github.com/torvalds/linux/blob/v6.3/drivers/soc/imx/gpcv2.c#L347-L375

Haven't observed any issues due to the lack of this delay in U-Boot yet,
but better to align it with the kernel driver implementation.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Marek Vasut <marex@denx.de>
16 months agoboard: gateworks: venice: update board doc to show other emmc parts
Tim Harvey [Wed, 3 May 2023 00:05:57 +0000 (17:05 -0700)]
board: gateworks: venice: update board doc to show other emmc parts

Update the venice board documentation to show how to install to the
various eMMC hardware partitions available as the same binary firmware
can be placed in either user/boot0/boot1 without build-time config
changes. Note that the boot offsets differ depending on the SoC and the
eMMC hardware partition.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
16 months agoboard: gateworks: venice: move env location
Tim Harvey [Wed, 3 May 2023 00:05:56 +0000 (17:05 -0700)]
board: gateworks: venice: move env location

To allow U-Boot to fit within emmc boot partitions move the env from
just under 16MiB to just under 4MiB as some emmc devices used on venice
boards have 4MiB boot partitions. This still leaves plenty of room for
U-Boot.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
16 months agoboard: gateworks: venice: dynamically update the update_firmware script
Tim Harvey [Wed, 3 May 2023 00:05:55 +0000 (17:05 -0700)]
board: gateworks: venice: dynamically update the update_firmware script

The update_firmware script is intended to update the boot firmware but
the details including the offset and hardware partition are dependent
on the boot device.

Specifically:
- IMX8MM/IMX8MP (BOOTROM v2) the offset is 32KiB for SD and eMMC user
  hardware partition and 0KiB for eMMC boot partitions.
- IMX8MM the offset is 33KiB for SD and eMMC regardless of hardware
  partition.

Dynamically set soc, dev, bootpart, and bootblk env vars at runtime
and use these in the update_firmware script. Remove the splblk env var
from config files as its no longer needed.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
16 months agoboard: gateworks: venice: dynamically determine U-Boot env partition
Tim Harvey [Wed, 3 May 2023 00:05:54 +0000 (17:05 -0700)]
board: gateworks: venice: dynamically determine U-Boot env partition

Determine the U-Boot env hardware partition depending on the boot
device.

This allows the same boot firmware image to be placed on user, boot0,
or boot1 without changing CONFIG_SYS_MMC_ENV_PART.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
16 months agoboard: gateworks: venice: dynamically determine U-Boot raw sector
Tim Harvey [Wed, 3 May 2023 00:05:53 +0000 (17:05 -0700)]
board: gateworks: venice: dynamically determine U-Boot raw sector

CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR needs to adjust for
IMX8MN and IMX8MP when booting from an eMMC boot partition due
to IMX BOOTROM v2 using an SPL offset of 0 for boot partitions
and 32K for the user partition.

In order to allow the same firmware to run on both user and boot
hardware partitions adjust raw_sect dynamically at runtime.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
16 months agoboard: gateworks: venice: add eraseenv command
Tim Harvey [Tue, 2 May 2023 17:45:54 +0000 (10:45 -0700)]
board: gateworks: venice: add eraseenv command

Add eraseenv command and remove the unnecessary env command.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
16 months agoboard: gateworks: venice: add GPIO name lookup
Tim Harvey [Tue, 2 May 2023 17:44:44 +0000 (10:44 -0700)]
board: gateworks: venice: add GPIO name lookup

Add GPIO name lookup so that you can act on GPIO's by name vs controller
id:

Before:
u-boot=> gpio input pci_wdis#
GPIO: 'pci_wdis#' not found
Command 'gpio' failed: Error -22

After:
u-boot=> gpio input pci_wdis#
gpio: pin pci_wdis# (gpio 103) value is 1

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
16 months agoconfigs: verdin-imx8mp: enable ARCH_MISC_INIT
Sergio Prado [Tue, 2 May 2023 08:57:50 +0000 (10:57 +0200)]
configs: verdin-imx8mp: enable ARCH_MISC_INIT

This is required to boot a FIT image, otherwise the caam_jr driver is
not initialized and the hash verification fails with the following
error:

Verifying Hash Integrity ... sha256dev_get_priv: null device
CAAM was not setup properly or it is faulty

Signed-off-by: Sergio Prado <sergio.prado@toradex.com>
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
16 months agoARM: imx9: support env in fat and ext4
Oleksandr Suvorov [Tue, 11 Apr 2023 17:27:41 +0000 (20:27 +0300)]
ARM: imx9: support env in fat and ext4

Change boot device logic to also allow environment stored in fat and
in ext4 when booting from SD or eMMC.

As the boot device check for SD and for eMMC was depending on
ENV_IS_IN_MMC being defined, change the ifdef blocks at
env_get_location to use IS_ENABLED instead for all modes, returning
NOWHERE when no valid mode is found.

This solution is based on (with added SPL support):
Link: https://lore.kernel.org/all/20211020191626.3648540-1-ricardo@foundries.io/
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
16 months agoarm: mx6: module_fuse: fix build failure due to wrong argument name
Giulio Benetti [Thu, 6 Apr 2023 16:17:13 +0000 (18:17 +0200)]
arm: mx6: module_fuse: fix build failure due to wrong argument name

nodeoff variable should be variable off returned by fdt_path_offset() so
let's rename it to off.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
16 months agocolibri-imx8x: print firmware versions
Andrejs Cainikovs [Mon, 3 Apr 2023 11:14:25 +0000 (13:14 +0200)]
colibri-imx8x: print firmware versions

Print firmware versions during U-Boot start:

 BuildInfo:
  - SCFW f5623878, SECO-FW c9de51c0, IMX-MKIMAGE 0, ATF c6a19b1
  - U-Boot 2022.04-00335-g65192567f81-dirty

Signed-off-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
16 months agoconfigs: imx: imx8mm_beacon: Add config option for QSPI booting
Adam Ford [Thu, 2 Feb 2023 01:58:41 +0000 (19:58 -0600)]
configs: imx: imx8mm_beacon: Add config option for QSPI booting

The imx8mm_beacon SOM has a QSPI part attached to the FSPI controller.
Update the header and spl files to support booting from NOR flash and
add imx8mm_beacon_fspi_defconfig to support this configuration.

Signed-off-by: Adam Ford <aford173@gmail.com>
16 months agoimx: imx8mm-beacon: Enable FlexSPI in U-Boot
Adam Ford [Thu, 2 Feb 2023 01:58:40 +0000 (19:58 -0600)]
imx: imx8mm-beacon: Enable FlexSPI in U-Boot

In order to use the FlexSPI interface in U-Boot, configure
the alias to make spi0 point to flexspi.

With that enabled, sf probe detects the QSPI part as:
SF: Detected n25q256ax1 with page size 256 Bytes, erase size 4 KiB, total 32 MiB

Signed-off-by: Adam Ford <aford173@gmail.com>
16 months agoMerge branch 'next'
Tom Rini [Mon, 10 Jul 2023 18:29:14 +0000 (14:29 -0400)]
Merge branch 'next'

16 months agoPrepare v2023.07 v2023.07
Tom Rini [Mon, 10 Jul 2023 18:13:47 +0000 (14:13 -0400)]
Prepare v2023.07

Signed-off-by: Tom Rini <trini@konsulko.com>
16 months agoMerge tag 'fsl-qoriq-2023-7-6' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Mon, 10 Jul 2023 01:54:40 +0000 (21:54 -0400)]
Merge tag 'fsl-qoriq-2023-7-6' of https://source.denx.de/u-boot/custodians/u-boot-fsl-qoriq into next

Enable DM Serial for ls1043ardb and ls1046ardb/afrwy
Fixed secure boot on LS-CH2 platforms

16 months agoMerge branch '2023-07-07-assorted-build-improvements' into next
Tom Rini [Sat, 8 Jul 2023 15:28:39 +0000 (11:28 -0400)]
Merge branch '2023-07-07-assorted-build-improvements' into next

- Correct a few dependencies in Kconfig and better handle some generated
  files so that they are properly cleaned later.

16 months agosysreset: Change Kconfig GPIO dependency
Michal Simek [Tue, 4 Jul 2023 12:05:13 +0000 (14:05 +0200)]
sysreset: Change Kconfig GPIO dependency

DM_GPIO depends on GPIO to be enabled but select will cause that DM_GPIO is
selected without GPIO which ends up in compilation error:
undefined reference to `dm_gpio_set_value'
undefined reference to `dm_gpio_get_value'
undefined reference to `dm_gpio_free'
undefined reference to `gpio_request_by_name'

Signed-off-by: Michal Simek <michal.simek@amd.com>
[trini: Fix configs which had relied on these select's]
Signed-off-by: Tom Rini <trini@konsulko.com>
16 months agotpl: Kconfig: TPL_BANNER_PRINT depends on DEBUG_UART && TPL_SERIAL
Ying Sun [Sun, 25 Jun 2023 09:18:21 +0000 (17:18 +0800)]
tpl: Kconfig: TPL_BANNER_PRINT depends on DEBUG_UART && TPL_SERIAL

As implemented in the arch/arm/mach-rockchip/tpl.c file,
the CONFIG_TPL_BANNER_PRINT option will not work
if either of these options is not enabled.

Add dependency constraints to the CONFIG_TPL_BANNER_PRINT option
definition to prevent configuration problems
where option is enabled but do not take effect.

Suggested-by: Yanjie Ren <renyanjie01@gmail.com>
Signed-off-by: Ying Sun <sunying@nj.iscas.ac.cn>
16 months agocommon: Kconfig: SYS_CONSOLE_ENV_OVERWRITE depends on SYS_CONSOLE_IS_IN_ENV
Ying Sun [Sun, 25 Jun 2023 08:52:07 +0000 (16:52 +0800)]
common: Kconfig: SYS_CONSOLE_ENV_OVERWRITE depends on SYS_CONSOLE_IS_IN_ENV

CONFIG_SYS_CONSOLE_ENV_OVERWRITE is implemented in common/console.c
when "#if CONFIG_IS_ENABLED(SYS_CONSOLE_IS_IN_ENV)" is met.

It is recommended to add dependency constraints to its definition.

Suggested-by: Yanjie Ren <renyanjie01@gmail.com>
Signed-off-by: Ying Sun <sunying@nj.iscas.ac.cn>
16 months agocmd: CONFIG_CMD_SAVES depends on CONFIG_CMD_LOADS
Ying Sun [Sun, 25 Jun 2023 08:24:47 +0000 (16:24 +0800)]
cmd: CONFIG_CMD_SAVES depends on CONFIG_CMD_LOADS

CONFIG_CMD_SAVES is used to enable support for the "saveenv" command
and is only implemented in cmd/load.c
when "#if defined(CONFIG_CMD_LOADS)" is met.

It is recommended to add dependency constraints to its definition.
Prevents "saveenv" command from not being supported
when "CONFIG_CMD_SAVES=y CONFIG_CMD_LOADS=n".

Suggested-by: Yanjie Ren <renyanjie01@gmail.com>
Signed-off-by: Ying Sun <sunying@nj.iscas.ac.cn>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agotest: Find leftovers after clean/mrproper
Tobias Deiminger [Mon, 19 Jun 2023 22:41:07 +0000 (00:41 +0200)]
test: Find leftovers after clean/mrproper

Docs describe 'make clean' to delete most generated files, 'make
mrproper' to delete current configuration and all generated files. This
test tries to assert it.

Idea is to search remaining files by patterns in copies of the initial
out-of-source build, which has two advantages:
- looking in an out-of-source build dir allows to tell generated source
  code from committed source code
- copying is fast (compared to rebuilding each time) which allows to do
  a "world clean"

Signed-off-by: Tobias Deiminger <tdmg@linutronix.de>
16 months agoKbuild: Fix cleanup of *.dtbo for sandbox
Tobias Deiminger [Mon, 19 Jun 2023 22:41:06 +0000 (00:41 +0200)]
Kbuild: Fix cleanup of *.dtbo for sandbox

sandbox can generate DT overlays, but they were not cleaned.

Extend the explicit clean-files list accordingly.

Fixes: 95300f203f32 ("pytest: add sandbox test for "extension" command")
Signed-off-by: Tobias Deiminger <tdmg@linutronix.de>
16 months agoKbuild: Fix cleanup of *.dtb for some archs
Tobias Deiminger [Mon, 19 Jun 2023 22:41:05 +0000 (00:41 +0200)]
Kbuild: Fix cleanup of *.dtb for some archs

'make clean' did not descend into arch/$ARCH/dts for arc, m68k, nios2,
sh, xtensa.

Fix it by adding the missing archs to the explicit clean-dirs list.

Signed-off-by: Tobias Deiminger <tdmg@linutronix.de>
16 months agoKbuild: Fix cleanup of VPL
Tobias Deiminger [Mon, 19 Jun 2023 22:41:04 +0000 (00:41 +0200)]
Kbuild: Fix cleanup of VPL

VPL artifacts like example vpl/u-boot-vpl are currently not removed by
'make clean'.

We can clean them just as it's already done for SPL and TPL.

Fixes: f86ca5ad8f78 ("Introduce Verifying Program Loader (VPL)")
Signed-off-by: Tobias Deiminger <tdmg@linutronix.de>
16 months agoAdjust gitignore for tools/generated/
Tobias Deiminger [Mon, 19 Jun 2023 22:41:03 +0000 (00:41 +0200)]
Adjust gitignore for tools/generated/

Tell git that auto-generated C sources are now exclusively expected
under tools/generated/.

Signed-off-by: Tobias Deiminger <tdmg@linutronix.de>
16 months agoKbuild: Fix cleanup of generated sources in tools
Tobias Deiminger [Mon, 19 Jun 2023 22:41:02 +0000 (00:41 +0200)]
Kbuild: Fix cleanup of generated sources in tools

On 'make clean', generated C files in tools/env/ and tools/boot/ are
currently not removed, but they should.

Auto-generation for shared sources was first introduced with
ad80c4a3220b ("kbuild, tools: generate wrapper C sources automatically
by Makefile"). Cleanup later regressed (see Fixes:), because shared
files were moved out of lib/ and common/, but 'clean-dirs := lib common'
was not adjusted accordingly. Further, the generated
tools/env/embedded.c became a sibling to project files, which prevents
directory-wise cleanup at all.

To solve it, we establishe tools/generated/ as the sole place for
generated sources. Wrappers are now generated as
tools/generated/<orig_dirname>/<orig_filename>, and 'make clean' can
remove tools/generated/ as a whole (Linux Makefile.asm-generic headers
are cleaned similarly). This way we don't have to maintain separate
clean-files or clean-dirs entries for each single added or moved wrapper
file.

Fixes: 0649cd0d4908 ("Move environment files from common/ to env/")
Fixes: 19a91f2464a8 ("Create a new boot/ directory")
Signed-off-by: Tobias Deiminger <tdmg@linutronix.de>
[trini: Correct mkfwupdate case]
Signed-off-by: Tom Rini <trini@konsulko.com>
16 months agoMAINTAINERS: correct at91 tree link
Eugen Hristev [Fri, 7 Jul 2023 13:45:32 +0000 (16:45 +0300)]
MAINTAINERS: correct at91 tree link

This was not done when the tree name was changed, fix it now.

Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
16 months agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-usb into...
Tom Rini [Thu, 6 Jul 2023 17:23:36 +0000 (13:23 -0400)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-usb into next

16 months agoMerge branch 'riscv-for-next' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Thu, 6 Jul 2023 17:21:37 +0000 (13:21 -0400)]
Merge branch 'riscv-for-next' of https://source.denx.de/u-boot/custodians/u-boot-riscv into next

- RISC-V CI OpenSBI version update
- Andes ae350 board modification
- Sync PolarFire SoC dts with Linux
- Support building ubifs

16 months agoboard: ae350: Add missing env variables for booti
Yu Chien Peter Lin [Tue, 4 Jul 2023 11:13:21 +0000 (19:13 +0800)]
board: ae350: Add missing env variables for booti

The 'booti' command is unable to boot Image.gz due to the absence
of required environment variables 'kernel_comp_addr_r' and
'kernel_comp_size'.

This commit adds these variables and reorganizes the memory layout
to prevent any overlap between binaries and files.

Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
16 months agoriscv: andes_plicsw: Fix IPI during OpenSBI invocation
Yu Chien Peter Lin [Tue, 4 Jul 2023 11:13:20 +0000 (19:13 +0800)]
riscv: andes_plicsw: Fix IPI during OpenSBI invocation

On some AE350 boards, we need to explicitly initialize the priority
registers to a non-zero value so the boot hart can instruct secondary
harts to jump to OpenSBI.

This patch also updates the information about PLICSW.

Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
16 months agoRISC-V: CONFIG_SPL_OPENSBI_SCRATCH_OPTIONS description
Heinrich Schuchardt [Tue, 4 Jul 2023 00:14:21 +0000 (02:14 +0200)]
RISC-V: CONFIG_SPL_OPENSBI_SCRATCH_OPTIONS description

Describe which numeric values can be used for as scratch options for
OpenSBI.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
16 months agoclk: starfive: pll: Fix to use postdiv1_mask
Hoegeun Kwon [Wed, 28 Jun 2023 10:19:49 +0000 (19:19 +0900)]
clk: starfive: pll: Fix to use postdiv1_mask

There is a problem that the rates of PLL0 and PLL1 are set incorrectly
because the postdiv1_mask value is incorrectly entered when setting
the pll clk reg. Modify postdiv1's mask value to be put correctly.

Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
Reviewed-by: Minkyu Kang <mk7.kang@samsung.com>
16 months agoci: riscv: Update OpenSBI to v1.2
Bin Meng [Tue, 20 Jun 2023 05:55:00 +0000 (13:55 +0800)]
ci: riscv: Update OpenSBI to v1.2

Use the latest OpenSBI v1.2 release binaries for the RISC-V CI.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
16 months agoboard: microchip: set mac address for ethernet1 on icicle
Conor Dooley [Thu, 15 Jun 2023 10:12:44 +0000 (11:12 +0100)]
board: microchip: set mac address for ethernet1 on icicle

The dts sync from Linux leaves mac0/ethernet1 enabled on icicle, but
U-Boot does not currently set a mac address for it. Expand on the code
which currently sets the mac for mac1/ethernet0 to optionally set the
mac address for the second ethernet.

Reviewed-by: Padmarao Begari <padmarao.begari@microchip.com>
Tested-by: Padmarao Begari <padmarao.begari@microchip.com>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
16 months agoriscv: dts: sync mpfs-icicle devicetree with linux
Conor Dooley [Thu, 15 Jun 2023 10:12:43 +0000 (11:12 +0100)]
riscv: dts: sync mpfs-icicle devicetree with linux

The "notable" disappearances are:
- the pac193x stanza - there's nothing in mainline linux w.r.t. bindings
  for this & what is going to appear in mainline linux is going to be
  incompatible with what is currently in U-Boot.
- operating points - these operating points should not be set at the
  soc.dtsi level as they may not be possible depending on the design
  programmed to the FPGA
- clock output names - there are defines for the clock indices, these
  should not be needed
- the dt maintainers in linux NAKed using defines for IRQ numbers
- the qspi nand, which is not part of the icicle's default configuration
  is removed.

Reviewed-by: Padmarao Begari <padmarao.begari@microchip.com>
Tested-by: Padmarao Begari <padmarao.begari@microchip.com>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Rick Chen <rick@andestech.com>
16 months agoriscv: dts: drop microchip from dts filenames
Conor Dooley [Thu, 15 Jun 2023 10:12:42 +0000 (11:12 +0100)]
riscv: dts: drop microchip from dts filenames

The original names picked for the DT doesn't match Linux's naming scheme
and it was renamed there a while ago. Rename it in U-Boot to allow
easily syncing dts between the two projects.

Reviewed-by: Rick Chen <rick@andestech.com>
Reviewed-by: Padmarao Begari <padmarao.begari@microchip.com>
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
16 months agoclk: sifive: only build sifive-prci.o for CONFIG_CLK_SIFIVE_PRCI
Ben Dooks [Tue, 9 May 2023 13:50:05 +0000 (14:50 +0100)]
clk: sifive: only build sifive-prci.o for CONFIG_CLK_SIFIVE_PRCI

If we're building non FU540/FU740 SoC drivers, then the sifive-prci.o
is not needed. Only build this when CONFIG_CLK_SIFIVE_PRCI is selected.

Signed-off-by: Ben Dooks <ben.dooks@sifive.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
16 months agoriscv: define test_and_{set,clear}_bit in asm/bitops.h
Ben Dooks [Fri, 5 May 2023 08:02:07 +0000 (09:02 +0100)]
riscv: define test_and_{set,clear}_bit in asm/bitops.h

These seem to be missing, and trying to build ubifs without them
is causing errors due to these being missing.

Signed-off-by: Ben Dooks <ben.dooks@sifive.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
16 months agoriscv: implement local_irq_{save,restore} macros
Ben Dooks [Fri, 5 May 2023 08:02:06 +0000 (09:02 +0100)]
riscv: implement local_irq_{save,restore} macros

Add implementations of the local_irq_{save,restore} macros so that
<asm/atomic.h> can be used with riscv.

Signed-off-by: Ben Dooks <ben.dooks@sifive.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
16 months agoriscv: add generic link for <asm/atomic.h>
Ben Dooks [Fri, 5 May 2023 08:02:05 +0000 (09:02 +0100)]
riscv: add generic link for <asm/atomic.h>

Add a link from <asm/atomic.h> to the generic one to allow
things like ubifs to be built. This can be extended with
riscv AMO ops at a later date.

Signed-off-by: Ben Dooks <ben.dooks@sifive.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
16 months agocmd/sbi: display new extensions
Heinrich Schuchardt [Wed, 12 Apr 2023 08:38:16 +0000 (10:38 +0200)]
cmd/sbi: display new extensions

OpenSBI already implements some extensions that are not ratified yet:

* Debug Console Extension (DBCN)
* System Suspend Extension (SUSP)
* Collaborative Processor Performance Control Extension (CPPC)

Allow the sbi command to display these.

Provide the FID definitions of the Debug Console Extension. We can use that
extension for an early debug console driver.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
16 months agoLFU-544: Kconfig.nxp: Fixed secure boot on LS-CH2 platforms
Kshitiz Varshney [Thu, 22 Jun 2023 09:24:45 +0000 (11:24 +0200)]
LFU-544: Kconfig.nxp: Fixed secure boot on LS-CH2 platforms

pimg64 image pointer is dependent on ESBC_ADDR_64BIT config, which is
getting disabled, due to dependency on ESBC_HDR_LS.
ESBC_HDR_LS is required for LS-CH3 platforms.
So, removing the dependency on ESBC_HDR_LS.

Signed-off-by: Kshitiz Varshney <kshitiz.varshney@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Gaurav Jain <gaurav.jain@nxp.com>
16 months agoconfigs: ls1046afrwy: enable DM_SERIAL
Camelia Groza [Fri, 16 Jun 2023 13:18:38 +0000 (16:18 +0300)]
configs: ls1046afrwy: enable DM_SERIAL

As the serial devices are configured in the device tree, enable
DM_SERIAL in the ls1046afrwy defconfigs.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
16 months agoconfigs: ls1046ardb: enable DM_SERIAL
Camelia Groza [Fri, 16 Jun 2023 13:18:37 +0000 (16:18 +0300)]
configs: ls1046ardb: enable DM_SERIAL

As the serial devices are configured in the device tree, enable
DM_SERIAL in the ls1046ardb defconfigs.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
16 months agoarch: arm: dts: ls1046a: tag serial nodes with bootph-all
Camelia Groza [Fri, 16 Jun 2023 13:18:36 +0000 (16:18 +0300)]
arch: arm: dts: ls1046a: tag serial nodes with bootph-all

Make sure the serial driver is initialized before relocation by tagging
the serial nodes with "bootph-all".

In order to keep the serial nodes in sync with their representation in
the Linux dts, add these u-boot specific properties to *-u-boot.dtsi
files.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
16 months agoarch: arm: dts: ls1046a: sync serial nodes with Linux
Camelia Groza [Fri, 16 Jun 2023 13:18:35 +0000 (16:18 +0300)]
arch: arm: dts: ls1046a: sync serial nodes with Linux

Pick up the serial node descriptions from Linux v6.3 for the ls1046ardb
and ls1046afrwy boards and their dependencies. Including the
fsl,qoriq-clockgen.h and arm-gic.h headers forces us to change the include
directives to explicitly go through the C preprocessor for all boards in
the ls1046a SoC family.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
16 months agoconfigs: ls1043ardb: enable DM_SERIAL
Camelia Groza [Fri, 16 Jun 2023 13:18:34 +0000 (16:18 +0300)]
configs: ls1043ardb: enable DM_SERIAL

As the serial devices are configured in the device tree, enable
DM_SERIAL in the ls1043ardb defconfigs.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
16 months agoarch: arm: dts: ls1043a: tag serial nodes with bootph-all
Camelia Groza [Fri, 16 Jun 2023 13:18:33 +0000 (16:18 +0300)]
arch: arm: dts: ls1043a: tag serial nodes with bootph-all

Make sure the serial driver is initialized before relocation by tagging
the serial nodes with "bootph-all".

In order to keep the serial nodes in sync with their representation in
the Linux dts, add these u-boot specific properties to *-u-boot.dtsi
files.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
16 months agoarch: arm: dts: ls1043a: sync serial nodes with Linux
Camelia Groza [Fri, 16 Jun 2023 13:18:32 +0000 (16:18 +0300)]
arch: arm: dts: ls1043a: sync serial nodes with Linux

Pick up the serial node descriptions from Linux v6.3 for the ls1043ardb
board and its dependencies. Including the fsl,qoriq-clockgen.h and
arm-gic.h headers forces us to change the include directives to explicitly
go through the C preprocessor for all boards in the ls1043a SoC family.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
16 months agotools: spkgimage: correct printf specifier
Heinrich Schuchardt [Tue, 4 Jul 2023 20:18:09 +0000 (22:18 +0200)]
tools: spkgimage: correct printf specifier

Compiling on armv7 results in:

tools/renesas_spkgimage.c: In function ‘spkgimage_parse_config_line’:
tools/renesas_spkgimage.c:76:66: warning: format ‘%ld’ expects
argument of type ‘long int’, but argument 3 has type ‘size_t’
{aka ‘unsigned int’} [-Wformat=]
   76 |         "config error: unknown keyword on line %ld\n",
      |                                                ~~^
      |                                                  |
      |                                                  long int
      |                                                %d
   77 |         line_num);
      |         ~~~~~~~~
      |         |
      |         size_t {aka unsigned int}

The correct printf specifier for size_t is '%zu'.

Fixes: afdfcb11f97c ("tools: spkgimage: add Renesas SPKG format")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
16 months agoMerge tag 'v2023.07-rc6' into next
Tom Rini [Wed, 5 Jul 2023 15:28:55 +0000 (11:28 -0400)]
Merge tag 'v2023.07-rc6' into next

Prepare v2023.07-rc6

16 months agocolibri-imx7: Call fdt_increase_size()
Fabio Estevam [Tue, 4 Jul 2023 17:09:45 +0000 (14:09 -0300)]
colibri-imx7: Call fdt_increase_size()

For changing the USB OTG node status from "okay" to "disabled" more
space is needed, so call fdt_increase_size() to avoid the following
error:

```
 U-Boot 2023.07-rc5-0.0.0-devel+git.580eb31199be (Jun 27 2023 - 13:39:58 +0000)
 CPU:   Freescale i.MX7S rev1.2 800 MHz (running at 792 MHz)
 CPU:   Extended Commercial temperature grade (-20C to 105C) at 30C
 Reset cause: POR
 DRAM:  initcall sequence 8786eafc failed at call 8781b351 (err=-3)
 ### ERROR ### Please RESET the board ###
```

Ideally, fdt_status_disabled() should call fdt_increase_size() internally,
so that there would be no need for manually calling it in board code.

Do it manually for now to fix the regression.

Based on the code from board/CZ.NIC/turris_omnia/turris_omnia.c.

Reported-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Tested-by: Francesco Dolcini <francesco.dolcini@toradex.com> # Toradex Colibri iMX7S
16 months agogit-mailrc: add alias for Eugen Hristev
Eugen Hristev [Tue, 4 Jul 2023 11:25:36 +0000 (14:25 +0300)]
git-mailrc: add alias for Eugen Hristev

add my patchwork alias

Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
16 months agoMerge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-pmic into...
Tom Rini [Tue, 4 Jul 2023 15:22:57 +0000 (11:22 -0400)]
Merge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-pmic into next

16 months agoregulator: handle different error codes in regulator_set_enable_if_allowed
Eugen Hristev [Wed, 19 Apr 2023 13:45:26 +0000 (16:45 +0300)]
regulator: handle different error codes in regulator_set_enable_if_allowed

The regulator core can return different codes which are not considered
a real error for this function.
Return success in such cases.

Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
16 months agoregulator: rename dev_pdata to plat
Eugen Hristev [Wed, 19 Apr 2023 13:45:25 +0000 (16:45 +0300)]
regulator: rename dev_pdata to plat

Simplify the subsystem by renaming `dev_pdata` to just `plat`.
No functional change, just trivial renaming.

Suggested-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
16 months agoregulator: implement basic reference counter
Eugen Hristev [Wed, 19 Apr 2023 13:45:24 +0000 (16:45 +0300)]
regulator: implement basic reference counter

Some devices share a regulator supply, when the first one will request
regulator disable, the second device will have it's supply cut off before
graciously shutting down. Hence there will be timeouts and other failed
operations.
Implement a reference counter mechanism similar with what is done in
Linux, to keep track of enable and disable requests, and only disable the
regulator when the last of the consumers has requested shutdown.

Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
16 months agoPrepare v2023.07-rc6
Tom Rini [Mon, 3 Jul 2023 17:48:58 +0000 (13:48 -0400)]
Prepare v2023.07-rc6

Signed-off-by: Tom Rini <trini@konsulko.com>
16 months agospl: spl_legacy: Fix spl_end address
Fabio Estevam [Sat, 1 Jul 2023 02:30:53 +0000 (23:30 -0300)]
spl: spl_legacy: Fix spl_end address

Currently, spl_end points to the __bss_end address, which
is an external RAM address instead of the end of the SPL text
section in the internal RAM.

This causes boot failures on imx6-colibri, for example:

```
Trying to boot from MMC1
SPL: Image overlaps SPL
resetting ...
```
Fix this problem by assigning spl_end to _image_binary_end, as this
symbol properly represents the end of the SPL text section.

From u-boot-spl.map:

.end
 *(.__end)
                0x00000000009121a4                _image_binary_end = .

Fixes: 77aed22b48ab ("spl: spl_legacy: Add extra address checks")
Reported-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
Tested-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Tested-by: Marek Vasut <marex@denx.de> # DH i.MX6Q DHCOM PDK2
16 months agomicroblaze: u-boot-spl.lds: Pass _image_binary_end
Fabio Estevam [Sat, 1 Jul 2023 02:30:52 +0000 (23:30 -0300)]
microblaze: u-boot-spl.lds: Pass _image_binary_end

Pass _image_binary_end to make a standard way to indicate the end
of the text section in SPL.

The motivation for this is to have a uniform way to handle
the SPL boundary checks.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Marek Vasut <marex@denx.de>
16 months agosunxi: u-boot-spl.lds: Pass _image_binary_end
Fabio Estevam [Sat, 1 Jul 2023 02:30:51 +0000 (23:30 -0300)]
sunxi: u-boot-spl.lds: Pass _image_binary_end

Pass _image_binary_end to make a standard way to indicate the end
of the text section in SPL.

The motivation for this is to have a uniform way to handle
the SPL boundary checks.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Marek Vasut <marex@denx.de>
16 months agodoc: imx: habv4: Fix typo in 'signing'
Fabio Estevam [Thu, 29 Jun 2023 19:25:31 +0000 (16:25 -0300)]
doc: imx: habv4: Fix typo in 'signing'

Fix two occurrences where 'signing' is misspelled.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Tim Harvey <tharvey@gateworks.com>
16 months agorockchip: Restore support for boot scripts in legacy image format
Jonas Karlman [Mon, 26 Jun 2023 19:43:06 +0000 (19:43 +0000)]
rockchip: Restore support for boot scripts in legacy image format

Use of CONFIG_SPL_FIT_SIGNATURE=y cause CONFIG_LEGACY_IMAGE_FORMAT=n as
default, this prevent boot scripts in legacy image format from working
and was an unintended change in the listed fixes commits:

  Wrong image format for "source" command

Add CONFIG_LEGACY_IMAGE_FORMAT=y to defconfig for affected boards to
restore support for boot scripts in legacy image format.

Fixes: 3bf8e4080763 ("board: rockchip: add Radxa ROCK5B Rk3588 board")
Fixes: cf777572ca31 ("rockchip: rockpro64: Use SDMA to boost eMMC performance")
Fixes: 6e2b8344d60c ("rockchip: rock-pi-4: Use SDMA to boost eMMC performance")
Fixes: 1bf49d5a4a7c ("rockchip: rk3566-radxa-cm3-io: Update defconfig")
Fixes: 703c170b40f2 ("rockchip: rk3568-evb: Update defconfig")
Fixes: 68000f750acd ("rockchip: rk3568-rock-3a: Update defconfig")
Fixes: 6fb02589a608 ("rockchip: rk3588-evb: Update defconfig")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
16 months agousb: dwc3-generic: Ensure reset GPIO is configured as an output
Peter Korsgaard [Wed, 28 Jun 2023 12:26:48 +0000 (14:26 +0200)]
usb: dwc3-generic: Ensure reset GPIO is configured as an output

GPIOD_ACTIVE_LOW is not enough to configure a GPIO as an output, we need
GPIOD_IS_OUT as well.

Fixes: b252d79b0936d60b ("usb: dwc3: Add support to reset usb ULPI phy")
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
16 months agoMerge tag 'efi-2023-07-rc6' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sat, 1 Jul 2023 20:11:51 +0000 (16:11 -0400)]
Merge tag 'efi-2023-07-rc6' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request efi-2023-07-rc6

Documentation:

* man-pages for the loads and saves commands

UEFI:

* fix implementation of allow_unaligned() for armv7 and arm11

16 months agoARM: arm11: Add C wrapper for allow_unaligned()
Marek Vasut [Sat, 1 Jul 2023 15:26:19 +0000 (17:26 +0200)]
ARM: arm11: Add C wrapper for allow_unaligned()

Rename current assembler implementation of allow_unaligned() to
arm11_arch_cp15_allow_unaligned() and add it into arm11.h header,
then add C wrapper of allow_unaligned().

This fixes misbehavior when linking U-Boot, where the CPU specific
allow_unaligned() implementation was ignored and instead the
__weak allow_unaligned() implementation from lib/efi_loader/efi_setup.c
was used, which led to "data abort" just before booting Linux via tftp,
in efi_dp_from_file() -> path_to_uefi() -> utf16_put() .

The problem is triggerd by c7c0ca37673 ("efi_loader: fix efi_dp_from_file()") .
Adding the wrapper fixes the problem.

Fixes: d47a774680d ("arm: arm11: allow unaligned memory access")
Signed-off-by: Marek Vasut <marex@denx.de>
16 months agoARM: armv7: Add C wrapper for allow_unaligned()
Marek Vasut [Sat, 1 Jul 2023 15:26:18 +0000 (17:26 +0200)]
ARM: armv7: Add C wrapper for allow_unaligned()

Rename current assembler implementation of allow_unaligned() to
v7_arch_cp15_allow_unaligned() and add it into armv7.h header,
then add C wrapper of allow_unaligned().

This fixes misbehavior when linking U-Boot on ARMv7a i.MX6Q, where the
CPU specific allow_unaligned() implementation was ignored and instead the
__weak allow_unaligned() implementation from lib/efi_loader/efi_setup.c
was used, which led to "data abort" just before booting Linux via tftp,
in efi_dp_from_file() -> path_to_uefi() -> utf16_put() .

The problem is triggerd by c7c0ca37673 ("efi_loader: fix efi_dp_from_file()") .
Adding the wrapper fixes the problem.

Fixes: 78f90aaeecc ("arm: armv7: allow unaligned memory access")
Signed-off-by: Marek Vasut <marex@denx.de>
16 months agodoc: fix typo loady in loadb man-page
Heinrich Schuchardt [Sun, 25 Jun 2023 21:22:44 +0000 (23:22 +0200)]
doc: fix typo loady in loadb man-page

%s/loady/loadb/

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agodoc: saves man-page
Heinrich Schuchardt [Sun, 25 Jun 2023 13:14:03 +0000 (15:14 +0200)]
doc: saves man-page

Provide a man-page for the saves command.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agodoc: loads man-page
Heinrich Schuchardt [Sun, 25 Jun 2023 11:40:23 +0000 (13:40 +0200)]
doc: loads man-page

Provide a man-page for the loads command.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
16 months agosmegw01: Fix wrong symbol override
Eduard Strehlau [Tue, 27 Jun 2023 16:57:49 +0000 (13:57 -0300)]
smegw01: Fix wrong symbol override

board_mmc_get_env_part() is not called as the default implementation
of mmc_get_env_part() is used.

Fix this problem by directly calling mmc_get_env_part() instead.

Signed-off-by: Eduard Strehlau <eduard@lionizers.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
16 months agoCI: Azure: Split keymile jobs out
Tom Rini [Mon, 26 Jun 2023 19:19:54 +0000 (15:19 -0400)]
CI: Azure: Split keymile jobs out

Currently the PowerPC build job in Azure will hit the maximum time limit
for a build and stop. Looking at the job, the easiest path to reducing
it is to move Keymile vendor boards to their own job and exclude them
from the PowerPC one (and while at this, the ls102 job).

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
16 months agoboard: freescale: imx93_evk: Fix MMC environment offset boot conflict.
Ken Sloat [Tue, 11 Apr 2023 20:05:31 +0000 (16:05 -0400)]
board: freescale: imx93_evk: Fix MMC environment offset boot conflict.

Currently, the imx93_evk is configured with CONFIG_ENV_IS_IN_MMC and the
chosen environment offset in the config is 0x400000. Unless the user
programs the associated fuses, this offset is the default secondary boot
image offset used by the i.MX 93 ROM bootloader. With certain
combinations of environmental variables, the CRC and beginning of the
environment can potentially falsely appear as a valid boot image
container header. If the expected "sw_version" offset within this
mistaken boot image container is greater than the primary's, the ROM
bootloader can skip booting of the primary image altogether and attempt
to boot with the content of the environment data. This will then hang
the system.

To fix this, move the environment from 0x400000 to 0x700000 reserving up
to 3 MB at 0x400000 for any actual secondary user image container.

Signed-off-by: Ken Sloat <ken.s@variscite.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
16 months agoMerge tag 'u-boot-rockchip-20230629' of https://source.denx.de/u-boot/custodians...
Tom Rini [Thu, 29 Jun 2023 13:52:48 +0000 (09:52 -0400)]
Merge tag 'u-boot-rockchip-20230629' of https://source.denx.de/u-boot/custodians/u-boot-rockchip

- rockchip inno phy fix;
- pinctrl driver in SPL arort in specific case;
- fix IO port voltage for rock5b-rk3588 board;

16 months agoboard: rockchip: rock5b-rk3588: fix description
Eugen Hristev [Fri, 23 Jun 2023 10:05:27 +0000 (13:05 +0300)]
board: rockchip: rock5b-rk3588: fix description

Update description with correct specifications

Fixes: 3bf8e4080763 ("board: rockchip: add Radxa ROCK5B Rk3588 board")
Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
16 months agopinctrl: rockchip: Fix Data Abort exception in SPL
Jonas Karlman [Thu, 8 Jun 2023 10:59:38 +0000 (10:59 +0000)]
pinctrl: rockchip: Fix Data Abort exception in SPL

Using CONFIG_ARMV8_SPL_EXCEPTION_VECTORS=y and CONFIG_OF_LIVE=y triggers
a Data Abort exception from unaligned memory access when the pinctrl
driver iterate node properties, e.g. for UART2 on RK3568.

  setting mux of GPIO0-24 to 1
  setting mux of GPIO0-24 to 1
  "Synchronous Abort" handler, esr 0x96000021
  elr: 000000000000e554 lr : 000000000000e54c
  x 0: 0000000000000a5c x 1: 0000000000000a5c
  x 2: 0000000000000007 x 3: 0000000000000065
  x 4: 0000000000000007 x 5: 0000000000022d4e
  x 6: 0000000000000a7c x 7: 00000000000227a4
  x 8: 0000000000021cf0 x 9: 0000000000000a7c
  x10: 0000000000021cf0 x11: 0000000000021cf0
  x12: 00000000003fda1c x13: 0000000000000007
  x14: 00000000003fd9ec x15: 000000000001c0ff
  x16: 0000000007000000 x17: 00000000fdccd028
  x18: 00000000003fde20 x19: 0000000000000018
  x20: 0000000000020670 x21: 0000000000000000
  x22: 00000000003fdb00 x23: 00000000003fef90
  x24: 0000000000020688 x25: 0000000000000000
  x26: 0000000000000001 x27: 00000000003ffc50
  x28: 0000000000000000 x29: 00000000003fda60

  Code: b94083e1 97ffd508 93407c01 37f81260 (f9401038)
  Resetting CPU ...

Fix this by replacing the loop to access node properties with use of
ofnode_for_each_prop instead of the current ifdef.

Also continue to next prop instead of aborting at first sign of an
unknown property.

This fixes the Data Abort exception and also pinconf of e.g. pull and
drive in SPL, e.g. for UART2 on RK3568.

  setting mux of GPIO0-24 to 1
  setting mux of GPIO0-24 to 1
  setting pull of GPIO0-24 to 5
  setting mux of GPIO0-25 to 1
  setting mux of GPIO0-25 to 1
  setting pull of GPIO0-25 to 5

Fixes: e7ae4cf27a6d ("pinctrl: rockchip: Add common rockchip pinctrl driver")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
16 months agopinephone-pro: Fix I/O port voltage (GPIO3D4A is 1.8V)
Ondrej Jirman [Thu, 25 May 2023 13:27:08 +0000 (15:27 +0200)]
pinephone-pro: Fix I/O port voltage (GPIO3D4A is 1.8V)

This fixes access to camera sensor over I2C during probe time in
the kernel. (Kernel will fix I/0 port voltage by itself, but the
timing depends on probe order of the drivers, so the fix can
come after the camera sensor driver already failed to probe.)

Signed-off-by: Ondrej Jirman <megi@xff.cz>
Cc: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
16 months agophy: rockchip: inno-usb2: fix phy reg=0 case
Eugen Hristev [Mon, 22 May 2023 08:39:58 +0000 (11:39 +0300)]
phy: rockchip: inno-usb2: fix phy reg=0 case

The support for #address-cells=2 has a loophole: if the reg is actually 0,
but the #address-cells is actually 1, like in such case below:

syscon {
#address-cells = <1>;

phy {
reg = <0 0x10>;
};
};

then the second u32 of the 'reg' is the size, not the address.

The code should check for the parent's #address-cells value, and not
assume that if the first u32 is 0, then the #address-cells is 2, and the
reg property is something like
reg = <0 0xff00 0x10>;

Fixed this by looking for the #address-cells value and retrieving the
reg address only if this is ==2.
To avoid breaking anything I also kept the check `if reg==0` as some DT's
may have a wrong #address-cells as parent and even if this commit is
correct, it might break the existing wrong device-trees.

Fixes: d538efb9adcf ("phy: rockchip: inno-usb2: Add support #address_cells = 2")
Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
16 months agoMerge tag 'u-boot-amlogic-next-20230628' of https://source.denx.de/u-boot/custodians...
Tom Rini [Wed, 28 Jun 2023 14:10:03 +0000 (10:10 -0400)]
Merge tag 'u-boot-amlogic-next-20230628' of https://source.denx.de/u-boot/custodians/u-boot-amlogic into next

- add support for Amlogic A1 SoC and ad401 board
- add support for Videostrong KII Pro
- introduce secure power domain for A1 SoC

16 months agodrivers: meson: introduce secure power controller driver
Alexey Romanov [Wed, 31 May 2023 09:31:56 +0000 (12:31 +0300)]
drivers: meson: introduce secure power controller driver

This patch adds Power controller driver support for Amlogic
A1 family using secure monitor calls. The power domains register
only can access in secure world.

Signed-off-by: Alexey Romanov <avromanov@sberdevices.ru>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20230531093156.29240-4-avromanov@sberdevices.ru
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
16 months agodt-bindings: power: add Meson A1 PWRC bindings
Alexey Romanov [Wed, 31 May 2023 09:31:55 +0000 (12:31 +0300)]
dt-bindings: power: add Meson A1 PWRC bindings

We can use them in secure pwrc driver.

Signed-off-by: Alexey Romanov <avromanov@sberdevices.ru>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20230531093156.29240-3-avromanov@sberdevices.ru
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
16 months agoarch/arm: meson: sm: introduce power domain functions
Alexey Romanov [Wed, 31 May 2023 09:31:54 +0000 (12:31 +0300)]
arch/arm: meson: sm: introduce power domain functions

This commit adds functions to manage secure power domain for
Amlogic SoC's using smc functionality.

Signed-off-by: Alexey Romanov <avromanov@sberdevices.ru>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20230531093156.29240-2-avromanov@sberdevices.ru
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
16 months agodoc: boards: amlogic: add documentation for KII Pro
Ferass El Hafidi [Sun, 7 May 2023 12:42:29 +0000 (12:42 +0000)]
doc: boards: amlogic: add documentation for KII Pro

Add build instructions for the KII Pro set-top box.

Signed-off-by: Ferass El Hafidi <vitali64pmemail@protonmail.com>
Link: https://lore.kernel.org/r/20230507124109.31778-4-vitali64pmemail@protonmail.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
16 months agoboards: amlogic: add KII Pro defconfig
Ferass El Hafidi [Sun, 7 May 2023 12:42:24 +0000 (12:42 +0000)]
boards: amlogic: add KII Pro defconfig

Add configurations for the Videostrong KII Pro set-top box.
This defconfig is cloned from the WeTek Play2's.

Signed-off-by: Ferass El Hafidi <vitali64pmemail@protonmail.com>
Link: https://lore.kernel.org/r/20230507124109.31778-3-vitali64pmemail@protonmail.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
16 months agoarm: dts: add support for Videostrong KII Pro
Ferass El Hafidi [Sun, 7 May 2023 12:42:19 +0000 (12:42 +0000)]
arm: dts: add support for Videostrong KII Pro

Import the device tree from mainline linux (v6.4-rc1) and add the
old PHY reset bindings in the PHY node, else U-Boot and linux won't
be able to use the PHY.

Signed-off-by: Ferass El Hafidi <vitali64pmemail@protonmail.com>
Link: https://lore.kernel.org/r/20230507124109.31778-2-vitali64pmemail@protonmail.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
16 months agoboard: amlogic: add support for AD401 board
Igor Prusov [Fri, 5 May 2023 12:56:39 +0000 (15:56 +0300)]
board: amlogic: add support for AD401 board

The AD401 board is the Amlogic A1 SoC reference board

Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20230505125639.3605-6-ivprusov@sberdevices.ru
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
16 months agopinctrl: meson: add pinctrl driver for Amlogic A1
Igor Prusov [Fri, 5 May 2023 12:56:38 +0000 (15:56 +0300)]
pinctrl: meson: add pinctrl driver for Amlogic A1

Based on Linux kernel commit:
dabad1ff85611 (pinctrl: meson: add pinctrl driver support for Meson-A1 SoC)

Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20230505125639.3605-5-ivprusov@sberdevices.ru
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
16 months agoARM: meson: add A1 support
Igor Prusov [Fri, 5 May 2023 12:56:37 +0000 (15:56 +0300)]
ARM: meson: add A1 support

Add support for Amlogic A1 SoC family.

Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru>
Signed-off-by: Evgeny Bachinin <eabachinin@sberdevices.ru>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20230505125639.3605-4-ivprusov@sberdevices.ru
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
16 months agoARM: dts: sync meson-a1-ad401 from Linux 6.3-rc7
Igor Prusov [Fri, 5 May 2023 12:56:36 +0000 (15:56 +0300)]
ARM: dts: sync meson-a1-ad401 from Linux 6.3-rc7

Add meson-a1-ad401.dts file from Linux 6.3-rc7

Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20230505125639.3605-3-ivprusov@sberdevices.ru
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
16 months agoARM: dts: Add Amlogic Meson A1 DT from Linux 6.3-rc7
Igor Prusov [Fri, 5 May 2023 12:56:35 +0000 (15:56 +0300)]
ARM: dts: Add Amlogic Meson A1 DT from Linux 6.3-rc7

Import Linux 6.3-rc7 Device tree and necessary bindings for Amlogic A1
board from 6a8f57ae2eb0 ("Linux 6.3-rc7").

Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20230505125639.3605-2-ivprusov@sberdevices.ru
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
16 months agoMerge branch 'riscv-fixes' of https://source.denx.de/u-boot/custodians/u-boot-riscv
Tom Rini [Tue, 27 Jun 2023 13:39:58 +0000 (09:39 -0400)]
Merge branch 'riscv-fixes' of https://source.denx.de/u-boot/custodians/u-boot-riscv

16 months agoriscv: Fix alignment of RELA sections in the linker scripts
Bin Meng [Tue, 27 Jun 2023 01:24:56 +0000 (09:24 +0800)]
riscv: Fix alignment of RELA sections in the linker scripts

In current linker script both .efi_runtime_rel and .rela.dyn sections
are of RELA type whose entry size is either 12 (RV32) or 24 (RV64).
These two are arranged as a continuous region on purpose so that the
prelink-riscv executable can fix up the PIE addresses in one loop.

However there is an 'ALIGN(8)' between these 2 sections which might
cause a gap to be inserted between these 2 sections to satisfy the
alignment requirement on RV32. This would break the assumption of
the prelink process and generate an unbootable image.

Fixes: 9a6569a043d3 ("riscv: Update alignment for some sections in linker scripts")
Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Rick Chen <rick@andestech.com>
16 months agoMAINTAINERS: update SiFive HiFive Unmatched maintainers
Heinrich Schuchardt [Mon, 1 May 2023 12:57:08 +0000 (14:57 +0200)]
MAINTAINERS: update SiFive HiFive Unmatched maintainers

Email account pragnesh.patel@sifive.com does not exist anymore.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>