From patchwork Wed Feb 21 10:37:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 1902043 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) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Tft8D4wrQz23d2 for ; Wed, 21 Feb 2024 21:40:12 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8AD508807E; Wed, 21 Feb 2024 11:38:48 +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 13DEC86EEC; Wed, 21 Feb 2024 11:38:17 +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,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from smtp-8fa9.mail.infomaniak.ch (smtp-8fa9.mail.infomaniak.ch [IPv6:2001:1600:7:10::8fa9]) (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 97AA388030 for ; Wed, 21 Feb 2024 11:37:55 +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-0000.mail.infomaniak.ch (smtp-4-0000.mail.infomaniak.ch [10.7.10.107]) by smtp-4-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4Tft5b1sV6zGPr; Wed, 21 Feb 2024 11:37:55 +0100 (CET) Received: from unknown by smtp-4-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4Tft5Y6PvvzX3Z; Wed, 21 Feb 2024 11:37:53 +0100 (CET) From: Quentin Schulz Date: Wed, 21 Feb 2024 11:37:32 +0100 Subject: [PATCH v3 05/20] rockchip: pine64: pinephone-pro: migrate to rockchip_early_misc_init_r MIME-Version: 1.0 Message-Id: <20240221-jaguar-v3-5-1f256a82201b@theobroma-systems.com> References: <20240221-jaguar-v3-0-1f256a82201b@theobroma-systems.com> In-Reply-To: <20240221-jaguar-v3-0-1f256a82201b@theobroma-systems.com> 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: Dragan Simic , u-boot@lists.denx.de, Quentin Schulz , Quentin Schulz X-Mailer: b4 0.13.0 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 Compared to the original misc_init_r from Rockchip mach code, setup_iodomain() is added and rockchip_setup_macaddr() is not called. It is assumed adding rockchip_setup_macaddr() back is fine. Let's use rockchip_early_misc_init_r instead of reimplementing the whole misc_init_r from Rockchip (the side effect being that rockchip_setup_macaddr() is back). Cc: Quentin Schulz Reviewed-by: Kever Yang Reviewed-by: Dragan Simic Reviewed-by: Peter Robinson Signed-off-by: Quentin Schulz --- .../pine64/pinephone-pro-rk3399/pinephone-pro-rk3399.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/board/pine64/pinephone-pro-rk3399/pinephone-pro-rk3399.c b/board/pine64/pinephone-pro-rk3399/pinephone-pro-rk3399.c index b6ccbb9c1c4..de75ee329d8 100644 --- a/board/pine64/pinephone-pro-rk3399/pinephone-pro-rk3399.c +++ b/board/pine64/pinephone-pro-rk3399/pinephone-pro-rk3399.c @@ -12,7 +12,6 @@ #include #include #include -#include #include #define GRF_IO_VSEL_BT565_GPIO2AB 1 @@ -56,23 +55,11 @@ static void setup_iodomain(void) rk_setreg(&pmugrf->soc_con0, 1 << PMUGRF_CON0_VSEL_SHIFT); } -int misc_init_r(void) +int rockchip_early_misc_init_r(void) { - const u32 cpuid_offset = 0x7; - const u32 cpuid_length = 0x10; - u8 cpuid[cpuid_length]; - int ret; - setup_iodomain(); - ret = rockchip_cpuid_from_efuse(cpuid_offset, cpuid_length, cpuid); - if (ret) - return ret; - - ret = rockchip_cpuid_set(cpuid, cpuid_length); - if (ret) - return ret; + return 0; - return ret; } #endif