public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] [DNX#2007012542000021] [PATCH] Abort booting if the DTB version is incomp [...]
@ 2007-01-25 16:20 OTRS Notification Master
  2007-02-05 19:38 ` Timur Tabi
  2007-03-14 19:58 ` Timur Tabi
  0 siblings, 2 replies; 10+ messages in thread
From: OTRS Notification Master @ 2007-01-25 16:20 UTC (permalink / raw)
  To: u-boot

Hello list,

inside the automatic U-Boot patch tracking system a new ticket
[DNX#2007012542000021] was created:

<snip>
> U-Boot only supports version 16 of the device tree file format, although
> some
> versions of the device tree compiler generate version 3 by default. 
> With
> this patch, U-Boot now checks the version number and aborts the boot
> process
> if the version of the device tree passed on the bootm command line is
> not
> compatible.
> 
> Signed-off-by: Timur Tabi <timur@freescale.com>
> ---
>  common/cmd_bootm.c |   10 ++++++++++
>  1 files changed, 10 insertions(+), 0 deletions(-)
> 
> diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
> index 0c092c7..9111cbd 100644
> --- a/common/cmd_bootm.c
> +++ b/common/cmd_bootm.c
> @@ -741,6 +741,16 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int fl
>  		hdr = (image_header_t *)of_flat_tree;
>  
>  		if  (*(ulong *)of_flat_tree == OF_DT_HEADER) {
> +			struct boot_param_header *bph =
> +				(struct boot_param_header *) of_flat_tree;
> +
> +			if ((OF_DT_VERSION < be32_to_cpu(bph->last_comp_version)) ||
> +			    (OF_DT_VERSION > be32_to_cpu(bph->version))) {
> +				printf("ERROR: DTB version %u is not compatible with version %u " \
> +				       "(last_comp_version=%u)\n", be32_to_cpu(bph->version),
> +				       OF_DT_VERSION, be32_to_cpu(bph->last_comp_version));
> +				return;
> +			}
>  #ifndef CFG_NO_FLASH
>  			if (addr2info((ulong)of_flat_tree) != NULL)
>  				of_data = (ulong)of_flat_tree;
> -- 
> 1.4.4
</snip>

Your U-Boot support team

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-03-14 23:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-25 16:20 [U-Boot-Users] [DNX#2007012542000021] [PATCH] Abort booting if the DTB version is incomp [...] OTRS Notification Master
2007-02-05 19:38 ` Timur Tabi
2007-02-06  0:40   ` Wolfgang Denk
2007-03-14 19:58 ` Timur Tabi
2007-03-14 20:36   ` Wolfgang Denk
2007-03-14 21:01     ` Stefan Roese
2007-03-14 21:04       ` Wolfgang Denk
2007-03-14 21:22         ` Ben Warren
2007-03-14 23:12           ` Wolfgang Denk
2007-03-14 21:07     ` Jerry Van Baren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox