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 95B04C54EED for ; Mon, 30 Jan 2023 10:17:45 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 279A981930; Mon, 30 Jan 2023 11:17:42 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=kicherer.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=kicherer.org header.i=@kicherer.org header.b="d/yfTt4z"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3C6DF8118B; Mon, 30 Jan 2023 11:17:40 +0100 (CET) Received: from mail.zeus06.de (www.zeus06.de [194.117.254.36]) (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 E80D183523 for ; Mon, 30 Jan 2023 11:17:34 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=kicherer.org Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=dev@kicherer.org DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=kicherer.org; h= mime-version:date:from:to:cc:subject:in-reply-to:references :message-id:content-type:content-transfer-encoding; s=k1; bh=o4p adWjJ8KThPYljqwsDqvNTteabTSFbAazKo83fwkw=; b=d/yfTt4zFL8Fkr9JreZ mQBFMphAUsWlO8+HuwstbZxe4HKhcaSguFOfh8qi5RbLYE9ulVEtPPsCEg5IAsdB Z3yiP/i7BWwl24pbDyS2ksxMThOCdcXzh/RflORWO+ujnaA0BnLciXM4rMY4d3B3 /bwwxePrpBPtYUvR/4gpAHdQ= Received: (qmail 1586393 invoked from network); 30 Jan 2023 11:17:33 +0100 Received: by mail.zeus06.de with ESMTPA; 30 Jan 2023 11:17:33 +0100 X-UD-Smtp-Session: l3s6476p2@THYBhnjzBtjCdf4e MIME-Version: 1.0 Date: Mon, 30 Jan 2023 11:17:33 +0100 From: Mario Kicherer To: Tom Rini Cc: u-boot@lists.denx.de, sbabic@denx.de, festevam@gmail.com, uboot-imx@nxp.com, daniel.schwierzeck@gmail.com, weijie.gao@mediatek.com, GSS_MTK_Uboot_upstream@mediatek.com, rick@andestech.com, ycliang@andestech.com Subject: Re: [PATCH v2 1/2] spl: spl_nor: add BOOT_DEVICE_NOR2 as alternative SPL_LOAD_IMAGE_METHOD In-Reply-To: References: <20230119152822.1214202-1-dev@kicherer.org> <20230119152822.1214202-2-dev@kicherer.org> <0f606ddab66a5dab3b8f0bcb856a73f3@kicherer.org> Message-ID: <313895737b1a6bed0729bd2870ddf832@kicherer.org> X-Sender: dev@kicherer.org Content-Type: text/plain; charset=US-ASCII; format=flowed 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 2023-01-27 18:58, Tom Rini wrote: >> Okay, I think I understand your point now. I am not sure what's the >> best >> way to proceed here. Should I try to build all targets that contain >> BOOT_DEVICE_NOR and add a #define for BOOT_DEVICE_NOR2 if my patch >> really >> breaks the build? Or should I just add a #define BOOT_DEVICE_NOR2 to >> every >> #define BOOT_DEVICE_NOR? >> >> It looks like a change would be necessary in these files then: >> >> arch/arm/include/asm/arch-am33xx/spl.h >> arch/arm/include/asm/arch-orion5x/spl.h >> arch/arm/mach-k3/include/mach/j721e_spl.h >> arch/arm/mach-k3/include/mach/j721s2_spl.h >> arch/microblaze/include/asm/spl.h >> arch/powerpc/include/asm/spl.h >> >> > Ah, OK. Keep in mind that MMC1/MMC2 are for different physical MMC >> > devices on a given platform. I think this is more like the case where >> > you should be able to override spl_nor_get_uboot_base at the board level >> > to say if you're loading A or B? >> >> Ah yes, it's been a while since I wrote this patch originally. >> spl_nor_get_uboot_base() chooses between A and B and BOOT_DEVICE_NOR2 >> signals that I should choose the other one now. > > I think you should be able to solve this problem without making further > changes upstream, yes. I am not sure I understand your answer. Both ways I mentioned would probably require further changes. Or do you mean I should find a way to implement this only with board-specific code? I sent two additional patches to the mailing list: [PATCH] spl: spl_nor: use panic instead of hang if booting fails [PATCH] spl: spl-nor: return error if no valid image was loaded which would make this possible. However, I would prefer this patch series as it enables loading U-Boot from an alternate location without additional resets and relying on a boot counter. Best regards, Mario