Running seL4 on a BeagleV-Fire

Hello guys,
last week I received the BeagleV-Fire, which contains the Microchip’s Polarfire MPFS025T SoC.

I’ve tried to run seL4 but I got stuck in here:

boot_problem

Someone has tried or has some advice for me?

Thanks

Hi

Could you describe how you built seL4? Are you running sel4test?

I couldn’t find any kind of technical reference manual for the BeagleV-Fire, do you know where it is or where I could find the device tree for the platform?

Thanks

Hello,
so I’ve supposed that, as it’s exactly the same SoC used by the real PolarFire, the memory addresses and all should be the same, so the original compilation for Polarfire should work.

I’ve followed the instructions given by the guys from Dornerworks in the following link:

I’ve also tried with the steps stated in the sel4 web, leading to the same error:
https://docs.sel4.systems/Hardware/polarfire.html

Yes, I would also think it should work given it’s the same SoC.

When you use a binary image like for the seL4 website, it leads to the same fault in the same place?

And just to confirm, there’s no SBI/OpenSBI running before U-Boot?

Hello, sorry for the delay!
I’ve been busy this last week.

I’ve also continue with some tests and some reading (https://sel4.discourse.group/t/microchip-polarfire-icicle-kit-status/675/4
and I always end with the same error…

@ivanvelickovic As far as I can see, I don’t see opensbi before uboot
I’ve also followd this https://openbeagle.org/beaglev-fire/BeagleV-Fire-ubuntu so that’s the uboot I’m using at the moment.

HSS: decompressing from eNVM to L2 Scratch ... Passed
DDR training ... Passed ( 5820 ms)
---------------------------------
--        BeagleV-Fire         --
---------------------------------
[5.882954] PolarFire(R) SoC Hart Software Services (HSS) - version 0.99.36-BVF-0.3.0
MPFS HAL version 2.2.104 / DDR Driver version 0.4.023 / Mi-V IHC version 0.1.1 / BOARD=bvf
(c) Copyright 2017-2022 Microchip FPGA Embedded Systems Solutions.
incorporating OpenSBI - version 1.2
(c) Copyright 2019-2022 Western Digital Corporation.
[5.913942] Build ID: 3f0ed536ff6a0aaef3c9b81896adaee39ec4d8c1
[5.920799] Built with the following tools:
 - riscv64-unknown-elf-gcc (xPack GNU RISC-V Embedded GCC (Microsemi SoftConsole build), 64-bit) 8.3.0
 - GNU ld (xPack GNU RISC-V Embedded GCC (Microsemi SoftConsole build), 64-bit) 2.32
[5.942673] NOTICE: Running from L2 Scratchpad
[5.948315] Serial Number: 
26b0af2182740fefddf246a1379f788f00000000000000000000000000000000000000000000000000000000000000000000
[5.960987] Segment Configuration:
        Cached: SEG0_0: offset 0x0080000000, physical DDR 0x00000000
        Cached: SEG0_1: offset 0x1000000000, physical DDR 0x00000000
    Non-cached: SEG1_2: offset 0x00c0000000, physical DDR 0x00000000
    Non-cached: SEG1_3: offset 0x1400000000, physical DDR 0x00000000
Non-cached WCB: SEG1_4: offset 0x00d0000000, physical DDR 0x00000000
Non-cached WCB: SEG1_5: offset 0x1800000000, physical DDR 0x00000000
[6.01870] L2 Cache Configuration:
    L2-Scratchpad:  4 ways (512 KiB)
         L2-Cache:  8 ways (1024 KiB)
           L2-LIM:  4 ways (512 KiB)
[6.16279] DDR-Lo size is   32 MiB
[6.20445] DDR-Hi size is 1888 MiB
[6.44211] Design Info: 
    Design Name: CI_DEFAULT_FD28A2CA1789CDC1137
    Design Version: 02.00.2
[6.54541] Attempting to select eMMC ... Passed
[6.309993] User button NOT pressed
Press a key to enter CLI, ESC to skip
Timeout in 1 second
..
[7.319633] CLI boot interrupt timeout
[7.324147] Initializing Mi-V IHC
[7.328226] Initializing IPI Queues (3304 bytes @ a02e660)...
[7.334736] Initializing PMPs
[7.338469] Initializing Boot Image ...
[7.343069] Trying to boot via MMC ...
[7.347583] Attempting to select eMMC ... Passed
[7.603122] Preparing to copy from MMC to DDR ...
[7.608677] Validated GPT Header ...
[7.627643] Validated GPT Partition Entries ...
[7.632938] Boot Partition found at index 0
[7.637885] Attempting to read image header (1632 bytes) ...
[7.644369] Copying 699928 bytes to 0x103fc00000
[7.653917] MMC: Boot Image registered ...
[7.658778] Boot image passed CRC
[7.663118] Boot image set name: "PolarFire-SoC-HSS::U-Boot"
U-Boot 2022.01-linux4microchip+fpga-2023.02-00001-gf993b00a (Feb 14 2024 - 13:57:45 +0100)
CPU:   rv64imafdc
Model: Microchip PolarFire-SoC Icicle Kit
DRAM:  1.8 GiB
MMC:   mmc@20008000: 0
Loading Environment from nowhere... OK
In:    serial@20000000
Out:   serial@20000000
Err:   serial@20000000
Net:   eth0: ethernet@20112000
Hit any key to stop autoboot:  0 
RISC-V #  

Good morning,
just to give you all an update on the subject.

I’m still blocked with running seL4 in the beagleV-Fire board but, we also have the real polarfire, the video kit to be precise and there, I’ve tried to run seL4 and I have it fully working.

I’ve also tried the following:

  • Loading seL4 as an uboot image (uImage) + its correspondent dtb file (This is the procedure I followed with the real polarfire). Here I though I got something because I didn’t have any crash so I just though that I wasn’t reading the good serial port (the beaglev-fire only has 1 uart) so I modified seL4 to output everything through the uart0 but, nothing changed…

All ideas are welcome.

I also tried to run seL4 on the BeagleV-Fire, but I wasn’t able to make any headway with it. It seems like the instructions based on the Icicle kit from the original Dornerworks website used a different load address than what the wiki says:

seL4 wiki:
fatload mmc 0 0x1000200000 seL4-uImage
fatload mmc 0 0x1020200000 kernel.dtb
bootm 0x1000200000 - 0x1020200000

RISC-V # fatload mmc 0:2 0x80000000 sel4test-driver-image-riscv-polarfire; go 0x80000000

Ivan, is there a reason why the instructions have changed between the two?

Hello,
here the steps I had to do to get seL4 running on the Beagle:
1- Set the default uart to the UART0, as the beagle is using that port. Modify the file
projects/util_libs/libplatsupport/plat_include/polarfire/platsupport/plat/serial.h

...
PS_SERIAL_DEFAULT = UART0
...
#define DEFAULT_SERIAL_PADDR UART0_PADDR
#define DEFAULT_SERIAL_INTERRUPT UART0_IRQ
...

2- Define the variable FW_FDT_PATH in <tools/opensbi/firmware/fw_base.S> with your kernel.dtb file

#define FW_FDT_PATH    "../../build/kernel/kernel.dtb"

3-
Then I just compile seL4 with the following parameters:

../init-build.sh -DPLATFORM=polarfire -DElfloaderImage=elf -DKernelPrinting=ON -DRISCV64=TRUE #-DSMP=1 -DKernelMaxNumNodes=4

4-
After that, I use the hss-payload-generator with the following config.yaml:
hart-entry-points: {u54_1: '0x80000000', u54_2: '0x80000000', u54_3: '0x80000000', u54_4: '0x80000000'}
payloads:
sel4test-driver-image-riscv-polarfire: {exec-addr: '0x80000000', owner-hart: u54_1, priv-mode: prv_m}

./hss-payload-generator -vv -c config.yaml payload.bin

5-
and finally, just copy the binary file to the Beagle:
sudo dd if=payload.bin of=/dev/sdb1

6-
image

p.s. Indeed, I don’t understand why it doesn’t work following the wiki (I’ve tested in the real Polarfire, and they worked).