Re: Converting MIPS to Device Tree
From: Florian Fainelli <florian@openwrt.org>
Date: 2011-06-12 18:20:30
On Wednesday 08 June 2011 09:15:14 Geert Uytterhoeven wrote:
On Wed, Jun 8, 2011 at 01:02, David VomLehn [off-list ref] wrote:quoted
I took a look at the issue of passing device trees to the kernel and started by surveying the methods currently in use for passing information from the bootloader to the kernel. I came up with the ten approaches: How MIPS Bootloaders Pass Information to the Kernel --------------------------------------------------- Apologies for any errors; this was meant more to be a quick survey rather than a detailed analysis. 6. a0 - argc a1 - argv a2 - non-standard envp Command line created by concatenating argv strings, starting at argv[1]. The envp is a pointer to a list of char ptr to name/char ptr pairs. Platforms: txx9This depends on the actual boot loader. My rbtx4927 has a VxWorks boot loader, which just doesn't pass anything. Cfr. commit 97b0511ce125b0cb95d73b198c1bdbb3cebc4de2 ("MIPS: TXx9: Make firmware parameter passing more robust").
Thinking about this more, on platforms for which we do not have control about the bootloader, we can usually still get it to boot a wrapper. Such a wrapper could do the following: - embedd the kernel - embedd the appropriate dtb - copy the relevant a0-a3 values and pass to the kernel a pointer to the valid dtb in the aX register such a wrapper already exists, which is the code responsible for decompressing the kernel in arch/mips/boot/compressed. If we want to support multiple flavors of the same SoC, using the same kernel image, we only need to relink the boot wrapper with the correct dtb (and kernel of course). -- Florian