All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC PATCH 2/2] sunxi: add "fel" boot target
Date: Mon, 14 Sep 2015 13:42:21 +0200	[thread overview]
Message-ID: <55F6B29D.7000309@redhat.com> (raw)
In-Reply-To: <20150914133353.1e1658c4@i7>

Hi,

On 14-09-15 12:33, Siarhei Siamashka wrote:
> On Fri, 11 Sep 2015 11:31:50 +0200
> Bernhard Nortmann <bernhard.nortmann@web.de> wrote:
>
>> Hi!
>>
>> Am 10.09.2015 um 20:36 schrieb Hans de Goede:
>>> Hi,
>>>
>>> I would prefer to have this like this:
>>>
>>>      "bootcmd_fel=" \
>>>          "if test -n ${fel_booted} && test -n ${fel_data_addr}; then " \
>>>              "echo '(FEL boot)';" \
>>>              "source ${fel_data_addr}; " \
>>>          "fi\0"
>>>
>>
>> Sure, we could do that. I wanted to make clear that ${fel_booted} is
>> independent of a script being present (and thus ${fel_data_addr} set).
>> If the user feels inclined to do so, he might e.g. tweak bootcmd_fel
>> to override some defaults even with no boot.scr involved.
>>
>>> Also if we are not using fel_data_size, then why do we even
>>> have it ?
>>>
>>
>> I thought it unnecessary to restrict ourselves to not being able to
>> pass the size information, and kept it optional deliberately.
>>
>> Admittedly it's pointless in the "standard" case of boot.scr, as that
>> is expected to be an image with a well-defined header (including data
>> size). I could imagine other uses, e.g. a customized fel utility
>> passing uEnv.txt-style data, and integrating that via bootcmd_fel
>> "import -t ${fel_data_addr} ${fel_data_size}".
>
> We could probably have this data represented in the following way
> in the SPL header:
>
> 	union {
> 		struct {
> 			uint32_t fel_boot_script_address;
> 			uint32_t must_be_zero;
> 		};
> 		struct {
> 			uint32_t fel_uenv_txt_address;
> 			uint32_t fel_uenv_txt_size;
> 		};
> 	};
>
> So that if 'fel_uenv_txt_size' is non-zero, then we can do
> "import -t ${fel_uenv_txt_address} ${fel_uenv_txt_size}".
> And if it is zero, then treat this pointer as boot.scr data.
>
> And we don't even need to use the union if we don't want to. This all
> data could be also stored in a straightforward way (at the expense
> of using additional 4 bytes in the SPL header):
>
> 	uint32_t fel_boot_script_address;
> 	uint32_t fel_uenv_txt_address;
> 	uint32_t fel_uenv_txt_size;
>
> And because it takes more storage space, we would need to increase
> the SPL header size. But this can be easily done.
>
>> Personally I like to do this when testing; I find it easier to
>> simply edit a text file (without having to go through a mkimage
>> .scr on each cycle).
>
> Supporting both boot.scr and uEnv.txt for FEL boot seems to be
> reasonably simple to me. You can even do it in a single patch
> series. As Hans suggests, please take care of the boot.scr case
> first. Then maybe introduce uEnv.txt support with an additional
> patch.

I'm still not convinced that support uEnv.txt is necessary at all,
but I agree that if we this having this done through extra fields,
rather then through a union would be better.

Regards,

Hans

  reply	other threads:[~2015-09-14 11:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-03 14:11 [U-Boot] [RFC PATCH 0/2] sunxi: support FEL-provided environment vars and "fel" boot target Bernhard Nortmann
2015-09-03 14:11 ` [U-Boot] [RFC PATCH 1/2] sunxi: retrieve FEL-provided values to environment variables Bernhard Nortmann
2015-09-10 18:34   ` Hans de Goede
2015-09-11  9:08     ` Bernhard Nortmann
2015-09-12 11:58     ` Ian Campbell
2015-09-12 12:24       ` Hans de Goede
2015-09-14 13:12         ` Bernhard Nortmann
2015-09-03 14:12 ` [U-Boot] [RFC PATCH 2/2] sunxi: add "fel" boot target Bernhard Nortmann
2015-09-10 18:36   ` Hans de Goede
2015-09-11  9:31     ` Bernhard Nortmann
2015-09-12 12:48       ` Hans de Goede
2015-09-13  7:15         ` Ian Campbell
2015-09-14 10:33       ` Siarhei Siamashka
2015-09-14 11:42         ` Hans de Goede [this message]
2015-09-14 11:46           ` Hans de Goede
2015-09-26 21:03             ` Siarhei Siamashka

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=55F6B29D.7000309@redhat.com \
    --to=hdegoede@redhat.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.