Hi Simon, On 8/4/2026 9:19 PM, Simon Glass wrote: > Hi Jonas, > > On Tue, 4 Aug 2026 at 04:57, Jonas Karlman <[email protected]> wrote: >> >> This series takes the initial steps required to try and remove use of >> syscon_get_first_range() or syscon_get_regmap_by_driver_data() to get >> GRF base addresses at runtime for the Rockchip platform. >> >> The GRF base addresses are fixed and known at compile time, yet drivers >> keep trying to resolve them at runtime delaying some operations by >> several ms. > > I suppose all addresses are known at compile-time, if you have a > single device tree. I have always hoped that we might end up with a > generic U-Boot for rockchip.
I do not understand how removing these unneeded syscon drivers and helpers would stop such goals or make that any harder. From my point of view, they are currently making such things harder and only adds extra code, runtime and energy waste. E.g. around 227 ms was wasted resolving fixed known base addresses for RK3399 last time I measured it, see [1]. Most drivers or any SoC specific code is already identified using a compatible that is SoC specific, i.e. the RAM or CLK drivers are matched using a SoC specific compatible and seeing how all GRF variants are unique there will always need to be SoC specific code to handle the GRFs base address and reg offsets. And for drivers that are more dynamic in nature the DT typically have a phandle to the GRF syscon node anyway, so getting it from the phandle will be a better option and closer matches how Linux handles similar references. The biggest current blocker for a more generic U-Boot proper on Rockchip platform is rockchip_get_cru() and how it currently makes it impossible to support multiple SoCs in one build due to how it is used in the sysreset driver. Fortunately, I have a pending series that also cleans up the unneeded rockchip_get_cru/clk() related helpers. > > I wonder if there is another way to do this, perhaps reading the > address once and caching it? I really do not see the need for that; it would only make things more complex than it really needs to be. We should use constants where appropriate, e.g. soc specific drivers/code and use generic phandle lookups elsewhere. At least that is my end goal with this and pending follow-up series. [1] https://git.u-boot-project.org/u-boot/contributors/kwiboo/u-boot/-/commit/cfb736dea37f834e849e54d39fb086c91697fc24 Regards, Jonas > >> >> In this initial part the three current uses of ROCKCHIP_SYSCON_x lookup >> used on RK35xx SoCs is converted to use a constant value or using >> phandle lookup, followed by removing the SoC specific syscon driver and >> finally removing the RK35xx special ROCKCHIP_SYSCON_x enum values. >> >> The changes included in this series have no intended behavior change for >> the affected RK35xx SoCs. >> >> Future series will continue to convert uses of ROCKCHIP_SYSCON_x for >> remaining older RK SoCs if this initial part is accepted. >> >> Jonas Karlman (9): >> ram: rockchip: rk3568: Simplify get_info() ops >> ram: rockchip: rk3588: Simplify get_info() ops >> video: rockchip: dw_mipi_dsi: Get GRF base address from phandle >> rockchip: rk3568: Remove unneeded syscon driver >> rockchip: rk3588: Remove unneeded syscon driver >> rockchip: rk3576: Remove unneeded syscon driver >> rockchip: rk3528: Remove unneeded syscon driver >> rockchip: rk3506: Remove unneeded syscon driver >> rockchip: include: Remove unused ROCKCHIP_SYSCON_x enum values >> >> arch/arm/include/asm/arch-rockchip/clock.h | 8 ----- >> arch/arm/mach-rockchip/rk3506/Makefile | 1 - >> arch/arm/mach-rockchip/rk3506/syscon_rk3506.c | 19 ------------ >> arch/arm/mach-rockchip/rk3528/Makefile | 1 - >> arch/arm/mach-rockchip/rk3528/syscon_rk3528.c | 19 ------------ >> arch/arm/mach-rockchip/rk3568/Makefile | 1 - >> arch/arm/mach-rockchip/rk3568/syscon_rk3568.c | 23 -------------- >> arch/arm/mach-rockchip/rk3576/Makefile | 1 - >> arch/arm/mach-rockchip/rk3576/syscon_rk3576.c | 22 ------------- >> arch/arm/mach-rockchip/rk3588/Makefile | 1 - >> arch/arm/mach-rockchip/rk3588/syscon_rk3588.c | 31 ------------------- >> drivers/ram/rockchip/sdram_rk3568.c | 29 +++-------------- >> drivers/ram/rockchip/sdram_rk3588.c | 31 ++++--------------- >> drivers/video/rockchip/dw_mipi_dsi_rockchip.c | 16 ++++++---- >> 14 files changed, 21 insertions(+), 182 deletions(-) >> delete mode 100644 arch/arm/mach-rockchip/rk3506/syscon_rk3506.c >> delete mode 100644 arch/arm/mach-rockchip/rk3528/syscon_rk3528.c >> delete mode 100644 arch/arm/mach-rockchip/rk3568/syscon_rk3568.c >> delete mode 100644 arch/arm/mach-rockchip/rk3576/syscon_rk3576.c >> delete mode 100644 arch/arm/mach-rockchip/rk3588/syscon_rk3588.c >> >> -- >> 2.54.0 >> > > Regards, > Simon
