On 2019.01.31 14:44, Ard Biesheuvel wrote:
On Thu, 31 Jan 2019 at 15:36, Ard Biesheuvel <ard.biesheu...@linaro.org> wrote:

On Thu, 31 Jan 2019 at 15:13, Leif Lindholm <leif.lindh...@linaro.org> 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 <p...@akeo.ie>
---
   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.
+<kbd>Esc</kbd> enters platform setup. <kbd>F1</kbd> 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
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to