From: Guillaume Gardet <guillaume.gardet@free.fr>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] spl: if MMCSD_MODE_RAW fails, try MMCSD_MODE_FS, if available
Date: Thu, 18 Feb 2016 17:42:29 +0100 [thread overview]
Message-ID: <56C5F475.7070707@free.fr> (raw)
In-Reply-To: <20160218163834.GA25819@skynet>
Le 18/02/2016 17:38, Nikita Kiryanov a ?crit :
> On Thu, Feb 18, 2016 at 05:11:46PM +0100, Guillaume Gardet wrote:
>>
>> Le 18/02/2016 17:07, Nikita Kiryanov a ?crit :
>>> On Thu, Feb 18, 2016 at 09:36:01AM -0500, Tom Rini wrote:
>>>> On Thu, Feb 18, 2016 at 04:25:29PM +0200, Nikita Kiryanov wrote:
>>>>> On Thu, Feb 18, 2016 at 02:31:08PM +0100, Guillaume Gardet wrote:
>>>>>> Le 18/02/2016 14:07, Nikita Kiryanov a ?crit :
>>>>>>> On Thu, Feb 18, 2016 at 11:06:32AM +0100, Guillaume Gardet wrote:
>>>>>>>> Hi Tom, Nikita ,
>>>>>>>>
>>>>>>>> Le 18/02/2016 10:19, Nikita Kiryanov a ?crit :
>>>>>>>>> Hi Tom, Guillaume,
>>>>>>>>>
>>>>>>>>> On Wed, Feb 17, 2016 at 03:27:22PM -0500, Tom Rini wrote:
>>>>>>>>>> On Wed, Feb 17, 2016 at 09:09:27AM +0100, Guillaume GARDET wrote:
>>>>>>>>>>
>>>>>>>>>>> Since commit fd61d39970b9901217efc7536d9f3a61b4e1752a:
>>>>>>>>>>> spl: mmc: add break statements in spl_mmc_load_image()
>>>>>>>>>>> RAW and FS boot modes are now exclusive again. So, if MMCSD_MODE_RAW fails, the
>>>>>>>>>>> board hangs. This patch allows to try MMCSD_MODE_FS then, if available.
>>>>>>>>>>>
>>>>>>>>>>> It has been tested on a beaglebone black to boot on an EXT partition.
>>>>>>>>>>>
>>>>>>>>>>> Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
>>>>>>>>>>> Cc: Tom Rini <trini@konsulko.com>
>>>>>>>>>>> Cc: Nikita Kiryanov <nikita@compulab.co.il>
>>>>>>>>>>> Cc: Igor Grinberg <grinberg@compulab.co.il>
>>>>>>>>>>> Cc: Paul Kocialkowski <contact@paulk.fr>
>>>>>>>>>>> Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
>>>>>>>>>>> Cc: Simon Glass <sjg@chromium.org>
>>>>>>>>>>> Cc: Matwey V. Kornilov <matwey.kornilov@gmail.com>
>>>>>>>>>>>
>>>>>>>>>>> ---
>>>>>>>>>>> common/spl/spl_mmc.c | 2 +-
>>>>>>>>>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>>>>>>>
>>>>>>>>>>> diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
>>>>>>>>>>> index c3931c6..2eef0f2 100644
>>>>>>>>>>> --- a/common/spl/spl_mmc.c
>>>>>>>>>>> +++ b/common/spl/spl_mmc.c
>>>>>>>>>>> @@ -284,7 +284,7 @@ int spl_mmc_load_image(u32 boot_device)
>>>>>>>>>>> if (!err)
>>>>>>>>>>> return err;
>>>>>>>>>>> #endif
>>>>>>>>>>> - break;
>>>>>>>>>>> + /* Fall through */
>>>>>>>>>>> case MMCSD_MODE_FS:
>>>>>>>>>>> debug("spl: mmc boot mode: fs\n");
>>>>>>>>>> This also essentially reverts fd61d399. So Nikita, was there a specific
>>>>>>>>>> use case that was broken before, or was the code just unclear in
>>>>>>>>>> intentions here? Thanks!
>>>>>>>>> There was no broken use case that I'm aware of. The change was made as
>>>>>>>>> part of a code improvement series and was meant to address what I
>>>>>>>>> consider to be bad and problematic design. Instead of reverting it
>>>>>>>>> though, how about implementing something similar to what I did in the
>>>>>>>>> main common/spl/spl.c:board_init_r()? You would have a weak function
>>>>>>>>> that will default to the original spl_boot_mode() if not overridden,
>>>>>>>>> and allow the user to define a sequence of boot modes otherwise.
>>>>>>>> The thing is you broke a wanted behavior currently in use. So, the priority is to come back to the previous behavior.
>>>>>>> Could you add a comment indicating that this is wanted behavior that
>>>>>>> has a user, and who the user is?
>>>>>> Not sure what you mean.
>>>>> I mean something like:
>>>>> /* If raw mode fails, try fs mode. Some boards, such as beaglebone black,
>>>>> * depend on this funcitonality.
>>>>> */
>>>> But it's not board specific, it's use-case specific.
>>> The comment I proposed does not suggest it's board specific, just that
>>> this specific use case is used by someone.
>>>
>>>> instead of shoving both SPL and U-Boot into the correct magic raw
>>>> location, just shove SPL there and let U-Boot itself be in the /boot
>>>> partition. This is just as applicable on say imx6 as it is on TI parts.
>>> I don't think that's clear enough that this is the purpose of the
>>> missing break statement. It's a little too implicit. What I'm suggesting
>>> is that we make it a bit more explicit, barring a rewrite.
>> So, maybe just:
>> /* If raw mode fails, try fs mode. */
>> ?
> That'll work too.
If Tom is ok, I will send a V2.
Guillaume
next prev parent reply other threads:[~2016-02-18 16:42 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-16 18:27 [U-Boot] Beaglebone Black broken since commit fd61d39970b9901217efc7536d9f3a61b4e1752a Guillaume Gardet
2016-02-17 8:09 ` [U-Boot] [PATCH] spl: if MMCSD_MODE_RAW fails, try MMCSD_MODE_FS, if available Guillaume GARDET
2016-02-17 20:27 ` Tom Rini
2016-02-18 9:19 ` Nikita Kiryanov
2016-02-18 10:06 ` Guillaume Gardet
2016-02-18 13:07 ` Nikita Kiryanov
2016-02-18 13:31 ` Guillaume Gardet
2016-02-18 14:25 ` Nikita Kiryanov
2016-02-18 14:36 ` Tom Rini
2016-02-18 16:07 ` Nikita Kiryanov
2016-02-18 16:11 ` Guillaume Gardet
2016-02-18 16:38 ` Nikita Kiryanov
2016-02-18 16:42 ` Guillaume Gardet [this message]
2016-02-18 17:04 ` Tom Rini
2016-02-18 17:17 ` [U-Boot] [PATCH V2] spl: if MMCSD_MODE_RAW fails, try MMCSD_MODE_FS Guillaume GARDET
2016-02-19 13:06 ` Nikita Kiryanov
2016-02-20 0:54 ` [U-Boot] [U-Boot, " Tom Rini
-- strict thread matches above, loose matches on Subject: below --
2014-11-18 9:44 [U-Boot] [PATCH] spl: if MMCSD_MODE_RAW fails, try MMCSD_MODE_FS, if available Guillaume GARDET
2014-12-02 8:35 ` Guillaume Gardet
2014-12-12 21:49 ` Robert Nelson
2014-12-15 8:43 ` Guillaume Gardet
2014-12-15 9:01 ` Guillaume Gardet
2014-12-16 11:03 ` Guillaume Gardet
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=56C5F475.7070707@free.fr \
--to=guillaume.gardet@free.fr \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox