Genode on RPI

Tomasz Gajewski tomga at wp.pl
Mon Jan 7 00:08:33 CET 2019



> Christian Helmuth <christian.helmuth at genode-labs.com> writes:
>>
>> I'm not an U-Boot expert but as I understand it the loader sensibly
>> handles the boot-image format [1] [2] by switching to AArch32 or
>> AArch64 depending on the image-header information. So, it should be a
>> matter of
>>
>>   mkimage -A arm  vs.
>>   mkimage -A arm64
>>
>> Or Am I wrong?
>
> That's what I was suggesting when writing about patches but it seems I
> did not write that clearly enough. I've seen informations about those
> patches in mailing lists from 2016 and assumed that u-boot does the
> switch to Aarch32.
>
> I'll try to make some tests during the weekend that will somehow
> clarify what is happening.

u-boot switches to Aarch32 in my current configuration.

Using suggested by Bob method (writing to memory and checking it after
reset) I confirmed that code crt0.s from bootstrap is started in HYP
mode and using code:

    mrs r0,cpsr
    bic r0,r0,#0x1F
    orr r0,r0,#0x13
    msr spsr_cxsf,r0
    add r0,pc,#4
    msr ELR_hyp,r0
    eret

taken from [1] I could switch to SVC mode what allowed to continue boot.

Currently I don't know how far it goes (but further than in my earlier
attempts) because write after enabling address translation in
repos/base-hw/src/bootstrap/spec/rpi/platform.cc with:

    sctlr = Cpu::Sctlr::read();
    Cpu::Sctlr::C::set(sctlr, 1);
    Cpu::Sctlr::I::set(sctlr, 1);
    Cpu::Sctlr::M::set(sctlr, 1);
    Cpu::Sctlr::write(sctlr);

I loose ability to write debug to memory.

At least I'm now in a state that I think I understand what is going on
and I'll continue research when time permits.

Thanks for help.

[1] https://github.com/dwelch67/raspberrypi/tree/master/boards/pi3/aarch32/SVC

Tomasz Gajewski




More information about the users mailing list