public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/6] SPL: Port SPL framework to powerpc
Date: Fri, 24 Aug 2012 16:11:07 +0200	[thread overview]
Message-ID: <50378B7B.2060108@denx.de> (raw)
In-Reply-To: <CACUy__WzuW_RzdKJc6q8v9pbx93r+My4DoiXYw3-W--40Ys-aw@mail.gmail.com>

Hi Daniel,

On 08/24/2012 01:49 PM, Daniel Schwierzeck wrote:
>>> I still would like to move to my suggestion to not copy the header and
>>> use the mkimage header values ih_load and ih_ep directly. Right now I
>>> don't see any showstopper for doing it this way. I'll send a patch to
>>> change this shortly (if everything works out).
>>
>> Hmmm. As it seems some SPL loading drivers (block like mmc, streaming
>> like ymodem) are not that easily converted to skipping the header. So
>> I'm not so sure if we should go this way after all...
>>
>> Comments?
> 
> I did similar work for my upcoming Lantiq MIPS SoC port. In my
> approach I also support compressed u-boot
> images as payload (LZO, LZMA).

Yes, I thought about adding this as well. Nice.

> The u-boot image is merged with SPL
> image without any padding or
> fixed flash offsets to achieve a maximum reduction of flash footprint.

Interesting. I'm still padding to the fixed offset. Let me look into
squeezing those two images together as well...

> I ended up with doing something like this:
> 
> static int spl_parse_image(const image_header_t *hdr, struct spl_image *spl)
> {
>        u32 magic;
> 
>        magic = image_get_magic(hdr);
>        if (magic != IH_MAGIC)
>                return -1;
> 
>        spl->data_addr += image_get_header_size();
>        spl->entry_addr = image_get_load(hdr);
>        spl->size = image_get_data_size(hdr);
>        spl->comp = image_get_comp(hdr);
> 
>        if (spl->comp == IH_COMP_NONE)
>                spl->load_addr = spl->entry_addr;
>        else
>                spl->load_addr = CONFIG_LOADADDR;
> 
>        return 0;
> }

So you introduced a new "struct spl_image" and did not use "struct
spl_image_info" from the SPL framework? Why is that? We should
definitely consolidate to one structure here.

> spl->data_addr points to the image header of the payload and is
> initialized by the caller
> dependent on the used load mechanism.

Good idea. Looks like your spl_parse_image might be a potential
replacement for spl_parse_image_header() from this common SPL framework.

> If the payload is uncompressed
> it can be directly copied to
> its final RAM location. A compressed payload needs an intermediate
> copy step if it is stored in SPI or NAND flash.
> I chose CONFIG_LOADADDR. After this the decompression function
> extracts the image to its final RAM location.

Sounds good. Do you have some patches that you could send for review?
Did you try to keep as much platform/arch independent as possible?

> I think we should keep an architecture-neutral SPL image context
> inside the generic SPL framework.
> The content of this context should be filled by architecture/SoC/board
> specific code.

Ack. It would be great to review your code here. Please keep us informed.

Thanks,
Stefan

  reply	other threads:[~2012-08-24 14:11 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-23  8:12 [U-Boot] [PATCH 0/6] SPL: Port SPL framework to powerpc Stefan Roese
2012-08-23  8:12 ` [U-Boot] [PATCH 1/6] SPL: Add NOR flash booting support Stefan Roese
2012-08-23 15:07   ` Tom Rini
2012-08-23 15:19     ` Stefan Roese
2012-08-23  8:12 ` [U-Boot] [PATCH 2/6] powerpc: Extract EPAPR_MAGIC constants into processor.h Stefan Roese
2012-08-23  8:12 ` [U-Boot] [PATCH 3/6] SPL: Port SPL framework to powerpc Stefan Roese
2012-08-23 17:10   ` Tom Rini
2012-08-23 18:16     ` Stefan Roese
2012-08-23 19:31       ` Tom Rini
2012-08-24  8:17         ` Stefan Roese
2012-08-24 10:17           ` Heiko Schocher
2012-08-24 10:56             ` Stefan Roese
2012-08-24 11:13               ` Stefan Roese
2012-08-24 11:49                 ` Daniel Schwierzeck
2012-08-24 14:11                   ` Stefan Roese [this message]
2012-08-24 15:29                     ` Daniel Schwierzeck
2012-08-24 16:06                     ` Stefan Roese
2012-08-24 16:42                       ` Daniel Schwierzeck
2012-08-24 17:24                         ` Stefan Roese
2012-08-24 22:13                           ` Daniel Schwierzeck
2012-08-24 19:15                 ` Tom Rini
2012-08-25  8:48                   ` Stefan Roese
2012-08-23 21:39   ` Tom Rini
2012-08-24  7:01     ` Stefan Roese
2012-08-24 15:55       ` Tom Rini
2012-08-24 16:07         ` Stefan Roese
2012-08-24 16:19           ` Tom Rini
2012-08-24 17:21             ` Stefan Roese
2012-08-23 21:52   ` Tom Rini
2012-08-24  7:03     ` Stefan Roese
2012-08-23  8:12 ` [U-Boot] [PATCH 4/6] env: Extract getenv_f() into separate source file Stefan Roese
2012-08-23  8:12 ` [U-Boot] [PATCH 5/6] mpc5200: Add SPL support Stefan Roese
2012-08-23  8:12 ` [U-Boot] [PATCH 6/6] mpc5200: Add a3m071 board support Stefan Roese
2012-08-23 21:53 ` [U-Boot] [PATCH 0/6] SPL: Port SPL framework to powerpc 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=50378B7B.2060108@denx.de \
    --to=sr@denx.de \
    --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