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 C202AC4332F for ; Mon, 21 Nov 2022 17:42:10 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 11AD28539C; Mon, 21 Nov 2022 18:42:09 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.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=kernel.org header.i=@kernel.org header.b="hjwO+rhY"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 19F20853F5; Mon, 21 Nov 2022 18:42:07 +0100 (CET) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) (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 0B40C853E9 for ; Mon, 21 Nov 2022 18:42:05 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id AB9F4B81249; Mon, 21 Nov 2022 17:42:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2CE40C433D7; Mon, 21 Nov 2022 17:42:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669052524; bh=UkZcLL2ps11db1q+OC/uyhQ1LXxaRciE4XfvwYYMur0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hjwO+rhYCwxM+SXAtHa3iB09olUVhGlrSbq662b3FQYk0FUgb0GBCou8dXmWWbwCx q5t5MkTpxgI5SdPNPUfi72CXH1Drt5jsNN1qVcnTnEqduWITWGiA2+DgEPKDEyqbm1 V1Aqw85IbpJVLQ1xGhxjX1k5LwcAzV+8JyLiKL4LOvIPG0shnCtH4NLh5qYCBPAm8G N5QWSbYEBuqreONvxl5y1PxIPlYxr4n3aaOQ4dwH8eMnTLjDDiyTGFcPbou6HIrW0i pigcNJkSkovZIrjCoTSqRnQ+7kPMJPao5r/RDvYLsYI94HWLx61p5vy2gkAU9afjGC VgWkyvwNFxbAA== Received: by pali.im (Postfix) id C18FB7CC; Mon, 21 Nov 2022 18:42:01 +0100 (CET) Date: Mon, 21 Nov 2022 18:42:01 +0100 From: Pali =?utf-8?B?Um9ow6Fy?= To: Tom Rini , Marek =?utf-8?B?QmVow7pu?= , Simon Glass Cc: u-boot@lists.denx.de Subject: Re: [PATCH v2] board_f: Add support for CONFIG_OF_BOARD_FIXUP for XIP images Message-ID: <20221121174201.u3qoksqewebvpeve@pali> References: <20220827181220.471-1-pali@kernel.org> <20220828151929.32588-1-kabel@kernel.org> <20221101232303.7wdt7xrsalkydlan@pali> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20221101232303.7wdt7xrsalkydlan@pali> User-Agent: NeoMutt/20180716 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.6 at phobos.denx.de X-Virus-Status: Clean + Tom On Wednesday 02 November 2022 00:23:03 Pali Rohár wrote: > On Monday 10 October 2022 17:48:58 Simon Glass wrote: > > Hi, > > > > On Sun, 28 Aug 2022 at 09:19, Marek Behún wrote: > > > > > > From: Pali Rohár > > > > > > When U-Boot is running from flash memory (execute in place) then > > > gd->fdt_blob before relocation points to read-only flash memory. > > > > > > So U-Boot calls board_fix_fdt() with read-only gd->fdt_blob pointer which > > > cause immediate CPU crash when callback is trying to modify gd->fdt_blob. > > > > > > Fix this issue by introducing a new config option > > > OF_DTB_READONLY_BEFORE_RELOC which moves fix_fdt callback after the > > > reloc_fdt callback. This makes CONFIG_OF_BOARD_FIXUP working also if > > > U-Boot before relocation is not running from read/write (S)RAM memory. > > > > > > This is required for mpc85xx boards when booting from flash NOR. > > > > > > Signed-off-by: Pali Rohár > > > Signed-off-by: Marek Behún > > > --- > > > Changes since v1: > > > - just changed the new Kconfig option name and associated help string > > > --- > > > common/board_f.c | 8 +++++++- > > > dts/Kconfig | 6 ++++++ > > > 2 files changed, 13 insertions(+), 1 deletion(-) > > > > Can we just make this the normal behaviour? I think it makes more > > sense to change the FDT after we have relocated it. > > > > Regards, > > Simon > > Marek? Any comments?