From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: None (no SPF record) identity=mailfrom; client-ip=2a00:1450:4864:20::541; helo=mail-ed1-x541.google.com; envelope-from=pete@akeo.ie; receiver=edk2-devel@lists.01.org Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) (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 87E10211BA45F for ; Thu, 31 Jan 2019 09:19:40 -0800 (PST) Received: by mail-ed1-x541.google.com with SMTP id a20so3204077edc.8 for ; Thu, 31 Jan 2019 09:19:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akeo-ie.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=J1Vl+WiCDazKI7xBEVelrBQHO/ZIw7FFgaP1DAuGe8s=; b=bGQ2tUaBzXIg84K4jKh6+rJInxu2dk1SXCkVf7u6BiCfrtjfkefmpeI8EdnEph20pV awtUX1fvDQMB2t9G0k4IcmOEahG734Zc628xUON+e7TXLcHZAPq7WkV8efkTu1GL3BY7 WJQ1Ohe4K+A7QgxoYTVJdFY2yqwa0Y3h91oKddh/Z++oTyyNRS2zwf2gd5W6g0Zniffo d/tmqAk/GE/7CdVZgfPMqpCsa02JK+1BeB32BTvf3GokE9N+DnNzeVMqhk33fzeTQUHy H9v+kQQLg3dKsom8HrBPbhHGIat6pejLCucA2dlZ/dg1idV1Cklpu7jHyGLhSKnsTgqo WnNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=J1Vl+WiCDazKI7xBEVelrBQHO/ZIw7FFgaP1DAuGe8s=; b=GBRyGBs+3bOSMk4Ekbl/nynraC/Pvsx/SlnqSST2m1x9CTpht6CD5g26Mc8yHO28Ok 7Vjm/dg8pu3DXFufGcoiUCNyg7xR2bAhgAjZjN7wWOMT1urryJ3f7tPAHDtDb/AUkJ+X VxHT0P7UCDU7eWSBcbqbYCTeBaoHdjc6kqPAlJbq5TFMHSZP9jaUfNohEEh1h0ESRzIp obBiHtMn6LbiNWJE3SmLzLAaOSts4NWA41hDRnFLjp4rMBeFGYbDILZtEJg+ePnIZGDp 82/I1dWp+k9VxH0a2s41yzugan1948Lw1buXW+/oxRiRAXWoXqIfxecdAJaPdXNgp1Nd rGhg== X-Gm-Message-State: AJcUukf+9u0osmQLZSTxyI+0uMRAIpHVrWVc6H1BxugQoTQYqxdNxOR8 ImZJ0aaJWxqccLGTUJ1FvOifn0IOG+M= X-Google-Smtp-Source: ALg8bN7FzqS4+yO3gvrL8EY8HK4TtVQipgD5TedO3SlbAgk+6Ufrys6puRTo29H1EDp8hHhjwiqdEQ== X-Received: by 2002:a17:906:4e43:: with SMTP id g3mr18763710ejw.24.1548955177937; Thu, 31 Jan 2019 09:19:37 -0800 (PST) Received: from [10.0.0.102] ([84.203.95.186]) by smtp.googlemail.com with ESMTPSA id t9sm1400244edd.25.2019.01.31.09.19.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 Jan 2019 09:19:36 -0800 (PST) To: Ard Biesheuvel , Leif Lindholm Cc: "edk2-devel@lists.01.org" References: <20190129162655.3800-1-pete@akeo.ie> <20190129162655.3800-21-pete@akeo.ie> <20190130215024.6rzpicbnykk5hzuo@bivouac.eciton.net> <4877c43c-a16a-c468-f5ad-bd6cde214ce0@akeo.ie> <20190131141351.znaggng6ywqnzfus@bivouac.eciton.net> From: Pete Batard Message-ID: Date: Thu, 31 Jan 2019 17:19:35 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: Subject: Re: [PATCH v4 edk2-platforms 20/23] Platform/Raspberry/Pi3: Add platform readme 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: Thu, 31 Jan 2019 17:19:41 -0000 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 2019.01.31 14:44, Ard Biesheuvel wrote: > On Thu, 31 Jan 2019 at 15:36, Ard Biesheuvel wrote: >> >> On Thu, 31 Jan 2019 at 15:13, Leif Lindholm wrote: >>> >>> On Thu, Jan 31, 2019 at 12:30:22PM +0000, Pete Batard wrote: >>>> Hi Leif. Thanks for reviewing this patchset. >>>> >>>> On 2019.01.30 21:50, Leif Lindholm wrote: >>>>> Hi Pete, >>>>> >>>>> I will only have minor comments on this set, but I'll start with this >>>>> documentation. >>>>> >>>>> On Tue, Jan 29, 2019 at 04:26:52PM +0000, Pete Batard wrote: >>>>>> Contributed-under: TianoCore Contribution Agreement 1.1 >>>>>> Signed-off-by: Pete Batard >>>>>> --- >>>>>> Platform/Raspberry/Pi3/Readme.md | 259 ++++++++++++++++++++ >>>>>> Readme.md | 3 + >>>>>> 2 files changed, 262 insertions(+) >>>>>> >>>>>> diff --git a/Platform/Raspberry/Pi3/Readme.md b/Platform/Raspberry/Pi3/Readme.md >>>>>> new file mode 100644 >>>>>> index 000000000000..7fb59ccdc321 >>>>>> --- /dev/null >>>>>> +++ b/Platform/Raspberry/Pi3/Readme.md >>>>>> @@ -0,0 +1,259 @@ >>>>>> +Raspberry Pi 3 EDK2 Platform Support >>>>>> +==================================== >>>>>> + >>>>>> +# Summary >>>>>> + >>>>>> +This is a port of 64-bit Tiano Core UEFI firmware for the Raspberry Pi 3/3B+ platforms, >>>>>> +based on [Ard Bisheuvel's 64-bit](http://www.workofard.com/2017/02/uefi-on-the-pi/) >>>>>> +and [Microsoft's 32-bit](https://github.com/ms-iot/RPi-UEFI/tree/ms-iot/Pi3BoardPkg) >>>>>> +implementations, as maintained by [Andrei Warkentin](https://github.com/andreiw/RaspberryPiPkg). >>>>>> + >>>>>> +This is meant as a generally useful 64-bit ATF + UEFI implementation for the Raspberry >>>>>> +Pi 3/3B+ which should be good enough for most kind of UEFI development, as well as for >>>>>> +running consummer Operating Systems in such as Linux or Windows. >>>>>> + >>>>>> +Raspberry Pi is a trademark of the [Raspberry Pi Foundation](http://www.raspberrypi.org). >>>>>> + >>>>>> +# Status >>>>>> + >>>>>> +This firmware, that has been validated to compile against the current >>>>>> +[edk2](https://github.com/tianocore/edk2)/[edk2-platforms](https://github.com/tianocore/edk2-platforms), >>>>>> +should be able to boot Linux (SUSE, Ubuntu), NetBSD, FreeBSD as well as Windows 10 ARM64 >>>>>> +(full GUI version). >>>>>> + >>>>>> +It also provides support for ATF ([Arm Trusted Platform](https://github.com/ARM-software/arm-trusted-firmware)). >>>>>> + >>>>>> +HDMI and the mini-UART serial port can be used for output devices, with mirrored output. >>>>>> +USB keyboards and the mini-UART serial port can be used as input. >>>>>> + >>>>>> +The boot order is currently hardcoded, first to the USB ports and then to the uSD card. >>>>>> +If there no bootable media media is found, the UEFI Shell is launched. >>>>>> +Esc enters platform setup. F1 boots the UEFI Shell. >>>>>> + >>>>>> +# Building >>>>>> + >>>>>> +(These instructions were validated against the latest edk2 / edk2-platforms / >>>>>> +edk2-non-osi as of 2019.01.27, on a Debian 9.6 x64 system). >>>>>> + >>>>>> +You may need to install the relevant compilation tools. Especially you should have the >>>>>> +ACPI Source Language (ASL) compiler, `nasm` as well as a native compiler installed. >>>>> >>>>> nasm? The x86 assembler? >>>> >>>> I'll remove that. >>>> >>>>>> +On a Debian system, you can get these prerequisites installed with: >>>>>> +``` >>>>>> +sudo apt-get install build-essential acpica-tools nasm uuid-dev >>>>>> +``` >>>>>> + >>>>>> +**IMPORTANT:** We recommend the use of the Linaro GCC for compilation instead of >>>>>> +your system's native ARM64 GCC cross compiler. >>>>> >>>>> This sounds like something written in the days of GCC 4.8. I doubt it >>>>> has any relevance today. >>>> >>>> It very much had until circa one month ago, as we observed early Synchronous >>>> Exceptions when trying to use the native Debian ARM64 compiler, which we did >>>> not observe with Linaro's toolchain. We even had trouble (similar issue) >>>> with recent Linaro toolchains at some stage, which is why, until v3, we >>>> recommended an older version, but recent tests showed that the latest Linaro >>>> GCC (2019.02) appeared to be okay, which is why I removed the previous >>>> requirement to use exclusively Linaro's 2017.10 GCC 5.5. >>> >>> Urgh. But that actually makes the above statement even more >>> misleading. What you have isn't an issue with non-Linaro toolchains, >>> you have an unidentified toolchain issue that you've triggered more >>> frequently >>> >> >> Could you please check whether the broken toolchain in question has >> the workaround for Cortex-A53 erratum 843419 enabled? (gcc -v will >> tell you) It is. On that subject, I have now ran a new series of tests, with the default AARCH64 Debian 9.7 compiler (gcc 6.3.0 20170516), and so far I have not been able to observe the Synchronous Exceptions that had us switch to the Linaro compiler. It needs to be noted however that, since we ran into those, we did switch to using different ATF binaries, different VideoCore firmware, and removed some drivers (such as an HyperVisor) from the firmware. So there are quite a few elements that could have had an impact on the earlier issue. I will continue to test with the default Debian compiler for now, and, if I don't see a resurgence of the issue, I'll remove the note about preferring a Linaro toolchain. Also, given that Leif doesn't want the full hand-holding compilation instructions and that I have no intention to push back on that, I will remove that part from the readme, and keep only the line that provides the build options. >> >> While playing with this port the other day, I noticed that the RPi3 is >> affected by this, and the Debian kernels don't enable mitigations for >> it either. >> > > Answering to self: > > my stretch gcc has > > Using built-in specs. > COLLECT_GCC=gcc > COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/6/lto-wrapper > Target: aarch64-linux-gnu > Configured with: ../src/configure -v --with-pkgversion='Debian > 6.3.0-18+deb9u1' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs > --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ > --prefix=/usr --program-suffix=-6 --program-prefix=aarch64-linux-gnu- > --enable-shared --enable-linker-build-id --libexecdir=/usr/lib > --without-included-gettext --enable-threads=posix --libdir=/usr/lib > --enable-nls --with-sysroot=/ --enable-clocale=gnu > --enable-libstdcxx-debug --enable-libstdcxx-time=yes > --with-default-libstdcxx-abi=new --enable-gnu-unique-object > --disable-libquadmath --enable-plugin --enable-default-pie > --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk > --enable-gtk-cairo > --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-arm64/jre > --enable-java-home > --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-arm64 > --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-arm64 > --with-arch-directory=aarch64 > --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-multiarch > --enable-fix-cortex-a53-843419 --enable-checking=release > --build=aarch64-linux-gnu --host=aarch64-linux-gnu > --target=aarch64-linux-gnu > Thread model: posix > gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1) > > which means it is built so that it will pass the correct linker option > to ld, it does not affect code generation in general. > > In any case, it may be worth adding this to the .dsc > > [BuildOptions] > GCC:*_*_*_DLINK_FLAGS = -Wl,--fix-cortex-a53-843419 That's probably a good idea. I'll make sure we have the above just in case. Regards, /Pete