From patchwork Tue Oct 29 12:08:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudius Heine X-Patchwork-Id: 1186077 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 472VkJ2tZWz9sPT for ; Tue, 29 Oct 2019 23:09:10 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id E785AC21DD3; Tue, 29 Oct 2019 12:09:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 7D6F5C21C27; Tue, 29 Oct 2019 12:09:03 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 0498DC21C27; Tue, 29 Oct 2019 12:09:02 +0000 (UTC) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by lists.denx.de (Postfix) with ESMTPS id AE2E3C21BE5 for ; Tue, 29 Oct 2019 12:09:02 +0000 (UTC) Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 472Vk63f3Mz1rHF5; Tue, 29 Oct 2019 13:09:02 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 472Vk63LQcz1qqkn; Tue, 29 Oct 2019 13:09:02 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id mL0qNtoCxc-H; Tue, 29 Oct 2019 13:09:01 +0100 (CET) X-Auth-Info: b3i9zx0m2yQuOCa9HK8P8RP56sodwHd6X4ZQRcVYWzo= Received: from mail-internal.denx.de (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Tue, 29 Oct 2019 13:09:01 +0100 (CET) Received: from pollux.denx.de (pollux [192.168.1.1]) by mail-internal.denx.de (Postfix) with ESMTP id 198F018095E; Tue, 29 Oct 2019 13:08:57 +0100 (CET) Received: by pollux.denx.de (Postfix, from userid 569) id 0146B1A009F; Tue, 29 Oct 2019 13:08:56 +0100 (CET) From: Claudius Heine To: Date: Tue, 29 Oct 2019 13:08:43 +0100 Message-Id: <20191029120847.3581884-1-ch@denx.de> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Cc: Albert Aribaud , open list , "NXP i.MX U-Boot Team" Subject: [U-Boot] [PATCH v3 RESEND 1/2] ARM: imx: Fix bmode detection from grp10 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" imx6_is_bmode_from_gpr9 always returns false, because IMX6_SRC_GPR10_BMODE is 1<<28 and gets casted to u8 on return. This moves the function body into imx6_src_get_boot_mode, since that is the only one using it and it is on the same abstraction level (accessing registers directly). Signed-off-by: Claudius Heine --- arch/arm/include/asm/mach-imx/sys_proto.h | 5 ----- arch/arm/mach-imx/init.c | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/arch/arm/include/asm/mach-imx/sys_proto.h b/arch/arm/include/asm/mach-imx/sys_proto.h index 4925dd7894..041f93f484 100644 --- a/arch/arm/include/asm/mach-imx/sys_proto.h +++ b/arch/arm/include/asm/mach-imx/sys_proto.h @@ -89,11 +89,6 @@ enum imx6_bmode { IMX6_BMODE_NAND_MAX = 0xf, }; -static inline u8 imx6_is_bmode_from_gpr9(void) -{ - return readl(&src_base->gpr10) & IMX6_SRC_GPR10_BMODE; -} - u32 imx6_src_get_boot_mode(void); void gpr_init(void); diff --git a/arch/arm/mach-imx/init.c b/arch/arm/mach-imx/init.c index b8d8d12372..d18e3c740a 100644 --- a/arch/arm/mach-imx/init.c +++ b/arch/arm/mach-imx/init.c @@ -118,7 +118,7 @@ void boot_mode_apply(unsigned cfg_val) #if defined(CONFIG_MX6) u32 imx6_src_get_boot_mode(void) { - if (imx6_is_bmode_from_gpr9()) + if (readl(&src_base->gpr10) & IMX6_SRC_GPR10_BMODE) return readl(&src_base->gpr9); else return readl(&src_base->sbmr1);