mirror of
				https://github.com/lingble/meta-tegra.git
				synced 2025-10-30 03:52:41 +00:00 
			
		
		
		
	tegra-helper-scripts: use 'sparse update' of SPI flash by default
The tegraflash.py script takes a '--sparseupdate' option that causes it to update only changed partitions in the SPI flash. Enable that by default in the flash helper script, and add an --erase-spi option to force full erasure of the SPI flash, in case that's needed. Signed-off-by: Matt Madison <matt@madison.systems>
This commit is contained in:
		 Matt Madison
					Matt Madison
				
			
				
					committed by
					
						 Matt Madison
						Matt Madison
					
				
			
			
				
	
			
			
			 Matt Madison
						Matt Madison
					
				
			
						parent
						
							cfe0220947
						
					
				
				
					commit
					0a367f0b53
				
			| @@ -15,6 +15,8 @@ imgfile= | |||||||
| dataimg= | dataimg= | ||||||
| inst_args="" | inst_args="" | ||||||
| extdevargs= | extdevargs= | ||||||
|  | sparseargs= | ||||||
|  | erase_spi= | ||||||
| blocksize=4096 | blocksize=4096 | ||||||
|  |  | ||||||
| # These functions are used in odmsign.func but do not | # These functions are used in odmsign.func but do not | ||||||
| @@ -54,7 +56,7 @@ get_value_from_PT_table() { | |||||||
|     eval "$varname=\"$value\"" |     eval "$varname=\"$value\"" | ||||||
| } | } | ||||||
|  |  | ||||||
| ARGS=$(getopt -n $(basename "$0") -l "bup,bup-type:,no-flash,sign,sdcard,spi-only,boot-only,external-device,rcm-boot,datafile:,usb-instance:,uefi-enc:" -o "u:v:s:b:B:yc:" -- "$@") | ARGS=$(getopt -n $(basename "$0") -l "bup,bup-type:,no-flash,sign,sdcard,spi-only,boot-only,external-device,rcm-boot,datafile:,usb-instance:,uefi-enc:,erase-spi" -o "u:v:s:b:B:yc:" -- "$@") | ||||||
| if [ $? -ne 0 ]; then | if [ $? -ne 0 ]; then | ||||||
|     echo "Error parsing options" >&2 |     echo "Error parsing options" >&2 | ||||||
|     exit 1 |     exit 1 | ||||||
| @@ -93,6 +95,10 @@ while true; do | |||||||
|         rcm_boot=1 |         rcm_boot=1 | ||||||
|         shift |         shift | ||||||
|         ;; |         ;; | ||||||
|  |     --erase-spi) | ||||||
|  |         erase_spi=yes | ||||||
|  |         shift | ||||||
|  |         ;; | ||||||
|     --external-device) |     --external-device) | ||||||
|         external_device=1 |         external_device=1 | ||||||
|         extdevargs="--external_device" |         extdevargs="--external_device" | ||||||
| @@ -621,6 +627,10 @@ else | |||||||
|     tfcmd=${flash_cmd:-"flash;reboot"} |     tfcmd=${flash_cmd:-"flash;reboot"} | ||||||
| fi | fi | ||||||
|  |  | ||||||
|  | if [ $no_flash -eq 0 -a "$erase_spi" != "yes" ] && echo "$tfcmd" | grep -q "flash"; then | ||||||
|  |     sparseargs="--sparseupdate" | ||||||
|  | fi | ||||||
|  |  | ||||||
| want_signing=0 | want_signing=0 | ||||||
| if [ -n "$keyfile" ] || [ $rcm_boot -eq 1 ] || [ $no_flash -eq 1 -a $to_sign -eq 1 ]; then | if [ -n "$keyfile" ] || [ $rcm_boot -eq 1 ] || [ $no_flash -eq 1 -a $to_sign -eq 1 ]; then | ||||||
|     want_signing=1 |     want_signing=1 | ||||||
| @@ -671,7 +681,7 @@ if [ $want_signing -eq 1 ]; then | |||||||
|           --cfg flash.xml \ |           --cfg flash.xml \ | ||||||
|           --bct_backup \ |           --bct_backup \ | ||||||
|           --boot_chain A \ |           --boot_chain A \ | ||||||
|           $bctargs $ramcodeargs $extdevargs $BINSARGS" |           $bctargs $ramcodeargs $extdevargs $sparseargs $BINSARGS" | ||||||
|     FBARGS="--cmd \"$tfcmd\"" |     FBARGS="--cmd \"$tfcmd\"" | ||||||
|     . "$here/odmsign.func" |     . "$here/odmsign.func" | ||||||
|     (odmsign_ext_sign_and_flash) || exit 1 |     (odmsign_ext_sign_and_flash) || exit 1 | ||||||
| @@ -711,7 +721,7 @@ else | |||||||
|           --cfg flash.xml \ |           --cfg flash.xml \ | ||||||
|           --bct_backup \ |           --bct_backup \ | ||||||
|           --boot_chain A \ |           --boot_chain A \ | ||||||
|           $bctargs $extdevargs \ |           $bctargs $extdevargs $sparseargs \ | ||||||
|           --bins \"$BINSARGS\"" |           --bins \"$BINSARGS\"" | ||||||
| fi | fi | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user