• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修订版6ec65c8558f5e2f98c4baf28a347354942f0f908 (tree)
时间2022-07-26 18:29:02
作者Peng Fan <peng.fan@nxp....>
CommiterStefano Babic

Log Message

tools: image: support i.MX93

Support build i.MX93 container image with mkimage

Signed-off-by: Peng Fan <peng.fan@nxp.com>

更改概述

差异

--- a/include/imx8image.h
+++ b/include/imx8image.h
@@ -165,6 +165,7 @@ enum imx8image_core_type {
165165 CFG_M40,
166166 CFG_M41,
167167 CFG_A35,
168+ CFG_A55,
168169 CFG_A53,
169170 CFG_A72
170171 };
@@ -180,7 +181,9 @@ enum imx8image_fld_types {
180181 typedef enum SOC_TYPE {
181182 NONE = 0,
182183 QX,
183- QM
184+ QM,
185+ ULP,
186+ IMX9
184187 } soc_type_t;
185188
186189 typedef enum option_type {
@@ -201,7 +204,9 @@ typedef enum option_type {
201204 DATA,
202205 PARTITION,
203206 FILEOFF,
204- MSG_BLOCK
207+ MSG_BLOCK,
208+ SENTINEL,
209+ UPOWER
205210 } option_type_t;
206211
207212 typedef struct {
@@ -221,6 +226,11 @@ typedef struct {
221226 #define CORE_CA72 5
222227 #define CORE_SECO 6
223228
229+#define CORE_ULP_CM33 0x1
230+#define CORE_ULP_CA35 0x2
231+#define CORE_ULP_UPOWER 0x4
232+#define CORE_ULP_SENTINEL 0x6
233+
224234 #define SC_R_OTP 357U
225235 #define SC_R_DEBUG 354U
226236 #define SC_R_ROM_0 236U
@@ -235,6 +245,7 @@ typedef struct {
235245 #define IMG_TYPE_DATA 0x04 /* Data image type */
236246 #define IMG_TYPE_DCD_DDR 0x05 /* DCD/DDR image type */
237247 #define IMG_TYPE_SECO 0x06 /* SECO image type */
248+#define IMG_TYPE_SENTINEL 0x06 /* SENTINEL image type */
238249 #define IMG_TYPE_PROV 0x07 /* Provisioning image type */
239250 #define IMG_TYPE_DEK 0x08 /* DEK validation type */
240251
--- a/tools/imx8image.c
+++ b/tools/imx8image.c
@@ -60,6 +60,7 @@ static table_entry_t imx8image_core_entries[] = {
6060 {CFG_M40, "M40", "M4 core 0", },
6161 {CFG_M41, "M41", "M4 core 1", },
6262 {CFG_A35, "A35", "A35 core", },
63+ {CFG_A55, "A55", "A55 core", },
6364 {CFG_A53, "A53", "A53 core", },
6465 {CFG_A72, "A72", "A72 core", },
6566 {-1, "", "", },
@@ -117,6 +118,10 @@ static void parse_cfg_cmd(image_t *param_stack, int32_t cmd, char *token,
117118 soc = QX;
118119 } else if (!strncmp(token, "IMX8QM", 6)) {
119120 soc = QM;
121+ } else if (!strncmp(token, "ULP", 3)) {
122+ soc = IMX9;
123+ } else if (!strncmp(token, "IMX9", 4)) {
124+ soc = IMX9;
120125 } else {
121126 fprintf(stderr, "Unknown CMD_SOC_TYPE");
122127 exit(EXIT_FAILURE);
@@ -187,6 +192,7 @@ static void parse_cfg_fld(image_t *param_stack, int32_t *cmd, char *token,
187192 param_stack[p_idx].filename = token;
188193 break;
189194 case CFG_A35:
195+ case CFG_A55:
190196 param_stack[p_idx].ext = CORE_CA35;
191197 param_stack[p_idx].option =
192198 (*cmd == CMD_DATA) ? DATA : AP;
@@ -219,6 +225,7 @@ static void parse_cfg_fld(image_t *param_stack, int32_t *cmd, char *token,
219225 case CFG_M41:
220226 case CFG_A35:
221227 case CFG_A53:
228+ case CFG_A55:
222229 case CFG_A72:
223230 param_stack[p_idx++].entry =
224231 (uint32_t)strtoll(token, NULL, 0);
@@ -548,6 +555,18 @@ static void set_image_array_entry(flash_header_v3_t *container,
548555 img->dst = 0x20C00000;
549556 img->entry = 0x20000000;
550557 break;
558+ case SENTINEL:
559+ if (container->num_images > 0) {
560+ fprintf(stderr, "Error: SENTINEL container only allows 1 image\n");
561+ return;
562+ }
563+
564+ img->hab_flags |= IMG_TYPE_SENTINEL;
565+ img->hab_flags |= CORE_ULP_SENTINEL << BOOT_IMG_FLAGS_CORE_SHIFT;
566+ tmp_name = "SENTINEL";
567+ img->dst = 0xe4000000; /* S400 IRAM base */
568+ img->entry = 0xe4000000;
569+ break;
551570 case AP:
552571 if (soc == QX && core == CORE_CA35) {
553572 meta = IMAGE_A35_DEFAULT_META(custom_partition);
@@ -555,6 +574,8 @@ static void set_image_array_entry(flash_header_v3_t *container,
555574 meta = IMAGE_A53_DEFAULT_META(custom_partition);
556575 } else if (soc == QM && core == CORE_CA72) {
557576 meta = IMAGE_A72_DEFAULT_META(custom_partition);
577+ } else if (((soc == ULP) || (soc == IMX9)) && core == CORE_CA35) {
578+ meta = 0;
558579 } else {
559580 fprintf(stderr,
560581 "Error: invalid AP core id: %" PRIu64 "\n",
@@ -562,8 +583,10 @@ static void set_image_array_entry(flash_header_v3_t *container,
562583 exit(EXIT_FAILURE);
563584 }
564585 img->hab_flags |= IMG_TYPE_EXEC;
565- /* On B0, only core id = 4 is valid */
566- img->hab_flags |= CORE_CA53 << BOOT_IMG_FLAGS_CORE_SHIFT;
586+ if ((soc == ULP) || (soc == IMX9))
587+ img->hab_flags |= CORE_ULP_CA35 << BOOT_IMG_FLAGS_CORE_SHIFT;
588+ else
589+ img->hab_flags |= CORE_CA53 << BOOT_IMG_FLAGS_CORE_SHIFT; /* On B0, only core id = 4 is valid */
567590 tmp_name = "AP";
568591 img->dst = entry;
569592 img->entry = entry;
@@ -572,17 +595,22 @@ static void set_image_array_entry(flash_header_v3_t *container,
572595 break;
573596 case M40:
574597 case M41:
575- if (core == 0) {
576- core = CORE_CM4_0;
577- meta = IMAGE_M4_0_DEFAULT_META(custom_partition);
578- } else if (core == 1) {
579- core = CORE_CM4_1;
580- meta = IMAGE_M4_1_DEFAULT_META(custom_partition);
598+ if ((soc == ULP) || (soc == IMX9)) {
599+ core = CORE_ULP_CM33;
600+ meta = 0;
581601 } else {
582- fprintf(stderr,
583- "Error: invalid m4 core id: %" PRIu64 "\n",
584- core);
585- exit(EXIT_FAILURE);
602+ if (core == 0) {
603+ core = CORE_CM4_0;
604+ meta = IMAGE_M4_0_DEFAULT_META(custom_partition);
605+ } else if (core == 1) {
606+ core = CORE_CM4_1;
607+ meta = IMAGE_M4_1_DEFAULT_META(custom_partition);
608+ } else {
609+ fprintf(stderr,
610+ "Error: invalid m4 core id: %" PRIu64 "\n",
611+ core);
612+ exit(EXIT_FAILURE);
613+ }
586614 }
587615 img->hab_flags |= IMG_TYPE_EXEC;
588616 img->hab_flags |= core << BOOT_IMG_FLAGS_CORE_SHIFT;
@@ -598,7 +626,14 @@ static void set_image_array_entry(flash_header_v3_t *container,
598626 break;
599627 case DATA:
600628 img->hab_flags |= IMG_TYPE_DATA;
601- img->hab_flags |= CORE_CA35 << BOOT_IMG_FLAGS_CORE_SHIFT;
629+ if ((soc == ULP) || (soc == IMX9)) {
630+ if (core == CORE_CM4_0)
631+ img->hab_flags |= CORE_ULP_CM33 << BOOT_IMG_FLAGS_CORE_SHIFT;
632+ else
633+ img->hab_flags |= CORE_ULP_CA35 << BOOT_IMG_FLAGS_CORE_SHIFT;
634+ } else {
635+ img->hab_flags |= CORE_CA35 << BOOT_IMG_FLAGS_CORE_SHIFT;
636+ }
602637 tmp_name = "DATA";
603638 img->dst = entry;
604639 break;
@@ -630,6 +665,15 @@ static void set_image_array_entry(flash_header_v3_t *container,
630665 img->dst = img->entry - 1;
631666 }
632667 break;
668+ case UPOWER:
669+ if (soc == ULP) {
670+ img->hab_flags |= IMG_TYPE_EXEC;
671+ img->hab_flags |= CORE_ULP_UPOWER << BOOT_IMG_FLAGS_CORE_SHIFT;
672+ tmp_name = "UPOWER";
673+ img->dst = 0x28300200; /* UPOWER code RAM */
674+ img->entry = 0x28300200;
675+ }
676+ break;
633677 default:
634678 fprintf(stderr, "unrecognized image type (%d)\n", type);
635679 exit(EXIT_FAILURE);
@@ -797,6 +841,10 @@ static int build_container(soc_type_t soc, uint32_t sector_size,
797841 fprintf(stdout, "Platform:\ti.MX8QXP B0\n");
798842 else if (soc == QM)
799843 fprintf(stdout, "Platform:\ti.MX8QM B0\n");
844+ else if (soc == ULP)
845+ fprintf(stdout, "Platform:\ti.MX8ULP A0\n");
846+ else if (soc == IMX9)
847+ fprintf(stdout, "Platform:\ti.MX9\n");
800848
801849 set_imx_hdr_v3(&imx_header, 0);
802850 set_imx_hdr_v3(&imx_header, 1);
@@ -815,6 +863,7 @@ static int build_container(soc_type_t soc, uint32_t sector_size,
815863 case M41:
816864 case SCFW:
817865 case DATA:
866+ case UPOWER:
818867 case MSG_BLOCK:
819868 if (container < 0) {
820869 fprintf(stderr, "No container found\n");
@@ -833,6 +882,7 @@ static int build_container(soc_type_t soc, uint32_t sector_size,
833882 break;
834883
835884 case SECO:
885+ case SENTINEL:
836886 if (container < 0) {
837887 fprintf(stderr, "No container found\n");
838888 exit(EXIT_FAILURE);
@@ -941,7 +991,8 @@ static int build_container(soc_type_t soc, uint32_t sector_size,
941991 if (img_sp->option == M40 || img_sp->option == M41 ||
942992 img_sp->option == AP || img_sp->option == DATA ||
943993 img_sp->option == SCD || img_sp->option == SCFW ||
944- img_sp->option == SECO || img_sp->option == MSG_BLOCK) {
994+ img_sp->option == SECO || img_sp->option == MSG_BLOCK ||
995+ img_sp->option == UPOWER || img_sp->option == SENTINEL) {
945996 copy_file_aligned(ofd, img_sp->filename, img_sp->src,
946997 sector_size);
947998 }