Make sure that argv[] argument pointers are not modified.

The hush shell dynamically allocates (and re-allocates) memory for the
argument strings in the "char *argv[]" argument vector passed to
commands.  Any code that modifies these pointers will cause serious
corruption of the malloc data structures and crash U-Boot, so make
sure the compiler can check that no such modifications are being done
by changing the code into "char * const argv[]".

This modification is the result of debugging a strange crash caused
after adding a new command, which used the following argument
processing code which has been working perfectly fine in all Unix
systems since version 6 - but not so in U-Boot:

int main (int argc, char **argv)
{
	while (--argc > 0 && **++argv == '-') {
/* ====> */	while (*++*argv) {
			switch (**argv) {
			case 'd':
				debug++;
				break;
			...
			default:
				usage ();
			}
		}
	}
	...
}

The line marked "====>" will corrupt the malloc data structures and
usually cause U-Boot to crash when the next command gets executed by
the shell.  With the modification, the compiler will prevent this with
an
	error: increment of read-only location '*argv'

N.B.: The code above can be trivially rewritten like this:

	while (--argc > 0 && **++argv == '-') {
		char *arg = *argv;
		while (*++arg) {
			switch (*arg) {
			...

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>
diff --git a/common/cmd_ambapp.c b/common/cmd_ambapp.c
index bb20ab5..283c433 100644
--- a/common/cmd_ambapp.c
+++ b/common/cmd_ambapp.c
@@ -223,7 +223,7 @@
 	printf("   irq: %-2d (ver: %d)\n", irq, ver);
 }
 
-int do_ambapp_print(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_ambapp_print(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 
 	/* Print AHB Masters */
diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c
index 710abdf..fbe73f1 100644
--- a/common/cmd_bdinfo.c
+++ b/common/cmd_bdinfo.c
@@ -42,7 +42,7 @@
 #if defined(CONFIG_PPC)
 static void print_str(const char *, const char *);
 
-int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	bd_t *bd = gd->bd;
 	char buf[32];
@@ -122,7 +122,7 @@
 
 #elif defined(CONFIG_NIOS2)
 
-int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	bd_t *bd = gd->bd;
 
@@ -149,7 +149,7 @@
 
 #elif defined(CONFIG_MICROBLAZE)
 
-int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	bd_t *bd = gd->bd;
 	print_num ("mem start      ",	(ulong)bd->bi_memstart);
@@ -171,7 +171,7 @@
 
 #elif defined(CONFIG_SPARC)
 
-int do_bdinfo(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_bdinfo(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	bd_t *bd = gd->bd;
 
@@ -206,7 +206,7 @@
 
 static void print_str(const char *, const char *);
 
-int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	bd_t *bd = gd->bd;
 	char buf[32];
@@ -256,7 +256,7 @@
 
 static void print_str(const char *, const char *);
 
-int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	bd_t *bd = gd->bd;
 	char buf[32];
@@ -284,7 +284,7 @@
 
 #elif defined(CONFIG_MIPS)
 
-int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	bd_t *bd = gd->bd;
 
@@ -324,7 +324,7 @@
 
 #elif defined(CONFIG_ARM)
 
-int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_bdinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	int i;
 	bd_t *bd = gd->bd;
diff --git a/common/cmd_bedbug.c b/common/cmd_bedbug.c
index 8be1c25..d01ee19 100644
--- a/common/cmd_bedbug.c
+++ b/common/cmd_bedbug.c
@@ -73,7 +73,7 @@
  * Entry point from the interpreter to the disassembler.  Repeated calls
  * will resume from the last disassembled address.
  * ====================================================================== */
-int do_bedbug_dis (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_bedbug_dis (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	ulong addr;		/* Address to start disassembly from    */
 	ulong len;		/* # of instructions to disassemble     */
@@ -115,7 +115,7 @@
  * instructions in consecutive memory locations until a '.' (period) is
  * entered on a line by itself.
  * ====================================================================== */
-int do_bedbug_asm (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_bedbug_asm (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	long mem_addr;		/* Address to assemble into     */
 	unsigned long instr;	/* Machine code for text        */
@@ -167,7 +167,7 @@
  * CPU-specific break point set routine.
  * ====================================================================== */
 
-int do_bedbug_break (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_bedbug_break (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	/* -------------------------------------------------- */
 	if (bug_ctx.do_break)
@@ -263,7 +263,7 @@
  * stopped flag in the context so that the breakpoint routine will
  * return.
  * ====================================================================== */
-int do_bedbug_continue (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_bedbug_continue (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	/* -------------------------------------------------- */
 
@@ -286,7 +286,7 @@
  * the address passes control to the CPU-specific set breakpoint routine
  * for the current breakpoint number.
  * ====================================================================== */
-int do_bedbug_step (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_bedbug_step (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	unsigned long addr;	/* Address to stop at */
 
@@ -317,7 +317,7 @@
  * the address passes control to the CPU-specific set breakpoint routine
  * for the current breakpoint number.
  * ====================================================================== */
-int do_bedbug_next (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_bedbug_next (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	unsigned long addr;	/* Address to stop at */
 
@@ -346,7 +346,7 @@
  * Interpreter command to print the current stack.  This assumes an EABI
  * architecture, so it starts with GPR R1 and works back up the stack.
  * ====================================================================== */
-int do_bedbug_stack (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_bedbug_stack (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	unsigned long sp;	/* Stack pointer                */
 	unsigned long func;	/* LR from stack                */
@@ -391,7 +391,7 @@
  * Interpreter command to dump the registers.  Calls the CPU-specific
  * show registers routine.
  * ====================================================================== */
-int do_bedbug_rdump (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_bedbug_rdump (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	/* -------------------------------------------------- */
 
diff --git a/common/cmd_bmp.c b/common/cmd_bmp.c
index 583b009..5ec798c 100644
--- a/common/cmd_bmp.c
+++ b/common/cmd_bmp.c
@@ -90,7 +90,7 @@
 }
 #endif
 
-static int do_bmp_info(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+static int do_bmp_info(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	ulong addr;
 
@@ -109,7 +109,7 @@
 	return (bmp_info(addr));
 }
 
-static int do_bmp_display(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+static int do_bmp_display(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	ulong addr;
 	int x = 0, y = 0;
@@ -149,7 +149,7 @@
  * Return:      None
  *
  */
-static int do_bmp(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+static int do_bmp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	cmd_tbl_t *c;
 
diff --git a/common/cmd_boot.c b/common/cmd_boot.c
index bfc1db2..9ccc8c7 100644
--- a/common/cmd_boot.c
+++ b/common/cmd_boot.c
@@ -30,12 +30,12 @@
 
 /* Allow ports to override the default behavior */
 __attribute__((weak))
-unsigned long do_go_exec (ulong (*entry)(int, char *[]), int argc, char *argv[])
+unsigned long do_go_exec (ulong (*entry)(int, char * const []), int argc, char * const argv[])
 {
 	return entry (argc, argv);
 }
 
-int do_go (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_go (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	ulong	addr, rc;
 	int     rcode = 0;
@@ -69,7 +69,7 @@
 	"      passing 'arg' as arguments"
 );
 
-extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
 
 U_BOOT_CMD(
 	reset, 1, 0,	do_reset,
diff --git a/common/cmd_bootldr.c b/common/cmd_bootldr.c
index b2a8b0e..c7f14d9 100644
--- a/common/cmd_bootldr.c
+++ b/common/cmd_bootldr.c
@@ -142,7 +142,7 @@
  *   to also add booting from SPI, or TWI, but this function does
  *   not currently support that.
  */
-int do_bootldr(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_bootldr(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	void *addr;
 
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 74ff205..bf77fb4 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -78,7 +78,7 @@
 #if defined(CONFIG_CMD_IMLS)
 #include <flash.h>
 extern flash_info_t flash_info[]; /* info for FLASH chips */
-static int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+static int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
 #endif
 
 #ifdef CONFIG_SILENT_CONSOLE
@@ -90,9 +90,9 @@
 static int fit_check_kernel (const void *fit, int os_noffset, int verify);
 #endif
 
-static void *boot_get_kernel (cmd_tbl_t *cmdtp, int flag,int argc, char *argv[],
+static void *boot_get_kernel (cmd_tbl_t *cmdtp, int flag,int argc, char * const argv[],
 		bootm_headers_t *images, ulong *os_data, ulong *os_len);
-extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
 
 /*
  *  Continue booting an OS image; caller already has:
@@ -102,7 +102,7 @@
  *  - loaded (first part of) image to header load address,
  *  - disabled interrupts.
  */
-typedef int boot_os_fn (int flag, int argc, char *argv[],
+typedef int boot_os_fn (int flag, int argc, char * const argv[],
 			bootm_headers_t *images); /* pointers to os/initrd/fdt */
 
 #ifdef CONFIG_BOOTM_LINUX
@@ -121,8 +121,8 @@
 #if defined(CONFIG_CMD_ELF)
 static boot_os_fn do_bootm_vxworks;
 static boot_os_fn do_bootm_qnxelf;
-int do_bootvx (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
-int do_bootelf (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+int do_bootvx (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
+int do_bootelf (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
 #endif
 #if defined(CONFIG_INTEGRITY)
 static boot_os_fn do_bootm_integrity;
@@ -206,7 +206,7 @@
 #endif
 }
 
-static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	void		*os_hdr;
 	int		ret;
@@ -438,10 +438,10 @@
 	return 0;
 }
 
-static int bootm_start_standalone(ulong iflag, int argc, char *argv[])
+static int bootm_start_standalone(ulong iflag, int argc, char * const argv[])
 {
 	char  *s;
-	int   (*appl)(int, char *[]);
+	int   (*appl)(int, char * const []);
 
 	/* Don't start if "autostart" is set to "no" */
 	if (((s = getenv("autostart")) != NULL) && (strcmp(s, "no") == 0)) {
@@ -450,7 +450,7 @@
 		setenv("filesize", buf);
 		return 0;
 	}
-	appl = (int (*)(int, char *[]))ntohl(images.ep);
+	appl = (int (*)(int, char * const []))ntohl(images.ep);
 	(*appl)(argc-1, &argv[1]);
 
 	return 0;
@@ -473,7 +473,7 @@
 	U_BOOT_CMD_MKENT(go, 0, 1, (void *)BOOTM_STATE_OS_GO, "", ""),
 };
 
-int do_bootm_subcommand (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_bootm_subcommand (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	int ret = 0;
 	int state;
@@ -576,7 +576,7 @@
 /* bootm - boot application image from image in memory */
 /*******************************************************************/
 
-int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	ulong		iflag;
 	ulong		load_end = 0;
@@ -811,7 +811,7 @@
  *     pointer to image header if valid image was found, plus kernel start
  *     address and length, otherwise NULL
  */
-static void *boot_get_kernel (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
+static void *boot_get_kernel (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
 		bootm_headers_t *images, ulong *os_data, ulong *os_len)
 {
 	image_header_t	*hdr;
@@ -1012,7 +1012,7 @@
 /* bootd - boot default image */
 /*******************************************************************/
 #if defined(CONFIG_CMD_BOOTD)
-int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	int rcode = 0;
 
@@ -1047,7 +1047,7 @@
 /* iminfo - print header info for a requested image */
 /*******************************************************************/
 #if defined(CONFIG_CMD_IMI)
-int do_iminfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_iminfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	int	arg;
 	ulong	addr;
@@ -1134,7 +1134,7 @@
 /* imls - list all images found in flash */
 /*******************************************************************/
 #if defined(CONFIG_CMD_IMLS)
-int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_imls (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	flash_info_t *info;
 	int i, j;
@@ -1237,7 +1237,7 @@
 /*******************************************************************/
 
 #ifdef CONFIG_BOOTM_NETBSD
-static int do_bootm_netbsd (int flag, int argc, char *argv[],
+static int do_bootm_netbsd (int flag, int argc, char * const argv[],
 			    bootm_headers_t *images)
 {
 	void (*loader)(bd_t *, image_header_t *, char *, char *);
@@ -1325,7 +1325,7 @@
 #endif /* CONFIG_BOOTM_NETBSD*/
 
 #ifdef CONFIG_LYNXKDI
-static int do_bootm_lynxkdi (int flag, int argc, char *argv[],
+static int do_bootm_lynxkdi (int flag, int argc, char * const argv[],
 			     bootm_headers_t *images)
 {
 	image_header_t *hdr = &images->legacy_hdr_os_copy;
@@ -1347,7 +1347,7 @@
 #endif /* CONFIG_LYNXKDI */
 
 #ifdef CONFIG_BOOTM_RTEMS
-static int do_bootm_rtems (int flag, int argc, char *argv[],
+static int do_bootm_rtems (int flag, int argc, char * const argv[],
 			   bootm_headers_t *images)
 {
 	void (*entry_point)(bd_t *);
@@ -1380,7 +1380,7 @@
 #endif /* CONFIG_BOOTM_RTEMS */
 
 #if defined(CONFIG_CMD_ELF)
-static int do_bootm_vxworks (int flag, int argc, char *argv[],
+static int do_bootm_vxworks (int flag, int argc, char * const argv[],
 			     bootm_headers_t *images)
 {
 	char str[80];
@@ -1402,7 +1402,7 @@
 	return 1;
 }
 
-static int do_bootm_qnxelf(int flag, int argc, char *argv[],
+static int do_bootm_qnxelf(int flag, int argc, char * const argv[],
 			    bootm_headers_t *images)
 {
 	char *local_args[2];
@@ -1428,7 +1428,7 @@
 #endif
 
 #ifdef CONFIG_INTEGRITY
-static int do_bootm_integrity (int flag, int argc, char *argv[],
+static int do_bootm_integrity (int flag, int argc, char * const argv[],
 			   bootm_headers_t *images)
 {
 	void (*entry_point)(void);
diff --git a/common/cmd_cache.c b/common/cmd_cache.c
index 1202258..be87b5c 100644
--- a/common/cmd_cache.c
+++ b/common/cmd_cache.c
@@ -29,7 +29,7 @@
 
 static int on_off (const char *);
 
-int do_icache ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_icache ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	switch (argc) {
 	case 2:			/* on / off	*/
@@ -55,7 +55,7 @@
 	return 0;
 }
 
-int do_dcache ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_dcache ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	switch (argc) {
 	case 2:			/* on / off	*/
diff --git a/common/cmd_console.c b/common/cmd_console.c
index 178fbfe..d8cad6b 100644
--- a/common/cmd_console.c
+++ b/common/cmd_console.c
@@ -29,7 +29,7 @@
 #include <stdio_dev.h>
 
 extern void _do_coninfo (void);
-int do_coninfo (cmd_tbl_t * cmd, int flag, int argc, char *argv[])
+int do_coninfo (cmd_tbl_t * cmd, int flag, int argc, char * const argv[])
 {
 	int l;
 	struct list_head *list = stdio_get_list();
diff --git a/common/cmd_cplbinfo.c b/common/cmd_cplbinfo.c
index 1a044d2..fc6abff 100644
--- a/common/cmd_cplbinfo.c
+++ b/common/cmd_cplbinfo.c
@@ -42,7 +42,7 @@
 /*
  * display current instruction and data cplb tables
  */
-int do_cplbinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_cplbinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	printf("%s CPLB table [%08x]:\n", "Instruction", *(uint32_t *)DMEM_CONTROL);
 	show_cplb_table((uint32_t *)ICPLB_ADDR0, (uint32_t *)ICPLB_DATA0);
diff --git a/common/cmd_cramfs.c b/common/cmd_cramfs.c
index 55e2d36..ab10450 100644
--- a/common/cmd_cramfs.c
+++ b/common/cmd_cramfs.c
@@ -98,7 +98,7 @@
  * @param argv arguments list
  * @return 0 on success, 1 otherwise
  */
-int do_cramfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_cramfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	char *filename;
 	int size;
@@ -163,7 +163,7 @@
  * @param argv arguments list
  * @return 0 on success, 1 otherwise
  */
-int do_cramfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_cramfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	char *filename = "/";
 	int ret;
diff --git a/common/cmd_dataflash_mmc_mux.c b/common/cmd_dataflash_mmc_mux.c
index 97e303e..de4e676 100644
--- a/common/cmd_dataflash_mmc_mux.c
+++ b/common/cmd_dataflash_mmc_mux.c
@@ -26,7 +26,7 @@
 
 static int mmc_nspi (const char *);
 
-int do_dataflash_mmc_mux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_dataflash_mmc_mux (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	switch (argc) {
 	case 2:			/* on / off	*/
diff --git a/common/cmd_date.c b/common/cmd_date.c
index 3141a39..50b4240 100644
--- a/common/cmd_date.c
+++ b/common/cmd_date.c
@@ -43,7 +43,7 @@
 
 int mk_date (char *, struct rtc_time *);
 
-int do_date (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_date (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	struct rtc_time tm;
 	int rcode = 0;
diff --git a/common/cmd_dcr.c b/common/cmd_dcr.c
index 4f23b8d..45de8cd 100644
--- a/common/cmd_dcr.c
+++ b/common/cmd_dcr.c
@@ -36,7 +36,7 @@
  * Interpreter command to retrieve an AMCC PPC 4xx Device Control Register
  * =======================================================================
  */
-int do_getdcr ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[] )
+int do_getdcr ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[] )
 {
 	unsigned short dcrn;	/* Device Control Register Num */
 	unsigned long value;	/* DCR's value */
@@ -63,7 +63,7 @@
  * Interpreter command to set an AMCC PPC 4xx Device Control Register
  * ======================================================================
 */
-int do_setdcr (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_setdcr (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	unsigned short dcrn;	/* Device Control Register Num */
 	unsigned long value;
@@ -110,7 +110,7 @@
  * Device Control Register inderect addressing.
  * =======================================================================
  */
-int do_getidcr (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_getidcr (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	unsigned short adr_dcrn;	/* Device Control Register Num for Address */
 	unsigned short dat_dcrn;	/* Device Control Register Num for Data */
@@ -166,7 +166,7 @@
  * Device Control Register inderect addressing.
  * =======================================================================
  */
-int do_setidcr (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_setidcr (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	unsigned short adr_dcrn;	/* Device Control Register Num for Address */
 	unsigned short dat_dcrn;	/* Device Control Register Num for Data */
diff --git a/common/cmd_df.c b/common/cmd_df.c
index 7f957fe..6a08666 100644
--- a/common/cmd_df.c
+++ b/common/cmd_df.c
@@ -6,7 +6,7 @@
 #include <common.h>
 #include <df.h>
 
-static int do_df(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+static int do_df(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	const char *cmd;
 
diff --git a/common/cmd_diag.c b/common/cmd_diag.c
index 0436c49..317ea66 100644
--- a/common/cmd_diag.c
+++ b/common/cmd_diag.c
@@ -28,7 +28,7 @@
 #include <command.h>
 #include <post.h>
 
-int do_diag (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_diag (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	unsigned int i;
 
diff --git a/common/cmd_display.c b/common/cmd_display.c
index 3422395..6c11aa6 100644
--- a/common/cmd_display.c
+++ b/common/cmd_display.c
@@ -30,7 +30,7 @@
 #define CWORD_CLEAR	0x80
 #define CLEAR_DELAY	(110 * 2)
 
-int do_display (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_display (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	int i;
 	int pos;
diff --git a/common/cmd_dtt.c b/common/cmd_dtt.c
index 3cfd36e..3388e43 100644
--- a/common/cmd_dtt.c
+++ b/common/cmd_dtt.c
@@ -28,7 +28,7 @@
 #include <dtt.h>
 #include <i2c.h>
 
-int do_dtt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_dtt (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	int i;
 	unsigned char sensors[] = CONFIG_DTT_SENSORS;
diff --git a/common/cmd_echo.c b/common/cmd_echo.c
index 3ec4d48..43a6da5 100644
--- a/common/cmd_echo.c
+++ b/common/cmd_echo.c
@@ -24,7 +24,7 @@
 #include <common.h>
 #include <command.h>
 
-int do_echo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_echo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	int i;
 	int putnl = 1;
diff --git a/common/cmd_eeprom.c b/common/cmd_eeprom.c
index 519b510..129162c 100644
--- a/common/cmd_eeprom.c
+++ b/common/cmd_eeprom.c
@@ -60,7 +60,7 @@
 /* ------------------------------------------------------------------------- */
 
 #if defined(CONFIG_CMD_EEPROM)
-int do_eeprom ( cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_eeprom ( cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	const char *const fmt =
 		"\nEEPROM @0x%lX %s: addr %08lx  off %04lx  count %ld ... ";
diff --git a/common/cmd_elf.c b/common/cmd_elf.c
index 63f6fe7..104d6e6 100644
--- a/common/cmd_elf.c
+++ b/common/cmd_elf.c
@@ -29,7 +29,8 @@
 
 /* Allow ports to override the default behavior */
 __attribute__((weak))
-unsigned long do_bootelf_exec (ulong (*entry)(int, char *[]), int argc, char *argv[])
+unsigned long do_bootelf_exec (ulong (*entry)(int, char * const[]),
+			       int argc, char * const argv[])
 {
 	unsigned long ret;
 
@@ -56,7 +57,7 @@
 /* ======================================================================
  * Interpreter command to boot an arbitrary ELF image from memory.
  * ====================================================================== */
-int do_bootelf (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_bootelf (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	unsigned long addr;		/* Address of the ELF image     */
 	unsigned long rc;		/* Return value from user code  */
@@ -93,7 +94,7 @@
  * be either an ELF image or a raw binary.  Will attempt to setup the
  * bootline and other parameters correctly.
  * ====================================================================== */
-int do_bootvx (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_bootvx (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	unsigned long addr;		/* Address of image            */
 	unsigned long bootaddr;		/* Address to put the bootline */
diff --git a/common/cmd_exit.c b/common/cmd_exit.c
index ed876d8..f3fc8f5 100644
--- a/common/cmd_exit.c
+++ b/common/cmd_exit.c
@@ -24,7 +24,7 @@
 #include <common.h>
 #include <command.h>
 
-int do_exit(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_exit(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	int r;
 
diff --git a/common/cmd_ext2.c b/common/cmd_ext2.c
index b7e4048..49021cd 100644
--- a/common/cmd_ext2.c
+++ b/common/cmd_ext2.c
@@ -56,7 +56,7 @@
 #define PRINTF(fmt,args...)
 #endif
 
-int do_ext2ls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_ext2ls (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	char *filename = "/";
 	int dev=0;
@@ -123,7 +123,7 @@
 /******************************************************************************
  * Ext2fs boot command intepreter. Derived from diskboot
  */
-int do_ext2load (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_ext2load (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	char *filename = NULL;
 	char *ep;
diff --git a/common/cmd_fat.c b/common/cmd_fat.c
index f3089a2..ede7308 100644
--- a/common/cmd_fat.c
+++ b/common/cmd_fat.c
@@ -33,7 +33,7 @@
 #include <fat.h>
 
 
-int do_fat_fsload (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_fat_fsload (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	long size;
 	unsigned long offset;
@@ -94,7 +94,7 @@
 	"      to address 'addr' from dos filesystem"
 );
 
-int do_fat_ls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_fat_ls (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	char *filename = "/";
 	int ret;
@@ -141,7 +141,7 @@
 	"    - list files from 'dev' on 'interface' in a 'directory'"
 );
 
-int do_fat_fsinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_fat_fsinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	int dev=0;
 	int part=1;
@@ -227,7 +227,7 @@
 }
 
 int
-do_fat_dump (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
+do_fat_dump (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char * const argv[])
 {
 	__u8 block[1024];
 	int ret;
diff --git a/common/cmd_fdc.c b/common/cmd_fdc.c
index 4c16d19..486d5d4 100644
--- a/common/cmd_fdc.c
+++ b/common/cmd_fdc.c
@@ -713,7 +713,7 @@
 /****************************************************************************
  * main routine do_fdcboot
  */
-int do_fdcboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_fdcboot (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	FD_GEO_STRUCT *pFG = (FD_GEO_STRUCT *)floppy_type;
 	FDC_COMMAND_STRUCT *pCMD = &cmd;
diff --git a/common/cmd_fdos.c b/common/cmd_fdos.c
index 3cc6586..00f7e88 100644
--- a/common/cmd_fdos.c
+++ b/common/cmd_fdos.c
@@ -35,7 +35,7 @@
  * do_fdosboot --
  *-----------------------------------------------------------------------------
  */
-int do_fdosboot(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_fdosboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
     char *name;
     char *ep;
@@ -115,7 +115,7 @@
  * do_fdosls --
  *-----------------------------------------------------------------------------
  */
-int do_fdosls(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_fdosls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
     char *path = "";
     int drive = CONFIG_SYS_FDC_DRIVE_NUMBER;
diff --git a/common/cmd_fdt.c b/common/cmd_fdt.c
index 5df79ae..cd4c6de 100644
--- a/common/cmd_fdt.c
+++ b/common/cmd_fdt.c
@@ -42,7 +42,7 @@
 DECLARE_GLOBAL_DATA_PTR;
 
 static int fdt_valid(void);
-static int fdt_parse_prop(char **newval, int count, char *data, int *len);
+static int fdt_parse_prop(char *const*newval, int count, char *data, int *len);
 static int fdt_print(const char *pathp, char *prop, int depth);
 
 /*
@@ -63,7 +63,7 @@
 /*
  * Flattened Device Tree command, see the help for parameter definitions.
  */
-int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_fdt (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	if (argc < 2) {
 		cmd_usage(cmdtp);
@@ -515,7 +515,7 @@
  * data: A bytestream to be placed in the property
  * len: The length of the resulting bytestream
  */
-static int fdt_parse_prop(char **newval, int count, char *data, int *len)
+static int fdt_parse_prop(char * const *newval, int count, char *data, int *len)
 {
 	char *cp;		/* temporary char pointer */
 	char *newp;		/* temporary newval char pointer */
diff --git a/common/cmd_flash.c b/common/cmd_flash.c
index 6361c4e..5d8fb7a 100644
--- a/common/cmd_flash.c
+++ b/common/cmd_flash.c
@@ -287,7 +287,7 @@
 }
 #endif /* CONFIG_SYS_NO_FLASH */
 
-int do_flinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_flinfo ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 #ifndef CONFIG_SYS_NO_FLASH
 	ulong bank;
@@ -319,7 +319,7 @@
 	return 0;
 }
 
-int do_flerase (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_flerase (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 #ifndef CONFIG_SYS_NO_FLASH
 	flash_info_t *info;
@@ -461,7 +461,7 @@
 }
 #endif /* CONFIG_SYS_NO_FLASH */
 
-int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 #ifndef CONFIG_SYS_NO_FLASH
 	flash_info_t *info;
diff --git a/common/cmd_fpga.c b/common/cmd_fpga.c
index 2e017b8..ddc7a05 100644
--- a/common/cmd_fpga.c
+++ b/common/cmd_fpga.c
@@ -156,7 +156,7 @@
  * If there is no data addr field, the fpgadata environment variable is used.
  * The info command requires no data address field.
  */
-int do_fpga (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_fpga (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	int op, dev = FPGA_INVALID_DEVICE;
 	size_t data_size = 0;
diff --git a/common/cmd_help.c b/common/cmd_help.c
index e860dfb..8c8178e 100644
--- a/common/cmd_help.c
+++ b/common/cmd_help.c
@@ -24,7 +24,7 @@
 #include <common.h>
 #include <command.h>
 
-int do_help(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_help(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	return _do_help(&__u_boot_cmd_start,
 			&__u_boot_cmd_end - &__u_boot_cmd_start,
diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c
index 8b9c2c9..fb9d3b0 100644
--- a/common/cmd_i2c.c
+++ b/common/cmd_i2c.c
@@ -178,7 +178,7 @@
  *	i2c read {i2c_chip} {devaddr}{.0, .1, .2} {len} {memaddr}
  */
 
-static int do_i2c_read ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+static int do_i2c_read ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	u_char	chip;
 	uint	devaddr, alen, length;
@@ -226,7 +226,7 @@
  * Syntax:
  *	i2c md {i2c_chip} {addr}{.0, .1, .2} {len}
  */
-static int do_i2c_md ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+static int do_i2c_md ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	u_char	chip;
 	uint	addr, alen, length;
@@ -324,7 +324,7 @@
  * Syntax:
  *	i2c mw {i2c_chip} {addr}{.0, .1, .2} {data} [{count}]
  */
-static int do_i2c_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+static int do_i2c_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	uchar	chip;
 	ulong	addr;
@@ -388,7 +388,7 @@
  * Syntax:
  *	i2c crc32 {i2c_chip} {addr}{.0, .1, .2} {count}
  */
-static int do_i2c_crc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+static int do_i2c_crc (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	uchar	chip;
 	ulong	addr;
@@ -452,7 +452,7 @@
  */
 
 static int
-mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char *argv[])
+mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const argv[])
 {
 	uchar	chip;
 	ulong	addr;
@@ -575,7 +575,7 @@
  * Syntax:
  *	i2c probe {addr}{.0, .1, .2}
  */
-static int do_i2c_probe (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+static int do_i2c_probe (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	int j;
 #if defined(CONFIG_SYS_I2C_NOPROBES)
@@ -619,7 +619,7 @@
  *	{length} - Number of bytes to read
  *	{delay}  - A DECIMAL number and defaults to 1000 uSec
  */
-static int do_i2c_loop(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+static int do_i2c_loop(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	u_char	chip;
 	ulong	alen;
@@ -731,7 +731,7 @@
  * Syntax:
  *	i2c sdram {i2c_chip}
  */
-static int do_sdram (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+static int do_sdram (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	enum { unknown, EDO, SDRAM, DDR2 } type;
 
@@ -1208,7 +1208,7 @@
 #endif
 
 #if defined(CONFIG_I2C_MUX)
-static int do_i2c_add_bus(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+static int do_i2c_add_bus(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	int ret=0;
 
@@ -1239,7 +1239,7 @@
 #endif  /* CONFIG_I2C_MUX */
 
 #if defined(CONFIG_I2C_MULTI_BUS)
-static int do_i2c_bus_num(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+static int do_i2c_bus_num(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	int bus_idx, ret=0;
 
@@ -1257,7 +1257,7 @@
 }
 #endif  /* CONFIG_I2C_MULTI_BUS */
 
-static int do_i2c_bus_speed(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+static int do_i2c_bus_speed(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	int speed, ret=0;
 
@@ -1274,17 +1274,17 @@
 	return ret;
 }
 
-static int do_i2c_mm(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+static int do_i2c_mm(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	return mod_i2c_mem (cmdtp, 1, flag, argc, argv);
 }
 
-static int do_i2c_nm(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+static int do_i2c_nm(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	return mod_i2c_mem (cmdtp, 0, flag, argc, argv);
 }
 
-static int do_i2c_reset(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+static int do_i2c_reset(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
 	return 0;
@@ -1312,7 +1312,7 @@
 	U_BOOT_CMD_MKENT(speed, 1, 1, do_i2c_bus_speed, "", ""),
 };
 
-static int do_i2c(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+static int do_i2c(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	cmd_tbl_t *c;
 
diff --git a/common/cmd_ide.c b/common/cmd_ide.c
index 2e9f834..d486697 100644
--- a/common/cmd_ide.c
+++ b/common/cmd_ide.c
@@ -172,7 +172,7 @@
 
 /* ------------------------------------------------------------------------- */
 
-int do_ide (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_ide (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
     int rcode = 0;
 
@@ -346,7 +346,7 @@
     }
 }
 
-int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	char *boot_device = NULL;
 	char *ep;
diff --git a/common/cmd_immap.c b/common/cmd_immap.c
index 37e6058..1f59c1e 100644
--- a/common/cmd_immap.c
+++ b/common/cmd_immap.c
@@ -43,14 +43,14 @@
 DECLARE_GLOBAL_DATA_PTR;
 
 static void
-unimplemented ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+unimplemented ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	printf ("Sorry, but the '%s' command has not been implemented\n",
 		cmdtp->name);
 }
 
 int
-do_siuinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+do_siuinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
 
@@ -81,7 +81,7 @@
 }
 
 int
-do_memcinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+do_memcinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
 
@@ -133,7 +133,7 @@
 }
 
 int
-do_sitinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+do_sitinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	unimplemented (cmdtp, flag, argc, argv);
 	return 0;
@@ -141,7 +141,7 @@
 
 #ifdef CONFIG_8260
 int
-do_icinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+do_icinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	unimplemented (cmdtp, flag, argc, argv);
 	return 0;
@@ -149,7 +149,7 @@
 #endif
 
 int
-do_carinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+do_carinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
 
@@ -233,7 +233,7 @@
 #endif
 
 int
-do_iopinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+do_iopinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
 
@@ -316,7 +316,7 @@
  * use *uint and set the address based on cmd + port
  */
 int
-do_iopset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+do_iopset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	uint rcode = 0;
 	iopin_t iopin;
@@ -431,14 +431,14 @@
 }
 
 int
-do_dmainfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+do_dmainfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	unimplemented (cmdtp, flag, argc, argv);
 	return 0;
 }
 
 int
-do_fccinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+do_fccinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	unimplemented (cmdtp, flag, argc, argv);
 	return 0;
@@ -498,7 +498,7 @@
 }
 
 int
-do_brginfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+do_brginfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
 
@@ -522,7 +522,7 @@
 }
 
 int
-do_i2cinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+do_i2cinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
 
@@ -569,42 +569,42 @@
 }
 
 int
-do_sccinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+do_sccinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	unimplemented (cmdtp, flag, argc, argv);
 	return 0;
 }
 
 int
-do_smcinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+do_smcinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	unimplemented (cmdtp, flag, argc, argv);
 	return 0;
 }
 
 int
-do_spiinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+do_spiinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	unimplemented (cmdtp, flag, argc, argv);
 	return 0;
 }
 
 int
-do_muxinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+do_muxinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	unimplemented (cmdtp, flag, argc, argv);
 	return 0;
 }
 
 int
-do_siinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+do_siinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	unimplemented (cmdtp, flag, argc, argv);
 	return 0;
 }
 
 int
-do_mccinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+do_mccinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	unimplemented (cmdtp, flag, argc, argv);
 	return 0;
diff --git a/common/cmd_irq.c b/common/cmd_irq.c
index 2c7e6bb..4888328 100644
--- a/common/cmd_irq.c
+++ b/common/cmd_irq.c
@@ -24,7 +24,7 @@
 #include <config.h>
 #include <command.h>
 
-int do_interrupts(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_interrupts(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 
 	if (argc != 2) {
@@ -49,7 +49,7 @@
 );
 
 /* Implemented in $(CPU)/interrupts.c */
-int do_irqinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+int do_irqinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
 
 U_BOOT_CMD(
 	irqinfo,    1,    1,     do_irqinfo,
diff --git a/common/cmd_itest.c b/common/cmd_itest.c
index 58c5e7b..e88d6e0 100644
--- a/common/cmd_itest.c
+++ b/common/cmd_itest.c
@@ -160,7 +160,7 @@
 }
 
 /* command line interface to the shell test */
-int do_itest ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[] )
+int do_itest ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[] )
 {
 	int	value, w;
 
diff --git a/common/cmd_jffs2.c b/common/cmd_jffs2.c
index 6799cca..0e7a6b0 100644
--- a/common/cmd_jffs2.c
+++ b/common/cmd_jffs2.c
@@ -485,7 +485,7 @@
  * @param argv arguments list
  * @return 0 on success, 1 otherwise
  */
-int do_jffs2_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_jffs2_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	char *fsname;
 	char *filename;
@@ -549,7 +549,7 @@
  * @param argv arguments list
  * @return 0 on success, 1 otherwise
  */
-int do_jffs2_ls(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_jffs2_ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	char *filename = "/";
 	int ret;
@@ -587,7 +587,7 @@
  * @param argv arguments list
  * @return 0 on success, 1 otherwise
  */
-int do_jffs2_fsinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_jffs2_fsinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	struct part_info *part;
 	char *fsname;
diff --git a/common/cmd_license.c b/common/cmd_license.c
index 85a4871..90fd57e 100644
--- a/common/cmd_license.c
+++ b/common/cmd_license.c
@@ -30,7 +30,7 @@
 #include <malloc.h>
 #include <license.h>
 
-int do_license(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_license(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	char *tok, *dst = malloc(LICENSE_MAX);
 	unsigned long len = LICENSE_MAX;
diff --git a/common/cmd_load.c b/common/cmd_load.c
index d6bbb78..52ed1fa 100644
--- a/common/cmd_load.c
+++ b/common/cmd_load.c
@@ -51,7 +51,7 @@
 /* -------------------------------------------------------------------- */
 
 #if defined(CONFIG_CMD_LOADS)
-int do_load_serial (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_load_serial (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	long offset = 0;
 	ulong addr;
@@ -255,7 +255,7 @@
 
 #if defined(CONFIG_CMD_SAVES)
 
-int do_save_serial (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_save_serial (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	ulong offset = 0;
 	ulong size   = 0;
@@ -433,7 +433,7 @@
 char his_pad_char;   /* pad chars he needs */
 char his_quote;      /* quote chars he'll use */
 
-int do_load_serial_bin (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_load_serial_bin (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	ulong offset = 0;
 	ulong addr;
@@ -1091,7 +1091,7 @@
 /* -------------------------------------------------------------------- */
 
 #if defined(CONFIG_CMD_HWFLOW)
-int do_hwflow (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_hwflow (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	extern int hwflow_onoff(int);
 
diff --git a/common/cmd_log.c b/common/cmd_log.c
index 3653fe1..49deddd 100644
--- a/common/cmd_log.c
+++ b/common/cmd_log.c
@@ -193,7 +193,7 @@
  * Return:      None
  *
  */
-int do_log (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_log (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	char *s;
 	unsigned long i, start, size;
diff --git a/common/cmd_mac.c b/common/cmd_mac.c
index 20403da..1884c2a 100644
--- a/common/cmd_mac.c
+++ b/common/cmd_mac.c
@@ -24,7 +24,7 @@
 #include <common.h>
 #include <command.h>
 
-extern int do_mac(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+extern int do_mac(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
 
 U_BOOT_CMD(
 	mac, 3, 1,  do_mac,
diff --git a/common/cmd_mem.c b/common/cmd_mem.c
index 1839330..bcea399 100644
--- a/common/cmd_mem.c
+++ b/common/cmd_mem.c
@@ -43,7 +43,7 @@
 #define PRINTF(fmt,args...)
 #endif
 
-static int mod_mem(cmd_tbl_t *, int, int, int, char *[]);
+static int mod_mem(cmd_tbl_t *, int, int, int, char * const []);
 
 /* Display values from last command.
  * Memory modify remembered values are different from display memory.
@@ -60,7 +60,7 @@
  *	md{.b, .w, .l} {addr} {len}
  */
 #define DISP_LINE_LEN	16
-int do_mem_md ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_mem_md ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	ulong	addr, length;
 #if defined(CONFIG_HAS_DATAFLASH)
@@ -158,16 +158,16 @@
 	return (rc);
 }
 
-int do_mem_mm ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_mem_mm ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	return mod_mem (cmdtp, 1, flag, argc, argv);
 }
-int do_mem_nm ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_mem_nm ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	return mod_mem (cmdtp, 0, flag, argc, argv);
 }
 
-int do_mem_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_mem_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	ulong	addr, writeval, count;
 	int	size;
@@ -211,7 +211,7 @@
 }
 
 #ifdef CONFIG_MX_CYCLIC
-int do_mem_mdc ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_mem_mdc ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	int i;
 	ulong count;
@@ -240,7 +240,7 @@
 	return 0;
 }
 
-int do_mem_mwc ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_mem_mwc ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	int i;
 	ulong count;
@@ -270,7 +270,7 @@
 }
 #endif /* CONFIG_MX_CYCLIC */
 
-int do_mem_cmp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_mem_cmp (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	ulong	addr1, addr2, count, ngood;
 	int	size;
@@ -355,7 +355,7 @@
 	return rcode;
 }
 
-int do_mem_cp ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_mem_cp ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	ulong	addr, dest, count;
 	int	size;
@@ -463,7 +463,7 @@
 	return 0;
 }
 
-int do_mem_base (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_mem_base (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	if (argc > 1) {
 		/* Set new base address.
@@ -476,7 +476,7 @@
 	return 0;
 }
 
-int do_mem_loop (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_mem_loop (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	ulong	addr, length, i, junk;
 	int	size;
@@ -547,7 +547,7 @@
 }
 
 #ifdef CONFIG_LOOPW
-int do_mem_loopw (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_mem_loopw (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	ulong	addr, length, i, data;
 	int	size;
@@ -626,7 +626,7 @@
  * configured using CONFIG_SYS_ALT_MEMTEST. The complete test loops until
  * interrupted by ctrl-c or by a failure of one of the sub-tests.
  */
-int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	vu_long	*addr, *start, *end;
 	ulong	val;
@@ -984,7 +984,7 @@
  *	nm{.b, .w, .l} {addr}
  */
 static int
-mod_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char *argv[])
+mod_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const argv[])
 {
 	ulong	addr, i;
 	int	nbytes, size;
@@ -1089,7 +1089,7 @@
 
 #ifndef CONFIG_CRC32_VERIFY
 
-int do_mem_crc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_mem_crc (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	ulong addr, length;
 	ulong crc;
@@ -1120,7 +1120,7 @@
 
 #else	/* CONFIG_CRC32_VERIFY */
 
-int do_mem_crc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_mem_crc (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	ulong addr, length;
 	ulong crc;
@@ -1128,7 +1128,7 @@
 	ulong vcrc;
 	int verify;
 	int ac;
-	char **av;
+	char * const *av;
 
 	if (argc < 3) {
   usage:
@@ -1175,7 +1175,7 @@
 #endif	/* CONFIG_CRC32_VERIFY */
 
 #ifdef CONFIG_CMD_MD5SUM
-int do_md5sum(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_md5sum(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	unsigned long addr, len;
 	unsigned int i;
@@ -1200,7 +1200,7 @@
 #endif
 
 #ifdef CONFIG_CMD_SHA1
-int do_sha1sum(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_sha1sum(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	unsigned long addr, len;
 	unsigned int i;
@@ -1225,7 +1225,7 @@
 #endif
 
 #ifdef CONFIG_CMD_UNZIP
-int do_unzip ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_unzip ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	unsigned long src, dst;
 	unsigned long src_len = ~0UL, dst_len = ~0UL;
diff --git a/common/cmd_mfsl.c b/common/cmd_mfsl.c
index b19ad0e..eeef2cd 100644
--- a/common/cmd_mfsl.c
+++ b/common/cmd_mfsl.c
@@ -31,7 +31,7 @@
 #include <command.h>
 #include <asm/asm.h>
 
-int do_frd (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_frd (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	unsigned int fslnum;
 	unsigned int num;
@@ -189,7 +189,7 @@
 	return 0;
 }
 
-int do_fwr (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_fwr (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	unsigned int fslnum;
 	unsigned int num;
@@ -348,7 +348,7 @@
 
 }
 
-int do_rspr (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_rspr (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	unsigned int reg = 0;
 	unsigned int val = 0;
diff --git a/common/cmd_mgdisk.c b/common/cmd_mgdisk.c
index 3ba62f6..c2d5217 100644
--- a/common/cmd_mgdisk.c
+++ b/common/cmd_mgdisk.c
@@ -26,7 +26,7 @@
 
 #include <mg_disk.h>
 
-int do_mg_disk_cmd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_mg_disk_cmd (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	u32 from, to, size;
 
diff --git a/common/cmd_mii.c b/common/cmd_mii.c
index 65e13c3..1619a25 100644
--- a/common/cmd_mii.c
+++ b/common/cmd_mii.c
@@ -292,7 +292,7 @@
 }
 
 /* ---------------------------------------------------------------- */
-int do_mii (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_mii (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	char		op[2];
 	unsigned char	addrlo, addrhi, reglo, reghi;
diff --git a/common/cmd_misc.c b/common/cmd_misc.c
index b0ced2f..8439da2 100644
--- a/common/cmd_misc.c
+++ b/common/cmd_misc.c
@@ -27,7 +27,7 @@
 #include <common.h>
 #include <command.h>
 
-int do_sleep (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_sleep (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	ulong start = get_timer(0);
 	ulong delay;
diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c
index c67c9cf..698157f 100644
--- a/common/cmd_mmc.c
+++ b/common/cmd_mmc.c
@@ -28,7 +28,7 @@
 #ifndef CONFIG_GENERIC_MMC
 static int curr_device = -1;
 
-int do_mmc (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_mmc (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	int dev;
 
@@ -114,7 +114,7 @@
 	printf("Bus Width: %d-bit\n", mmc->bus_width);
 }
 
-int do_mmcinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_mmcinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	struct mmc *mmc;
 	int dev_num;
@@ -140,7 +140,7 @@
 	""
 );
 
-int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	int rc = 0;
 
diff --git a/common/cmd_mp.c b/common/cmd_mp.c
index d78c209..4d7b871 100644
--- a/common/cmd_mp.c
+++ b/common/cmd_mp.c
@@ -24,7 +24,7 @@
 #include <command.h>
 
 int
-cpu_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+cpu_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	unsigned long cpuid;
 
diff --git a/common/cmd_mtdparts.c b/common/cmd_mtdparts.c
index 116e637..447486b 100644
--- a/common/cmd_mtdparts.c
+++ b/common/cmd_mtdparts.c
@@ -1713,7 +1713,7 @@
  * @param argv arguments list
  * @return 0 on success, 1 otherwise
  */
-int do_chpart(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_chpart(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 /* command line only */
 	struct mtd_device *dev;
@@ -1751,7 +1751,7 @@
  * @param argv arguments list
  * @return 0 on success, 1 otherwise
  */
-int do_mtdparts(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_mtdparts(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	if (argc == 2) {
 		if (strcmp(argv[1], "default") == 0) {
diff --git a/common/cmd_nand.c b/common/cmd_nand.c
index f611fd7..ea80555 100644
--- a/common/cmd_nand.c
+++ b/common/cmd_nand.c
@@ -90,7 +90,7 @@
 }
 
 static int
-arg_off_size(int argc, char *argv[], nand_info_t *nand, ulong *off, size_t *size)
+arg_off_size(int argc, char * const argv[], nand_info_t *nand, ulong *off, size_t *size)
 {
 	int idx = nand_curr_device;
 #if defined(CONFIG_CMD_MTDPARTS)
@@ -204,7 +204,7 @@
 	       nand->name, nand->erasesize >> 10);
 }
 
-int do_nand(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_nand(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	int i, dev, ret = 0;
 	ulong addr, off;
@@ -599,7 +599,7 @@
 	return 0;
 }
 
-int do_nandboot(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_nandboot(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	char *boot_device = NULL;
 	int idx;
diff --git a/common/cmd_net.c b/common/cmd_net.c
index b80a7ad..3cdb07f 100644
--- a/common/cmd_net.c
+++ b/common/cmd_net.c
@@ -28,11 +28,11 @@
 #include <command.h>
 #include <net.h>
 
-extern int do_bootm (cmd_tbl_t *, int, int, char *[]);
+extern int do_bootm (cmd_tbl_t *, int, int, char * const []);
 
-static int netboot_common (proto_t, cmd_tbl_t *, int , char *[]);
+static int netboot_common (proto_t, cmd_tbl_t *, int , char * const []);
 
-int do_bootp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_bootp (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	return netboot_common (BOOTP, cmdtp, argc, argv);
 }
@@ -43,7 +43,7 @@
 	"[loadAddress] [[hostIPaddr:]bootfilename]"
 );
 
-int do_tftpb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_tftpb (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	return netboot_common (TFTP, cmdtp, argc, argv);
 }
@@ -54,7 +54,7 @@
 	"[loadAddress] [[hostIPaddr:]bootfilename]"
 );
 
-int do_rarpb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_rarpb (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	return netboot_common (RARP, cmdtp, argc, argv);
 }
@@ -66,7 +66,7 @@
 );
 
 #if defined(CONFIG_CMD_DHCP)
-int do_dhcp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_dhcp (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	return netboot_common(DHCP, cmdtp, argc, argv);
 }
@@ -79,7 +79,7 @@
 #endif
 
 #if defined(CONFIG_CMD_NFS)
-int do_nfs (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_nfs (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	return netboot_common(NFS, cmdtp, argc, argv);
 }
@@ -151,7 +151,7 @@
 }
 
 static int
-netboot_common (proto_t proto, cmd_tbl_t *cmdtp, int argc, char *argv[])
+netboot_common (proto_t proto, cmd_tbl_t *cmdtp, int argc, char * const argv[])
 {
 	char *s;
 	char *end;
@@ -230,7 +230,7 @@
 }
 
 #if defined(CONFIG_CMD_PING)
-int do_ping (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_ping (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	if (argc < 2)
 		return -1;
@@ -280,7 +280,7 @@
 
 }
 
-int do_cdp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_cdp (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	int r;
 
@@ -302,7 +302,7 @@
 #endif
 
 #if defined(CONFIG_CMD_SNTP)
-int do_sntp (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_sntp (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	char *toff;
 
@@ -340,7 +340,7 @@
 #endif
 
 #if defined(CONFIG_CMD_DNS)
-int do_dns(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_dns(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	if (argc == 1) {
 		cmd_usage(cmdtp);
diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index d2ef217..13325bc 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -139,7 +139,7 @@
 	return i;
 }
 
-int do_printenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_printenv (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	int i;
 	int rcode = 0;
@@ -173,7 +173,7 @@
  * This function will ONLY work with a in-RAM copy of the environment
  */
 
-int _do_setenv (int flag, int argc, char *argv[])
+int _do_setenv (int flag, int argc, char * const argv[])
 {
 	int   i, len, oldval;
 	int   console = -1;
@@ -390,7 +390,7 @@
 
 int setenv (char *varname, char *varvalue)
 {
-	char *argv[4] = { "setenv", varname, varvalue, NULL };
+	char * const argv[4] = { "setenv", varname, varvalue, NULL };
 	if ((varvalue == NULL) || (varvalue[0] == '\0'))
 		return _do_setenv (0, 2, argv);
 	else
@@ -400,12 +400,12 @@
 #ifdef CONFIG_HAS_UID
 void forceenv (char *varname, char *varvalue)
 {
-	char *argv[4] = { "forceenv", varname, varvalue, NULL };
+	char * const argv[4] = { "forceenv", varname, varvalue, NULL };
 	_do_setenv (0xdeaf4add, 3, argv);
 }
 #endif
 
-int do_setenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_setenv (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	if (argc < 2) {
 		cmd_usage(cmdtp);
@@ -420,7 +420,7 @@
  */
 
 #if defined(CONFIG_CMD_ASKENV)
-int do_askenv ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_askenv ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	extern char console_buffer[CONFIG_SYS_CBSIZE];
 	char message[CONFIG_SYS_CBSIZE];
@@ -497,7 +497,7 @@
  * Interactively edit an environment variable
  */
 #if defined(CONFIG_CMD_EDITENV)
-int do_editenv(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_editenv(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	char buffer[CONFIG_SYS_CBSIZE];
 	char *init_val;
@@ -576,7 +576,7 @@
 
 #if defined(CONFIG_CMD_SAVEENV) && !defined(CONFIG_ENV_IS_NOWHERE)
 
-int do_saveenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_saveenv (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	extern char * env_name_spec;
 
@@ -660,7 +660,7 @@
 #endif
 
 #if defined(CONFIG_CMD_RUN)
-int do_run (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+int do_run (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
 U_BOOT_CMD(
 	run,	CONFIG_SYS_MAXARGS,	1,	do_run,
 	"run commands in an environment variable",
diff --git a/common/cmd_onenand.c b/common/cmd_onenand.c
index 2646ae9..a3e46a3 100644
--- a/common/cmd_onenand.c
+++ b/common/cmd_onenand.c
@@ -32,7 +32,7 @@
 	return (*p != '\0' && *endptr == '\0') ? 1 : 0;
 }
 
-static int arg_off_size(int argc, char *argv[], ulong *off, size_t *size)
+static int arg_off_size(int argc, char * const argv[], ulong *off, size_t *size)
 {
 	if (argc >= 1) {
 		if (!(str2long(argv[0], off))) {
@@ -330,13 +330,13 @@
 	return 0;
 }
 
-static int do_onenand_info(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+static int do_onenand_info(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	printf("%s\n", mtd->name);
 	return 0;
 }
 
-static int do_onenand_bad(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+static int do_onenand_bad(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	ulong ofs;
 
@@ -351,7 +351,7 @@
 	return 0;
 }
 
-static int do_onenand_read(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+static int do_onenand_read(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	char *s;
 	int oob = 0;
@@ -383,7 +383,7 @@
 	return ret == 0 ? 0 : 1;
 }
 
-static int do_onenand_write(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+static int do_onenand_write(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	ulong addr, ofs;
 	size_t len;
@@ -409,7 +409,7 @@
 	return ret == 0 ? 0 : 1;
 }
 
-static int do_onenand_erase(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+static int do_onenand_erase(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	ulong ofs;
 	int ret = 0;
@@ -445,7 +445,7 @@
 	return ret == 0 ? 0 : 1;
 }
 
-static int do_onenand_test(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+static int do_onenand_test(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	ulong ofs;
 	int ret = 0;
@@ -470,7 +470,7 @@
 	return ret == 0 ? 0 : 1;
 }
 
-static int do_onenand_dump(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+static int do_onenand_dump(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	ulong ofs;
 	int ret = 0;
@@ -493,7 +493,7 @@
 	return ret == 0 ? 1 : 0;
 }
 
-static int do_onenand_markbad(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+static int do_onenand_markbad(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	int ret = 0;
 	ulong addr;
@@ -537,7 +537,7 @@
 	U_BOOT_CMD_MKENT(markbad, CONFIG_SYS_MAXARGS, 0, do_onenand_markbad, "", ""),
 };
 
-static int do_onenand(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+static int do_onenand(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	cmd_tbl_t *c;
 
diff --git a/common/cmd_otp.c b/common/cmd_otp.c
index 30af5a3..a8c73b5 100644
--- a/common/cmd_otp.c
+++ b/common/cmd_otp.c
@@ -80,7 +80,7 @@
 	bfrom_OtpCommand(OTP_INIT, write ? timing : timing & ~(-1 << 15));
 }
 
-int do_otp(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_otp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	uint32_t ret, base_flags;
 	bool prompt_user, force_read;
diff --git a/common/cmd_pci.c b/common/cmd_pci.c
index 8a260df..358ca60 100644
--- a/common/cmd_pci.c
+++ b/common/cmd_pci.c
@@ -471,7 +471,7 @@
  *      pci modify[.b, .w, .l] bus.device.function [addr]
  *      pci write[.b, .w, .l] bus.device.function addr value
  */
-int do_pci (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_pci (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	ulong addr = 0, value = 0, size = 0;
 	pci_dev_t bdf = 0;
diff --git a/common/cmd_pcmcia.c b/common/cmd_pcmcia.c
index e576b0c..70e5210 100644
--- a/common/cmd_pcmcia.c
+++ b/common/cmd_pcmcia.c
@@ -66,7 +66,7 @@
 extern int pcmcia_on (void);
 extern int pcmcia_off (void);
 
-int do_pinit (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_pinit (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	int rcode = 0;
 
diff --git a/common/cmd_portio.c b/common/cmd_portio.c
index f8befee..92d61d2 100644
--- a/common/cmd_portio.c
+++ b/common/cmd_portio.c
@@ -37,7 +37,7 @@
 static uint out_last_addr, out_last_size, out_last_value;
 
 
-int do_portio_out (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_portio_out (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	uint addr = out_last_addr;
 	uint size = out_last_size;
@@ -97,7 +97,7 @@
 	"[.b, .w, .l] port value\n    - output to IO port"
 );
 
-int do_portio_in (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_portio_in (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	uint addr = in_last_addr;
 	uint size = in_last_size;
diff --git a/common/cmd_reginfo.c b/common/cmd_reginfo.c
index 89fd9ec..94b8d58 100644
--- a/common/cmd_reginfo.c
+++ b/common/cmd_reginfo.c
@@ -35,7 +35,7 @@
 extern void mpc86xx_reginfo(void);
 #endif
 
-int do_reginfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_reginfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 #if defined(CONFIG_8xx)
 	volatile immap_t     *immap  = (immap_t *)CONFIG_SYS_IMMR;
diff --git a/common/cmd_reiser.c b/common/cmd_reiser.c
index 8ede782..2133a1f 100644
--- a/common/cmd_reiser.c
+++ b/common/cmd_reiser.c
@@ -47,7 +47,7 @@
 #define PRINTF(fmt,args...)
 #endif
 
-int do_reiserls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_reiserls (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	char *filename = "/";
 	int dev=0;
@@ -110,7 +110,7 @@
 /******************************************************************************
  * Reiserfs boot command intepreter. Derived from diskboot
  */
-int do_reiserload (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_reiserload (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	char *filename = NULL;
 	char *ep;
diff --git a/common/cmd_sata.c b/common/cmd_sata.c
index 1693a7e..7be58e5 100644
--- a/common/cmd_sata.c
+++ b/common/cmd_sata.c
@@ -62,7 +62,7 @@
 	return (dev < CONFIG_SYS_SATA_MAX_DEVICE) ? &sata_dev_desc[dev] : NULL;
 }
 
-int do_sata(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_sata(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	int rc = 0;
 
diff --git a/common/cmd_scsi.c b/common/cmd_scsi.c
index f89492f..5b2df28 100644
--- a/common/cmd_scsi.c
+++ b/common/cmd_scsi.c
@@ -202,7 +202,7 @@
 /******************************************************************************
  * scsi boot command intepreter. Derived from diskboot
  */
-int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	char *boot_device = NULL;
 	char *ep;
@@ -342,7 +342,7 @@
 /*********************************************************************************
  * scsi command intepreter
  */
-int do_scsi (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_scsi (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	switch (argc) {
     case 0:
diff --git a/common/cmd_setexpr.c b/common/cmd_setexpr.c
index da9e844..b3e489f 100644
--- a/common/cmd_setexpr.c
+++ b/common/cmd_setexpr.c
@@ -50,7 +50,7 @@
 	}
 }
 
-int do_setexpr(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_setexpr(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	ulong a, b;
 	char buf[16];
diff --git a/common/cmd_sf.c b/common/cmd_sf.c
index d69ae6a..4826e9f 100644
--- a/common/cmd_sf.c
+++ b/common/cmd_sf.c
@@ -19,7 +19,7 @@
 
 static struct spi_flash *flash;
 
-static int do_spi_flash_probe(int argc, char *argv[])
+static int do_spi_flash_probe(int argc, char * const argv[])
 {
 	unsigned int bus = 0;
 	unsigned int cs;
@@ -75,7 +75,7 @@
 	return 1;
 }
 
-static int do_spi_flash_read_write(int argc, char *argv[])
+static int do_spi_flash_read_write(int argc, char * const argv[])
 {
 	unsigned long addr;
 	unsigned long offset;
@@ -122,7 +122,7 @@
 	return 1;
 }
 
-static int do_spi_flash_erase(int argc, char *argv[])
+static int do_spi_flash_erase(int argc, char * const argv[])
 {
 	unsigned long offset;
 	unsigned long len;
@@ -152,7 +152,7 @@
 	return 1;
 }
 
-static int do_spi_flash(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+static int do_spi_flash(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	const char *cmd;
 
diff --git a/common/cmd_source.c b/common/cmd_source.c
index 1424d30..16a627a 100644
--- a/common/cmd_source.c
+++ b/common/cmd_source.c
@@ -199,7 +199,7 @@
 /**************************************************/
 #if defined(CONFIG_CMD_SOURCE)
 int
-do_source (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+do_source (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	ulong addr;
 	int rcode;
diff --git a/common/cmd_spi.c b/common/cmd_spi.c
index ab7aac7..bafa217 100644
--- a/common/cmd_spi.c
+++ b/common/cmd_spi.c
@@ -63,7 +63,7 @@
  * The command prints out the hexadecimal string received via SPI.
  */
 
-int do_spi (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_spi (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	struct spi_slave *slave;
 	char  *cp = 0;
diff --git a/common/cmd_spibootldr.c b/common/cmd_spibootldr.c
index d29ed2b..68aa618 100644
--- a/common/cmd_spibootldr.c
+++ b/common/cmd_spibootldr.c
@@ -15,7 +15,7 @@
 #include <asm/blackfin.h>
 #include <asm/mach-common/bits/bootrom.h>
 
-int do_spibootldr(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_spibootldr(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	s32 addr;
 
diff --git a/common/cmd_strings.c b/common/cmd_strings.c
index 3a0d8ff..bbbb6b4 100644
--- a/common/cmd_strings.c
+++ b/common/cmd_strings.c
@@ -12,7 +12,7 @@
 
 static char *start_addr, *last_addr;
 
-int do_strings(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_strings(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	if (argc == 1) {
 		cmd_usage(cmdtp);
diff --git a/common/cmd_terminal.c b/common/cmd_terminal.c
index 60ec378..7cc1a6c 100644
--- a/common/cmd_terminal.c
+++ b/common/cmd_terminal.c
@@ -29,7 +29,7 @@
 #include <stdio_dev.h>
 #include <serial.h>
 
-int do_terminal(cmd_tbl_t * cmd, int flag, int argc, char *argv[])
+int do_terminal(cmd_tbl_t * cmd, int flag, int argc, char * const argv[])
 {
 	int last_tilde = 0;
 	struct stdio_dev *dev = NULL;
diff --git a/common/cmd_test.c b/common/cmd_test.c
index d886f89..fcb5ef2 100644
--- a/common/cmd_test.c
+++ b/common/cmd_test.c
@@ -24,9 +24,9 @@
 #include <common.h>
 #include <command.h>
 
-int do_test(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_test(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
-	char **ap;
+	char * const *ap;
 	int left, adv, expr, last_expr, neg, last_cmp;
 
 	/* args? */
@@ -150,7 +150,7 @@
 	"[args..]"
 );
 
-int do_false(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_false(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	return 1;
 }
@@ -161,7 +161,7 @@
 	NULL
 );
 
-int do_true(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_true(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	return 0;
 }
diff --git a/common/cmd_tsi148.c b/common/cmd_tsi148.c
index f2097fd..1e83c88 100644
--- a/common/cmd_tsi148.c
+++ b/common/cmd_tsi148.c
@@ -402,7 +402,7 @@
 /*
  * Tundra Tsi148 configuration
  */
-int do_tsi148(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_tsi148(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	ulong addr1 = 0, addr2 = 0, size = 0, vam = 0, vdw = 0;
 	char cmd = 'x';
diff --git a/common/cmd_ubi.c b/common/cmd_ubi.c
index 2484b40..2faf8d8 100644
--- a/common/cmd_ubi.c
+++ b/common/cmd_ubi.c
@@ -436,7 +436,7 @@
 	return 0;
 }
 
-static int do_ubi(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+static int do_ubi(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	size_t size = 0;
 	ulong addr = 0;
diff --git a/common/cmd_ubifs.c b/common/cmd_ubifs.c
index ed0e9db..9017041 100644
--- a/common/cmd_ubifs.c
+++ b/common/cmd_ubifs.c
@@ -42,7 +42,7 @@
 int ubifs_ls(char *dir_name);
 int ubifs_load(char *filename, u32 addr, u32 size);
 
-int do_ubifs_mount(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_ubifs_mount(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	char *vol_name;
 	int ret;
@@ -68,7 +68,7 @@
 	return 0;
 }
 
-int do_ubifs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_ubifs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	char *filename = "/";
 	int ret;
@@ -89,7 +89,7 @@
 	return ret;
 }
 
-int do_ubifs_load(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_ubifs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	char *filename;
 	char *endp;
diff --git a/common/cmd_universe.c b/common/cmd_universe.c
index 0a6d722..a86a574 100644
--- a/common/cmd_universe.c
+++ b/common/cmd_universe.c
@@ -317,7 +317,7 @@
 /*
  * Tundra Universe configuration
  */
-int do_universe(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_universe(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	ulong addr1 = 0, addr2 = 0, size = 0, vam = 0, pms = 0, vdw = 0;
 	char cmd = 'x';
diff --git a/common/cmd_usb.c b/common/cmd_usb.c
index fcb5f76..73d74ac 100644
--- a/common/cmd_usb.c
+++ b/common/cmd_usb.c
@@ -349,7 +349,7 @@
  * usb boot command intepreter. Derived from diskboot
  */
 #ifdef CONFIG_USB_STORAGE
-int do_usbboot(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_usbboot(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	char *boot_device = NULL;
 	char *ep;
@@ -506,7 +506,7 @@
 /******************************************************************************
  * usb command intepreter
  */
-int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 
 	int i;
diff --git a/common/cmd_version.c b/common/cmd_version.c
index 7f165c7..7d1b495 100644
--- a/common/cmd_version.c
+++ b/common/cmd_version.c
@@ -26,7 +26,7 @@
 
 extern char version_string[];
 
-int do_version(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_version(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	printf("\n%s\n", version_string);
 
diff --git a/common/cmd_vfd.c b/common/cmd_vfd.c
index 9c5b038..1429d31 100644
--- a/common/cmd_vfd.c
+++ b/common/cmd_vfd.c
@@ -45,7 +45,7 @@
 
 int trab_vfd (ulong bitmap);
 
-int do_vfd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_vfd (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	ulong bitmap;
 
diff --git a/common/cmd_ximg.c b/common/cmd_ximg.c
index 75499b4..8a2cf83 100644
--- a/common/cmd_ximg.c
+++ b/common/cmd_ximg.c
@@ -43,7 +43,7 @@
 #endif
 
 int
-do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	ulong		addr = load_addr;
 	ulong		dest = 0;
diff --git a/common/cmd_yaffs2.c b/common/cmd_yaffs2.c
index d448d04..7c01ea2 100644
--- a/common/cmd_yaffs2.c
+++ b/common/cmd_yaffs2.c
@@ -24,7 +24,7 @@
 extern int yaffs_DumpDevStruct(const char *path);
 
 
-int do_ymount (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_ymount (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
     char *mtpoint = argv[1];
     cmd_yaffs_mount(mtpoint);
@@ -32,7 +32,7 @@
     return(0);
 }
 
-int do_yumount (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_yumount (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
     char *mtpoint = argv[1];
     cmd_yaffs_umount(mtpoint);
@@ -40,7 +40,7 @@
     return(0);
 }
 
-int do_yls (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_yls (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
     char *dirname = argv[argc-1];
 
@@ -49,7 +49,7 @@
     return(0);
 }
 
-int do_yrd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_yrd (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
     char *filename = argv[1];
     printf ("Reading file %s ", filename);
@@ -60,7 +60,7 @@
     return(0);
 }
 
-int do_ywr (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_ywr (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
     char *filename = argv[1];
     ulong value = simple_strtoul(argv[2], NULL, 16);
@@ -74,7 +74,7 @@
     return(0);
 }
 
-int do_yrdm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_yrdm (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
     char *filename = argv[1];
     ulong addr = simple_strtoul(argv[2], NULL, 16);
@@ -84,7 +84,7 @@
     return(0);
 }
 
-int do_ywrm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_ywrm (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
     char *filename = argv[1];
     ulong addr = simple_strtoul(argv[2], NULL, 16);
@@ -95,7 +95,7 @@
     return(0);
 }
 
-int do_ymkdir (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_ymkdir (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
     char *dirname = argv[1];
 
@@ -104,7 +104,7 @@
     return(0);
 }
 
-int do_yrmdir (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_yrmdir (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
     char *dirname = argv[1];
 
@@ -113,7 +113,7 @@
     return(0);
 }
 
-int do_yrm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_yrm (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
     char *path = argv[1];
 
@@ -122,7 +122,7 @@
     return(0);
 }
 
-int do_ymv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_ymv (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
     char *oldPath = argv[1];
     char *newPath = argv[2];
@@ -132,7 +132,7 @@
     return(0);
 }
 
-int do_ydump (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_ydump (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
     char *dirname = argv[1];
     if (yaffs_DumpDevStruct(dirname) != 0)
diff --git a/common/command.c b/common/command.c
index 67ad692..a1fc592 100644
--- a/common/command.c
+++ b/common/command.c
@@ -34,7 +34,7 @@
  */
 
 int _do_help (cmd_tbl_t *cmd_start, int cmd_items, cmd_tbl_t * cmdtp, int
-	      flag, int argc, char *argv[])
+	      flag, int argc, char * const argv[])
 {
 	int i;
 	int rcode = 0;
@@ -158,7 +158,7 @@
 
 #ifdef CONFIG_AUTO_COMPLETE
 
-int var_complete(int argc, char *argv[], char last_char, int maxv, char *cmdv[])
+int var_complete(int argc, char * const argv[], char last_char, int maxv, char *cmdv[])
 {
 	static char tmp_buf[512];
 	int space;
@@ -175,7 +175,7 @@
 }
 
 static void install_auto_complete_handler(const char *cmd,
-		int (*complete)(int argc, char *argv[], char last_char, int maxv, char *cmdv[]))
+		int (*complete)(int argc, char * const argv[], char last_char, int maxv, char *cmdv[]))
 {
 	cmd_tbl_t *cmdtp;
 
@@ -200,7 +200,7 @@
 
 /*************************************************************************************/
 
-static int complete_cmdv(int argc, char *argv[], char last_char, int maxv, char *cmdv[])
+static int complete_cmdv(int argc, char * const argv[], char last_char, int maxv, char *cmdv[])
 {
 	cmd_tbl_t *cmdtp;
 	const char *p;
@@ -301,7 +301,7 @@
 	return argc;
 }
 
-static void print_argv(const char *banner, const char *leader, const char *sep, int linemax, char *argv[])
+static void print_argv(const char *banner, const char *leader, const char *sep, int linemax, char * const argv[])
 {
 	int ll = leader != NULL ? strlen(leader) : 0;
 	int sl = sep != NULL ? strlen(sep) : 0;
@@ -328,7 +328,7 @@
 	printf("\n");
 }
 
-static int find_common_prefix(char *argv[])
+static int find_common_prefix(char * const argv[])
 {
 	int i, len;
 	char *anchor, *s, *t;
diff --git a/common/hush.c b/common/hush.c
index 9eea90f..8a74d22 100644
--- a/common/hush.c
+++ b/common/hush.c
@@ -94,7 +94,7 @@
 #include <hush.h>
 #include <command.h>        /* find_cmd */
 /*cmd_boot.c*/
-extern int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);      /* do_bootd */
+extern int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);      /* do_bootd */
 #endif
 #ifndef __U_BOOT__
 #include <ctype.h>     /* isalpha, isdigit */
@@ -1024,7 +1024,7 @@
 
 #ifdef CONFIG_BOOT_RETRY_TIME
 #  ifdef CONFIG_RESET_TO_RETRY
-	extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+	extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
 #  else
 #	error "This currently only works with CONFIG_RESET_TO_RETRY enabled"
 #  endif
@@ -1681,7 +1681,7 @@
 			} else {
 				int rcode;
 #if defined(CONFIG_CMD_BOOTD)
-	    extern int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+	    extern int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
 
 				/* avoid "bootd" recursion */
 				if (cmdtp->cmd == do_bootd) {
@@ -3351,7 +3351,7 @@
 	tcsetpgrp(shell_terminal, shell_pgrp);
 }
 
-int hush_main(int argc, char **argv)
+int hush_main(int argc, char * const *argv)
 {
 	int opt;
 	FILE *input;
@@ -3588,7 +3588,7 @@
 }
 
 #ifdef __U_BOOT__
-int do_showvar (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+int do_showvar (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	int i, k;
 	int rcode = 0;
diff --git a/common/image.c b/common/image.c
index 2b6007e..6d8833e 100644
--- a/common/image.c
+++ b/common/image.c
@@ -60,7 +60,7 @@
 #endif
 
 #ifdef CONFIG_CMD_BDI
-extern int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+extern int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
 #endif
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -756,7 +756,7 @@
  *     1, if ramdisk image is found but corrupted, or invalid
  *     rd_start and rd_end are set to 0 if no ramdisk exists
  */
-int boot_get_ramdisk (int argc, char *argv[], bootm_headers_t *images,
+int boot_get_ramdisk (int argc, char * const argv[], bootm_headers_t *images,
 		uint8_t arch, ulong *rd_start, ulong *rd_end)
 {
 	ulong rd_addr, rd_load;
@@ -1279,7 +1279,7 @@
  *     1, if fdt image is found but corrupted
  *     of_flat_tree and of_size are set to 0 if no fdt exists
  */
-int boot_get_fdt (int flag, int argc, char *argv[], bootm_headers_t *images,
+int boot_get_fdt (int flag, int argc, char * const argv[], bootm_headers_t *images,
 		char **of_flat_tree, ulong *of_size)
 {
 	const image_header_t *fdt_hdr;
diff --git a/common/kgdb.c b/common/kgdb.c
index 9e3b64c..8a621ad 100644
--- a/common/kgdb.c
+++ b/common/kgdb.c
@@ -584,7 +584,7 @@
 }
 
 int
-do_kgdb(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+do_kgdb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
     printf("Entering KGDB mode via exception handler...\n\n");
     kgdb_breakpoint(argc - 1, argv + 1);
diff --git a/common/lcd.c b/common/lcd.c
index 64fb1c6..93ddedf 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -78,7 +78,7 @@
 
 static int lcd_init (void *lcdbase);
 
-static int lcd_clear (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]);
+static int lcd_clear (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]);
 static void *lcd_logo (void);
 
 static int lcd_getbgcolor (void);
@@ -350,7 +350,7 @@
 }
 
 /*----------------------------------------------------------------------*/
-static int lcd_clear (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+static int lcd_clear (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 #if LCD_BPP == LCD_MONOCHROME
 	/* Setting the palette */
diff --git a/common/main.c b/common/main.c
index 3760ba3..20090ee 100644
--- a/common/main.c
+++ b/common/main.c
@@ -51,10 +51,10 @@
 void show_boot_progress (int val) __attribute__((weak, alias("__show_boot_progress")));
 
 #if defined(CONFIG_BOOT_RETRY_TIME) && defined(CONFIG_RESET_TO_RETRY)
-extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);		/* for do_reset() prototype */
+extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);		/* for do_reset() prototype */
 #endif
 
-extern int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
+extern int do_bootd (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
 
 #if defined(CONFIG_UPDATE_TFTP)
 void update_tftp (void);
@@ -1414,7 +1414,7 @@
 /****************************************************************************/
 
 #if defined(CONFIG_CMD_RUN)
-int do_run (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+int do_run (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	int i;