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

Compare with Current View Page History

« Previous Version 12 Next »

Page development is in progress.

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 (BL1), and bl1 is depended on bl2 address which flow is mentiond 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"

Bootloader file generation

For generated bl2.img and fip.bin i used below mentioned git repo.
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 i cloned mentioned git code https://github.com/frank-w/u-boot/tree/2024-04-bpi , and made below mentioned changes in uboot env file to make bootloader to load kernel and rdkb rootfs at initial bootup itself.

Bootloader changes wrt RDKB BPIR4 specific. Expand source

After making changes just executed build.sh 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 terminal 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


2)Generate kernel and rdkb rootfs by following below mentioned build instructions where bl2.img and fip.bin files will be include which were generated using above mentioned u-boot code

Build instructions for SD image for BPIR4.

BPIR4 build instructios for generating sdcard image. Expand source

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 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.


Flashing Steps of BPIR4 image to sdcard.

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

Script content used for final image generation
Image Generator script info Expand source




  • No labels