summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Schulz <[email protected]>2024-03-11 13:01:45 +0100
committerKever Yang <[email protected]>2024-03-13 18:14:19 +0800
commit7400ed6a1fb81a212aa7144f5caf461d7033ffbd (patch)
treefa003b6c15feb997db4416ae48f3a7bd72f65784
parent2871dee83336cdafc38140dc6edd517eb5cac4b7 (diff)
rockchip: add weak function symbol called at the beginning of misc_init_r
Most Rockchip boards who override misc_init_r do it only to call another function and keep the rest unchanged. Therefore to allow for less duplication, let's just add a weak function symbol that is called inside misc_init_r. Cc: Quentin Schulz <[email protected]> Reviewed-by: Kever Yang <[email protected]> Reviewed-by: Dragan Simic <[email protected]> Signed-off-by: Quentin Schulz <[email protected]>
-rw-r--r--arch/arm/mach-rockchip/board.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/arm/mach-rockchip/board.c b/arch/arm/mach-rockchip/board.c
index 2620530e03f..d5cb59c10fa 100644
--- a/arch/arm/mach-rockchip/board.c
+++ b/arch/arm/mach-rockchip/board.c
@@ -297,6 +297,11 @@ int fastboot_set_reboot_flag(enum fastboot_reboot_reason reason)
#endif
#ifdef CONFIG_MISC_INIT_R
+__weak int rockchip_early_misc_init_r(void)
+{
+ return 0;
+}
+
__weak int misc_init_r(void)
{
const u32 cpuid_offset = CFG_CPUID_OFFSET;
@@ -304,6 +309,10 @@ __weak int misc_init_r(void)
u8 cpuid[cpuid_length];
int ret;
+ ret = rockchip_early_misc_init_r();
+ if (ret)
+ return ret;
+
ret = rockchip_cpuid_from_efuse(cpuid_offset, cpuid_length, cpuid);
if (ret)
return ret;