board/ctrl: add BOARDCTL_SWITCH_BOOT switch boot system support

BOARDIOC_SWITCH_BOOT is required to communicate the boot partition from
userspace (OTA subsystem) to board. It can be used to change the system
boot behavior. So it's useful for A/B boot or even single boot case.

For the board support A/B boot case:
1. Download the new image from the sever
2. Write the new image to the alternative partition
3. Call BOARDCTL_SWITCH_BOOT to the alternative system

For single boot partition case:
1. Download the new image from the sever
2. Call BOARDCTL_SWITCH_BOOT and reboot to a small system
3. Write the new image to the main partition in the small system
4. Call BOARDCTL_SWITCH_BOOT again to the main system

Change-Id: Ifebb495784ecf06842946a249bec64f75dce894f
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
This commit is contained in:
liuhaitao
2021-07-20 22:12:28 +08:00
committed by Xiang Xiao
parent 200c86bc92
commit a02f450773
4 changed files with 49 additions and 1 deletions
+2 -1
View File
@@ -201,6 +201,7 @@
#define BOARDIOC_NXTERM_IOCTL _BOARDIOC(0x0010)
#define BOARDIOC_TESTSET _BOARDIOC(0x0011)
#define BOARDIOC_UNIQUEKEY _BOARDIOC(0x0012)
#define BOARDIOC_SWITCH_BOOT _BOARDIOC(0x0013)
/* If CONFIG_BOARDCTL_IOCTL=y, then board-specific commands will be support.
* In this case, all commands not recognized by boardctl() will be forwarded
@@ -209,7 +210,7 @@
* User defined board commands may begin with this value:
*/
#define BOARDIOC_USER _BOARDIOC(0x0013)
#define BOARDIOC_USER _BOARDIOC(0x0014)
/****************************************************************************
* Public Type Definitions