mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Wadim Egorov <w.egorov@phytec.de>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: "barebox@lists.infradead.org" <barebox@lists.infradead.org>
Subject: Re: barebox PBL question
Date: Tue, 14 Feb 2017 10:54:49 +0100	[thread overview]
Message-ID: <6ff1f0fb-5847-e927-0602-a61c35a58e5b@phytec.de> (raw)
In-Reply-To: <20170213192247.gjld5b33genwav2a@pengutronix.de>


On 13.02.2017 20:22, Sascha Hauer wrote:
> On Mon, Feb 13, 2017 at 04:13:48PM +0100, Wadim Egorov wrote:
>> Hi,
>>
>> I would like to add SPL support for the RK3288 SoC to barebox. But I am
>> facing
>> a few problems.
>>
>> The maximum size of the SPL image which the ROM code will read is 32KB.
>> I was thinking to use the PBL feature for the SPL part. But using the
>> the pbl code (with decompression) seems to be not a good idea, because
>> it's size
>> is already about 30K. I think this is an overhead.
> In a test build here the pbl code is 6KiB. The rest is the devicetree
> included in the binary (which I disabled in the test build). The dtb can
> be compressed which should give you enough space even in 32KiB.
OK, I think I checked the wrong file size. pblb is the bare binary file

>
>> But now I wonder how to generate two different images with a single build.
>> A SPL image, which should not exceed 32K and a barebox.
>>
>> I have problems to fully understand the PBL mechanism.
>> Why are the builds always adding the barebox.bin images to the PBL part?
> The idea is to create an image that contains the PBL and attached to it
> the compressed barebox image. If your ROM only allows a certain image
> size then make sure the PBL is small enough and tell the ROM to only
> load the PBL part of the image. Ideally the PBL then detects from where
> the PBL is loaded (by reading back the bootsource the SoC provides) and
> reads the rest of the image into SDRAM (or, for sake of simplicity, the
> whole image inculding PBL again)
ty for clarification

>
>> Here is an example, cat .zbarebox.cmd
>>
>> ld -EL  -Map arch/arm/pbl/zbarebox.map --gc-sections -static -o
>> arch/arm/pbl/zbarebox -e pbl_start -T arch/arm/pbl/zbarebox.lds
>> --start-group  common/built-in-pbl.o [...]  arch/arm/pbl/piggy.shipped.o
>> --end-group
>>
>> piggy.shipped.o is barebox.bin, which is added in piggy.shipped.S:
>>
>> .incbin "arch/arm/pbl/piggy.shipped"
> You should use PBL_MULTI_IMAGES instead. In fact, the existing Rockchip
> port already does this.
>
> I think your entry function should look something like:
>
> ENTRY_FUNCTION(start_rk3288_phycore_som, r0, r1, r2)
> {
> 	arm_cpu_lowlevel_init();
>
> 	if (inside_sdram(get_pc()))
> 		barebox_arm_entry(0x0, SZ_1G, fdt);
>
> 	rk3288_phycore_setup_sdram();
>
> 	jump_back_to_rom();
> }
>
> I don't know how jump_back_to_rom() should be implemented. Do you have
> to return from the entry function to the ROM or does the ROM provide some API
> which can be used to chainload the rest of the image?

No, there is no API in the ROM.
In u-boot the spl will return to bootrom in board_init_f(), then bootrom
loads u-boot binary.

Regards,
Wadim

>
> What you'll need additionally is a tool which encapsulates the image into
> a SoC specific container suitable for the ROM.
>
> Sascha
>


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2017-02-14  9:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-13 15:13 Wadim Egorov
2017-02-13 19:22 ` Sascha Hauer
2017-02-13 20:53   ` Trent Piepho
2017-02-14  7:27     ` Sascha Hauer
2017-02-14 18:12       ` Trent Piepho
2017-02-15  7:57         ` s.hauer
2017-02-14  9:54   ` Wadim Egorov [this message]
2017-02-14 10:48     ` Sascha Hauer
2017-02-14 11:34       ` Wadim Egorov

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=6ff1f0fb-5847-e927-0602-a61c35a58e5b@phytec.de \
    --to=w.egorov@phytec.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.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