OP-TEE / optee_os

Trusted side of the TEE
Other
1.56k stars 1.05k forks source link

BL33 code #668

Closed peterfeifanchen closed 8 years ago

peterfeifanchen commented 8 years ago

Hi,

I am just wondering, where do I find the code for BL33. I am just curious and going through the OPTEE code base right now. The arm-trusted-firmware repository has BL1,2,31 and BL32 would be the optee_os, but all I can find for BL33 is that it an image gets built in linaro-edk2/Build/HiKey/RELEASE_GCC49/FV/BL33_AP_UEFI.fd.

Thanks.

vchong commented 8 years ago

BL33 is the Non-trusted Firmware image [1]. It can be UEFI, U-Boot or other test or boot software. EDK II is an implementation of the UEFI specification. [2, 3] HiKey by default uses a fork of EDK2 [4].

[1] https://github.com/ARM-software/arm-trusted-firmware/blob/master/docs/firmware-design.md#bl33-non-trusted-firmware-image-load [2] http://www.tianocore.org/edk2/ [3] https://github.com/tianocore/edk2 [4] https://github.com/96boards/edk2/

peterfeifanchen commented 8 years ago

Is there a linker script file/map or a file with the source code for the entry point for BL33_AP_UEFI.fd? Kind of like how BL1, BL2, BL31 and OPTEE all have something like blx_entrypoint.S and generic_entry_a64.S.

I see under HisiPkg there is a HiKeyPkg which contains dsc and fdf files pointing to other Pkgs (I am assuming to grab), but beyond that I am not sure how to locate where the starting point is.

vchong commented 8 years ago

In ARM-TF, bl2_main.c, load_bl33 function calls load_image function with argument plat_get_ns_image_entrypoint(). In hikey_common.c, this function returns the image offset in DRAM.

In EDK2, HiKeyDxe.inf specifies the ENTRY_POINT to be HiKeyEntryPoint, in HiKeyDxe.c. This is the platform entry point. Not sure where the main entry point is. You might have to do some reading up on UEFI/EDK2.

ghost commented 8 years ago

Question has been answered, but If the issue persists or you have more questions, please re-open the issue.