MA-17338-1 Enable boot control v1.1
authorJi Luo <ji.luo@nxp.com>
Tue, 9 Jun 2020 06:59:45 +0000 (14:59 +0800)
committerJi Luo <ji.luo@nxp.com>
Thu, 13 May 2021 01:49:18 +0000 (09:49 +0800)
commita45dca90ff92f548f157f8739a76f249ca8241cb
tree752f3f7107bc4f5e510b76f8ccec587e1a4888b2
parentc81672979abafcecc7543c582af2d5370c85cd27
MA-17338-1 Enable boot control v1.1

The old boot control logic and misc data struct is based on the
'external/avb/libavb_ab' library which is already marked as
deprecated and won't be maintained by google anymore:

  commit 37f5946d0e1159273eff61dd8041377fedbf55a9
  Author: David Zeuthen <zeuthen@google.com>
  Date:   Wed Sep 20 15:02:32 2017 -0400

    Deprecate libavb_ab and bootctrl.avb code.

    This code was already marked as experimental in anticipation of being
    removed in the future. Officially deprecate it and set Jun 1 2018 as
    the date it will be removed. This should give users of the code ample
    time to fork/migrate.

    To keep using the code AVB_AB_I_UNDERSTAND_LIBAVB_AB_IS_DEPRECATED
    must be defined.

    The reason for deprecating this code is twofold:

     - Its policy was optimized for devices without a display with
       e.g. automatic fallback to the other slot if a slot fails to
       boot. Since most A/B stacks in Android devices don't work this
       way this code is confusing.

     - There are no known active users, no good test coverage for the
       bootctrl.avb code, and no plans to use it.

    When the code is removed we'll provide an easy transition path by
    keeping (but renaming) the |ab_ops| member in AvbOps.

    Change-Id: Id5e090a2048076d36ccca2e1c4cb55e226b8b43d

Google has provided a new boot control v1.1 implementation under
'hardware/interfaces/boot/1.1/default' which uses a new misc data struct defined
in the 'include/android_bootloader_message.h'. This commit adds a new boot control
implementation in bootloader, which combines the new misc data struct and inherit
some flow in 'libavb_ab', the old 'libavb_ab' library will be removed.

Test: boot/slot switch/retry count test on single&dual bootloader.

Signed-off-by: Ji Luo <ji.luo@nxp.com>
Change-Id: I0fa1ee8562c83afec549c8f6aad7a26a2214f626
(cherry picked from commit 29aafaf065d1688201d014213052863ec9d18e9c)
(cherry picked from commit f5cda163c1559480a43e75869747a50787fd0ee1)
19 files changed:
drivers/fastboot/fb_fsl/bcb.h
drivers/fastboot/fb_fsl/fb_fsl_command.c
drivers/fastboot/fb_fsl/fb_fsl_common.c
include/android_bootloader_message.h
include/configs/imx8qm_mek_android_auto.h
include/configs/imx8qm_mek_android_auto_xen.h
include/fsl_avb.h
lib/avb/Makefile
lib/avb/fsl/Makefile
lib/avb/fsl/fsl_avb.c
lib/avb/fsl/fsl_avb_ab_flow.c [deleted file]
lib/avb/fsl/fsl_bootctl.c [deleted file]
lib/avb/fsl/fsl_bootctrl.c [new file with mode: 0755]
lib/avb/fsl/fsl_bootctrl.h [new file with mode: 0644]
lib/avb/libavb_ab/Makefile [deleted file]
lib/avb/libavb_ab/avb_ab_flow.c [deleted file]
lib/avb/libavb_ab/avb_ab_flow.h [deleted file]
lib/avb/libavb_ab/avb_ab_ops.h [deleted file]
lib/avb/libavb_ab/libavb_ab.h [deleted file]