blob: ac69975fc7a5cb01a0d96187974a4aebf9f6542b [file] [log] [blame]
Ye Li1c610742022-07-26 16:40:55 +08001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright 2022 NXP
4 */
5
6#include <common.h>
7#include <command.h>
8#include <errno.h>
9#include <asm/io.h>
10#include <asm/mach-imx/s400_api.h>
11#include <asm/mach-imx/sys_proto.h>
12#include <asm/arch-imx/cpu.h>
13#include <asm/arch/sys_proto.h>
14#include <asm/mach-imx/image.h>
15#include <console.h>
16#include <cpu_func.h>
17#include <asm/mach-imx/ahab.h>
18#include <asm/global_data.h>
19
20DECLARE_GLOBAL_DATA_PTR;
21
22#define IMG_CONTAINER_BASE (0x80000000UL)
23#define IMG_CONTAINER_END_BASE (IMG_CONTAINER_BASE + 0xFFFFUL)
24
Ye Lic9e34362023-01-30 18:39:51 +080025#define AHAB_MAX_EVENTS 8
26
27static char *ele_ipc_str[] = {
28 "IPC = MU RTD (0x1)\n",
29 "IPC = MU APD (0x2)\n",
30 "IPC = INVALID\n",
31 NULL
32};
33
34static char *ele_status_str[] = {
35 "STA = ELE_SUCCESS_IND (0xD6)\n",
36 "STA = ELE_FAILURE_IND (0x29)\n",
37 "STA = INVALID\n",
38 NULL
39};
40
41static char *ele_cmd_str[] = {
42 "CMD = ELE_PING_REQ (0x01)\n",
43 "CMD = ELE_FW_AUTH_REQ (0x02)\n",
44 "CMD = ELE_RESTART_RST_TIMER_REQ (0x04)\n",
45 "CMD = ELE_DUMP_DEBUG_BUFFER_REQ (0x21)\n",
46 "CMD = ELE_OEM_CNTN_AUTH_REQ (0x87)\n",
47 "CMD = ELE_VERIFY_IMAGE_REQ (0x88)\n",
48 "CMD = ELE_RELEASE_CONTAINER_REQ (0x89)\n",
49 "CMD = ELE_WRITE_SECURE_FUSE_REQ (0x91)\n",
50 "CMD = ELE_FWD_LIFECYCLE_UP_REQ (0x95)\n",
51 "CMD = ELE_READ_FUSE_REQ (0x97)\n",
52 "CMD = ELE_GET_FW_VERSION_REQ (0x9D)\n",
53 "CMD = ELE_RET_LIFECYCLE_UP_REQ (0xA0)\n",
54 "CMD = ELE_GET_EVENTS_REQ (0xA2)\n",
55 "CMD = ELE_ENABLE_PATCH_REQ (0xC3)\n",
56 "CMD = ELE_RELEASE_RDC_REQ (0xC4)\n",
57 "CMD = ELE_GET_FW_STATUS_REQ (0xC5)\n",
58 "CMD = ELE_ENABLE_OTFAD_REQ (0xC6)\n",
59 "CMD = ELE_RESET_REQ (0xC7)\n",
60 "CMD = ELE_UPDATE_OTP_CLKDIV_REQ (0xD0)\n",
61 "CMD = ELE_POWER_DOWN_REQ (0xD1)\n",
62 "CMD = ELE_ENABLE_APC_REQ (0xD2)\n",
63 "CMD = ELE_ENABLE_RTC_REQ (0xD3)\n",
64 "CMD = ELE_DEEP_POWER_DOWN_REQ (0xD4)\n",
65 "CMD = ELE_STOP_RST_TIMER_REQ (0xD5)\n",
66 "CMD = ELE_WRITE_FUSE_REQ (0xD6)\n",
67 "CMD = ELE_RELEASE_CAAM_REQ (0xD7)\n",
68 "CMD = ELE_RESET_A35_CTX_REQ (0xD8)\n",
69 "CMD = ELE_MOVE_TO_UNSECURED_REQ (0xD9)\n",
70 "CMD = ELE_GET_INFO_REQ (0xDA)\n",
71 "CMD = ELE_ATTEST_REQ (0xDB)\n",
72 "CMD = ELE_RELEASE_PATCH_REQ (0xDC)\n",
73 "CMD = ELE_OTP_SEQ_SWITH_REQ (0xDD)\n",
74 "CMD = INVALID\n",
75 NULL
76};
77
78static char *ele_ind_str[] = {
79 "IND = ELE_ROM_PING_FAILURE_IND (0x0A)\n",
80 "IND = ELE_FW_PING_FAILURE_IND (0x1A)\n",
81 "IND = ELE_BAD_SIGNATURE_FAILURE_IND (0xF0)\n",
82 "IND = ELE_BAD_HASH_FAILURE_IND (0xF1)\n",
83 "IND = ELE_INVALID_LIFECYCLE_IND (0xF2)\n",
84 "IND = ELE_PERMISSION_DENIED_FAILURE_IND (0xF3)\n",
85 "IND = ELE_INVALID_MESSAGE_FAILURE_IND (0xF4)\n",
86 "IND = ELE_BAD_VALUE_FAILURE_IND (0xF5)\n",
87 "IND = ELE_BAD_FUSE_ID_FAILURE_IND (0xF6)\n",
88 "IND = ELE_BAD_CONTAINER_FAILURE_IND (0xF7)\n",
89 "IND = ELE_BAD_VERSION_FAILURE_IND (0xF8)\n",
90 "IND = ELE_INVALID_KEY_FAILURE_IND (0xF9)\n",
91 "IND = ELE_BAD_KEY_HASH_FAILURE_IND (0xFA)\n",
92 "IND = ELE_NO_VALID_CONTAINER_FAILURE_IND (0xFB)\n",
93 "IND = ELE_BAD_CERTIFICATE_FAILURE_IND (0xFC)\n",
94 "IND = ELE_BAD_UID_FAILURE_IND (0xFD)\n",
95 "IND = ELE_BAD_MONOTONIC_COUNTER_FAILURE_IND (0xFE)\n",
96 "IND = ELE_MUST_SIGNED_FAILURE_IND (0xE0)\n",
97 "IND = ELE_NO_AUTHENTICATION_FAILURE_IND (0xEE)\n",
98 "IND = ELE_BAD_SRK_SET_FAILURE_IND (0xEF)\n",
99 "IND = ELE_UNALIGNED_PAYLOAD_FAILURE_IND (0xA6)\n",
100 "IND = ELE_WRONG_SIZE_FAILURE_IND (0xA7)\n",
101 "IND = ELE_ENCRYPTION_FAILURE_IND (0xA8)\n",
102 "IND = ELE_DECRYPTION_FAILURE_IND (0xA9)\n",
103 "IND = ELE_OTP_PROGFAIL_FAILURE_IND (0xAA)\n",
104 "IND = ELE_OTP_LOCKED_FAILURE_IND (0xAB)\n",
105 "IND = ELE_OTP_INVALID_IDX_FAILURE_IND (0xAD)\n",
106 "IND = ELE_TIME_OUT_FAILURE_IND (0xB0)\n",
107 "IND = ELE_BAD_PAYLOAD_FAILURE_IND (0xB1)\n",
108 "IND = ELE_WRONG_ADDRESS_FAILURE_IND (0xB4)\n",
109 "IND = ELE_DMA_FAILURE_IND (0xB5)\n",
110 "IND = ELE_DISABLED_FEATURE_FAILURE_IND (0xB6)\n",
111 "IND = ELE_MUST_ATTEST_FAILURE_IND (0xB7)\n",
112 "IND = ELE_RNG_NOT_STARTED_FAILURE_IND (0xB8)\n",
113 "IND = ELE_CRC_ERROR_IND (0xB9)\n",
114 "IND = ELE_AUTH_SKIPPED_OR_FAILED_FAILURE_IND (0xBB)\n",
115 "IND = ELE_INCONSISTENT_PAR_FAILURE_IND (0xBC)\n",
116 "IND = ELE_RNG_INST_FAILURE_FAILURE_IND (0xBD)\n",
117 "IND = ELE_LOCKED_REG_FAILURE_IND (0xBE)\n",
118 "IND = ELE_BAD_ID_FAILURE_IND (0xBF)\n",
119 "IND = ELE_INVALID_OPERATION_FAILURE_IND (0xC0)\n",
120 "IND = ELE_NON_SECURE_STATE_FAILURE_IND (0xC1)\n",
121 "IND = ELE_MSG_TRUNCATED_IND (0xC2)\n",
122 "IND = ELE_BAD_IMAGE_NUM_FAILURE_IND (0xC3)\n",
123 "IND = ELE_BAD_IMAGE_ADDR_FAILURE_IND (0xC4)\n",
124 "IND = ELE_BAD_IMAGE_PARAM_FAILURE_IND (0xC5)\n",
125 "IND = ELE_BAD_IMAGE_TYPE_FAILURE_IND (0xC6)\n",
126 "IND = ELE_CORRUPTED_SRK_FAILURE_IND (0xD0)\n",
127 "IND = ELE_OUT_OF_MEMORY_IND (0xD1)\n",
128 "IND = ELE_CSTM_FAILURE_IND (0xCF)\n",
129 "IND = ELE_OLD_VERSION_FAILURE_IND (0xCE)\n",
130 "IND = ELE_WRONG_BOOT_MODE_FAILURE_IND (0xCD)\n",
131 "IND = ELE_APC_ALREADY_ENABLED_FAILURE_IND (0xCB)\n",
132 "IND = ELE_RTC_ALREADY_ENABLED_FAILURE_IND (0xCC)\n",
133 "IND = ELE_ABORT_IND (0xFF)\n",
134 "IND = INVALID\n",
135 NULL
136};
137
138static u8 ele_cmd[] = {
139 ELE_PING_REQ,
140 ELE_FW_AUTH_REQ,
141 ELE_RESTART_RST_TIMER_REQ,
142 ELE_DUMP_DEBUG_BUFFER_REQ,
143 ELE_OEM_CNTN_AUTH_REQ,
144 ELE_VERIFY_IMAGE_REQ,
145 ELE_RELEASE_CONTAINER_REQ,
146 ELE_WRITE_SECURE_FUSE_REQ,
147 ELE_FWD_LIFECYCLE_UP_REQ,
148 ELE_READ_FUSE_REQ,
149 ELE_GET_FW_VERSION_REQ,
150 ELE_RET_LIFECYCLE_UP_REQ,
151 ELE_GET_EVENTS_REQ,
152 ELE_ENABLE_PATCH_REQ,
153 ELE_RELEASE_RDC_REQ,
154 ELE_GET_FW_STATUS_REQ,
155 ELE_ENABLE_OTFAD_REQ,
156 ELE_RESET_REQ,
157 ELE_UPDATE_OTP_CLKDIV_REQ,
158 ELE_POWER_DOWN_REQ,
159 ELE_ENABLE_APC_REQ,
160 ELE_ENABLE_RTC_REQ,
161 ELE_DEEP_POWER_DOWN_REQ,
162 ELE_STOP_RST_TIMER_REQ,
163 ELE_WRITE_FUSE_REQ,
164 ELE_RELEASE_CAAM_REQ,
165 ELE_RESET_A35_CTX_REQ,
166 ELE_MOVE_TO_UNSECURED_REQ,
167 ELE_GET_INFO_REQ,
168 ELE_ATTEST_REQ,
169 ELE_RELEASE_PATCH_REQ,
170 ELE_OTP_SEQ_SWITH_REQ
171};
172
173static u8 ele_ind[] = {
174 ELE_ROM_PING_FAILURE_IND,
175 ELE_FW_PING_FAILURE_IND,
176 ELE_BAD_SIGNATURE_FAILURE_IND,
177 ELE_BAD_HASH_FAILURE_IND,
178 ELE_INVALID_LIFECYCLE_IND,
179 ELE_PERMISSION_DENIED_FAILURE_IND,
180 ELE_INVALID_MESSAGE_FAILURE_IND,
181 ELE_BAD_VALUE_FAILURE_IND,
182 ELE_BAD_FUSE_ID_FAILURE_IND,
183 ELE_BAD_CONTAINER_FAILURE_IND,
184 ELE_BAD_VERSION_FAILURE_IND,
185 ELE_INVALID_KEY_FAILURE_IND,
186 ELE_BAD_KEY_HASH_FAILURE_IND,
187 ELE_NO_VALID_CONTAINER_FAILURE_IND,
188 ELE_BAD_CERTIFICATE_FAILURE_IND,
189 ELE_BAD_UID_FAILURE_IND,
190 ELE_BAD_MONOTONIC_COUNTER_FAILURE_IND,
191 ELE_MUST_SIGNED_FAILURE_IND,
192 ELE_NO_AUTHENTICATION_FAILURE_IND,
193 ELE_BAD_SRK_SET_FAILURE_IND,
194 ELE_UNALIGNED_PAYLOAD_FAILURE_IND,
195 ELE_WRONG_SIZE_FAILURE_IND,
196 ELE_ENCRYPTION_FAILURE_IND,
197 ELE_DECRYPTION_FAILURE_IND,
198 ELE_OTP_PROGFAIL_FAILURE_IND,
199 ELE_OTP_LOCKED_FAILURE_IND,
200 ELE_OTP_INVALID_IDX_FAILURE_IND,
201 ELE_TIME_OUT_FAILURE_IND,
202 ELE_BAD_PAYLOAD_FAILURE_IND,
203 ELE_WRONG_ADDRESS_FAILURE_IND,
204 ELE_DMA_FAILURE_IND,
205 ELE_DISABLED_FEATURE_FAILURE_IND,
206 ELE_MUST_ATTEST_FAILURE_IND,
207 ELE_RNG_NOT_STARTED_FAILURE_IND,
208 ELE_CRC_ERROR_IND,
209 ELE_AUTH_SKIPPED_OR_FAILED_FAILURE_IND,
210 ELE_INCONSISTENT_PAR_FAILURE_IND,
211 ELE_RNG_INST_FAILURE_FAILURE_IND,
212 ELE_LOCKED_REG_FAILURE_IND,
213 ELE_BAD_ID_FAILURE_IND,
214 ELE_INVALID_OPERATION_FAILURE_IND,
215 ELE_NON_SECURE_STATE_FAILURE_IND,
216 ELE_MSG_TRUNCATED_IND,
217 ELE_BAD_IMAGE_NUM_FAILURE_IND,
218 ELE_BAD_IMAGE_ADDR_FAILURE_IND,
219 ELE_BAD_IMAGE_PARAM_FAILURE_IND,
220 ELE_BAD_IMAGE_TYPE_FAILURE_IND,
221 ELE_CORRUPTED_SRK_FAILURE_IND,
222 ELE_OUT_OF_MEMORY_IND,
223 ELE_CSTM_FAILURE_IND,
224 ELE_OLD_VERSION_FAILURE_IND,
225 ELE_WRONG_BOOT_MODE_FAILURE_IND,
226 ELE_APC_ALREADY_ENABLED_FAILURE_IND,
227 ELE_RTC_ALREADY_ENABLED_FAILURE_IND,
228 ELE_ABORT_IND
229};
230
231static u8 ele_ipc[] = {
232 ELE_IPC_MU_RTD,
233 ELE_IPC_MU_APD
234};
235
236static u8 ele_status[] = {
237 ELE_SUCCESS_IND,
238 ELE_FAILURE_IND
239};
240
241static inline u32 get_idx(u8 *list, u8 tgt, u32 size)
242{
243 u32 i;
244
245 for (i = 0; i < size; i++) {
246 if (list[i] == tgt)
247 return i;
248 }
249
250 return i; /* last str is invalid */
251}
Ye Li1c610742022-07-26 16:40:55 +0800252
253static void display_ahab_auth_ind(u32 event)
254{
255 u8 resp_ind = (event >> 8) & 0xff;
256
Ye Lic9e34362023-01-30 18:39:51 +0800257 printf("%s\n", ele_ind_str[get_idx(ele_ind, resp_ind, ARRAY_SIZE(ele_ind))]);
Ye Li1c610742022-07-26 16:40:55 +0800258}
259
260int ahab_auth_cntr_hdr(struct container_hdr *container, u16 length)
261{
262 int err;
263 u32 resp;
264
265 memcpy((void *)IMG_CONTAINER_BASE, (const void *)container,
266 ALIGN(length, CONFIG_SYS_CACHELINE_SIZE));
267
268 flush_dcache_range(IMG_CONTAINER_BASE,
269 IMG_CONTAINER_BASE + ALIGN(length, CONFIG_SYS_CACHELINE_SIZE) - 1);
270
271 err = ahab_auth_oem_ctnr(IMG_CONTAINER_BASE, &resp);
272 if (err) {
273 printf("Authenticate container hdr failed, return %d, resp 0x%x\n",
274 err, resp);
275 display_ahab_auth_ind(resp);
276 }
277
278 return err;
279}
280
281int ahab_auth_release(void)
282{
283 int err;
284 u32 resp;
285
286 err = ahab_release_container(&resp);
287 if (err) {
288 printf("Error: release container failed, resp 0x%x!\n", resp);
289 display_ahab_auth_ind(resp);
290 }
291
292 return err;
293}
294
295int ahab_verify_cntr_image(struct boot_img_t *img, int image_index)
296{
297 int err;
298 u32 resp;
299
300 err = ahab_verify_image(image_index, &resp);
301 if (err) {
302 printf("Authenticate img %d failed, return %d, resp 0x%x\n",
303 image_index, err, resp);
304 display_ahab_auth_ind(resp);
305
306 return -EIO;
307 }
308
309 return 0;
310}
311
312static inline bool check_in_dram(ulong addr)
313{
314 int i;
315 struct bd_info *bd = gd->bd;
316
317 for (i = 0; i < CONFIG_NR_DRAM_BANKS; ++i) {
318 if (bd->bi_dram[i].size) {
319 if (addr >= bd->bi_dram[i].start &&
320 addr < (bd->bi_dram[i].start + bd->bi_dram[i].size))
321 return true;
322 }
323 }
324
325 return false;
326}
327
328int authenticate_os_container(ulong addr)
329{
330 struct container_hdr *phdr;
331 int i, ret = 0;
332 int err;
333 u16 length;
334 struct boot_img_t *img;
335 unsigned long s, e;
336
337 if (addr % 4) {
338 puts("Error: Image's address is not 4 byte aligned\n");
339 return -EINVAL;
340 }
341
342 if (!check_in_dram(addr)) {
343 puts("Error: Image's address is invalid\n");
344 return -EINVAL;
345 }
346
347 phdr = (struct container_hdr *)addr;
348 if (phdr->tag != 0x87 || phdr->version != 0x0) {
349 printf("Error: Wrong container header\n");
350 return -EFAULT;
351 }
352
353 if (!phdr->num_images) {
354 printf("Error: Wrong container, no image found\n");
355 return -EFAULT;
356 }
357
358 length = phdr->length_lsb + (phdr->length_msb << 8);
359
360 debug("container length %u\n", length);
361
362 err = ahab_auth_cntr_hdr(phdr, length);
363 if (err) {
364 ret = -EIO;
365 goto exit;
366 }
367
368 debug("Verify images\n");
369
370 /* Copy images to dest address */
371 for (i = 0; i < phdr->num_images; i++) {
372 img = (struct boot_img_t *)(addr +
373 sizeof(struct container_hdr) +
374 i * sizeof(struct boot_img_t));
375
376 debug("img %d, dst 0x%x, src 0x%lx, size 0x%x\n",
377 i, (uint32_t)img->dst, img->offset + addr, img->size);
378
379 memcpy((void *)img->dst, (const void *)(img->offset + addr),
380 img->size);
381
382 s = img->dst & ~(CONFIG_SYS_CACHELINE_SIZE - 1);
383 e = ALIGN(img->dst + img->size, CONFIG_SYS_CACHELINE_SIZE) - 1;
384
385 flush_dcache_range(s, e);
386
387 ret = ahab_verify_cntr_image(img, i);
388 if (ret)
389 goto exit;
390 }
391
392exit:
393 debug("ahab_auth_release, 0x%x\n", ret);
394 ahab_auth_release();
395
396 return ret;
397}
398
399static int do_authenticate(struct cmd_tbl *cmdtp, int flag, int argc,
400 char *const argv[])
401{
402 ulong addr;
403
404 if (argc < 2)
405 return CMD_RET_USAGE;
406
407 addr = simple_strtoul(argv[1], NULL, 16);
408
409 printf("Authenticate OS container at 0x%lx\n", addr);
410
411 if (authenticate_os_container(addr))
412 return CMD_RET_FAILURE;
413
414 return CMD_RET_SUCCESS;
415}
416
417static void display_life_cycle(u32 lc)
418{
419 printf("Lifecycle: 0x%08X, ", lc);
420 switch (lc) {
421 case 0x1:
422 printf("BLANK\n\n");
423 break;
424 case 0x2:
425 printf("FAB\n\n");
426 break;
427 case 0x4:
428 printf("NXP Provisioned\n\n");
429 break;
430 case 0x8:
431 printf("OEM Open\n\n");
432 break;
433 case 0x10:
434 printf("OEM Secure World Closed\n\n");
435 break;
436 case 0x20:
437 printf("OEM closed\n\n");
438 break;
439 case 0x40:
440 printf("Field Return OEM\n\n");
441 break;
442 case 0x80:
443 printf("Field Return NXP\n\n");
444 break;
445 case 0x100:
446 printf("OEM Locked\n\n");
447 break;
448 case 0x200:
449 printf("BRICKED\n\n");
450 break;
451 default:
452 printf("Unknown\n\n");
453 break;
454 }
455}
456
457static int confirm_close(void)
458{
459 puts("Warning: Please ensure your sample is in NXP closed state, "
460 "OEM SRK hash has been fused, \n"
461 " and you are able to boot a signed image successfully "
462 "without any SECO events reported.\n"
463 " If not, your sample will be unrecoverable.\n"
464 "\nReally perform this operation? <y/N>\n");
465
466 if (confirm_yesno())
467 return 1;
468
469 puts("Ahab close aborted\n");
470 return 0;
471}
472
473static int do_ahab_close(struct cmd_tbl *cmdtp, int flag, int argc,
474 char *const argv[])
475{
476 int err;
477 u32 resp;
478
479 if (!confirm_close())
480 return -EACCES;
481
482 err = ahab_forward_lifecycle(8, &resp);
483 if (err != 0) {
484 printf("Error in forward lifecycle to OEM closed\n");
485 return -EIO;
486 }
487
488 printf("Change to OEM closed successfully\n");
489
490 return 0;
491}
492
493int ahab_dump(void)
494{
495 u32 buffer[32];
496 int ret, i = 0;
497
498 do {
499 ret = ahab_dump_buffer(buffer, 32);
500 if (ret < 0) {
501 printf("Error in dump AHAB log\n");
502 return -EIO;
503 }
504
505 if (ret == 1)
506 break;
507 for (i = 0; i < ret; i++)
508 printf("0x%x\n", buffer[i]);
509 } while (ret >= 21);
510
511 return 0;
512}
513
514static int do_ahab_dump(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
515{
516 return ahab_dump();
517}
518
Ye Lic9e34362023-01-30 18:39:51 +0800519static void display_event(u32 event)
520{
521 printf("\n\t0x%08x\n", event);
522 printf("\t%s", ele_ipc_str[get_idx(ele_ipc,
523 (event >> 24) & 0xFF, ARRAY_SIZE(ele_ipc))]);
524 printf("\t%s", ele_cmd_str[get_idx(ele_cmd,
525 (event >> 16) & 0xFF, ARRAY_SIZE(ele_cmd))]);
526 printf("\t%s", ele_ind_str[get_idx(ele_ind,
527 (event >> 8) & 0xFF, ARRAY_SIZE(ele_ind))]);
528 printf("\t%s", ele_status_str[get_idx(ele_status,
529 event & 0xFF, ARRAY_SIZE(ele_status))]);
530}
531
Ye Li1c610742022-07-26 16:40:55 +0800532static int do_ahab_status(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
533{
Ye Lic9e34362023-01-30 18:39:51 +0800534 u32 lc, i;
535 u32 events[AHAB_MAX_EVENTS];
536 u32 cnt = AHAB_MAX_EVENTS;
537 int ret;
Ye Li1c610742022-07-26 16:40:55 +0800538
539 lc = readl(FSB_BASE_ADDR + 0x41c);
540 lc &= 0x3ff;
541
542 display_life_cycle(lc);
Ye Lic9e34362023-01-30 18:39:51 +0800543
544 ret = ahab_get_events(events, &cnt, NULL);
545 if (ret) {
546 printf("Get ELE EVENTS error %d\n", ret);
547 return CMD_RET_FAILURE;
548 }
549
550 if (!cnt) {
551 puts("\n\tNo Events Found!\n");
552 return 0;
553 }
554
555 for (i = 0; i < cnt; i++)
556 display_event(events[i]);
557
Ye Li1c610742022-07-26 16:40:55 +0800558 return 0;
559}
560
561U_BOOT_CMD(auth_cntr, CONFIG_SYS_MAXARGS, 1, do_authenticate,
562 "autenticate OS container via AHAB",
563 "addr\n"
564 "addr - OS container hex address\n"
565);
566
567U_BOOT_CMD(ahab_close, CONFIG_SYS_MAXARGS, 1, do_ahab_close,
568 "Change AHAB lifecycle to OEM closed",
569 ""
570);
571
572U_BOOT_CMD(ahab_dump, CONFIG_SYS_MAXARGS, 1, do_ahab_dump,
573 "Dump AHAB log for debug",
574 ""
575);
576
577U_BOOT_CMD(ahab_status, CONFIG_SYS_MAXARGS, 1, do_ahab_status,
578 "display AHAB lifecycle only",
579 ""
580);