From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] Falcon boot breaks on DRA7 because of commit b9c8ccab "env_mmc.c: Allow environment to be used within SPL"
Date: Thu, 26 Jan 2017 18:36:55 -0500 [thread overview]
Message-ID: <20170126233655.GH22316@bill-the-cat> (raw)
In-Reply-To: <c5ccc2a4-a23f-4f19-b77b-8fa4f4ef5b25@ti.com>
On Wed, Jan 25, 2017 at 11:21:32AM +0100, Jean-Jacques Hiblot wrote:
>
>
> On 24/01/2017 20:11, Tom Rini wrote:
> >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!
> I did more tests and it turns out that there I find no real benefit
> of registering only the controller for the boot device.
> The initialization of the MMC/SD/eMMC is done only prior accessing
> it, not when it's registered. So in terms of boot time the impact of
> registering many controllers is not significant.
> By registering the same controllers in SPL and in u-boot, we would
> get the same mapping for the MMC devices in SPL and u-boot. It would
> remove a source of confusion and of #ifdef CONFIG_SPL_BUILD
>
> The catch is that many boards register only one MMC controller in
> the SPL, depending on what the boot source is (ex: board_mmc_init()
> in board/freescale/mx6slevk/mx6slevk.c)
> To reduce the risk of regression, we could deal with those boards in
> 2 steps:
> 1) Don't change the code of the board except to override the weak
> function mmc_get_env_dev() and make it return 0. This is not likely
> to introduce a regression
> 2) One by one, change the code of the boards to register all the
> controllers in SPL as done in u-boot. Also we need to adapt
> spl_boot_device() to return the right boot device. There has been a
> partial attempt at this ""ARM: mx6: add MMC2 boot device detection
> support in SPL" but had to be reverted probably because it was not
> coherent with the registration of the controllers.
Due to the issue you mention in #2, we probably need to do #1 and with
care and testing, as there's enough places that assume SPL is a single
MMC device that it'll be problematic to do them one at a time.
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170126/2f61773d/attachment.sig>
next prev parent reply other threads:[~2017-01-26 23:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-24 9:26 [U-Boot] Falcon boot breaks on DRA7 because of commit b9c8ccab "env_mmc.c: Allow environment to be used within SPL" Jean-Jacques Hiblot
2017-01-24 15:17 ` Tom Rini
2017-01-24 15:35 ` Jean-Jacques Hiblot
2017-01-24 15:46 ` Tom Rini
2017-01-24 17:04 ` Jean-Jacques Hiblot
2017-01-24 19:11 ` Tom Rini
2017-01-25 10:21 ` Jean-Jacques Hiblot
2017-01-26 23:36 ` Tom Rini [this message]
2017-01-30 12:44 ` Jean-Jacques Hiblot
2017-01-30 22:44 ` Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170126233655.GH22316@bill-the-cat \
--to=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.