Changes between Version 1 and Version 2 of venice/firmware
- Timestamp:
- 11/12/2020 11:45:59 PM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
venice/firmware
v1 v2 85 85 86 86 ==== 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):87 Update 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: 88 88 89 89 Complete Compressed Disk Images are available for download here: [http://dev.gateworks.com/venice/images/] 90 90 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 91 Procedure: 92 * Via U-Boot: 93 {{{#!bash 94 # setup network environment (use bootp or static by setting ipaddr/serverip and optional netmask/gatewayip) 95 setenv autoload 0; bootp # use dhcp for network config but do not fetch a file 96 # choose the device to update 99 97 setenv dev 2 # sets MMC device to be flashed - see mmc list 98 # set your image 100 99 setenv 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 101 run update_all 102 }}} 103 - This is what the update_all script does if your curious: 105 104 {{{#!bash 106 105 update_all=tftpboot ${loadaddr} ${image} && gzwrite mmc ${dev} ${loadaddr} ${filesize} 107 106 }}} 107 * Via Linux: 108 {{{#!bash 109 # fetch your file 110 cd /tmp 111 wget http://dev.gateworks.com/venice/images/focal-venice.img.gz 112 # uncompress and write to the emmc device 113 zcat focal-gw7901.img.gz | dd of=/dev/mmcblk0 bs=4M 114 }}} 108 115 109 116 110 117 ==== 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.118 Updating 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. 112 119 113 120 Note 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). 114 121 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 122 The latest pre-built Bootloader image for Venice is available for download here: [http://dev.gateworks.com/venice/boot_firmware/flash.bin] 123 124 125 Procedure: 126 * Via U-Boot: 127 {{{#!bash 128 # setup network environment (use bootp or static by setting ipaddr/serverip and optional netmask/gatewayip) 129 setenv autoload 0; bootp # use dhcp for network config but do not fetch a file 130 # choose the device to update 131 setenv dev 2 # sets MMC device to be flashed - see mmc list 132 # set your image 133 setenv image flash.bin # with any tftp server directories in front of the filename 134 # update 135 run update_firmware 136 }}} 137 - This is what the update_firmware script does if your curious: 138 {{{#!bash 118 139 update_firmware=tftpboot $loadaddr $image && setexpr blkcnt $filesize + 0x1ff && setexpr blkcnt $blkcnt / 0x200 && mmc dev $dev && mmc write $loadaddr 0x42 $blkcnt 119 140 }}} 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 144 cd /tmp 145 wget http://dev.gateworks.com/venice/boot_firmware/flash.bin 146 # uncompress and write to the emmc device to 33K offset 147 dd if=flash.bin of=/dev/mmcblk0 bs=1K seek=33 132 148 }}} 133 149 134 150 135 151 ==== 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 152 Updating the root filesystem from a 'compressed filesystem image' is easily done in U-Boot or Linux. 153 154 Note 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 157 Procedure: 158 * Via U-Boot: 159 {{{#!bash 160 # setup network environment (use bootp or static by setting ipaddr/serverip and optional netmask/gatewayip) 161 setenv autoload 0; bootp # use dhcp for network config but do not fetch a file 162 # choose the device to update 163 setenv dev 2 # sets MMC device to be flashed - see mmc list 164 # set your image 165 setenv image rootfs.ext4.gz # with any tftp server directories in front of the filename 166 # update 167 run update_rootfs 168 }}} 169 - This is what the update_rootfs script does if your curious: 170 {{{#!bash 139 171 update_rootfs=tftpboot $loadaddr $image && gzwrite mmc $dev $loadaddr $filesize 100000 1000000 140 172 }}} 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 179 cd /tmp 180 wget http://sever/rootfs.ext4.gz 181 # uncompress and write to the emmc device to 16M offset 182 dd if=flash.bin of=/dev/mmcblk0 bs=1M seek=16 154 183 }}} 155 184