From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::341; helo=mail-wm1-x341.google.com; envelope-from=nariman.poushin@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 69E0921A00AE6 for ; Wed, 28 Nov 2018 08:49:44 -0800 (PST) Received: by mail-wm1-x341.google.com with SMTP id y185so4415680wmd.1 for ; Wed, 28 Nov 2018 08:49:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=TX+We7936YhuNQC3DtJREUvVHhTj56upBRFdPK/f8eA=; b=C8fL4KN+CPzgr7cgLZHDK0CvXvve6O5gye9EPqtZpT1x3pUUaCDcXUa9lAPlRjIddR UtbYc5+8+hR8nGaxunpIWDkuA9CO1km6VPM4vzahikWU1UKeNmECQhiYdWVBBxaB788c npP1nS8KkU/aN4XELda8nzVeW6Zp4tx/lUnv8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=TX+We7936YhuNQC3DtJREUvVHhTj56upBRFdPK/f8eA=; b=emM2N6z5en7EnapCq7SC88puFDRZZZUiuhdR0+F9Zo3QqfnHXUBcE4WGVOUZQfNNKG zN+R6YDsEzoXGNAGdBrFeyZ1Te08b8iIutxtkvViJ+1J13c31HszupSnHhSVRA0SVoRh CzMMnxbXXjRQb+wI5bVou8ZDKrPUgRWGV6Ki9yrIdhqRk6qfWn5E2w9Ax58xsOMwMRi6 wiXGocWY5ni3PvfVJ6wkI267XAVEOA2tKPNu7Uw12lEYhWAiFbf4CGqlQjFnKCHiV2X8 BN+wIAcDtVHFFvE20CpKCTX8Bk86Ogs6qgXF+/Q3ymyAONae3+np0QnK8fiOm9PSDiQX 9pNQ== X-Gm-Message-State: AA+aEWaVhiODJGPXlAYCR19IaA/H5xtnf1irZ1e4QdPDh8+pg3501cME yZgg+aW50vLtcWFGvz9DlYgtHg== X-Google-Smtp-Source: AFSGD/XcXHEeEKXxsei1sGBCmJIpTyX0VSdmxkSQfCG/FypjWUvG6MOB3E208h4+bzd+NBksUQsUqA== X-Received: by 2002:a1c:83c8:: with SMTP id f191mr3437413wmd.134.1543423782633; Wed, 28 Nov 2018 08:49:42 -0800 (PST) Received: from linaro.org (host81-158-40-147.range81-158.btcentralplus.com. [81.158.40.147]) by smtp.gmail.com with ESMTPSA id k19sm8223630wre.5.2018.11.28.08.49.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Nov 2018 08:49:41 -0800 (PST) Date: Wed, 28 Nov 2018 16:49:41 +0000 From: Nariman Poushin To: Leif Lindholm Cc: edk2-devel@lists.01.org, mark.nicholson@arm.com Message-ID: <20181128164940.GA19137@linaro.org> References: <1543238268-32652-1-git-send-email-nariman.poushin@linaro.org> <20181126183837.6tftkt23gxapjaka@bivouac.eciton.net> MIME-Version: 1.0 In-Reply-To: <20181126183837.6tftkt23gxapjaka@bivouac.eciton.net> User-Agent: Mutt/1.5.24 (2015-08-30) Subject: Re: [PATCH v2 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: , X-List-Received-Date: Wed, 28 Nov 2018 16:49:44 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Nov 26, 2018 at 06:38:37PM +0000, Leif Lindholm wrote: > On Mon, Nov 26, 2018 at 01:17:48PM +0000, Nariman Poushin wrote: > > 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 > > > > Signed-off-by: Nariman Poushin > > Detailed comments below. > Overall, the feedback is pretty much all either > - Please refer to top-level Readme.md for generic operations (and > improve that if needed.). > or > - The wiki page is horribly outdated, so it's great you're taking this > step and placing the instructions with the code, but you're basing > it on something horribly outdated. > > +Mark (Since he may actually have some links to less outdated > information on one of ARM's sites.) > > (Apologies if reading the below feels like someone throwing bricks at you.) Absolutely no problems, really appreciate the feedback! > > > --- > > Platform/ARM/Readme.md | 102 +++++++++++++++++++++++++++++++++++++++++++++++++ > > 1 file changed, 102 insertions(+) > > create mode 100644 Platform/ARM/Readme.md > > > > diff --git a/Platform/ARM/Readme.md b/Platform/ARM/Readme.md > > new file mode 100644 > > index 0000000..f6b97d3 > > --- /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. > > (This is actually no longer true - although we are lacking certain > assembler files required to build most full platforms: my w-i-p can be > found at > https://git.linaro.org/people/leif.lindholm/edk2.git/log/?h=aarch64-vs > and lets you build several platforms with large bits of critical > assembler functionality stubbed out :) cgty68ooih vv gee "Building these platforms with Visual Studio is not yet supported." > would be a more accurate statement. Updated to refer to your experimental tree. > > > + > > +== 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 > > This is mentioned in the top-level Readme.md (without the specific > commands). Please add to the text there if necessary. > > > + > > +2) Download the sources > > + > > +Please see the root edk2/Readme.md for information on how to obtain the source > > [Readme.md](../../Readme.md) Dropped this section, it's unlikely you have obtained the edk2-platforms source without being entirely unaware of the edk2 source? > > > + > > +== Build EDK2 Tianocore == > > + > > +1) Install AArch64 GNU toolchain: > > +
sudo apt install gcc-aarch64-linux-gnu
> > More like sudo apt-install gcc. > But still, this and the esoterics of cross compilation (for those that > prefer to faff around) is covered in the top-level Readme.md. > > > + > > +2) Build EDK2: > > + > > +
cd $(WORKSPACE)/edk2
> > +* For the Foundation and Base FVPs (defined by the DSC file > > ArmPlatformPkg?/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4-foundation.dsc): > > Yikes. That file hasn't existed for quite some time. > (edk2-platforms/)Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc > is what you want. > > > +
GCC5_AARCH64_PREFIX=aarch64-linux-gnu- build -a AARCH64 -p
> > Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc -t GCC5
> > Skip the cross compilation scaffolding, it's covered in the root > Readme.md for those who need it. Just give a simple example command > line as a sneaky way to point out the .dsc. > > > + > > +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
> > Again, I'd leave the generic build instructions out of this. > > > + > > +== 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-
> > If people need a cross compiler, they already have one installed if > they got this far. > > But actually, I think this whole section can go. This shouldn't be a > page talking about how to build a Linux kernel. And those virtio > options are actually the default in upstream Linux these days. > > > + > > +You should get the binaries: > > +* arch/arm64/boot/Image > > +* arch/arm64/boot/dts/foundation-v8.dtb > > +* arch/arm64/boot/dts/rtsm_ve-aemv8a.dtb > > This isn't really up to date. There's separate gicv2/gicv3 blobs. And > another one for PSCI (I think). Dropped this whole section as per your comment above, makes sense. I am sorting out this section to refer to up to date models, and drop the reference to Linux for now. I will include a section on how to get up and running using the edk2/edk2-platforms build just built with the pre-builts from the Linaro 18.10 release (which date it, but is a damn sight more recent than the current instructions). Sound ok? > > > + > > +=== Run Linux from UEFI on the Foundation FVP === > > + > > +1) Download the Foundation FVP: http://www.arm.com/fvp> > > Maybe change to > https://developer.arm.com/products/system-design/fixed-virtual-platforms > ? (This is where I get redirected these days.) Done. > > + > > +Decompress the AArch64 Foundation FVP > > +
tar xf ~/FM000-KT-00035-r0p8-48rel5.tgz
> > + It feels like people should know how to use tar if they got this far, and by dropping this we avoid assuming a version. Is it fair to just say "Download the Foundation FVP" with the updated URL and expect Reasonable People to Do the Right Thing? > > > Pretty sure we want to nuke everything from here: > > > +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
> > + > > + > > To here. > Everything of the above that isn't incorrect these days is ... unhelpful. > > Not that it wouldn't be useful to have instructions ... just not > these. > > Ideally, there would be some link here to how to bundle this with ARM > trusted firmware and run a Linux installer, or a (modern) filesystem > available from somewhere. > > But I'd take no information over the outdated content above. > > Finally, a more simple request: > Could you add a link to this file from top-level Readme.md? > Towards the very end, there is an > ## ARM > that could (probably?) become > ## [ARM](Platforms/ARM/Readme.md) > And you could then nuke the Juno/VExpress links currently located > under that header. Sure thing, will fix that up. > > Regards, > > Leif