]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
19 months agoarm: mach-k3: Increase SYSFW max image size
Dave Gerlach [Tue, 16 May 2023 04:54:37 +0000 (10:24 +0530)]
arm: mach-k3: Increase SYSFW max image size

When booting with HS silicon, the system firmware image is 278270, which
is slightly larger than currently allocated amount.

This can cause unexpected behavior if this overlap interferes with other
things in memory, so increase this with a slightly margin added as well
to avoid any boot issues that can appear after system firmware gets
loaded.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Tero Kristo <kristo@kernel.org>
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
19 months agoKconfig: j721e: Change K3_MCU_SCRATCHPAD_BASE to non firewalled region
Manorit Chawdhry [Tue, 16 May 2023 04:54:36 +0000 (10:24 +0530)]
Kconfig: j721e: Change K3_MCU_SCRATCHPAD_BASE to non firewalled region

In non-combined boot flow for K3, all the firewalls are locked by default
until sysfw comes up. Rom configures some of the firewall for its usage
along with the SRAM for R5 but the PSRAM region is still locked.

The K3 MCU Scratchpad for j721e was set to a PSRAM region triggering the
firewall exception before sysfw came up. The exception started happening
after adding multi dtb support that accesses the scratchpad for reading
EEPROM contents.

The commit changes R5 MCU scratchpad for j721e to an SRAM region.

Old Map:
┌─────────────────────────────────────┐ 0x41c00000
│                 SPL                 │
├─────────────────────────────────────┤ 0x41c40000 (approx)
│                STACK                │
├─────────────────────────────────────┤ 0x41c85b20
│             Global data             │
│  sizeof(struct global_data) = 0xd8  │
├─────────────────────────────────────┤ gd->malloc_base = 0x41c85bfc
│                HEAP                 │
│  CONFIG_SYS_MALLOC_F_LEN = 0x70000  │
├─────────────────────────────────────┤ CONFIG_SPL_BSS_START_ADDR
│               SPL BSS               │ (0x41cf5bfc)
│  CONFIG_SPL_BSS_MAX_SIZE = 0xA000   │
└─────────────────────────────────────┘ CONFIG_SYS_K3_BOOT_PARAM_TABLE_INDEX
                (0x41cffbfc)

New Map:
┌─────────────────────────────────────┐ 0x41c00000
│                 SPL                 │
├─────────────────────────────────────┤ 0x41c40000 (approx)
│                EMPTY                │
├─────────────────────────────────────┤ 0x41c81920
│                STACK                │
│ SPL_SIZE_LIMIT_PROVIDE_STACK=0x4000 │
├─────────────────────────────────────┤ 0x41c85920
│             Global data             │
│  sizeof(struct global_data) = 0xd8  │
├─────────────────────────────────────┤ gd->malloc_base = 0x41c859f0
│                HEAP                 │
│  CONFIG_SYS_MALLOC_F_LEN = 0x70000  │
├─────────────────────────────────────┤ CONFIG_SPL_BSS_START_ADDR
│               SPL BSS               │ (0x41cf59f0)
│  CONFIG_SPL_BSS_MAX_SIZE = 0xA000   │
├─────────────────────────────────────┤ 0x41cff9fc
│         NEW MCU SCRATCHPAD          │
│  SYS_K3_MCU_SCRATCHPAD_SIZE = 0x200 │
└─────────────────────────────────────┘ CONFIG_SYS_K3_BOOT_PARAM_TABLE_INDEX
                (0x41cffbfc)

Fixes: ab977c8b91b4 ("configs: j721s2_evm_r5: Enable support for building multiple dtbs into FIT")
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
[n-francis@ti.com: SRAM allocation addressing diagram]
Signed-off-by: Neha Francis <n-francis@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Kamlesh Gurudasani <kamlesh@ti.com>
19 months agoconfigs: j721e: Merge the HS and non-HS defconfigs
Manorit Chawdhry [Tue, 16 May 2023 04:54:35 +0000 (10:24 +0530)]
configs: j721e: Merge the HS and non-HS defconfigs

K3 devices have runtime type board detection. Make the default defconfig
include the secure configuration. Then remove the HS specific config.

Non-HS devices will continue to boot due to runtime device type detection.
If TI_SECURE_DEV_PKG is not set the build will emit warnings, for non-HS
devices these can be ignored.

Reviewed-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Acked-by: Andrew Davis <afd@ti.com>
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
19 months agoarm: k3: config.mk: Add missing dependencies on tispl.bin HS
Andrew Davis [Tue, 16 May 2023 04:54:34 +0000 (10:24 +0530)]
arm: k3: config.mk: Add missing dependencies on tispl.bin HS

When building for secure devices using non-buildman based image generation
the signed tispl.bin file is called tispl.bin_HS. Also build the unsigned
tispl.bin file as expected.

Signed-off-by: Andrew Davis <afd@ti.com>
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
19 months agoPrepare v2023.07-rc3
Tom Rini [Mon, 29 May 2023 14:59:09 +0000 (10:59 -0400)]
Prepare v2023.07-rc3

