
On Tue, Jan 24, 2017 at 06:04:47PM +0100, Jean-Jacques Hiblot wrote:
On 24/01/2017 16:46, Tom Rini wrote:
I had noticed that it's quite old indeed. I didn't mean that it's a regression. I'm just puzzled by the commit. what is its purpose ? why is SPL not using CONFIG_SYS_MMC_ENV_DEV ?
Because in SPL we do not have both MMC devices initialized.
That is not always the case. Actually in spl_mmc.c the code requires us to register more than one MMC device to work properly when multiple MMC boot devices can be used (see spl_mmc_get_device_index()) I did the test of registering only MMC2 when booting from eMMC, the SPL fails because it can't find device 1: Trying to boot from MMC2_2 MMC Device 1 not found spl: could not find mmc device. error: -19
We register the one we booted from and thus it is device 0 to U-Boot in this case. I suspect the rest of the issues stem from this quirk, or something having broken around this quirk. Thanks!
Right. So I suspect the problem is that some level of the env_mmc.c code needs to be adapted again for the change in how SPL now works with the possibility of multiple devices. It's possible that the change you found is the right fix, please investigate a bit more and confirm things before submitting a proper patch, thanks!