From: Sascha Hauer <s.hauer@pengutronix.de>
To: Pascal Vizeli <pvizeli@syshack.ch>
Cc: barebox@lists.infradead.org
Subject: Re: Oftree from memory and access to start arguments
Date: Thu, 7 Jun 2018 09:31:13 +0200 [thread overview]
Message-ID: <20180607073113.7k7rupezic6t3iwj@pengutronix.de> (raw)
In-Reply-To: <CACvFaDeA6k7d=1hOxCkOo1cXoxB566S3249XhZk3-zSNkQU3ag@mail.gmail.com>
Hi Pascal,
On Wed, Jun 06, 2018 at 01:07:27AM +0200, Pascal Vizeli wrote:
> Hi,
>
> I'm working on a functionality to load a device tree with oftree from
> memory. The use case is like raspberry platform they have his own
> device tree for linux kernel. If I known the address (config.txt), I
> will load this from memory and read out the dynamic linux args and use
> other overlays for states with bootchoiser and boot the kernel
> correctly.
>
> On raspberry, I can write the device-tree to a memory address with
> config.txt. It would be nice, if I can access to barebox (start.c)
> main arguments, while the raspberry pi load barebox like a linux
> kernel and give him the device-address on r2.
Starting barebox with the devicetree provided in r2 shouldn't be a
problem. See arch/arm/boards/raspberry-pi/lowlevel.c:
ENTRY_FUNCTION(start_raspberry_pi2, r0, r1, r2)
{
void *fdt = __dtb_bcm2836_rpi_2_start + get_runtime_offset();
arm_cpu_lowlevel_init();
barebox_arm_entry(BCM2835_SDRAM_BASE, SZ_512M, fdt);
}
Just call barebox_arm_entry() with 'r2' instead of 'fdt'.
You could also store the value of r2 in a known memory location
and load the devicetree later in some board specific initcall.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2018-06-07 7:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-05 23:07 Pascal Vizeli
2018-06-07 7:31 ` Sascha Hauer [this message]
2018-06-07 23:03 ` Pascal Vizeli
2018-06-11 6:31 ` Sascha Hauer
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=20180607073113.7k7rupezic6t3iwj@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=pvizeli@syshack.ch \
/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