Signed-off-by: Tom Rini <trini@konsulko.com>
19 months agoconfigs: Resync with savedefconfig
Tom Rini [Mon, 29 May 2023 14:43:26 +0000 (10:43 -0400)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
19 months agoMerge tag 'u-boot-imx-20230525' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
Tom Rini [Thu, 25 May 2023 18:27:39 +0000 (14:27 -0400)]
Merge tag 'u-boot-imx-20230525' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

u-boot-imx-20230525
-------------------

- i.MX93 series
- Fixes

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

19 months agoserial: mxs: Add MXS AUART driver
Marek Vasut [Sat, 6 May 2023 14:43:31 +0000 (16:43 +0200)]
serial: mxs: Add MXS AUART driver

Add trivial driver for the MXS AUART IP. This is the other UART IP
present in i.MX23 and i.MX28, used to drive the non-DUART ports.

Signed-off-by: Marek Vasut <marex@denx.de>
19 months agoimx9: imx93_evk: enable sysreset
Peng Fan [Fri, 28 Apr 2023 04:08:47 +0000 (12:08 +0800)]
imx9: imx93_evk: enable sysreset

Enable sysreset for i.MX93 EVK.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agoimx9: imx93_evk: update ddr timing file
Peng Fan [Fri, 28 Apr 2023 04:08:46 +0000 (12:08 +0800)]
imx9: imx93_evk: update ddr timing file

Update DDR timing file generated by DDR Config Tool
1. Dynamic refresh rate is set by default
2. The 3rd freq will be 625MTS based on power and performance better than 100MTS.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agoimx9: Calculate DDR size from DDRC setting
Ye Li [Fri, 28 Apr 2023 04:08:45 +0000 (12:08 +0800)]
imx9: Calculate DDR size from DDRC setting

To avoid using static setting for ECC enabled DDR size, switch
to calculate DDR size from DDRC setting

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Jacky Bai <ping.bai@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agoddr: imx9: update the rank setting for multi fsp support
Jacky Bai [Fri, 28 Apr 2023 04:08:44 +0000 (12:08 +0800)]
ddr: imx9: update the rank setting for multi fsp support

The rank setting flow should be updated to support multi
fsp config.

Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agoddr: imx93: update the ddr init to support mult setpoints
Jacky Bai [Fri, 28 Apr 2023 04:08:43 +0000 (12:08 +0800)]
ddr: imx93: update the ddr init to support mult setpoints

Update the DDR init flow for multi-setpoint support on i.MX93. A new
fsp_cfg struct need to be added in the timing file to store the diff
part of the DDRC and DRAM MR register for each setpoint.

Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agoddr: imx93: Add 625M bypass clock support
Jacky Bai [Fri, 28 Apr 2023 04:08:42 +0000 (12:08 +0800)]
ddr: imx93: Add 625M bypass clock support

Add 625M bypass clock that may be used DRAM 625M
bypass mode support.

Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agoddr: imx9: Change the saved ddr data base to 0x2051c000
Jacky Bai [Fri, 28 Apr 2023 04:08:41 +0000 (12:08 +0800)]
ddr: imx9: Change the saved ddr data base to 0x2051c000

change the ddr saved info to the last 16KB of the OCRAM.

Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agoimx9: imx93_evk: Update spl stack & bss base address
Peng Fan [Fri, 28 Apr 2023 04:08:40 +0000 (12:08 +0800)]
imx9: imx93_evk: Update spl stack & bss base address

As the ddr timing info will be saved at the last 16KB of
the OCRAM, spl stack & bss base should be updated to avoid
conflict.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agoddr: imx9: Add workaround for DDRPHY rank-to-rank errata
Ye Li [Fri, 28 Apr 2023 04:08:39 +0000 (12:08 +0800)]
ddr: imx9: Add workaround for DDRPHY rank-to-rank errata

According to DDRPHY errata, the Rank-to-Rank Spacing and tphy_rdcsgap
specification does not include the Critical Delay Difference (CDD) to
properly define the required rank-to-rank read command spacing after
executing PHY training firmware.

Following the errata workaround, at the end of data training, we get
all CDD values through the MessageBlock, then re-configure the DDRC
timing of WWT/WRT/RRT/RWT with comparing MAX CDD values.

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
19 months agoarm: dts: imx93: add tmu
Peng Fan [Fri, 28 Apr 2023 04:08:38 +0000 (12:08 +0800)]
arm: dts: imx93: add tmu

Add tmu nodes and thermal zone

Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agoarm: dts: imx93: sync device tree with Linux
Peng Fan [Fri, 28 Apr 2023 04:08:37 +0000 (12:08 +0800)]
arm: dts: imx93: sync device tree with Linux

Sync device tree with next-20230426

Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agoimx9: allow to bootaux Mcore with input address
Ye Li [Fri, 28 Apr 2023 04:08:36 +0000 (12:08 +0800)]
imx9: allow to bootaux Mcore with input address

Currently bootaux only supports to boot M33 core from TCM. Since ATF
has changed to use x2 parameter for M33 image address, update the
bootaux command to use input address, so we can support boot from
any possilbe address like TCM, DDR, Flexspi NOR.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agoimx9: imx93_evk: add low drive mode support on 11x11 EVK
Peng Fan [Fri, 28 Apr 2023 04:08:35 +0000 (12:08 +0800)]
imx9: imx93_evk: add low drive mode support on 11x11 EVK

Add a static u-boot config for i.MX93 low drive mode support. When
low drive mode is enabled, VDD_SOC is set to 0.75V. Bus clocks,
A55 core clock (900Mhz), DDR clock (1866MTS), and some peripherals
clocks (USDHC/FLEXSPI/PDM/DISP_PIX/CAM_PIX) must decrease to meet
max frequencies in low drive mode.

Also set standby voltage for buck1

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agoimx9: use i.MX generic rom api function
Peng Fan [Fri, 28 Apr 2023 04:08:34 +0000 (12:08 +0800)]
imx9: use i.MX generic rom api function

There is no need to save gd with using the generic rom api function, so
simplify code.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agoimx9: correct coding style
Peng Fan [Fri, 28 Apr 2023 04:08:33 +0000 (12:08 +0800)]
imx9: correct coding style

The end brace should be in a new line

Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agoimx9: add i.MX93 variants support
Peng Fan [Fri, 28 Apr 2023 04:08:32 +0000 (12:08 +0800)]
imx9: add i.MX93 variants support

According to datasheet, iMX93 has fused parts with CORE1 or NPU or
both disabled. So update code to support it, the kernel device tree
runtime update will be added in future patches.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agoimx9: clock: config arm alt root to 500mhz
Peng Fan [Fri, 28 Apr 2023 04:08:31 +0000 (12:08 +0800)]
imx9: clock: config arm alt root to 500mhz

Config the A55 alt root clock to 500MHz(LD mode frequency)
by default. Normally, this clock root is only used as an
intermediate clock soure for A55 core/dsu when change the
ARM PLL frequency.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agoimx9: clock: add CONFIG_IMX9_LOW_DRIVE_MODE support
Peng Fan [Fri, 28 Apr 2023 04:08:30 +0000 (12:08 +0800)]
imx9: clock: add CONFIG_IMX9_LOW_DRIVE_MODE support

Add CONFIG_IMX9_LOW_DRIVE_MODE in imx9 clk, later we will
add board support

Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agoimx9: clock: clear HW_CTRL_SEL
Peng Fan [Fri, 28 Apr 2023 04:08:29 +0000 (12:08 +0800)]
imx9: clock: clear HW_CTRL_SEL

The HW_CTRL_SEL should be cleared when configuring PLL to avoid
potential glitch

Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agoimx9: Get market segment and speed grading
Peng Fan [Fri, 28 Apr 2023 04:08:28 +0000 (12:08 +0800)]
imx9: Get market segment and speed grading

Get the chip's market segment and speed grading from fuse and print
them in boot log as other i.MX series.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agoimx9: soc: support reset cause
Peng Fan [Fri, 28 Apr 2023 04:08:27 +0000 (12:08 +0800)]
imx9: soc: support reset cause

Support print reset cause. Since SRSR is not accessible from non-secure
world, so first save it to grp0, then read it in non-secure world.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agowatchdog: ulp_wdog: guard reset_cpu with condition check
Peng Fan [Fri, 28 Apr 2023 04:08:26 +0000 (12:08 +0800)]
watchdog: ulp_wdog: guard reset_cpu with condition check

There will be build error if CONFIG_SYSRESET is enabled, so guard
the reset_cpu with condition check here

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Stefan Roese <sr@denx.de>
19 months agoimx9: imx93_evk: enable CONFIG_WDT
Peng Fan [Fri, 28 Apr 2023 04:08:25 +0000 (12:08 +0800)]
imx9: imx93_evk: enable CONFIG_WDT

Without this config, there is boot error: Error binding ulp_wdt driver

Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agoimx9: imx93_evk: select IMX_TMU
Peng Fan [Fri, 28 Apr 2023 04:08:24 +0000 (12:08 +0800)]
imx9: imx93_evk: select IMX_TMU

Select thermal config to print current temperature

Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agoimx9: imx93_evk: drop unused macro
Peng Fan [Fri, 28 Apr 2023 04:08:23 +0000 (12:08 +0800)]
imx9: imx93_evk: drop unused macro

Drop unused macro

Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agoimx9: imx93_evk: enable CPU_IMX
Peng Fan [Fri, 28 Apr 2023 04:08:22 +0000 (12:08 +0800)]
imx9: imx93_evk: enable CPU_IMX

select CONFIG_CPU_IMX to display cpu info

Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agoimx9: Change hard coded MAC to read from fuse
Ye Li [Fri, 28 Apr 2023 04:08:21 +0000 (12:08 +0800)]
imx9: Change hard coded MAC to read from fuse

The MAC addresses are hard coded for bring up. Change it to support
reading from fuse.

Reviewed-by: Jacky Bai <ping.bai@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agoimx9: cut off OPTEE memory region from U-Boot
Peng Fan [Fri, 28 Apr 2023 04:08:20 +0000 (12:08 +0800)]
imx9: cut off OPTEE memory region from U-Boot

OPTEE memory region is set secure access only in ATF with configuration
to TRDC, and need to remove it from U-Boot, otherwise U-Boot and Kernel
may crash when accessing the memory

Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agoimx9: simplify clk settings
Peng Fan [Fri, 28 Apr 2023 04:08:19 +0000 (12:08 +0800)]
imx9: simplify clk settings

Simplify the clk root settings with an array

Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agoimx9: correct getting LPI2C clk
Peng Fan [Fri, 28 Apr 2023 04:08:18 +0000 (12:08 +0800)]
imx9: correct getting LPI2C clk

LPI2C_CLK_ROOT should be used instead of LPUART_CLK_ROOT for i2c

Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agoimx9: use parameter freq when set_arm_clk
Peng Fan [Fri, 28 Apr 2023 04:08:17 +0000 (12:08 +0800)]
imx9: use parameter freq when set_arm_clk

The freq parameter was ignored, should use it when configuring ARM PLL

Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agoimx9: add more PLL settings
Peng Fan [Fri, 28 Apr 2023 04:08:16 +0000 (12:08 +0800)]
imx9: add more PLL settings

Add more PLL settings for A55 and Display

Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agoimx9: configure M33 systick to 24M
Peng Fan [Fri, 28 Apr 2023 04:08:15 +0000 (12:08 +0800)]
imx9: configure M33 systick to 24M

The M33 systick should be 24M per reference mannual, so correct it.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agoimx: imx8_cpu: print cpu grade temperature
Peng Fan [Fri, 28 Apr 2023 04:08:14 +0000 (12:08 +0800)]
imx: imx8_cpu: print cpu grade temperature

Support print out cpu grade temperature

Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agoimx: imx8_cpu: support get temperature for i.MX9
Peng Fan [Fri, 28 Apr 2023 04:08:13 +0000 (12:08 +0800)]
imx: imx8_cpu: support get temperature for i.MX9

Use CONFIG_DM_THERMAL to make the temperature function could be reused
by i.MX8 and i.MX9

Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agoimx: imx8_cpu: support i.MX9
Peng Fan [Fri, 28 Apr 2023 04:08:12 +0000 (12:08 +0800)]
imx: imx8_cpu: support i.MX9

Add CPU_IMX Kconfig
Support imx8_cpu driver for i.MX9

Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agoimx: imx8_cpu: use static for local functions
Peng Fan [Fri, 28 Apr 2023 04:08:11 +0000 (12:08 +0800)]
imx: imx8_cpu: use static for local functions

For local functions, use static for function.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agoimx: firmware: sci: add inline functions when IMX8 not enabled
Peng Fan [Fri, 28 Apr 2023 04:08:10 +0000 (12:08 +0800)]
imx: firmware: sci: add inline functions when IMX8 not enabled

Since we might reuse some drivers for other platforms, while the drivers
have sci firmware api, so to avoid build failure add inline functions

Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agoimx: move imx8 sci header file to include/firmware/imx
Peng Fan [Fri, 28 Apr 2023 04:08:09 +0000 (12:08 +0800)]
imx: move imx8 sci header file to include/firmware/imx

Move imx8 sci header file to include/firmware/imx, then we could
use build macro to reuse some i.MX8 drivers for i.MX9, such as
drivers/cpu/imx8_cpu.c.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Stefano Babic <sbabic@denx.de>
19 months agoimx: spl_imx_romapi: typo fix
Peng Fan [Fri, 28 Apr 2023 04:08:08 +0000 (12:08 +0800)]
imx: spl_imx_romapi: typo fix

Unknow->Unknown

Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agothermal: imx_tmu: Update TMU driver to support iMX93
Ye Li [Fri, 28 Apr 2023 04:08:07 +0000 (12:08 +0800)]
thermal: imx_tmu: Update TMU driver to support iMX93

The TMU used on iMX93 is IP revision 2.1 which is different with previous
revision used on iMX8MQ. So add a new FLAG V4 for this revision to
distinguish the operations.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agoimx8ulp: build ahab
Peng Fan [Fri, 28 Apr 2023 04:08:06 +0000 (12:08 +0800)]
imx8ulp: build ahab

The ahab was missed to be compiled, so add it back.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
19 months agoARM: dts: imx7d-sdb-u-boot: Fix usdhc1 UHS operation
Fabio Estevam [Wed, 12 Apr 2023 12:41:04 +0000 (09:41 -0300)]
ARM: dts: imx7d-sdb-u-boot: Fix usdhc1 UHS operation

Commit 1a7904fdfa7d ("mmc: fsl_esdhc_imx: Use esdhc_soc_data
flags to set host caps") exposed the following SD card error:

U-Boot 2023.04-00652-g487e42f7bc5e (Apr 05 2023 - 22:14:21 -0300)

CPU:   Freescale i.MX7D rev1.0 1000 MHz (running at 792 MHz)
CPU:   Commercial temperature grade (0C to 95C) at 35C
Reset cause: POR
Model: Freescale i.MX7 SabreSD Board
Board: i.MX7D SABRESD in non-secure mode
DRAM:  1 GiB
Core:  100 devices, 19 uclasses, devicetree: separate
PMIC: PFUZE3000 DEV_ID=0x30 REV_ID=0x10
MMC:   FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2
Loading Environment from MMC... Card did not respond to voltage
select! : -110
*** Warning - No block device, using default environment

The reason of the problem, as explained by Ye Li:

"When UHS is enabled in defconfig, the usdhc1 node in imx7d-sdb.dts does
not configure pad for VSELECT, also the data pad should be set to
100Mhz/200Mhz pin states."

Apply these changes into u-boot.dtsi for now. When these changes
reach the Linux mainline imx7d-sdb, they can be dropped from u-boot.dtsi.

This fixes UHS mode on the imx7d-sdb board.

Suggested-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
19 months agothermal: imx_tmu: Move architecture code into driver
Marek Vasut [Tue, 4 Apr 2023 19:25:10 +0000 (21:25 +0200)]
thermal: imx_tmu: Move architecture code into driver

Stop polluting the architecture directory with driver specific code,
move it into driver where it should be. Split the code slightly so
the MX8MM/MX8MN fuse readout and programming and MX8MP fuse readout
and programming are in their separate functions, and called in case
of matching SoC.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
19 months agothermal: imx_tmu: Clean up all prints
Marek Vasut [Tue, 4 Apr 2023 19:25:09 +0000 (21:25 +0200)]
thermal: imx_tmu: Clean up all prints

Use dev_(dev, ...) for all printing and debug logging, since this
already includes the device name. Drop device name where duplicate.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Andrejs Cainikovs <andrejs.cainikovs@toradex.com>
19 months agoARM: imx: Fix parsing of ROM log event IDs on iMX8M
Fedor Ross [Thu, 14 Apr 2022 16:36:23 +0000 (18:36 +0200)]
ARM: imx: Fix parsing of ROM log event IDs on iMX8M

It seems like the ROM log events for the iMX8M are not fully covered by
AN12853 i.MX ROMs Log Events, Rev. 0, May 2020. On iMX8M the ROM event
ID 0x82 seems to use parameter0 which stops the parsing because the end
of list is detected too early.

This patch adds ROM event ID 0x82 and skips the next word if ID 0x82 is
parsed.

Fixes: a5ee05cf71 ("ARM: imx: Pick correct eMMC boot partition from ROM log")
Signed-off-by: Fedor Ross <fedor.ross@ifm.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
19 months agoMerge tag 'u-boot-rockchip-20230519' of https://source.denx.de/u-boot/custodians...
Tom Rini [Fri, 19 May 2023 14:13:33 +0000 (10:13 -0400)]
Merge tag 'u-boot-rockchip-20230519' of https://source.denx.de/u-boot/custodians/u-boot-rockchip

rk3588 driver:
- Sync the reset driver with kernel code;
- Enable pcie controller and phy support;
- Enable USB controller and phy support;
Board level dts and config update:
- boost eMMC performance for some of rk3399 boards;
- boot from SPI NOR flash for rk356x boards;
- Other board level updates;

19 months agorockchip: rk3588-rock-5b: Enable boot from SPI NOR flash
Jonas Karlman [Thu, 18 May 2023 15:39:30 +0000 (15:39 +0000)]
rockchip: rk3588-rock-5b: Enable boot from SPI NOR flash

Add sfc and flash node to device tree and config options to enable
support for booting from SPI NOR flash on Radxa ROCK 5 Model B.

Similar to RK3568 the BootRom in RK3588 can read all data and look for
idbloader at 0x8000, same as on SD and eMMC.

Use the rksd format and modify the mkimage offset to generate a bootable
u-boot-rockchip-spi.bin that can be written to 0x0 of SPI NOR flash. The
FIT image is loaded from 0x60000.

  => sf probe
  SF: Detected mx25u12835f with page size 256 Bytes, erase size 4 KiB, total 16 MiB

  => load mmc 1:1 10000000 u-boot-rockchip-spi.bin
  1492992 bytes read in 129 ms (11 MiB/s)

  => sf update $fileaddr 0 $filesize
  device 0 offset 0x0, size 0x16c800
  1300480 bytes written, 192512 bytes skipped in 11.103s, speed 137694 B/s

The BROM_BOOTSOURCE_ID value read back when booting from SPI flash does
not match the expected value of 3 (SPINOR) used by other SoCs. Instead a
value of 6 is read back, add a new enum value to handle this new
bootsource id.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Tested-by: Eugen Hristev <eugen.hristev@collabora.com>
Reviewed-by: Eugen Hristev <eugen.hristev@collabora.com>
19 months agoconfigs: phycore-rk3288: Enable CONFIG_LTO
Wadim Egorov [Tue, 13 Dec 2022 10:38:09 +0000 (11:38 +0100)]
configs: phycore-rk3288: Enable CONFIG_LTO

The phycore-rk3288 SPL binary is reaching the limits of 32KB very often.
Enable CONFIG_LTO to reduce the size of the SPL and make the board more
future proof for changes increasing the SPL size.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agorockchip: Pinebook Pro: Fix emmc default configuration
Wolfgang Zarre [Mon, 1 May 2023 07:43:20 +0000 (09:43 +0200)]
rockchip: Pinebook Pro: Fix emmc default configuration

If u-boot is installed on the internal emmc, then this will
allow to boot without failure.

Signed-off-by: Wolfgang Zarre <lxdev12@zirdeon.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agorockchip: rk3588-rock-5b: Add bootph prop to pinctrl for uart2 and sdhci
Jonas Karlman [Wed, 17 May 2023 18:26:39 +0000 (18:26 +0000)]
rockchip: rk3588-rock-5b: Add bootph prop to pinctrl for uart2 and sdhci

Enable pinctrl for sdhci in SPL to support loading of FIT image from SD
and eMMC storage when booting from SPI NOR flash.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agorockchip: rk3588-rock-5b: Update defconfig
Jonas Karlman [Wed, 17 May 2023 18:26:38 +0000 (18:26 +0000)]
rockchip: rk3588-rock-5b: Update defconfig

Update defconfig for rk3588-rock-5b with new defaults.

Remove the SPL_ROCKCHIP_BACK_TO_BROM=y option, SPL is expected to load
next stage from a FIT image and then jump to next stage not back to
BootRom.

Extend SPL_MAX_SIZE to 0x40000, SPL is loaded to 0x0 and TF-A is loaded
to 0x40000, use the space in between as SPL_MAX_SIZE.

Add config option to include useful gpio cmd.

Remove the CONFIG_NET_RANDOM_ETHADDR=y option, ethaddr and eth1addr is
set based on cpuid read from OTP.

Add CONFIG_SYS_NS16550_MEM32=y to use 32bit access of serial register.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agorockchip: rk3588-evb: Update defconfig
Jonas Karlman [Wed, 17 May 2023 18:26:38 +0000 (18:26 +0000)]
rockchip: rk3588-evb: Update defconfig

Update defconfig for rk3588-evb with new defaults.

Add CONFIG_SPL_FIT_SIGNATURE=y to let SPL verify an auto generated hash
of FIT images. This help indicate if there is an issue loading any of
the images to DRAM or SRAM.

Extend SPL_MAX_SIZE to 0x40000, SPL is loaded to 0x0 and TF-A is loaded
to 0x40000, use the space in between as SPL_MAX_SIZE.

Add config options to include useful gpio and regulator cmd.

Remove the CONFIG_NET_RANDOM_ETHADDR=y option, ethaddr and eth1addr is
set based on cpuid read from OTP.

Remove CONFIG_DEBUG_UART_ANNOUNCE=y to remove debug messages.

Add CONFIG_SYS_NS16550_MEM32=y to use 32bit access of serial register.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agorockchip: rk3588: Select DM_RESET and DM_REGULATOR_FIXED in arch Kconfig
Jonas Karlman [Wed, 17 May 2023 18:26:37 +0000 (18:26 +0000)]
rockchip: rk3588: Select DM_RESET and DM_REGULATOR_FIXED in arch Kconfig

Like other Rockchip SoCs, DM_RESET and DM_REGULATOR_FIXED is useful
across RK3588 platform. Select them from arch Kconfig.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agorockchip: rk3568-rock-3a: Enable boot from SPI NOR flash
Jonas Karlman [Wed, 17 May 2023 18:26:35 +0000 (18:26 +0000)]
rockchip: rk3568-rock-3a: Enable boot from SPI NOR flash

Add sfc and flash node to device tree and config options to enable
support for booting from SPI NOR flash on Radxa ROCK 3 Model A.

Unlike prior generation SoCs the BootRom in RK3568 can read all data and
look for idbloader at 0x8000, same as on SD and eMMC.

Use the rksd format and modify the mkimage offset to generate a bootable
u-boot-rockchip-spi.bin that can be written to 0x0 of SPI NOR flash. The
FIT image is loaded from 0x60000.

  => sf probe
  SF: Detected mx25u12835f with page size 256 Bytes, erase size 4 KiB, total 16 MiB

  => load mmc 1:1 10000000 u-boot-rockchip-spi.bin
  1384448 bytes read in 119 ms (11.1 MiB/s)

  => sf update $fileaddr 0 $filesize
  device 0 offset 0x0, size 0x152000
  1179648 bytes written, 204800 bytes skipped in 9.901s, speed 143185 B/s

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agorockchip: rk3568-rock-3a: Use pinctrl for sdmmc and sdhci in SPL
Jonas Karlman [Wed, 17 May 2023 18:26:34 +0000 (18:26 +0000)]
rockchip: rk3568-rock-3a: Use pinctrl for sdmmc and sdhci in SPL

Enable pinctrl for sdmmc and sdhci in SPL to support loading of FIT
image from SD and eMMC storage when booting from SPI NOR flash.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agorockchip: rk3568-rock-3a: Update defconfig
Jonas Karlman [Wed, 17 May 2023 18:26:34 +0000 (18:26 +0000)]
rockchip: rk3568-rock-3a: Update defconfig

Update defconfig for rk3568-rock-3a with new defaults.

Remove the SPL_ROCKCHIP_BACK_TO_BROM=y option, SPL is expected to load
next stage from a FIT image and then jump to next stage not back to
BootRom.

Add CONFIG_SPL_FIT_SIGNATURE=y to let SPL verify an auto generated hash
of FIT images. This help indicate if there is an issue loading any of
the images to DRAM or SRAM.

Extend SPL_MAX_SIZE to 0x40000, SPL is loaded to 0x0 and TF-A is loaded
to 0x40000, use the space in between as SPL_MAX_SIZE.

Add config option to include useful gpio cmd.

Remove the CONFIG_NET_RANDOM_ETHADDR=y option, ethaddr and eth1addr is
set based on cpuid read from OTP.

Filter out assigned-clock props with CONFIG_OF_SPL_REMOVE_PROPS,
U-Boot proper will read and configure assigned-clock props.

Remove the CONFIG_SPL_PMIC_RK8XX=y option, the pmic is not used in SPL.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agorockchip: rk3568-evb: Update defconfig
Jonas Karlman [Wed, 17 May 2023 18:26:32 +0000 (18:26 +0000)]
rockchip: rk3568-evb: Update defconfig

Update defconfig for rk3568-evb with new defaults.

Remove the SPL_ROCKCHIP_BACK_TO_BROM=y option, SPL is expected to load
next stage from a FIT image and then jump to next stage not back to
BootRom.

Add CONFIG_SPL_FIT_SIGNATURE=y to let SPL verify an auto generated hash
of FIT images. This help indicate if there is an issue loading any of
the images to DRAM or SRAM.

Extend SPL_MAX_SIZE to 0x40000, SPL is loaded to 0x0 and TF-A is loaded
to 0x40000, use the space in between as SPL_MAX_SIZE.

Add config options to include useful gpio, i2c, pmic and regulator cmd.

Remove the CONFIG_NET_RANDOM_ETHADDR=y option, ethaddr and eth1addr is
set based on cpuid read from OTP.

Filter out assigned-clock props with CONFIG_OF_SPL_REMOVE_PROPS,
U-Boot proper will read and configure assigned-clock props.

Add config options to enable support for the RK809 PMIC.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agorockchip: rk3566-radxa-cm3-io: Use pinctrl for sdmmc and sdhci in SPL
Jonas Karlman [Wed, 17 May 2023 18:26:31 +0000 (18:26 +0000)]
rockchip: rk3566-radxa-cm3-io: Use pinctrl for sdmmc and sdhci in SPL

Enable pinctrl for sdmmc and sdhci in SPL to support loading of FIT
image from SD and eMMC storage when booting from SPI NOR flash.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agorockchip: rk3566-radxa-cm3-io: Update defconfig
Jonas Karlman [Wed, 17 May 2023 18:26:30 +0000 (18:26 +0000)]
rockchip: rk3566-radxa-cm3-io: Update defconfig

Update defconfig for rk3566-radxa-cm3-io with new defaults. Also add
missing supported mmc modes to sdhci node.

Remove the SPL_ROCKCHIP_BACK_TO_BROM=y option, SPL is expected to load
next stage from a FIT image and then jump to next stage not back to
BootRom.

Add CONFIG_SPL_FIT_SIGNATURE=y to let SPL verify an auto generated hash
of FIT images. This help indicate if there is an issue loading any of
the images to DRAM or SRAM.

Extend SPL_MAX_SIZE to 0x40000, SPL is loaded to 0x0 and TF-A is loaded
to 0x40000, use the space in between as SPL_MAX_SIZE.

Add config option to include useful gpio cmd.

Remove the CONFIG_NET_RANDOM_ETHADDR=y option, ethaddr and eth1addr is
set based on cpuid read from OTP.

Filter out assigned-clock props with CONFIG_OF_SPL_REMOVE_PROPS,
U-Boot proper will read and configure assigned-clock props.

Add CONFIG_SYS_NS16550_MEM32=y to use 32bit access of serial register.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agorockchip: rk356x-u-boot: Add xin24m clock node to SPL
Jonas Karlman [Wed, 17 May 2023 18:26:29 +0000 (18:26 +0000)]
rockchip: rk356x-u-boot: Add xin24m clock node to SPL

Add bootph-all prop to xin24m clock node, it is referenced by cru node.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agospi: rockchip_sfc: Use linux rockchip,sfc-no-dma prop
Jonas Karlman [Wed, 17 May 2023 18:26:28 +0000 (18:26 +0000)]
spi: rockchip_sfc: Use linux rockchip,sfc-no-dma prop

Use the same prop as linux to control the use of fifo or dma mode. Also
add a u-boot,spl-sfc-no-dma prop to control the same in SPL.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agoconfigs: rock5b-rk3588: add PCI drivers and command
Eugen Hristev [Wed, 17 May 2023 10:01:02 +0000 (13:01 +0300)]
configs: rock5b-rk3588: add PCI drivers and command

Add drivers for PCIe , phy, and command.

Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agoARM: dts: rockchip: rock5b: enable pcie2x1l2 and associated combphy
Christopher Obbard [Wed, 17 May 2023 10:01:01 +0000 (13:01 +0300)]
ARM: dts: rockchip: rock5b: enable pcie2x1l2 and associated combphy

Enable the PCIe 2x1l 2 device and associated combphy.
On this bus, the Rock5B has an Ethernet transceiver connected.

Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
[eugen.hristev@collabora.com: minor tweaks]
Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
[jonas@kwiboo.se: add PCIe pins]
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agoARM: dts: rockchip: rk3588s-u-boot: add pcie2x1l2 with PHY
Joseph Chen [Wed, 17 May 2023 10:01:00 +0000 (13:01 +0300)]
ARM: dts: rockchip: rk3588s-u-boot: add pcie2x1l2 with PHY

Add the node for PCIe 2x1l 2 device together with the corresponding
combphy.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
[eugen.hristev@collabora.com: moved to -u-boot.dtsi, minor
adaptations]
Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
[jonas@kwiboo.se: adapt to kernel node]
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agorockchip: rockpro64: Build u-boot-rockchip-spi.bin
Jonas Karlman [Sat, 6 May 2023 17:41:15 +0000 (17:41 +0000)]
rockchip: rockpro64: Build u-boot-rockchip-spi.bin

Enable CONFIG_ROCKCHIP_SPI_IMAGE to build u-boot-rockchip-spi.bin.
Define CONFIG_SYS_SPI_U_BOOT_OFFS to write u-boot.itb at the expected
offset. Enable CONFIG_LTO to reduce size of SPL so that the mkimage
output fit before the 0x60000 offset in u-boot-rockchip-spi.bin.

  => sf probe
  SF: Detected gd25q128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB
  => load mmc 1:1 10000000 u-boot-rockchip-spi.bin
  1442304 bytes read in 27 ms (50.9 MiB/s)
  => sf update $fileaddr 0 $filesize
  device 0 offset 0x0, size 0x160200
  1421824 bytes written, 20480 bytes skipped in 9.501s, speed 155432 B/s

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agorockchip: rock-pi-4: Use SDMA to boost eMMC performance
Jonas Karlman [Wed, 17 May 2023 18:40:41 +0000 (18:40 +0000)]
rockchip: rock-pi-4: Use SDMA to boost eMMC performance

Enable the use of SDMA mode to boost eMMC performance on ROCK Pi 4.
Also add missing flags to indicate the supported MMC modes.

Using mmc read command to read 32 MiB data shows following improvement:

  => time mmc read 10000000 2000 10000

Before: time: 3.178 seconds
After: time: 0.402 seconds

This also enables CONFIG_SPL_FIT_SIGNATURE option to help discover
any possible future issue with loading TF-A into DRAM/SRAM.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agorockchip: rockpro64: Use SDMA to boost eMMC performance
Jonas Karlman [Sat, 6 May 2023 17:41:12 +0000 (17:41 +0000)]
rockchip: rockpro64: Use SDMA to boost eMMC performance

Enable the use of SDMA mode to boost eMMC performance on RockPro64.
Also add missing flags to indicate the supported MMC modes.

Using mmc read command to read 32 MiB data shows following improvement:

  => time mmc read 10000000 2000 10000

Before: time: 3.178 seconds
After: time: 0.402 seconds

This also enables CONFIG_SPL_FIT_SIGNATURE option to help discover
any possible future issue with loading TF-A into DRAM/SRAM.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agommc: rockchip_sdhci: Disable DMA mode using a device tree property
Jonas Karlman [Sat, 6 May 2023 17:41:11 +0000 (17:41 +0000)]
mmc: rockchip_sdhci: Disable DMA mode using a device tree property

Loading part of TF-A into SRAM from eMMC using DMA fails on RK3399
similar to other Rockchip SoCs. Checksum validation fails with:

  ## Checking hash(es) for Image atf-2 ... sha256 error!
  Bad hash value for 'hash' hash node in 'atf-2' image node
  spl_load_simple_fit: can't load image loadables index 1 (ret = -1)
  mmc_load_image_raw_sector: mmc block read error
  SPL: failed to boot from all boot devices
  ### ERROR ### Please RESET the board ###

Add a device tree property, u-boot,spl-fifo-mode, to control when the
rockchip_sdhci driver should disable the use of DMA and fallback on PIO
mode. Same device tree property is used by the rockchip_dw_mmc driver.

In commit 2cc6cde647e2 ("mmc: rockchip_sdhci: Limit number of blocks
read in a single command") the DMA mode was disabled using a CONFIG
option on RK3588. Revert that and instead disable DMA using the device
tree property for all RK3588 boards, also apply similar workaround for
all RK3399 boards.

Fixes: 2cc6cde647e2 ("mmc: rockchip_sdhci: Limit number of blocks read in a single command")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Tested-by: Quentin Schulz <foss+uboot@0leil.net> # RK3399 Puma, RK3588 Tiger
19 months agommc: rockchip_sdhci: Skip blocks read workaround on RK3399
Jonas Karlman [Sat, 6 May 2023 17:41:09 +0000 (17:41 +0000)]
mmc: rockchip_sdhci: Skip blocks read workaround on RK3399

The workaround to limit number of blocks to read in a single command
should only be applied to RK3568 and RK3588. Change to be more strict
when to apply the workaround.

Fixes: 2cc6cde647e2 ("mmc: rockchip_sdhci: Limit number of blocks read in a single command")
Suggested-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Tested-by: Quentin Schulz <foss+uboot@0leil.net> # RK3399 Puma, RK3588 Tiger
19 months agophy: rockchip: naneng-combphy: Support rk3588
Jon Lin [Thu, 27 Apr 2023 07:35:35 +0000 (10:35 +0300)]
phy: rockchip: naneng-combphy: Support rk3588

Add support for rk3588 phy variant.
The PHY clock is fixed at 100MHz.

Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
[kever.yang@rock-chips.com: update pcie pll parameters]
Co-developed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
[eugen.hristev@collabora.com: squashed, tidy up]
Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agophy: rockchip: naneng-combphy: Add support for multiple resets
Eugen Hristev [Thu, 27 Apr 2023 07:35:34 +0000 (10:35 +0300)]
phy: rockchip: naneng-combphy: Add support for multiple resets

Some variants of the PHY have more than just one reset.
To cover all cases, request the rests in bulk rather than just
the reset at index 0.

Co-developed-by: Ren Jianing <jianing.ren@rock-chips.com>
Signed-off-by: Ren Jianing <jianing.ren@rock-chips.com>
Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agopci: pcie_dw_rockchip: Support max_link_speed dts property
Jon Lin [Thu, 27 Apr 2023 07:35:33 +0000 (10:35 +0300)]
pci: pcie_dw_rockchip: Support max_link_speed dts property

Add support for max_link_speed specified in the PCI DT binding.

Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
[eugen.hristev@collabora.com: port to latest API, set default correctly,
align to 80 chars]
Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
[jonas@kwiboo.se: switch to dev_read_u32_default]
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agopci: pcie_dw_rockchip: Add rk3588 compatible
Jon Lin [Thu, 27 Apr 2023 07:35:32 +0000 (10:35 +0300)]
pci: pcie_dw_rockchip: Add rk3588 compatible

Add compatible for RK3588 SoC.

Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agoreset: rockchip: implement rk3588 lookup table
Eugen Hristev [Mon, 15 May 2023 10:55:04 +0000 (13:55 +0300)]
reset: rockchip: implement rk3588 lookup table

The current DT bindings for the rk3588 clock use a different ID than the
one that is supposed to be written to the hardware registers.
Thus, we cannot use directly the id provided in the phandle, but rather
use a lookup table to correctly setup the hardware.

This approach has been implemented already in Linux, by commit :
f1c506d152ff ("clk: rockchip: add clock controller for the RK3588")

Hence, implement a similar approach using the lookup table, and adapt
the existing reset driver to work with SoCs using lookup table.
The file rst-rk3588.c has been copied as much as possible from Linux.

Adapt the clk rk3588 driver as well to bind the reset driver with the
lookup table.

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
19 months agoconfigs: rockchip: rock5b-rk3588: add pinctrl to SPL
Eugen Hristev [Mon, 15 May 2023 13:44:03 +0000 (16:44 +0300)]
configs: rockchip: rock5b-rk3588: add pinctrl to SPL

Add pinctrl driver in SPL. Do not remove pinctrl properties for SPL dtb.

Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agoARM: dts: rk3588-rock-5b-u-boot: add bootph-all to pinctrl for sdmmc
Eugen Hristev [Mon, 15 May 2023 13:44:02 +0000 (16:44 +0300)]
ARM: dts: rk3588-rock-5b-u-boot: add bootph-all to pinctrl for sdmmc

To be able to initialize the pinctrl correctly at SPL level and read
u-boot proper from SD-Card, the pinctrl must be initialized.

Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
19 months agophy: Keep balance of counts when ops is missing
Jonas Karlman [Mon, 15 May 2023 09:59:50 +0000 (12:59 +0300)]
phy: Keep balance of counts when ops is missing

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Fixes: 226fce6108fe ("phy: Track power-on and init counts in uclass")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
19 months agophy: rockchip-inno-usb2: add initial support for rk3588 PHY
Eugen Hristev [Mon, 15 May 2023 09:59:49 +0000 (12:59 +0300)]
phy: rockchip-inno-usb2: add initial support for rk3588 PHY

Add initial support for the rk3588 PHY variant.
The lookup for the host-port reg inside the struct now does a do {} while()
instead of a while() {} in order to allow a first check for reg == 0.

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Co-developed-by: Frank Wang <frank.wang@rock-chips.com>
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
19 months agophy: remove phy-supply related code
Eugen Hristev [Mon, 15 May 2023 09:59:48 +0000 (12:59 +0300)]
phy: remove phy-supply related code

phy-supply is now handled at uclass level. Remove it from the drivers that
implement it at the driver level.

Acked-by: Neil Armstrong <neil.armstrong@linaro.org>
Suggested-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
19 months agophy: add support for phy-supply
Eugen Hristev [Mon, 15 May 2023 09:59:47 +0000 (12:59 +0300)]
phy: add support for phy-supply

Some phys require a phy-supply property that is a phandle to a regulator
that needs to be enabled for phy operations.
Implement basic supply lookup, enable and disabling, if DM_REGULATOR is
available.

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
[jonas@kwiboo.se:
use regulator_set_enable_if_allowed and disable if power_on ops fails]
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
19 months agoconfigs: rockchip: rock5b-rk3588: enable USB and regulators
Eugen Hristev [Wed, 17 May 2023 09:21:26 +0000 (12:21 +0300)]
configs: rockchip: rock5b-rk3588: enable USB and regulators

Enable USB command, USB drivers, PHY and regulators, for USB host
operations.

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
19 months agoARM: dts: rockchip: rk3588-rock-5b-u-boot: add USB 2.0 host
Eugen Hristev [Mon, 15 May 2023 09:59:45 +0000 (12:59 +0300)]
ARM: dts: rockchip: rk3588-rock-5b-u-boot: add USB 2.0 host

Add USB 2.0 host nodes and PHYs.

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Co-developed-by: William Wu <william.wu@rock-chips.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
Signed-off-by: Eugen Hristev <eugen.hristev@collabora.com>
19 months agoMerge tag 'efi-2023-07-rc3' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Tue, 16 May 2023 15:23:30 +0000 (11:23 -0400)]
Merge tag 'efi-2023-07-rc3' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request efi-2023-07-rc3

Documentation:

* update the description of signature algorithms

UEFI:

* fix unaligned access to GUID in HII database protocol
* fix launching EFI binaries loaded via semihosting
* fix filling of file path in loaded image protocol for non-block devices

19 months agoMerge branch '2023-05-15-assorted-bugfixes'
Tom Rini [Tue, 16 May 2023 15:16:42 +0000 (11:16 -0400)]
Merge branch '2023-05-15-assorted-bugfixes'

- Merge in a long-standing fix for some exynos platforms, correct a
  Kconfig description, fix some env issues, fix an issue in
  devfdt_get_addr_size_index_ptr and look for "panel-timings" not
  "panel-timing" per upstream binding.

19 months agoMerge tag 'xilinx-for-v2023.07-rc3' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Tue, 16 May 2023 13:10:57 +0000 (09:10 -0400)]
Merge tag 'xilinx-for-v2023.07-rc3' of https://source.denx.de/u-boot/custodians/u-boot-microblaze

Xilinx changes for v2023.07-rc3

.mailmap
- Fix Xilinx IDs

ZynqMP:
- Fix R5 split boot mode
- DT fixes - sync with Linux

Xilinx:
- Enable virtio and RNG support
- Enable ADI ethernet phy

SPI/Zynq:
- Fix dummy byte calculation

19 months agoenvironment: ti: rproc: fix remoteproc environment variables
Manorit Chawdhry [Mon, 15 May 2023 06:52:42 +0000 (12:22 +0530)]
environment: ti: rproc: fix remoteproc environment variables

During refactor this seemed to have been missed.

Fixes: 65dbb128fb45 ("include: environment: ti: Use .env for environment variables")
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
19 months agocore: fdtaddr: use map_sysmem() as cast for the return (part 2)
Johan Jonker [Wed, 10 May 2023 21:48:44 +0000 (23:48 +0200)]
core: fdtaddr: use map_sysmem() as cast for the return (part 2)

For the devfdt_get_addr_size_index_ptr() function use
map_sysmem() function as cast for the return for use in
sandbox.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
19 months agodrivers: core: ofnode: fix typo in panel timing decode
Raphael Gallais-Pou [Thu, 11 May 2023 14:36:52 +0000 (16:36 +0200)]
drivers: core: ofnode: fix typo in panel timing decode

In case where a single timing resolution is implemented in the
device-tree, the property is named "panel-timing", as specify
in Linux kernel binding file:

Documentation/devicetree/bindings/display/panel/panel-common.yaml

  # Display Timings
  panel-timing:
    description:
      Most display panels are restricted to a single resolution and
      require specific display timings. The panel-timing subnode expresses those
      timings.
    $ref: panel-timing.yaml#

  display-timings:
    description:
      Some display panels support several resolutions with different timings.
      The display-timings bindings supports specifying several timings and
      optionally specifying which is the native mode.
    $ref: display-timings.yaml#

Fixes: 0347cc773270 ("drivers: core: ofnode: Add panel timing decode.")
Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
19 months agoenvtools lack extra settings since commit 86b9c3e4e4 ("env: Allow U-Boot scripts...
Christophe Leroy [Thu, 11 May 2023 06:16:49 +0000 (08:16 +0200)]
envtools lack extra settings since commit 86b9c3e4e4 ("env: Allow U-Boot scripts to be placed in

After converting my targets from CFG_EXTRA_ENV_SETTINGS to
CONFIG_EXTRA_ENV_TEXT as suggested by Tom, I discovered that
fw_setenv doesn't set the entire defaut environment anymore.

I tried to fix it with the below patch, but it fails qemu-x86 CI test,
see https://source.denx.de/u-boot/custodians/u-boot-mpc8xx/-/pipelines/16326
That's the only CI test that fails AFAICS.

Could you help with a solution ? This needs to be fixed.

Thanks
Christophe

---- >8 ----
From: Christophe Leroy <christophe.leroy@csgroup.eu>
Subject: [RFC PATCH] envtools: Fix default environment

After converting some targets from CFG_EXTRA_ENV_SETTINGS to
CONFIG_EXTRA_ENV_TEXT, default environment embedded in
fw_env tool missed all extra settings.

Commit 86b9c3e4e4 ("env: Allow U-Boot scripts to be placed in
a .env file") restricted the inclusion of the content of that
file to builds without USE_HOSTCC.

But as mentionned in commit 79fc0c5f49 ("tools/env: cross-compile
fw_printenv without setting HOSTCC"), HOSTCC and USE_HOSTCC are
kept for code re-use.

Remove the restricting so that settings included in a .env
file are also added to fw_env tool.

Fixes: 86b9c3e4e4 ("env: Allow U-Boot scripts to be placed in a .env file")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
19 months agosamsung: common: do not reset if cros-ec uclass is missing
Henrik Grimler [Tue, 9 May 2023 19:05:47 +0000 (21:05 +0200)]
samsung: common: do not reset if cros-ec uclass is missing

Otherwise non-ChromeOS samsung devices, like the odroid boards, are
stuck in a bootloop if CONFIG_CROS_EC is not enabled:

    <...>
    MMC: SAMSUNG SDHCI: 2, EXYNOS DWMMC: 0
    Loading Environment from MMC... *** Warning - bad CRC, using default environment

    cros-ec communications failure -96

    Please reset with Power+Refresh

    Cannot init cros-ec device
    resetting ...

Issue started after commit e44d7e73fe0d ("dm: core: Switch
uclass_*_device_err to use uclass_*_device_check").

Signed-off-by: Henrik Grimler <henrik@grimler.se>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Minkyu Kang <mk7.kang@samsung.com>
19 months agoRevert "mmc: s5p_sdhci: unset the SDHCI_QUIRK_BROKEN_R1B"
Henrik Grimler [Tue, 9 May 2023 19:05:46 +0000 (21:05 +0200)]
Revert "mmc: s5p_sdhci: unset the SDHCI_QUIRK_BROKEN_R1B"

This reverts commit a034ec06ff1d558bbe11d5ee05edbb4de3ee2215.

Commit 4a3ea75de4c5 ("Revert "mmc: sdhci: set to INT_DATA_END when
there are data"") reverted the alternative fix that was added for
Exynos 4 devices, causing an error when trying to boot from an sdcard:

    <...>
    Loading Environment from MMC... sdhci_send_command: Timeout for status update!
    mmc fail to send stop cmd
    <...>

Re-add the quirk to allow booting from sdcards again.

Signed-off-by: Henrik Grimler <henrik@grimler.se>