All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] arm: mach-snapdragon: misc: Initialize eMMC if necessary
@ 2021-08-03 10:12 Stephan Gerhold
  2021-08-03 10:12 ` [PATCH v2 2/2] arm: mach-snapdrgon: misc: Simplify msm_generate_mac_addr() Stephan Gerhold
  2021-09-02 22:41 ` [PATCH v2 1/2] arm: mach-snapdragon: misc: Initialize eMMC if necessary Tom Rini
  0 siblings, 2 replies; 5+ messages in thread
From: Stephan Gerhold @ 2021-08-03 10:12 UTC (permalink / raw)
  To: u-boot; +Cc: Stephan Gerhold, Ramon Fried, Tom Rini

At the moment U-Boot produces an empty MAC address (02:00:00:00:00:00)
if the eMMC is not used by anything in U-Boot (e.g. with
CONFIG_ENV_IS_NOWHERE=y instead of having the environment on eMMC).
This happens because then there is nothing that actually initializes
the eMMC and reads the "cid" that is later accessed.

To fix this, call mmc_init() to ensure the eMMC is initialized.
There is no functional difference if the eMMC is already initialized
since then mmc_init() will just return without doing anything.

Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---

(no changes since v1)

 arch/arm/mach-snapdragon/misc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/mach-snapdragon/misc.c b/arch/arm/mach-snapdragon/misc.c
index 985625a548..fbd5f4d051 100644
--- a/arch/arm/mach-snapdragon/misc.c
+++ b/arch/arm/mach-snapdragon/misc.c
@@ -33,6 +33,9 @@ u32 msm_board_serial(void)
 	if (!mmc_dev)
 		return 0;
 
+	if (mmc_init(mmc_dev))
+		return 0;
+
 	return UNSTUFF_BITS(mmc_dev->cid, 16, 32);
 }
 
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-09-02 22:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-03 10:12 [PATCH v2 1/2] arm: mach-snapdragon: misc: Initialize eMMC if necessary Stephan Gerhold
2021-08-03 10:12 ` [PATCH v2 2/2] arm: mach-snapdrgon: misc: Simplify msm_generate_mac_addr() Stephan Gerhold
2021-08-03 13:10   ` Ramon Fried
2021-09-02 22:41   ` Tom Rini
2021-09-02 22:41 ` [PATCH v2 1/2] arm: mach-snapdragon: misc: Initialize eMMC if necessary Tom Rini

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.