From patchwork Thu Oct 25 01:18:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andes X-Patchwork-Id: 988884 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=andestech.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 42gTpk5Rp6z9sBk for ; Thu, 25 Oct 2018 12:21:02 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 44E3BC21DFA; Thu, 25 Oct 2018 01:20:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, RDNS_DYNAMIC autolearn=no autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 33343C21DD4; Thu, 25 Oct 2018 01:20:55 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 87EFAC21DD4; Thu, 25 Oct 2018 01:20:54 +0000 (UTC) Received: from ATCSQR.andestech.com (59-120-53-16.HINET-IP.hinet.net [59.120.53.16]) by lists.denx.de (Postfix) with ESMTPS id 7A5ABC21DB6 for ; Thu, 25 Oct 2018 01:20:53 +0000 (UTC) Received: from mail.andestech.com (atcpcs16.andestech.com [10.0.1.222]) by ATCSQR.andestech.com with ESMTP id w9P1LqmI061093; Thu, 25 Oct 2018 09:21:52 +0800 (GMT-8) (envelope-from uboot@andestech.com) Received: from app09.andestech.com (10.0.12.145) by ATCPCS16.andestech.com (10.0.1.222) with Microsoft SMTP Server id 14.3.123.3; Thu, 25 Oct 2018 09:20:22 +0800 From: Andes To: Date: Thu, 25 Oct 2018 09:18:39 +0800 Message-ID: <20181025011839.22273-1-uboot@andestech.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-Originating-IP: [10.0.12.145] X-DNSRBL: X-MAIL: ATCSQR.andestech.com w9P1LqmI061093 Cc: rickchen36@gmail.com, greentime@andestech.com Subject: [U-Boot] [PATCH] riscv: ax25-ae350: Pass dtb address to u-boot with a1 register X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" From: Rick Chen ax25-ae350 use CONFIG_OF_BOARD which allow the board to override the fdt address. And prior_stage_fdt_address offer a temporary memory address to keep the dtb address which was passed from loader(gdb) to u-boot with a1. Signed-off-by: Rick Chen Cc: Greentime Hu --- board/AndesTech/ax25-ae350/ax25-ae350.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/board/AndesTech/ax25-ae350/ax25-ae350.c b/board/AndesTech/ax25-ae350/ax25-ae350.c index 5f4ca0f..d343453 100644 --- a/board/AndesTech/ax25-ae350/ax25-ae350.c +++ b/board/AndesTech/ax25-ae350/ax25-ae350.c @@ -14,6 +14,7 @@ DECLARE_GLOBAL_DATA_PTR; +extern phys_addr_t prior_stage_fdt_address; /* * Miscellaneous platform dependent initializations */ @@ -66,7 +67,7 @@ ulong board_flash_get_legacy(ulong base, int banknum, flash_info_t *info) void *board_fdt_blob_setup(void) { - void **ptr = (void *)CONFIG_SYS_SDRAM_BASE; + void **ptr = (void *)&prior_stage_fdt_address; if (fdt_magic(*ptr) == FDT_MAGIC) return (void *)*ptr;