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@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox