Skip to content

Commit d904202

Browse files
yliu80lijinxia
authored andcommitted
IOC mediator: Set default boot wakeup reason for IOC mediator
Set default boot wakeup reason to avoid acrn-dm boot failed with invalid acrn-dm boot parameter. Signed-off-by: Yuan Liu <yuan1.liu@intel.com> Reviewed-by: Yu Wang <yu1.wang@intel.com> Reviewed-by: Zhao Yakui <yakui.zhao@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent 14b2e1d commit d904202

File tree

1 file changed

+12
-3
lines changed
  • devicemodel/hw/platform

1 file changed

+12
-3
lines changed

devicemodel/hw/platform/ioc.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,8 +1281,14 @@ ioc_parse(const char *opts)
12811281
snprintf(virtual_uart_path, sizeof(virtual_uart_path), "%s", param);
12821282
if (tmp != NULL) {
12831283
tmp = strtok(NULL, ",");
1284-
if (tmp != NULL)
1284+
if (tmp != NULL) {
12851285
ioc_boot_reason = strtoul(tmp, 0, 0);
1286+
1287+
/*
1288+
* Mask invalid bits of wakeup reason for IOC mediator
1289+
*/
1290+
ioc_boot_reason &= CBC_WK_RSN_ALL;
1291+
}
12861292
}
12871293
free(param);
12881294
return 0;
@@ -1302,9 +1308,12 @@ ioc_init(struct vmctx *ctx)
13021308
if (ioc_is_platform_supported() != 0)
13031309
goto ioc_err;
13041310

1305-
/* Check IOC boot reason */
1311+
/*
1312+
* Set default boot wakeup reason as ignition button active if met
1313+
* invalid parameter.
1314+
*/
13061315
if (ioc_boot_reason == 0)
1307-
goto ioc_err;
1316+
ioc_boot_reason = CBC_WK_RSN_BTN;
13081317
ioc = (struct ioc_dev *)calloc(1, sizeof(struct ioc_dev));
13091318
if (!ioc)
13101319
goto ioc_err;

0 commit comments

Comments
 (0)