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 4CAF2EB64DC for ; Thu, 20 Jul 2023 07:39:14 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7630284782; Thu, 20 Jul 2023 09:39:12 +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="ApSu5rqH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 027C98471A; Thu, 20 Jul 2023 09:39:11 +0200 (CEST) Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) (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 EE942856A7 for ; Thu, 20 Jul 2023 09:39: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=knaerzche@gmail.com Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-51f7fb9a944so612332a12.3 for ; Thu, 20 Jul 2023 00:39:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689838746; x=1690443546; h=content-transfer-encoding:in-reply-to:from:cc:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=6z7t8/R4/UNaXlDr3wm8zWL6HHRzbONuM4caCIuaWng=; b=ApSu5rqHWJDf2oGSheoZB/Hs7L7dh7ZitWu0GNeMnXdeVZ3QzKNlXc2hnlWwF6NQaH al3FMyBe7LQUM0fPIS+31EIpqnd51HDu7s+YpTHnfDq16CNXqCy0IKaKFBAFLhrx94x6 i/HiJUvHpugIuk7qnKGR6eXaJNyWzbr/N5zWT548bHy0cU19FVU+f+sjjD7AYIJooTnd Hy2yFFlM8PO+hU01DvmOOAy0COin1koZCAkiVW18aDx+VPS2yn93njEVGxVR7WNyP9Mk zjAi/T3Qj6ho507tINVzeA6NCgcDhPJyfWr1VcWW52ICIQ86KCRNKU7koOgaCjNuJIT8 4uuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689838746; x=1690443546; h=content-transfer-encoding:in-reply-to:from:cc:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6z7t8/R4/UNaXlDr3wm8zWL6HHRzbONuM4caCIuaWng=; b=XMJdgXB4lAWtrcGdh6TFqb85DhnOmj+dTGejkwv2Ei3yC7xYlnmrzenCnCRA87MwO+ 0/5VfOes5cKz4LPOl9Jt/imCREgbzXd+IKTKEwnwQBZAzSfh70n8Tj3JMKOOvZAJXGY8 6fnFdy30kAh+jmjHBTYE8pJsnNd/6vGgH8HOgdUXaj7R8AnKSbQny0MNrt5JZ9B90hC4 oOzwiNrLR4h0eff9EzTPk2bvZnamqYmkUfCf0DsMGFsm6BaVAAdpJfGT8fq8UY8kThIY LOZczqh/llpAqTtD/S1v7ZpGdvczfcvpfxXiJ32DBrSd4sinyzMywQUXYmZ+1HA+ZSQ6 qyAg== X-Gm-Message-State: ABy/qLaicAWpo/SYcg0WcnKQLTyhXEIE9SiBmhJ+KyYlKPdWgNo7JanR KSCo3Qo0mW6+5hxc6TrkJA== X-Google-Smtp-Source: APBJJlGOSHYXNAanaBspenHxsx8h08UE288Tsa7LrGJH+WCYSE+mYaADV6iDVv2UbXT2u73feaAgPQ== X-Received: by 2002:aa7:c496:0:b0:521:d75d:ef69 with SMTP id m22-20020aa7c496000000b00521d75def69mr1111441edq.31.1689838746290; Thu, 20 Jul 2023 00:39:06 -0700 (PDT) Received: from ?IPV6:2001:9e8:b977:1800:843e:f62:5e13:c6f4? ([2001:9e8:b977:1800:843e:f62:5e13:c6f4]) by smtp.gmail.com with ESMTPSA id i11-20020aa7c70b000000b0051bfc7763c2sm362010edq.25.2023.07.20.00.39.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 20 Jul 2023 00:39:05 -0700 (PDT) Message-ID: <72f61407-204b-b2c8-78b8-2ea3c8874068@gmail.com> Date: Thu, 20 Jul 2023 09:39:04 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v2 5/5] optee: Support Rockchip OP-TEE binaries Content-Language: en-US To: Kever Yang , u-boot@lists.denx.de References: <20230716081034.1196995-1-knaerzche@gmail.com> <20230718145715.1280201-1-knaerzche@gmail.com> <20230718145715.1280201-6-knaerzche@gmail.com> <4fd45ec4-bc18-1d92-ebb4-8aa40dcddccf@rock-chips.com> Cc: Philipp Tomsich , Simon Glass , =?UTF-8?Q?Heiko_St=c3=bcbner?= From: Alex Bee In-Reply-To: <4fd45ec4-bc18-1d92-ebb4-8aa40dcddccf@rock-chips.com> Content-Type: text/plain; charset=UTF-8; format=flowed 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.8 at phobos.denx.de X-Virus-Status: Clean Hi Kever, Am 19.07.23 um 09:28 schrieb Kever Yang: > 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 for your review. I'm aware of Heiko's ATF BL32 implemenation for RK3288. But what about RK3128/RK3036? They might wwork w/o RK OPTEE-binaries in regards of SMP bringup, but still you have no TEE. You're right: It's not strictly required to have support for RK OPTEE-binaries, but also it doesn't hurt and it's fully optional to use it for those SoCs. Besides RK's TEE-implementations provide some more services via SMCC calls (DVFS for DRAM, for instance) which are not supported (yet) by upstream variants. I don't like the requirement of this patch either, but unfortunately the TEE binaries RK provides are built with wrong/incompatible flags. Regards, Alex > > 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)