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 ED57CEB64DA for ; Tue, 18 Jul 2023 14:58:20 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2AC0A86709; Tue, 18 Jul 2023 16:57:33 +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="qLVzs5vy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3348B866F0; Tue, 18 Jul 2023 16:57:24 +0200 (CEST) Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) (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 250B38668B for ; Tue, 18 Jul 2023 16:57:21 +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-x534.google.com with SMTP id 4fb4d7f45d1cf-52165886aa3so6554548a12.3 for ; Tue, 18 Jul 2023 07:57:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689692240; x=1692284240; 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=K5qiZPVsGZmJDee1b5pK83pLSO4Nv98Iz+WFeCFnaac=; b=qLVzs5vy1OxaW0fxVxyFAxY/DydFy8KzwhVbGqcVHcZQxXXiuXqJDv1l9NF/qL9SQR vBdLgc5yDvBK561xO9WE+DcXWclkCaCiLtlyJEFOzIkzJYvfqccSmk3/AabvLte9J+Aa FZYSepOI1ola08BbXP6160755LnOuVDeDt5uoi3j/oeOk3UCOu+3Uq0O6f/w8XIaH++d pehrmFu7LvQB2YDNHBXrNOYlTtkho2hyL01YWJmydJVWfIgtCY1ClI5tZ+rfb5Aj2aob n0a3VWlqUJNDioHNphpg0udkEDhG1t4uJgkgyUQLFw0CfpG5g95EySrdiwGibbBso2sM BfNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689692240; x=1692284240; 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=K5qiZPVsGZmJDee1b5pK83pLSO4Nv98Iz+WFeCFnaac=; b=DLN1AOqEpv7a+nsLvuNSa/DygKUSD3gqrLnu5c9bgVMxNbnH3rbtt/PPFsT0ql/jEA nCVHik1CenpBTf1HQnRrRU0TpfnhqTvAI3ryiW6ztt4FllN30uXUMLSLHyBPRhaJC76E aA8uK2xGNsxDV1pBRRIHV3pVMrIX31X26ZoU4M2dY3crd5iwLYXIfC/QxoyUZHr84HqA ZpNaXsh8X51LS0dj0NhnLZcBKAwiX+DMW+IhviaGmtMDkg3OiNwJVQbQjfQGW1kQTlVl ua2de5rTdwzxZk6uBdeG9sWA1dO7Yn/6oGLFd0z2U1MPQHgKsPuwSvMOLyS3pOvSKpC8 VniQ== X-Gm-Message-State: ABy/qLY90SnweT9owlvOEmgOR+dFZYuELljikff7MJCMrd6qE2bLywgP QPMGOb6cRZiFFcMHinxMpAxzOGyyBg== X-Google-Smtp-Source: APBJJlH/OgpGRZtvdmD3Qe8RIVH4/5FKMO+ugQ2oE1LB9Mro5hsjdQ5eR1ODhKmA+Sulv3/bRxbdQQ== X-Received: by 2002:a05:6402:1a41:b0:51d:d27a:6d3 with SMTP id bf1-20020a0564021a4100b0051dd27a06d3mr170197edb.11.1689692240677; Tue, 18 Jul 2023 07:57:20 -0700 (PDT) Received: from U4.fritz.box ([2001:9e8:b960:df00:3afe:540e:d7ee:98ac]) by smtp.gmail.com with ESMTPSA id f25-20020aa7d859000000b0051de20c59d7sm1340797eds.15.2023.07.18.07.57.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jul 2023 07:57:20 -0700 (PDT) From: Alex Bee To: u-boot@lists.denx.de, Kever Yang , Philipp Tomsich , Simon Glass Cc: Alex Bee Subject: [PATCH v2 5/5] optee: Support Rockchip OP-TEE binaries Date: Tue, 18 Jul 2023 16:57:15 +0200 Message-ID: <20230718145715.1280201-6-knaerzche@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230718145715.1280201-1-knaerzche@gmail.com> References: <20230716081034.1196995-1-knaerzche@gmail.com> <20230718145715.1280201-1-knaerzche@gmail.com> 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.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 | 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 + 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