X-Git-Url: https://git.kernelconcepts.de/?a=blobdiff_plain;f=tools%2Fimximage.c;h=03a771667327387ff454a855e6032d20f19b71ac;hb=7373323056f524b3136cee4911f1debc23723ae7;hp=8e81bdb9c4624ef4028367967e533a9c33c70199;hpb=8a1edd7d54096ed28232a6cfec7288cd0426d988;p=karo-tx-uboot.git diff --git a/tools/imximage.c b/tools/imximage.c index 8e81bdb9c4..03a7716673 100644 --- a/tools/imximage.c +++ b/tools/imximage.c @@ -47,10 +47,12 @@ static table_entry_t imximage_cmds[] = { * this is needed to set the correct flash offset */ static table_entry_t imximage_bootops[] = { - {FLASH_OFFSET_SPI, "spi", "SPI Flash", }, + {FLASH_OFFSET_ONENAND, "onenand", "OneNAND Flash",}, {FLASH_OFFSET_NAND, "nand", "NAND Flash", }, + {FLASH_OFFSET_NOR, "nor", "NOR Flash", }, + {FLASH_OFFSET_SATA, "sata", "SATA Disk", }, {FLASH_OFFSET_SD, "sd", "SD Card", }, - {FLASH_OFFSET_ONENAND, "onenand", "OneNAND Flash",}, + {FLASH_OFFSET_SPI, "spi", "SPI Flash", }, {-1, "", "Invalid", }, }; @@ -59,7 +61,7 @@ static table_entry_t imximage_bootops[] = { */ static table_entry_t imximage_versions[] = { {IMXIMAGE_V1, "", " (i.MX25/35/51 compatible)", }, - {IMXIMAGE_V2, "", " (i.MX53 compatible)", }, + {IMXIMAGE_V2, "", " (i.MX53/6 compatible)", }, {-1, "", " (Invalid)", }, }; @@ -214,8 +216,12 @@ static void set_imx_hdr_v1(struct imx_header *imxhdr, uint32_t dcd_len, dcd_v1_t *dcd_v1 = &hdr_v1->dcd_table; uint32_t base_offset; - /* Set default offset */ - imxhdr->flash_offset = FLASH_OFFSET_STANDARD; + /* Exit if there is no BOOT_FROM field specifying the flash_offset */ + if(imxhdr->flash_offset == FLASH_OFFSET_UNDEFINED) { + fprintf(stderr, "Error: Header v1: No BOOT_FROM tag in %s\n", + params->imagename); + exit(EXIT_FAILURE); + } /* Set magic number */ fhdr_v1->app_code_barker = APP_CODE_BARKER; @@ -251,8 +257,12 @@ static void set_imx_hdr_v2(struct imx_header *imxhdr, uint32_t dcd_len, imx_header_v2_t *hdr_v2 = &imxhdr->header.hdr_v2; flash_header_v2_t *fhdr_v2 = &hdr_v2->fhdr; - /* Set default offset */ - imxhdr->flash_offset = FLASH_OFFSET_STANDARD; + /* Exit if there is no BOOT_FROM field specifying the flash_offset */ + if(imxhdr->flash_offset == FLASH_OFFSET_UNDEFINED) { + fprintf(stderr, "Error: Header v2: No BOOT_FROM tag in %s\n", + params->imagename); + exit(EXIT_FAILURE); + } /* Set magic number */ fhdr_v2->header.tag = IVT_HEADER_TAG; /* 0xD1 */ @@ -523,6 +533,8 @@ static void imximage_set_header(void *ptr, struct stat *sbuf, int ifd, * set up function ptr group to V1 by default. */ imximage_version = IMXIMAGE_V1; + /* Be able to detect if the cfg file has no BOOT_FROM tag */ + imxhdr->flash_offset = FLASH_OFFSET_UNDEFINED; set_hdr_func(imxhdr); /* Parse dcd configuration file */