/*
- * (C) Copyright 2000-2003
+ * (C) Copyright 2000-2004
* DENX Software Engineering
* Wolfgang Denk, wd@denx.de
* All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
*/
#include <errno.h>
} table_entry_t;
table_entry_t arch_name[] = {
- { IH_CPU_INVALID, NULL, "Invalid CPU", },
- { IH_CPU_ALPHA, "alpha", "Alpha", },
- { IH_CPU_ARM, "arm", "ARM", },
- { IH_CPU_I386, "x86", "Intel x86", },
- { IH_CPU_IA64, "ia64", "IA64", },
- { IH_CPU_MIPS, "mips", "MIPS", },
- { IH_CPU_MIPS64, "mips64", "MIPS 64 Bit", },
- { IH_CPU_PPC, "ppc", "PowerPC", },
- { IH_CPU_S390, "s390", "IBM S390", },
- { IH_CPU_SH, "sh", "SuperH", },
- { IH_CPU_SPARC, "sparc", "SPARC", },
- { IH_CPU_SPARC64, "sparc64", "SPARC 64 Bit", },
- { IH_CPU_M68K, "m68k", "MC68000", },
- { -1, "", "", },
+ { IH_CPU_INVALID, NULL, "Invalid CPU", },
+ { IH_CPU_ALPHA, "alpha", "Alpha", },
+ { IH_CPU_ARM, "arm", "ARM", },
+ { IH_CPU_I386, "x86", "Intel x86", },
+ { IH_CPU_IA64, "ia64", "IA64", },
+ { IH_CPU_M68K, "m68k", "MC68000", },
+ { IH_CPU_MICROBLAZE, "microblaze", "MicroBlaze", },
+ { IH_CPU_MIPS, "mips", "MIPS", },
+ { IH_CPU_MIPS64, "mips64", "MIPS 64 Bit", },
+ { IH_CPU_NIOS, "nios", "NIOS", },
+ { IH_CPU_NIOS2, "nios2", "NIOS II", },
+ { IH_CPU_PPC, "ppc", "PowerPC", },
+ { IH_CPU_S390, "s390", "IBM S390", },
+ { IH_CPU_SH, "sh", "SuperH", },
+ { IH_CPU_SPARC, "sparc", "SPARC", },
+ { IH_CPU_SPARC64, "sparc64", "SPARC 64 Bit", },
+ { IH_CPU_BLACKFIN, "blackfin", "Blackfin", },
+ { -1, "", "", },
};
table_entry_t os_name[] = {
{ IH_OS_INVALID, NULL, "Invalid OS", },
- { IH_OS_OPENBSD, "openbsd", "OpenBSD", },
- { IH_OS_NETBSD, "netbsd", "NetBSD", },
- { IH_OS_FREEBSD, "freebsd", "FreeBSD", },
{ IH_OS_4_4BSD, "4_4bsd", "4_4BSD", },
- { IH_OS_LINUX, "linux", "Linux", },
- { IH_OS_SVR4, "svr4", "SVR4", },
+ { IH_OS_ARTOS, "artos", "ARTOS", },
+ { IH_OS_DELL, "dell", "Dell", },
{ IH_OS_ESIX, "esix", "Esix", },
- { IH_OS_SOLARIS, "solaris", "Solaris", },
+ { IH_OS_FREEBSD, "freebsd", "FreeBSD", },
{ IH_OS_IRIX, "irix", "Irix", },
- { IH_OS_SCO, "sco", "SCO", },
- { IH_OS_DELL, "dell", "Dell", },
- { IH_OS_NCR, "ncr", "NCR", },
+ { IH_OS_LINUX, "linux", "Linux", },
{ IH_OS_LYNXOS, "lynxos", "LynxOS", },
- { IH_OS_VXWORKS, "vxworks", "VxWorks", },
+ { IH_OS_NCR, "ncr", "NCR", },
+ { IH_OS_NETBSD, "netbsd", "NetBSD", },
+ { IH_OS_OPENBSD, "openbsd", "OpenBSD", },
{ IH_OS_PSOS, "psos", "pSOS", },
{ IH_OS_QNX, "qnx", "QNX", },
- { IH_OS_U_BOOT, "u-boot", "U-Boot", },
{ IH_OS_RTEMS, "rtems", "RTEMS", },
- { IH_OS_ARTOS, "artos", "ARTOS", },
+ { IH_OS_SCO, "sco", "SCO", },
+ { IH_OS_SOLARIS, "solaris", "Solaris", },
+ { IH_OS_SVR4, "svr4", "SVR4", },
+ { IH_OS_U_BOOT, "u-boot", "U-Boot", },
+ { IH_OS_VXWORKS, "vxworks", "VxWorks", },
{ -1, "", "", },
};
table_entry_t type_name[] = {
{ IH_TYPE_INVALID, NULL, "Invalid Image", },
- { IH_TYPE_STANDALONE, "standalone", "Standalone Program", },
+ { IH_TYPE_FILESYSTEM, "filesystem", "Filesystem Image", },
+ { IH_TYPE_FIRMWARE, "firmware", "Firmware", },
{ IH_TYPE_KERNEL, "kernel", "Kernel Image", },
- { IH_TYPE_RAMDISK, "ramdisk", "RAMDisk Image", },
{ IH_TYPE_MULTI, "multi", "Multi-File Image", },
- { IH_TYPE_FIRMWARE, "firmware", "Firmware", },
+ { IH_TYPE_RAMDISK, "ramdisk", "RAMDisk Image", },
{ IH_TYPE_SCRIPT, "script", "Script", },
- { IH_TYPE_FILESYSTEM, "filesystem", "Filesystem Image", },
+ { IH_TYPE_STANDALONE, "standalone", "Standalone Program", },
{ -1, "", "", },
};
table_entry_t comp_name[] = {
{ IH_COMP_NONE, "none", "uncompressed", },
- { IH_COMP_GZIP, "gzip", "gzip compressed", },
{ IH_COMP_BZIP2, "bzip2", "bzip2 compressed", },
+ { IH_COMP_GZIP, "gzip", "gzip compressed", },
{ -1, "", "", },
};
*/
if (xflag) {
if (ep != addr + sizeof(image_header_t)) {
- fprintf (stderr, "%s: For XIP, the entry point must be the load addr + %lu\n",
+ fprintf (stderr,
+ "%s: For XIP, the entry point must be the load addr + %lu\n",
cmdname,
(unsigned long)sizeof(image_header_t));
exit (EXIT_FAILURE);
if (crc32 (0, data, len) != checksum) {
fprintf (stderr,
- "*** Warning: \"%s\" has bad header checksum!\n",
- imagefile);
+ "%s: ERROR: \"%s\" has bad header checksum!\n",
+ cmdname, imagefile);
+ exit (EXIT_FAILURE);
}
data = (char *)(ptr + sizeof(image_header_t));
if (crc32 (0, data, len) != ntohl(hdr->ih_dcrc)) {
fprintf (stderr,
- "*** Warning: \"%s\" has corrupted data!\n",
- imagefile);
+ "%s: ERROR: \"%s\" has corrupted data!\n",
+ cmdname, imagefile);
+ exit (EXIT_FAILURE);
}
/* for multi-file images we need the data part, too */
if (opt_type == IH_TYPE_MULTI || opt_type == IH_TYPE_SCRIPT) {
char *file = datafile;
- unsigned long size;
+ uint32_t size;
for (;;) {
char *sep = NULL;
{
fprintf (stderr, "Usage: %s -l image\n"
" -l ==> list image header information\n"
- " %s -A arch -O os -T type -C comp "
+ " %s [-x] -A arch -O os -T type -C comp "
"-a addr -e ep -n name -d data_file[:data_file...] image\n",
cmdname, cmdname);
fprintf (stderr, " -A ==> set architecture to 'arch'\n"