On Thu, Jan 17, 2019 at 03:44:22PM +0300, Серафим Долбилов wrote: > 17.01.2019, 10:59, "Sascha Hauer" <s.hauer@xxxxxxxxxxxxxx>: > > You can have any devicetree by adding it to arch/arm/dts/Makefile: > > > > pbl-dtb-$(CONFIG_MACH_FREESCALE_MX51_PDK) += imx51-babbage.dtb.o > > > > Then add a declaration for it (replace beginning of filename with > > __dtb_, .dtb.o with _start and '-' with '_'): > > > > extern char __dtb_imx51_babbage_start[]; > > > > And then you can use it. Use obj-dtb-$(CONFIG_MACH_FREESCALE_MX51_PDK) > > when you want to have it in the full barebox image rather than in the > > PBL. > > In which cases do I need to link it to the full image? > > Frankly speaking, I just want DT to be parsed by the bootloader (in > order to detect such devices as USB, ethernet PHY, etc, and run their > drivers) and then passed to Linux kernel (when boot command is > invoked). > So all my questions about DT are coming from around this problem. This is what barebox does by default. > > Reading Barebox's source code I found that `examle.dts` (e.g.) becomes > `example.dtb`, then `example.dtb.o`, and is finally linked into PBL, > being "catched" in lwl-code by `extern char __dtb_example_start[];` > symbol. Then this symbol is used in `barebox_arm_entry()` function, > etc... So I just want to know, why do we link DT into PBL, and what is > PBL exactly, if not an self-unpacking-and-relocating image? PBL is for PreBootLoader. Yes, it's a self extracting image. During building of barebox a single barebox binary and one to many PBL images are built. Each PBL image is for one specific board. It's the PBL which actually knows the board type and it'll pass the device tree to the barebox binary to let it know which hardware it is running on. This is all done to build barebox for multiple boards in a single go. Regards 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