Running Genode on a Raspberry Pi 3

Simon Himmelbauer himmelba at in.tum.de
Tue Nov 10 21:12:58 CET 2020


>> Hi Genodians,
>>
>> I am trying to get a Genode image using the Fiasco.OC-kernel running
>> on an RPi 3. I created an arm_v8a build directory and accordingly set
>> the KERNEL and BOARD variable. I also compiled a u-boot image from the
>> upstream repository.
>>
>> When I attempt to boot the image from the u-boot prompt, I receive the
>> output below with no further reaction. I am still on Genode 19.05
>> because of a few modifications so I unless there is no other solution,
>> I would like to avoid upgrading to a newer version.
>>
>> I also tried to run a few L4Re images provided here [0] with the same
>> result, so the problem might not even be specific to Genode.
>>
>> Does anyone else have experiences with running on an RPi 3? Is there
>> anything I am missing here?
> Hi,
>
> today I was able to check this configuration and in my setup and it is
> working ok for me. My setup is somewhat similar to one I described in my
> article on genodians.org with loading image over tftp although I think I
> did not describe in datail configuration for 64bit version.
>
> I think one important piece is content of config.txt. Mine is:
>
>    kernel=u-boot.bin
>    enable_uart=1
>
>    arm_64bit=1
>
>    enable_jtag_gpio=1
>
>
> Based on modification times of files on sd card I prepared it about year
> ago (November 2019) and if I correctly remember I used current at that
> time versions of rpi firmware and u-boot.
>
>
> Below is the complete output I received from running run/log with
> KERNEL=foc and BOARD=rpi3 on release 20.08
>
> I hope this will help you.
>
> Best regards,
> Tomasz
>
Hi Tomasz,

I actually used your guide to setup Genode on a Raspberry so before I 
continue, I wanted to thank you for this article.

Anyway, I don't understand what I am doing wrong here. I followed your 
guide step-by-step with the exception of booting the image from the 
sd-card. My config looks very similar to yours (see below). However, I 
always receive garbage output. I think it must be a UART-issue of some 
sort. I investigated the Fiasco.OC-kernel code and found out that when 
the rpi3 configuration is used, it tries to compile a driver for the 
16550 instead of the PL011, which is actually used in the RPi3 (unless I 
am misunderstanding something, I should add that most of this stuff is 
kind of new to me). Unfortunately, this did not fix the problem either 
but still, I added the changed files below for clarification.

Could you share me your image to see whether I can get it to boot on my 
Pi as well?

Best regards,
Simon

config.txt:
enable_uart=1
arm_64bit=1
init_uart_baud=115200
kernel=u-boot.bin

I modified the file src/kern/arm/bsp/bcm283x/Modules to compile the 
driver for the PL011 instead:

SUBSYSTEMS              += LIBUART
PREPROCESS_PARTS        += libuart generic_tickless_idle arm_single_ipi_irq
PREPROCESS_PARTS        += $(if $(CONFIG_ARM_V7PLUS),arm_generic_timer)
# PREPROCESS_PARTS        += $(if $(CONFIG_PF_BCM283X_RPI3),16550)
PREPROCESS_PARTS        += $(if $(CONFIG_PF_BCM283X_RPIZW),16550)
INTERFACES_KERNEL       += $(if $(CONFIG_ARM_V7PLUS),generic_timer)
INTERFACES_KERNEL       += arm_control irq_handler
RAM_PHYS_BASE           := 0

#ifeq ($(CONFIG_PF_BCM283X_RPI3),y)
#  uart_IMPL              = uart uart-16550
#  kernel_uart_IMPL      += kernel_uart-libuart
#  OBJECTS_LIBUART       += uart_16550.o
ifeq ($(CONFIG_PF_BCM283X_RPIZW),y)
   uart_IMPL              = uart uart-16550
   kernel_uart_IMPL      += kernel_uart-libuart
   OBJECTS_LIBUART       += uart_16550.o
else
   uart_IMPL             += uart-arm-bcm283x
   kernel_uart_IMPL      += kernel_uart-arm-bcm283x
   OBJECTS_LIBUART       += uart_pl011.o
endif
arm_control_IMPL      += arm_control-arm-bcm283x
config_IMPL           += config-arm-bcm283x
mem_layout_IMPL       += mem_layout-arm-bcm283x
pic_IMPL              += pic-arm-bcm283x
timer_IMPL            += timer-arm-bcm283x
timer_IMPL            += $(if $(CONFIG_ARM_V7PLUS),timer-arm-generic)
timer_tick_IMPL       += $(if 
$(CONFIG_ARM_V7PLUS),timer_tick-arm-bcm283x,timer_tick-single-vector)
reset_IMPL            += reset-arm-bcm283x
clock_IMPL            += clock-generic
ipi_IMPL              += ipi-arm-bcm283x
platform_control_IMPL += platform_control-arm-bcm283x
irq_handler_IMPL       = irq_handler-arm-bcm283x

I also needed to modify src/kern/arm/bsp/bcm283x/uart-arm-bcm283x.cpp so 
it is included by the compiler:

IMPLEMENTATION [pf_bcm283x && !(pf_bcm283x_rpizw)]:

#include "koptions.h"
#include "uart_pl011.h"

IMPLEMENT Address Uart::base() const
{ return Koptions::o()->uart.base_address; }

IMPLEMENT int Uart::irq() const
{ return Koptions::o()->uart.irqno; }

IMPLEMENT L4::Uart *Uart::uart()
{
   //static L4::Uart_pl011 uart(Koptions::o()->uart.base_baud);
   static L4::Uart_pl011 uart(115200);
   return &uart;
}


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.genode.org/pipermail/users/attachments/20201110/f7d2982a/attachment.html>


More information about the users mailing list