From: Kumar Gala Date: Tue, 20 Nov 2007 14:34:19 -0600 Subject: [U-Boot-Users] [PATCH] fdt: add common memory fixup function In-Reply-To: <20071026114220.18869.61526.stgit@tq-sewsrv-4.tq-net.de> References: <20071026114220.18869.61526.stgit@tq-sewsrv-4.tq-net.de> Message-ID: <8163F1FC-2E89-4166-B793-83A17C349852@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/common/cmd_bootm.c b/common/cmd_bootm.c > index d816349..3381c07 100644 > --- a/common/cmd_bootm.c > +++ b/common/cmd_bootm.c > @@ -992,6 +992,16 @@ do_bootm_linux (cmd_tbl_t *cmdtp, int flag, > do_reset (cmdtp, flag, argc, argv); > } > #endif > + /* > + * 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); > + } > #ifdef CONFIG_OF_BOARD_SETUP > /* Call the board-specific fixup routine */ > ft_board_setup(of_flat_tree, gd->bd); Was thinking about this some more and realized I don't like fdt_memory() getting called via bootm w/o the board code have control. I think Kim suggest we have a CONFIG_OF_MEMORY_FIXUP that this call is wrapped around. But leave fdt_memory() available. I want it such that the board code/config is in control of what fixups gets called for it. There are cases in which we don't want fdt_memory() called as it stands. - k