[U-Boot-Users] [PATCH][RFC] Add common memory fixup function
Martin Krause
Martin.Krause at tqs.de
Tue Nov 27 09:38:15 CET 2007
Hi Vitaly,
Vitaly Bordug wrote on Monday, November 26, 2007 11:12 PM:
> On Mon, 26 Nov 2007 14:55:46 -0600 (CST)
> Kumar Gala wrote:
>
> > Guys,
> >
> > Here's my cut at a more generic version of Martin's patch that
> > respects #ac and #sc.
> >
> > Let me know what you think and if you have any comments. I'll add
> > the board bits in a complete patch if this looks ok.
> >
> funny, I did the same with slightly different approach.
> below goes my version...
>
> I think we are different only in #ac/#sc accounting, so
> let the people consider the best approach :)
>
> Or... am I wrong in something?
> ----
>
> fdt: add common memory fixup function
>
> From: Martin Krause <martin.krause at tqs.de>
>
> Add the function fdt_memory() to fixup the /memory node of the fdt
> with the memory values detected by U-Boot (taken from bd->bi_memstart
> and bd->bi_memsize).
>
> The new function is called for all boards which define
> CONFIG_OF_LIBFDT.
>
> This patch removes already existing board specific memory fixup
> routines
> for boards wich have CONFIG_OF_LIBFDT defined and switches them to the
> new routine. Boards wich use the CONIFG_OF_FLAT_TREE method are not
> touched.
>
> Signed-off-by: Martin Krause <martin.krause at tqs.de>
> Signed-off-by: Vitaly Bordug <vitb at kernel.crashing.org>
> ---
>
> README | 9 +++++
> board/cds/common/ft_board.c | 9 -----
> board/cm5200/cm5200.c | 23 ++-----------
> common/cmd_bootm.c | 12 +++++++
> common/fdt_support.c | 75
> +++++++++++++++++++++++++++++++++++++++++++ cpu/mpc83xx/cpu.c
> | 20 ++--------- include/fdt_support.h | 1 +
> 7 files changed, 103 insertions(+), 46 deletions(-)
>
[...]
> diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
> index d816349..41547c6 100644
> --- a/common/cmd_bootm.c
> +++ b/common/cmd_bootm.c
> @@ -992,6 +992,18 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
> do_reset (cmdtp, flag, argc, argv);
> }
> #endif
> +#ifdef CONFIG_OF_MEMORY_FIXUP
> + /*
> + * Add the "/memory" node if it does not exist, and do a fixup
> + * of the "reg" property with values detected by U-Boot
> + * (taken from bd->bi_memstart and bd->bi_memsize).
> + */
> + if (fdt_memory(of_flat_tree) < 0) {
> + puts ("ERROR: /memory node create failed - "
> + "must RESET the board to recover.\n");
> + do_reset (cmdtp, flag, argc, argv);
> + }
> +#endif
Ah, you placed a CONFIG_OF_MEMORY_FIXUP around the fdt_memory() call.
That's OK with me, but then please set this define for all boards,
which did a memory fixup already. I can't remeber, which boards this
were exactly, but I know that the TQM5200 was one of it :-).
Best Regards,
Martin Krause
More information about the U-Boot
mailing list