static uint32_t ivt_offset;
static uint32_t using_fit;
+#define ROM_V1 1
+#define ROM_V2 2
+
+static uint32_t rom_version = ROM_V1;
+
#define CSF_SIZE 0x2000
#define HDMI_IVT_ID 0
#define IMAGE_IVT_ID 1
{CMD_LOADER, "LOADER", "loader image", },
{CMD_SECOND_LOADER, "SECOND_LOADER", "2nd loader image", },
{CMD_DDR_FW, "DDR_FW", "ddr firmware", },
+ {CMD_ROM_VERSION, "ROM_VERSION", "rom version", },
{-1, "", "", },
};
token);
if (!strncmp(token, "sd", 2))
rom_image_offset = 0x8000;
+
+ if (rom_version == ROM_V2)
+ ivt_offset = 0;
break;
case CMD_LOADER:
ap_img = token;
case CMD_DDR_FW:
/* Do nothing */
break;
+ case CMD_ROM_VERSION:
+ if (!strncmp(token, "v2", 2)) {
+ rom_version = ROM_V2;
+ ivt_offset = 0;
+ } else if (!strncmp(token, "v1", 2)) {
+ rom_version = ROM_V1;
+ }
+ break;
+
}
}
* Record the second bootloader relative offset in
* image's IVT reserved1
*/
- imx_header[IMAGE_IVT_ID].fhdr.reserved1 =
- sld_header_off - header_image_off;
+ if (rom_version == ROM_V1) {
+ imx_header[IMAGE_IVT_ID].fhdr.reserved1 =
+ sld_header_off - header_image_off;
+ }
sld_fd = open(sld_img, O_RDONLY | O_BINARY);
if (sld_fd < 0) {
fprintf(stderr, "%s: Can't open: %s\n",