From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) by mx.groups.io with SMTP id smtpd.web09.39237.1608555187648488286 for ; Mon, 21 Dec 2020 04:53:07 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=VJDor8I7; spf=pass (domain: linaro.org, ip: 209.85.210.169, mailfrom: masahisa.kojima@linaro.org) Received: by mail-pf1-f169.google.com with SMTP id t22so6421645pfl.3 for ; Mon, 21 Dec 2020 04:53:07 -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=h1NibPi8EmTVOk+MeMAUDEyj+IlilJpqDoYms5uKmNI=; b=VJDor8I7Cw6+Wp92bR1GLw9FFhf06cm6oiL4WkAwk7xJ2ZUPVuwnwdesXrGWF8/qVC 87i3Y/DRAWqkA1Ftnru4ytrz9Qe7rI6kRx5uCgpW40D4AcFzeBP3EzJ1wMa9mEG/5AZt fOYlwU6dJQoX3TM4ZgonDqGEiUSV106TpqZDHIi5KMHw0I/E/lv3HYrih7dNQ23KQovn aZnWFnAv89XqgvnVrrUukCH8MKtrbDxXyZwemJot5mDA9pH2QtALNFp/KzLzCrFqDHk4 zmgnFDweYc56hVTJR0dqcrUOuCmoFrXXxLO5VM9ltIz+YQDIPN9ApTpZCceGx66He7jE 9dbA== 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=h1NibPi8EmTVOk+MeMAUDEyj+IlilJpqDoYms5uKmNI=; b=rucRC6SCMSG8Uez2PaUAQeBWGV81MoUmx01TvcEGWFuhGaYdUyO3FAILJUsI5NmMzf ToiUI/fJZf/XHJCoTJqZPbyC6Of60vYcW8pdwy4TZmzcRpYR4vRYbaR2W6pmDem4SKab WY/6WqZrBRuIc3EZyrg1owcqecffgOul9qcOFK7TGYlGSHq/idJikjncyvaTbVD/lgq1 d2pqBH41O/gunfqUuBvh1wswWYOXhyueoza6Z5nifcc+4pi98ikgI4iVhg+9BeuuoW+U BIaJlkco4qKtajmUp2XFyuAPJUOWXtgSGEEBDu36/xlAjbvYwvlsP/JzcR3UyOeKmCqd LpXQ== X-Gm-Message-State: AOAM5336NXurzqo4QZbBjdotAq74nztIPT7NdblCOll6UVxgcy0FKp9u b0ZaTkZFh/lkxzjWBNiZ3ziUTgT/nvF4xQ== X-Google-Smtp-Source: ABdhPJyMSRYcyyZjmObEl4Z3zRGkH4UJufYboyRmPdUPUp0YWhTjogHtC48RF3Kb0wdg9rl51FUIFQ== X-Received: by 2002:aa7:8550:0:b029:19e:46e7:913b with SMTP id y16-20020aa785500000b029019e46e7913bmr14875863pfn.58.1608555186599; Mon, 21 Dec 2020 04:53:06 -0800 (PST) Return-Path: Received: from localhost ([121.95.100.191]) by smtp.gmail.com with ESMTPSA id s7sm16380517pfh.207.2020.12.21.04.53.05 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Dec 2020 04:53:05 -0800 (PST) From: "Masahisa Kojima" To: devel@edk2.groups.io Cc: Masahisa Kojima , Ard Biesheuvel , Leif Lindholm , Graeme Gregory , Radoslaw Biernacki , Tanmay Jagdale , Shashi Mallela Subject: [PATCH edk2-platforms 3/4] SbsaQemu: add standalone MM build instruction Date: Mon, 21 Dec 2020 21:53:56 +0900 Message-Id: <20201221125357.17744-4-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201221125357.17744-1-masahisa.kojima@linaro.org> References: <20201221125357.17744-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