Main goal for this series is to remove uses of rockchip_get_cru() helper in the rockchip_sysreset driver and from the get_reset_cause() helper.
Use of the rockchip_get_cru() abstraction is limiting future potential use of a single U-Boot proper build targeting multiple RK SoCs, since a build only can contain an implementation of rockchip_get_cru() tailored for a single SoC. This series instead moves the CRU base address to be part of the driver private data, meaning the CRU compatible help dictate what base address is going to be used at runtime in the sysreset driver. It also implements the sysreset get_status() ops to similarly drop the dependency on rockchip_get_cru() from the cpuinfo get_reset_cause() helper. With these changes it should also be possible to use DISPLAY_CPUINFO=y on most RK SoCs, however because sysreset get_status() ops are now implemented the print_resetinfo initcall already prints the reset reason so use of DISPLAY_CPUINFO=y to print reset reason may become obsolete. Finally, it also fully removes the now unused rockchip_get_cru() helpers for RK35xx SoCs. A future series should expand this to fully cover removal for all RK SoCs. This depends on the following series for a clean apply: - rockchip: Always init clocks in SPL build for RK35xx [1] - rockchip: Remove unneeded syscon driver for RK35xx [2] - rockchip: Remove unused rockchip_get_clk() helpers for RK35xx [3] and a branch for this series with all depends can be found at [4] [1] https://patchwork.ozlabs.org/cover/2280555/ [2] https://patchwork.ozlabs.org/cover/2280781/ [3] https://patchwork.ozlabs.org/cover/2281097/ [4] https://git.u-boot-project.org/u-boot/contributors/kwiboo/u-boot/-/commits/sysreset-bind Jonas Karlman (30): sysreset: rockchip: Add rockchip_sysreset_bind() helper clk: rockchip: rk3588: Use rockchip_sysreset_bind() helper clk: rockchip: rk3576: Use rockchip_sysreset_bind() helper clk: rockchip: rk3568: Use rockchip_sysreset_bind() helper clk: rockchip: rk3528: Use rockchip_sysreset_bind() helper clk: rockchip: rk3506: Use rockchip_sysreset_bind() helper clk: rockchip: rk3399: Use rockchip_sysreset_bind() helper clk: rockchip: rk3368: Use rockchip_sysreset_bind() helper clk: rockchip: rk3328: Use rockchip_sysreset_bind() helper clk: rockchip: rk3308: Use rockchip_sysreset_bind() helper clk: rockchip: rk3288: Use rockchip_sysreset_bind() helper clk: rockchip: rk322x: Use rockchip_sysreset_bind() helper clk: rockchip: px30: Use rockchip_sysreset_bind() helper clk: rockchip: rv1126: Use rockchip_sysreset_bind() helper clk: rockchip: rv1108: Use rockchip_sysreset_bind() helper clk: rockchip: rk3188: Use rockchip_sysreset_bind() helper clk: rockchip: rk3128: Use rockchip_sysreset_bind() helper clk: rockchip: rk3066: Use rockchip_sysreset_bind() helper clk: rockchip: rk3036: Use rockchip_sysreset_bind() helper sysreset: rockchip: Remove use of rockchip_get_cru() sysreset: rockchip: Implement get_status() ops rockchip: rk3399-roc-pc: Drop get_reset_cause() call rockchip: cpuinfo: Use sysreset_get_status() helper rockchip: rk3588: Remove unneeded rockchip_cru alias rockchip: rk3568: Remove unneeded rockchip_cru alias rockchip: rk3568: Remove unused rockchip_get_cru() helper rockchip: rk3588: Remove unused rockchip_get_cru() helper rockchip: rk3576: Remove unused rockchip_get_cru() helper rockchip: rk3528: Remove unused rockchip_get_cru() helper rockchip: rk3506: Remove unused rockchip_get_cru() helper arch/arm/include/asm/arch-rockchip/clock.h | 20 +++- arch/arm/include/asm/arch-rockchip/cru.h | 17 --- arch/arm/include/asm/arch-rockchip/cru_px30.h | 3 + .../include/asm/arch-rockchip/cru_rk3036.h | 2 + .../include/asm/arch-rockchip/cru_rk3066.h | 2 + .../include/asm/arch-rockchip/cru_rk3128.h | 2 + .../include/asm/arch-rockchip/cru_rk3188.h | 2 + .../include/asm/arch-rockchip/cru_rk322x.h | 2 + .../include/asm/arch-rockchip/cru_rk3288.h | 2 + .../include/asm/arch-rockchip/cru_rk3308.h | 1 + .../include/asm/arch-rockchip/cru_rk3328.h | 2 + .../include/asm/arch-rockchip/cru_rk3368.h | 2 + .../include/asm/arch-rockchip/cru_rk3399.h | 3 + .../include/asm/arch-rockchip/cru_rk3506.h | 1 + .../include/asm/arch-rockchip/cru_rk3568.h | 4 +- .../include/asm/arch-rockchip/cru_rk3576.h | 2 +- .../include/asm/arch-rockchip/cru_rk3588.h | 4 +- .../include/asm/arch-rockchip/cru_rv1108.h | 2 + .../include/asm/arch-rockchip/cru_rv1126.h | 2 + arch/arm/mach-rockchip/cpu-info.c | 50 +++------ arch/arm/mach-rockchip/rk3506/Makefile | 1 - arch/arm/mach-rockchip/rk3506/clk_rk3506.c | 10 -- arch/arm/mach-rockchip/rk3528/Makefile | 1 - arch/arm/mach-rockchip/rk3528/clk_rk3528.c | 10 -- arch/arm/mach-rockchip/rk3568/Makefile | 1 - arch/arm/mach-rockchip/rk3568/clk_rk3568.c | 12 -- arch/arm/mach-rockchip/rk3576/Makefile | 1 - arch/arm/mach-rockchip/rk3576/clk_rk3576.c | 12 -- arch/arm/mach-rockchip/rk3588/Makefile | 1 - arch/arm/mach-rockchip/rk3588/clk_rk3588.c | 12 -- board/firefly/roc-pc-rk3399/roc-pc-rk3399.c | 7 +- drivers/clk/rockchip/clk_px30.c | 18 +-- drivers/clk/rockchip/clk_rk3036.c | 18 +-- drivers/clk/rockchip/clk_rk3066.c | 17 +-- drivers/clk/rockchip/clk_rk3128.c | 18 +-- drivers/clk/rockchip/clk_rk3188.c | 17 +-- drivers/clk/rockchip/clk_rk322x.c | 18 +-- drivers/clk/rockchip/clk_rk3288.c | 18 +-- drivers/clk/rockchip/clk_rk3308.c | 18 +-- drivers/clk/rockchip/clk_rk3328.c | 18 +-- drivers/clk/rockchip/clk_rk3368.c | 18 +-- drivers/clk/rockchip/clk_rk3399.c | 18 +-- drivers/clk/rockchip/clk_rk3506.c | 14 +-- drivers/clk/rockchip/clk_rk3528.c | 18 +-- drivers/clk/rockchip/clk_rk3568.c | 18 +-- drivers/clk/rockchip/clk_rk3576.c | 18 +-- drivers/clk/rockchip/clk_rk3588.c | 18 +-- drivers/clk/rockchip/clk_rv1108.c | 18 +-- drivers/clk/rockchip/clk_rv1126.c | 18 +-- drivers/sysreset/sysreset_rockchip.c | 104 ++++++++++++++++-- 50 files changed, 244 insertions(+), 371 deletions(-) delete mode 100644 arch/arm/mach-rockchip/rk3506/clk_rk3506.c delete mode 100644 arch/arm/mach-rockchip/rk3528/clk_rk3528.c delete mode 100644 arch/arm/mach-rockchip/rk3568/clk_rk3568.c delete mode 100644 arch/arm/mach-rockchip/rk3576/clk_rk3576.c delete mode 100644 arch/arm/mach-rockchip/rk3588/clk_rk3588.c -- 2.54.0
