L4Re on Raspi 3

Paul Boddie paul at boddie.org.uk
Mon Jun 21 00:21:10 CEST 2021


On Sunday, 20 June 2021 23:42:28 CEST Adam Lackorzynski wrote:
> 
> On Sat Jun 19, 2021 at 02:00:18 +0200, Paul Boddie wrote:
> > 
> > Unfortunately, the UART defined for the Pi Zero W is the 16550, whereas
> > the Pi Zero may be more similar to the original Pi (or Pi 1) and use the
> > PL001.
> 
> Ok, thanks, bootstrap is currently not handling this, I'll try to add
> it.

Being a bit lazy about this, I found that choosing the original Raspberry Pi 
(rpi1) was fine in the Fiasco configuration when using the sources from 
GitHub. More on this below.

[...]

> Yes, definetly, dsb sy is a ARMv7 instruction. I'll have this fixed.

Great!

[...]

> > Thanks for helping to finish this unfinished business! :-)
> 
> Thanks for the addition too :)

I also spent quite a bit of time trying to reproduce my success with the 
Subversion checkout I already had, but it seems that it just won't produce 
working output for the Pi Zero, even with an ARMv6-compliant toolchain. One 
reason might be some deficiency or mismatch in the version of Fiasco from that 
era, where the Pi support was provided using the bcm283x BSP as opposed to the 
rpi BSP in more recent Fiasco sources. The L4Re code might also be 
incompatible in some way with the techniques that work with the snapshot.

So I decided to obtain the code from GitHub using the ham tool and manifest 
repository. This seemed to work reasonably well using the following recipe:

----
ham/ham init -u https://github.com/kernkonzept/manifest.git
ham/ham sync
cd l4/pkg/bootstrap
patch -p0 < rpi.cc.diff # remove "dsb sy" instructions!
cd ../..
make B=mybuild
cd mybuild
echo "CROSS_COMPILE:=$HOME/L4/buildroot-2020.11/output.arm/host/bin/arm-
linux-" > Makeconf.local
make config

    Target Architecture (ARM architecture)
    CPU variant (ARMv6zk type CPU)
    Platform Selection (Raspberry Pi)

make -j8
cd ../../fiasco
make B=mybuild
cd mybuild
echo "CROSS_COMPILE:=$HOME/L4/buildroot-2020.11/output.arm/host/bin/arm-
linux-" > Makeconf.local
make config

    Architecture (ARM processor family)
    Platform (Raspberry Pi (Broadcom 283X & 2711))
    Raspberry Pi variant (rpi1)
    CPU (ARM 1176 CPU)
    [*] Enable FPU co-processor
    [*]   Enable lazy FPU switching (NEW)

make -j8
cd ../../l4/mybuild
make -j8 E=hello uimage
----

I know this is similar to what is written in the GitHub wiki pages, but it 
might be useful to have it spelled out, particularly the configuration 
options. I have found the make invocations generally inconsistent and 
frustrating, with the Fiasco Makefile tending to ignore options in certain 
cases and create a "build" directory with the default settings.

Perhaps this has improved recently (and the snapshot does seem to deploy and 
use default configuration files), but clearer advice about just using existing 
board configurations would be very helpful. After all, projects like U-Boot 
and Linux support "make board_defconfig" rather well. (Getting the U-Boot 
binary to deploy on the Pi was almost trivial.)

I did wonder what the situation is with a few things related to the GitHub 
repositories. The snapshot provides extra packages, but are these readily 
downloaded using ham? More specifically for the Pi, has any support for the 
framebuffer been developed for it? (I got the video output working for the 
CI20, by the way, albeit in DVI-compatible mode, with full HDMI support being 
a matter of porting the remaining functionality from the Synopsys DW-HDMI 
Linux driver, which is fairly dull work that is unnecessary with my DVI 
monitor.)

I think I may try and develop on top of the GitHub-originating code in future: 
using the Subversion checkout was merely convenient since I already had all 
that code, and I didn't want to disrupt things and find myself doing a lot of 
work just to have things as they were, but it thankfully seemed to be a fairly 
straightforward process.

Anyway, thanks once again for the software and the improvements that helped to 
make this work!

Paul





More information about the l4-hackers mailing list