Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8349EC433FE for ; Wed, 20 Apr 2022 01:34:34 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 64D1280331; Wed, 20 Apr 2022 03:34:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=andestech.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id B030181B5B; Wed, 20 Apr 2022 03:34:30 +0200 (CEST) Received: from Atcsqr.andestech.com (exmail.andestech.com [60.248.187.195]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0646F80269 for ; Wed, 20 Apr 2022 03:34:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=andestech.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=uboot@andestech.com Received: from mail.andestech.com (ATCPCS16.andestech.com [10.0.1.222]) by Atcsqr.andestech.com with ESMTP id 23K1YHiD094391; Wed, 20 Apr 2022 09:34:17 +0800 (+08) (envelope-from uboot@andestech.com) Received: from app09.andestech.com (10.0.15.117) by ATCPCS16.andestech.com (10.0.1.225) with Microsoft SMTP Server id 14.3.498.0; Wed, 20 Apr 2022 09:34:10 +0800 From: Andes To: CC: , , Subject: [PATCH] riscv: ae350: Fix xip config boot failure Date: Wed, 20 Apr 2022 09:33:53 +0800 Message-ID: <20220420013353.12971-1-uboot@andestech.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.0.15.117] X-DNSRBL: X-MAIL: Atcsqr.andestech.com 23K1YHiD094391 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean From: Rick Chen It will fail to boot with ae350_rv[32|64]_spl_xip_defconfig. It need to add OONFIG_XIP to get the specific HW address for DTB. Also drop OF_SEPARATE in board_fdt_blob_setup() because it will never reach here anyway.It only allow OF_BOARD to call board_fdt_blob_setup() in fdtdec_setup(). Fixes: 2e8d2f88439d ("riscv: Remove OF_PRIOR_STAGE from RISC-V boards") Signed-off-by: Rick Chen --- board/AndesTech/ax25-ae350/ax25-ae350.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/board/AndesTech/ax25-ae350/ax25-ae350.c b/board/AndesTech/ax25-ae350/ax25-ae350.c index d6a4291..9ca7fdf 100644 --- a/board/AndesTech/ax25-ae350/ax25-ae350.c +++ b/board/AndesTech/ax25-ae350/ax25-ae350.c @@ -54,13 +54,20 @@ ulong board_flash_get_legacy(ulong base, int banknum, flash_info_t *info) return 0; } +#define ANDES_HW_DTB_ADDRESS 0xF2000000 void *board_fdt_blob_setup(int *err) { *err = 0; + #if defined(CONFIG_OF_BOARD) - return (void *)(ulong)gd->arch.firmware_fdt_addr; -#elif defined(CONFIG_OF_SEPARATE) +#if (defined(CONFIG_XIP) && CONFIG_IS_ENABLED(RISCV_MMODE)) + if (fdt_magic(CONFIG_SYS_FDT_BASE) == FDT_MAGIC) return (void *)CONFIG_SYS_FDT_BASE; + return (void *)ANDES_HW_DTB_ADDRESS; +#else + + return (void *)(ulong)gd->arch.firmware_fdt_addr; +#endif #else *err = -EINVAL; return NULL; -- 2.7.4