Changes between Version 21 and Version 22 of venice/firmware


Ignore:
Timestamp:
05/01/2025 05:55:50 PM (4 days ago)
Author:
Tim Harvey
Comment:

added script to determine emmc boot partition, adjust default boot partition, and include making boot0 writeable

Legend:

Unmodified
Added
Removed
Modified
  • venice/firmware

    v21 v22  
    200200
    201201==== Boot firmware update via Linux
    202 Updating the boot firmware via Linux requires you to manually determine the correct device, hardware partition and offset:
     202Updating the boot firmware via Linux requires you to manually specify the correct device, hardware partition and offset.
     203
     204To determine the current eMMC hardware boot partition you need to look at the PARTITION_CONFIG(EXT_CSD![179]) register bits ![5:3] 'BOOT_PARTITION_ENABLE' where 1='Boot Partition 1' (we call this boot0) 2='Boot Partition 2' (we call this boot1) and 7=User area (we call this user).
     205
     206Here is a set of bash commands in Linux that will use {{{mmc}}} (from the {{{mmc-utils}}} package) to read the CSD, decode the value and display the names we use to refer to the boot partition:
     207{{{#!bash
     208PARTITION_CONFIG=$(mmc extcsd read /dev/mmcblk2 | grep PARTITION_CONFIG | grep -o "0x[0-9a-fA-F]\+")
     209BOOT_PARTITION_ENABLE=$(( $(( $((PARTITION_CONFIG)) & 0x38 )) >> 3)) # convert hex to dec and mask off bits[5:3] and shift
     210case $BOOT_PARTITION_ENABLE in
     211  1) echo boot0;; # Boot partition 1
     212  2) echo boot1;; # Boot partition 2
     213  7) echo user;; # User area
     214esac
     215}}}
     216
    203217 * for IMX8M Mini board variants:
     218  - with boot firmware in boot0 hardware partition (default):
     219{{{#!bash
     220# allow writing to boot0
     221echo 0 > /sys/block/mmcblk2boot0/force_ro
     222# write to the emmc device to 33K offset
     223dd if=venice-imx8mm-flash.bin of=/dev/mmcblk2boot0 bs=1K seek=33
     224}}}
    204225  - with boot firmware in user hardware partition:
    205226{{{#!bash
     
    207228dd if=venice-imx8mm-flash.bin of=/dev/mmcblk2 bs=1K seek=33
    208229}}}
     230 * for IMX8M Nano board variants:
    209231  - with boot firmware in boot0 hardware partition:
    210232{{{#!bash
    211 # write to the emmc device to 33K offset
    212 dd if=venice-imx8mm-flash.bin of=/dev/mmcblk2boot0 bs=1K seek=33
    213 }}}
    214  * for IMX8M Nano board variants:
     233# allow writing to boot0
     234echo 0 > /sys/block/mmcblk2boot0/force_ro
     235# write to the emmc device to 0K offset
     236dd if=venice-imx8mn-flash.bin of=/dev/mmcblk2boot0 bs=1K seek=0
     237}}}
    215238  - with boot firmware in user hardware partition:
    216239{{{#!bash
     
    218241dd if=venice-imx8mn-flash.bin of=/dev/mmcblk2 bs=1K seek=32
    219242}}}
    220   - with boot firmware in boot0 hardware partition:
    221 {{{#!bash
     243 * for IMX8M Plus board variants:
     244  - with boot firmware in boot0 hardware partition (default):
     245{{{#!bash
     246# allow writing to boot0
     247echo 0 > /sys/block/mmcblk2boot0/force_ro
    222248# write to the emmc device to 0K offset
    223 dd if=venice-imx8mn-flash.bin of=/dev/mmcblk2boot0 bs=1K seek=0
    224 }}}
    225  * for IMX8M Plus board variants:
     249dd if=venice-imx8mp-flash.bin of=/dev/mmcblk2boot0 bs=1K seek=0
     250}}}
    226251  - with boot firmware in user hardware partition:
    227252{{{#!bash
    228253# write to the emmc device to 32K offset
    229254dd if=venice-imx8mp-flash.bin of=/dev/mmcblk2 bs=1K seek=32
    230 }}}
    231   - with boot firmware in boot0 hardware partition:
    232 {{{#!bash
    233 # write to the emmc device to 0K offset
    234 dd if=venice-imx8mp-flash.bin of=/dev/mmcblk2boot0 bs=1K seek=0
    235255}}}
    236256