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 9A47DC4332F for ; Mon, 21 Nov 2022 18:11:05 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 58F49853F5; Mon, 21 Nov 2022 19:11:03 +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="mgTkUJpl"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 584B9853B7; Mon, 21 Nov 2022 19:11:01 +0100 (CET) Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) (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 486528538A for ; Mon, 21 Nov 2022 19:10:59 +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=kabel@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 D51CFB81232; Mon, 21 Nov 2022 18:10:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9AFE7C433D6; Mon, 21 Nov 2022 18:10:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669054257; bh=X8w4iSqOErnArG0SalVwnA/l+qiSWeVXEJ1IIrnwtvM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=mgTkUJpl4DOpTL0CdvY66BdS5TTSB61VYZpjqT4lNADnatC0m0RWOBNUlcCYo82xV NUSHdtBHUrP0+tfIEw9x+D03ExRk1GZCzE5cB+cu/vOaZPfdJlZ9L9sVGYNYmtleRG NtmwRZeSoGG0bp0eGo3IY4YI1deDjLMmBQSPzRjGCiUqtljN05+zF/t3D5bgA9PSDV /fF7TnlifPGrdlg9bBFWh9z74liosQ6E43/I3nX34kvlb9xVNhslk5yYMtn4y/z/Vj q9ISXl8E3hFu4DQ4mrx0AxnpZaNHN2du2WVY2ONa2LwAowdrveVm6hiPnlXCfsQP3n BkgJlgwYmNB7A== Date: Mon, 21 Nov 2022 19:10:16 +0100 From: Marek =?UTF-8?B?QmVow7pu?= To: Tom Rini , Pali =?UTF-8?B?Um9ow6Fy?= , 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: <20221121191016.1da238e8@thinkpad> In-Reply-To: <20221121174532.GX7282@bill-the-cat> References: <20220827181220.471-1-pali@kernel.org> <20220828151929.32588-1-kabel@kernel.org> <20221101232303.7wdt7xrsalkydlan@pali> <20221121174201.u3qoksqewebvpeve@pali> <20221121174532.GX7282@bill-the-cat> X-Mailer: Claws Mail 4.1.0 (GTK 3.24.34; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Mon, 21 Nov 2022 12:45:32 -0500 Tom Rini wrote: > On Mon, Nov 21, 2022 at 06:42:01PM +0100, Pali Roh_r wrote: > > + 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. > > Can we? > Sorry, I didn't notice this thread. Do we know if there aren't boards that change fdt before reloc? Marek