From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03CD6C433EF for ; Wed, 29 Sep 2021 15:01:11 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 192C3613A6 for ; Wed, 29 Sep 2021 15:01:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 192C3613A6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EA2A380644; Wed, 29 Sep 2021 17:01:06 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="RF7BGT+1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2205E807CD; Wed, 29 Sep 2021 17:01:04 +0200 (CEST) Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4349780641 for ; Wed, 29 Sep 2021 17:00:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-ed1-x529.google.com with SMTP id v18so9691762edc.11 for ; Wed, 29 Sep 2021 08:00:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=UHyOenDGq9FgpzomeK6YDDZrTZ9hQ6CfhWRD1YJaPhw=; b=RF7BGT+1vgj3gbYS2oLI5TZTREbNRyRiIJvqwGFvsyagVVLHpbDXodZULK/mrBiGcy 8ZENdGA0M8x13u/Myjz1dGp86Oa15OkAcoWrV60CttItIkgoTHONReQjrVmgQdZHliuQ 19OkRXZA4qNDki4tEGERo8UlHrH8vZPLWZWTGrStrqEjFnoJlPK5jUJlqEVh0WqNxhI/ sDtouvey61D2s9r3tjjUnXnqECMcXGdmlQcKO5uPzTPIuoXafNRfjS8OTk2rnyz7FY9x mWcTjopo7WJMx82aXcsMjQNk1T0tCFHGNMUK7gstVVIjPUwde118hHDeGY/izoYZFhK8 7+nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=UHyOenDGq9FgpzomeK6YDDZrTZ9hQ6CfhWRD1YJaPhw=; b=48tp+m4KquCycNip9eJCQnR+BRh/PYmnRwhAfRFMu+wrbh7PezZRQYTLMBoFSypfO1 VjInNTYYC8XteRzGs40UC21EC+CuxCCRkDUqdcIvXHNEF30Yd/d1EiqCUF4KqjL0NQvW 6UOQBPKzy0mApeAMPn9DxgpeMaQWbZ4/myDAqFKjbbhKSLo9WRQLbycVDWCny/ISYvFj Xmcbgf1zZOtBvHnwpMrla07ZZqx5cZw42Cki8Q2dpCMsHW8wIMUZklkoNm+k7luyo1Oy okZz1+cFJnPbDGpkwfy8KPqxSpJFj2Ug9oBnFk9CADATyNHce/9ywK6TxV0T6APzWb8p 14nQ== X-Gm-Message-State: AOAM531fjeY2Rh4jpJC+D3rmG6xBLgVTF/K+nhFpS81ybp7KqZpCdgJt v8PK882Qb2z+yR3CkxpfkoUnSw== X-Google-Smtp-Source: ABdhPJzz4i5hzP/oKmlWlBYvEPz0K/+Rs6WNUz83YVW7JSIemOCueKWnMO5lzx8tJck45kGeJNCVZA== X-Received: by 2002:a17:906:c7d0:: with SMTP id dc16mr130198ejb.555.1632927574042; Wed, 29 Sep 2021 07:59:34 -0700 (PDT) Received: from apalos.home (ppp-94-66-220-209.home.otenet.gr. [94.66.220.209]) by smtp.gmail.com with ESMTPSA id g23sm42562edt.1.2021.09.29.07.59.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Sep 2021 07:59:33 -0700 (PDT) Date: Wed, 29 Sep 2021 17:59:30 +0300 From: Ilias Apalodimas To: Bin Meng Cc: Zong Li , Leo Yu-Chi Liang , Rick Chen , U-Boot Mailing List Subject: Re: [PATCH v2] board: sifive: Fix a potential build warning in board_fdt_blob_setup() Message-ID: References: <20210911143123.10423-1-bmeng.cn@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean [...] > > > int board_init(void) > > > diff --git a/board/sifive/unmatched/unmatched.c b/board/sifive/unmatched/unmatched.c > > > index d90b252bae..8773b660fa 100644 > > > --- a/board/sifive/unmatched/unmatched.c > > > +++ b/board/sifive/unmatched/unmatched.c > > > @@ -16,9 +16,9 @@ void *board_fdt_blob_setup(void) > > > if (IS_ENABLED(CONFIG_OF_SEPARATE)) { > > > if (gd->arch.firmware_fdt_addr) > > > return (ulong *)gd->arch.firmware_fdt_addr; > > > - else > > > - return (ulong *)&_end; > > > } > > > + > > > + return (ulong *)&_end; > > > > is _end correct here? Doesn't the placement depend on CONFIG_SPL_BUILD and > > CONFIG_SPL_SEPARATE_BSS? > > > > I will have to leave this to Zong to comment as he introduced this via > commit 47d73ba4f4a4 ("board: sifive: overwrite board_fdt_blob_setup in > u-boot proper"). > > I don't know what user case that Zong wanted to support on Unleased > and Unmatched. Okay. The I think we can fix this correctly. We can probably use OF_BOARD in those boards, as long as the SPL generated DTB is always there and passed over to OpenSBI. > > > To sum up the other thread I think the overall approach here is not ideal. > > OF_SEPARATE is used in conjunction with SPL in these boards. What happens > > (assuming I didn't miss anything), is that SPL passes the DTB to OpenSBI, > > which in it turn copies to a1 before invoking U-Boot. > > But we are better of with stricter rules for DTB. > > - OF_SEPARATE means: I'll read the DTB from the U-Boot binary. > > - OF_BOARD: The board will somehow provide it. > > > > So II think the patch should look something along the lines of: > > > > if (IS_ENABLED(CONFIG_OF_SEPARATE)) { > > #ifdef CONFIG_SPL_BUILD > > /* FDT is at end of BSS unless it is in a different memory region */ > > if (IS_ENABLED(CONFIG_SPL_SEPARATE_BSS)) > > fdt_blob = (void *)&_image_binary_end; > > else > > fdt_blob = (void *)&__bss_end; > > #else > > /* FDT is at end of image */ > > fdt_blob = (void *)&_end; > > > > Missing #endif here?o Yea it wasn't supposed to be real code. > > > } > > > > if (IS_ENABLED(CONFIG_OF_BOARD)) { > > fdt_blob = (void *)gd->arch.firmware_fdt_addr; > > } > > > > > } > > > > > > int board_init(void) > > > -- > > Regards, > Bin Regards /Ilias