From: Kumar Gala Date: Tue, 3 May 2011 09:21:42 -0500 Subject: [U-Boot] [PATCH 2/2] powerpc/85xx: verify the device tree before booting Linux In-Reply-To: <1304353907-31127-2-git-send-email-timur@freescale.com> References: <1304353907-31127-1-git-send-email-timur@freescale.com> <1304353907-31127-2-git-send-email-timur@freescale.com> Message-ID: <8FB32031-7344-4C7F-84F2-BA43E9959D07@kernel.crashing.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de > diff --git a/arch/powerpc/lib/bootm.c b/arch/powerpc/lib/bootm.c > index e01787d..53b9b27 100644 > --- a/arch/powerpc/lib/bootm.c > +++ b/arch/powerpc/lib/bootm.c > @@ -226,6 +226,23 @@ static int boot_bd_t_linux(bootm_headers_t *images) > return ret; > } > > +/* > + * Verify the device tree. > + * > + * This function is called after all device tree fix-ups have been enacted, > + * so that the final device tree can be verified. The definition of "verified" > + * is up to the specific implementation. However, it generally means that the > + * addresses of some of the devices in the device tree are compared with the > + * actual addresses at which U-Boot has placed them. > + * > + * The function should display warning messages for any problems it finds. > + * U-Boot will still attempt to boot the operating system, however. > + */ > +static void __ft_verify_fdt(void *fdt) > +{ > +} > +__attribute__((weak, alias("__ft_verify_fdt"))) void ft_verify_fdt(void *fdt); > + > static int boot_body_linux(bootm_headers_t *images) > { > ulong rd_len; > @@ -296,6 +313,8 @@ static int boot_body_linux(bootm_headers_t *images) > /* fixup the initrd now that we know where it should be */ > if (*initrd_start && *initrd_end) > fdt_initrd(*of_flat_tree, *initrd_start, *initrd_end, 1); > + > + ft_verify_fdt(*of_flat_tree); Do we not want to error out here if verify fails? > } > #endif /* CONFIG_OF_LIBFDT */ > return 0; > -- > 1.7.3.4