Porting u-boot from yocto to Android

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Porting u-boot from yocto to Android

872 Views
thisisprateek
Contributor I

I'm working on porting Android to a custom I.MX8MP based SoC. It has a working yocto based linux and u-boot. The custom board uses custom DDR4 initialization parameters, so naturally I began with copying boards/my_vedor/my_board folder from u-boot's work directory in Yocto into Android's vendor/nxp-opensource/uboot-imx/boards and did the same for board's include file, .dts files and u-boot defconfig files. Here's what else I have done so far:

1. Created new defconfigs for my_board to match TARGET_BOOTLOADER_CONFIG entries in evk_8mp's UBootKernelConfig.mk by copying all evk_8mp's defconfigs, renaming them and bringing my_board related changes from yocto into them (dtb, vendor name and +/- some configutations).

2. Created a new target for this board in device/nxp/imx8m/my_board and modified them. Made sure all TARGET_BOOTLOADER_CONFIGs point to the defconfigs crated in previous step.

3. Since Android's u-boot codebase is different from Yocto's, I merged all the my_board specific code in board/my_vendor/my_board as well as in the board's config header file to match the Android's codebase + my customization.

4. Repeated the step 3 for the my_board.dtb as well though I'm not sure if that was necessary.

I'm able to run lunch my_board and launch the build for bootloader. But the build is failing during compilation and the error seems to be arising from u-boot's libraries and not from my_board specific code. The errors are as below:

/android_build/vendor/nxp-opensource/uboot-imx/lib/avb/fsl/fsl_avbkey.c:314: undefined reference to `blob_decap'

android_build/vendor/nxp-opensource/uboot-imx/lib/avb/fsl/fsl_avbkey.c:319: undefined reference to `derive_blob_kek'

Now, I have narrowed it down to Trusty OS support. If I set CONFIG_IMX_TRUSTY_OS=n in my imx8mp_my_board_android_trusty_defconfig, imx8mp_my_board_android_trusty_dual_defconfig, imx8mp_my_board_android_trusty_secure_unlock_defconfig, and imx8mp_my_board_android_trusty_powersave_defconfig files, the build runs successfully. But If I try to perform the build for evk_8mp (of course I run lunch first), with CONFIG_IMX_TRUSTY_OS=y the build succeeds.

I'm out of clues as to what might be going wrong. I'm attaching the build logs here for reference. Any help with this would be very much appreciated.at

Please let me know if any clarifications are needed.

Thanks

Labels (1)
0 Kudos
4 Replies

575 Views
joanxie
NXP TechSupport
NXP TechSupport

this is patch for adding trust OS, you can check what different in your code, I don't know how your code change, but you can refer to this patch to get some clue

"https://coral.googlesource.com/uboot-imx/+/6fa4f4a42fd90631f8dc8303b17f600c085d8595%5E%21/"

0 Kudos

724 Views
Tooght
Contributor III

Hi Sir @thisisprateek ,

I have the same problem, Did you find the solution? CAn you please shed some light on how to fix this issue?

 

Thank you!

0 Kudos

684 Views
thisisprateek
Contributor I

I couldn't get it solved. I went with setting CONFIG_IMX_TRUSTY_OS=n. It got built without Trusty OS support. The customer didn't demand it either and the project moved on.

661 Views
Tooght
Contributor III

Thank you @thisisprateek. it seems I have to do the same thing like you did here for now. I'll keep an eye on here. if I have any solution, I'll share it with you.

0 Kudos