From patchwork Fri Jan 27 21:53:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 92726 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp445165qgi; Fri, 27 Jan 2017 13:55:26 -0800 (PST) X-Received: by 10.223.161.194 with SMTP id v2mr8866021wrv.144.1485554126749; Fri, 27 Jan 2017 13:55:26 -0800 (PST) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id 185si4261139wmz.36.2017.01.27.13.55.26; Fri, 27 Jan 2017 13:55:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8E249B3898; Fri, 27 Jan 2017 22:55:05 +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 dYpO9rn7h7w8; Fri, 27 Jan 2017 22:55:05 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 15C49B3865; Fri, 27 Jan 2017 22:54:46 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5BC1AB387D for ; Fri, 27 Jan 2017 22:54:36 +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 rn8RHngi5KRm for ; Fri, 27 Jan 2017 22:54:36 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from conuserg-11.nifty.com (conuserg-11.nifty.com [210.131.2.78]) by theia.denx.de (Postfix) with ESMTPS id BE5EDB387C for ; Fri, 27 Jan 2017 22:54:26 +0100 (CET) Received: from grover.sesame (FL1-111-169-71-157.osk.mesh.ad.jp [111.169.71.157]) (authenticated) by conuserg-11.nifty.com with ESMTP id v0RLs2X2015159; Sat, 28 Jan 2017 06:54:08 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com v0RLs2X2015159 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1485554048; bh=I4ALr8pMPrMNTmdC759RSWBVPxXYjXK+2UCWTI0htg8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k0L1R65ca8/5QE7EuATXeUeuN9TiWOZ66RZMVoEtsEh5p3eDQthQ22KE/FWuqnQ/7 jV5zU2qinuYqWkDJBiT56YRDRVi8chIInhTBCt/Qp1SKYgWmTHEr5PTnh4SKd+xZ3O c4ZPzcjkYvICA8Nie1IUGyb6ByEPgRvJIHXKzlYjHb+zX+uJzX6FwqhsJiVNYb/dhK gOcZ8xbnB1isUJ8aLOE7L44L0nsDKWcMUTiaesogjMNjPHR8Exz5AxzboabORM0pM0 TVzVQl3gdYl0lMWQNN6M1jUbsxdGTZzCrHn/uQDjIHzTbFZOVRxbWcHXbCFd/KJXiZ QFMEGNpMwOPdg== X-Nifty-SrcIP: [111.169.71.157] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sat, 28 Jan 2017 06:53:44 +0900 Message-Id: <1485554036-29320-5-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1485554036-29320-1-git-send-email-yamada.masahiro@socionext.com> References: <1485554036-29320-1-git-send-email-yamada.masahiro@socionext.com> Cc: Albert Aribaud Subject: [U-Boot] [PATCH 04/16] ARM: uniphier: use gd->bd->bi_dram for memory reserve on LD20 SoC 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: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" For LD20 SoC, the last 64 byte of each DRAM bank is used for the dynamic training of DRAM PHY. The regions must be reserved in DT to prevent the kernel from using them. Now gd->bd->bi_dram reflects the actual memory banks. Just use it instead of getting access to the board parameters. Signed-off-by: Masahiro Yamada --- arch/arm/mach-uniphier/dram_init.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) -- 2.7.4 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot diff --git a/arch/arm/mach-uniphier/dram_init.c b/arch/arm/mach-uniphier/dram_init.c index 43fe6a5..e55e1f8 100644 --- a/arch/arm/mach-uniphier/dram_init.c +++ b/arch/arm/mach-uniphier/dram_init.c @@ -246,22 +246,15 @@ void dram_init_banksize(void) */ int ft_board_setup(void *fdt, bd_t *bd) { - const struct uniphier_board_data *param; unsigned long rsv_addr; const unsigned long rsv_size = 64; - int ch, ret; + int i, ret; if (uniphier_get_soc_id() != UNIPHIER_LD20_ID) return 0; - param = uniphier_get_board_param(); - if (!param) { - printf("failed to get board parameter\n"); - return -ENODEV; - } - - for (ch = 0; ch < param->dram_nr_ch; ch++) { - rsv_addr = param->dram_ch[ch].base + param->dram_ch[ch].size; + for (i = 0; i < ARRAY_SIZE(gd->bd->bi_dram); i++) { + rsv_addr = gd->bd->bi_dram[i].start + gd->bd->bi_dram[i].size; rsv_addr -= rsv_size; ret = fdt_add_mem_rsv(fdt, rsv_addr, rsv_size);