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 9A274CA0FED for ; Fri, 5 Sep 2025 08:20:18 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9FF818390D; Fri, 5 Sep 2025 10:19:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com 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; unprotected) header.d=ti.com header.i=@ti.com header.b="Sr8efHwx"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E6A54838E7; Fri, 5 Sep 2025 10:19:26 +0200 (CEST) Received: from lelvem-ot02.ext.ti.com (lelvem-ot02.ext.ti.com [198.47.23.235]) (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 B5EE583390 for ; Fri, 5 Sep 2025 10:19:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=anshuld@ti.com Received: from fllvem-sh03.itg.ti.com ([10.64.41.86]) by lelvem-ot02.ext.ti.com (8.15.2/8.15.2) with ESMTP id 5858JMsT3710752; Fri, 5 Sep 2025 03:19:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1757060362; bh=Gm447EMSkelUeLJID+gx+3d8AQiRrfYyO+yMp13s16Y=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Sr8efHwxUf0VaZD8Fmb1L2Zm8QBi80dsM4dAGQ+JW0bOY0Cmsm0B5bWv+dDac6g01 fxbTYg1FME+ZnSkY9K0ITMA5frnlhauXiWOZHNcSTzMMtijOmKmRKVULEVXpoKq6aT EZMN10J53E7j38+L3PQcrt2IVpOMOgVzPT03nDgM= Received: from DFLE113.ent.ti.com (dfle113.ent.ti.com [10.64.6.34]) by fllvem-sh03.itg.ti.com (8.18.1/8.18.1) with ESMTPS id 5858JMr7752741 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=FAIL); Fri, 5 Sep 2025 03:19:22 -0500 Received: from DFLE103.ent.ti.com (10.64.6.24) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.55; Fri, 5 Sep 2025 03:19:21 -0500 Received: from lelvem-mr05.itg.ti.com (10.180.75.9) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.55 via Frontend Transport; Fri, 5 Sep 2025 03:19:21 -0500 Received: from localhost (dhcp-172-24-233-105.dhcp.ti.com [172.24.233.105]) by lelvem-mr05.itg.ti.com (8.18.1/8.18.1) with ESMTP id 5858JK5s445388; Fri, 5 Sep 2025 03:19:21 -0500 From: Anshul Dalal To: CC: Anshul Dalal , , , , , , , , , , , , , , , , Subject: [PATCH -next v6 09/10] mach-k3: add reserved memory fixups for next boot stage Date: Fri, 5 Sep 2025 13:49:00 +0530 Message-ID: <20250905081902.489345-10-anshuld@ti.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250905081902.489345-1-anshuld@ti.com> References: <20250905081902.489345-1-anshuld@ti.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea 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.8 at phobos.denx.de X-Virus-Status: Clean The boot flow in K3 platforms requires the subsequent boot stages to be aware of the memory reserved for previous boot binaries. In the regular boot sequence of: R5 SPL -> ATF -> OP-TEE -> A-core SPL -> U-Boot -> Kernel, Both A-core SPL and U-Boot should be made aware of the memory reserved for ATF and OP-TEE from their device-tree. Currently this information is absent. Therefore this patch adds the reserved-memory regions as part of spl_perform_arch_fixups for the next stage's DT. This is called during both R5 and A-core SPL which fixes up the DT for their respective next stages: A-core SPL and U-Boot proper. Signed-off-by: Anshul Dalal --- arch/arm/mach-k3/common.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/arm/mach-k3/common.c b/arch/arm/mach-k3/common.c index abf4169d6b7..9c2fe92cf25 100644 --- a/arch/arm/mach-k3/common.c +++ b/arch/arm/mach-k3/common.c @@ -321,6 +321,17 @@ static __maybe_unused void k3_dma_remove(void) pr_warn("DMA Device not found (err=%d)\n", rc); } +void spl_perform_arch_fixups(struct spl_image_info *spl_image) +{ + void *fdt = spl_image_fdt_addr(spl_image); + + if (!fdt) + return; + + fdt_fixup_reserved(fdt, "tfa", CONFIG_K3_ATF_LOAD_ADDR, 0x80000); + fdt_fixup_reserved(fdt, "optee", CONFIG_K3_OPTEE_LOAD_ADDR, 0x1800000); +} + void spl_board_prepare_for_boot(void) { #if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF)) -- 2.50.1