xref: /rk3399_ARM-atf/docs/plat/qti/rb3gen2.rst (revision c8e08212b85169a00b9b914b69d87529e14bdb6b)
1Dragonwing RB3 Gen 2 development platform
2=========================================
3
4Trusted Firmware-A (TF-A) platform port for Kodiak SoC based RB3Gen2 platform.
5For details about RB3Gen2 platform, refer to this
6`link <https://www.qualcomm.com/developer/hardware/rb3-gen-2-development-kit>`__
7
8Boot flow
9-------------
10
11The boot flow on RB3Gen2 with TF-A BL2 replacing the TZ firmware binary and
12FIP payload replcacing UEFI binary as::
13
14        PBL (ROM) -> XBL -> TF-A BL2 -> TF-A BL31 -> BL33 -> Linux kernel
15                                            |
16                                             --> OP-TEE as BL32
17
18BL33 can either be edk2, U-Boot, Coreboot + Depthcharge etc.
19
20Summary:
21
22- PBL authenticates and loads XBL on on-chip RAM (IMEM) which is responsible
23  to initializing DRAM and has the flash storage driver.
24- XBL/XBL_SEC authenticates and loads TF-A BL2 from `tz_a/b` partition and
25  FIP payload from `uefi_a/b` partition on flash to DRAM.
26- TF-A BL2 parses the FIP payload on DRAM and loads BL31, BL32 and BL33
27  components in corresponding locations as specified in FIP metadata.
28
29How to build
30------------
31
32Steps to build TF-A BL2 and FIP payload::
33
34	$ make CROSS_COMPILE=aarch64-none-elf- PLAT=rb3gen2 SPD=opteed \
35            QTISECLIB_PATH=<qtiseclib-path> BL32=<path-to-optee-bin> \
36            BL33=<path-to-os-bootloader-bin> fip all
37
38        $ ./tools/qti/generate_fip_elf.sh build/rb3gen2/release/fip.bin \
39            0x9fc00000
40
41QTISELIB for Kodiak/SC7280 is available at
42`link <https://github.com/coreboot/qc_blobs/blob/master/sc7280/qtiseclib/libqtisec.a?raw=true>`__
43
44Note that the bl2.elf generated here is required to be signed as TZ image with
45QTI signing involved. Also, the fip.elf generated above is signed using
46`qtestsign <https://github.com/msm8916-mainline/qtestsign>`__ which just puts
47the OEM test signature to allow it to work on devices in non-secure mode. In
48secure mode, it is required to be signed using
49`sectools v2 <https://docs.qualcomm.com/bundle/publicresource/topics/80-70020-11/tools.html>`__
50
51How to flash
52------------
53
54Generate a Yocto BSP image for RB3Gen2 following instructions from meta-qcom
55`here <https://github.com/qualcomm-linux/meta-qcom?tab=readme-ov-file#quick-build>`__
56
57It will generate a tar ball in the build folder for RB3Gen2 something like:
58`qcom-multimedia-image-qcs6490-rb3gen2-core-kit.rootfs.qcomflash.tar.gz`. Untar
59it and replace `tz.mbn` with `bl2.mbn` and `uefi.elf` with `fip.elf` that you
60have generated by yourself.
61
62Then flash the board following the meta-qcom instructions
63`here <https://github.com/qualcomm-linux/meta-qcom?tab=readme-ov-file#flash-images>`__
64
65Boot Trace
66-------------
67
68Boot logs on RB3Gen2::
69
70        Format: Log Type - Time(microsec) - Message - Optional Info
71        Log Type: B - Since Boot(Power On Reset),  D - Delta,  S - Statistic
72        <snip-XBL-logs>
73        NOTICE:  BL2: v2.13.0(release):v2.13.0-825-gc17b22110
74        NOTICE:  BL2: Built : 15:54:07, Sep 25 2025
75        NOTICE:  BL2: Booting BL31
76        NOTICE:  BL31: v2.13.0(release):v2.13.0-825-gc17b22110
77        NOTICE:  BL31: Built : 15:58:59, Sep 25 2025
78        QTISECLIB [0019dc805]QC_IMAGE_VERSION_STRING=QTISECLIB.CB.1.0-00069-SC7280AAAAAANAZT-1
79        QTISECLIB [001a0817c]IMAGE_VARIANT_STRING=SC7180LC
80        QTISECLIB [001a221d8]OEM_IMAGE_VERSION_STRING=crm-ubuntu54
81        QTISECLIB [001a40244]QC_IMAGE_TS_STRING=23:42:01, Aug 31 2022
82        I/TC:
83        I/TC: OP-TEE version: 4.7.0-79-g8a8fab26c (gcc version 14.2.0 (Ubuntu 14.2.0-19ubuntu2)) #7 Thu Sep 25 10:28:22 UTC 2025 aarch64
84        I/TC: WARNING: This OP-TEE configuration might be insecure!
85        I/TC: WARNING: Please check https://optee.readthedocs.io/en/latest/architecture/porting_guidelines.html
86        I/TC: Primary CPU initializing
87        I/TC: Primary CPU switching to normal world boot
88        <snip>
89