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 00674EB64DA for ; Wed, 19 Jul 2023 07:29:04 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7E2658469F; Wed, 19 Jul 2023 09:29:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 5985380181; Wed, 19 Jul 2023 09:28:59 +0200 (CEST) Received: from mail-m11886.qiye.163.com (mail-m11886.qiye.163.com [115.236.118.86]) (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 BCBAA8675B for ; Wed, 19 Jul 2023 09:28:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=rock-chips.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kever.yang@rock-chips.com Received: from [192.168.60.65] (unknown [103.29.142.67]) by mail-m11886.qiye.163.com (Hmail) with ESMTPA id 2DAA7801AA; Wed, 19 Jul 2023 15:28:38 +0800 (CST) Message-ID: <4fd45ec4-bc18-1d92-ebb4-8aa40dcddccf@rock-chips.com> Date: Wed, 19 Jul 2023 15:28:37 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v2 5/5] optee: Support Rockchip OP-TEE binaries Content-Language: en-US To: Alex Bee , u-boot@lists.denx.de, Philipp Tomsich , Simon Glass , =?UTF-8?Q?Heiko_St=c3=bcbner?= References: <20230716081034.1196995-1-knaerzche@gmail.com> <20230718145715.1280201-1-knaerzche@gmail.com> <20230718145715.1280201-6-knaerzche@gmail.com> From: Kever Yang In-Reply-To: <20230718145715.1280201-6-knaerzche@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFITzdXWS1ZQUlXWQ8JGhUIEh9ZQVlDSUJIVkxLGE4YQxkZSBlKQ1UTARMWGhIXJBQOD1 lXWRgSC1lBWUpLSFVJQlVKT0lVTUxZV1kWGg8SFR0UWUFZT0tIVUpKS0hKTFVKS0tVS1kG X-HM-Tid: 0a896d0d0a752ebakusn2daa7801aa X-HM-MType: 1 X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6OTo6CTo4Pz1DTA8xMQoVKTc3 DREKCj9VSlVKTUNCTE5KTEpCS09IVTMWGhIXVRAeDR4JVQIaFRw7CRQYEFYYExILCFUYFBZFWVdZ EgtZQVlKS0hVSUJVSk9JVU1MWVdZCAFZQUhNQko3Bg++ 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 Hi Alex, On 2023/7/18 22:57, Alex Bee wrote: > Currently the only ARM Rockchip SoC which is supported by upstream > optee-os is RK322x. For all other ARM SoCs a > vendor-provided OP-TEE binary has to be used to have a TEE available. > Those are using a calling convension different from upstream optee-os. > > This introduces CONFIG_ROCKCHIP_OPTEE_BINARY which signals that any > of those vendor binaries is used and changes the calling convension > accordingly. > > Signed-off-by: Alex Bee > --- > arch/arm/mach-rockchip/Kconfig | 8 ++++++++ > common/spl/spl_optee.S | 4 ++++ > 2 files changed, 12 insertions(+) > > diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig > index 17dd43155d..83d8a2a056 100644 > --- a/arch/arm/mach-rockchip/Kconfig > +++ b/arch/arm/mach-rockchip/Kconfig > @@ -449,6 +449,14 @@ config ROCKCHIP_BOOT_MODE_REG > The Soc will enter to different boot mode(defined in asm/arch-rockchip/boot_mode.h) > according to the value from this register. > > +config ROCKCHIP_OPTEE_BINARY > + bool "Use a OP-TEE binary provided by Rockchip" > + depends on SPL_OPTEE_IMAGE > + default y if ROCKCHIP_RK3036 || ROCKCHIP_RK3128 || ROCKCHIP_RK3288     This patch is not need for now.     the  rk3036 works without OPTEE, and rk3288 is able to use ATF instead for OPTEE which upstreamed by Heiko. Thanks, - Kever > + help > + This option enables the usage of vendor-provided OP-TEE binaries. > + Say Y if you are using OP-TEE binary provided by Rockchip. > + > config ROCKCHIP_RK8XX_DISABLE_BOOT_ON_POWERON > bool "Disable device boot on power plug-in" > depends on PMIC_RK8XX > diff --git a/common/spl/spl_optee.S b/common/spl/spl_optee.S > index a269904d38..ea41d8adb6 100644 > --- a/common/spl/spl_optee.S > +++ b/common/spl/spl_optee.S > @@ -7,6 +7,10 @@ > #include > > ENTRY(spl_optee_entry) > +#ifdef CONFIG_ROCKCHIP_OPTEE_BINARY > + ldr r1, =CONFIG_TEXT_BASE > +#else > ldr lr, =CONFIG_TEXT_BASE > +#endif > mov pc, r3 > ENDPROC(spl_optee_entry)