public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: York Sun <yorksun@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/7] spl: pbl: Add new SPL image for pblimage tool
Date: Tue, 23 Sep 2014 03:40:17 +0000	[thread overview]
Message-ID: <D0463556.183B2%yorksun@freescale.com> (raw)
In-Reply-To: <fe25db28d60941ae9ed4d03a36ef71bd@BN1PR0301MB0689.namprd03.prod.outlook.com>

Alison,

On 9/22/14 7:43 PM, "Wang Huan-B18965" <alison.wang@freescale.com> wrote:

>Hi, York,
>
>> On 09/21/2014 11:17 PM, Wang Huan-B18965 wrote:
>> >
>> > [Alison Wang] Let me explain the sequence.
>> >
>> > 1. u-boot-spl.bin is produced. The size of it is not a fixed value.
>> >
>> > 2. u-boot-spl-pbl-pad.bin is produced. The size of it is defined by
>> > CONFIG_SPL_MAX_SIZE. For detail, u-boot-spl-pbl-pad.bin is generated
>> > by padding u-boot-spl.bin to the size of CONFIG_SPL_MAX_SIZE.
>> >
>> > The following is the reason for using u-boot-spl-pbl-pad.bin.
>> >
>> > First of all, the SPL part need to be reorganized for the recognition
>> > of PBL through the pblimage tool.
>> >
>> > For the pblimage tool, the SPL image is splitted into 64 byte chunks,
>> > and PBL needs a command for each piece. In current pblimage tool, the
>> > size of the SPL image(u-boot-spl.bin) should be a fixed value like
>> > PowerPC. Well, for LS102xA and some other ARM platforms, the size of
>> > the SPL image (u-boot-spl.bin) is changeable. So a new image
>> > spl/u-boot-spl-pbl-pad.bin is produced, and the size of it is a fixed
>> > value "CONFIG_SPL_MAX_SIZE". Then use u-boot-spl-pbl-pad.bin instead
>> > of spl/u-boot-spl.bin to generate spl/u-boot-spl.pbl.
>> >
>> > 3. spl/u-boot-spl.pbl is produced through pblimage tool. As
>> > CONFIG_SPL_PBL_PAD is enabled, spl/u-boot-spl-pbl-pad.bin is used as
>> > the source file instead of spl/u-boot-spl.bin.
>> >
>> > 4. u-boot-with-spl-pbl.bin is produced. For detail,
>> > u-boot-with-spl-pbl.bin is generated by padding spl/u-boot-spl.pbl to
>> > the offset of CONFIG_SPL_PAD_TO and adding u-boot.img.
>> >
>> > As the size of spl/u-boot-spl.pbl is not a fixed value, we pad it to
>> > the offset of CONFIG_SPL_PAD_TO. So it is convenient for us to
>> > determine the location of u-boot.img in SD card.
>> >
>> 
>> Sorry for the late respond. I was away for an urgent project.
>> 
>> If I understand you correctly, you define a CONFIG_SPL_MAX_SIZE and pad
>> the final binary file to this size. How do you determine the size? I
>> understand PBL loading mechanism. Would it be possible to pad to 64
>> byte boundary (or any practical size since it is adjustable) and avoid
>> the definition of CONFIG_SPL_MAX_SIZE?
>
>[Alison Wang] I checked the size of spl/u-boot-spl.bin, then determined
>CONFIG_SPL_MAX_SIZE which is larger than the size of spl/u-boot-spl.bin.
>For Pblimage tool, the size of SPL image need to be a fixed value.
>For example, for PowerPC, no matter how the SPL code is changed, the
>size of spl/u-boot-spl.bin is always 0x28000 (so the "pbl_cmd_initaddr"
>is always 0x82000000). But for LS1, the size of spl/u-boot-spl.bin is not
>a fixed size. When the SPL code is changed, the size of spl/u-boot-spl.bin
>is changed, so "pbl_cmd_initaddr" is changed too. It's unacceptable for
>pblimage
>tool("pbl_cmd_initaddr" need to be a fixed value). To fix this issue, I
>use
>CONFIG_SPL_MAX_SIZE.
>
>Do you mean there is some approach to pad spl/u-boot-spl.bin to any
>practical size and avoid the definition of CONFIG_SPL_MAX_SIZE?

