[PATCH 0/2] meson64_android: fix initial flashing failures

The SEI-610 and SEI-510 boards are well supported in the Android Open Source project via the yukawa [1] platform.
Their U-Boot version, despite being public [2] is not in mainline.
For initial boards, with an empty eMMC, we can have boot loops while using the flashing process described in [3].
This series add 2 fixes for these bootloops.
[1] https://android.googlesource.com/device/amlogic/yukawa [2] https://gitlab.com/baylibre/amlogic/atv/u-boot/-/tree/u-boot/v2021.07/integ [3] https://gitlab.com/baylibre/amlogic/atv/aosp/device/amlogic/yukawa/-/wikis/K...
Neil Armstrong (2): configs: meson64_android: bypass other checks on run_fastboot=1 configs: meson64_android: add PANIC stage for SYSTEM fails
include/configs/meson64_android.h | 47 +++++++++++++++++++------------ 1 file changed, 29 insertions(+), 18 deletions(-)
base-commit: 4f4f974a46244270c1c6723017711c0aa8250206

From: Neil Armstrong narmstrong@baylibre.com
This can lead to GPT and BCB errors even if fastboot was selected early by usb rom boot and the eMMC is blank/invalid.
Signed-off-by: Neil Armstrong narmstrong@baylibre.com Signed-off-by: Mattijs Korpershoek mkorpershoek@baylibre.com --- include/configs/meson64_android.h | 35 +++++++++++++++++-------------- 1 file changed, 19 insertions(+), 16 deletions(-)
diff --git a/include/configs/meson64_android.h b/include/configs/meson64_android.h index fb3ccc329a7e..93d8f8ec99de 100644 --- a/include/configs/meson64_android.h +++ b/include/configs/meson64_android.h @@ -140,24 +140,27 @@ "echo Fastboot forced by usb rom boot;" \ "setenv run_fastboot 1;" \ "fi;" \ - "if gpt verify mmc ${mmcdev} ${partitions}; then; " \ - "else " \ - "echo Broken MMC partition scheme;" \ - "setenv run_fastboot 1;" \ - "fi;" \ - "if bcb load " __stringify(CONFIG_FASTBOOT_FLASH_MMC_DEV) " " \ - CONTROL_PARTITION "; then " \ - "if bcb test command = bootonce-bootloader; then " \ - "echo BCB: Bootloader boot...; " \ - "bcb clear command; bcb store; " \ + "if test "${run_fastboot}" -eq 0; then " \ + "if gpt verify mmc ${mmcdev} ${partitions}; then; " \ + "else " \ + "echo Broken MMC partition scheme;" \ "setenv run_fastboot 1;" \ "fi; " \ - "if bcb test command = boot-fastboot; then " \ - "echo BCB: fastboot userspace boot...; " \ - "setenv force_recovery 1;" \ - "fi; " \ - "else " \ - "echo Warning: BCB is corrupted or does not exist; " \ + "fi;" \ + "if test "${run_fastboot}" -eq 0; then " \ + "if bcb load " __stringify(CONFIG_FASTBOOT_FLASH_MMC_DEV) " " \ + CONTROL_PARTITION "; then " \ + "if bcb test command = bootonce-bootloader; then " \ + "echo BCB: Bootloader boot...; " \ + "bcb clear command; bcb store; " \ + "setenv run_fastboot 1;" \ + "elif bcb test command = boot-fastboot; then " \ + "echo BCB: fastboot userspace boot...; " \ + "setenv force_recovery 1;" \ + "fi; " \ + "else " \ + "echo Warning: BCB is corrupted or does not exist; " \ + "fi;" \ "fi;" \ "if test "${run_fastboot}" -eq 1; then " \ "echo Running Fastboot...;" \

From: Neil Armstrong narmstrong@baylibre.com
If bootloader was updated without running oem format, reboot will cause boot loop because the SYSTEM stage fails.
Add a final PANIC stage running fastboot to permit recovery.
Signed-off-by: Neil Armstrong narmstrong@baylibre.com Signed-off-by: Mattijs Korpershoek mkorpershoek@baylibre.com --- include/configs/meson64_android.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/include/configs/meson64_android.h b/include/configs/meson64_android.h index 93d8f8ec99de..7cd1ab034118 100644 --- a/include/configs/meson64_android.h +++ b/include/configs/meson64_android.h @@ -233,16 +233,24 @@ "echo Running Android...;" \ BOOT_CMD \ "fi;" \ - "echo Failed to boot Android...;" \ - "reset\0" + "echo Failed to boot Android...;\0"
#define BOOTENV_DEV_NAME_SYSTEM(devtypeu, devtypel, instance) \ "system "
+#define BOOTENV_DEV_PANIC(devtypeu, devtypel, instance) \ + "bootcmd_panic=" \ + "fastboot " __stringify(CONFIG_FASTBOOT_USB_DEV) "; " \ + "reset\0" + +#define BOOTENV_DEV_NAME_PANIC(devtypeu, devtypel, instance) \ + "panic " + #define BOOT_TARGET_DEVICES(func) \ func(FASTBOOT, fastboot, na) \ func(RECOVERY, recovery, na) \ func(SYSTEM, system, na) \ + func(PANIC, panic, na) \
#define PREBOOT_LOAD_LOGO \ "if test "${boot_source}" != "usb" && " \

Hi,
On 17/11/2021 12:04, Mattijs Korpershoek wrote:
The SEI-610 and SEI-510 boards are well supported in the Android Open Source project via the yukawa [1] platform.
Their U-Boot version, despite being public [2] is not in mainline.
For initial boards, with an empty eMMC, we can have boot loops while using the flashing process described in [3].
This series add 2 fixes for these bootloops.
[1] https://android.googlesource.com/device/amlogic/yukawa [2] https://gitlab.com/baylibre/amlogic/atv/u-boot/-/tree/u-boot/v2021.07/integ [3] https://gitlab.com/baylibre/amlogic/atv/aosp/device/amlogic/yukawa/-/wikis/K...
Neil Armstrong (2): configs: meson64_android: bypass other checks on run_fastboot=1 configs: meson64_android: add PANIC stage for SYSTEM fails
include/configs/meson64_android.h | 47 +++++++++++++++++++------------ 1 file changed, 29 insertions(+), 18 deletions(-)
base-commit: 4f4f974a46244270c1c6723017711c0aa8250206
Thanks, Applied to u-boot-amlogic
Neil
participants (2)
-
Mattijs Korpershoek
-
Neil Armstrong