From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) by mx.groups.io with SMTP id smtpd.web12.8561.1614575855347170547 for ; Sun, 28 Feb 2021 21:17:35 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=NXY3Nndy; spf=pass (domain: linaro.org, ip: 209.85.210.175, mailfrom: masahisa.kojima@linaro.org) Received: by mail-pf1-f175.google.com with SMTP id q204so9634043pfq.10 for ; Sun, 28 Feb 2021 21:17:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CYIEkmB8GTMfZTyhk6BLdVLLJCuwDmDjjllbIzcagl8=; b=NXY3NndyV5B7nYqoK+aphVBoHAERm2j4bG/7WPVaiaEDWnELqHjj90hn4BF1Ny6AH2 solPEDstW4dR4rCVwGZZ4TR1Vw1fJhI2eIbw/o5srKMsreEFGtq6lt5qaQTNyUKgm6KM v9/zCumKhc+n6pFR/1NQYTZD3669gDcgQiV55Y1Z4U/YjScUW5317m0qH9NcSsHggZ13 8l2PqnK9UvJanYB25dUUc0ry4FUqNzsXrkRS2B6+LUI0ADm44cwDMYasmPk9NEWthQWM 3wBCCCxPIxdyKMq7nWsaLUB0oE0TOhi9ZAQ+hgJhV8ZoNGzjJOQJFjzkROiJBKw2fonZ tsrg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=CYIEkmB8GTMfZTyhk6BLdVLLJCuwDmDjjllbIzcagl8=; b=LvPERAE9rofhab078WnD7yhkkCOSX1EyTK8pzRLUb9XoB5NHaOi5WNR4OXPLt+79// dtaaFcOivqkP6Jh29BfGpWNoUy3UP9eCAOhRSJxwov6R70o5GH4vC8PzTD1NrLLzVFXk ZxZ8pRwIdel/I/6PGnAl0/gPguhH60LLJFutXi3TxADFUKeNC4SWW1K6PVLs+PRRXMSu CJKuh9TCi+slgbZ3A2EM7m0pKTMZojM0yVdY/ZsgujW6DIBr0j5XUOFW8XWDI+VyPw0Z S7Fb4qEVZA1yucf1nHjEWmbQ/oTqbO1vI3N2CGqsPKHsJ0LkhOAklIT7sVRlLKdgnxGF rlQA== X-Gm-Message-State: AOAM5316MFjgRpygE9Idz0jx0G4ho8ksR3URunejQ9ZVs+M/Lly04VBh nwgevz/lW6stbbk6Wm86tIyJlVR5luZYvg== X-Google-Smtp-Source: ABdhPJwIeOUW14BHJdpVmkxJBhmSSk7NK+Xk+jP/WggpYHP8noUT5P+hdUzgCUmNtPOGQPRBR76lYw== X-Received: by 2002:aa7:93a6:0:b029:1ed:8b81:6a2e with SMTP id x6-20020aa793a60000b02901ed8b816a2emr13783024pff.29.1614575854920; Sun, 28 Feb 2021 21:17:34 -0800 (PST) Return-Path: Received: from localhost.localdomain ([2400:2411:502:a100:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id g17sm11877365pfb.214.2021.02.28.21.17.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Feb 2021 21:17:34 -0800 (PST) From: "Masahisa Kojima" To: devel@edk2.groups.io Cc: Masahisa Kojima , Ard Biesheuvel , Leif Lindholm , Graeme Gregory , Radoslaw Biernacki , Shashi Mallela Subject: [PATCH edk2-platforms v2 3/4] SbsaQemu: add standalone MM build instruction Date: Mon, 1 Mar 2021 14:19:51 +0900 Message-Id: <20210301051952.29091-4-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210301051952.29091-1-masahisa.kojima@linaro.org> References: <20210301051952.29091-1-masahisa.kojima@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This commit adds the standalone MM build instruction to enable UEFI secure boot. Signed-off-by: Masahisa Kojima --- Platform/Qemu/SbsaQemu/Readme.md | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/Platform/Qemu/SbsaQemu/Readme.md b/Platform/Qemu/SbsaQemu/Readme.md index 63786d9d0fd3..cdee8b41507e 100644 --- a/Platform/Qemu/SbsaQemu/Readme.md +++ b/Platform/Qemu/SbsaQemu/Readme.md @@ -104,6 +104,41 @@ Create a directory $WORKSPACE that would hold source code of the components. truncate -s 256M SBSA_FLASH[01].fd ``` +## Build UEFI with standalone MM based UEFI secure boot + +1. Compile standalone MM image + + ``` + cd $WORKSPACE + build -b RELEASE -a AARCH64 -t GCC5 -p edk2-platforms/Platform/Qemu/SbsaQemu/SbsaQemuStandaloneMM.dsc + ``` + +2. Compile TF-A with BL32(Secure Payload) + + Detailed build instructions can be found on the following link: + https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/tree/docs/plat/qemu-sbsa.rst + + Then copy `bl1.bin` and `fip.bin` to the the edk2-non-osi directory: + +3. Compile UEFI with UEFI secure boot enabled + + ``` + cd $WORKSPACE + build -b RELEASE -a AARCH64 -t GCC5 -p edk2-platforms/Platform/Qemu/SbsaQemu/SbsaQemu.dsc -DSECURE_BOOT_ENABLE=TRUE + ``` + + Copy SBSA_FLASH0.fd and SBSA_FLASH1.fd to top $WORKSPACE directory. + Then extend the file size to match the machine flash size. + ``` + cp Build/SbsaQemu/RELEASE_GCC5/FV/SBSA_FLASH[01].fd . + truncate -s 256M SBSA_FLASH[01].fd + ``` + + To keep the UEFI variable storage after the succeeding build, use `dd` instead of `cp`. + ``` + dd if=./Build/SbsaQemu/RELEASE_GCC5/FV/SBSA_FLASH0.fd of=./SBSA_FLASH0.fd conv=notrunc bs=2M count=8 + ``` + # Running The resulting SBSA_FLASH0.fd file will contain Secure flash0 image (TF-A code). -- 2.17.1