mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Pascal Vizeli <pvizeli@syshack.ch>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/1] arm: boards: support native fdt for raspberry pi
Date: Mon, 11 Jun 2018 08:34:45 +0200	[thread overview]
Message-ID: <20180611063445.fwbw2m5ha6p2nhlj@pengutronix.de> (raw)
In-Reply-To: <20180608074133.30653-1-pvizeli@syshack.ch>

On Fri, Jun 08, 2018 at 07:41:33AM +0000, Pascal Vizeli wrote:
> It store the native device tree from bootloader to '/rpi_native.dtb'.
> This device tree is not compatible with barebox but needed to boot the
> linux kernel correctly. With new overlay support we can patch this
> device tree on runtime.
> 
> Now barebox can be the middle bootloader and we have no limitations to
> origin bootloader.
> 
> Question: How I can share a address between PBL and barebox?

See other mail I just sent you.

> +static int rpi_native_fdt(void)
> +{
> +	struct fdt_header *oftree;
> +	int mode = O_RWSIZE_4 | O_RDONLY;
> +	int fd = 0;
> +	uint32_t size;
> +	void *map;
> +
> +	fd = open_and_lseek("/dev/mem", mode, rpi_fdt_addr);
> +	if (fd < 0) {
> +		printf("failed open /dev/mem for fdt");
> +		goto end;
> +	}
> +
> +	map = memmap(fd, PROT_READ);
> +	if (map == (void *)-1) {
> +		printf("failed map memory for fdt");
> +		goto end;
> +	}

No need to open/memmap /dev/mem. Just dereference the memory location.

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

      parent reply	other threads:[~2018-06-11  6:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-08  7:41 Pascal Vizeli
2018-06-08  7:47 ` Pascal Vizeli
2018-06-11  6:34 ` Sascha Hauer [this message]

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=20180611063445.fwbw2m5ha6p2nhlj@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