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 EBDA1C4332F for ; Thu, 22 Dec 2022 00:47:54 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5F6158532E; Thu, 22 Dec 2022 01:47:14 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1671670034; bh=wgB82SlK3LjUEHsxktc/+NtnOgIcW99yzytjReEhq7g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=n6/J6/ey2/eyWddIo4IpHnrf61d+7NysHOwfyMmmCjHY5QXpqm+m5u4rk3Jx/VeIn vV3qaxl09xWUvxLeeEF+5LhUmEkccOUQl0qf6AdwyKC01Wc6eTx3SFoXl3AtvyKzwR 1F6WVKvD29LwqP2kw4KFY1PlvCmW4llGMvayWYgyaceAsKxk6TtjMDPUWlVHvigKm7 XyloYd7zPShGGsIbawGD5dP6+gpRsg8EE1hT4r7dMEURGcC0JZZhrC6qZgqesK1aMQ 97zj3IwOfQecfgUqsBIjZ+NV9Xl9g4TRb2X3fOBSK3oXMTYXGphqxCRkaRNhabHSBw NXqdwVK26WF+A== Received: from tr.lan (ip-86-49-120-218.bb.vodafone.cz [86.49.120.218]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 14A2F8521D; Thu, 22 Dec 2022 01:47:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1671670023; bh=wgB82SlK3LjUEHsxktc/+NtnOgIcW99yzytjReEhq7g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kchpDPf8GxdEcgNzgh6zS1J8hNEyeyTwVp+kvvfq2vmthR5a2921tyuO6zGVHK3WN WIy59FmQaUiPHtxfO0fI0E3nm+gtg9Rh6IzxaF6vU+VAAQviXpcmr2w+ULDNjwZpzZ NBGPOu+rah8UvWwDum3QM6w1ZczsAzMkQ3Ib+F6rPxJ8BFYV+bP7jEOMgfNs3ppcyz owmi9Fi4i2LP6EWqbiEnlje+mJ0t9VRYn/pol0dKL9mqAz7fL7R/k4aHG6+mzAM+1R gDLoKCFGPBdTN8umWVxP8UkNSaalcrSLZiCy/jc7w5hdTacCQfem374XgDfsU7EHLz Y7vBgS4AqCrDw== From: Marek Vasut To: u-boot@lists.denx.de Cc: Marek Vasut , "Ariel D'Alessandro" , "NXP i.MX U-Boot Team" , "Ying-Chun Liu (PaulLiu)" , Adam Ford , Andrejs Cainikovs , Fabio Estevam , Manoj Sai , Marcel Ziswiler , Michael Trimarchi , Peng Fan , Ricardo Salveti , Simon Glass , Stefano Babic , Tim Harvey , Ye Li Subject: [PATCH 05/10] arm: imx: imx8m: Only use ROM pointers if not PSCI provider Date: Thu, 22 Dec 2022 01:46:38 +0100 Message-Id: <20221222004643.1013095-5-marex@denx.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221222004643.1013095-1-marex@denx.de> References: <20221222004643.1013095-1-marex@denx.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 The ROM pointers are in fact populated by the ATF BL31 blob, in case U-Boot itself if the PSCI provider, there is no ATF BL31 blob, hence ignore the ROM pointers. Signed-off-by: Marek Vasut --- Cc: "Ariel D'Alessandro" Cc: "NXP i.MX U-Boot Team" Cc: "Ying-Chun Liu (PaulLiu)" Cc: Adam Ford Cc: Andrejs Cainikovs Cc: Fabio Estevam Cc: Manoj Sai Cc: Marcel Ziswiler Cc: Michael Trimarchi Cc: Peng Fan Cc: Ricardo Salveti Cc: Simon Glass Cc: Stefano Babic Cc: Tim Harvey Cc: Ye Li --- arch/arm/mach-imx/imx8m/soc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c index 5e92f8143cf..96c6e69aae4 100644 --- a/arch/arm/mach-imx/imx8m/soc.c +++ b/arch/arm/mach-imx/imx8m/soc.c @@ -238,7 +238,7 @@ int dram_init(void) return ret; /* rom_pointer[1] contains the size of TEE occupies */ - if (rom_pointer[1]) + if (!IS_ENABLED(CONFIG_ARMV8_PSCI) && rom_pointer[1]) gd->ram_size = sdram_size - rom_pointer[1]; else gd->ram_size = sdram_size; @@ -267,7 +267,7 @@ int dram_init_banksize(void) } gd->bd->bi_dram[bank].start = PHYS_SDRAM; - if (rom_pointer[1]) { + if (!IS_ENABLED(CONFIG_ARMV8_PSCI) && rom_pointer[1]) { phys_addr_t optee_start = (phys_addr_t)rom_pointer[0]; phys_size_t optee_size = (size_t)rom_pointer[1]; @@ -312,7 +312,7 @@ phys_size_t get_effective_memsize(void) sdram_b1_size = sdram_size; } - if (rom_pointer[1]) { + if (!IS_ENABLED(CONFIG_ARMV8_PSCI) && rom_pointer[1]) { /* We will relocate u-boot to Top of dram1. Tee position has two cases: * 1. At the top of dram1, Then return the size removed optee size. * 2. In the middle of dram1, return the size of dram1. @@ -344,7 +344,8 @@ phys_size_t board_get_usable_ram_top(phys_size_t total_size) * rom_pointer[1] stores the size TEE uses. * We need to reserve the memory region for TEE. */ - if (rom_pointer[0] && rom_pointer[1] && top_addr > rom_pointer[0]) + if (!IS_ENABLED(CONFIG_ARMV8_PSCI) && rom_pointer[0] && + rom_pointer[1] && top_addr > rom_pointer[0]) top_addr = rom_pointer[0]; return top_addr; -- 2.35.1