hikey: fix 'invalid partition' error during recovery
After trying to use upstream EDK2 on my HiKey board without success,
I reached a point where even 'make recovery' would not make the board
bootable again. The recovery process failed like so:
$ make recovery
[...]
Waiting for device... [35][34][33][32][31][30][29][28][27][26][25][24][23][22][21][20][19][18]
Sending /home/jerome/work/optee_repo_hikey/build/../l-loader/recovery.bin ...
Done
fastboot flash loader /home/jerome/work/optee_repo_hikey/build/../l-loader/l-loader.bin
< waiting for any device >
Sending 'loader' (39 KB) FAILED (remote: 'invalid partition')
fastboot: error: Command failed
make: *** [Makefile:351: recovery] Error 1
The solution to this problem is mentioned in [1] and consists in
running 'fastboot getvar partition-size:ptable' before the fastboot
flash command.
Link: [1] https://github.com/96boards/documentation/issues/751.
Signed-off-by: Jerome Forissier <jerome@forissier.org>
Acked-by: Victor Chong <victor.chong@linaro.org>
diff --git a/hikey.mk b/hikey.mk
index 7fa8115..4181c92 100644
--- a/hikey.mk
+++ b/hikey.mk
@@ -348,6 +348,7 @@
$(call flash_help)
@echo
$(ROOT)/burn-boot/hisi-idt.py --img1=$(LLOADER_PATH)/recovery.bin
+ fastboot getvar partition-size:ptable
fastboot flash loader $(LLOADER_PATH)/l-loader.bin
@echo
@echo "3. Wait until you see the (UART) message"