int android_image_get_kernel(const struct andr_img_hdr *hdr, int verify,
ulong *os_data, ulong *os_len)
{
+ extern boot_metric metrics;
u32 kernel_addr = android_image_get_kernel_addr(hdr);
/*
kernel_addr, DIV_ROUND_UP(hdr->kernel_size, 1024));
char newbootargs[512] = {0};
- char commandline[1024] = {0};
+ char commandline[2048] = {0};
char *bootargs = getenv("bootargs");
if (bootargs) {
strcat(commandline, newbootargs);
}
+ /* boot metric variables */
+ metrics.ble_1 = get_timer(0);
+ sprintf(newbootargs,
+ " androidboot.boottime=1BLL:%d,1BLE:%d,KL:%d,KD:%d,AVB:%d,ODT:%d,SW:%d",
+ metrics.bll_1, metrics.ble_1, metrics.kl, metrics.kd, metrics.avb,
+ metrics.odt, metrics.sw);
+ strcat(commandline, newbootargs);
+
#ifdef CONFIG_AVB_SUPPORT
/* secondary cmdline added by avb */
char *bootargs_sec = getenv("bootargs_sec");
"battery-soc-ok"
};
+/* Boot metric variables */
+boot_metric metrics = {
+ .bll_1 = 0,
+ .ble_1 = 0,
+ .kl = 0,
+ .kd = 0,
+ .avb = 0,
+ .odt = 0,
+ .sw = 0
+};
+
#ifdef CONFIG_USB_GADGET
struct f_fastboot {
struct usb_function usb_function;
struct andr_img_hdr *hdr = NULL;
struct andr_img_hdr *hdrload;
ulong image_size;
+ u32 avb_metric;
AvbABFlowResult avb_result;
AvbSlotVerifyData *avb_out_data;
lock_status = FASTBOOT_LOCK;
}
bool allow_fail = (lock_status == FASTBOOT_UNLOCK ? true : false);
+ avb_metric = get_timer(0);
/* if in lock state, do avb verify */
avb_result = avb_ab_flow(&fsl_avb_ab_ops, requested_partitions, allow_fail, &avb_out_data);
+ /* get the duration of avb */
+ metrics.avb = get_timer(avb_metric);
+
if (avb_result == AVB_AB_FLOW_RESULT_OK) {
assert(avb_out_data != NULL);
/* load the first partition */
#define ANDR_BOOT_NAME_SIZE 16
#define ANDR_BOOT_ARGS_SIZE 512
+/* Boot metric variables (in millisecond) */
+struct boot_metric
+{
+ u32 bll_1; /* 1th bootloader load duration */
+ u32 ble_1; /* 1th bootloader exec duration */
+ u32 kl; /* kernel image load duration */
+ u32 kd; /* kernel image decompress duration */
+ u32 avb; /* avb verify boot.img duration */
+ u32 odt; /* overlay device tree duration */
+ u32 sw; /* system wait for UI interaction duration*/
+};
+typedef struct boot_metric boot_metric;
+
struct andr_img_hdr {
char magic[ANDR_BOOT_MAGIC_SIZE];