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 8187EEB64DD for ; Sun, 16 Jul 2023 13:08:42 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 88982863D5; Sun, 16 Jul 2023 15:07:54 +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="RfvqAWUQ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6090B801FE; Sun, 16 Jul 2023 10:10:53 +0200 (CEST) Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) (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 2454384460 for ; Sun, 16 Jul 2023 10:10:51 +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-ej1-x630.google.com with SMTP id a640c23a62f3a-992acf67388so440492266b.1 for ; Sun, 16 Jul 2023 01:10:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689495050; x=1692087050; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UvYuwfXjqiI88PzlaUIHFBxhc1VWQVUGurSfj6vcZZo=; b=RfvqAWUQuty7ILr9EY+GNp8yVCTq9S7PnraWBzSx0qNCS2ym59wACL5HpgJciENATr wRupGvd0/JMWFTJL7mpI6HG0MX5tbj9DqZeiopBrGc5j+RH8OOQ10UFL8e2PCYWYwgFi u/5HH+XYAHZjZE14FZrQlwbRXAmGE8cBGejYVyZim13DnREJsmfovsQ5cNVOXCycZlGF u56eR+roTUOuLXQqLp8E2l2gZHOTPCzDoozat+9QgDFUYwS1Lqs+bk84svxhmNNZZwJq 4NvolsTVSV3IGc21TcN/tnmb+dPwG1dGIrkbf2xY84N69xyvl3ZK42RrMPo6W+zpLpmN PHZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689495050; x=1692087050; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UvYuwfXjqiI88PzlaUIHFBxhc1VWQVUGurSfj6vcZZo=; b=VHHwiqLnJpdCIjK41JKblzrcPgasu1kegrHpk88p8u+GaURB0YvaMgFFWXu/W79WMA 9538K2In/Lf8fNvPXbc3VCdW06XYoqluXhXN/2LLQZeqGhBdQKIjLwuw6/jCBCG4ig55 Kd1PKH9ay1rjspKblyekFKkTFWeaCwWRIbAT6wdvHQ+7hschApgWIKfTyv+L0GnTPP+c /qB7x2QjXzKmUkN3MyXFuu1Y+0xJpdpGKhEYCBCV9UWs4cQ3P+IJktWn3kltrR31xruA 2TeEa1Fw4Pxbft0I6pq0ir3PB9M3Gsl7R+27GMlMNDxJGaNgmV1cklKptcvpf4+WT6EN VzZg== X-Gm-Message-State: ABy/qLalcjAlZnt7W5Ktsd1uEFhoXCEs4mTErsieE6VhvWxbESoPnBM5 A5Vo/Z2gxw47n/K3wfW7bCeombNx1Q== X-Google-Smtp-Source: APBJJlH86GBttP/ZGeP39UoNgCbU3OHh5EzRwZzyaA5WQbO1JTmktC//H4Dk01CR4PM7owj/pI7t0w== X-Received: by 2002:a17:906:18f:b0:96a:52e:5379 with SMTP id 15-20020a170906018f00b0096a052e5379mr8184340ejb.63.1689495050646; Sun, 16 Jul 2023 01:10:50 -0700 (PDT) Received: from U4.fritz.box ([2001:9e8:b94c:4700:19f7:e833:87a:bd6]) by smtp.gmail.com with ESMTPSA id gr10-20020a170906e2ca00b0098d25cbb899sm7613657ejb.41.2023.07.16.01.10.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Jul 2023 01:10:50 -0700 (PDT) From: Alex Bee To: u-boot@lists.denx.de, Kever Yang , Philipp Tomsich , Simon Glass Cc: Alex Bee Subject: [PATCH v1 5/5] optee: Support Rockchip OPTEE binaries Date: Sun, 16 Jul 2023 10:10:34 +0200 Message-ID: <20230716081034.1196995-6-knaerzche@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230716081034.1196995-1-knaerzche@gmail.com> References: <20230716081034.1196995-1-knaerzche@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Sun, 16 Jul 2023 15:07:42 +0200 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 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 | 9 +++++++++ common/spl/spl_optee.S | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig index 9f12524aeb..41a9c4fe95 100644 --- a/arch/arm/mach-rockchip/Kconfig +++ b/arch/arm/mach-rockchip/Kconfig @@ -449,6 +449,15 @@ 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_FIT && SPL_OPTEE_IMAGE + default y if ROCKCHIP_RK3036 || ROCKCHIP_RK3128 || ROCKCHIP_RK3288 + 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) -- 2.41.0