From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EA8BDC6FD1D for ; Mon, 27 Mar 2023 21:12:21 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7E946857BD; Mon, 27 Mar 2023 23:12:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="tiCBXWe0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 71CDE80A45; Mon, 27 Mar 2023 23:12:17 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B1AC3857C5 for ; Mon, 27 Mar 2023 23:12:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0944261502; Mon, 27 Mar 2023 21:12:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C63DC433EF; Mon, 27 Mar 2023 21:12:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679951532; bh=7PLaJGyLIVCu9DTF/2uUP9mpJ6dyg7VHTyp4rqSXYA4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tiCBXWe0AV5lS9qBIFZ6nP1lojx9QQNl7ZjxQ/AGWUlCLFwPdktvGedrKSk77h5Iy hjzrVnTZL7y/KbeBIH5NHYwSM6YpasDPE6/vnD/AS6nIA3b8/mIZovQuSHhT4o5p7i hHTfgZ7UjD96K6Pu93fQ3oYpUqJpdyuQZelHtlYDIV/AMxE3GX/bQCR5dzPitT8W33 UZ6UktUm3K0omsl/DoceavhQmIKJN+c9Muewc9kHKa1NmAb8Vzq/hKDQEv+xBQY9UI UPzqNhg1pYL0HX82VQ80oNzbcjHiKY+a7TMSu3IQQVsrZmmUzJIuLaZrKjKY+5KWHK o+p+G4a/ddqgQ== Received: by pali.im (Postfix) id 299C3555; Mon, 27 Mar 2023 23:12:09 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Stefan Roese Cc: u-boot@lists.denx.de Subject: [PATCH v2 u-boot-mvebu] arm: mvebu: Cleanup get_boot_device() code Date: Mon, 27 Mar 2023 23:11:50 +0200 Message-Id: <20230327211150.11305-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230304104102.19055-1-pali@kernel.org> References: <20230304104102.19055-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Show correct information in debug() output and use correct names for variables. No functional change. Signed-off-by: Pali Rohár --- arch/arm/mach-mvebu/cpu.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-mvebu/cpu.c b/arch/arm/mach-mvebu/cpu.c index 56999f608a38..8b91e174c4c1 100644 --- a/arch/arm/mach-mvebu/cpu.c +++ b/arch/arm/mach-mvebu/cpu.c @@ -67,6 +67,10 @@ u32 get_boot_device(void) { u32 val; u32 boot_device; + u32 boot_err_mode; +#ifdef CONFIG_ARMADA_38X + u32 boot_err_code; +#endif /* * First check, if UART boot-mode is active. This can only @@ -74,9 +78,9 @@ u32 get_boot_device(void) * MSB marks if the UART mode is active. */ val = readl(BOOTROM_ERR_REG); - boot_device = (val & BOOTROM_ERR_MODE_MASK) >> BOOTROM_ERR_MODE_OFFS; - debug("BOOTROM_REG=0x%08x boot_device=0x%x\n", val, boot_device); - if (boot_device == BOOTROM_ERR_MODE_UART) + boot_err_mode = (val & BOOTROM_ERR_MODE_MASK) >> BOOTROM_ERR_MODE_OFFS; + debug("BOOTROM_ERR_REG=0x%08x boot_err_mode=0x%x\n", val, boot_err_mode); + if (boot_err_mode == BOOTROM_ERR_MODE_UART) return BOOT_DEVICE_UART; #ifdef CONFIG_ARMADA_38X @@ -84,8 +88,9 @@ u32 get_boot_device(void) * If the bootrom error code contains any other than zeros it's an * error condition and the bootROM has fallen back to UART boot */ - boot_device = (val & BOOTROM_ERR_CODE_MASK) >> BOOTROM_ERR_CODE_OFFS; - if (boot_device) + boot_err_code = (val & BOOTROM_ERR_CODE_MASK) >> BOOTROM_ERR_CODE_OFFS; + debug("boot_err_code=0x%x\n", boot_err_code); + if (boot_err_code) return BOOT_DEVICE_UART; #endif -- 2.20.1