Odroid C2 Bare Metal - access to registers

Moderators: mdrjr, odroid

Odroid C2 Bare Metal - access to registers

Unread postby davetreehouse » Wed Jun 06, 2018 2:00 am

Hi everyone

Currently I am testing the Odroid C2 board for bare metal development. I could handle the signing but now I am completely stuck. Is it correct that registers such as SPSR_EL3, SPSel and others cannot be read out even at EL3? And if so, can't they be written too?

Thank you in advance for your answer!

dave
davetreehouse
 
Posts: 3
Joined: Wed Jun 06, 2018 1:51 am
languages_spoken: english
ODROIDs: Odroid C2

Re: Odroid C2 Bare Metal - access to registers

Unread postby tobetter » Wed Jun 06, 2018 2:13 am

I wonder what you mean by you can handle the signing. If you are developing of the TrustZone code, I doubt it can be on ODROID-C2 since it does not have TEE OS. Actually, the secure mode of S905 shipped on ODROID-C2 is disabled while ODROID-XU4 is.
tobetter
 
Posts: 2240
Joined: Mon Feb 25, 2013 10:55 am
Location: Paju, South Korea
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1

Re: Odroid C2 Bare Metal - access to registers

Unread postby davetreehouse » Wed Jun 06, 2018 4:30 pm

Hi tobetter

No, I am not developing Trust Zone Code. I try to port a hypervisor without using a bootloader, i.e. directly run my code after the bl31.bin blob provided by hardkernel. To be able to run the code without the U-Boot bootloader, I need to sign it with the aml_encrypt_gxb a.o.

My problem now is that I have to reroute all exceptions to the hypervisor code running at EL2 and therefore need to be able to write to the mentioned registers.

Now that you mentioned it - is it possible to run the code without using the bl1.bin to bl31.bin blobs provided by Hardkernel? I think that this would solve my problem too.

dave
davetreehouse
 
Posts: 3
Joined: Wed Jun 06, 2018 1:51 am
languages_spoken: english
ODROIDs: Odroid C2

Re: Odroid C2 Bare Metal - access to registers

Unread postby tobetter » Thu Jun 07, 2018 1:52 pm

davetreehouse wrote:Hi tobetter

No, I am not developing Trust Zone Code. I try to port a hypervisor without using a bootloader, i.e. directly run my code after the bl31.bin blob provided by hardkernel. To be able to run the code without the U-Boot bootloader, I need to sign it with the aml_encrypt_gxb a.o.

My problem now is that I have to reroute all exceptions to the hypervisor code running at EL2 and therefore need to be able to write to the mentioned registers.

Now that you mentioned it - is it possible to run the code without using the bl1.bin to bl31.bin blobs provided by Hardkernel? I think that this would solve my problem too.

dave

Hello Dave,

I am sorry that I am not having that much knowledge of Hypervisor thing. But you must use the binary bl1.bin and bl31.bin to initiate the hardware blocks and load further images. If they are missing or signature is not matched, ODROID-C2 won't boot up.
tobetter
 
Posts: 2240
Joined: Mon Feb 25, 2013 10:55 am
Location: Paju, South Korea
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1

Re: Odroid C2 Bare Metal - access to registers

Unread postby Luke.go » Thu Jun 07, 2018 3:03 pm

Hi there.
You should go into the EL3 to manage the SPSR_EL3. because to access each Exception Level, you should have permission about it.
But, why you want to read the Sp of EL3? :roll:
In my opinion, you should don't care about that on EL2 or Hypervisor.
Luke.go
 
Posts: 227
Joined: Mon May 30, 2016 1:55 pm
languages_spoken: english

Re: Odroid C2 Bare Metal - access to registers

Unread postby davetreehouse » Thu Jun 07, 2018 4:28 pm

Hi all

Thanks for your answers!!

@tobetter - Unfortunately, I have already suspected that this is not possible. I also noticed that only the standard sections from the linker script are loaded. In a first attempt I created a separate section for the reset handling, which was somehow not loaded correctly (or not at all). But thanks again for your help!

@ luke - Well, directly after the bl31.bin the processor is per default in EL3, so this shouldn't be the problem. In the SPSR_EL3 register, I would like to mask the exceptions. In the Stack Pointer itself, I'm not really interested except for the fact that I need to have a separate SP on each exception level (therefore I need access to SPSel to select the SP_ELn for each EL in contrast to the per default used SP_EL0).

Thanks again for your help!! I think I will try another board and may be come back to the Odroid C2 later - I'm a little bit short on time because it's for a Bachelor Thesis :)

dave
davetreehouse
 
Posts: 3
Joined: Wed Jun 06, 2018 1:51 am
languages_spoken: english
ODROIDs: Odroid C2


Return to Hardware and peripherals

Who is online

Users browsing this forum: No registered users and 2 guests