You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 33 Next »

Dependencies for sdcard flashing.

Bootloader:

Bananapi r4 follows a atf (arm-trusted firmware) flow for device bootup, by default flash memory is present in the device which will be loaded with BL1  and BL1 will be having bl2 address to load bl2 and make device up.

Device bootup flow as mentioned below.

BL1
BL2(bl2.img)
FIP (Fip.bin)
Kernel (Yocto build)
Rootfs (RDKB stack)

a)BL1: Bootloader one which will be part of flash memory of bpir4 , it will be holding address for bl2.
b)BL2: Bootloader two need to be generated and loaded in a specified sector so that bl1 can load bl2. 
c)fip: Firmware image Package which contains firmware components eg bl31.
d)Kernel: Layer which will be acting between hardware and OS.
e)RDKB : RDKB stack or RDKB OS for user interaction.

"Kernel and rdkb rootfs will be generated as part BPIR4 build instructions"

Generate ATF files.

Used below mentioned git repo for generating bl2.img and fip.bin file.
1) https://github.com/frank-w/u-boot/tree/2024-04-bpi → for generating uboot.bin files .
2) https://github.com/frank-w/u-boot/tree/mtk-atf → for generating atf flow bootloader files (bl2.img and fip.bin)

At initial cloned mentioned git code "https://github.com/frank-w/u-boot/tree/2024-04-bpi" , and made below mentioned changes in u-boot env file to make boot-loader compatible in  loading kernel and rdkb os at initial boot-up itself.

Bootloader changes wrt RDKB BPIR4 specific. Expand source


After making changes just executed build.sh script file. After complete execution of this script file, we can see u-boot.* files will be generated in specific folder.

File after build.sh script execution Expand source


In other folder clone "https://github.com/frank-w/u-boot/tree/mtk-atf", and copy all u-boot.* files from existing generated folder to this specific folder  and make below mentioned changes, then execute build.sh script.

Changes in atf Expand source

 After completion of script execution we can see bl2.img and fip.bin files will be generated in build/mt7988/release path.

heam@Dell-OptiPlex-9020:~/bootloader/atf/u-boot/build/mt7988/release$ ls
bl2  bl2.bin  bl2.img  bl31  bl31.bin  fdts  fip.bin  lib  libc  libfdt  libwrapper  romlib

Build instructions for SD image for BPIR4.

Generated bl2.img and fip.bin files need to be include in meta-cmf-bananapi layer.

BPIR4 build instructios for generating sdcard image.
repo init -u https://code.rdkcentral.com/r/manifests -b kirkstone -m rdkb-bpi-extsrc.xml
repo sync -j `nproc` --no-clone-bundle --no-tags
MACHINE=bananapi4-rdk-broadband BPI_IMG_TYPE=sdmmc source meta-cmf-bananapi/setup-environment-refboard-rdkb
bitbake rdk-generic-broadband-image

Image generating steps for BPIR4.

After completion of build go to deploy folder and execute "bpir4_sd_image_creater.sh"  script file, to generate final sdcard image.

Script file expansion.

Image Generator script info Expand source

Info regarding script execution

Script execution creating sdcard image. Expand source

After completion of script execution, final image will be generated with "bpi-r4_sdmmc_rdk-broadband-image.img.gz" image name.

Image can be flashed to sdcard using dd command or balenaEtcher.

Flashing steps.

1)Image generated after execution of script "bpi-r4_sdmmc_rdk-broadband-image.img.gz"can be flashed directly to sdcard using dd command or balenaEtcher.
2)For 2nd time flashing you can follow below mentioned flashing instructions instead if executing script,but use existing sdcard only.

BPIR4 2nd time flashing instructions. Expand source

Reference links:

ATF: https://trustedfirmware-a.readthedocs.io/en/latest/ 

Issues:

Facing permission issue if i try to automate the script using bbclass.
-losetup utility is working in yocto but permission issue is there when i try to access looping devices.

losetup: /dev/loop7: failed to set up loop device: Permission denied

So, Working on alternative ways for creating sdcard image using wic utility. Simultaneously analysing yocto layers for creating sdcard image based of ATF flow.
     -Jira for tracking this issue. RDKBACCL-429 - Getting issue details... STATUS



  • No labels