PBL image is created this way

A) Create the RCW header
B) Determine u-boot image size
C) Subtract the size from top of 24-bit space, that's what you see
0x82000000-size. The magic number 0x82000000 is used to make the result as
0x81xxxxxx. The highest of 0x8 is ACS=1, the lowest bit of 0x81 is
CONTINUE=1, the xxxxxx is the 24-bit offset. By changing the offset, you
can load the data into memory, up to 64 byte a time. By making a lot of
0x81xxxxxx, you make a sequence of commands to load 64 byte a time, until
all image is loaded.

Given the above mechanism, do you still think the image has to be a fixed
size? I think you need to adjust pblimage.c to deal with the variable
size, and pad the last chunk to be aligned with 2^n byte.

York

  reply	other threads:[~2014-09-23  3:40 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-18  5:47 [U-Boot] [PATCH 0/7] Add SD boot support for LS1021AQDS/TWR board Alison Wang
2014-09-18  5:47 ` [U-Boot] [PATCH 1/7] spl: pbl: Add new SPL image for pblimage tool Alison Wang
2014-09-18  9:37   ` Albert ARIBAUD
2014-09-19  5:07     ` Huan Wang
2014-09-20  7:47       ` Albert ARIBAUD
2014-09-22  6:17         ` Huan Wang
2014-09-22 15:49           ` York Sun
2014-09-23  2:43             ` Huan Wang
2014-09-23  3:40               ` York Sun [this message]
2014-09-25  6:33                 ` Huan Wang
2014-09-18  5:47 ` [U-Boot] [PATCH 2/7] ls102xa: pblimage: Add pblimage tool support for LS102xA Alison Wang
2014-09-18  9:57   ` Albert ARIBAUD
2014-09-22  6:22     ` Huan Wang
2014-09-24  7:55       ` [U-Boot] [OT] " Albert ARIBAUD
2014-09-24  8:00         ` Huan Wang
2014-09-18  5:47 ` [U-Boot] [PATCH 3/7] spl: Use u-boot.img instead of u-boot.bin when CONFIG_SPL_PBL_PAD is enabled Alison Wang
2014-09-18  5:47 ` [U-Boot] [PATCH 4/7] ls102xa: qixis: Add CONFIG_QIXIS_I2C_ACCESS macro Alison Wang
2014-09-18  5:47 ` [U-Boot] [PATCH 5/7] common: spl: Add interactive DDR debugger support for SPL Alison Wang
2014-09-18  5:47 ` [U-Boot] [PATCH 6/7] arm: ls102xa: Add SD boot support for LS1021AQDS board Alison Wang
2014-09-18 11:20   ` Albert ARIBAUD
2014-09-19  3:40     ` Alison Wang
2014-09-19  5:10     ` Huan Wang
     [not found]     ` <1411053355745.66856@freescale.com>
2014-09-19 15:56       ` Albert ARIBAUD
2014-09-22  6:46         ` Huan Wang
2014-09-22 11:01           ` Albert ARIBAUD
2014-09-25  6:45             ` Huan Wang
2014-10-01 18:08               ` Albert ARIBAUD
2014-10-08  9:53                 ` Huan Wang
2014-10-11 11:30                   ` Albert ARIBAUD
2014-10-15  6:56                     ` Huan Wang
2014-10-15 10:30                       ` Albert ARIBAUD
2014-09-18  5:47 ` [U-Boot] [PATCH 7/7] arm: ls102xa: Add SD boot support for LS1021ATWR board Alison Wang

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=D0463556.183B2%yorksun@freescale.com \
    --to=yorksun@freescale.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox