Changes between Version 39 and Version 40 of venice/secure_boot


Ignore:
Timestamp:
03/28/2025 11:50:22 PM (3 days ago)
Author:
Tim Harvey
Comment:

updated build instructions for HABv4 so that they work with both v2023.04-venice and v2024.10-venice (the later will sign it for you)

Legend:

Unmodified
Added
Removed
Modified
  • venice/secure_boot

    v39 v40  
    4141
    4242The SRK_HASH fuses for the IMX6/IMX7/IMX8 are defined by a bank and a word:
    43  - SRK_HASH[31:00] bank 6 word 0
    44  - SRK_HASH[63:32] bank 6 word 1
    45  - SRK_HASH[95:64] bank 6 word 2
    46  - SRK_HASH[127:96] bank 6 word 3
    47  - SRK_HASH[159:128] bank 7 word 0
    48  - SRK_HASH]191:160] bank 7 word 1
    49  - SRK_HASH[223:192] bank 7 word 2
    50  - SRK_HASH[255:224] bank 7 word 3
     43 - SRK_HASH[31..00] bank 6 word 0
     44 - SRK_HASH[63..32] bank 6 word 1
     45 - SRK_HASH[95..64] bank 6 word 2
     46 - SRK_HASH[127..96] bank 6 word 3
     47 - SRK_HASH[159..128] bank 7 word 0
     48 - SRK_HASH]191..160] bank 7 word 1
     49 - SRK_HASH[223..192] bank 7 word 2
     50 - SRK_HASH[255..224] bank 7 word 3
    5151
    5252See also:
     
    139139  * Note the above fuse values will differ per your serial/passphrase
    140140 2. Build U-boot with HABv4 enabled and a single DTB:
    141   * Pre-requisite: Build Venice BSP using this link here: [wiki:venice/bsp]
    142   * Export VENICE_BSP variable to your directory: {{{export VENICE_BSP=/path/to/your/bsp/directory}}}
    143 {{{#!bash
    144 # checkout a fresh u-boot
    145 git clone https://github.com/Gateworks/uboot-venice.git
    146 cd uboot-venice
    147 # setup cross toolchain environment (ie source setup-environment in Venice BSP dir)
    148 export PATH=$VENICE_BSP/buildroot/output/host/bin:$PATH
    149 export CROSS_COMPILE="aarch64-linux-"
    150 export ARCH=arm64
    151 # copy necessary artifacts from bsp
    152 cp $VENICE_BSP/u-boot/lpddr4*.bin . # DDR firmware
    153 cp $VENICE_BSP/atf/build/imx8mm/release/bl31.bin . # ATF
    154 # configure for venice board
    155 make imx8mm_venice_defconfig
    156 make menuconfig # select CONFIG_IMX_HAB=y
    157 make flash.bin
    158 }}}
    159   - if using a non-gateworks branch of U-boot, ensure that "CONFIG_SPL_LOAD_FIT_ADDRESS=0x44000000"
    160   - for clarity here are the differences in defconfig:
    161 {{{#!bash
    162 $ make savedefconfig && diff defconfig configs/imx8mm_venice_defconfig
    163 scripts/kconfig/conf  --savedefconfig=defconfig Kconfig
    164 21,22d21
    165 < CONFIG_IMX_HAB=y
    166 < # CONFIG_CMD_DEKBLOB is not set
    167 }}}
    168   - note that the above is for imx8mm (you need to copy the ATF from the imx8mp directory and use imx8mp_venice_defconfig if you are using imx8mp for example)
    169  3. create a signed_flash.bin
     141  * Pre-requisites:
     142   - Build Venice BSP using this link here: [wiki:venice/bsp]
     143   - Have CST installed
     144  * Building:
    170145{{{#!bash
    171146# setup env to point to the CST
     
    176151export SRK_TABLE=$CST_DIR/crts/SRK_1_2_3_4_table.bin
    177152export PATH=$CST_DIR/linux64/bin:$PATH
     153# setup cross toolchain environment (ie source setup-environment in Venice BSP dir)
     154export PATH=$VENICE_BSP/buildroot/output/host/bin:$PATH
     155export CROSS_COMPILE="aarch64-linux-"
     156export ARCH=arm64
     157# checkout a fresh u-boot
     158git clone https://github.com/Gateworks/uboot-venice.git
     159cd uboot-venice
     160# copy ATF and DDR firmware from BSP
     161cp $VENICE_BSP/u-boot/lpddr4*.bin . # DDR firmware
     162cp $VENICE_BSP/atf/build/imx8mm/release/bl31.bin . # ATF
     163# configure for venice board
     164make imx8mm_venice_defconfig
     165make menuconfig # select CONFIG_IMX_HAB=y
     166make flash.bin
     167}}}
     168   - if using a non-gateworks branch of U-boot, ensure that "CONFIG_SPL_LOAD_FIT_ADDRESS=0x44000000"
     169   - for clarity here are the differences in defconfig:
     170{{{#!bash
     171$ make savedefconfig && diff defconfig configs/imx8mm_venice_defconfig
     172scripts/kconfig/conf  --savedefconfig=defconfig Kconfig
     17321,22d21
     174< CONFIG_IMX_HAB=y
     175< # CONFIG_CMD_DEKBLOB is not set
     176}}}
     177   - note that the above is for imx8mm (you need to copy the ATF from the imx8mp directory and use imx8mp_venice_defconfig if you are using imx8mp for example)
     178 3. create a signed_flash.bin (required prior to v2024.10; for v2024.10-venice branch you can skip this step as it signs it automatically
     179{{{#!bash
    178180# sign flash.bin (if U-Boot version is less than v2024.10 where automated signing was introduced if CONFIG_IMX_HAB=y)
    179 /bin/sh doc/imx/habv4/csf_examples/mx8m/csf.sh
     181[ -f doc/imx/habv4/csf_examples/mx8m/csf.sh ] && /bin/sh doc/imx/habv4/csf_examples/mx8m/csf.sh
    180182# create a JTAG image (if needed) using one of the following (dependent on which SoC you are using)
    181183mkimage_jtag --emmc -s --partconf=boot0 \
     
    404406. ./setup-environment
    405407}}}
     408 1. setup CST environment:
     409{{{#!bash
     410# setup env to point to the CST
     411export CST_DIR=/usr/src/nxp/cst-3.4.0
     412export CST_BIN=$CST_DIR/linux64/bin/cst
     413export CSF_KEY=$CST_DIR/crts/CSF1_1_sha256_4096_65537_v3_usr_crt.pem
     414export IMG_KEY=$CST_DIR/crts/IMG1_1_sha256_4096_65537_v3_usr_crt.pem
     415export SRK_TABLE=$CST_DIR/crts/SRK_1_2_3_4_table.bin
     416export PATH=$CST_DIR/linux64/bin:$PATH
     417}}}
    406418 1. setup additional SOC and Board specific environment:
    407419  - for imx8mm:
     
    449461cp firmware-imx-8.10/firmware/ddr/synopsys/lpddr4*.bin .
    450462}}}
    451  1. Build OP-TEE (**This must be rebuilt every time you build OP-TEE):
     463 1. Build OP-TEE
    452464{{{#!bash
    453465make -j8 -C tee \
     
    459471  O=out && ${CROSS_COMPILE}objcopy -O binary tee/out/core/tee.elf ./tee.bin
    460472}}}
    461  1. Build ATF (**This must be rebuilt every time you build OP-TEE):
     473 1. Build ATF
    462474{{{#!bash
    463475make -j8 -C atf SPD=opteed PLAT=$PLAT BL32_BASE=$CFG_TZDRAM_START && \
     
    474486 1. Sign it:
    475487{{{#!bash
    476 # setup env to point to the CST
    477 export CST_DIR=/usr/src/nxp/cst-3.4.0
    478 export CST_BIN=$CST_DIR/linux64/bin/cst
    479 export CSF_KEY=$CST_DIR/crts/CSF1_1_sha256_4096_65537_v3_usr_crt.pem
    480 export IMG_KEY=$CST_DIR/crts/IMG1_1_sha256_4096_65537_v3_usr_crt.pem
    481 export SRK_TABLE=$CST_DIR/crts/SRK_1_2_3_4_table.bin
    482 export PATH=$CST_DIR/linux64/bin:$PATH
    483488# sign flash.bin (if U-Boot version is less than v2024.10 where automated signing was introduced if CONFIG_IMX_HAB=y)
    484 /bin/sh doc/imx/habv4/csf_examples/mx8m/csf.sh
     489[ -f doc/imx/habv4/csf_examples/mx8m/csf.sh ] && /bin/sh doc/imx/habv4/csf_examples/mx8m/csf.sh
    485490# create a JTAG image (if needed) using one of the following depending on your SoC
    486491mkimage_jtag --emmc -s --partconf=boot0 \