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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC3A7C433F5 for ; Thu, 7 Oct 2021 17:13:22 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 3DCD16113E for ; Thu, 7 Oct 2021 17:13:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3DCD16113E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CDFB78350C; Thu, 7 Oct 2021 19:13:19 +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="ZBx9cruq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AC0C38350C; Thu, 7 Oct 2021 19:13:17 +0200 (CEST) Received: from mail-oi1-x22d.google.com (mail-oi1-x22d.google.com [IPv6:2607:f8b0:4864:20::22d]) (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 5900E83508 for ; Thu, 7 Oct 2021 19:13:14 +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=mr.nuke.me@gmail.com Received: by mail-oi1-x22d.google.com with SMTP id a3so9924121oid.6 for ; Thu, 07 Oct 2021 10:13:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=kWNPhbOu+7vuaQO4crTSDg8LwHDoSbrgsTdidHuVNJI=; b=ZBx9cruq3EYs5JrZBilvyO1U6o7A6BSNBj4majx3YAKa8wJrPK07KY2XpiX5r8WRXH x9df6/stSFGjdmEt3lAj8fYBGeudQoqBoHArrlrsKVyrpoYyi9Dz+CcRn14TR+jHEjHN 6MZT10/HNAb7ZHjpvaLTwhZ9TZcxpfY5olGH0AeaLlclmzhFXau1f36MmVZGhSvnvhQL 3RGq4NUto9C0BprPD6Ls9mHgp0x+gXNALq2zCXRoOvmwuBivVV/OFEbsyp+Aq4Kns3uC OWTVbdHsqlPIyRnCePRa2sSWuRZHhpFmeLZU72kNkPY5SIpTQ304ranZ4YGluYUs1XrR IwNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=kWNPhbOu+7vuaQO4crTSDg8LwHDoSbrgsTdidHuVNJI=; b=EkKHlCmhVuiG4KlwQpvvzX5vxNL0lfGFUHZPbIINbLnG0gdYCrgkECOgX/04xh5Cc4 MIzXU/IldjKMgTCfX0RNNjUIef546zQtN5KzvMNqv6VhrXit0JN6w9EIBsLjSTidCs8R nBltWgCqWcDfO8G4pT6ei66ouKZ2QgU2WnADMRagpQD0xuxnG5Df6orT6XjF+EIvkr/Q 70beZ7vdt1wyj6qUZhI7PUyywS0XTyuckjtZ5HwsjYyV0iyJKhfBnUuY0LdnBHzjbaye V8fDrJyWGPPuGOr4B+I+CfVxQOTjG9aaEhvOxExGgrLipmYTQehxiD4MBBZ9zIYkIWLi J3rQ== X-Gm-Message-State: AOAM531AWexvvNszje0mATs+Wx1zLxLH17O8felvwJ4xOizoVvy7O+cB 90dhtZgTH9niGOFHenY4BFgPEbt+6OU= X-Google-Smtp-Source: ABdhPJzkjcwFA23WpuioskeM826HbxOEmpWGMfSQgpC4deUzskONhAP0GmBMm9yrI6iIT0pc+g3iDg== X-Received: by 2002:a05:6808:21a8:: with SMTP id be40mr2229225oib.20.1633626792834; Thu, 07 Oct 2021 10:13:12 -0700 (PDT) Received: from nuclearis3.gtech (c-98-195-139-126.hsd1.tx.comcast.net. [98.195.139.126]) by smtp.gmail.com with ESMTPSA id bl23sm7248oib.40.2021.10.07.10.13.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 07 Oct 2021 10:13:12 -0700 (PDT) Subject: Re: [PATCH 0/3] stm32mp: Attempt to resolve unintended breakage with v2021.10-rc2 To: Patrick DELAUNAY , u-boot@lists.denx.de Cc: patrice.chotard@foss.st.com, uboot-stm32@st-md-mailman.stormreply.com, marex@denx.de, etienne.carriere@linaro.org References: <20210909145536.2979951-1-mr.nuke.me@gmail.com> From: "Alex G." Message-ID: Date: Thu, 7 Oct 2021 12:13:11 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean Hi Patrick, On 9/14/21 7:26 AM, Patrick DELAUNAY wrote: > Hi Alexandru, > I think you need to update  arch/arm/mach-stm32mp/Kconfig > > > something like: > > >  config STM32MP15x >      bool "Support STMicroelectronics STM32MP15x Soc" > -    select ARCH_SUPPORT_PSCI if !TFABOOT > -    select ARM_SMCCC if TFABOOT > +    select ARCH_SUPPORT_PSCI if !TFABOOT && !SPL_OPTEE_IMAGE > +    select ARM_SMCCC if TFABOOT || SPL_OPTEE_IMAGE >      select CPU_V7A > -    select CPU_V7_HAS_NONSEC if !TFABOOT > +    select CPU_V7_HAS_NONSEC if !TFABOOT && !SPL_OPTEE_IMAGE >      select CPU_V7_HAS_VIRT >      select OF_BOARD_SETUP >      select PINCTRL_STM32 > @@ -47,8 +47,8 @@ config STM32MP15x >      select STM32_SERIAL >      select SYS_ARCH_TIMER >      imply CMD_NVEDIT_INFO > -    imply SYSRESET_PSCI if TFABOOT > -    imply SYSRESET_SYSCON if !TFABOOT > +    imply SYSRESET_PSCI if TFABOOT || SPL_OPTEE_IMAGE > +    imply SYSRESET_SYSCON if !TFABOOT && !SPL_OPTEE_IMAGE >      help >          support of STMicroelectronics SOC STM32MP15x family >          STM32MP157, STM32MP153 or STM32MP151 > @@ -153,7 +153,7 @@ config NR_DRAM_BANKS This is a terrible idea. We're trying to answer a few questions: * Did the FSBL provide a PSCI secure monitor * Is u-boot running in normal or secure world But instead of clearly defining those answers, we're trying to infer them from other config options. This is confusing to start with, but it's also wrong. For example, SPL_OPTEE_IMAGE means "we support OPTEE images in SPL". It doesn't mean that we loaded an OP-TEE kernel at all. SPL with SPL_OPTEE_IMAGE may as well boot a legacy uboot image -- nothing prevents it. So to infer from this that u-boot runs in the normal world is wrong. Without loss of generality, any CONFIG that conflates u-boot options with SPL options is likely to cause some changes down the line. > So just introduce CONFIG_TFABOOT_FIP_CONTAINER don't solve all the > issues.... > > > I think you need to manage CONFIG_SPL_OPTEE_IMAGE > to handle specific case when OPTEE is running after SPL. Sure, but I'd have to adjust this at runtime, not in Kconfig for the reasons above. > I try to experiment the OPTEE load by SPL but I don't see how > the OP-TEE pager can be managed by SPL in the current code. > It must loaded in SYRAM at 0x2ffc0000, with a risk to overwrite the SPL > code loaded by rom code at 0x2ffc2500. This consideration is not unique to SPL. I don't have that problem because SPL loads OP-TEE to DRAM at 0xde000000. If OP-TEE wants to load parts of itself to SYSRAM, that happens after SPL passed control, so the conflict is not relevant. > or how to manage several binary, see OP-TEE header v2 support in OP-TEE, > > Several file it is already supported in TF-A BL2 with FIP: > > tee-header_v2.bin > tee-pager_v2.bin > tee-pageable_v2.bin I don't know how to use use the OP-TEE pager with SPL, so I elected not to: EXTRA_OEMAKE = "PLATFORM=${OPTEE_PLATFORM} \ CFG_WITH_PAGER=n \ CFG_NS_ENTRY_ADDR=${KERNEL_UIMAGE_LOADADDRESS} \ CROSS_COMPILE=${HOST_PREFIX} \ CFG_TEE_CORE_DEBUG=y \ CFG_TEE_CORE_LOG_LEVEL=2 \ ${TZDRAM_FLAGS} \ " TZDRAM_FLAGS = "CFG_TZDRAM_START= 0xde000000\ CFG_DRAM_SIZE=0x20000000 " Alex