Changes between Version 44 and Version 45 of newport
- Timestamp:
- 02/12/2018 09:42:44 PM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
newport
v44 v45 160 160 [=#serial-ethernet-uboot] 161 161 === Update Firmware via Serial Console and Ethernet from Bootloader === 162 If u sing U-Boot (recommended) you need to setup a TFTP server to host the files for transfer. Alternatively you could load firmware files from removable storage (microSD, mSATA, or USB for example) however the transfer rate is typically very slow compared to Gigabit Ethernet. For details on setting up a TFTP server see [wiki:tftpserver here].162 If updating firmware via Bootloader/Serial/Ethernet (recommended for speed) you need to setup a TFTP server to host the files for transfer. Alternatively you could load firmware files from removable storage (microSD, mSATA, or USB for example) however the transfer rate is typically very slow compared to Gigabit Ethernet. For details on setting up a TFTP server see [wiki:tftpserver here]. 163 163 164 164 The following instructions assume your board target IP address is 192.168.1.1 and you have a TFTP server at 192.168.1.146. Adjust environment according to your network via 'setenv ipaddr <ipaddr>' and 'setenv serverip <serverip>'. … … 169 169 * use {{{mmc list}}} to see how they are configured 170 170 171 Examples: 172 * Update just the '[wiki:newport/boot boot firmware]' (everything up to and including the Bootloader) ([https://github.com/Gateworks/images-newport/raw/master/firmware-newport.img firmware image]): 173 {{{#!bash 174 setenv dev 0 # use 'mmc list' to show which device to use for eMMC vs microSD 175 tftpboot ${loadaddr} firmware-newport.img && mmc write ${loadaddr} 0 8000 # update first 16MB 176 }}} 177 * Update the entire device from a Compressed Disk Image ('[wiki:newport/boot boot firmware]' as well as OS): 171 The methods you use to update the firmware depends on what specifically you are trying to update. 172 173 Update the entire device from a Compressed Disk Image ('[wiki:newport/boot boot firmware]' as well as OS): 178 174 {{{#!bash 179 175 setenv dev 0 # use 'mmc list' to show which device to use for eMMC vs microSD 180 176 tftpboot ${loadaddr} xenial-newport.img.gz && gzwrite mmc ${dev} ${loadaddr} ${filesize} 181 177 }}} 182 - If using Ubuntu you will want to run {{{resize2fs /dev/mmcblk0p2}}} to resize the partition to expand to the available anytime after the first. This is because {{{xenial-newport.img.gz}}} is a compressed disk image created with a minimal root filesystem to keep flashing time down to a minimum for fast updates. 178 - If the image was created using a minimally sized filesystem you will want to resize it after booting to take advantage of the full partition space. For an {{{ext4}}} root filesystem on the primary MMC device run {{{resize2fs /dev/mmcblk0p2}}}. 179 180 Updating just the kernel can be done with {{{tftpboot}}} and {{{fatwrite}}}: 181 {{{#!bash 182 # kernel 183 tftpboot $loadaddr kernel.itb && fatwrite mmc $dev:1 $loadaddr kernel.itb $filesize 184 # bootscript 185 tftpboot $loadaddr newport.scr && fatwrite mmc $dev:1 $loadaddr newport.scr $filesize 186 }}} 187 188 Updating the [wiki:newport/boot 'Boot firmware'] (everything up to and including the Bootloader) requires preparing a boot image that contains your desired partition table, boot firmware, kernel, bootscript and U-Boot environment: 189 * on Linux development host with the Newport BSP in a shell that has the env setup: 190 {{{#!bash 191 IMG=myimage.img 192 KERNEL=linux/arch/arm64/boot/Image 193 cp firmware-newport.img $(IMG) 194 # create kernel.itb with compressed kernel image 195 cp $(KERNEL) vmlinux 196 gzip -f vmlinux 197 ./newport/mkits.sh -o kernel.its -k ${PWD}/vmlinux.gz -C gzip -v "Newport Kenrel" 198 mkimage -f kernel.its kernel.itb 199 # copy kernel.itb into FAT12 filesystem 200 fatfs-tool -i $(IMG) cp kernel.itb / 201 # create bootscript (customize ubuntu.scr as needed) 202 mkimage -A arm64 -T script -C none -d newport/ubuntu.scr ./newport.scr 203 # copy newport.scrinto FAT12 filesystem 204 fatfs-tool -i $(IMG) cp newport.scr / 205 }}} 206 * on a Newport booted to the bootloader: 207 {{{#!bash 208 setenv dev 0 # use 'mmc list' to show which device to use for eMMC vs microSD 209 tftpboot ${loadaddr} myimage.img && mmc write ${loadaddr} 0 8000 # update first 16MB 210 mmc rescan # re-scan the mmc devices in case the partition table changed 211 }}} 183 212 184 213 185 214 [=#serial-ethernet-linux] 186 215 === Update Firmware via Serial Console and Ethernet from Linux === 187 If booted to Linux on a board you can easily update the [wiki:newport/boot 'Boot Firmware']: 216 If booted to Linux on a board you can also update the kernel and bootscript fairly easily by mounting the FAT12 filesystem and copying the file(s): 217 {{{#!bash 218 mount /dev/mmcblk0p1 /mnt 219 cp kernel.itb /mnt 220 cp newport.scr /mnt 221 }}} 222 223 You can also easily update the [wiki:newport/boot 'Boot Firmware']. First prepare a boot image that contains your desired partition table, boot firmware, kernel, bootscript and U-Boot environment (see example above). Then on a booted Newport: 188 224 {{{#!bash 189 225 cd /tmp 190 wget http://dev.gateworks.com/newport/ firmware-newport.img191 dd if= firmware-newport.img of=/dev/mmcblk0226 wget http://dev.gateworks.com/newport/myimage.img 227 dd if=myimage.img of=/dev/mmcblk0 192 228 }}} 193 229 * Note above we are writing to {{{/dev/mmcblk0}}} and not a partition 194 230 * Use {{{/dev/mmcblk1}}} for the secondary MMC device (ie microSD) 195 231 * Note that Newport boards only supports MMC based boot devices 196 197 If booted to Linux on a board you can also update the kernel and bootscript fairly easily by mounting the FAT12 filesystem and copying the file(s): 198 {{{#!bash 199 mount /dev/mmcblk0p1 /mnt 200 cp kernel.itb /mnt 201 cp newport.scr /mnt 202 }}} 232 * **Note that this overwrites the partition-table, the U-Boot environment, and the FAT12 filesystem which are things you might have customizations in.** 203 233 204 234 Note that if you want to update the root filesystem itself from within Linux you can only do this by either: