]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
11 months agocmd: increase default for SYS_MAXARGS
Heinrich Schuchardt [Mon, 15 Jan 2024 13:46:56 +0000 (14:46 +0100)]
cmd: increase default for SYS_MAXARGS

The value of CONFIG SYS_MAXARGS limits the usability of the 'for' command.
The current default of 16 is too low for some use case. Cf.
https://bugs.launchpad.net/snap-core18/+bug/1910094

Increase the default to 64.

Reported-by: Dave Jones <dave.jones@canonical.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
11 months agoboard: ti: common: board_detect: Fix EEPROM offset read for 1-byte
Prasanth Babu Mantena [Mon, 30 Oct 2023 17:04:58 +0000 (22:34 +0530)]
board: ti: common: board_detect: Fix EEPROM offset read for 1-byte

EEPROM detection logic in ti_i2c_eeprom_get() involves reading
the total size and the 1-byte size with an offset 1. The commit
9f393a2d7af8 ("board: ti: common: board_detect: Fix EEPROM read
quirk for 2-byte") that attempts to fix this uses a wrong pointer to
compare.

The value with one offset is read into offset_test, but the pointer
used to match was still ep, resulting in an invalid comparison of the
values. The intent is to identify bad 2-byte addressing eeproms that
get stuck on the successive reads.

Fixes: 9f393a2d7af8 (board: ti: common: board_detect: Fix EEPROM read quirk for 2-byte)
Signed-off-by: Prasanth Babu Mantena <p-mantena@ti.com>
Tested-by: Matwey V. Kornilov <matwey.kornilov@gmail.com>
Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
11 months agoMerge patch series "omap3: Make SPL_OMAP3_ID_NAND depend on NAND_OMAP_GPMC"
Tom Rini [Mon, 22 Jan 2024 18:30:23 +0000 (13:30 -0500)]
Merge patch series "omap3: Make SPL_OMAP3_ID_NAND depend on NAND_OMAP_GPMC"

This series results in making it such that with CONFIG_MTD disabled we
then do not prompt the user for a number of memory technology device
related options and so clean up our configuration menu / display.

11 months agomtd: Make CONFIG_MTD be the gate symbol for the menu
Tom Rini [Wed, 10 Jan 2024 18:46:10 +0000 (13:46 -0500)]
mtd: Make CONFIG_MTD be the gate symbol for the menu

The help for CONFIG_MTD explains that it needs to be enabled for various
things like NAND, etc to be available. It however then doesn't enforce
this dependency and so if you have none of these systems present you
still need to disable a number of options. Fix this by making places
that select/imply one type of flash, but did not do the same, also do
this for "MTD". Make boards which hadn't been enabling MTD already but
need it now, do so. In a few places, disable CONFIG_CMD_MTDPARTS as it
wasn't previously enabled but was now being implied.

Signed-off-by: Tom Rini <trini@konsulko.com>
11 months agocmd/flash: Make this default y for CFI and NOR only
Tom Rini [Wed, 10 Jan 2024 18:46:09 +0000 (13:46 -0500)]
cmd/flash: Make this default y for CFI and NOR only

This command is only useful on CFI and NOR type flashes and not others.
Update the dependency so that it's not enabled by default in other
cases. This will lead to a number of platforms no longer building this
command, where it was not useful.

Signed-off-by: Tom Rini <trini@konsulko.com>
11 months agoenv: Make ENV_IS_IN_SPI_FLASH depend on SPI flash being present
Tom Rini [Wed, 10 Jan 2024 18:46:08 +0000 (13:46 -0500)]
env: Make ENV_IS_IN_SPI_FLASH depend on SPI flash being present

In order for our environment to be present on SPI flash we need to
depend not on the symbol for a SPI controller but rather that SPI flash
of some sort is present. Update the dependencies.

Signed-off-by: Tom Rini <trini@konsulko.com>
11 months agocmd/mtdparts: Make this select MTD_PARTITIONS
Tom Rini [Wed, 10 Jan 2024 18:46:07 +0000 (13:46 -0500)]
cmd/mtdparts: Make this select MTD_PARTITIONS

Rather than rely on someone selecting or implying this hidden symbol
that the command requires, select it explicitly.

Signed-off-by: Tom Rini <trini@konsulko.com>
11 months agoomap3: Make SPL_OMAP3_ID_NAND depend on NAND_OMAP_GPMC
Tom Rini [Wed, 10 Jan 2024 18:46:06 +0000 (13:46 -0500)]
omap3: Make SPL_OMAP3_ID_NAND depend on NAND_OMAP_GPMC

This specific bit logic is used to determine what NAND chip is present
on a board in order to then know what revision of the board we have and
so what DDR chips are present. We can only do this if we have a NAND
chip, and so we will have NAND_OMAP_GPMC enabled.

Signed-off-by: Tom Rini <trini@konsulko.com>
11 months agocommon: usb-hub: Reset hub port before scanning
Shantur Rathore [Sat, 9 Dec 2023 18:10:56 +0000 (18:10 +0000)]
common: usb-hub: Reset hub port before scanning

Currently when a hub is turned on, all the ports are powered on.
This works well for hubs which have individual power control.

For the hubs without individual power control this has no effect.
Mostly in these scenarios the hub port is powered before the USB
controller is enabled, this can lead to some devices in unexpected
state.

With this patch, we explicitly reset the port while powering up hub
This resets the port for hubs without port power control and has
no effect on hubs with port power control as the port is still off.

Before this patch AMicro AM8180 based NVME to USB adapter won't be
detected as a USB3.0 Mass Storage device but with this it works as
expected.

Tested working after this patch:
1. AMicro AM8180 based NVME to USB Adapter
2. Kingston DataTraveler 3.0
3. GenesysLogic USB3.0 Hub

The drives were tested while connected directly and via the hub.

Signed-off-by: Shantur Rathore <i@shantur.com>
Reviewed-by: Marek Vasut <marex@denx.de>
11 months agoMerge https://gitlab.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Mon, 22 Jan 2024 15:59:20 +0000 (10:59 -0500)]
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-marvell

- solidrun: clearfog gtr: add serdes configuration (Josua)

11 months agoMerge tag 'u-boot-imx-master-20240122' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Mon, 22 Jan 2024 14:47:52 +0000 (09:47 -0500)]
Merge tag 'u-boot-imx-master-20240122' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

- Allow i.MX8M Plus DHCOM to operate in overdrive mode.
- Allow i.MX8M Plus eDM SBC to operate in overdrive mode.
- Enable the 'kaslrseed' command on DH i.MX8M Plus DHCOM.
- Select LTO by default on i.MX8M.
- Convert pico-dwarf/hobbit-imx6ul to CONFIG_DM_SERIAL.
- Fix 'reset' command on wandboard.

11 months agoMerge commit '3c9bb8fbdc77f6bd56e97597d875d8965db3b96c' of https://github.com/tienfon...
Tom Rini [Mon, 22 Jan 2024 14:35:38 +0000 (09:35 -0500)]
Merge commit '3c9bb8fbdc77f6bd56e97597d875d8965db3b96c' of https://github.com/tienfong/uboot_mainline

A few small SoCFPGA updates

11 months agoboard: solidrun: clearfog: fix serdes 1 / eth2 speed for clearfog gtr
Josua Mayer [Fri, 12 Jan 2024 13:35:11 +0000 (14:35 +0100)]
board: solidrun: clearfog: fix serdes 1 / eth2 speed for clearfog gtr

Clearfog GTR connects eth2 / serdes 1 to a 2.5Gbps capable ethernet
switch port. Linux already configures a fixed-link at speed 2500 from
device-tree.

Upgrade serdes 1 rate to 3.125Gbps to support a 2.5Gbps link.

Additionally add comments documenting each serdes' function of clearfog
gtr, which are shared with clearfog pro.

Signed-off-by: Josua Mayer <josua@solid-run.com>
11 months agoarm: mvebu: clearfog gtr: add config option to select serdes0 interface
Josua Mayer [Fri, 12 Jan 2024 13:35:10 +0000 (14:35 +0100)]
arm: mvebu: clearfog gtr: add config option to select serdes0 interface

Clearfog GTR has an assembly option for a SATA connector, CON18.
It shares the serdes with mini-pcie connector CON3.

Add new kconfig option to select betweenata and pci, defaulting to pci
as it was previously configured in board-file.

Clearfog GTR connects eth2 / serdes 1 to a 2.5Gbps capable ethernet
switch port. Linux already configures a fixed-link at speed 2500 from
device-tree.
Upgrade serdes 1 rate to 3.125Gbps to support a 2.5Gbps network link on
Clearfog GTR.

Signed-off-by: Josua Mayer <josua@solid-run.com>
11 months agoARM: imx: Enable kaslrseed command on DH i.MX8M Plus DHCOM
Marek Vasut [Sat, 20 Jan 2024 00:35:58 +0000 (01:35 +0100)]
ARM: imx: Enable kaslrseed command on DH i.MX8M Plus DHCOM

Linux 6.6.y with KASLR enabled would print the following message on boot:
"
KASLR disabled due to lack of seed
"
Enable the 'kaslrseed' command so a random number seed can be pulled
from CAAM and inserted into the /chosen node 'kaslr-seed' property of
Linux kernel DT before boot, thus letting KASLR work properly.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
11 months agopico-dwarf/hobbit-imx6ul: Convert to CONFIG_DM_SERIAL
Fabio Estevam [Fri, 19 Jan 2024 19:41:34 +0000 (16:41 -0300)]
pico-dwarf/hobbit-imx6ul: Convert to CONFIG_DM_SERIAL

The conversion to CONFIG_DM_SERIAL is mandatory, so select
this option.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
11 months agowandboard: Convert to watchdog driver model
Fabio Estevam [Fri, 19 Jan 2024 17:25:33 +0000 (14:25 -0300)]
wandboard: Convert to watchdog driver model

Commit 68dcbdd594d4 ("ARM: imx: Add weak default reset_cpu()") caused
the 'reset' command in U-Boot to not cause a board reset.

Fix it by switching to the watchdog driver model via sysreset, which
is the preferred method for implementing the watchdog reset.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
11 months agoARM: imx: Configure GIC clock parent on Data Modul i.MX8M Plus eDM SBC
Marek Vasut [Fri, 19 Jan 2024 16:08:32 +0000 (17:08 +0100)]
ARM: imx: Configure GIC clock parent on Data Modul i.MX8M Plus eDM SBC

The CONFIG_SPL_BOARD_INIT lets SPL common code call spl_board_init()
during the SPL start up. On this particular system, spl_board_init()
is used to reconfigure GIC clock parent to PLL2 500M, which is the
configuration expected by the Linux kernel. Enable SPL_BOARD_INIT
and fill in the GIC clock configuration code.

Set GIC clock to 500 MHz for OD VDD_SOC. Kernel driver does not
allow to change it. Should set the clock after PMIC setting done.
Default is 400 MHz (system_pll1_800m with div = 2) set by ROM for
ND VDD_SOC.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
11 months agoARM: imx: Enable SPL_BOARD_INIT on DH i.MX8M Plus DHCOM
Marek Vasut [Fri, 19 Jan 2024 16:07:54 +0000 (17:07 +0100)]
ARM: imx: Enable SPL_BOARD_INIT on DH i.MX8M Plus DHCOM

The CONFIG_SPL_BOARD_INIT lets SPL common code call spl_board_init()
during the SPL start up. On this particular system, spl_board_init()
is used to reconfigure GIC clock parent to PLL2 500M, which is the
configuration expected by the Linux kernel. Enable SPL_BOARD_INIT .

Set GIC clock to 500 MHz for OD VDD_SOC. Kernel driver does not
allow to change it. Should set the clock after PMIC setting done.
Default is 400 MHz (system_pll1_800m with div = 2) set by ROM for
ND VDD_SOC.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
11 months agoimx8m: Enable LTO by default
Fabio Estevam [Thu, 18 Jan 2024 15:06:39 +0000 (12:06 -0300)]
imx8m: Enable LTO by default

In an attempt to select ARMV8_SPL_EXCEPTION_VECTORS, the SPL size
could not fit into the internal SRAM of some imx8m targets:

   aarch64:  +   imx8mm_phg
