DB410c LK Bootloader compile from source


#1

Hello,

I am interested in developing and changing the code of the LK bootloader. I see a couple of threads on this forum related to this topic but none answered my question yet.

My problem is: The LK image I have compiled won’t run. I didn’t change anything in the code yet, I am just trying to compile the bootloader from sources and have it working. I followed the steps found here:

git clone git://codeaurora.org/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8.git -b LA.BR.1.1.3.c4-01000-8x16.0
git clone http://git.linaro.org/landing-teams/working/qualcomm/lk.git -b dragonboard410c-LA.BR.1.2.7-03810-8x16.0-linaro1
cd lk
make -j4 msm8916 EMMC_BOOT=1 TOOLCHAIN_PREFIX=../arm-eabi-4.8/bin/arm-eabi-
sudo fastboot flash aboot ./build-msm8916/emmc_appsboot.mbn

The compilation is successful, the image is created and flashed successfully too, but after reboot the board is bricked and won’t start again. fastboot mode pushing Vol [ - ] button is not working as well. Fortunately I can fix this booting from the SD card rescue image.

What am I doing wrong in the process? Can someone think of any step that I might be missing?

Cheers and thanks in advance


#2

I am having the same issue. Below is the output I see on the serial console.

Mark


S - QC_IMAGE_VERSION_STRING=BOOT.BF.3.0-00286
S - IMAGE_VARIANT_STRING=HAAAANAZA
S - OEM_IMAGE_VERSION_STRING=CRM
S - Boot Config, 0x000002e3
S - Core 0 Frequency, 0 MHz
B - 1545 - PBL, Start
B - 3489 - bootable_media_detect_entry, Start
B - 168714 - bootable_media_detect_success, Start
B - 168718 - elf_loader_entry, Start
B - 170982 - auth_hash_seg_entry, Start
B - 171191 - auth_hash_seg_exit, Start
B - 186651 - elf_segs_hash_verify_entry, Start
B - 246881 - PBL, End
B - 254004 - SBL1, Start
B - 316864 - pm_device_init, Start
D - 14731 - pm_device_init, Delta
B - 331992 - boot_flash_init, Start
D - 30 - boot_flash_init, Delta
B - 336018 - boot_config_data_table_init, Start
D - 68564 - boot_config_data_table_init, Delta - (452 Bytes)
B - 409127 - CDT version:3,Platform ID:24,Major ID:1,Minor ID:0,Subtype:0
B - 415379 - sbl1_ddr_set_params, Start
B - 419192 - cpr_init, Start
D - 0 - cpr_init, Delta
B - 424804 - Pre_DDR_clock_init, Start
D - 213 - Pre_DDR_clock_init, Delta
D - 0 - sbl1_ddr_set_params, Delta
B - 437400 - pm_driver_init, Start
D - 3477 - pm_driver_init, Delta
B - 449478 - SBC platform detected: XO_ADJ_FINE = 0x20
B - 449509 - clock_init, Start
D - 30 - clock_init, Delta
B - 464423 - Image Load, Start
D - 32849 - QSEE Image Loaded, Delta - (567468 Bytes)
B - 497302 - Image Load, Start
D - 396 - SEC Image Loaded, Delta - (2048 Bytes)
B - 504531 - sbl1_efs_handle_cookies, Start
D - 91 - sbl1_efs_handle_cookies, Delta
B - 512308 - Image Load, Start
D - 20191 - QHEE Image Loaded, Delta - (56048 Bytes)
B - 532530 - Image Load, Start
D - 14091 - RPM Image Loaded, Delta - (149316 Bytes)
B - 546651 - Image Load, Start
B - 549030 - Error code 3063 at boot_authenticator.c Line 407


#3

Looks like this output is coming from the sbl1.mbn first-stage bootloader. I think it is trying to load our second-stage bootloader, but it is rejecting because it fails at checking some signature. So, second stage bootloader must be signed somehow?


#4

hi,

as mentioned here: Linux based Linaro 17.04 release, there is an additional step which is missing from the release notes.


#5

Thanks. With this signing procedure I am able to launch the custom bootloader. Here the commands I used, just for reference:

git clone git://codeaurora.org/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8.git -b LA.BR.1.1.3.c4-01000-8x16.0
git clone http://git.linaro.org/landing-teams/working/qualcomm/lk.git -b dragonboard410c-LA.BR.1.2.7-03810-8x16.0-linaro1
git clone --depth 1 https://git.linaro.org/landing-teams/working/qualcomm/signlk.git
cd lk
make -j4 msm8916 EMMC_BOOT=1 TOOLCHAIN_PREFIX=../arm-eabi-4.8/bin/arm-eabi-
mv build-msm8916/emmc_appsboot.mbn build-msm8916/emmc_appsboot_unsigned.mbn
../signlk/signlk.sh -i=./build-msm8916/emmc_appsboot_unsigned.mbn -o=./build-msm8916/emmc_appsboot.mbn -d
sudo fastboot flash aboot ./build-msm8916/emmc_appsboot.mbn

Cheers