From patchwork Thu Apr 1 10:35:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 413571 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp433192jai; Thu, 1 Apr 2021 03:35:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyZ3dCunIH8pWeifzmMY63zGQkAdVDjaSTh4FYO1PKhYz+ZvTXbgZQ0C3JNCY+cGvMiJ7F X-Received: by 2002:a17:906:2ac1:: with SMTP id m1mr8425149eje.472.1617273349892; Thu, 01 Apr 2021 03:35:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617273349; cv=none; d=google.com; s=arc-20160816; b=fsutpOYkE7bXjyzVo/gS4y7TZdc6gIiorMhNMab6Cyrrmnp7HzgBhLa53fEJh5XVKc KvKjiMzN3E4KDNCxXNDS4MPLep4OVP59ie6aZkhVmV0xDcsSme+nJ8D/ldbY5NX2LDBO HO7KTorkPE0P/tMeSujm4UA54buu7SD180m458hNXnYNzYzRZ8t4FTGh2Vu/Ls/+q03a N/YezG5uITOEJdr+jpr2rbqpsoA+FTxePa9MSE8ms5iF85pKi6QwFyqBdsv/382Nkpf7 vZD2oGbYTB/ul1E+9DGMeSRoBnlzkzhiyXsDCyV+csDvTy+Ai2EBOBeosOg5MpvUvn8A KdYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=FWp6Jfc/ZRFWAR2jkSMau9VvfO7UGs2NkUoRP9+VKUY=; b=JKwIfoajBouor3g2dH+ZvuPRRxjqlinJKjK1DeOl2zA/+v4aJzTjWdcJje8vlbNyHL OgYmjDgzqASBBs6fq6rj1GkTvm6D6zbeN87BoxGU89zuvH2C8jhQb1FuQXGCBXbVIaUs LyVxLuEwoSGJPZgr+8wOM+/q84ZruQ1hrR4N1GR5D+DAKSGMMaJcuQpdoytn/mBWB8WW HD5/NMNJ1rfQ/swWgLVhUfedMfxp+Wy23M+neQ0xNIt8lr+6NFRa5k5N1jW4uggFVjVx ri9l4Du/ODjsATZZpJZAzydGbMgLqcVdh9wbi4FAqiZ/KmRbpIDKEytEEXx624MpVVBk iCeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Yf6cv80d; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id a17si3881806eju.485.2021.04.01.03.35.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Apr 2021 03:35:49 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Yf6cv80d; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1FA2480C6A; Thu, 1 Apr 2021 12:35:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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=linaro.org header.i=@linaro.org header.b="Yf6cv80d"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0417D80C6B; Thu, 1 Apr 2021 12:35:45 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) (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 881E780C69 for ; Thu, 1 Apr 2021 12:35:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-ed1-x52b.google.com with SMTP id y6so1402301eds.1 for ; Thu, 01 Apr 2021 03:35:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=FWp6Jfc/ZRFWAR2jkSMau9VvfO7UGs2NkUoRP9+VKUY=; b=Yf6cv80dQdvN8PrROcGTqeDfauxNR3SQR9kcHOzOBsaTASPiPwh56linLfOEE7gd7L 2noR3DIpIEbPWd5ywzSYA3rug24EDy1Qo8qHO64uBFZwNixgxzQ0I3uiB76ufCRphggM Pv3+HvsSR7wWxKFR+nHI/ZNgoKHESK5xa4JwQrl/JbZZ1Ozuw2jkdLD0t/hPZZw7ydpA 5TzHXrVzxu0McRRNC4iIRlsOY9lqCTLkoGtOn6o4NVmi2qifC26YmpGY/mDfS2EDkwd1 DhFLSQEb0dbi/r3OCGdjWHEzRjgFeHJQyh2F//jmpAyTN9Rc915gHS4fv82+BHBaHcrP ggwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=FWp6Jfc/ZRFWAR2jkSMau9VvfO7UGs2NkUoRP9+VKUY=; b=Ia4jBpJUQE/aax1G7B0/MhgRnvffCZJIHlr2bpBu4KE2wFpyS9lw2z7yVXtaFBXo9m yUU2uzkl3ofEb2RnJcjA3DdRJo0sdfwL89nYz0MNSJ7I2tb6Prgpn3Ub4eVfyXGZukgF IfUzYUlgg7ey8Blaw52nxgyTNwoCkh6bS5JhLcFOIGfcMJpPUl/tmV5wiQzA6XT9Rku2 B04kz4fTl2Ov0sbqJjXzXowMIA8K9th2x4I2+ScpLTyG/Fg2RdOTVq1s+9chRPaibt8+ eNw4Srto00ev03YXNvJ7a/ngJmfjCOIHtPotpEJW2I0Zu/NGrHwbH149a9v2nePsnMDr 9CyQ== X-Gm-Message-State: AOAM531mFCbCsJcuh2IjPLQ+AI/1eNpfL2Q5Wq/3ZK9n//AGxfb2FiUV 57ecybI1/7L17vZnDAeQxLqkag== X-Received: by 2002:aa7:cb97:: with SMTP id r23mr8904161edt.106.1617273341158; Thu, 01 Apr 2021 03:35:41 -0700 (PDT) Received: from apalos.home ([2a02:587:464a:c916:2e56:dcff:fe9a:8f06]) by smtp.gmail.com with ESMTPSA id w6sm2553085eje.107.2021.04.01.03.35.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Apr 2021 03:35:40 -0700 (PDT) From: Ilias Apalodimas To: xypron.glpk@gmx.de Cc: Ilias Apalodimas , AKASHI Takahiro , Simon Glass , u-boot@lists.denx.de Subject: [PATCH] doc: Add build instructions for OP-TEE backed EFI variables Date: Thu, 1 Apr 2021 13:35:38 +0300 Message-Id: <20210401103538.100347-1-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.31.0 MIME-Version: 1.0 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.102.4 at phobos.denx.de X-Virus-Status: Clean Since that invlolves external projects and not only U-Boot, add guidance for supported platforms Signed-off-by: Ilias Apalodimas --- doc/develop/uefi/uefi.rst | 58 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) -- 2.31.0 diff --git a/doc/develop/uefi/uefi.rst b/doc/develop/uefi/uefi.rst index b3494c22e073..fe9bbcd471b8 100644 --- a/doc/develop/uefi/uefi.rst +++ b/doc/develop/uefi/uefi.rst @@ -213,7 +213,63 @@ non-volatile variables. When calling the variable services via the OP-TEE API U-Boot's OP-TEE supplicant relays calls to the RPMB driver which has to be enabled via CONFIG_SUPPORT_EMMC_RPMB=y. -[1] https://optee.readthedocs.io/ - OP-TEE documentation +EDK2 Build instructions +*********************** + +.. code-block:: bash + + $ git clone https://github.com/tianocore/edk2.git + $ git clone https://github.com/tianocore/edk2-platforms.git + $ cd edk2 + $ git submodule init && git submodule update --init --recursive + $ cd .. + $ export WORKSPACE=$(pwd) + $ export PACKAGES_PATH=$WORKSPACE/edk2:$WORKSPACE/edk2-platforms + $ export ACTIVE_PLATFORM="Platform/StandaloneMm/PlatformStandaloneMmPkg/PlatformStandaloneMmRpmb.dsc" + $ export GCC5_AARCH64_PREFIX=aarch64-linux-gnu- + $ source edk2/edksetup.sh + $ make -C edk2/BaseTools + $ build -p $ACTIVE_PLATFORM -b RELEASE -a AARCH64 -t GCC5 -n `nproc` + +OP-TEE Build instructions +************************* + +.. code-block:: bash + + $ git clone https://github.com/OP-TEE/optee_os.git + $ cd optee_os + $ ln -s ../Build/MmStandaloneRpmb/RELEASE_GCC5/FV/BL32_AP_MM.fd + $ export ARCH=arm + $ CROSS_COMPILE32=arm-linux-gnueabihf- make -j32 CFG_ARM64_core=y \ + PLATFORM= CFG_STMM_PATH=BL32_AP_MM.fd CFG_RPMB_FS=y \ + CFG_RPMB_FS_DEV_ID=0 CFG_CORE_HEAP_SIZE=524288 CFG_RPMB_WRITE_KEY=1 \ + CFG_CORE_HEAP_SIZE=524288 CFG_CORE_DYN_SHM=y CFG_RPMB_TESTKEY=y \ + CFG_REE_FS=n CFG_CORE_ARM64_PA_BITS=48 CFG_TEE_CORE_LOG_LEVEL=1 \ + CFG_TEE_TA_LOG_LEVEL=1 CFG_SCTLR_ALIGNMENT_CHECK=n + +U-Boot Build instructions +************************* + +Although the StandAloneMM binary comes from EDK2, using and storing the +variables is currently available in U-Boot only. + +.. code-block:: bash + + $ git clone https://github.com/u-boot/u-boot.git + $ cd u-boot + $ export CROSS_COMPILE=aarch64-linux-gnu- + $ export ARCH= + $ make _defconfig + $ make menuconfig + +Enable ``CONFIG_OPTEE``, ``CONFIG_CMD_OPTEE_RPMB`` and ``CONFIG_EFI_MM_COMM_TEE`` + +.. warning:: + + - Your OP-TEE platform port must support Dynamic shared memory, since that's + the only kind of memory U-Boot supports for now. + +[1] https://optee.readthedocs.io/en/latest/building/efi_vars/stmm.html Executing the boot manager ~~~~~~~~~~~~~~~~~~~~~~~~~~