summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2024-07-18 13:52:11 -0600
committerTom Rini <[email protected]>2024-07-18 17:03:47 -0600
commit459560000736ac7c9c8b04522789c20fb45ff95a (patch)
tree1d7b710ed41b3781c7de59b777f51917c710833f /include
parentcbfd2c28a007ae7601e5451aa2ad750b0453d518 (diff)
parentc2a2a06e01651ed814f8fae0c21fc49dc72b5af1 (diff)
Merge patch series "bootstd: Add Android support"
Mattijs Korpershoek <[email protected]> says: Android boot flow is a bit different than a regular Linux distro. Android relies on multiple partitions in order to boot. A typical boot flow would be: 1. Parse the Bootloader Control Block (BCB, misc partition) 2. If BCB requested bootonce-bootloader, start fastboot and wait. 3. If BCB requested recovery or normal android, run the following: a. Get slot (A/B) from BCB b. Run AVB (Android Verified Boot) on boot partitions c. Load boot and vendor_boot partitions d. Load device-tree, ramdisk and boot The AOSP documentation has more details at [1], [2], [3] This has been implemented via complex boot scripts such as [4]. However, these boot script are neither very maintainable nor generic. Moreover, DISTRO_DEFAULTS is being deprecated [5]. Add a generic Android bootflow implementation for bootstd. For this initial version, only boot image v4 is supported. This has been tested on sandbox using: $ ./test/py/test.py --bd sandbox --build -k test_ut This has also been tested on the AM62X SK EVM using TI's Android SDK[6] To test on TI board, the following (WIP) patch is needed as well: https://gitlab.baylibre.com/baylibre/ti/ti-u-boot/-/commit/84cceb912bccd7cdd7f9dd69bca0e5d987a1fd04 [1] https://source.android.com/docs/core/architecture/bootloader [2] https://source.android.com/docs/core/architecture/partitions [3] https://source.android.com/docs/core/architecture/partitions/generic-boot [4] https://source.denx.de/u-boot/u-boot/-/blob/master/include/configs/meson64_android.h [5] https://lore.kernel.org/r/all/[email protected]/ [6] https://software-dl.ti.com/processor-sdk-android/esd/AM62X/09_02_00/docs/android/Overview.html
Diffstat (limited to 'include')
-rw-r--r--include/bootflow.h9
-rw-r--r--include/image.h14
2 files changed, 23 insertions, 0 deletions
diff --git a/include/bootflow.h b/include/bootflow.h
index 6affc5e1a4f..4d2fc7b69b5 100644
--- a/include/bootflow.h
+++ b/include/bootflow.h
@@ -409,6 +409,15 @@ void bootflow_remove(struct bootflow *bflow);
int bootflow_iter_check_blk(const struct bootflow_iter *iter);
/**
+ * bootflow_iter_check_mmc() - Check that a bootflow uses a MMC device
+ *
+ * This checks the bootdev in the bootflow to make sure it uses a mmc device
+ *
+ * Return: 0 if OK, -ENOTSUPP if some other device is used (e.g. ethernet)
+ */
+int bootflow_iter_check_mmc(const struct bootflow_iter *iter);
+
+/**
* bootflow_iter_check_sf() - Check that a bootflow uses SPI FLASH
*
* This checks the bootdev in the bootflow to make sure it uses SPI flash
diff --git a/include/image.h b/include/image.h
index 9daaee15cdb..dd4042d1bd9 100644
--- a/include/image.h
+++ b/include/image.h
@@ -1972,6 +1972,13 @@ bool is_android_vendor_boot_image_header(const void *vendor_boot_img);
ulong get_abootimg_addr(void);
/**
+ * set_abootimg_addr() - Set Android boot image address
+ *
+ * Return: no returned results
+ */
+void set_abootimg_addr(ulong addr);
+
+/**
* get_ainit_bootimg_addr() - Get Android init boot image address
*
* Return: Android init boot image address
@@ -1986,6 +1993,13 @@ ulong get_ainit_bootimg_addr(void);
ulong get_avendor_bootimg_addr(void);
/**
+ * set_abootimg_addr() - Set Android vendor boot image address
+ *
+ * Return: no returned results
+ */
+void set_avendor_bootimg_addr(ulong addr);
+
+/**
* board_fit_config_name_match() - Check for a matching board name
*
* This is used when SPL loads a FIT containing multiple device tree files