+aarch64-linux-ld.bfd: u-boot-spl section `__u_boot_list' will not fit in region `.sram'
+aarch64-linux-ld.bfd: region `.sram' overflowed by 1824 bytes

Select LTO to prevent that.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Marek Vasut <marex@denx.de>
11 months agoarm: dts: agilex: Increase reserved memory size to 32MB
Dinesh Maniyam [Fri, 15 Dec 2023 07:21:51 +0000 (15:21 +0800)]
arm: dts: agilex: Increase reserved memory size to 32MB

The reserved space is extended to 32MB in Linux kernel because
additional space is needed for authorization execution of JIC/RBF file.
U-Boot required to align with Linux.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@intel.com>
11 months agoclk: altera: n5x: Fix MEMCLKMGR_EXTCNTRST_C0CNTRST to bit(0)
Dinesh Maniyam [Fri, 15 Dec 2023 07:15:19 +0000 (15:15 +0800)]
clk: altera: n5x: Fix MEMCLKMGR_EXTCNTRST_C0CNTRST to bit(0)

MEMCLKMGR_EXTCNTRST_C0CNTRST register defined as BIT[0] in documentation
but it is wrongly defined as BIT[7] in u-boot code. This register is used
to hold associated pingpong counter in reset
while PLL and 5:1 mux configuration is changed.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@intel.com>
11 months agoarm: socfpga: stratix10: SPI clock support
Dinesh Maniyam [Thu, 7 Dec 2023 07:46:02 +0000 (15:46 +0800)]
arm: socfpga: stratix10: SPI clock support

This patch is to add SPI clock support for stratix10. Get clock rate
function always returning 0 because the DW-SPI driver get the rate
from clock node in dts but Stratix10 does not support device tree
clock node.To overcome this spi will get the clock_rate directly
from spi clock controller override the weaker function.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@intel.com>
11 months agoMerge tag 'efi-2024-04-rc1-3' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sun, 21 Jan 2024 14:11:33 +0000 (09:11 -0500)]
Merge tag 'efi-2024-04-rc1-3' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request efi-2024-04-rc1-3

Documentation:

* correct documentation of part_get_bootable()
* remove duplicate word "has" in UEFI documentation

UEFI:

* rename check_disk_has_default_file function
* auto-generate boot option for each blkio device
* auto-generate removable media boot option first
* avoid pointer access after calling efi_delete_handle
* create common function to free struct efi_disk_obj
* return immediately in UCLASS_EFI_LOADER removal

11 months agoefi_loader: return immediately in UCLASS_EFI_LOADER removal
Masahisa Kojima [Fri, 19 Jan 2024 00:45:46 +0000 (09:45 +0900)]
efi_loader: return immediately in UCLASS_EFI_LOADER removal

In case of UCLASS_EFI_LOADER, EFI handles are managed by
EFI application/driver, we must not delete EFI handles.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
11 months agoefi_loader: create common function to free struct efi_disk_obj
Masahisa Kojima [Fri, 19 Jan 2024 00:45:45 +0000 (09:45 +0900)]
efi_loader: create common function to free struct efi_disk_obj

Current error handling of creating raw disk/partition has
following issues.
 - duplicate free for EFI handle, EFI handle is already freed
   in efi_delete_handle()
 - missing free for struct efi_device_path and
   struct efi_simple_file_system_protocol in some error paths

To address those issues, this commit creates the common function
to free the struct efi_disk_obj resources and calls it in case
of error.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
11 months agoefi_loader: avoid pointer access after calling efi_delete_handle
Masahisa Kojima [Fri, 19 Jan 2024 00:45:44 +0000 (09:45 +0900)]
efi_loader: avoid pointer access after calling efi_delete_handle

efi_delete_handle() calls efi_purge_handle(), then it finally
frees the EFI handle.
Both diskobj and handle variables in efi_disk_remove() have
the same pointer, we can not access diskobj->dp after calling
efi_delete_handle().

This commit saves the struct efi_device_path pointer before
calling efi_delete_handle(). This commit also fixes the
missing free for volume member in struct efi_disk_obj.

This commit also removes the container_of() calls, and
adds the TODO comment of missing efi_close_protocol() call
for the parent EFI_BLOCK_IO_PROTOCOL.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
11 months agoefi_loader: auto-generate removable media boot option first
Masahisa Kojima [Fri, 12 Jan 2024 00:19:23 +0000 (09:19 +0900)]
efi_loader: auto-generate removable media boot option first

This commit auto-generates the boot option for removable
block io devices followed by fixed block io devices.
This is what EDK II reference implementation does.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
11 months agoefi_loader: auto-generate boot option for each blkio device
Masahisa Kojima [Fri, 12 Jan 2024 00:19:22 +0000 (09:19 +0900)]
efi_loader: auto-generate boot option for each blkio device

Current efibootmgr auto-generates the boot option for all
disks and partitions installing EFI_SIMPLE_FILE_SYSTEM_PROTOCOL,
while EDK II reference implementation auto-generates the boot option
for all devices installing  EFI_BLOCK_IO_PROTOCOL with
eliminating logical partitions.

This commit modifies the efibootmgr to get aligned to EDK II.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
11 months agoefi_loader: rename check_disk_has_default_file function
Masahisa Kojima [Fri, 12 Jan 2024 00:19:21 +0000 (09:19 +0900)]
efi_loader: rename check_disk_has_default_file function

check_disk_has_default_file() function checks if the
architecture-specific default file exists on the block
device, and fills the default file device path if it exists.

Rename the function name to fill_default_file_path().

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
11 months agopart: correct documentation of part_get_bootable()
Heinrich Schuchardt [Tue, 16 Jan 2024 14:00:20 +0000 (15:00 +0100)]
part: correct documentation of part_get_bootable()

We have to use 'Return:' to render the description of the return value in
the HTML documentation.

Fixes: f55aa4454ac3 ("part: Add a fallback for part_get_bootable()")
Fixes: dcffa4428d03 ("part: Add a function to find the first bootable partition")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
11 months agodoc: uefi: remove duplicate word "has"
Wei Ming Chen [Fri, 19 Jan 2024 01:34:14 +0000 (09:34 +0800)]
doc: uefi: remove duplicate word "has"

There should be only one "has" instead of "has has"

Signed-off-by: Wei Ming Chen <jj251510319013@gmail.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
11 months agoMerge patch series "k3-j721e: beagleboneai: Fix USB"
Tom Rini [Sat, 20 Jan 2024 16:39:13 +0000 (11:39 -0500)]
Merge patch series "k3-j721e: beagleboneai: Fix USB"

Roger Quadros <rogerq@kernel.org> says:

Hi,

This series fixes USB operation on k3-j721e based boards.

11 months agoconfigs/j721e_beagleboneai64_a72_defconfig: Enable Sierra PHY
Roger Quadros [Fri, 12 Jan 2024 12:49:51 +0000 (14:49 +0200)]
configs/j721e_beagleboneai64_a72_defconfig: Enable Sierra PHY

This is required for USB Super-Speed operation.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
11 months agoarm: dts: k3-j721e-beagleboneai64: Fix USB operation
Roger Quadros [Fri, 12 Jan 2024 12:49:50 +0000 (14:49 +0200)]
arm: dts: k3-j721e-beagleboneai64: Fix USB operation

Without correct SERDES MUX and Lane control settings
USB0 will be broken. Set the MUX and Lane control devices
to be auto probed so they are configured correctly.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
11 months agoarm: dts: k3-j721e: Fix USB0 operation
Roger Quadros [Fri, 12 Jan 2024 12:49:49 +0000 (14:49 +0200)]
arm: dts: k3-j721e: Fix USB0 operation

Without correct SERDES MUX and Lane control settings
USB0 will be broken. Set the MUX and Lane control devices
to be auto probed so they are configured correctly.

Fixes: 69b19ca67bcb ("arm: dts: k3-j721e: Sync with v6.6-rc1")
Signed-off-by: Roger Quadros <rogerq@kernel.org>
11 months agousb: cdns3: avoid error messages if phys don't exist
Roger Quadros [Fri, 12 Jan 2024 12:49:48 +0000 (14:49 +0200)]
usb: cdns3: avoid error messages if phys don't exist

The phys property is optional so don't complain
if it doesn't exist in device tree.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
11 months agoboard: ti: j721e: Drop SERDES PHY init from board file
Roger Quadros [Fri, 12 Jan 2024 12:49:47 +0000 (14:49 +0200)]
board: ti: j721e: Drop SERDES PHY init from board file

Since commit 69b19ca67bcb ("arm: dts: k3-j721e: Sync with v6.6-rc1"),
the following error message is seen at u-boot
"Sierra init failed:-19"

Probing and initializing the SERDES PHY from
board file is not a clean solution so drop it.

Proper use case should be via PHY_UCLASS APIs.

Signed-off-by: Roger Quadros <rogerq@kernel.org>
11 months agoKconfig: boot: Imply BOOTSTD_DEFAULT when BOOTSTD_FULL=y
Shantur Rathore [Sat, 23 Dec 2023 06:51:59 +0000 (06:51 +0000)]
Kconfig: boot: Imply BOOTSTD_DEFAULT when BOOTSTD_FULL=y

We need BOOTSTD_DEFAULT when BOOTSTD_FULL is selected.

Signed-off-by: Shantur Rathore <i@shantur.com>
11 months agoMerge tag 'u-boot-stm32-20240119' of https://source.denx.de/u-boot/custodians/u-boot-stm
Tom Rini [Fri, 19 Jan 2024 16:59:28 +0000 (11:59 -0500)]
Merge tag 'u-boot-stm32-20240119' of https://source.denx.de/u-boot/custodians/u-boot-stm

Add CMDLINE dependecy for CMD_STM32KEY

STM32MP1:
---------
Set stdio to serial on DH STM32MP15xx DHSOM
Fix reset for usart1 in scmi configuration

STM32MP2:
---------
Add BSEC and OTP support for STM32MP25
Fix CONFIG_STM32MP25X flag usage

11 months agostm32mp2: Fix CONFIG_STM32MP25X flag usage
Patrice Chotard [Tue, 9 Jan 2024 14:00:17 +0000 (15:00 +0100)]
stm32mp2: Fix CONFIG_STM32MP25X flag usage

"#if" was used instead of "#ifdef"

Fixes: 01a701994b05 ("stm32mp2: initial support")
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
11 months agostm32mp: Add dependencies on CMDLINE for command stm32key
Patrick Delaunay [Mon, 15 Jan 2024 13:30:54 +0000 (14:30 +0100)]
stm32mp: Add dependencies on CMDLINE for command stm32key

We cannot use stm32key commands without CONFIG_CMDLINE so add the
required condition.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
11 months agoARM: stm32: Set stdio to serial on DH STM32MP15xx DHSOM
Marek Vasut [Sat, 13 Jan 2024 17:57:27 +0000 (18:57 +0100)]
ARM: stm32: Set stdio to serial on DH STM32MP15xx DHSOM

In case CONSOLE_MUX and SYS_CONSOLE_IS_IN_ENV are enabled, the console
stdin, stdout, stderr must be defined in environment. Define the default
settings to fix the following warning on boot:

"
In:    No input devices available!
Out:   No output devices available!
Err:   No error devices available!
"

Sort the default environment as well.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
11 months agoMerge branch '2024-01-18-assorted-fixes'
Tom Rini [Fri, 19 Jan 2024 13:46:47 +0000 (08:46 -0500)]
Merge branch '2024-01-18-assorted-fixes'

- A number of OS boot related cleanups, a number of TI platform
  fixes/cleanups, SMBIOS fixes, tweak get_maintainers.pl to report me
  for more places, fix the "clean the build" pytest and add a bootstage
  pytest, fix PKCS11 URI being omitted in some valid cases, make an iommu
  problem easier to debug on new platforms, nvme and pci improvements,
  refactor image-host code a bit, fix a typo in env setting, add a missing
  dependency for CMD_LICENSE, and correct how we call getchar() in some
  places.

11 months agoarm: Rename STM32MP15x
Patrick Delaunay [Mon, 15 Jan 2024 14:05:57 +0000 (15:05 +0100)]
arm: Rename STM32MP15x

CONFIG options must not use lower-case letter. Convert this and related
ones to upper case.

Signed-off-by: Simon Glass <sjg@chromium.org
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
11 months agoarm: Rename STM32MP13x
Patrick Delaunay [Mon, 15 Jan 2024 14:05:56 +0000 (15:05 +0100)]
arm: Rename STM32MP13x

CONFIG options must not use lower-case letter. Convert this and related
ones to upper case.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Igor Opaniuk <igor.opaniuk@foundries.io>
11 months agoboard: st: stm32mp2: display the board identification
Patrick Delaunay [Mon, 15 Jan 2024 14:05:55 +0000 (15:05 +0100)]
board: st: stm32mp2: display the board identification

Add the display of the STMicroelectronics board identification saved in OTP
in stm32mp2 checkboard function.

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
11 months agoboard: st: stm32mp2: add checkboard
Patrick Delaunay [Mon, 15 Jan 2024 14:05:54 +0000 (15:05 +0100)]
board: st: stm32mp2: add checkboard

Implement the weak function checkboard to identify the used board with
compatible in device tree for the support of stm32mp2 STMicroelectronics
boards.

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
11 months agostm32mp: activate the command stboard for stm32mp25 boards
Patrick Delaunay [Mon, 15 Jan 2024 14:05:53 +0000 (15:05 +0100)]
stm32mp: activate the command stboard for stm32mp25 boards

Activate the command stboard for stm32mp25 STMicroelectronics boards,
add the default used OTP identifier and the associated board identifier:
- stm32mp25xx-ev1 = MB1936
- stm32mp25xx-dk = MB1605

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
11 months agostm32mp: stm32prog: add support of stm32mp25
Patrick Delaunay [Mon, 15 Jan 2024 14:05:52 +0000 (15:05 +0100)]
stm32mp: stm32prog: add support of stm32mp25

Change OTP number to 364 for STM32MP25 as it is done in bsec driver.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
11 months agosmt32mp: add setup_mac_address for stm32mp25
Patrick Delaunay [Mon, 15 Jan 2024 14:05:51 +0000 (15:05 +0100)]
smt32mp: add setup_mac_address for stm32mp25

Add a function setup_mac_address() to update the MAC address from the
default location in OTP for stm32mp2 platform.

The max number of OTP for MAC address is increased to 8 for STM32MP25,
defined with get_eth_nb() and checked in setup_mac_address.

The MAC address FF:FF:FF:FF:FF:FF, the broadcast ethaddr, is a invalid
value used for unused MAC address slot in OTP, for example for board
with STM32MP25x part number allows up to 5 ethernet ports but it is not
supported by the hardware, without switch; the associated variable
"enetaddr%d" is not created.

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
11 months agostm32mp: add setup_serial_number for stm32mp25
Patrice Chotard [Mon, 15 Jan 2024 14:05:50 +0000 (15:05 +0100)]
stm32mp: add setup_serial_number for stm32mp25

Add support of serial number for stm32mp25, gets from OTP with BSEC driver.

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Igor Opaniuk <igor.opaniuk@foundries.io>
11 months agostm32mp: add soc.c file
Patrick Delaunay [Mon, 15 Jan 2024 14:05:49 +0000 (15:05 +0100)]
stm32mp: add soc.c file

Add a new file soc.c for common functions between stm32mp1 and stm32mp2
family and move print_cpuinfo() in this new file.

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Igor Opaniuk <igor.opaniuk@foundries.io>
11 months agoconfigs: stm32mp25: add support of fuse command
Patrick Delaunay [Mon, 15 Jan 2024 14:05:48 +0000 (15:05 +0100)]
configs: stm32mp25: add support of fuse command

Add support of the command fuse with CONFIG_CMD_FUSE to allow access
on OTP with command line.

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
11 months agostm32mp: bsec: add support of stm32mp25
Patrick Delaunay [Mon, 15 Jan 2024 14:05:47 +0000 (15:05 +0100)]
stm32mp: bsec: add support of stm32mp25

Add support of BSEC for STM32MP25x family to access OTP.

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
11 months agostm32mp: bsec: add driver data
Patrick Delaunay [Mon, 15 Jan 2024 14:05:46 +0000 (15:05 +0100)]
stm32mp: bsec: add driver data

Add driver data in  BSEC driver to test presence of OP-TEE TA,
mandatory for STM32MP13 family and prepare the support of new device
with more OTP than 95.

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
11 months agoarm: stm32mp: add Rev.B support for STM32MP25
Yann Gautier [Mon, 15 Jan 2024 14:05:45 +0000 (15:05 +0100)]
arm: stm32mp: add Rev.B support for STM32MP25

Add chip revision B support for STM32MP25, for displaying it in trace.

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Yann Gautier <yann.gautier@foss.st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
11 months agoarm64: dts: st: add bsec support to stm32mp25
Patrick Delaunay [Mon, 15 Jan 2024 14:05:44 +0000 (15:05 +0100)]
arm64: dts: st: add bsec support to stm32mp25

Add BSEC support to STM32MP25 SoC family with SoC information:
- RPN = Device part number (BSEC_OTP_DATA9)
- PKG = package data register (Bits 2:0 of BSEC_OTP_DATA122)

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Signed-off-by: Alexandre Torgue <alexandre.torgue@foss.st.com>
11 months agoARM: dts: stm32: Fix reset for usart1 in scmi configuration
Patrice Chotard [Thu, 4 Jan 2024 12:37:50 +0000 (13:37 +0100)]
ARM: dts: stm32: Fix reset for usart1 in scmi configuration

In SCMI configuration, usart1 is secure, so all its resources are secured
(clock and reset) and can't be set/unset by non-secure world but by OP-TEE.

Fixes: 6cccc8d396bf ("ARM: dts: stm32: add SCMI version of STM32 boards (DK1/DK2/ED1/EV1)")
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
11 months agoMerge tag 'u-boot-rockchip-20240119' of https://source.denx.de/u-boot/custodians...
Tom Rini [Fri, 19 Jan 2024 13:02:58 +0000 (08:02 -0500)]
Merge tag 'u-boot-rockchip-20240119' of https://source.denx.de/u-boot/custodians/u-boot-rockchip

- Add board: rk3328 FriendlyARM NanoPi R2C Plus, rk3588 Turing RK1 SoM;
- Enable SPI boot for rk3588 and rk3528;
- Set boot device in SPL as common code;
- other misc fixes;

11 months agorockchip: rk3128: remove noop file
Quentin Schulz [Thu, 18 Jan 2024 13:56:00 +0000 (14:56 +0100)]
rockchip: rk3128: remove noop file

arch_cpu_init is already returning 0 in its weak definition in
common/board_f.c so let's just remove the file entirely since nothing
else is done in it.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
11 months agorockchip: remove unused global data ptr
Quentin Schulz [Thu, 18 Jan 2024 13:55:59 +0000 (14:55 +0100)]
rockchip: remove unused global data ptr

Remove leftover import and global data ptr from files since they aren't
used anymore.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
11 months agorockchip: find U-boot proper boot device by inverting the logic that sets it
Quentin Schulz [Thu, 18 Jan 2024 13:55:58 +0000 (14:55 +0100)]
rockchip: find U-boot proper boot device by inverting the logic that sets it

BOOT_DEVICE_* is set by spl_node_to_boot_device() depending on the block
device number associated with the MMC device the SPL used to load U-Boot
proper from. It is NOT related to the mmc alias in the Device Tree.

For SPI flashes, all SPI flashes will return BOOT_DEVICE_SPI so there's
currently no way to know from which one the SPL loaded U-Boot proper
from. Therefore, let's just find the first valid candidate in
/chosen/u-boot,spl-boot-order that is a SPI flash and return that path.
This is a best effort.

While the original implementation may have worked, using the exact same
mechanism but in inverted fashion makes it less likely to have
surprising corner-cases or side-effects.

A nice side-effect is that all existing and future Rockchip SoCs now
automatically have their /chosen/u-boot,spl-boot-device set.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
11 months agorockchip: factor out spl_perform_fixups into common spl-boot-order
Quentin Schulz [Thu, 18 Jan 2024 13:55:57 +0000 (14:55 +0100)]
rockchip: factor out spl_perform_fixups into common spl-boot-order

All SoCs are susceptible to wanting to know which storage medium was
used to load U-Boot SPL. So instead of reimplementing the same functions
in SoCs over and over again (here just rk3399 and px30 but rk3588 is
coming), let's just put all this in common into spl-boot-order.c
allowing to support a new SoC just by defining the spl_boot_devices
array in the appropriate SoC file.

Note that spl_perform_fixups() now calls spl_image_fdt_addr() to get the
address of the fdt instead of directly reading the
spl_image_info->fdt_addr member, because that member is not guaranteed
to be present (guarded with compile flags). This is essential because we
move the logic away from px30 and rk3399 which had those compile flags
enabled to code run for all Rockchip SoCs.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
11 months agorockchip: px30: simplify logic for getting SPL boot medium DT node
Quentin Schulz [Thu, 18 Jan 2024 13:55:56 +0000 (14:55 +0100)]
rockchip: px30: simplify logic for getting SPL boot medium DT node

In preparation of moving spl_perform_fixups to spl-boot-order.c, let's
simplify the logic around mapping the BOOT_DEVICE_x enum index to a DT
node by using an instantiated array of chars instead of creating a new
data structure on the fly.
This will make it easier to factor out the code handling the SPL boot
medium detection by having spl_decode_boot_device common to all SoCs.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
11 months agorockchip: rk3399: simplify logic for getting SPL boot medium DT node
Quentin Schulz [Thu, 18 Jan 2024 13:55:55 +0000 (14:55 +0100)]
rockchip: rk3399: simplify logic for getting SPL boot medium DT node

In preparation of moving spl_perform_fixups to spl-boot-order.c, let's
simplify the logic around mapping the BOOT_DEVICE_x enum index to a DT
node by using an instantiated array of chars instead of creating a new
data structure on the fly.

This will make it easier to factor out the code handling the SPL boot
medium detection by having spl_decode_boot_device common to all SoCs.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
11 months agodoc: board: anbernic: Update rgxx3 to add new boards
Chris Morgan [Tue, 2 Jan 2024 15:46:54 +0000 (09:46 -0600)]
doc: board: anbernic: Update rgxx3 to add new boards

Update the RGxx3 documentation to note that it now supports the
RG-ARC-D, RG-ARC-S, Powkiddy RK2023, and Powkiddy RGB30. Also update
verbiage around panel detection to note that it is no longer hard coded
to the RG503.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
11 months agoboard: rockchip: Add support for new boards to RGxx3
Chris Morgan [Tue, 2 Jan 2024 15:46:53 +0000 (09:46 -0600)]
board: rockchip: Add support for new boards to RGxx3

Add support for the Anbernic RG-ARC-D, Anbernic RG-ARC-S, Powkiddy
RK2023, and Powkiddy RGB30 to the Anbernic RGxx3. While the Powkiddy
devices are manufactured by Powkiddy instead of Anbernic,
the hardware is so similar they can all use the same bootloader.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
11 months agorockchip: board: Add board_rng_seed() for all Rockchip devices
Chris Morgan [Tue, 2 Jan 2024 15:46:52 +0000 (09:46 -0600)]
rockchip: board: Add board_rng_seed() for all Rockchip devices

Allow all rockchip devices to use the hardware RNG to seed Linux
RNG.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
11 months agoboard: rockchip: Refactor panel auto-detect code
Chris Morgan [Tue, 2 Jan 2024 15:46:48 +0000 (09:46 -0600)]
board: rockchip: Refactor panel auto-detect code

Make the inability to detect a panel using the auto detection code not
fail the entire boot process. This means that if the panel ID cannot
be read we don't set an environment variable for the panel, and if an
environment variable for the panel is not set we don't attempt to
update the compatible string. Changes to the code also ensure that
when there are multiple compatible strings required for the panel
we use them both, which solves some issues that will pop up soon
for the Linux driver.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
11 months agorockchip: rk3328: Set efuse auto mode and timing control
Jonas Karlman [Sun, 7 Jan 2024 18:18:33 +0000 (18:18 +0000)]
rockchip: rk3328: Set efuse auto mode and timing control

Reading from efuse return zero when mainline TF-A is used.

  => dump_efuse
  00000000: 00 00 00 00  ....
  00000004: 00 00 00 00  ....
  00000008: 00 00 00 00  ....
  0000000c: 00 00 00 00  ....
  00000010: 00 00 00 00  ....
  00000014: 00 00 00 00  ....
  00000018: 00 00 00 00  ....
  0000001c: 00 00 00 00  ....

However, when vendor TF-A blobs is used reading from efuse works.

Change to use auto mode, enable finish and auto access err interrupts
and set timing control using same values that vendor TF-A blob use to
fix this.

With this efuse can be read when either of mainline TF-A or vendor blob
is used.

  => dump_efuse
  00000000: 52 4b 33 82  RK3.
  00000004: 00 fe 21 55  ..!U
  00000008: 52 4b 57 34  RKW4
  0000000c: 35 30 32 39  5029
  00000010: 00 00 00 00  ....
  00000014: 08 25 0c 0f  .%..
  00000018: 02 0d 08 00  ....
  0000001c: 00 00 f0 00  ....

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
11 months agorockchip: theobroma-systems: fix modified boot_targets detection
Quentin Schulz [Wed, 17 Jan 2024 17:59:13 +0000 (18:59 +0100)]
rockchip: theobroma-systems: fix modified boot_targets detection

U-Boot proper automatically modifies boot_targets to swap the order in
which MMC storage media are used for standard boot based on which MMC
storage medium was used to load U-Boot proper. This is however only done
if the user has not changed it manually, therefore a check between the
default and current value is done.

This used to work fine until the migration to standard boot where
boot_targets value size in the default environment went above the 32
characters that env_get_default function can return, thus resulting in a
truncated variable.

Therefore the check between default and current value would always fail.

By using the newly added env_get_default_into function, a buffer of
the appropriate size can be allocated on the stack to get the whole
value of boot_targets in the default environment and thus fixing the
check.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
11 months agoenv: migrate env_get_default to call env_get_default_into
Quentin Schulz [Wed, 17 Jan 2024 17:59:12 +0000 (18:59 +0100)]
env: migrate env_get_default to call env_get_default_into

Since both functions share a similar goal and env_get_default_into can
do what env_get_default wants to do with specific arguments, let's make
env_get_default call env_get_default_into so as to avoid code
duplication.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
11 months agoenv: allow to copy value from default environment into a buffer
Quentin Schulz [Wed, 17 Jan 2024 17:59:11 +0000 (18:59 +0100)]
env: allow to copy value from default environment into a buffer

env_get_default suffers from a particular issue int that it can only
return a value truncated to gd->env_buf (32) characters. This may be
enough for most variables but it isn't for others, so let's allow users
to provide a preallocated buffer to copy the value into instead,
allowing for more control, though it'll still be truncated if the value
size is bigger than the preallocated buffer.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
11 months agorockchip: ringneck-px30/puma-rk3399: factor out storage medium selection
Quentin Schulz [Wed, 17 Jan 2024 17:59:10 +0000 (18:59 +0100)]
rockchip: ringneck-px30/puma-rk3399: factor out storage medium selection

Ringneck PX30 and Puma RK3399 both have the same expectation with regard
to bootstd device order and U-Boot environment storage device, except
that Puma RK3399 also supports SPI Flash.

Let's move all of this into a common file where common logic can be put.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
11 months agorockchip: puma-rk3399: do not hardcode MMC controller paths
Quentin Schulz [Wed, 17 Jan 2024 17:59:09 +0000 (18:59 +0100)]
rockchip: puma-rk3399: do not hardcode MMC controller paths

To prepare to put the similar logic around storage medium selection for
Ringneck PX30 and Puma RK3399 in common, let's not use hardcoded paths
but use uclass functions instead to find udevice based on their DT node
full path.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
11 months agorockchip: ringneck-px30: do not hardcode MMC controller paths
Quentin Schulz [Wed, 17 Jan 2024 17:59:08 +0000 (18:59 +0100)]
rockchip: ringneck-px30: do not hardcode MMC controller paths

To prepare to put the similar logic around storage medium selection for
Ringneck PX30 and Puma RK3399 in common, let's not use hardcoded paths
but use uclass functions instead to find udevice based on their DT node
full path.

Cc: Quentin Schulz <foss+uboot@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
11 months agoboard: rockchip: Add the Turing RK1 SoM
Joshua Riek [Wed, 10 Jan 2024 01:30:24 +0000 (20:30 -0500)]
board: rockchip: Add the Turing RK1 SoM

The Turing RK1 is a Rockchip RK3588 based SoM from Turing Machines.

Specifications:

    Rockchip RK3588 SoC
    4x ARM Cortex-A76, 4x ARM Cortex-A55
    8/16/32GB memory LPDDR4x
    Mali G610MC4 GPU
    32GB eMMC HS400
    2x USB 2.0, 2x USB 3.0
    2x MIPI CSI 4x lanes
    1x MIPI-DSI DPHY 2x lanes
    PCIe 2.0 x1, PCIe 3.0 x4
    1x HDMI 2.1 output, 1x DP 1.4 output
    Gigabit Ethernet
    Size: 69.6mm x 45mm (260-pin SO-DIMM connector)

Kernel commit:
2806a69f3fef ("arm64: dts: rockchip: Add Turing RK1 SoM support")

Signed-off-by: Joshua Riek <jjriek@verizon.net>
Tested-by: Sam Edwards <CFSworks@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
11 months agorockchip: rk3588s-orangepi-5: Build SPI image
Jonas Karlman [Fri, 17 Nov 2023 23:24:37 +0000 (23:24 +0000)]
rockchip: rk3588s-orangepi-5: Build SPI image

Enable building of the SPI image, u-boot-rockchip-spi.bin, now that we
know what bootsource id values BootRom use for SPI flash on RK3588.

Fixes: 28c5f941edf7 ("board: rockchip: Add Xunlong Orange Pi 5")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
11 months agorockchip: rk3588-orangepi-5-plus: Build SPI image
Slawomir Stepien [Fri, 17 Nov 2023 23:24:36 +0000 (23:24 +0000)]
rockchip: rk3588-orangepi-5-plus: Build SPI image

Enable building of the SPI image, u-boot-rockchip-spi.bin, now that we
know what bootsource id values BootRom use for SPI flash on RK3588.

Fixes: b51cf8bb09b6 ("board: rockchip: Add Xunlong Orange Pi 5 Plus")
Signed-off-by: Slawomir Stepien <sst@poczta.fm>
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
11 months agorockchip: rk3588-nanopc-t6: Build SPI image
John Clark [Fri, 17 Nov 2023 23:24:35 +0000 (23:24 +0000)]
rockchip: rk3588-nanopc-t6: Build SPI image

Enable building of the SPI image, u-boot-rockchip-spi.bin, now that we
know what bootsource id values BootRom use for SPI flash on RK3588.

Fixes: b0b8086898f8 ("board: rockchip: add FriendlyElec NanoPC-T6 rk3588 board")
Signed-off-by: John Clark <inindev@gmail.com>
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
11 months agorockchip: rk3588: Fix boot from SPI flash
Jonas Karlman [Fri, 17 Nov 2023 23:24:34 +0000 (23:24 +0000)]
rockchip: rk3588: Fix boot from SPI flash

The commit fd6e425be243 ("rockchip: rk3588-rock-5b: Enable boot from SPI
NOR flash") added a new BROM_BOOTSOURCE_SPINOR_RK3588 with value 6.

At the time the reason for this new bootsource id value 6 was unknown.

We now know that the BootRom on RK3588 use different bootsource id
values depending on the iomux used by the flash spi controller, and not
by the type of spi nor or spi nand flash used.

Add the following enum values and use them for RK3588 boot_devices.

- BROM_BOOTSOURCE_FSPI_M0 = 3
- BROM_BOOTSOURCE_FSPI_M1 = 4
- BROM_BOOTSOURCE_FSPI_M2 = 6

Fixes: fd6e425be243 ("rockchip: rk3588-rock-5b: Enable boot from SPI NOR flash")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Tested-by: Slawomir Stepien <sst@poczta.fm>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
11 months agoboard: rockchip: Add support for FriendlyARM NanoPi R2C Plus
Tianling Shen [Sat, 23 Dec 2023 04:00:07 +0000 (12:00 +0800)]
board: rockchip: Add support for FriendlyARM NanoPi R2C Plus

The NanoPi R2C Plus is a small variant of NanoPi R2C with a on-board
eMMC flash (8G) included.

The device tree is taken from the kernel v6.5.

Signed-off-by: Tianling Shen <cnsztl@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
11 months agoarm: dts: rockchip: rk3288: move to 64 bit reg size
Johan Jonker [Wed, 27 Dec 2023 12:06:47 +0000 (13:06 +0100)]
arm: dts: rockchip: rk3288: move to 64 bit reg size

To make automatic Rockchip DT syncing possible from Linux to U-boot prepare
rk3288.dtsi by moving to 64 bit reg size.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
11 months agorockchip: rk35xx: expand space for decompressed kernel
Hugh Cole-Baker [Tue, 26 Dec 2023 16:43:30 +0000 (16:43 +0000)]
rockchip: rk35xx: expand space for decompressed kernel

An uncompressed 6.7.0-rc1 Linux kernel Image built with the arm64
defconfig is about 40MB. This does not fit in to the space between
kernel_comp_addr_r and fdt_addr_r, so when uncompressing an Image.gz
to this size, the FDT will be overwritten. Rearrange addresses to have
128MiB for the kernel and its decompression buffer, then devicetree,
overlay and ramdisk at the end.

Signed-off-by: Hugh Cole-Baker <sigmaris@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
11 months agorockchip: board: Remove dwc3 usb init and gadget handler functions
Jonas Karlman [Sun, 12 Nov 2023 17:48:58 +0000 (17:48 +0000)]
rockchip: board: Remove dwc3 usb init and gadget handler functions

Remove board_usb_init() and dm_usb_gadget_handle_interrupts() functions
related to dwc3, they use e.g. a hard-coded reg address for RK3399 and
are obsolete with use of DM_USB_GADGET.

Use of DM_USB_GADGET, USB_DWC3_GENERIC and USB_DWC3_GADGET have replaced
same feature provided by the removed functions on RK3399 boards.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
11 months agoconfigs: rockchip: Use dwc3-generic driver on RK3328 and RK3399
Jonas Karlman [Sun, 12 Nov 2023 17:48:57 +0000 (17:48 +0000)]
configs: rockchip: Use dwc3-generic driver on RK3328 and RK3399

Complete the transition away from xhci-dwc3 and dwc3-of-simple drivers
and change to use the dwc3-generic driver on remaining RK3328 and RK3399
boards.

MISC, USB_DWC3 and USB_DWC3_GENERIC is enabled on boards that used to
enable USB_XHCI_DWC3. USB_XHCI_DWC3 is dropped from updated boards along
with the default y of USB_XHCI_DWC3_OF_SIMPLE.

There is no intended change in functionality with this changes, USB 3.0
is expected to continue same as before this change.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Marek Vasut <marex@denx.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
11 months agoget_maintainer.pl: slightly modify penguin_chief
Anthony Loiseau [Thu, 11 Jan 2024 16:51:27 +0000 (17:51 +0100)]
get_maintainer.pl: slightly modify penguin_chief

Penguin chiefs are actually stripped out from get_maintainer results unless
--git-chief-penguins is provided, which appends them to all results instead.

This is a issue for U-Boot since Tom Rini (penguin chief) is also maintainer
of some sub-trees ("ARM", "ARM TI" and "THE REST").

Hopefully, this match is performed case-senditive over name and email,
therefore upper-casing Tom Rini last name workarounds the issue.

Important note: This also fixes "THE REST" catch all section resulting
in Tom Rini listed as (maintainer:THE REST) for all files. Hope there is not
too much developers scripting their patch email header from get_maintainer.pl
output, otherwise Tom Rini may be flooded.

Cc: Tom Rini <trini@konsulko.com>
Signed-off-by: Anthony Loiseau <anthony.loiseau@allcircuits.com>
11 months agosmbios: fix matching issues for table types
Ilias Apalodimas [Thu, 11 Jan 2024 14:39:36 +0000 (16:39 +0200)]
smbios: fix matching issues for table types

commit 738b34668f28 ("smbios: Fallback to the default DT if sysinfo nodes are missing")
allowed the code to fallback and fill in SMBIOS tables with properties
from the compatible and product nodes of the DT, in case the
'smbios,sysinfo' node is missing.
That works fine for Type1/2 tables, but for other types we need to
match the smbios,sysinfo subnode name as well. So add it to the
smbios_ctx and check it during the sysinfo <-> DT mathcing

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
11 months agosmbios: shorten sysinfo_str declarations and use
Ilias Apalodimas [Thu, 11 Jan 2024 14:39:35 +0000 (16:39 +0200)]
smbios: shorten sysinfo_str declarations and use

sysinfo_str is a bit too long and makes indentation weird. Shorten it
to si_str.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
11 months agocmd: license: Add CONFIG_GZIP dependency
Ivan Orlov [Thu, 11 Jan 2024 12:58:19 +0000 (12:58 +0000)]
cmd: license: Add CONFIG_GZIP dependency

'License' command processing code could be successfully compiled only
when CONFIG_GZIP option is enabled, otherwise it can't find the 'gunzip'
function definition (it is defined in lib/gunzip.c).

Add CONFIG_GZIP dependency to 'license' command config option in the
corresponding Kconfig.

Signed-off-by: Ivan Orlov <ivan.orlov@codethink.co.uk>
11 months agocmd: bootflow: remove dead code in do_bootflow_cmdline()
Heinrich Schuchardt [Thu, 11 Jan 2024 08:14:33 +0000 (09:14 +0100)]
cmd: bootflow: remove dead code in do_bootflow_cmdline()

Checking argc < 3 twice is redundant.

Addresses-Coverity-ID: 477198 Logically dead code
Fixes: 921f63e57238 ("bootflow: Allow setting a cmdline arg with no value")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
11 months agosmbios: buffer overflow when zeroing entry point
Heinrich Schuchardt [Thu, 11 Jan 2024 06:34:08 +0000 (07:34 +0100)]
smbios: buffer overflow when zeroing entry point

A SMBIOS 3 entry point has a different length than an SMBIOS 2.1 entry
point.

Fixes: 70924294f375 ("smbios: Use SMBIOS 3.0 to support an address above 4GB")
Fixes: 1c5f6fa3883d ("smbios: Drop support for SMBIOS2 tables")
Addresses-Coverity-ID: 477212 ("Wrong sizeof argument")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
11 months agonvme: Update nvme_scan_namespace to keep trying on busy
Moritz Fischer [Wed, 10 Jan 2024 05:04:48 +0000 (05:04 +0000)]
nvme: Update nvme_scan_namespace to keep trying on busy

A busy controller shouldn't be game-over for all controllers,
so keep trying on hitting -EBUSY.

This change brings the actual behavior of the routine in line
with what the descriptions says.

Fixes: 982388eaa991 ("nvme: Add NVM Express driver support")
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Moritz Fischer <moritzf@google.com>
11 months agonvme: Fix error code and log to indicate busy
Moritz Fischer [Wed, 10 Jan 2024 05:04:47 +0000 (05:04 +0000)]
nvme: Fix error code and log to indicate busy

Return -EBUSY if controller is found busy rather than -ENOMEM
and update the error message accordingly.

Fixes: 982388eaa991 ("nvme: Add NVM Express driver support")
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Moritz Fischer <moritzf@google.com>
11 months agodrivers: pci: Fix dm_pci_map_bar() to support 64b BARs
Moritz Fischer [Wed, 10 Jan 2024 04:59:02 +0000 (04:59 +0000)]
drivers: pci: Fix dm_pci_map_bar() to support 64b BARs

This enables 64b BARs if CONFIG_SYS_PCI_64BIT is enabled.

Reviewed-by: Philip Oberfichtner <pro@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Moritz Fischer <moritzf@google.com>
11 months agogetchar(): Correct usage
Tom Rini [Tue, 9 Jan 2024 22:57:16 +0000 (17:57 -0500)]
getchar(): Correct usage

The function getchar() returns an 'int' and not a 'char'. Coverity notes
that "Assigning the return value of getchar to char ... truncates its value."
and so for the most part we can resolve this easily by using 'int' as
intended, and often used throughout the codebase. A few places are not
so simple and would require further re-architecting of the code in order
to change this, so we leave them be.

Signed-off-by: Tom Rini <trini@konsulko.com>
11 months agotest/py: bootstage: Add test for bootstage command
Love Kumar [Tue, 9 Jan 2024 09:09:57 +0000 (14:39 +0530)]
test/py: bootstage: Add test for bootstage command

Add test cases for bootstage command to print the bootstage report, to
stash the data into memory and to unstash the data from memory.

Signed-off-by: Love Kumar <love.kumar@amd.com>
11 months agoarch: mach-k3: Fix incorrect mapping of higher DDR addresses as device memory
Sekhar Nori [Tue, 9 Jan 2024 08:45:51 +0000 (14:15 +0530)]
arch: mach-k3: Fix incorrect mapping of higher DDR addresses as device memory

Entry for physical address 0x500000000 in memory map table for MMU
configuration is spilling over and inadvertently making DDR available at
higher address (above 4GB address space) get mapped as device memory
(nGnRnE).

Fix this by adjusting entry size. Tested on AM62A SK. Before this patch:

=> time crc32 0x881000000 0x20000000
crc32 for 881000000 ... 8a0ffffff ==> 7f34d7ca

time: 1 minutes, 14.716 seconds

After patch:

=> time crc32 0x881000000 0x20000000
crc32 for 881000000 ... 8a0ffffff ==> 7f34d7ca

time: 2.710 seconds

Acked-by: Andrew Davis <afd@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
11 months agotest: Skip cleanup test if not built out of tree
Tobias Deiminger [Mon, 8 Jan 2024 21:11:00 +0000 (22:11 +0100)]
test: Skip cleanup test if not built out of tree

With commit 42c0e5bb054d ("test: Find leftovers after clean/mrproper")
we assume that we are performing out of tree builds. test_clean and
test_mrproper fail if the assumption isn't met.

However there are valid scenarios where tests run with in source builds
(i.e., test.py --build-dir=.).

Automatically skip cleanup tests in such scenarios to prevent false
positives.

Signed-off-by: Tobias Deiminger <tdmg@linutronix.de>
Reviewed-by: Harald Seiler <u-boot@rahix.de>