summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJi Luo <ji.luo@nxp.com>2020-08-27 14:07:12 +0800
committerJi Luo <ji.luo@nxp.com>2020-08-31 18:16:24 +0800
commitd25c0c7b9de22abd6c326975199c86c943e742cf (patch)
treee15a0089c17e5169bf2c42a6e2779cafb4304473 /lib
parent65571cbbea2d59694e6bc45480fc52cae02790e9 (diff)
MA-17788 Boot time refine for automotive
Disable unused dts and configs for imx8q to reduce the boot time. The 'part_get_info_by_name' can be very time consuming as it will loop through all the GPT entries to find the matched partition, specify the number of 'misc' partition and use 'part_get_info' to load the partition info directly will save much time. With this patch, about 300ms can be save for imx8qm, about 350ms can be saved for imx8qxp. Test: boot tests. Signed-off-by: Ji Luo <ji.luo@nxp.com> Change-Id: I66bc7e002caea62754b670d0a30860a23a17ff61
Diffstat (limited to 'lib')
-rwxr-xr-xlib/avb/fsl/fsl_bootctrl.c11
-rw-r--r--lib/trusty/ql-tipc/libtipc.c5
2 files changed, 11 insertions, 5 deletions
diff --git a/lib/avb/fsl/fsl_bootctrl.c b/lib/avb/fsl/fsl_bootctrl.c
index 7f710ff40c..e07de32e9f 100755
--- a/lib/avb/fsl/fsl_bootctrl.c
+++ b/lib/avb/fsl/fsl_bootctrl.c
@@ -448,6 +448,9 @@ out:
#define PARTITION_NAME_LEN 13
#define PARTITION_BOOTLOADER "bootloader"
+#ifdef CONFIG_ANDROID_AUTO_SUPPORT
+#define PARTITION_MISC_ID 11
+#endif
extern int mmc_switch(struct mmc *mmc, u8 set, u8 index, u8 value);
@@ -469,7 +472,11 @@ int fsl_save_metadata_if_changed_dual_uboot(struct blk_desc *dev_desc,
/* Save metadata if changed. */
if (memcmp(ab_data, ab_data_orig, sizeof(struct bootloader_control)) != 0) {
/* Get misc partition info */
+#ifdef CONFIG_ANDROID_AUTO_SUPPORT
+ if (part_get_info(dev_desc, PARTITION_MISC_ID, &info) == -1) {
+#else
if (part_get_info_by_name(dev_desc, FASTBOOT_PARTITION_MISC, &info) == -1) {
+#endif
printf("Can't get partition info of partition: misc\n");
return -1;
}
@@ -497,7 +504,11 @@ int fsl_load_metadata_dual_uboot(struct blk_desc *dev_desc,
struct bootloader_control serialized;
size_t num_bytes;
+#ifdef CONFIG_ANDROID_AUTO_SUPPORT
+ if (part_get_info(dev_desc, PARTITION_MISC_ID, &info) == -1) {
+#else
if (part_get_info_by_name(dev_desc, FASTBOOT_PARTITION_MISC, &info) == -1) {
+#endif
printf("Can't get partition info of partition: misc\n");
return -1;
} else {
diff --git a/lib/trusty/ql-tipc/libtipc.c b/lib/trusty/ql-tipc/libtipc.c
index db001a8d31..7414634bd4 100644
--- a/lib/trusty/ql-tipc/libtipc.c
+++ b/lib/trusty/ql-tipc/libtipc.c
@@ -76,7 +76,6 @@ int trusty_ipc_init(void)
}
/* create Trusty IPC device */
- trusty_info("Initializing Trusty IPC device\n");
rc = trusty_ipc_dev_create(&_ipc_dev, &_tdev, PAGE_SIZE);
if (rc != 0) {
trusty_error("Initializing Trusty IPC device failed (%d)\n", rc);
@@ -87,7 +86,6 @@ int trusty_ipc_init(void)
rpmb_ctx = rpmb_storage_get_ctx();
/* start secure storage proxy service */
- trusty_info("Initializing RPMB storage proxy service\n");
rc = rpmb_storage_proxy_init(_ipc_dev, rpmb_ctx);
if (rc != 0) {
trusty_error("Initlializing RPMB storage proxy service failed (%d)\n",
@@ -106,14 +104,12 @@ int trusty_ipc_init(void)
/* secure storage service init ok, use trusty backed keystore */
env_set("keystore", "trusty");
- trusty_info("Initializing Trusty AVB client\n");
rc = avb_tipc_init(_ipc_dev);
if (rc != 0) {
trusty_error("Initlializing Trusty AVB client failed (%d)\n", rc);
return rc;
}
- trusty_info("Initializing Trusty Keymaster client\n");
rc = km_tipc_init(_ipc_dev);
if (rc != 0) {
trusty_error("Initlializing Trusty Keymaster client failed (%d)\n", rc);
@@ -122,7 +118,6 @@ int trusty_ipc_init(void)
}
#ifndef CONFIG_AVB_ATX
- trusty_info("Initializing Trusty Hardware Crypto client\n");
rc = hwcrypto_tipc_init(_ipc_dev);
if (rc != 0) {
trusty_error("Initlializing Trusty Keymaster client failed (%d)\n", rc);