arm: mach-snapdragon: misc: Initialize eMMC if necessary
authorStephan Gerhold <stephan@gerhold.net>
Tue, 3 Aug 2021 10:12:37 +0000 (12:12 +0200)
committerTom Rini <trini@konsulko.com>
Thu, 2 Sep 2021 13:48:20 +0000 (09:48 -0400)
commit1eb006249e2fe84e889a89154d71a9cb0093eed8
treec2e5bd81d482586cb0ddf7afdbb0d6ec61a3b1b4
parentcd82f199852d88218e1f17f5ec07cdd9112a89c4
arm: mach-snapdragon: misc: Initialize eMMC if necessary

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>
arch/arm/mach-snapdragon/misc.c