Changes between Version 1 and Version 2 of venice/firmware


Ignore:
Timestamp:
11/12/2020 11:45:59 PM (2 months ago)
Author:
Tim Harvey
Comment:

updated image flashing instructions to including Linux as well as U-Boot examples

Legend:

Unmodified
Added
Removed
Modified
  • venice/firmware

    v1 v2  
    8585
    8686==== Update entire firmware (recommended)
    87 Update the entire device from a Compressed Disk Image. This image includes the ('boot firmware as well as entire OS and kernel):
     87Update the entire device from a Compressed Disk Image. This image includes the partition table, boot firmware, bootloader environment, as well as entire OS and kernel:
    8888
    8989Complete Compressed Disk Images are available for download here: [http://dev.gateworks.com/venice/images/]
    9090
    91 Examples:
    92  * Setup environment for networking
    93 {{{#!bash
    94 setenv ipaddr 192.168.1.1 # sets device IP
    95 setenv serverip 192.168.1.146 # sets TFTP LAN server IP
    96 }}}
    97  * Choose which device you are going to update:
    98 {{{#!bash
     91Procedure:
     92 * Via U-Boot:
     93{{{#!bash
     94# setup network environment (use bootp or static by setting ipaddr/serverip and optional netmask/gatewayip)
     95setenv autoload 0; bootp  # use dhcp for network config but do not fetch a file
     96# choose the device to update
    9997setenv dev 2 # sets MMC device to be flashed - see mmc list
     98# set your image
    10099setenv image focal-venice.img.gz # or whatever filename is used, with any tftp server directories in front of the filename
    101 run update_all # the update_all script expects a compressed image and will write to the beginning of flash
    102 }}}
    103 
    104 This is what the update_all script does:
     100# update
     101run update_all
     102}}}
     103  - This is what the update_all script does if your curious:
    105104{{{#!bash
    106105update_all=tftpboot ${loadaddr} ${image} && gzwrite mmc ${dev} ${loadaddr} ${filesize}
    107106}}}
     107 * Via Linux:
     108{{{#!bash
     109# fetch your file
     110cd /tmp
     111wget http://dev.gateworks.com/venice/images/focal-venice.img.gz
     112# uncompress and write to the emmc device
     113zcat focal-gw7901.img.gz | dd of=/dev/mmcblk0 bs=4M
     114}}}
    108115
    109116
    110117==== Updating just the boot firmware
    111 Updating the [wiki:nvenice/boot 'Boot firmware'] via this method includes the SPL, U-Boot, the device-tree, and the ATF. The method here specifically does not update the disk partition table at the beginning of the boot device as that really has nothing to do with the boot firmware.
     118Updating the [wiki:venice/boot 'Boot firmware'] via this method includes the SPL, U-Boot, the device-tree, and the ATF. The method here specifically does not update the disk partition table at the beginning of the boot device as that really has nothing to do with the boot firmware. This method also does not destroy any current U-Boot environment.
    112119
    113120Note that the IMX8 BOOT ROM fetches code starting at a 33K offset (in order to reserve everything below that for things like disk partition tables).
    114121
    115 We will use the {{{update_firmware}}} script in the Venice U-Boot default environment which looks like this:
    116 {{{#!bash
    117 => print update_firmware
     122The latest pre-built Bootloader image for Venice is available for download here: [http://dev.gateworks.com/venice/boot_firmware/flash.bin]
     123
     124
     125Procedure:
     126 * Via U-Boot:
     127{{{#!bash
     128# setup network environment (use bootp or static by setting ipaddr/serverip and optional netmask/gatewayip)
     129setenv autoload 0; bootp  # use dhcp for network config but do not fetch a file
     130# choose the device to update
     131setenv dev 2 # sets MMC device to be flashed - see mmc list
     132# set your image
     133setenv image flash.bin # with any tftp server directories in front of the filename
     134# update
     135run update_firmware
     136}}}
     137  - This is what the update_firmware script does if your curious:
     138{{{#!bash
    118139update_firmware=tftpboot $loadaddr $image && setexpr blkcnt $filesize + 0x1ff && setexpr blkcnt $blkcnt / 0x200 && mmc dev $dev && mmc write $loadaddr 0x42 $blkcnt
    119140}}}
    120  * Note the flash offset is 0x42 blocks which is 33KiB
    121  * Note the {{{dev}}} and {{{image}}} env variables are used by this script
    122 
    123 On a Venice booted to the bootloader:
    124 {{{#!bash
    125 => mmc list
    126 FSL_SDHC: 0
    127 FSL_SDHC: 1 (SD)
    128 FSL_SDHC: 2 (eMMC)
    129 => setenv dev 2 # eMMC
    130 => setenv image flash.bin
    131 => run update_firmware
     141 * Via Linux:
     142{{{#!bash
     143# fetch your file
     144cd /tmp
     145wget http://dev.gateworks.com/venice/boot_firmware/flash.bin
     146# uncompress and write to the emmc device to 33K offset
     147dd if=flash.bin of=/dev/mmcblk0 bs=1K seek=33
    132148}}}
    133149
    134150
    135151==== Updating just the root filesystem
    136 Updating the root filesystem from a 'compressed filesystem image' can easily be done by help of the {{{update_rootfs}}} script in the Venice U-Boot default environment which looks like this:
    137 {{{#!bash
    138 => print update_rootfs
     152Updating the root filesystem from a 'compressed filesystem image' is easily done in U-Boot or Linux.
     153
     154Note that Gateworks does not host any pre-built filesystem images on our servers but the Venice BSP builds one for you from a downloaded rootfs tarball when you build the {{{ubuntu-image}}} target. The file is in the bsp directory as {{{focal-venice.ext4}}} and can be compressed with {{{gzip focal-venice.ext4}}}
     155
     156
     157Procedure:
     158 * Via U-Boot:
     159{{{#!bash
     160# setup network environment (use bootp or static by setting ipaddr/serverip and optional netmask/gatewayip)
     161setenv autoload 0; bootp  # use dhcp for network config but do not fetch a file
     162# choose the device to update
     163setenv dev 2 # sets MMC device to be flashed - see mmc list
     164# set your image
     165setenv image rootfs.ext4.gz # with any tftp server directories in front of the filename
     166# update
     167run update_rootfs
     168}}}
     169  - This is what the update_rootfs script does if your curious:
     170{{{#!bash
    139171update_rootfs=tftpboot $loadaddr $image && gzwrite mmc $dev $loadaddr $filesize 100000 1000000
    140172}}}
    141  * Note gzwrite is used so the filesystem image must be compressed with 'gzip' (otherwise you could use mmc write manually). The data (ie type of filesystem or content ) does not matter here
    142  * Note the flash offset is 0x1000000 blocks which is 16MiB
    143  * Note the {{{dev}}} and {{{image}}} env variables are used by this script
    144 
    145 On a Venice booted to the bootloader:
    146 {{{#!bash
    147 => mmc list
    148 FSL_SDHC: 0
    149 FSL_SDHC: 1 (SD)
    150 FSL_SDHC: 2 (eMMC)
    151 => setenv dev 2 # eMMC
    152 => setenv image rootfs.ext4.gz
    153 => run update_rootfs
     173  - Note gzwrite is used so the filesystem image must be compressed with 'gzip' (otherwise you could use mmc write manually). The data (ie type of filesystem or content ) does not matter here
     174  - Note the flash offset is 0x1000000 blocks which is 16MiB
     175  - Note the {{{dev}}} and {{{image}}} env variables are used by this script
     176 * Via Linux:
     177{{{#!bash
     178# fetch your file
     179cd /tmp
     180wget http://sever/rootfs.ext4.gz
     181# uncompress and write to the emmc device to 16M offset
     182dd if=flash.bin of=/dev/mmcblk0 bs=1M seek=16
    154183}}}
    155184