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 EFF06C25B0D for ; Sat, 13 Aug 2022 04:36:08 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id ADE99849A4; Sat, 13 Aug 2022 06:36:06 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com 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=gmail.com header.i=@gmail.com header.b="EVL6QwEf"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 49D4C849A7; Sat, 13 Aug 2022 06:36:05 +0200 (CEST) Received: from mail-qt1-x834.google.com (mail-qt1-x834.google.com [IPv6:2607:f8b0:4864:20::834]) (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 72B37845D1 for ; Sat, 13 Aug 2022 06:36:02 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seanga2@gmail.com Received: by mail-qt1-x834.google.com with SMTP id e28so2187340qts.1 for ; Fri, 12 Aug 2022 21:36:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject:from:to:cc; bh=DEb9MunL2zpbHi+phJZZ7J3JW62bv5N+tRoyq6JiDvc=; b=EVL6QwEfbZGFoSXwcshLDL81lm7tt8H1yKSZavzLYH41UbIT5vN8Hb0h6PnZLmxzQx Wt0lGgcFfCi4OW+iUaBJZDi7LsGIa/tNyvY0vCrmR/aTcrLtdDpO4QMOrv4F+SYv1dOA Wq4jkGKw1+pW/xyy5fuk+3U1/ErNNLHnMj65D/2TI/gbK0gcpZyLgcKFxl+gKYsH2her t5IiN25KQhydN5DF+I02J0ktVdY7pFtd+fcMdEwriBJ4LYu7daFgWXYwiwZbrjPsjjE+ hXyCM3TpeOLtdTLGTDn9W2twutyUlYU2I/xPkzHf8ymmBmTTxXq8b6S4NdL9i87fCkgj 67hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject :x-gm-message-state:from:to:cc; bh=DEb9MunL2zpbHi+phJZZ7J3JW62bv5N+tRoyq6JiDvc=; b=esoacy1rbCKz647Z2SA2LPyjj7+0FVWQbW976/nYkF1uYE919NBr0EvaUuere1hJEu dGxzch6HFA5Mv8t3GNmqZ9eAHtxAVgpX63+51Ln5F5XdKRuhEuBpG3z3VdI6MwzWB2D3 Ma2ATML3A71GZ22gej+oX2WqssuoV/1P677n93nMRkh2dLyMBWKTuuSPpmURW+E/9SIH i9YkkRy0z2hezvRe+ZwZFPDdP0PF/p3M9re95wOS0QsSVBpEL5peyGA8JA3CT5u+nTPr ON2CfBd5FCtT6LFeAZaAMWJM6xb+aBMCErhGKM7iWeKe8Aqujqg2RartnfIpagFPWwn2 Go8A== X-Gm-Message-State: ACgBeo30Kp7TXR1BpdTi0Gr0XX5efn6gQfTXViopsj9QBBod5C55V8GJ qP1U2v1+IO2To/ZG0EtJ1iESjmf0Y78= X-Google-Smtp-Source: AA6agR66G0Li2hcPeepVfLPpyH1U2p/9H5lvAWyppzqR5+vshNpoGaQ34ACkOP4dg9cLgLopvQs48g== X-Received: by 2002:a05:622a:54a:b0:343:5a1a:9acd with SMTP id m10-20020a05622a054a00b003435a1a9acdmr6248372qtx.194.1660365360859; Fri, 12 Aug 2022 21:36:00 -0700 (PDT) Received: from [192.168.1.201] (pool-173-73-95-180.washdc.fios.verizon.net. [173.73.95.180]) by smtp.gmail.com with ESMTPSA id u11-20020a05620a430b00b006b99b78751csm3482511qko.112.2022.08.12.21.36.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 12 Aug 2022 21:36:00 -0700 (PDT) Subject: Re: [RFC PATCH 1/1] spl: introduce SPL_XIP to config To: Nikita Shubin Cc: linux@yadro.com, Nikita Shubin , Rick Chen , Leo , Simon Glass , Ilias Apalodimas , Heinrich Schuchardt , Sergei Miroshnichenko , Alexandru Gagniuc , Alper Nebi Yasak , Andrew Davis , u-boot@lists.denx.de References: <20220811093706.3772-1-nikita.shubin@maquefel.me> <20220811093706.3772-2-nikita.shubin@maquefel.me> From: Sean Anderson Message-ID: <9afeff6a-07f3-a951-c083-da8ad77a5031@gmail.com> Date: Sat, 13 Aug 2022 00:35:59 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20220811093706.3772-2-nikita.shubin@maquefel.me> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US 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 Hi Nikita, On 8/11/22 5:37 AM, Nikita Shubin wrote: > From: Nikita Shubin > > U-Boot and SPL don't necessary share the same location, so we might end > with XIP SPL and U-Boot in "normal" memory. > > This adds an option special for SPL to behave it in XIP manner and don't > use hart_lottery and available_harts_lock. > > Signed-off-by: Nikita Shubin > --- On a stylistic note, typically cover letters are not used for single patches (but feel free to use them for larger series). > arch/riscv/cpu/cpu.c | 2 +- > arch/riscv/cpu/start.S | 4 ++-- > arch/riscv/include/asm/global_data.h | 2 +- > arch/riscv/lib/asm-offsets.c | 2 +- > arch/riscv/lib/smp.c | 2 +- > common/spl/Kconfig | 5 +++++ > include/configs/scr7_vcu118.h | 2 ++ > 7 files changed, 13 insertions(+), 6 deletions(-) > > diff --git a/arch/riscv/cpu/cpu.c b/arch/riscv/cpu/cpu.c > index 9f5fa0bcb3..89528748d7 100644 > --- a/arch/riscv/cpu/cpu.c > +++ b/arch/riscv/cpu/cpu.c > @@ -19,7 +19,7 @@ > * The variables here must be stored in the data section since they are used > * before the bss section is available. > */ > -#ifndef CONFIG_XIP > +#if !defined(CONFIG_XIP) && !defined(CONFIG_SPL_XIP) Shouldn't this be #if CONFIG_IS_ENABLED(XIP) ? ditto for the rest of these > u32 hart_lottery __section(".data") = 0; > > /* > diff --git a/arch/riscv/cpu/start.S b/arch/riscv/cpu/start.S > index 26cb877ed1..d824990778 100644 > --- a/arch/riscv/cpu/start.S > +++ b/arch/riscv/cpu/start.S > @@ -122,7 +122,7 @@ call_board_init_f_0: > call_harts_early_init: > jal harts_early_init > > -#ifndef CONFIG_XIP > +#if !defined(CONFIG_XIP) && !defined(CONFIG_SPL_XIP) > /* > * Pick hart to initialize global data and run U-Boot. The other harts > * wait for initialization to complete. > @@ -155,7 +155,7 @@ call_harts_early_init: > /* save the boot hart id to global_data */ > SREG tp, GD_BOOT_HART(gp) > > -#ifndef CONFIG_XIP > +#if !defined(CONFIG_XIP) && !defined(CONFIG_SPL_XIP) > la t0, available_harts_lock > amoswap.w.rl zero, zero, 0(t0) > > diff --git a/arch/riscv/include/asm/global_data.h b/arch/riscv/include/asm/global_data.h > index 9a146d1d49..d71e09c5ab 100644 > --- a/arch/riscv/include/asm/global_data.h > +++ b/arch/riscv/include/asm/global_data.h > @@ -30,7 +30,7 @@ int iccm[CONFIG_NR_CPUS]; > #if CONFIG_IS_ENABLED(SMP) > struct ipi_data ipi[CONFIG_NR_CPUS]; > #endif > -#ifndef CONFIG_XIP > +#if !defined(CONFIG_XIP) && !defined(CONFIG_SPL_XIP) > ulong available_harts; > #endif > }; > diff --git a/arch/riscv/lib/asm-offsets.c b/arch/riscv/lib/asm-offsets.c > index f1fe089b3d..bcb3c78654 100644 > --- a/arch/riscv/lib/asm-offsets.c > +++ b/arch/riscv/lib/asm-offsets.c > @@ -16,7 +16,7 @@ int main(void) > { > DEFINE(GD_BOOT_HART, offsetof(gd_t, arch.boot_hart)); > DEFINE(GD_FIRMWARE_FDT_ADDR, offsetof(gd_t, arch.firmware_fdt_addr)); > -#ifndef CONFIG_XIP > +#if !defined(CONFIG_XIP) && !defined(CONFIG_SPL_XIP) > DEFINE(GD_AVAILABLE_HARTS, offsetof(gd_t, arch.available_harts)); > #endif > > diff --git a/arch/riscv/lib/smp.c b/arch/riscv/lib/smp.c > index ba992100ad..cef324954c 100644 > --- a/arch/riscv/lib/smp.c > +++ b/arch/riscv/lib/smp.c > @@ -45,7 +45,7 @@ static int send_ipi_many(struct ipi_data *ipi, int wait) > continue; > } > > -#ifndef CONFIG_XIP > +#if !defined(CONFIG_XIP) && !defined(CONFIG_SPL_XIP) > /* skip if hart is not available */ > if (!(gd->arch.available_harts & (1 << reg))) > continue; > diff --git a/common/spl/Kconfig b/common/spl/Kconfig > index 07c03d611d..f24e423fc0 100644 > --- a/common/spl/Kconfig > +++ b/common/spl/Kconfig > @@ -27,6 +27,11 @@ config SPL_FRAMEWORK > supports MMC, NAND and YMODEM and other methods loading of U-Boot > and the Linux Kernel. If unsure, say Y. > > +config SPL_XIP > + bool "Support SPL in XIP" > + help > + Enable this if SPL is in XIP memory. Can you add another sentence or two? What is "XIP memory"? How does it differ from the standard boot process? Also, it seems like we already have SPL_XIP_SUPPORT. Maybe we can reuse that? > config SPL_FRAMEWORK_BOARD_INIT_F > bool "Define a generic function board_init_f" > depends on SPL_FRAMEWORK > diff --git a/include/configs/scr7_vcu118.h b/include/configs/scr7_vcu118.h > index 34545255d1..8f3ba36ce1 100644 > --- a/include/configs/scr7_vcu118.h > +++ b/include/configs/scr7_vcu118.h > @@ -29,6 +29,8 @@ > #define SCR7_OCRAM_REGION_SIZE 0xffff > > #define SCR7L2_CACHE 1 > + > +#define CONFIG_SYS_UBOOT_BASE CONFIG_SYS_TEXT_BASE > #endif > > #define CONFIG_SYS_FLASH_BASE 0x00000fffff030000 > What is this part doing? It's not mentioned in the commit message. --Sean