From patchwork Mon Nov 26 14:52:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nariman Poushin X-Patchwork-Id: 152046 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp5804673ljp; Mon, 26 Nov 2018 06:52:27 -0800 (PST) X-Google-Smtp-Source: AJdET5eronMz6eZPozfFUfOujLgpvKc98mh8hfqpD8tivXVswiC0gj1RZOEtQDEHALH8e1G59JGF X-Received: by 2002:a63:e247:: with SMTP id y7mr24134771pgj.84.1543243947613; Mon, 26 Nov 2018 06:52:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543243947; cv=none; d=google.com; s=arc-20160816; b=xs91kVNUHOoc1UkZK5p+U0hnVtxC5+P8jvPsswQv1J0VLZ36xC3809cJfA8Cfzxgvn xU+0CGFVYMTECK1xKAVeEPUhpEl37CCTtAT3w+qnBn2Kjoka4KCikELKPZ0952nyn17s BXsHSTa6XpaDZeWyFccGcr/EUHfOuF6SDKdQ0kr9v/zMq4PfFxSDngDlBIQ2su7FB7Fc YIdC33f7NDkEv55HZt+LBJPmb1lwDHugRXiLcOFG329ic1HryJ5djaHQWf4FHzbXeKVY HnNeh7Yk1gb/ksY07970PiILWxcHCP6SKeqGnXpp4MSSnTapHI11yzSYhA2RgXxCnrZ/ pE4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to; bh=14V4/5Q0Vok5Hw2SiWKXBJXQirW+bxqYIBMpGuUjOEk=; b=tL895Vr+oy/rynLWMA7Gf+f4LjhK3porr3giw6wup6E+yAwqlyXWbpoblE0XIEc8KG r81eIQBprwhqntWfnbWzG7Rj42a+EnQt9x36fBaU7hL24ZTw4IeEKttDPZzJolOojShp EVlcHm7Ja+Nllb65NLt2TH90xSe/TzJb5o8sY79K3J0XpINFXP0GjIrjJkHTtEywnHIj gVsyb2SCjeKyXk6EGORKsc9gJMtF4wZDNea8hZfi3rTpYa8uCTaKVGKPx4bq0Fi/HM9b HZk7ZAmTYrN8GDUQ+ozfZp8t+heDSXTaZNXjjBUTDnvLOOJ2qLWiHTgsXFj5DMTvdx1C J/mw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id 2si566978pla.156.2018.11.26.06.52.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Nov 2018 06:52:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 45E3921A02937; Mon, 26 Nov 2018 06:52:17 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Softfail (domain owner discourages use of this host) identity=mailfrom; client-ip=81.158.40.147; helo=ubuntu-armbox; envelope-from=narpou01@linaro.org; receiver=edk2-devel@lists.01.org Received: from ubuntu-armbox (host81-158-40-147.range81-158.btcentralplus.com [81.158.40.147]) by ml01.01.org (Postfix) with ESMTP id AB72D21B02822 for ; Mon, 26 Nov 2018 06:52:15 -0800 (PST) Received: by ubuntu-armbox (Postfix, from userid 1001) id 028B8DE091C; Mon, 26 Nov 2018 14:52:19 +0000 (GMT) From: Nariman Poushin To: edk2-devel@lists.01.org, liming.gao@intel.com Date: Mon, 26 Nov 2018 14:52:14 +0000 Message-Id: <1543243935-4242-1-git-send-email-nariman.poushin@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <4A89E2EF3DFEDB4C8BFDE51014F606A14E372573@SHSMSX104.ccr.corp.intel.com> References: <4A89E2EF3DFEDB4C8BFDE51014F606A14E372573@SHSMSX104.ccr.corp.intel.com> Subject: [edk2] [edk2-platforms] [PATCH v2 1/2] Readme.md: Update instructions to fetch source X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Openssl is fetched as a git submodule, so make sure git clone --recursive is specified in the instructions to fetch a full source tree. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Nariman Poushin --- Changes since v1: - Added Contribution Agreement tag Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Leif Lindholm diff --git a/Readme.md b/Readme.md index 6ad5953..bb53c6f 100644 --- a/Readme.md +++ b/Readme.md @@ -78,7 +78,7 @@ target-specific binutils. These are included with any prepackaged GCC toolchain 1. [edk2-non-osi](https://github.com/tianocore/edk2-non-osi) (if building platforms that need it) ``` - $ git clone https://github.com/tianocore/edk2.git + $ git clone https://github.com/tianocore/edk2.git --recursive ... $ git clone https://github.com/tianocore/edk2-platforms.git ... From patchwork Mon Nov 26 14:52:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nariman Poushin X-Patchwork-Id: 152047 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp5804731ljp; Mon, 26 Nov 2018 06:52:29 -0800 (PST) X-Google-Smtp-Source: AFSGD/VZJgQN74zTbYRjcCWlREzj7bC31uBD+TA4B/vt+ZMR6QzWJwUxeIUtyZ5FGEeJDVTWQlFx X-Received: by 2002:a63:91c1:: with SMTP id l184mr25342259pge.29.1543243949513; Mon, 26 Nov 2018 06:52:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543243949; cv=none; d=google.com; s=arc-20160816; b=ZtW5W0FmDRgdStvBvBvZ3WPw2kxgZ57UaxFjM7a1yy3ZuVvvyKhnAQSAi315tZ7snn 3GSuv0x7m6NcjLAYdc2dPsfhV0rgGo8/NK4imbv4YjxDOxjPQKd4+8USxxKY3oheTvdz 9wPxnRdOWRINzTE7vVfqREb2sNVHWDM9ZrgZzDhkM8flaCS50uD+UM4V70jW7v/LJwsj q8o0bsVGv3wJ7WCO9HhLS1ZydzFbgMzUlvOYm/b6e+qGoFae1+T8/PkWaSCHjeGxHLOO wZu9FVsSbABLGcGHwrR51puaaOJ7g6xbTKXzoLOs4WfAFWrU5wUbTeZnGELDfE/BOHxB EsJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to; bh=Ks75uHdISUFzdJEToiU4vHA6MYe4UV6KCl2wTuU1Das=; b=hSBisukAcyX9Mnz4B7pi2+W0fpQdpnNd2NREMd1oF981RaIdMIr0X5V/2xdgLcScic M+QjTuAEsajVESg5Q4y9KT8g3nL7o7x+ugUpmPfX+jfvRv0+OGkBaMLl8OOMxYSESziV qTQ7xvH1cwlQpcu5MNYuvfd9IF6/yd2g4JNd++lpoEAItmtweyjA9bN2A24uEda9tpJ0 EEqnoQSf/chk8+W1IPL1FRFv9rHKy/px7B8Qht+zaqmuSpaNVp41LyZnWTnp3yI1w0rj khCI3zlnrjo8uaIJ4USpXzCvAxkv+PYkOm4b0HvOAn5JWfIFPxq7KbUeuylkhmf3F6WK H7mg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id g32si518502pgg.400.2018.11.26.06.52.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Nov 2018 06:52:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 7BB6E21195918; Mon, 26 Nov 2018 06:52:18 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Softfail (domain owner discourages use of this host) identity=mailfrom; client-ip=81.158.40.147; helo=ubuntu-armbox; envelope-from=narpou01@linaro.org; receiver=edk2-devel@lists.01.org Received: from ubuntu-armbox (host81-158-40-147.range81-158.btcentralplus.com [81.158.40.147]) by ml01.01.org (Postfix) with ESMTP id 4821121194864 for ; Mon, 26 Nov 2018 06:52:16 -0800 (PST) Received: by ubuntu-armbox (Postfix, from userid 1001) id E3667DE0923; Mon, 26 Nov 2018 14:52:19 +0000 (GMT) From: Nariman Poushin To: edk2-devel@lists.01.org, liming.gao@intel.com Date: Mon, 26 Nov 2018 14:52:15 +0000 Message-Id: <1543243935-4242-2-git-send-email-nariman.poushin@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1543243935-4242-1-git-send-email-nariman.poushin@linaro.org> References: <4A89E2EF3DFEDB4C8BFDE51014F606A14E372573@SHSMSX104.ccr.corp.intel.com> <1543243935-4242-1-git-send-email-nariman.poushin@linaro.org> Subject: [edk2] [edk2-platforms] [PATCH v3 2/2] Platform/ARM: Add Readme.md X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" This covers the bulk of the information originally present in https://github.com/tianocore/tianocore.github.io/wiki/ArmPlatformPkg-AArch64 regarding building and running the Foundation/Base FVP Platforms. The sections on fetching source have been delegated to the root Readme.md Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Nariman Poushin --- Changes since v2: - Updated the "Download the Sources" section to have the correct path - Added Contribution Agreement tag Platform/ARM/Readme.md | 102 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 Platform/ARM/Readme.md -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/Platform/ARM/Readme.md b/Platform/ARM/Readme.md new file mode 100644 index 0000000..c23b0a2 --- /dev/null +++ b/Platform/ARM/Readme.md @@ -0,0 +1,102 @@ +== Introduction == +These instructions are to build and run UEFI on the AArch64 Foundation or Base FVPs (Fixed Virtual Platforms). FVPs are fixed configurations of ARM Fast Models; they are also known as RTSMs (Real Time System Models). The Base FVP is an evolution of the VE (Versatile Express) RTSM.
+While the AArch64 Foundation FVP is free to download, the Base FVP requires an ARM license. The Base FVP has additional debugging and configuration features. + +Requirement: +* A 32-bit or 64-bit Linux host machine. Support for MS Windows-based toolchains has not been added to the EDK2 BaseTools. + +== Getting the EDK2 Source with AArch64 support (ARM 64-bit architecture) == +1) Get the requirements + +A Universally Unique Id (UUID) header. Needed to build the EDK2 BaseTools. On Ubuntu: sudo apt-get install uuid-dev + +2) Download the sources + +Please see the root edk2-platforms/Readme.md for information on how to obtain the source + +== Build EDK2 Tianocore == + +1) Install AArch64 GNU toolchain: +
sudo apt install gcc-aarch64-linux-gnu
+ +2) Build EDK2: + +
cd $(WORKSPACE)/edk2
+* For the Foundation and Base FVPs (defined by the DSC file ArmPlatformPkg?/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4-foundation.dsc): +
GCC5_AARCH64_PREFIX=aarch64-linux-gnu- build -a AARCH64 -p Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc -t GCC5
+ +Once built, the UEFI Firmware is the following file Build/ArmVExpress-FVP-AArch64/DEBUG_GCC5/FV/FVP_AARCH64_EFI.fd + +Note 1: To build the release build, add '-b RELEASE'. Here's an example with the Foundation FVP: +
GCC5_AARCH64_PREFIX=aarch64-linux-gnu- build -a AARCH64 -p Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc -t GCC5 -b RELEASE
+ +== Start Linux from UEFI on the FVPs == + +=== Build AArch64 Linux === +1) Get the AArch64 Linux sources +
git clone git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-aarch64.git -b soc-armv8-model
+cd linux-aarch64
+ +2) Build the AArch64 kernel with Virtio support +
make ARCH=arm64 mrproper
+make ARCH=arm64 defconfig
+ +Enable Virtio Disk and Ext4 support in the kernel. The Linaro disk file-system uses Ext4. +
make ARCH=arm64 menuconfig
+Device Drivers  ---> Virtio drivers  ---> <*> Platform bus driver for memory mapped virtio devices
+Device Drivers  ---> [*] Block devices  --->  <*> Virtio block driver
+File systems  ---> <*> The Extended 4 (ext4) filesystem
+ +Build the kernel. +
make -j4 ARCH=arm64 CROSS_COMPILE=/gcc-linaro-aarch64-linux-gnu-4.8-2013.06_linux/bin/aarch64-linux-gnu-
+ +You should get the binaries: +* arch/arm64/boot/Image +* arch/arm64/boot/dts/foundation-v8.dtb +* arch/arm64/boot/dts/rtsm_ve-aemv8a.dtb + +=== Run Linux from UEFI on the Foundation FVP === + +1) Download the Foundation FVP: http://www.arm.com/fvp + +Decompress the AArch64 Foundation FVP +
tar xf ~/FM000-KT-00035-r0p8-48rel5.tgz
+ +2) The current version of the Foundation FVP can only start an ELF image. To workaround this limitation, we use the 'uefi-aarch64-bootstrap' to start the UEFI image on this model. + +To build the 'uefi-aarch64-bootstrap': +
pushd ArmPlatformPkg/ArmVExpressPkg/Scripts/uefi-aarch64-bootstrap/
+CROSS_COMPILE=/gcc-linaro-aarch64-linux-gnu-4.8-2013.06_linux/bin/aarch64-linux-gnu- make
+popd
+ +3) The Foundation FVP takes an option for an ELF file to be loaded as well as an option to load a binary data blob into RAM. + +Linux kernel (filename = 'Image') and the Device Tree Binary (filename = 'foundation-v8.dtb') are expected to be found in the directory where the model is started from. + +A file system example can be downloaded from Linaro: +
wget http://releases.linaro.org/13.06/openembedded/aarch64/vexpress64-openembedded_minimal-armv8_20130623-376.img.gz
+gunzip vexpress64-openembedded_minimal-armv8_20130623-376.img.gz
+ +The file-system needs some minimal preparation: +
mkdir tmp
+fdisk -lu vexpress64-openembedded_minimal-armv8_20130623-376.img
+sudo mount -o loop,offset=$((106496 * 512)) vexpress64-openembedded_minimal-armv8_20130623-376.img tmp/
+cd tmp
+sudo ln -s S35mountall.sh etc/rcS.d/S03mountall.sh
+sudo sh -c "echo 'devtmpfs /dev devtmpfs mode=0755,nosuid 0 0' >> etc/fstab"
+cd ..
+sudo umount tmp/
+ +The following command line can be used to run UEFI in the following manner: +
$AARCH64_FOUNDATION_MODEL_ROOT/Foundation_v8 --cores=2 --image=ArmPlatformPkg/ArmVExpressPkg/Scripts/uefi-aarch64-bootstrap/uefi-bootstrap-el3-foundation.axf --nsdata=Build/ArmVExpress-RTSM-AEMv8Ax4-foundation/DEBUG_GCC47/FV/RTSM_VE_FOUNDATIONV8_EFI.fd@0xA0000000 --block-device=/vexpress64-openembedded_minimal-armv8_20130623-376.img
+ +Note: Do not use a symbolic link to the file-system image. The model will not be able to read the image file. + +=== Run Linux from UEFI on the Base FVP === + +The Linux kernel (filename = 'Image') and the Device Tree Binary (filename = 'rtsm_ve-aemv8a.dtb') are expected to be found in the directory where the model is started from. +
export PATH=ARM_BASE_AEMV8_ROOT:$PATH
+export LD_LIBRARY_PATH=ARM_BASE_AEMV8_ROOT:$LD_LIBRARY_PATH
+FVP_VE_AEMv8A -C motherboard.flashloader0.fname=Build/ArmVExpress-RTSM-AEMv8Ax4/DEBUG_GCC47/FV/RTSM_VE_AEMV8_EFI.fd
+ +