Binman how to build using Rockchip BL32 binary as OP-TEE

Jonas Karlman jonas at kwiboo.se
Wed Sep 6 08:51:39 CEST 2023


Hi Simon,

On 2023-09-05 20:16, Simon Glass wrote:
> Hi Jonas,
> 
> On Mon, 4 Sept 2023 at 10:52, Jonas Karlman <jonas at kwiboo.se> wrote:
>>
>> Hi Massimo,
>>
>> On 2023-09-04 17:05, Massimo Pegorer wrote:
>>> Hi,
>>>
>>> Is there any way for binman to package FIT with U-Boot TF-A and
>>> OP-TEE, using bl32 binary provided by Rockchip as TEE?
>>>
>>> I've tried with TEE=/path/to/rkbin/bin/rk33/xxx_bl32_vX.YZ.bin, but
>>> binman failed.
>>>
>>> In my poor understanding of Python code, it seems binman accepts only
>>> ELF format or a binary format starting with optee_v1_header, but
>>> binaries provided by Rockchip in rkbin repository do not have this
>>> header.
>>
>> One way that I have used/tested before was to create a tee.elf version
>> using something like:
>>
>> $ aarch64-linux-gnu-objcopy -B aarch64 -I binary -O elf64-littleaarch64
> xxx_bl32_vX.YZ.bin bl32.o
>> $ aarch64-linux-gnu-ld bl32.o -T tee.ld -o tee.elf
>>
>> tee.ld:
>> ----
>> ENTRY(_binary_bl32_bin_start);
>>
>> SECTIONS
>> {
>>         . = 0x08400000;
>>         .data : {
>>                 *(.data)
>>         }
>> }
>> ----
>>
>> And then make with TEE=tee.elf, however keep in mind that U-Boot may not
>> treat the memory region used by OP-TEE properly for aarch64.
>>
>> Regards,
>> Jonas
>>
>>>
>>> Thanks in advance for any hints!
> 
> Should we do something to support a 'flat' binary in the tee-os entry type?
> For example, we could allow it if so long as a fixed load address is
> provided? It might be a bit of a hack though.

Yes, it would be nice to have some way to support a blob with flat/plain
binary code and a fixed load address.

Personally I have no interest in using TEE-OS on Rockchip platform and
have only used above workaround for testing and to verify that a blob
could be loaded.

As vaguely stated, using a rkbin provided TEE-OS blob is not fully
supported in U-Boot/linux on aarch64. No memory reservation is made so
U-Boot proper or linux may use part of the memory managed by TEE-OS.

Regards,
Jonas

> 
> Regards,
> Simon
> 



More information about the U-Boot mailing list