cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Observer
Observer
1,073 Views
Registered: ‎03-18-2019

U-Boot EL3

Hi.
Is It possible to run U-Boot with exception layer EL3.
I want to use U-Boot as the bootloader for BareMetal or FreeRTOS firmware for ZynqMP platform. The problem is that U-Boot runs with EL2, switchs EL to EL1 when start BareMetal/FreeRTOS (is built with BSP for EL3).

Thanks.

0 Kudos
5 Replies
Highlighted
Xilinx Employee
Xilinx Employee
987 Views
Registered: ‎03-02-2016

Evethough its is not the  supported bootflow, Yes you can boot u-boot at EL3 with out any issue, you just have to skip loading ATF(bl31.elf) in the bootsequence.

Regarding hand off to EL3 app, you need to comment out the routine do_go_exec() defined in board/xilinx/zynqmp/zynqmp.c of u-boot. 

0 Kudos
Highlighted
Visitor
Visitor
544 Views
Registered: ‎01-24-2020

Has anyone been able to implement this solution?

I tired to remove BL31 from the bif for generating BOOT.bin.

the_ROM_image:
{
[bootloader, destination_cpu = a53-0] embeddedsw/lib/sw_apps/zynqmp_fsbl/src/fsbl.elf
[pmufw_image] embeddedsw/lib/sw_apps/zynqmp_pmufw/src/executable.elf
[destination_device=pl] hardware_platforms/latest/top.bit
[destination_cpu=a53-0, exception_level=el-3] u-boot-xlnx/u-boot.elf
}

After flashing BOOT.bin I get the FSBL output 


================= In Stage 4 ============
Protection configuration applied
Running Cpu Handoff address: 0x8000000, Exec State: 0
Exit from FSBL

 

Do i need to put Uboot at a certain address?  I am not sure what I am doing wrong here.

0 Kudos
Highlighted
Observer
Observer
531 Views
Registered: ‎03-18-2019

Hi.

I have made my own bootloader on FreeRTOS base.

0 Kudos
Highlighted
Visitor
Visitor
275 Views
Registered: ‎03-04-2020

Has anyone made something like this work?

bare:
{
    [bootloader, destination_cpu=a53-0] fsbl.elf
    [destination_cpu=a53-0, exception_level=el-3] u-boot.elf
}

If so, what did you change in U-Boot?  In FSBL?  Can you show the code?

If not, what did you try?  Can you show the code?

 

0 Kudos
Highlighted
Visitor
Visitor
239 Views
Registered: ‎01-24-2020

There are a couple of places where Uboot depends on the Secure monitor (SMC, ATF, bl31) to make calls to the PMU. When the SMC is not present uboot will hang execution on these smc calls.

You will need to bypass the SMC and make a IPI calls to the PMU directly or just not make those calls, in your case with no PMU FW either I guess you would skip it all together.

The first of which is in board_early_init_f(void) in board/xilinx/zynqmp/zynqmp.c

zynqmp_pmufw_version makes call to invoke_smc, if you comment this call to zynqmp_pmufw_version()  you should get to the uboot prompt at EL3

 

For executing FreeRTOS application from Uboot you will need to disable instruction cache in do_go_exec in board/xilinx/zynqmp/zynqmp.c after disabling the data cache. 

icache_disable();

 

For our application we also needed to be able to load PL from UBoot at EL3 with no SMC so we are making the IPI calls needed with a small library that is adapted from the Arm Trusted Firmware "pm_service" code.