From patchwork Tue Jan 23 14:49:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 1889719 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TK9555l9Gz23f0 for ; Wed, 24 Jan 2024 01:51:05 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C691687D90; Tue, 23 Jan 2024 15:50:05 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=0leil.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 01C3287D43; Tue, 23 Jan 2024 15:49:59 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from smtp-190e.mail.infomaniak.ch (smtp-190e.mail.infomaniak.ch [185.125.25.14]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id CFC1087D3C for ; Tue, 23 Jan 2024 15:49:56 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=0leil.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=foss+uboot@0leil.net Received: from smtp-4-0001.mail.infomaniak.ch (unknown [10.7.10.108]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4TK93j5vXxzMs77L; Tue, 23 Jan 2024 15:49:53 +0100 (CET) Received: from unknown by smtp-4-0001.mail.infomaniak.ch (Postfix) with ESMTPA id 4TK93h4fWmzVJH; Tue, 23 Jan 2024 15:49:52 +0100 (CET) From: Quentin Schulz To: Simon Glass , Philipp Tomsich , Kever Yang , Tom Rini , Alper Nebi Yasak , Peter Robinson , Jagan Teki , Klaus Goger , Heiko Stuebner , Otavio Salvador , Andy Yan , Manivannan Sadhasivam , Lukasz Majewski , Sean Anderson , Joe Hershberger , Ramon Fried , Sughosh Ganu , Heinrich Schuchardt , Anatolij Gustschin Cc: heiko@sntech.de, Quentin Schulz , u-boot@lists.denx.de, Quentin Schulz Subject: [PATCH 04/18] rockchip: add weak function symbol called at the beginning of misc_init_r Date: Tue, 23 Jan 2024 15:49:12 +0100 Message-ID: <20240123-jaguar-v1-4-1eec1c34953c@theobroma-systems.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240123-jaguar-v1-0-1eec1c34953c@theobroma-systems.com> References: <20240123-jaguar-v1-0-1eec1c34953c@theobroma-systems.com> MIME-Version: 1.0 X-Mailer: b4 0.12.4 X-Infomaniak-Routing: alpha X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean From: Quentin Schulz 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 Signed-off-by: Quentin Schulz Reviewed-by: Kever Yang Reviewed-by: Dragan Simic --- arch/arm/mach-rockchip/board.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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;