[PATCH next RFC 0/5] rockchip: panic() when DRAM init fails

Quentin Schulz foss+uboot at 0leil.net
Tue Nov 5 18:21:54 CET 2024


I am the unfortunate owner of an RK3399 Puma that is failing DRAM init
every now and then with the following cryptic error message:
"""
pctl_start: Failed to init pctl channel 0
"""

When it fails, the current logic is implemented in such a way that the
board enters an infinite while loop. This is not ideal for embedded
systems that are not easily accessible and also an issue when having
devices in a CI lab for example.

Therefore, let's simply panic if the DRAM fails to init. This was tested
only on RK3399 Puma, similar changes may be required for other SoCs to
properly propagate the errors.

While this is all but a work-around instead of fixing the DRAM init
sequence, I believe it is important for resilience of devices in the
field.

Marking this as RFC because:
1) panic()s for all Rockchip SoCs but only tested on RK3399
2) unsure about error return values (ENODEV and the likes), not sure
   what would be better than that though :/

Note that one can still hang() if they want by setting PANIC_HANG
symbol.

Signed-off-by: Quentin Schulz <quentin.schulz at cherry.de>
---
Quentin Schulz (5):
      ram: rk3399: allow to fail DRAM init if pctl_start fails
      ram: rk3399: fail probe if DRAM init failed
      rockchip: spl/tpl: panic when DRAM init failed
      ram: rk3399: merge two consecutive ifs with same condition
      ram: rk3399: fail DRAM init when pctl channel init fails instead of hanging

 arch/arm/mach-rockchip/spl.c        |  7 +++----
 arch/arm/mach-rockchip/tpl.c        |  6 ++----
 drivers/ram/rockchip/sdram_rk3399.c | 24 +++++++++++-------------
 3 files changed, 16 insertions(+), 21 deletions(-)
---
base-commit: 56accc56b9aab87ef4809ccc588e1257969cd271
change-id: 20241105-rk3399-dram-init-207325c2d9ca

Best regards,
-- 
Quentin Schulz <quentin.schulz at cherry.de>



More information about the U-Boot mailing list