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 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 E2715C433EF for ; Fri, 22 Apr 2022 12:21:42 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 50DAF83AE6; Fri, 22 Apr 2022 14:21:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=nic.cz Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; secure) header.d=nic.cz header.i=@nic.cz header.b="o1U+u2lp"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1137883AE6; Fri, 22 Apr 2022 14:21:38 +0200 (CEST) Received: from mail.nic.cz (mail.nic.cz [IPv6:2001:1488:800:400::400]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 93A6883D57 for ; Fri, 22 Apr 2022 14:21:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=nic.cz Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=marek.behun@nic.cz Received: from thinkpad (unknown [172.20.6.87]) by mail.nic.cz (Postfix) with ESMTPS id 3070D151166; Fri, 22 Apr 2022 14:21:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1650630094; bh=DwXJsG63RrCsd9YVJqaTN/qpApf4qaHxD0+hWtPQojI=; h=Date:From:To:Cc:Subject:From; b=o1U+u2lppDAtBWnPwQIFjOusLoZrPwsEkzMXo2J9tyH+z1g/gomLS8Nmcq4Foskvu IwlZPTsDkmozm4jPPhJlEoxUv5az14cbBJAhppEmGO11lNf1AvJNJclB2sGG8/094v zNplGwr20fJIw8VVXHL2G7niyUbbPqELjAUVU4gk= Date: Fri, 22 Apr 2022 14:21:33 +0200 From: Marek =?UTF-8?B?QmVow7pu?= To: Pali =?UTF-8?B?Um9ow6Fy?= Cc: Stefan Roese , u-boot@lists.denx.de Subject: Re: [PATCH u-boot-marvell 2/8] arm: mvebu: turris_omnia: Provide env_sf_get_env_addr() function Message-ID: <20220422142133.042e757b@thinkpad> In-Reply-To: <20220422114943.cgpeykx4i6ofyt3b@pali> References: <20220302114758.21787-1-pali@kernel.org> <20220302114758.21787-3-pali@kernel.org> <20220302133725.6dde7559@dellmb> <20220422114943.cgpeykx4i6ofyt3b@pali> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 On Fri, 22 Apr 2022 13:49:43 +0200 Pali Roh=C3=A1r wrote: > On Wednesday 02 March 2022 13:37:25 Marek Beh=C3=BAn wrote: > > On Wed, 2 Mar 2022 12:47:52 +0100 > > Pali Roh=C3=A1r wrote: > > =20 > > > BootROM maps SPI Flash to fixed address 0xD4000000 and this mapping is > > > active also when BootROM is executing binary kwbimage headers, which > > > includes also U-Boot SPL. > > >=20 > > > Therefore no initialization code is required to access SPI Flags from > > > U-Boot SPL. In proper U-Boot it is remapped to other location. > > >=20 > > > So in mvebu implementation of env_sf_get_env_addr() function returns > > > 0xD4000000 when running in SPL and NULL when in proper U-Boot. > > >=20 > > > This change would allow to use U-Boot ENV in U-Boot SPL. Normally it = is not > > > possible to read ENV because it is too big and U-Boot SPL does not ha= ve > > > such big malloc() pool to real all ENV variables. > > >=20 > > > Signed-off-by: Pali Roh=C3=A1r > > > --- > > > board/CZ.NIC/turris_omnia/turris_omnia.c | 10 ++++++++++ > > > 1 file changed, 10 insertions(+) > > >=20 > > > diff --git a/board/CZ.NIC/turris_omnia/turris_omnia.c b/board/CZ.NIC/= turris_omnia/turris_omnia.c > > > index 33cec6587e19..a93af6c5b877 100644 > > > --- a/board/CZ.NIC/turris_omnia/turris_omnia.c > > > +++ b/board/CZ.NIC/turris_omnia/turris_omnia.c > > > @@ -243,6 +243,16 @@ static bool omnia_detect_sata(void) > > > return stsword & MSATA_IND_STSBIT ? true : false; > > > } > > > =20 > > > +void *env_sf_get_env_addr(void) > > > +{ > > > + /* SPI Flash is mapped to address 0xD4000000 only in SPL */ > > > +#ifdef CONFIG_SPL_BUILD > > > + return (void *)0xD4000000 + CONFIG_ENV_OFFSET; > > > +#else > > > + return NULL; > > > +#endif =20 > >=20 > > if (IS_ENABLED(CONFIG_SPL_BUILD)) > > return (void *)0xD4000000 + CONFIG_ENV_OFFSET; > > else > > return NULL; > >=20 > > Marek =20 >=20 > This does not work. CONFIG_ENV_OFFSET is not defined. >=20 > All this code needs to be filtered out via preprocessor. OK. In that case: Reviewed-by: Marek Beh=C3=BAn