From: "Pali Rohár" <pali@kernel.org>
To: Tony Dinh <mibodhi@gmail.com>
Cc: u-boot@lists.denx.de
Subject: [PATCH u-boot-mvebu] arm: mvebu: Cleanup get_boot_device() code
Date: Sat, 4 Mar 2023 11:41:02 +0100 [thread overview]
Message-ID: <20230304104102.19055-1-pali@kernel.org> (raw)
Show correct information in debug() output and use correct names for variables.
No functional change.
Signed-off-by: Pali Rohár <pali@kernel.org>
---
arch/arm/mach-mvebu/cpu.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-mvebu/cpu.c b/arch/arm/mach-mvebu/cpu.c
index 97154aaa2a7e..018a3614d4dd 100644
--- a/arch/arm/mach-mvebu/cpu.c
+++ b/arch/arm/mach-mvebu/cpu.c
@@ -67,6 +67,8 @@ u32 get_boot_device(void)
{
u32 val;
u32 boot_device;
+ u32 boot_err_mode;
+ u32 boot_err_code;
/*
* First check, if UART boot-mode is active. This can only
@@ -74,9 +76,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 +86,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
next reply other threads:[~2023-03-04 10:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-04 10:41 Pali Rohár [this message]
2023-03-24 10:24 ` [PATCH u-boot-mvebu] arm: mvebu: Cleanup get_boot_device() code Stefan Roese
2023-03-25 12:27 ` Pali Rohár
2023-03-27 6:59 ` Stefan Roese
2023-03-27 21:11 ` [PATCH v2 " Pali Rohár
2023-03-30 4:59 ` Stefan Roese
2023-03-30 8:26 ` Stefan Roese
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230304104102.19055-1-pali@kernel.org \
--to=pali@kernel.org \
--cc=mibodhi@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.