[U-Boot] [PATCH v3 27/58] fastboot: sunxi: Update fastboot mmc default device

Olliver Schinagl oliver at schinagl.nl
Wed Aug 22 18:56:50 UTC 2018


On 21-08-18 18:57, Jagan Teki wrote:
> On Mon, Aug 20, 2018 at 5:14 PM, Maxime Ripard
> <maxime.ripard at bootlin.com> wrote:
>> On Sun, Aug 19, 2018 at 07:26:44PM +0530, Jagan Teki wrote:
>>> Usually eMMC is default mmc device for fastboot.
>>>
>>> By enabling DM_MMC, the mmc devices are probed as per
>>> DT status not with respect to MMC_SUNXI_SLOT_EXTRA in
>>> U-Boot proper.
>>>
>>> Allwinner SoC has maximum of 4 mmc controllers start from
>>> mmc0...mmc3 on which mmc2 can be used an eMMC controller
>>> eventhough mmc3 some boards used as eMMC.
>>>
>>> So, update the default fastboot device as 2 to make the
>>> standard usage irrespective of DT node status.
>>>
>>> Other corner cases like different device usage, or specific
>>> mmc node status is not enabled in order in DTS must explicitly
>>> add config on the specific defconfig file.
>>>
>>> Cc: Olliver Schinagl <oliver at schinagl.nl>
>>> Cc: Chen-Yu Tsai <wens at csie.org>
>>> Signed-off-by: Jagan Teki <jagan at amarulasolutions.com>
>> This breaks all existing users, since if DM_MMC isn't set (and it
>> isn't at the moment), the MMC IDs won't change, and you're changing it
>> from either 0 or 1 to 2.
> True, bisectable issue. will take care on next version.
>
>> Can't we have a DT property instead? It looks much better than having
>> to deal with a non stable ID in Kconfig.
> What do you mean by DT property handle? mmc2 is eMMC in all sunXi
> isn't? ie reason I make it default.
That's absurdly naive :)

eMMC is whatever the board designer decides to hook it up to (and one
can even argue that there could be vendor trees that also have strange
designs)

While from a 'hacker' standpoint mmc0 SD, mmc2 eMMC makes tons of sense,
as those are the allwinner default bootable mmc interfaces, a proper
product may opt to put eMMC on mmc0 for 'security reasons'. E.g. secure
boot and what not. (Lets not get into discussions about how to secure
our platform or how secure it really is)

Further more, a designed board may use an SPI to boot, and end up with
eMMC on mmc3 due to the fact all other pins are in use.

Making this assumption that mmc2 is always eMMC (if mmc is used) is very
naive in my opinion and may bite us in the ass eventually.

Having a default, and letting it be overridable, is not a big issue of
course :)

Olliver


More information about the U-Boot mailing list