From patchwork Fri Feb 10 14:23:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Davis X-Patchwork-Id: 726555 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3vKcdL0flVz9s6n for ; Sat, 11 Feb 2017 01:24:05 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D477C4AD1F; Fri, 10 Feb 2017 15:24:00 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qlO3SIu9mAYL; Fri, 10 Feb 2017 15:24:00 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 183164ABEE; Fri, 10 Feb 2017 15:24:00 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 288B44ABEE for ; Fri, 10 Feb 2017 15:23:57 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OLbSB6Wq0OAI for ; Fri, 10 Feb 2017 15:23:57 +0100 (CET) Received: from fllnx209.ext.ti.com (fllnx209.ext.ti.com [198.47.19.16]) by theia.denx.de (Postfix) with ESMTPS id AFB884AAA7 for ; Fri, 10 Feb 2017 15:23:56 +0100 (CET) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id v1AENTaD023077; Fri, 10 Feb 2017 08:23:29 -0600 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id v1AENOgw021674; Fri, 10 Feb 2017 08:23:24 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.294.0; Fri, 10 Feb 2017 08:23:23 -0600 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id v1AENNj2021236; Fri, 10 Feb 2017 08:23:23 -0600 Received: from localhost (uda0226330.am.dhcp.ti.com [128.247.83.85]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id v1AENN322491; Fri, 10 Feb 2017 08:23:23 -0600 (CST) From: "Andrew F. Davis" To: Tom Rini , Lokesh Vutla Date: Fri, 10 Feb 2017 08:23:23 -0600 Message-ID: <20170210142323.8755-1-afd@ti.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH] arm: omap5: Fix generation of reserved-memory DT node X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" When the node 'reserved-memory' is not defined in the DT we fail to add needed properties. We also fail to move 'offs' to point to the new node. Fix these here. Signed-off-by: Andrew F. Davis Reviewed-by: Tom Rini --- arch/arm/mach-omap2/omap5/fdt.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-omap2/omap5/fdt.c b/arch/arm/mach-omap2/omap5/fdt.c index 900f0010f6..7a3a8db517 100644 --- a/arch/arm/mach-omap2/omap5/fdt.c +++ b/arch/arm/mach-omap2/omap5/fdt.c @@ -161,6 +161,7 @@ static int ft_hs_fixup_dram(void *fdt, bd_t *bd) u32 sec_mem_start = CONFIG_TI_SECURE_EMIF_REGION_START; u32 sec_mem_size = CONFIG_TI_SECURE_EMIF_TOTAL_REGION_SIZE; fdt64_t temp[2]; + fdt32_t two; /* If start address is zero, place at end of DRAM */ if (0 == sec_mem_start) @@ -181,7 +182,7 @@ static int ft_hs_fixup_dram(void *fdt, bd_t *bd) debug("Node %s not found\n", path); path = "/"; subpath = "reserved-memory"; - fdt_path_offset(fdt, path); + offs = fdt_path_offset(fdt, path); offs = fdt_add_subnode(fdt, offs, subpath); if (offs < 0) { printf("Could not create %s%s node.\n", path, subpath); @@ -189,6 +190,10 @@ static int ft_hs_fixup_dram(void *fdt, bd_t *bd) } path = "/reserved-memory"; offs = fdt_path_offset(fdt, path); + two = cpu_to_fdt32(2); + fdt_setprop(fdt, offs, "#address-cells", &two, sizeof(two)); + fdt_setprop(fdt, offs, "#size-cells", &two, sizeof(two)); + fdt_setprop(fdt, offs, "ranges", NULL, 0); } subpath = "secure_reserved";