[U-Boot] [PATCH v3 9/9] arm: dts: sunxi: Enumerate MMC2 as MMC1

Jagan Teki
2019-01-21T15:46:00Z

On Mon, Jan 21, 2019 at 9:08 PM Vasily Khoruzhick <anarsoul@gmail.com> wrote:
>
> On Mon, Jan 21, 2019 at 2:32 AM Jagan Teki <jagan@amarulasolutions.com> wrote:
> >
> > Environment and fastboot MMC devices are configured based number
> > of mmc slots defined on particular board in sunxi platform.
> >
> > If number of slots are not more than 1, it assigns 0 which usually mmc
> > device on SD slot. With DM_MMC it is detected as 0 since mmc0 node always
> > be an mmc device.
> >
> > If number of slots are more than 1, it assigns 1 which assumes 0 is mmc
> > device and 1 is emmc device. But with DM_MMC there is chance of detecting
> > emmc as device 2 since mmc1 is SDIO as per devicetree definition.
> >
> > So override mmc2 to mmc1 in sunxi dtsi, this will eventually detect mmc2
> > as mmc 1 device even if the board dts has mmc0, mmc1, mmc2.
>
> It doesn't work on Pinebook - where we have mmc0 (SD card), mmc1
> (SDIO), mmc2 (eMMC). It still enumerates mmc2 as mmc2.

BPI-M64 has same, here is log

U-Boot 2019.01-00171-g1fa1610a2a-dirty (Jan 21 2019 - 21:12:21 +0530)
Allwinner Technology

CPU: Allwinner A64 (SUN50I)
Model: BananaPi-M64
DRAM: 2 GiB
MMC: Device 'mmc at 1c11000': seq 1 is in use by 'mmc at 1c10000'
mmc at 1c0f000: 0, mmc at 1c10000: 2, mmc at 1c11000: 1
Loading Environment from FAT... OK
In: serial
Out: serial
Err: serial
Allwinner mUSB OTG (Peripheral)
Net: phy interface7
eth0: ethernet at 1c30000, eth1: usb_ether
starting USB...
USB0: USB EHCI 1.00
USB1: USB OHCI 1.0
USB2: USB EHCI 1.00
USB3: USB OHCI 1.0
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 1 for devices... 1 USB Device(s) found
scanning bus 2 for devices... 2 USB Device(s) found
scanning bus 3 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot: 0
=>
=>
=> mmc list
mmc at 1c0f000: 0
mmc at 1c10000: 2
mmc at 1c11000: 1 (eMMC)
=> mmc dev 0
switch to partitions #0, OK
mmc0 is current device
=> mmc list
mmc at 1c0f000: 0 (SD)
mmc at 1c10000: 2
mmc at 1c11000: 1 (eMMC)