From: Marek Vasut Date: Wed, 29 Nov 2017 04:11:26 +0100 Subject: [U-Boot] [PATCH] fdtdec: Support parsing multiple /memory nodes In-Reply-To: <20171129025815.GN3587@bill-the-cat> References: <20171129024545.6860-1-marek.vasut+renesas@gmail.com> <20171129025815.GN3587@bill-the-cat> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 11/29/2017 03:58 AM, Tom Rini wrote: > On Wed, Nov 29, 2017 at 03:45:45AM +0100, Marek Vasut wrote: > >> It is legal to have multiple /memory nodes in a device tree . Currently, >> fdtdec_setup_memory_size() only supports parsing the first node . This >> patch extends the function such that if a particular /memory node does >> no longer have further "reg" entries and CONFIG_NR_DRAM_BANKS still >> allows for more DRAM banks, the code moves on to the next memory node >> and checks it's "reg"s. This makes it possible to handle both systems >> with single memory node with multiple entries and systems with multiple >> memory nodes with single entry. >> >> Signed-off-by: Marek Vasut >> Cc: Tom Rini >> Cc: Simon Glass > > https://www.devicetree.org/downloads/devicetree-specification-v0.1-20160524.pdf > says that multiple nodes can be used, so this is the correct fix here. I am not a big fan of this kind of practice, but that's how our DTs are, so it cannot be helped and we have to support this :-( > Thanks! > > Reviewed-by: Tom Rini Thanks. -- Best regards, Marek Vasut