global: Convert simple_strtoul() with hex to hextoul()

It is a pain to have to specify the value 16 in each call. Add a new
hextoul() function and update the code to use it.

Add a proper comment to simple_strtoul() while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/cmd/abootimg.c b/cmd/abootimg.c
index 40e8978..f48a9dc 100644
--- a/cmd/abootimg.c
+++ b/cmd/abootimg.c
@@ -161,7 +161,7 @@
 	if (argc != 2)
 		return CMD_RET_USAGE;
 
-	img_addr = simple_strtoul(argv[1], &endp, 16);
+	img_addr = hextoul(argv[1], &endp);
 	if (*endp != '\0') {
 		printf("Error: Wrong image address\n");
 		return CMD_RET_FAILURE;
diff --git a/cmd/adtimg.c b/cmd/adtimg.c
index aa94300..f4b5cbf 100644
--- a/cmd/adtimg.c
+++ b/cmd/adtimg.c
@@ -27,7 +27,7 @@
 	if (argc != 2)
 		return CMD_RET_USAGE;
 
-	hdr_addr = simple_strtoul(argv[1], &endp, 16);
+	hdr_addr = hextoul(argv[1], &endp);
 	if (*endp != '\0') {
 		printf("Error: Wrong image address '%s'\n", argv[1]);
 		return CMD_RET_FAILURE;
diff --git a/cmd/aes.c b/cmd/aes.c
index 4c0dad9..1936518 100644
--- a/cmd/aes.c
+++ b/cmd/aes.c
@@ -55,11 +55,11 @@
 	else
 		return CMD_RET_USAGE;
 
-	key_addr = simple_strtoul(argv[2], NULL, 16);
-	iv_addr = simple_strtoul(argv[3], NULL, 16);
-	src_addr = simple_strtoul(argv[4], NULL, 16);
-	dst_addr = simple_strtoul(argv[5], NULL, 16);
-	len = simple_strtoul(argv[6], NULL, 16);
+	key_addr = hextoul(argv[2], NULL);
+	iv_addr = hextoul(argv[3], NULL);
+	src_addr = hextoul(argv[4], NULL);
+	dst_addr = hextoul(argv[5], NULL);
+	len = hextoul(argv[6], NULL);
 
 	key_ptr = (uint8_t *)map_sysmem(key_addr, key_len);
 	iv_ptr = (uint8_t *)map_sysmem(iv_addr, 128 / 8);
diff --git a/cmd/armflash.c b/cmd/armflash.c
index 5e7315e..d1466f7 100644
--- a/cmd/armflash.c
+++ b/cmd/armflash.c
@@ -280,7 +280,7 @@
 	} else if (argc == 4 && !strcmp(argv[1], "load")) {
 		ulong load_addr;
 
-		load_addr = simple_strtoul(argv[3], NULL, 16);
+		load_addr = hextoul(argv[3], NULL);
 		ret = load_image(argv[2], load_addr);
 	} else {
 		return CMD_RET_USAGE;
diff --git a/cmd/avb.c b/cmd/avb.c
index 88172a9..02b4b1f 100644
--- a/cmd/avb.c
+++ b/cmd/avb.c
@@ -22,7 +22,7 @@
 	if (argc != 2)
 		return CMD_RET_USAGE;
 
-	mmc_dev = simple_strtoul(argv[1], NULL, 16);
+	mmc_dev = hextoul(argv[1], NULL);
 
 	if (avb_ops)
 		avb_ops_free(avb_ops);
@@ -53,9 +53,9 @@
 		return CMD_RET_USAGE;
 
 	part = argv[1];
-	offset = simple_strtoul(argv[2], NULL, 16);
-	bytes = simple_strtoul(argv[3], NULL, 16);
-	buffer = (void *)simple_strtoul(argv[4], NULL, 16);
+	offset = hextoul(argv[2], NULL);
+	bytes = hextoul(argv[3], NULL);
+	buffer = (void *)hextoul(argv[4], NULL);
 
 	if (avb_ops->read_from_partition(avb_ops, part, offset, bytes,
 					 buffer, &bytes_read) ==
@@ -86,8 +86,8 @@
 		return CMD_RET_USAGE;
 
 	part = argv[1];
-	offset = simple_strtoul(argv[2], NULL, 16);
-	bytes = simple_strtoul(argv[3], NULL, 16);
+	offset = hextoul(argv[2], NULL);
+	bytes = hextoul(argv[3], NULL);
 
 	buffer = malloc(bytes);
 	if (!buffer) {
@@ -132,9 +132,9 @@
 		return CMD_RET_USAGE;
 
 	part = argv[1];
-	offset = simple_strtoul(argv[2], NULL, 16);
-	bytes = simple_strtoul(argv[3], NULL, 16);
-	buffer = (void *)simple_strtoul(argv[4], NULL, 16);
+	offset = hextoul(argv[2], NULL);
+	bytes = hextoul(argv[3], NULL);
+	buffer = (void *)hextoul(argv[4], NULL);
 
 	if (avb_ops->write_to_partition(avb_ops, part, offset, bytes, buffer) ==
 	    AVB_IO_RESULT_OK) {
@@ -161,7 +161,7 @@
 	if (argc != 2)
 		return CMD_RET_USAGE;
 
-	index = (size_t)simple_strtoul(argv[1], NULL, 16);
+	index = (size_t)hextoul(argv[1], NULL);
 
 	if (avb_ops->read_rollback_index(avb_ops, index, &rb_idx) ==
 	    AVB_IO_RESULT_OK) {
@@ -188,8 +188,8 @@
 	if (argc != 3)
 		return CMD_RET_USAGE;
 
-	index = (size_t)simple_strtoul(argv[1], NULL, 16);
-	rb_idx = simple_strtoul(argv[2], NULL, 16);
+	index = (size_t)hextoul(argv[1], NULL);
+	rb_idx = hextoul(argv[2], NULL);
 
 	if (avb_ops->write_rollback_index(avb_ops, index, rb_idx) ==
 	    AVB_IO_RESULT_OK)
diff --git a/cmd/axi.c b/cmd/axi.c
index c72197e..c676819 100644
--- a/cmd/axi.c
+++ b/cmd/axi.c
@@ -198,14 +198,14 @@
 		/*
 		 * Address is specified since argc >= 3
 		 */
-		addr = simple_strtoul(argv[2], NULL, 16);
+		addr = hextoul(argv[2], NULL);
 
 		/*
 		 * If there's another parameter, it is the length to display;
 		 * length is the number of objects, not number of bytes
 		 */
 		if (argc > 3)
-			length = simple_strtoul(argv[3], NULL, 16);
+			length = hextoul(argv[3], NULL);
 	}
 
 	switch (size) {
@@ -291,14 +291,14 @@
 	};
 
 	/* Address is specified since argc > 4 */
-	addr = simple_strtoul(argv[2], NULL, 16);
+	addr = hextoul(argv[2], NULL);
 
 	/* Get the value to write */
-	writeval = simple_strtoul(argv[3], NULL, 16);
+	writeval = hextoul(argv[3], NULL);
 
 	/* Count ? */
 	if (argc == 5)
-		count = simple_strtoul(argv[4], NULL, 16);
+		count = hextoul(argv[4], NULL);
 	else
 		count = 1;
 
diff --git a/cmd/bedbug.c b/cmd/bedbug.c
index bef617b..549c905 100644
--- a/cmd/bedbug.c
+++ b/cmd/bedbug.c
@@ -75,11 +75,11 @@
 
 	if ((flag & CMD_FLAG_REPEAT) == 0) {
 		/* New command */
-		addr = simple_strtoul (argv[1], NULL, 16);
+		addr = hextoul(argv[1], NULL);
 
 		/* If an extra param is given then it is the length */
 		if (argc > 2)
-			len = simple_strtoul (argv[2], NULL, 16);
+			len = hextoul(argv[2], NULL);
 	}
 
 	/* Run the disassembler */
@@ -114,7 +114,7 @@
 		return CMD_RET_USAGE;
 
 	printf ("\nEnter '.' when done\n");
-	mem_addr = simple_strtoul (argv[1], NULL, 16);
+	mem_addr = hextoul(argv[1], NULL);
 
 	while (1) {
 		putc ('\n');
diff --git a/cmd/binop.c b/cmd/binop.c
index c85cb51..bb5adc3 100644
--- a/cmd/binop.c
+++ b/cmd/binop.c
@@ -58,7 +58,7 @@
 	ulong addr;
 	u8 *buf;
 
-	addr = simple_strtoul(varname, NULL, 16);
+	addr = hextoul(varname, NULL);
 	buf = map_sysmem(addr, len);
 	memcpy(buf, result, len);
 	unmap_sysmem(buf);
@@ -95,12 +95,12 @@
 	src2 = malloc(len);
 
 	if (*src1arg == '*')
-		read_from_mem(simple_strtoul(src1arg + 1, NULL, 16), src1, len);
+		read_from_mem(hextoul(src1arg + 1, NULL), src1, len);
 	else
 		read_from_env_var(src1arg, src1);
 
 	if (*src2arg == '*')
-		read_from_mem(simple_strtoul(src2arg + 1, NULL, 16), src2, len);
+		read_from_mem(hextoul(src2arg + 1, NULL), src2, len);
 	else
 		read_from_env_var(src2arg, src2);
 
diff --git a/cmd/blk_common.c b/cmd/blk_common.c
index 87f94b5..0898798 100644
--- a/cmd/blk_common.c
+++ b/cmd/blk_common.c
@@ -63,9 +63,9 @@
 
 	default: /* at least 4 args */
 		if (strcmp(argv[1], "read") == 0) {
-			ulong addr = simple_strtoul(argv[2], NULL, 16);
-			lbaint_t blk = simple_strtoul(argv[3], NULL, 16);
-			ulong cnt = simple_strtoul(argv[4], NULL, 16);
+			ulong addr = hextoul(argv[2], NULL);
+			lbaint_t blk = hextoul(argv[3], NULL);
+			ulong cnt = hextoul(argv[4], NULL);
 			ulong n;
 
 			printf("\n%s read: device %d block # "LBAFU", count %lu ... ",
@@ -78,9 +78,9 @@
 			       n == cnt ? "OK" : "ERROR");
 			return n == cnt ? 0 : 1;
 		} else if (strcmp(argv[1], "write") == 0) {
-			ulong addr = simple_strtoul(argv[2], NULL, 16);
-			lbaint_t blk = simple_strtoul(argv[3], NULL, 16);
-			ulong cnt = simple_strtoul(argv[4], NULL, 16);
+			ulong addr = hextoul(argv[2], NULL);
+			lbaint_t blk = hextoul(argv[3], NULL);
+			ulong cnt = hextoul(argv[4], NULL);
 			ulong n;
 
 			printf("\n%s write: device %d block # "LBAFU", count %lu ... ",
diff --git a/cmd/blob.c b/cmd/blob.c
index 887219c..e2efae7 100644
--- a/cmd/blob.c
+++ b/cmd/blob.c
@@ -70,10 +70,10 @@
 	else
 		return CMD_RET_USAGE;
 
-	src_addr = simple_strtoul(argv[2], NULL, 16);
-	dst_addr = simple_strtoul(argv[3], NULL, 16);
-	len = simple_strtoul(argv[4], NULL, 16);
-	key_addr = simple_strtoul(argv[5], NULL, 16);
+	src_addr = hextoul(argv[2], NULL);
+	dst_addr = hextoul(argv[3], NULL);
+	len = hextoul(argv[4], NULL);
+	key_addr = hextoul(argv[5], NULL);
 
 	km_ptr = (uint8_t *)(uintptr_t)key_addr;
 	src_ptr = (uint8_t *)(uintptr_t)src_addr;
diff --git a/cmd/bmp.c b/cmd/bmp.c
index 6040fa5..f4fe97d 100644
--- a/cmd/bmp.c
+++ b/cmd/bmp.c
@@ -102,7 +102,7 @@
 		addr = image_load_addr;
 		break;
 	case 2:		/* use argument */
-		addr = simple_strtoul(argv[1], NULL, 16);
+		addr = hextoul(argv[1], NULL);
 		break;
 	default:
 		return CMD_RET_USAGE;
@@ -124,10 +124,10 @@
 		addr = image_load_addr;
 		break;
 	case 2:		/* use argument */
-		addr = simple_strtoul(argv[1], NULL, 16);
+		addr = hextoul(argv[1], NULL);
 		break;
 	case 4:
-		addr = simple_strtoul(argv[1], NULL, 16);
+		addr = hextoul(argv[1], NULL);
 		if (!strcmp(argv[2], "m"))
 			x = BMP_ALIGN_CENTER;
 		else
diff --git a/cmd/boot.c b/cmd/boot.c
index b84c0ed..fab294e 100644
--- a/cmd/boot.c
+++ b/cmd/boot.c
@@ -29,7 +29,7 @@
 	if (argc < 2)
 		return CMD_RET_USAGE;
 
-	addr = simple_strtoul(argv[1], NULL, 16);
+	addr = hextoul(argv[1], NULL);
 
 	printf ("## Starting application at 0x%08lX ...\n", addr);
 
diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index cba81ff..83eab0b 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -281,7 +281,7 @@
 				return EFI_NOT_FOUND;
 			}
 		}
-		fdt_addr = simple_strtoul(fdt_opt, NULL, 16);
+		fdt_addr = hextoul(fdt_opt, NULL);
 		if (!fdt_addr) {
 			log_err("ERROR: invalid $fdt_addr or $fdtcontroladdr\n");
 			return EFI_LOAD_ERROR;
@@ -628,7 +628,7 @@
 	if (argc > 2) {
 		uintptr_t fdt_addr;
 
-		fdt_addr = simple_strtoul(argv[2], NULL, 16);
+		fdt_addr = hextoul(argv[2], NULL);
 		fdt = map_sysmem(fdt_addr, 0);
 	} else {
 		fdt = EFI_FDT_USE_INTERNAL;
diff --git a/cmd/booti.c b/cmd/booti.c
index 3df70ea..397d4b8 100644
--- a/cmd/booti.c
+++ b/cmd/booti.c
@@ -43,7 +43,7 @@
 		debug("*  kernel: default image load address = 0x%08lx\n",
 				image_load_addr);
 	} else {
-		ld = simple_strtoul(argv[0], NULL, 16);
+		ld = hextoul(argv[0], NULL);
 		debug("*  kernel: cmdline image address = 0x%08lx\n", ld);
 	}
 
diff --git a/cmd/bootm.c b/cmd/bootm.c
index 81c6b93..92468d0 100644
--- a/cmd/bootm.c
+++ b/cmd/bootm.c
@@ -112,7 +112,7 @@
 	if (argc > 0) {
 		char *endp;
 
-		simple_strtoul(argv[0], &endp, 16);
+		hextoul(argv[0], &endp);
 		/* endp pointing to NULL means that argv[0] was just a
 		 * valid number, pass it along to the normal bootm processing
 		 *
@@ -240,7 +240,7 @@
 	}
 
 	for (arg = 1; arg < argc; ++arg) {
-		addr = simple_strtoul(argv[arg], NULL, 16);
+		addr = hextoul(argv[arg], NULL);
 		if (image_info(addr) != 0)
 			rcode = 1;
 	}
diff --git a/cmd/bootstage.c b/cmd/bootstage.c
index 0e623f2..77a4bc6 100644
--- a/cmd/bootstage.c
+++ b/cmd/bootstage.c
@@ -24,12 +24,12 @@
 	*sizep = CONFIG_BOOTSTAGE_STASH_SIZE;
 	if (argc < 2)
 		return 0;
-	*basep = simple_strtoul(argv[1], &endp, 16);
+	*basep = hextoul(argv[1], &endp);
 	if (*argv[1] == 0 || *endp != 0)
 		return -1;
 	if (argc == 2)
 		return 0;
-	*sizep = simple_strtoul(argv[2], &endp, 16);
+	*sizep = hextoul(argv[2], &endp);
 	if (*argv[2] == 0 || *endp != 0)
 		return -1;
 
diff --git a/cmd/bootz.c b/cmd/bootz.c
index 7556cd2..4f024bd 100644
--- a/cmd/bootz.c
+++ b/cmd/bootz.c
@@ -39,7 +39,7 @@
 		debug("*  kernel: default image load address = 0x%08lx\n",
 				image_load_addr);
 	} else {
-		images->ep = simple_strtoul(argv[0], NULL, 16);
+		images->ep = hextoul(argv[0], NULL);
 		debug("*  kernel: cmdline image address = 0x%08lx\n",
 			images->ep);
 	}
diff --git a/cmd/broadcom/nitro_image_load.c b/cmd/broadcom/nitro_image_load.c
index 4a36b30..93b5cb4 100644
--- a/cmd/broadcom/nitro_image_load.c
+++ b/cmd/broadcom/nitro_image_load.c
@@ -53,13 +53,13 @@
 		return CMD_RET_USAGE;
 
 	/* convert command parameter to fastboot address (base 16), i.e. hex */
-	images_load_addr = simple_strtoul(argv[1], NULL, 16);
+	images_load_addr = hextoul(argv[1], NULL);
 	if (!images_load_addr) {
 		pr_err("Invalid load address\n");
 		return CMD_RET_USAGE;
 	}
 
-	spi_load_addr = simple_strtoul(argv[2], NULL, 16);
+	spi_load_addr = hextoul(argv[2], NULL);
 	if (!spi_load_addr) {
 		pr_err("Invalid spi load address\n");
 		return CMD_RET_USAGE;
diff --git a/cmd/cbfs.c b/cmd/cbfs.c
index 10c2c92..8a61f2c 100644
--- a/cmd/cbfs.c
+++ b/cmd/cbfs.c
@@ -22,7 +22,7 @@
 		return 0;
 	}
 	if (argc == 2) {
-		end_of_rom = simple_strtoul(argv[1], &ep, 16);
+		end_of_rom = hextoul(argv[1], &ep);
 		if (*ep) {
 			puts("\n** Invalid end of ROM **\n");
 			return 1;
@@ -58,9 +58,9 @@
 	}
 
 	/* parse offset and count */
-	offset = simple_strtoul(argv[1], NULL, 16);
+	offset = hextoul(argv[1], NULL);
 	if (argc == 4)
-		count = simple_strtoul(argv[3], NULL, 16);
+		count = hextoul(argv[3], NULL);
 	else
 		count = 0;
 
diff --git a/cmd/cramfs.c b/cmd/cramfs.c
index 1aeb567..44c0818 100644
--- a/cmd/cramfs.c
+++ b/cmd/cramfs.c
@@ -107,7 +107,7 @@
 	struct mtdids id;
 
 	ulong addr;
-	addr = simple_strtoul(env_get("cramfsaddr"), NULL, 16);
+	addr = hextoul(env_get("cramfsaddr"), NULL);
 
 	/* hack! */
 	/* cramfs_* only supports NOR flash chips */
@@ -172,7 +172,7 @@
 	struct mtdids id;
 
 	ulong addr;
-	addr = simple_strtoul(env_get("cramfsaddr"), NULL, 16);
+	addr = hextoul(env_get("cramfsaddr"), NULL);
 
 	/* hack! */
 	/* cramfs_* only supports NOR flash chips */
diff --git a/cmd/cros_ec.c b/cmd/cros_ec.c
index eb5053d..abda5d6 100644
--- a/cmd/cros_ec.c
+++ b/cmd/cros_ec.c
@@ -65,11 +65,11 @@
 		return 1;
 	if (argc < 4)
 		return 1;
-	addr = simple_strtoul(argv[3], &endp, 16);
+	addr = hextoul(argv[3], &endp);
 	if (*argv[3] == 0 || *endp != 0)
 		return 1;
 	if (argc > 4) {
-		size = simple_strtoul(argv[4], &endp, 16);
+		size = hextoul(argv[4], &endp);
 		if (*argv[4] == 0 || *endp != 0)
 			return 1;
 	}
diff --git a/cmd/demo.c b/cmd/demo.c
index 78a55f7..a2957f7 100644
--- a/cmd/demo.c
+++ b/cmd/demo.c
@@ -48,7 +48,7 @@
 	int ret;
 
 	if (argc) {
-		light = simple_strtoul(argv[0], NULL, 16);
+		light = hextoul(argv[0], NULL);
 		ret = demo_set_light(demo_dev, light);
 	} else {
 		ret = demo_get_light(demo_dev);
diff --git a/cmd/disk.c b/cmd/disk.c
index 2726115..cb3b990 100644
--- a/cmd/disk.c
+++ b/cmd/disk.c
@@ -36,7 +36,7 @@
 	bootstage_mark(BOOTSTAGE_ID_IDE_ADDR);
 
 	if (argc > 1)
-		addr = simple_strtoul(argv[1], NULL, 16);
+		addr = hextoul(argv[1], NULL);
 
 	bootstage_mark(BOOTSTAGE_ID_IDE_BOOT_DEVICE);
 
diff --git a/cmd/efidebug.c b/cmd/efidebug.c
index 8211a58..67ab06a 100644
--- a/cmd/efidebug.c
+++ b/cmd/efidebug.c
@@ -61,7 +61,7 @@
 		argv++;
 	}
 
-	capsule = (typeof(capsule))simple_strtoul(argv[1], &endp, 16);
+	capsule = (typeof(capsule))hextoul(argv[1], &endp);
 	if (endp == argv[1]) {
 		printf("Invalid address: %s", argv[1]);
 		return CMD_RET_FAILURE;
@@ -117,7 +117,7 @@
 	if (argc != 2)
 		return CMD_RET_USAGE;
 
-	capsule = (typeof(capsule))simple_strtoul(argv[1], &endp, 16);
+	capsule = (typeof(capsule))hextoul(argv[1], &endp);
 	if (endp == argv[1]) {
 		printf("Invalid address: %s", argv[1]);
 		return CMD_RET_FAILURE;
@@ -256,7 +256,7 @@
 		argc--;
 		argv++;
 
-		capsule_id = simple_strtoul(argv[0], &endp, 16);
+		capsule_id = hextoul(argv[0], &endp);
 		if (capsule_id < 0 || capsule_id > 0xffff)
 			return CMD_RET_USAGE;
 
@@ -983,7 +983,7 @@
 				r = CMD_RET_USAGE;
 				goto out;
 			}
-			id = (int)simple_strtoul(argv[1], &endp, 16);
+			id = (int)hextoul(argv[1], &endp);
 			if (*endp != '\0' || id > 0xffff)
 				return CMD_RET_USAGE;
 
@@ -1113,7 +1113,7 @@
 
 	guid = efi_global_variable_guid;
 	for (i = 1; i < argc; i++, argv++) {
-		id = (int)simple_strtoul(argv[1], &endp, 16);
+		id = (int)hextoul(argv[1], &endp);
 		if (*endp != '\0' || id > 0xffff)
 			return CMD_RET_FAILURE;
 
@@ -1410,7 +1410,7 @@
 	if (argc != 2)
 		return CMD_RET_USAGE;
 
-	bootnext = (u16)simple_strtoul(argv[1], &endp, 16);
+	bootnext = (u16)hextoul(argv[1], &endp);
 	if (*endp) {
 		printf("invalid value: %s\n", argv[1]);
 		r = CMD_RET_FAILURE;
@@ -1469,7 +1469,7 @@
 		return CMD_RET_FAILURE;
 
 	for (i = 0; i < argc; i++) {
-		id = (int)simple_strtoul(argv[i], &endp, 16);
+		id = (int)hextoul(argv[i], &endp);
 		if (*endp != '\0' || id > 0xffff) {
 			printf("invalid value: %s\n", argv[i]);
 			r = CMD_RET_FAILURE;
diff --git a/cmd/elf.c b/cmd/elf.c
index d44b95d..d75b214 100644
--- a/cmd/elf.c
+++ b/cmd/elf.c
@@ -115,7 +115,7 @@
 	if (argc < 2)
 		addr = image_load_addr;
 	else
-		addr = simple_strtoul(argv[1], NULL, 16);
+		addr = hextoul(argv[1], NULL);
 
 #if defined(CONFIG_CMD_NET)
 	/*
@@ -200,7 +200,7 @@
 	}
 
 	if (!bootaddr)
-		bootaddr = simple_strtoul(tmp, NULL, 16);
+		bootaddr = hextoul(tmp, NULL);
 
 	/*
 	 * Check to see if the bootline is defined in the 'bootargs' parameter.
diff --git a/cmd/fastboot.c b/cmd/fastboot.c
index ad5c064..033a2c9 100644
--- a/cmd/fastboot.c
+++ b/cmd/fastboot.c
@@ -112,13 +112,13 @@
 			case 'l':
 				if (--argc <= 0)
 					return CMD_RET_USAGE;
-				buf_addr = simple_strtoul(*++argv, NULL, 16);
+				buf_addr = hextoul(*++argv, NULL);
 				goto NXTARG;
 
 			case 's':
 				if (--argc <= 0)
 					return CMD_RET_USAGE;
-				buf_size = simple_strtoul(*++argv, NULL, 16);
+				buf_size = hextoul(*++argv, NULL);
 				goto NXTARG;
 
 			default:
diff --git a/cmd/fdt.c b/cmd/fdt.c
index baec055..c42f1c7 100644
--- a/cmd/fdt.c
+++ b/cmd/fdt.c
@@ -143,7 +143,7 @@
 			return 0;
 		}
 
-		addr = simple_strtoul(argv[0], NULL, 16);
+		addr = hextoul(argv[0], NULL);
 		blob = map_sysmem(addr, 0);
 		if (!fdt_valid(&blob))
 			return 1;
@@ -157,7 +157,7 @@
 			int  err;
 
 			/* Optional new length */
-			len = simple_strtoul(argv[1], NULL, 16);
+			len = hextoul(argv[1], NULL);
 			if (len < fdt_totalsize(blob)) {
 				printf("New length %d < existing length %d, ignoring\n",
 				       len, fdt_totalsize(blob));
@@ -195,11 +195,11 @@
 		/*
 		 * Set the address and length of the fdt.
 		 */
-		working_fdt = (struct fdt_header *)simple_strtoul(argv[2], NULL, 16);
+		working_fdt = (struct fdt_header *)hextoul(argv[2], NULL);
 		if (!fdt_valid(&working_fdt))
 			return 1;
 
-		newaddr = (struct fdt_header *)simple_strtoul(argv[3],NULL,16);
+		newaddr = (struct fdt_header *)hextoul(argv[3], NULL);
 
 		/*
 		 * If the user specifies a length, use that.  Otherwise use the
@@ -208,7 +208,7 @@
 		if (argc <= 4) {
 			len = fdt_totalsize(working_fdt);
 		} else {
-			len = simple_strtoul(argv[4], NULL, 16);
+			len = hextoul(argv[4], NULL);
 			if (len < fdt_totalsize(working_fdt)) {
 				printf ("New length 0x%X < existing length "
 					"0x%X, aborting.\n",
@@ -364,21 +364,22 @@
 		}
 
 		if (subcmd[0] == 'n' || (subcmd[0] == 's' && argc == 5)) {
-			int reqIndex = -1;
+			int req_index = -1;
 			int startDepth = fdt_node_depth(
 				working_fdt, nodeoffset);
 			int curDepth = startDepth;
-			int curIndex = -1;
+			int cur_index = -1;
 			int nextNodeOffset = fdt_next_node(
 				working_fdt, nodeoffset, &curDepth);
 
 			if (subcmd[0] == 'n')
-				reqIndex = simple_strtoul(argv[5], NULL, 16);
+				req_index = hextoul(argv[5], NULL);
 
 			while (curDepth > startDepth) {
 				if (curDepth == startDepth + 1)
-					curIndex++;
-				if (subcmd[0] == 'n' && curIndex == reqIndex) {
+					cur_index++;
+				if (subcmd[0] == 'n' &&
+				    cur_index == req_index) {
 					const char *node_name;
 
 					node_name = fdt_get_name(working_fdt,
@@ -394,7 +395,7 @@
 			}
 			if (subcmd[0] == 's') {
 				/* get the num nodes at this level */
-				env_set_ulong(var, curIndex + 1);
+				env_set_ulong(var, cur_index + 1);
 			} else {
 				/* node index not found */
 				printf("libfdt node not found\n");
@@ -548,7 +549,7 @@
 	 * Set boot cpu id
 	 */
 	} else if (strncmp(argv[1], "boo", 3) == 0) {
-		unsigned long tmp = simple_strtoul(argv[2], NULL, 16);
+		unsigned long tmp = hextoul(argv[2], NULL);
 		fdt_set_boot_cpuid_phys(working_fdt, tmp);
 
 	/*
@@ -600,7 +601,7 @@
 				return err;
 			}
 		} else if (argv[2][0] == 'd') {
-			unsigned long idx = simple_strtoul(argv[3], NULL, 16);
+			unsigned long idx = hextoul(argv[3], NULL);
 			int err = fdt_del_mem_rsv(working_fdt, idx);
 
 			if (err < 0) {
@@ -636,8 +637,8 @@
 			return CMD_RET_USAGE;
 
 		if (argc == 4) {
-			initrd_start = simple_strtoul(argv[2], NULL, 16);
-			initrd_end = simple_strtoul(argv[3], NULL, 16);
+			initrd_start = hextoul(argv[2], NULL);
+			initrd_end = hextoul(argv[3], NULL);
 		}
 
 		fdt_chosen(working_fdt);
@@ -654,7 +655,7 @@
 			return CMD_RET_FAILURE;
 
 		if (argc > 2) {
-			addr = simple_strtoul(argv[2], NULL, 16);
+			addr = hextoul(argv[2], NULL);
 			blob = map_sysmem(addr, 0);
 		} else {
 			blob = (struct fdt_header *)gd->fdt_blob;
@@ -691,7 +692,7 @@
 		if (!working_fdt)
 			return CMD_RET_FAILURE;
 
-		addr = simple_strtoul(argv[2], NULL, 16);
+		addr = hextoul(argv[2], NULL);
 		blob = map_sysmem(addr, 0);
 		if (!fdt_valid(&blob))
 			return CMD_RET_FAILURE;
@@ -706,7 +707,7 @@
 	else if (strncmp(argv[1], "re", 2) == 0) {
 		uint extrasize;
 		if (argc > 2)
-			extrasize = simple_strtoul(argv[2], NULL, 16);
+			extrasize = hextoul(argv[2], NULL);
 		else
 			extrasize = 0;
 		fdt_shrink_to_minimum(working_fdt, extrasize);
@@ -797,7 +798,7 @@
 			}
 			if (!isxdigit(*newp))
 				break;
-			tmp = simple_strtoul(newp, &newp, 16);
+			tmp = hextoul(newp, &newp);
 			*data++ = tmp & 0xFF;
 			*len    = *len + 1;
 		}
@@ -883,7 +884,7 @@
 
 	env_max_dump = env_get("fdt_max_dump");
 	if (env_max_dump)
-		max_dump = simple_strtoul(env_max_dump, NULL, 16);
+		max_dump = hextoul(env_max_dump, NULL);
 
 	/*
 	 * It is a string, but it may have multiple strings (embedded '\0's).
diff --git a/cmd/flash.c b/cmd/flash.c
index 240871e..bc93e98 100644
--- a/cmd/flash.c
+++ b/cmd/flash.c
@@ -151,7 +151,7 @@
 	char *ep;
 	char len_used; /* indicates if the "start +length" form used */
 
-	*addr_first = simple_strtoul(arg1, &ep, 16);
+	*addr_first = hextoul(arg1, &ep);
 	if (ep == arg1 || *ep != '\0')
 		return -1;
 
@@ -161,7 +161,7 @@
 		++arg2;
 	}
 
-	*addr_last = simple_strtoul(arg2, &ep, 16);
+	*addr_last = hextoul(arg2, &ep);
 	if (ep == arg2 || *ep != '\0')
 		return -1;
 
@@ -287,7 +287,7 @@
 		return 0;
 	}
 
-	bank = simple_strtoul(argv[1], NULL, 16);
+	bank = hextoul(argv[1], NULL);
 	if ((bank < 1) || (bank > CONFIG_SYS_MAX_FLASH_BANKS)) {
 		printf ("Only FLASH Banks # 1 ... # %d supported\n",
 			CONFIG_SYS_MAX_FLASH_BANKS);
@@ -366,7 +366,7 @@
 		return CMD_RET_USAGE;
 
 	if (strcmp(argv[1], "bank") == 0) {
-		bank = simple_strtoul(argv[2], NULL, 16);
+		bank = hextoul(argv[2], NULL);
 		if ((bank < 1) || (bank > CONFIG_SYS_MAX_FLASH_BANKS)) {
 			printf ("Only FLASH Banks # 1 ... # %d supported\n",
 				CONFIG_SYS_MAX_FLASH_BANKS);
@@ -547,7 +547,7 @@
 		return CMD_RET_USAGE;
 
 	if (strcmp(argv[2], "bank") == 0) {
-		bank = simple_strtoul(argv[3], NULL, 16);
+		bank = hextoul(argv[3], NULL);
 		if ((bank < 1) || (bank > CONFIG_SYS_MAX_FLASH_BANKS)) {
 			printf ("Only FLASH Banks # 1 ... # %d supported\n",
 				CONFIG_SYS_MAX_FLASH_BANKS);
diff --git a/cmd/fpga.c b/cmd/fpga.c
index 51410a8..3fdd0b3 100644
--- a/cmd/fpga.c
+++ b/cmd/fpga.c
@@ -57,7 +57,7 @@
 	}
 	*fpga_data = local_fpga_data;
 
-	local_data_size = simple_strtoul(argv[2], NULL, 16);
+	local_data_size = hextoul(argv[2], NULL);
 	if (!local_data_size) {
 		debug("fpga: zero size\n");
 		return CMD_RET_USAGE;
@@ -95,8 +95,8 @@
 		 */
 		argc++;
 
-	fpga_sec_info.encflag = (u8)simple_strtoul(argv[4], NULL, 16);
-	fpga_sec_info.authflag = (u8)simple_strtoul(argv[3], NULL, 16);
+	fpga_sec_info.encflag = (u8)hextoul(argv[4], NULL);
+	fpga_sec_info.authflag = (u8)hextoul(argv[3], NULL);
 
 	if (fpga_sec_info.authflag >= FPGA_NO_ENC_OR_NO_AUTH &&
 	    fpga_sec_info.encflag >= FPGA_NO_ENC_OR_NO_AUTH) {
@@ -134,7 +134,7 @@
 		return ret;
 
 	fpga_fsinfo.fstype = FS_TYPE_ANY;
-	fpga_fsinfo.blocksize = (unsigned int)simple_strtoul(argv[3], NULL, 16);
+	fpga_fsinfo.blocksize = (unsigned int)hextoul(argv[3], NULL);
 	fpga_fsinfo.interface = argv[4];
 	fpga_fsinfo.dev_part = argv[5];
 	fpga_fsinfo.filename = argv[6];
@@ -274,7 +274,7 @@
 	} else
 #endif
 	{
-		fpga_data = (void *)simple_strtoul(datastr, NULL, 16);
+		fpga_data = (void *)hextoul(datastr, NULL);
 		debug("*  fpga: cmdline image address = 0x%08lx\n",
 		      (ulong)fpga_data);
 	}
diff --git a/cmd/fpgad.c b/cmd/fpgad.c
index fb2fe63..e65441b 100644
--- a/cmd/fpgad.c
+++ b/cmd/fpgad.c
@@ -49,19 +49,19 @@
 		/*
 		 * FPGA is specified since argc > 2
 		 */
-		fpga = simple_strtoul(argv[1], NULL, 16);
+		fpga = hextoul(argv[1], NULL);
 
 		/*
 		 * Address is specified since argc > 2
 		 */
-		addr = simple_strtoul(argv[2], NULL, 16);
+		addr = hextoul(argv[2], NULL);
 
 		/*
 		 * If another parameter, it is the length to display.
 		 * Length is the number of objects, not number of bytes.
 		 */
 		if (argc > 3)
-			length = simple_strtoul(argv[3], NULL, 16);
+			length = hextoul(argv[3], NULL);
 	}
 
 	nbytes = length * sizeof(u16);
diff --git a/cmd/host.c b/cmd/host.c
index 6aa3d91..2e998ab 100644
--- a/cmd/host.c
+++ b/cmd/host.c
@@ -62,7 +62,7 @@
 	if (argc > 2)
 		return CMD_RET_USAGE;
 	dev_str = argv[0];
-	dev = simple_strtoul(dev_str, &ep, 16);
+	dev = hextoul(dev_str, &ep);
 	if (*ep) {
 		printf("** Bad device specification %s **\n", dev_str);
 		return CMD_RET_USAGE;
@@ -82,7 +82,7 @@
 	if (argc >= 2) {
 		char *ep;
 		char *dev_str = argv[1];
-		int dev = simple_strtoul(dev_str, &ep, 16);
+		int dev = hextoul(dev_str, &ep);
 		if (*ep) {
 			printf("** Bad device specification %s **\n", dev_str);
 			return CMD_RET_USAGE;
@@ -139,7 +139,7 @@
 		return 0;
 	}
 
-	dev = simple_strtoul(argv[1], &ep, 16);
+	dev = hextoul(argv[1], &ep);
 	if (*ep) {
 		printf("** Bad device specification %s **\n", argv[2]);
 		return CMD_RET_USAGE;
diff --git a/cmd/i2c.c b/cmd/i2c.c
index 0e1895a..631222c 100644
--- a/cmd/i2c.c
+++ b/cmd/i2c.c
@@ -308,13 +308,13 @@
 	/*
 	 * I2C chip address
 	 */
-	chip = simple_strtoul(argv[1], NULL, 16);
+	chip = hextoul(argv[1], NULL);
 
 	/*
 	 * I2C data address within the chip.  This can be 1 or
 	 * 2 bytes long.  Some day it might be 3 bytes long :-).
 	 */
-	devaddr = simple_strtoul(argv[2], NULL, 16);
+	devaddr = hextoul(argv[2], NULL);
 	alen = get_alen(argv[2], DEFAULT_ADDR_LEN);
 	if (alen > 3)
 		return CMD_RET_USAGE;
@@ -322,12 +322,12 @@
 	/*
 	 * Length is the number of objects, not number of bytes.
 	 */
-	length = simple_strtoul(argv[3], NULL, 16);
+	length = hextoul(argv[3], NULL);
 
 	/*
 	 * memaddr is the address where to store things in memory
 	 */
-	memaddr = (u_char *)simple_strtoul(argv[4], NULL, 16);
+	memaddr = (u_char *)hextoul(argv[4], NULL);
 
 #if CONFIG_IS_ENABLED(DM_I2C)
 	ret = i2c_get_cur_bus_chip(chip, &dev);
@@ -363,18 +363,18 @@
 	/*
 	 * memaddr is the address where to store things in memory
 	 */
-	memaddr = (u_char *)simple_strtoul(argv[1], NULL, 16);
+	memaddr = (u_char *)hextoul(argv[1], NULL);
 
 	/*
 	 * I2C chip address
 	 */
-	chip = simple_strtoul(argv[2], NULL, 16);
+	chip = hextoul(argv[2], NULL);
 
 	/*
 	 * I2C data address within the chip.  This can be 1 or
 	 * 2 bytes long.  Some day it might be 3 bytes long :-).
 	 */
-	devaddr = simple_strtoul(argv[3], NULL, 16);
+	devaddr = hextoul(argv[3], NULL);
 	alen = get_alen(argv[3], DEFAULT_ADDR_LEN);
 	if (alen > 3)
 		return cmd_usage(cmdtp);
@@ -382,7 +382,7 @@
 	/*
 	 * Length is the number of bytes.
 	 */
-	length = simple_strtoul(argv[4], NULL, 16);
+	length = hextoul(argv[4], NULL);
 
 #if CONFIG_IS_ENABLED(DM_I2C)
 	ret = i2c_get_cur_bus_chip(chip, &dev);
@@ -447,13 +447,13 @@
 	if (argc < 2)
 		return CMD_RET_USAGE;
 
-	chip = simple_strtoul(argv[1], NULL, 16);
+	chip = hextoul(argv[1], NULL);
 	ret = i2c_get_cur_bus_chip(chip, &dev);
 	if (ret)
 		return i2c_report_err(ret, I2C_ERR_READ);
 
 	if (argc > 2) {
-		flags = simple_strtoul(argv[2], NULL, 16);
+		flags = hextoul(argv[2], NULL);
 		ret = i2c_set_chip_flags(dev, flags);
 	} else  {
 		ret = i2c_get_chip_flags(dev, &flags);
@@ -477,13 +477,13 @@
 	if (argc < 2)
 		return CMD_RET_USAGE;
 
-	chip = simple_strtoul(argv[1], NULL, 16);
+	chip = hextoul(argv[1], NULL);
 	ret = i2c_get_cur_bus_chip(chip, &dev);
 	if (ret)
 		return i2c_report_err(ret, I2C_ERR_READ);
 
 	if (argc > 2) {
-		olen = simple_strtoul(argv[2], NULL, 16);
+		olen = hextoul(argv[2], NULL);
 		ret = i2c_set_chip_offset_len(dev, olen);
 	} else  {
 		ret = i2c_get_chip_offset_len(dev);
@@ -543,13 +543,13 @@
 		/*
 		 * I2C chip address
 		 */
-		chip = simple_strtoul(argv[1], NULL, 16);
+		chip = hextoul(argv[1], NULL);
 
 		/*
 		 * I2C data address within the chip.  This can be 1 or
 		 * 2 bytes long.  Some day it might be 3 bytes long :-).
 		 */
-		addr = simple_strtoul(argv[2], NULL, 16);
+		addr = hextoul(argv[2], NULL);
 		alen = get_alen(argv[2], DEFAULT_ADDR_LEN);
 		if (alen > 3)
 			return CMD_RET_USAGE;
@@ -559,7 +559,7 @@
 		 * Length is the number of objects, not number of bytes.
 		 */
 		if (argc > 3)
-			length = simple_strtoul(argv[3], NULL, 16);
+			length = hextoul(argv[3], NULL);
 	}
 
 #if CONFIG_IS_ENABLED(DM_I2C)
@@ -651,12 +651,12 @@
 	/*
 	 * Chip is always specified.
 	 */
-	chip = simple_strtoul(argv[1], NULL, 16);
+	chip = hextoul(argv[1], NULL);
 
 	/*
 	 * Address is always specified.
 	 */
-	addr = simple_strtoul(argv[2], NULL, 16);
+	addr = hextoul(argv[2], NULL);
 	alen = get_alen(argv[2], DEFAULT_ADDR_LEN);
 	if (alen > 3)
 		return CMD_RET_USAGE;
@@ -671,13 +671,13 @@
 	/*
 	 * Value to write is always specified.
 	 */
-	byte = simple_strtoul(argv[3], NULL, 16);
+	byte = hextoul(argv[3], NULL);
 
 	/*
 	 * Optional count
 	 */
 	if (argc == 5)
-		count = simple_strtoul(argv[4], NULL, 16);
+		count = hextoul(argv[4], NULL);
 	else
 		count = 1;
 
@@ -740,12 +740,12 @@
 	/*
 	 * Chip is always specified.
 	 */
-	chip = simple_strtoul(argv[1], NULL, 16);
+	chip = hextoul(argv[1], NULL);
 
 	/*
 	 * Address is always specified.
 	 */
-	addr = simple_strtoul(argv[2], NULL, 16);
+	addr = hextoul(argv[2], NULL);
 	alen = get_alen(argv[2], DEFAULT_ADDR_LEN);
 	if (alen > 3)
 		return CMD_RET_USAGE;
@@ -760,7 +760,7 @@
 	/*
 	 * Count is always specified
 	 */
-	count = simple_strtoul(argv[3], NULL, 16);
+	count = hextoul(argv[3], NULL);
 
 	printf ("CRC32 for %08lx ... %08lx ==> ", addr, addr + count - 1);
 	/*
@@ -840,12 +840,12 @@
 		/*
 		 * Chip is always specified.
 		 */
-		chip = simple_strtoul(argv[1], NULL, 16);
+		chip = hextoul(argv[1], NULL);
 
 		/*
 		 * Address is always specified.
 		 */
-		addr = simple_strtoul(argv[2], NULL, 16);
+		addr = hextoul(argv[2], NULL);
 		alen = get_alen(argv[2], DEFAULT_ADDR_LEN);
 		if (alen > 3)
 			return CMD_RET_USAGE;
@@ -900,7 +900,7 @@
 		else {
 			char *endp;
 
-			data = simple_strtoul(console_buffer, &endp, 16);
+			data = hextoul(console_buffer, &endp);
 			if (size == 1)
 				data = data << 24;
 			else if (size == 2)
@@ -1049,12 +1049,12 @@
 	/*
 	 * Chip is always specified.
 	 */
-	chip = simple_strtoul(argv[1], NULL, 16);
+	chip = hextoul(argv[1], NULL);
 
 	/*
 	 * Address is always specified.
 	 */
-	addr = simple_strtoul(argv[2], NULL, 16);
+	addr = hextoul(argv[2], NULL);
 	alen = get_alen(argv[2], DEFAULT_ADDR_LEN);
 	if (alen > 3)
 		return CMD_RET_USAGE;
@@ -1070,7 +1070,7 @@
 	 * Length is the number of objects, not number of bytes.
 	 */
 	length = 1;
-	length = simple_strtoul(argv[3], NULL, 16);
+	length = hextoul(argv[3], NULL);
 	if (length > sizeof(bytes))
 		length = sizeof(bytes);
 
@@ -1219,7 +1219,7 @@
 	/*
 	 * Chip is always specified.
 	 */
-	chip = simple_strtoul (argv[1], NULL, 16);
+	chip = hextoul(argv[1], NULL);
 
 #if CONFIG_IS_ENABLED(DM_I2C)
 	ret = i2c_get_cur_bus_chip(chip, &dev);
@@ -1673,7 +1673,7 @@
 		return 1;
 	}
 
-	chip = simple_strtoul(argv[1], NULL, 16);
+	chip = hextoul(argv[1], NULL);
 #if CONFIG_IS_ENABLED(DM_I2C)
 	ret = i2c_get_cur_bus_chip(chip, &dev);
 	if (!ret)
diff --git a/cmd/ini.c b/cmd/ini.c
index c075be6..81dfc4c 100644
--- a/cmd/ini.c
+++ b/cmd/ini.c
@@ -236,10 +236,10 @@
 		return CMD_RET_USAGE;
 
 	section = argv[1];
-	file_address = (char *)simple_strtoul(
-		argc < 3 ? env_get("loadaddr") : argv[2], NULL, 16);
-	file_size = (size_t)simple_strtoul(
-		argc < 4 ? env_get("filesize") : argv[3], NULL, 16);
+	file_address = (char *)hextoul(argc < 3 ? env_get("loadaddr") : argv[2],
+					NULL);
+	file_size = (size_t)hextoul(argc < 4 ? env_get("filesize") : argv[3],
+				     NULL);
 
 	return ini_parse(file_address, file_size, ini_handler, (void *)section);
 }
diff --git a/cmd/io.c b/cmd/io.c
index c7e9641..e23ea62 100644
--- a/cmd/io.c
+++ b/cmd/io.c
@@ -51,7 +51,7 @@
 			return 1;
 
 		/* Address is specified since argc > 1 */
-		addr = simple_strtoul(argv[1], NULL, 16);
+		addr = hextoul(argv[1], NULL);
 		addr += base_address;
 
 		/*
@@ -59,7 +59,7 @@
 		 * Length is the number of objects, not number of bytes.
 		 */
 		if (argc > 2)
-			length = simple_strtoul(argv[2], NULL, 16);
+			length = hextoul(argv[2], NULL);
 	}
 
 	bytes = size * length;
@@ -102,8 +102,8 @@
 	if (size < 0)
 		return 1;
 
-	addr = simple_strtoul(argv[1], NULL, 16);
-	val = simple_strtoul(argv[2], NULL, 16);
+	addr = hextoul(argv[1], NULL);
+	val = hextoul(argv[2], NULL);
 
 	if (size == 4)
 		outl((u32) val, addr);
diff --git a/cmd/iotrace.c b/cmd/iotrace.c
index 652ebef..f28359e 100644
--- a/cmd/iotrace.c
+++ b/cmd/iotrace.c
@@ -60,8 +60,8 @@
 	ulong addr = 0, size = 0;
 
 	if (argc == 2) {
-		addr = simple_strtoul(*argv++, NULL, 16);
-		size = simple_strtoul(*argv++, NULL, 16);
+		addr = hextoul(*argv++, NULL);
+		size = hextoul(*argv++, NULL);
 	} else if (argc != 0) {
 		return CMD_RET_USAGE;
 	}
@@ -76,8 +76,8 @@
 	ulong addr = 0, size = 0;
 
 	if (argc == 2) {
-		addr = simple_strtoul(*argv++, NULL, 16);
-		size = simple_strtoul(*argv++, NULL, 16);
+		addr = hextoul(*argv++, NULL);
+		size = hextoul(*argv++, NULL);
 	} else if (argc != 0) {
 		return CMD_RET_USAGE;
 	}
diff --git a/cmd/itest.c b/cmd/itest.c
index 9a441ce..74414cb 100644
--- a/cmd/itest.c
+++ b/cmd/itest.c
@@ -57,7 +57,7 @@
 
 	/* if the parameter starts with a * then assume is a pointer to the value we want */
 	if (s[0] == '*') {
-		addr = simple_strtoul(&s[1], NULL, 16);
+		addr = hextoul(&s[1], NULL);
 		buf = map_physmem(addr, w, MAP_WRBACK);
 		if (!buf && addr) {
 			puts("Failed to map physical memory\n");
@@ -82,7 +82,7 @@
 		unmap_physmem(buf, w);
 		return l;
 	} else {
-		l = simple_strtoul(s, NULL, 16);
+		l = hextoul(s, NULL);
 	}
 
 	/* avoid overflow on mask calculus */
@@ -93,7 +93,7 @@
 {
 	/* if the parameter starts with a * then assume a string pointer else its a literal */
 	if (s[0] == '*') {
-		return (char *)simple_strtoul(&s[1], NULL, 16);
+		return (char *)hextoul(&s[1], NULL);
 	} else if (s[0] == '$') {
 		int i = 2;
 
diff --git a/cmd/jffs2.c b/cmd/jffs2.c
index 9540988..63bd552 100644
--- a/cmd/jffs2.c
+++ b/cmd/jffs2.c
@@ -491,7 +491,7 @@
 		filename = argv[1];
 	}
 	if (argc == 3) {
-		offset = simple_strtoul(argv[1], NULL, 16);
+		offset = hextoul(argv[1], NULL);
 		image_load_addr = offset;
 		filename = argv[2];
 	}
diff --git a/cmd/load.c b/cmd/load.c
index b7894d7..ec3eed1 100644
--- a/cmd/load.c
+++ b/cmd/load.c
@@ -257,11 +257,11 @@
 #endif
 
 	if (argc >= 2) {
-		offset = simple_strtoul(argv[1], NULL, 16);
+		offset = hextoul(argv[1], NULL);
 	}
 #ifdef	CONFIG_SYS_LOADS_BAUD_CHANGE
 	if (argc >= 3) {
-		size = simple_strtoul(argv[2], NULL, 16);
+		size = hextoul(argv[2], NULL);
 	}
 	if (argc == 4) {
 		save_baudrate = (int)simple_strtoul(argv[3], NULL, 10);
@@ -284,7 +284,7 @@
 	}
 #else	/* ! CONFIG_SYS_LOADS_BAUD_CHANGE */
 	if (argc == 3) {
-		size = simple_strtoul(argv[2], NULL, 16);
+		size = hextoul(argv[2], NULL);
 	}
 #endif	/* CONFIG_SYS_LOADS_BAUD_CHANGE */
 
@@ -438,12 +438,12 @@
 	/* pre-set offset from $loadaddr */
 	s = env_get("loadaddr");
 	if (s)
-		offset = simple_strtoul(s, NULL, 16);
+		offset = hextoul(s, NULL);
 
 	load_baudrate = current_baudrate = gd->baudrate;
 
 	if (argc >= 2) {
-		offset = simple_strtoul(argv[1], NULL, 16);
+		offset = hextoul(argv[1], NULL);
 	}
 	if (argc == 3) {
 		load_baudrate = (int)simple_strtoul(argv[2], NULL, 10);
diff --git a/cmd/lzmadec.c b/cmd/lzmadec.c
index 3b8db0a..81924da 100644
--- a/cmd/lzmadec.c
+++ b/cmd/lzmadec.c
@@ -26,11 +26,11 @@
 
 	switch (argc) {
 	case 4:
-		dst_len = simple_strtoul(argv[3], NULL, 16);
+		dst_len = hextoul(argv[3], NULL);
 		/* fall through */
 	case 3:
-		src = simple_strtoul(argv[1], NULL, 16);
-		dst = simple_strtoul(argv[2], NULL, 16);
+		src = hextoul(argv[1], NULL);
+		dst = hextoul(argv[2], NULL);
 		break;
 	default:
 		return CMD_RET_USAGE;
diff --git a/cmd/md5sum.c b/cmd/md5sum.c
index 5ae3ddf..0f0e1d3 100644
--- a/cmd/md5sum.c
+++ b/cmd/md5sum.c
@@ -25,7 +25,7 @@
 	if (*dest == '*') {
 		u8 *ptr;
 
-		ptr = (u8 *)simple_strtoul(dest + 1, NULL, 16);
+		ptr = (u8 *)hextoul(dest + 1, NULL);
 		for (i = 0; i < 16; i++)
 			*ptr++ = sum[i];
 	} else {
@@ -46,7 +46,7 @@
 	if (*verify_str == '*') {
 		u8 *ptr;
 
-		ptr = (u8 *)simple_strtoul(verify_str + 1, NULL, 16);
+		ptr = (u8 *)hextoul(verify_str + 1, NULL);
 		memcpy(vsum, ptr, 16);
 	} else {
 		unsigned int i;
@@ -66,7 +66,7 @@
 
 			*nullp = '\0';
 			*(u8 *)(vsum + i) =
-				simple_strtoul(vsum_str + (i * 2), NULL, 16);
+				hextoul(vsum_str + (i * 2), NULL);
 			*nullp = end;
 		}
 	}
@@ -97,8 +97,8 @@
 			return CMD_RET_USAGE;
 	}
 
-	addr = simple_strtoul(*av++, NULL, 16);
-	len = simple_strtoul(*av++, NULL, 16);
+	addr = hextoul(*av++, NULL);
+	len = hextoul(*av++, NULL);
 
 	buf = map_sysmem(addr, len);
 	md5_wd(buf, len, output, CHUNKSZ_MD5);
@@ -147,8 +147,8 @@
 	if (argc < 3)
 		return CMD_RET_USAGE;
 
-	addr = simple_strtoul(argv[1], NULL, 16);
-	len = simple_strtoul(argv[2], NULL, 16);
+	addr = hextoul(argv[1], NULL);
+	len = hextoul(argv[2], NULL);
 
 	buf = map_sysmem(addr, len);
 	md5_wd(buf, len, output, CHUNKSZ_MD5);
diff --git a/cmd/mdio.c b/cmd/mdio.c
index cfa45ad..3c74326 100644
--- a/cmd/mdio.c
+++ b/cmd/mdio.c
@@ -254,7 +254,7 @@
 	switch (op[0]) {
 	case 'w':
 		if (pos > 1)
-			data = simple_strtoul(argv[pos--], NULL, 16);
+			data = hextoul(argv[pos--], NULL);
 		/* Intentional fall-through - Get reg for read and write */
 	case 'r':
 		if (pos > 1)
diff --git a/cmd/mem.c b/cmd/mem.c
index 1eb83b7..0978df5 100644
--- a/cmd/mem.c
+++ b/cmd/mem.c
@@ -89,14 +89,14 @@
 
 		/* Address is specified since argc > 1
 		*/
-		addr = simple_strtoul(argv[1], NULL, 16);
+		addr = hextoul(argv[1], NULL);
 		addr += base_address;
 
 		/* If another parameter, it is the length to display.
 		 * Length is the number of objects, not number of bytes.
 		 */
 		if (argc > 2)
-			length = simple_strtoul(argv[2], NULL, 16);
+			length = hextoul(argv[2], NULL);
 	}
 
 	bytes = size * length;
@@ -144,7 +144,7 @@
 
 	/* Address is specified since argc > 1
 	*/
-	addr = simple_strtoul(argv[1], NULL, 16);
+	addr = hextoul(argv[1], NULL);
 	addr += base_address;
 
 	/* Get the value to write.
@@ -152,11 +152,11 @@
 	if (SUPPORT_64BIT_DATA)
 		writeval = simple_strtoull(argv[2], NULL, 16);
 	else
-		writeval = simple_strtoul(argv[2], NULL, 16);
+		writeval = hextoul(argv[2], NULL);
 
 	/* Count ? */
 	if (argc == 4) {
-		count = simple_strtoul(argv[3], NULL, 16);
+		count = hextoul(argv[3], NULL);
 	} else {
 		count = 1;
 	}
@@ -258,13 +258,13 @@
 	       size == 4 ? "word" :
 	       size == 2 ? "halfword" : "byte";
 
-	addr1 = simple_strtoul(argv[1], NULL, 16);
+	addr1 = hextoul(argv[1], NULL);
 	addr1 += base_address;
 
-	addr2 = simple_strtoul(argv[2], NULL, 16);
+	addr2 = hextoul(argv[2], NULL);
 	addr2 += base_address;
 
-	count = simple_strtoul(argv[3], NULL, 16);
+	count = hextoul(argv[3], NULL);
 
 	bytes = size * count;
 	base = buf1 = map_sysmem(addr1, bytes);
@@ -321,13 +321,13 @@
 	if ((size = cmd_get_data_size(argv[0], 4)) < 0)
 		return 1;
 
-	addr = simple_strtoul(argv[1], NULL, 16);
+	addr = hextoul(argv[1], NULL);
 	addr += base_address;
 
-	dest = simple_strtoul(argv[2], NULL, 16);
+	dest = hextoul(argv[2], NULL);
 	dest += base_address;
 
-	count = simple_strtoul(argv[3], NULL, 16);
+	count = hextoul(argv[3], NULL);
 
 	if (count == 0) {
 		puts ("Zero length ???\n");
@@ -405,7 +405,7 @@
 			if (ch == 'q')
 				quiet = true;
 			else if (ch == 'l' && isxdigit(argv[0][2]))
-				limit = simple_strtoul(argv[0] + 2, NULL, 16);
+				limit = hextoul(argv[0] + 2, NULL);
 			else
 				return CMD_RET_USAGE;
 			argc--;
@@ -413,11 +413,11 @@
 		}
 
 		/* Address is specified since argc > 1 */
-		addr = simple_strtoul(argv[0], NULL, 16);
+		addr = hextoul(argv[0], NULL);
 		addr += base_address;
 
 		/* Length is the number of objects, not number of bytes */
-		length = simple_strtoul(argv[1], NULL, 16);
+		length = hextoul(argv[1], NULL);
 
 		/* Read the bytes to search for */
 		end = search_buf + sizeof(search_buf);
@@ -434,7 +434,7 @@
 				ptr += len;
 				continue;
 			} else {
-				u32 val = simple_strtoul(argv[i], NULL, 16);
+				u32 val = hextoul(argv[i], NULL);
 
 				switch (size) {
 				case 1:
@@ -512,7 +512,7 @@
 	if (argc > 1) {
 		/* Set new base address.
 		*/
-		base_address = simple_strtoul(argv[1], NULL, 16);
+		base_address = hextoul(argv[1], NULL);
 	}
 	/* Print the current base address.
 	*/
@@ -543,11 +543,11 @@
 
 	/* Address is always specified.
 	*/
-	addr = simple_strtoul(argv[1], NULL, 16);
+	addr = hextoul(argv[1], NULL);
 
 	/* Length is the number of objects, not number of bytes.
 	*/
-	length = simple_strtoul(argv[2], NULL, 16);
+	length = hextoul(argv[2], NULL);
 
 	bytes = size * length;
 	buf = map_sysmem(addr, bytes);
@@ -636,17 +636,17 @@
 
 	/* Address is always specified.
 	*/
-	addr = simple_strtoul(argv[1], NULL, 16);
+	addr = hextoul(argv[1], NULL);
 
 	/* Length is the number of objects, not number of bytes.
 	*/
-	length = simple_strtoul(argv[2], NULL, 16);
+	length = hextoul(argv[2], NULL);
 
 	/* data to write */
 	if (SUPPORT_64BIT_DATA)
 		data = simple_strtoull(argv[3], NULL, 16);
 	else
-		data = simple_strtoul(argv[3], NULL, 16);
+		data = hextoul(argv[3], NULL);
 
 	bytes = size * length;
 	buf = map_sysmem(addr, bytes);
@@ -1175,7 +1175,7 @@
 
 		/* Address is specified since argc > 1
 		*/
-		addr = simple_strtoul(argv[1], NULL, 16);
+		addr = hextoul(argv[1], NULL);
 		addr += base_address;
 	}
 
@@ -1215,7 +1215,7 @@
 			if (SUPPORT_64BIT_DATA)
 				i = simple_strtoull(console_buffer, &endp, 16);
 			else
-				i = simple_strtoul(console_buffer, &endp, 16);
+				i = hextoul(console_buffer, &endp);
 			nbytes = endp - console_buffer;
 			if (nbytes) {
 				/* good enough to not time out
@@ -1282,11 +1282,11 @@
 	if (argc < 3 || argc > 4)
 		return CMD_RET_USAGE;
 
-	len = simple_strtoul(argv[2], NULL, 16);
-	addr = simple_strtoul(argv[1], NULL, 16);
+	len = hextoul(argv[2], NULL);
+	addr = hextoul(argv[1], NULL);
 
 	if (argc == 4) {
-		seed = simple_strtoul(argv[3], NULL, 16);
+		seed = hextoul(argv[3], NULL);
 		if (seed == 0) {
 			printf("The seed cannot be 0. Using 0xDEADBEEF.\n");
 			seed = 0xDEADBEEF;
diff --git a/cmd/mfsl.c b/cmd/mfsl.c
index 31f5b36..0c78720 100644
--- a/cmd/mfsl.c
+++ b/cmd/mfsl.c
@@ -23,8 +23,8 @@
 	if (argc < 2)
 		return CMD_RET_USAGE;
 
-	fslnum = (unsigned int)simple_strtoul (argv[1], NULL, 16);
-	blocking = (unsigned int)simple_strtoul (argv[2], NULL, 16);
+	fslnum = (unsigned int)hextoul(argv[1], NULL);
+	blocking = (unsigned int)hextoul(argv[2], NULL);
 	if (fslnum < 0 || fslnum >= XILINX_FSL_NUMBER) {
 		puts ("Bad number of FSL\n");
 		return CMD_RET_USAGE;
@@ -178,9 +178,9 @@
 	if (argc < 3)
 		return CMD_RET_USAGE;
 
-	fslnum = (unsigned int)simple_strtoul (argv[1], NULL, 16);
-	num = (unsigned int)simple_strtoul (argv[2], NULL, 16);
-	blocking = (unsigned int)simple_strtoul (argv[3], NULL, 16);
+	fslnum = (unsigned int)hextoul(argv[1], NULL);
+	num = (unsigned int)hextoul(argv[2], NULL);
+	blocking = (unsigned int)hextoul(argv[3], NULL);
 	if (fslnum < 0 || fslnum >= XILINX_FSL_NUMBER)
 		return CMD_RET_USAGE;
 
@@ -332,8 +332,8 @@
 	if (argc < 2)
 		return CMD_RET_USAGE;
 
-	reg = (unsigned int)simple_strtoul (argv[1], NULL, 16);
-	val = (unsigned int)simple_strtoul (argv[2], NULL, 16);
+	reg = (unsigned int)hextoul(argv[1], NULL);
+	val = (unsigned int)hextoul(argv[2], NULL);
 	switch (reg) {
 	case 0x1:
 		if (argc > 2) {
diff --git a/cmd/mii.c b/cmd/mii.c
index fe8602e..fab420e 100644
--- a/cmd/mii.c
+++ b/cmd/mii.c
@@ -267,10 +267,10 @@
 	unsigned char * phi)
 {
 	char * end;
-	*plo = simple_strtoul(input, &end, 16);
+	*plo = hextoul(input, &end);
 	if (*end == '-') {
 		end++;
-		*phi = simple_strtoul(end, NULL, 16);
+		*phi = hextoul(end, NULL);
 	}
 	else {
 		*phi = *plo;
@@ -319,9 +319,9 @@
 		if (argc >= 4)
 			extract_range(argv[3], &reglo, &reghi);
 		if (argc >= 5)
-			data = simple_strtoul(argv[4], NULL, 16);
+			data = hextoul(argv[4], NULL);
 		if (argc >= 6)
-			mask = simple_strtoul(argv[5], NULL, 16);
+			mask = hextoul(argv[5], NULL);
 	}
 
 	if (addrhi > 31 && strncmp(op, "de", 2)) {
diff --git a/cmd/misc.c b/cmd/misc.c
index ef540e8..bcd8d96 100644
--- a/cmd/misc.c
+++ b/cmd/misc.c
@@ -57,9 +57,9 @@
 		return ret;
 	}
 
-	offset = simple_strtoul(argv[1], NULL, 16);
-	buf = (void *)simple_strtoul(argv[2], NULL, 16);
-	size = simple_strtoul(argv[3], NULL, 16);
+	offset = hextoul(argv[1], NULL);
+	buf = (void *)hextoul(argv[2], NULL);
+	size = hextoul(argv[3], NULL);
 
 	if (op == MISC_OP_READ)
 		misc_op = misc_read;
diff --git a/cmd/mmc.c b/cmd/mmc.c
index b942576..f722778 100644
--- a/cmd/mmc.c
+++ b/cmd/mmc.c
@@ -189,7 +189,7 @@
 	if (argc != 2)
 		return CMD_RET_USAGE;
 
-	key_addr = (void *)simple_strtoul(argv[1], NULL, 16);
+	key_addr = (void *)hextoul(argv[1], NULL);
 	if (!confirm_key_prog())
 		return CMD_RET_FAILURE;
 	if (mmc_rpmb_set_key(mmc, key_addr)) {
@@ -211,12 +211,12 @@
 	if (argc < 4)
 		return CMD_RET_USAGE;
 
-	addr = (void *)simple_strtoul(argv[1], NULL, 16);
-	blk = simple_strtoul(argv[2], NULL, 16);
-	cnt = simple_strtoul(argv[3], NULL, 16);
+	addr = (void *)hextoul(argv[1], NULL);
+	blk = hextoul(argv[2], NULL);
+	cnt = hextoul(argv[3], NULL);
 
 	if (argc == 5)
-		key_addr = (void *)simple_strtoul(argv[4], NULL, 16);
+		key_addr = (void *)hextoul(argv[4], NULL);
 
 	printf("\nMMC RPMB read: dev # %d, block # %d, count %d ... ",
 	       curr_device, blk, cnt);
@@ -240,10 +240,10 @@
 	if (argc != 5)
 		return CMD_RET_USAGE;
 
-	addr = (void *)simple_strtoul(argv[1], NULL, 16);
-	blk = simple_strtoul(argv[2], NULL, 16);
-	cnt = simple_strtoul(argv[3], NULL, 16);
-	key_addr = (void *)simple_strtoul(argv[4], NULL, 16);
+	addr = (void *)hextoul(argv[1], NULL);
+	blk = hextoul(argv[2], NULL);
+	cnt = hextoul(argv[3], NULL);
+	key_addr = (void *)hextoul(argv[4], NULL);
 
 	printf("\nMMC RPMB write: dev # %d, block # %d, count %d ... ",
 	       curr_device, blk, cnt);
@@ -334,9 +334,9 @@
 	if (argc != 4)
 		return CMD_RET_USAGE;
 
-	addr = (void *)simple_strtoul(argv[1], NULL, 16);
-	blk = simple_strtoul(argv[2], NULL, 16);
-	cnt = simple_strtoul(argv[3], NULL, 16);
+	addr = (void *)hextoul(argv[1], NULL);
+	blk = hextoul(argv[2], NULL);
+	cnt = hextoul(argv[3], NULL);
 
 	mmc = init_mmc_device(curr_device, false);
 	if (!mmc)
@@ -379,8 +379,8 @@
 	if (argc != 3)
 		return CMD_RET_USAGE;
 
-	addr = (void *)simple_strtoul(argv[1], NULL, 16);
-	blk = simple_strtoul(argv[2], NULL, 16);
+	addr = (void *)hextoul(argv[1], NULL);
+	blk = hextoul(argv[2], NULL);
 
 	if (!is_sparse_image(addr)) {
 		printf("Not a sparse image\n");
@@ -427,9 +427,9 @@
 	if (argc != 4)
 		return CMD_RET_USAGE;
 
-	addr = (void *)simple_strtoul(argv[1], NULL, 16);
-	blk = simple_strtoul(argv[2], NULL, 16);
-	cnt = simple_strtoul(argv[3], NULL, 16);
+	addr = (void *)hextoul(argv[1], NULL);
+	blk = hextoul(argv[2], NULL);
+	cnt = hextoul(argv[3], NULL);
 
 	mmc = init_mmc_device(curr_device, false);
 	if (!mmc)
@@ -457,8 +457,8 @@
 	if (argc != 3)
 		return CMD_RET_USAGE;
 
-	blk = simple_strtoul(argv[1], NULL, 16);
-	cnt = simple_strtoul(argv[2], NULL, 16);
+	blk = hextoul(argv[1], NULL);
+	cnt = hextoul(argv[2], NULL);
 
 	mmc = init_mmc_device(curr_device, false);
 	if (!mmc)
@@ -908,7 +908,7 @@
 
 	if (argc != 2)
 		return CMD_RET_USAGE;
-	val = simple_strtoul(argv[1], NULL, 16);
+	val = hextoul(argv[1], NULL);
 
 	mmc = find_mmc_device(curr_device);
 	if (!mmc) {
diff --git a/cmd/mtd.c b/cmd/mtd.c
index c22478c..ad5cc98 100644
--- a/cmd/mtd.c
+++ b/cmd/mtd.c
@@ -285,12 +285,12 @@
 			goto out_put_mtd;
 		}
 
-		user_addr = simple_strtoul(argv[0], NULL, 16);
+		user_addr = hextoul(argv[0], NULL);
 		argc--;
 		argv++;
 	}
 
-	start_off = argc > 0 ? simple_strtoul(argv[0], NULL, 16) : 0;
+	start_off = argc > 0 ? hextoul(argv[0], NULL) : 0;
 	if (!mtd_is_aligned_with_min_io_size(mtd, start_off)) {
 		printf("Offset not aligned with a page (0x%x)\n",
 		       mtd->writesize);
@@ -299,7 +299,7 @@
 	}
 
 	default_len = dump ? mtd->writesize : mtd->size;
-	len = argc > 1 ? simple_strtoul(argv[1], NULL, 16) : default_len;
+	len = argc > 1 ? hextoul(argv[1], NULL) : default_len;
 	if (!mtd_is_aligned_with_min_io_size(mtd, len)) {
 		len = round_up(len, mtd->writesize);
 		printf("Size not on a page boundary (0x%x), rounding to 0x%llx\n",
@@ -411,8 +411,8 @@
 	argc -= 2;
 	argv += 2;
 
-	off = argc > 0 ? simple_strtoul(argv[0], NULL, 16) : 0;
-	len = argc > 1 ? simple_strtoul(argv[1], NULL, 16) : mtd->size;
+	off = argc > 0 ? hextoul(argv[0], NULL) : 0;
+	len = argc > 1 ? hextoul(argv[1], NULL) : mtd->size;
 
 	if (!mtd_is_aligned_with_block_size(mtd, off)) {
 		printf("Offset not aligned with a block (0x%x)\n",
diff --git a/cmd/mvebu/bubt.c b/cmd/mvebu/bubt.c
index 5cd520e..d4f381b 100644
--- a/cmd/mvebu/bubt.c
+++ b/cmd/mvebu/bubt.c
@@ -137,7 +137,7 @@
 
 	addr_str = env_get("loadaddr");
 	if (addr_str)
-		addr = simple_strtoul(addr_str, NULL, 16);
+		addr = hextoul(addr_str, NULL);
 	else
 		addr = CONFIG_SYS_LOAD_ADDR;
 
diff --git a/cmd/mvebu/comphy_rx_training.c b/cmd/mvebu/comphy_rx_training.c
index 0798dec..25a9e15 100644
--- a/cmd/mvebu/comphy_rx_training.c
+++ b/cmd/mvebu/comphy_rx_training.c
@@ -25,8 +25,8 @@
 		return -1;
 	}
 
-	cp_index = simple_strtoul(argv[1], NULL, 16);
-	comphy_index = simple_strtoul(argv[2], NULL, 16);
+	cp_index = hextoul(argv[1], NULL);
+	comphy_index = hextoul(argv[2], NULL);
 
 	ret = uclass_get(UCLASS_MISC, &uc);
 	if (ret) {
diff --git a/cmd/nand.c b/cmd/nand.c
index 97e117a..34371b9 100644
--- a/cmd/nand.c
+++ b/cmd/nand.c
@@ -543,7 +543,7 @@
 		if (argc < 3)
 			goto usage;
 
-		off = (int)simple_strtoul(argv[2], NULL, 16);
+		off = (int)hextoul(argv[2], NULL);
 		ret = nand_dump(mtd, off, !strcmp(&cmd[4], ".oob"), repeat);
 
 		return ret == 0 ? 1 : 0;
@@ -559,7 +559,7 @@
 		if (argc < 4)
 			goto usage;
 
-		addr = (ulong)simple_strtoul(argv[2], NULL, 16);
+		addr = (ulong)hextoul(argv[2], NULL);
 
 		read = strncmp(cmd, "read", 4) == 0; /* 1 = read, 0 = write */
 		printf("\nNAND %s: ", read ? "read" : "write");
@@ -713,7 +713,7 @@
 			goto usage;
 
 		while (argc > 0) {
-			addr = simple_strtoul(*argv, NULL, 16);
+			addr = hextoul(*argv, NULL);
 
 			if (mtd_block_markbad(mtd, addr)) {
 				printf("block 0x%08lx NOT marked "
@@ -957,7 +957,7 @@
 			if (argc > 3)
 				goto usage;
 			if (argc == 3)
-				addr = simple_strtoul(argv[1], NULL, 16);
+				addr = hextoul(argv[1], NULL);
 			else
 				addr = CONFIG_SYS_LOAD_ADDR;
 
@@ -975,17 +975,17 @@
 		boot_device = env_get("bootdevice");
 		break;
 	case 2:
-		addr = simple_strtoul(argv[1], NULL, 16);
+		addr = hextoul(argv[1], NULL);
 		boot_device = env_get("bootdevice");
 		break;
 	case 3:
-		addr = simple_strtoul(argv[1], NULL, 16);
+		addr = hextoul(argv[1], NULL);
 		boot_device = argv[2];
 		break;
 	case 4:
-		addr = simple_strtoul(argv[1], NULL, 16);
+		addr = hextoul(argv[1], NULL);
 		boot_device = argv[2];
-		offset = simple_strtoul(argv[3], NULL, 16);
+		offset = hextoul(argv[3], NULL);
 		break;
 	default:
 #if defined(CONFIG_CMD_MTDPARTS)
@@ -1003,7 +1003,7 @@
 	}
 	bootstage_mark(BOOTSTAGE_ID_NAND_BOOT_DEVICE);
 
-	idx = simple_strtoul(boot_device, NULL, 16);
+	idx = hextoul(boot_device, NULL);
 
 	mtd = get_nand_dev_by_index(idx);
 	if (!mtd) {
diff --git a/cmd/net.c b/cmd/net.c
index 76c7e75..651c141 100644
--- a/cmd/net.c
+++ b/cmd/net.c
@@ -205,7 +205,7 @@
 	/* pre-set image_load_addr */
 	s = env_get("loadaddr");
 	if (s != NULL)
-		image_load_addr = simple_strtoul(s, NULL, 16);
+		image_load_addr = hextoul(s, NULL);
 
 	switch (argc) {
 	case 1:
@@ -220,7 +220,7 @@
 		 * form must be written in a format which can not be
 		 * mis-interpreted as a valid number.
 		 */
-		addr = simple_strtoul(argv[1], &end, 16);
+		addr = hextoul(argv[1], &end);
 		if (end == (argv[1] + strlen(argv[1]))) {
 			image_load_addr = addr;
 			/* refresh bootfile name from env */
@@ -234,7 +234,7 @@
 		break;
 
 	case 3:
-		image_load_addr = simple_strtoul(argv[1], NULL, 16);
+		image_load_addr = hextoul(argv[1], NULL);
 		net_boot_file_name_explicit = true;
 		copy_filename(net_boot_file_name, argv[2],
 			      sizeof(net_boot_file_name));
diff --git a/cmd/nvedit.c b/cmd/nvedit.c
index d14ba10..02a99b4 100644
--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
@@ -358,7 +358,7 @@
 
 	s = env_get(varname);
 	if (s)
-		value = simple_strtoul(s, &endp, 16);
+		value = hextoul(s, &endp);
 	if (!s || endp == s)
 		return default_val;
 
@@ -984,7 +984,7 @@
 			case 's':		/* size given */
 				if (--argc <= 0)
 					return cmd_usage(cmdtp);
-				size = simple_strtoul(*++argv, NULL, 16);
+				size = hextoul(*++argv, NULL);
 				goto NXTARG;
 			case 't':		/* text format */
 				if (fmt++)
@@ -1001,7 +1001,7 @@
 	if (argc < 1)
 		return CMD_RET_USAGE;
 
-	addr = simple_strtoul(argv[0], NULL, 16);
+	addr = hextoul(argv[0], NULL);
 	ptr = map_sysmem(addr, size);
 
 	if (size)
@@ -1140,11 +1140,11 @@
 	if (sep != '\n' && crlf_is_lf )
 		crlf_is_lf = 0;
 
-	addr = simple_strtoul(argv[0], NULL, 16);
+	addr = hextoul(argv[0], NULL);
 	ptr = map_sysmem(addr, 0);
 
 	if (argc >= 2 && strcmp(argv[1], "-")) {
-		size = simple_strtoul(argv[1], NULL, 16);
+		size = hextoul(argv[1], NULL);
 	} else if (chk) {
 		puts("## Error: external checksum format must pass size\n");
 		return CMD_RET_FAILURE;
diff --git a/cmd/nvedit_efi.c b/cmd/nvedit_efi.c
index d5e9382..676bbda 100644
--- a/cmd/nvedit_efi.c
+++ b/cmd/nvedit_efi.c
@@ -471,12 +471,12 @@
 
 			argc--;
 			argv++;
-			addr = simple_strtoul(argv[0], &ep, 16);
+			addr = hextoul(argv[0], &ep);
 			if (*ep != ':')
 				return CMD_RET_USAGE;
 
 			/* 0 should be allowed for delete */
-			size = simple_strtoul(++ep, NULL, 16);
+			size = hextoul(++ep, NULL);
 
 			value_on_memory = true;
 		} else if (!strcmp(argv[0], "-v")) {
diff --git a/cmd/onenand.c b/cmd/onenand.c
index 216458b..852ed5c 100644
--- a/cmd/onenand.c
+++ b/cmd/onenand.c
@@ -398,7 +398,7 @@
 	if ((s != NULL) && (!strcmp(s, ".oob")))
 		oob = 1;
 
-	addr = (ulong)simple_strtoul(argv[1], NULL, 16);
+	addr = (ulong)hextoul(argv[1], NULL);
 
 	printf("\nOneNAND read: ");
 	if (arg_off_size_onenand(argc - 2, argv + 2, &ofs, &len) != 0)
@@ -425,7 +425,7 @@
 	if (strncmp(argv[0] + 6, "yaffs", 5) == 0)
 		withoob = 1;
 
-	addr = (ulong)simple_strtoul(argv[1], NULL, 16);
+	addr = (ulong)hextoul(argv[1], NULL);
 
 	printf("\nOneNAND write: ");
 	if (arg_off_size_onenand(argc - 2, argv + 2, &ofs, &len) != 0)
@@ -512,7 +512,7 @@
 		return CMD_RET_USAGE;
 
 	s = strchr(argv[0], '.');
-	ofs = (int)simple_strtoul(argv[1], NULL, 16);
+	ofs = (int)hextoul(argv[1], NULL);
 
 	if (s != NULL && strcmp(s, ".oob") == 0)
 		ret = onenand_dump(mtd, ofs, 1);
@@ -535,7 +535,7 @@
 		return CMD_RET_USAGE;
 
 	while (argc > 0) {
-		addr = simple_strtoul(*argv, NULL, 16);
+		addr = hextoul(*argv, NULL);
 
 		if (mtd_block_markbad(mtd, addr)) {
 			printf("block 0x%08lx NOT marked "
diff --git a/cmd/osd.c b/cmd/osd.c
index 703d640..8557894 100644
--- a/cmd/osd.c
+++ b/cmd/osd.c
@@ -99,10 +99,10 @@
 		return CMD_RET_FAILURE;
 	}
 
-	x = simple_strtoul(argv[1], NULL, 16);
-	y = simple_strtoul(argv[2], NULL, 16);
+	x = hextoul(argv[1], NULL);
+	y = hextoul(argv[2], NULL);
 	hexstr = argv[3];
-	count = (argc > 4) ? simple_strtoul(argv[4], NULL, 16) : 1;
+	count = (argc > 4) ? hextoul(argv[4], NULL) : 1;
 
 	buflen = strlen(hexstr) / 2;
 
@@ -148,9 +148,9 @@
 		return CMD_RET_FAILURE;
 	}
 
-	x = simple_strtoul(argv[1], NULL, 16);
-	y = simple_strtoul(argv[2], NULL, 16);
-	color = simple_strtoul(argv[3], NULL, 16);
+	x = hextoul(argv[1], NULL);
+	y = hextoul(argv[2], NULL);
+	color = hextoul(argv[3], NULL);
 	text = argv[4];
 
 	res = video_osd_print(osd_cur, x, y, color, text);
@@ -176,8 +176,8 @@
 		return CMD_RET_FAILURE;
 	}
 
-	x = simple_strtoul(argv[1], NULL, 16);
-	y = simple_strtoul(argv[2], NULL, 16);
+	x = hextoul(argv[1], NULL);
+	y = hextoul(argv[2], NULL);
 
 	res = video_osd_set_size(osd_cur, x, y);
 	if (res) {
diff --git a/cmd/pcap.c b/cmd/pcap.c
index d0172f3..c751980 100644
--- a/cmd/pcap.c
+++ b/cmd/pcap.c
@@ -18,7 +18,7 @@
 	if (argc != 3)
 		return CMD_RET_USAGE;
 
-	addr = simple_strtoul(argv[1], NULL, 16);
+	addr = hextoul(argv[1], NULL);
 	size = simple_strtoul(argv[2], NULL, 10);
 
 	return pcap_init(addr, size) ? CMD_RET_FAILURE : CMD_RET_SUCCESS;
diff --git a/cmd/pci.c b/cmd/pci.c
index e53b7c8..22de942 100644
--- a/cmd/pci.c
+++ b/cmd/pci.c
@@ -470,14 +470,14 @@
 		if (name[i] == '.') {
 			memcpy(cnum, &name[iold], i - iold);
 			cnum[i - iold] = '\0';
-			bdfs[n++] = simple_strtoul(cnum, NULL, 16);
+			bdfs[n++] = hextoul(cnum, NULL);
 			iold = i + 1;
 		}
 	}
 	strcpy(cnum, &name[iold]);
 	if (n == 0)
 		n = 1;
-	bdfs[n] = simple_strtoul(cnum, NULL, 16);
+	bdfs[n] = hextoul(cnum, NULL);
 
 	return PCI_BDF(bdfs[0], bdfs[1], bdfs[2]);
 }
@@ -588,7 +588,7 @@
 #endif
 		else {
 			char *endp;
-			i = simple_strtoul(console_buffer, &endp, 16);
+			i = hextoul(console_buffer, &endp);
 			nbytes = endp - console_buffer;
 			if (nbytes) {
 				/* good enough to not time out
@@ -683,9 +683,9 @@
 		cmd_size = cmd_get_data_size(argv[1], 4);
 		size = (cmd_size == 4) ? PCI_SIZE_32 : cmd_size - 1;
 		if (argc > 3)
-			addr = simple_strtoul(argv[3], NULL, 16);
+			addr = hextoul(argv[3], NULL);
 		if (argc > 4)
-			value = simple_strtoul(argv[4], NULL, 16);
+			value = hextoul(argv[4], NULL);
 	case 'h':		/* header */
 #ifdef CONFIG_DM_PCI
 	case 'b':		/* bars */
@@ -709,7 +709,7 @@
 				argc--;
 			}
 			if (argc > 1)
-				busnum = simple_strtoul(argv[1], NULL, 16);
+				busnum = hextoul(argv[1], NULL);
 		}
 #ifdef CONFIG_DM_PCI
 		ret = uclass_get_device_by_seq(UCLASS_PCI, busnum, &bus);
diff --git a/cmd/pstore.c b/cmd/pstore.c
index 5656bae..c6973ae 100644
--- a/cmd/pstore.c
+++ b/cmd/pstore.c
@@ -172,26 +172,26 @@
 
 	/* Address is specified since argc > 2
 	 */
-	pstore_addr = simple_strtoul(argv[1], NULL, 16);
+	pstore_addr = hextoul(argv[1], NULL);
 
 	/* Length is specified since argc > 2
 	 */
-	pstore_length = simple_strtoul(argv[2], NULL, 16);
+	pstore_length = hextoul(argv[2], NULL);
 
 	if (argc > 3)
-		pstore_record_size = simple_strtoul(argv[3], NULL, 16);
+		pstore_record_size = hextoul(argv[3], NULL);
 
 	if (argc > 4)
-		pstore_console_size = simple_strtoul(argv[4], NULL, 16);
+		pstore_console_size = hextoul(argv[4], NULL);
 
 	if (argc > 5)
-		pstore_ftrace_size = simple_strtoul(argv[5], NULL, 16);
+		pstore_ftrace_size = hextoul(argv[5], NULL);
 
 	if (argc > 6)
-		pstore_pmsg_size = simple_strtoul(argv[6], NULL, 16);
+		pstore_pmsg_size = hextoul(argv[6], NULL);
 
 	if (argc > 7)
-		pstore_ecc_size = simple_strtoul(argv[7], NULL, 16);
+		pstore_ecc_size = hextoul(argv[7], NULL);
 
 	if (pstore_length < (pstore_record_size + pstore_console_size
 			     + pstore_ftrace_size + pstore_pmsg_size)) {
diff --git a/cmd/pxe_utils.c b/cmd/pxe_utils.c
index 9a30629..067c24e 100644
--- a/cmd/pxe_utils.c
+++ b/cmd/pxe_utils.c
@@ -351,7 +351,7 @@
 	int err;
 
 	/* Get the main fdt and map it */
-	fdt_addr = simple_strtoul(env_get("fdt_addr_r"), NULL, 16);
+	fdt_addr = hextoul(env_get("fdt_addr_r"), NULL);
 	working_fdt = map_sysmem(fdt_addr, 0);
 	err = fdt_check_header(working_fdt);
 	if (err)
@@ -364,7 +364,7 @@
 		return;
 	}
 
-	fdtoverlay_addr = simple_strtoul(fdtoverlay_addr_env, NULL, 16);
+	fdtoverlay_addr = hextoul(fdtoverlay_addr_env, NULL);
 
 	/* Cycle over the overlay files and apply them in order */
 	do {
diff --git a/cmd/qfw.c b/cmd/qfw.c
index e6a9fdb..eb6a552 100644
--- a/cmd/qfw.c
+++ b/cmd/qfw.c
@@ -120,7 +120,7 @@
 
 	env = env_get("loadaddr");
 	load_addr = env ?
-		(void *)simple_strtoul(env, NULL, 16) :
+		(void *)hextoul(env, NULL) :
 #ifdef CONFIG_LOADADDR
 		(void *)CONFIG_LOADADDR;
 #else
@@ -129,7 +129,7 @@
 
 	env = env_get("ramdiskaddr");
 	initrd_addr = env ?
-		(void *)simple_strtoul(env, NULL, 16) :
+		(void *)hextoul(env, NULL) :
 #ifdef CONFIG_RAMDISK_ADDR
 		(void *)CONFIG_RAMDISK_ADDR;
 #else
@@ -137,10 +137,10 @@
 #endif
 
 	if (argc == 2) {
-		load_addr = (void *)simple_strtoul(argv[0], NULL, 16);
-		initrd_addr = (void *)simple_strtoul(argv[1], NULL, 16);
+		load_addr = (void *)hextoul(argv[0], NULL);
+		initrd_addr = (void *)hextoul(argv[1], NULL);
 	} else if (argc == 1) {
-		load_addr = (void *)simple_strtoul(argv[0], NULL, 16);
+		load_addr = (void *)hextoul(argv[0], NULL);
 	}
 
 	if (!load_addr || !initrd_addr) {
diff --git a/cmd/read.c b/cmd/read.c
index 34f53f9..99c7e38 100644
--- a/cmd/read.c
+++ b/cmd/read.c
@@ -30,13 +30,13 @@
 		return 1;
 	}
 
-	dev = (int)simple_strtoul(argv[2], &ep, 16);
+	dev = (int)hextoul(argv[2], &ep);
 	if (*ep) {
 		if (*ep != ':') {
 			printf("Invalid block device %s\n", argv[2]);
 			return 1;
 		}
-		part = (int)simple_strtoul(++ep, NULL, 16);
+		part = (int)hextoul(++ep, NULL);
 	}
 
 	dev_desc = blk_get_dev(argv[1], dev);
@@ -45,9 +45,9 @@
 		return 1;
 	}
 
-	addr = (void *)simple_strtoul(argv[3], NULL, 16);
-	blk = simple_strtoul(argv[4], NULL, 16);
-	cnt = simple_strtoul(argv[5], NULL, 16);
+	addr = (void *)hextoul(argv[3], NULL);
+	blk = hextoul(argv[4], NULL);
+	cnt = hextoul(argv[5], NULL);
 
 	if (part != 0) {
 		if (part_get_info(dev_desc, part, &part_info)) {
diff --git a/cmd/reiser.c b/cmd/reiser.c
index 3db926f..707167f 100644
--- a/cmd/reiser.c
+++ b/cmd/reiser.c
@@ -90,7 +90,7 @@
 	case 3:
 		addr_str = env_get("loadaddr");
 		if (addr_str != NULL) {
-			addr = simple_strtoul (addr_str, NULL, 16);
+			addr = hextoul(addr_str, NULL);
 		} else {
 			addr = CONFIG_SYS_LOAD_ADDR;
 		}
@@ -98,19 +98,19 @@
 		count = 0;
 		break;
 	case 4:
-		addr = simple_strtoul (argv[3], NULL, 16);
+		addr = hextoul(argv[3], NULL);
 		filename = env_get("bootfile");
 		count = 0;
 		break;
 	case 5:
-		addr = simple_strtoul (argv[3], NULL, 16);
+		addr = hextoul(argv[3], NULL);
 		filename = argv[4];
 		count = 0;
 		break;
 	case 6:
-		addr = simple_strtoul (argv[3], NULL, 16);
+		addr = hextoul(argv[3], NULL);
 		filename = argv[4];
-		count = simple_strtoul (argv[5], NULL, 16);
+		count = hextoul(argv[5], NULL);
 		break;
 
 	default:
diff --git a/cmd/remoteproc.c b/cmd/remoteproc.c
index b3ddceb..2a0e575 100644
--- a/cmd/remoteproc.c
+++ b/cmd/remoteproc.c
@@ -130,9 +130,9 @@
 		return CMD_RET_USAGE;
 
 	id = (int)simple_strtoul(argv[1], NULL, 10);
-	addr = simple_strtoul(argv[2], NULL, 16);
+	addr = hextoul(argv[2], NULL);
 
-	size = simple_strtoul(argv[3], NULL, 16);
+	size = hextoul(argv[3], NULL);
 
 	if (!size) {
 		printf("\t Expect some size??\n");
diff --git a/cmd/rng.c b/cmd/rng.c
index 9747c11..1ad5a09 100644
--- a/cmd/rng.c
+++ b/cmd/rng.c
@@ -24,7 +24,7 @@
 	}
 
 	if (argc >= 2)
-		n = simple_strtoul(argv[1], NULL, 16);
+		n = hextoul(argv[1], NULL);
 
 	buf = malloc(n);
 	if (!buf) {
diff --git a/cmd/rtc.c b/cmd/rtc.c
index b4f61b2..784879e 100644
--- a/cmd/rtc.c
+++ b/cmd/rtc.c
@@ -18,13 +18,13 @@
 	if (argc < 2 || argc > 3)
 		return CMD_RET_USAGE;
 
-	reg = simple_strtoul(argv[0], NULL, 16);
-	len = simple_strtoul(argv[1], NULL, 16);
+	reg = hextoul(argv[0], NULL);
+	len = hextoul(argv[1], NULL);
 
 	if (argc == 3) {
 		u8 *addr;
 
-		addr = map_sysmem(simple_strtoul(argv[2], NULL, 16), len);
+		addr = map_sysmem(hextoul(argv[2], NULL), len);
 		ret = dm_rtc_read(dev, reg, addr, len);
 		unmap_sysmem(addr);
 		if (ret) {
@@ -59,13 +59,13 @@
 	if (argc < 2 || argc > 3)
 		return CMD_RET_USAGE;
 
-	reg = simple_strtoul(argv[0], NULL, 16);
+	reg = hextoul(argv[0], NULL);
 
 	if (argc == 3) {
 		u8 *addr;
 
-		len = simple_strtoul(argv[1], NULL, 16);
-		addr = map_sysmem(simple_strtoul(argv[2], NULL, 16), len);
+		len = hextoul(argv[1], NULL);
+		addr = map_sysmem(hextoul(argv[2], NULL), len);
 		ret = dm_rtc_write(dev, reg, addr, len);
 		unmap_sysmem(addr);
 		if (ret) {
diff --git a/cmd/setexpr.c b/cmd/setexpr.c
index 1eb67e2..05d6558 100644
--- a/cmd/setexpr.c
+++ b/cmd/setexpr.c
@@ -49,7 +49,7 @@
 		int len;
 		char *str;
 
-		addr = simple_strtoul(&s[1], NULL, 16);
+		addr = hextoul(&s[1], NULL);
 		switch (w) {
 		case 1:
 			p = map_sysmem(addr, sizeof(uchar));
@@ -94,7 +94,7 @@
 	} else {
 		if (w == CMD_DATA_SIZE_STR)
 			return -EINVAL;
-		arg.ival = simple_strtoul(s, NULL, 16);
+		arg.ival = hextoul(s, NULL);
 	}
 	*argp = arg;
 
diff --git a/cmd/sf.c b/cmd/sf.c
index 46346fb..eac27ed 100644
--- a/cmd/sf.c
+++ b/cmd/sf.c
@@ -54,7 +54,7 @@
 		++arg;
 	}
 
-	len_arg = simple_strtoul(arg, &ep, 16);
+	len_arg = hextoul(arg, &ep);
 	if (ep == arg || *ep != '\0')
 		return -1;
 
@@ -119,7 +119,7 @@
 			return -1;
 	}
 	if (argc >= 4) {
-		mode = simple_strtoul(argv[3], &endp, 16);
+		mode = hextoul(argv[3], &endp);
 		if (*argv[3] == 0 || *endp != 0)
 			return -1;
 	}
@@ -272,7 +272,7 @@
 	if (argc < 3)
 		return -1;
 
-	addr = simple_strtoul(argv[1], &endp, 16);
+	addr = hextoul(argv[1], &endp);
 	if (*argv[1] == 0 || *endp != 0)
 		return -1;
 
@@ -517,10 +517,10 @@
 
 	if (argc < 3)
 		return -1;
-	offset = simple_strtoul(argv[1], &endp, 16);
+	offset = hextoul(argv[1], &endp);
 	if (*argv[1] == 0 || *endp != 0)
 		return -1;
-	len = simple_strtoul(argv[2], &endp, 16);
+	len = hextoul(argv[2], &endp);
 	if (*argv[2] == 0 || *endp != 0)
 		return -1;
 
diff --git a/cmd/smccc.c b/cmd/smccc.c
index 0ff9a08..f527181 100644
--- a/cmd/smccc.c
+++ b/cmd/smccc.c
@@ -28,15 +28,15 @@
 	if (argc < 2)
 		return CMD_RET_USAGE;
 
-	fid = simple_strtoul(argv[1], NULL, 16);
+	fid = hextoul(argv[1], NULL);
 
-	a1 = argc > 2 ? simple_strtoul(argv[2], NULL, 16) : 0;
-	a2 = argc > 3 ? simple_strtoul(argv[3], NULL, 16) : 0;
-	a3 = argc > 4 ? simple_strtoul(argv[4], NULL, 16) : 0;
-	a4 = argc > 5 ? simple_strtoul(argv[5], NULL, 16) : 0;
-	a5 = argc > 6 ? simple_strtoul(argv[6], NULL, 16) : 0;
-	a6 = argc > 7 ? simple_strtoul(argv[7], NULL, 16) : 0;
-	a7 = argc > 8 ? simple_strtoul(argv[8], NULL, 16) : 0;
+	a1 = argc > 2 ? hextoul(argv[2], NULL) : 0;
+	a2 = argc > 3 ? hextoul(argv[3], NULL) : 0;
+	a3 = argc > 4 ? hextoul(argv[4], NULL) : 0;
+	a4 = argc > 5 ? hextoul(argv[5], NULL) : 0;
+	a5 = argc > 6 ? hextoul(argv[6], NULL) : 0;
+	a6 = argc > 7 ? hextoul(argv[7], NULL) : 0;
+	a7 = argc > 8 ? hextoul(argv[8], NULL) : 0;
 
 	if (!strcmp(argv[0], "smc"))
 		arm_smccc_smc(fid, a1, a2, a3, a4, a5, a6, a7, &res);
diff --git a/cmd/source.c b/cmd/source.c
index 71f7152..81e015b 100644
--- a/cmd/source.c
+++ b/cmd/source.c
@@ -179,7 +179,7 @@
 		      fit_uname, addr);
 #endif
 	} else {
-		addr = simple_strtoul(argv[1], NULL, 16);
+		addr = hextoul(argv[1], NULL);
 		debug("*  source: cmdline image address = 0x%08lx\n", addr);
 	}
 
diff --git a/cmd/strings.c b/cmd/strings.c
index 85fdc34..bf348af 100644
--- a/cmd/strings.c
+++ b/cmd/strings.c
@@ -18,9 +18,9 @@
 		return CMD_RET_USAGE;
 
 	if ((flag & CMD_FLAG_REPEAT) == 0) {
-		start_addr = (char *)simple_strtoul(argv[1], NULL, 16);
+		start_addr = (char *)hextoul(argv[1], NULL);
 		if (argc > 2)
-			last_addr = (char *)simple_strtoul(argv[2], NULL, 16);
+			last_addr = (char *)hextoul(argv[2], NULL);
 		else
 			last_addr = (char *)-1;
 	}
diff --git a/cmd/ti/ddr3.c b/cmd/ti/ddr3.c
index 6b43a73..be937a7 100644
--- a/cmd/ti/ddr3.c
+++ b/cmd/ti/ddr3.c
@@ -290,8 +290,8 @@
 			return CMD_RET_FAILURE;
 		}
 
-		start_addr = simple_strtoul(argv[2], NULL, 16);
-		ecc_err = simple_strtoul(argv[3], NULL, 16);
+		start_addr = hextoul(argv[2], NULL);
+		ecc_err = hextoul(argv[3], NULL);
 
 		if (!is_addr_valid(start_addr)) {
 			puts("Invalid address. Please enter ECC supported address!\n");
@@ -306,8 +306,8 @@
 	      ((argc == 5) && (strncmp(argv[1], "compare", 8) == 0))))
 		return cmd_usage(cmdtp);
 
-	start_addr = simple_strtoul(argv[2], NULL, 16);
-	end_addr = simple_strtoul(argv[3], NULL, 16);
+	start_addr = hextoul(argv[2], NULL);
+	end_addr = hextoul(argv[3], NULL);
 
 	if ((start_addr < CONFIG_SYS_SDRAM_BASE) ||
 	    (start_addr > (CONFIG_SYS_SDRAM_BASE +
@@ -321,7 +321,7 @@
 
 	puts("Please wait ...\n");
 	if (argc == 5) {
-		size = simple_strtoul(argv[4], NULL, 16);
+		size = hextoul(argv[4], NULL);
 		ddr_memory_compare(start_addr, end_addr, size);
 	} else {
 		ddr_memory_test(start_addr, end_addr, 0);
diff --git a/cmd/tlv_eeprom.c b/cmd/tlv_eeprom.c
index 5099cbd..2b643f9 100644
--- a/cmd/tlv_eeprom.c
+++ b/cmd/tlv_eeprom.c
@@ -751,7 +751,7 @@
 
 	/* Convert string to binary */
 	for (i = 0, p = (char *)string; i < 6; i++) {
-		buf[i] = p ? simple_strtoul(p, &end, 16) : 0;
+		buf[i] = p ? hextoul(p, &end) : 0;
 		if (p)
 			p = (*end) ? end + 1 : end;
 	}
diff --git a/cmd/tpm-common.c b/cmd/tpm-common.c
index 88c9e08..a48c060 100644
--- a/cmd/tpm-common.c
+++ b/cmd/tpm-common.c
@@ -68,7 +68,7 @@
 	for (i = 0; i < length; i += 2) {
 		byte[0] = bytes[i];
 		byte[1] = bytes[i + 1];
-		data[i / 2] = (u8)simple_strtoul(byte, NULL, 16);
+		data[i / 2] = (u8)hextoul(byte, NULL);
 	}
 
 	if (count_ptr)
diff --git a/cmd/trace.c b/cmd/trace.c
index 4ce47c7..2e3ee1d 100644
--- a/cmd/trace.c
+++ b/cmd/trace.c
@@ -21,8 +21,8 @@
 				   *buff_size);
 		*buff_ptr = env_get_ulong("profoffset", 16, 0);
 	} else {
-		*buff_size = simple_strtoul(argv[3], NULL, 16);
-		*buff = map_sysmem(simple_strtoul(argv[2], NULL, 16),
+		*buff_size = hextoul(argv[3], NULL);
+		*buff = map_sysmem(hextoul(argv[2], NULL),
 				   *buff_size);
 		*buff_ptr = 0;
 	};
diff --git a/cmd/tsi148.c b/cmd/tsi148.c
index 2eae14f..0d849d9 100644
--- a/cmd/tsi148.c
+++ b/cmd/tsi148.c
@@ -392,15 +392,15 @@
 	if (argc > 1)
 		cmd = argv[1][0];
 	if (argc > 2)
-		addr1 = simple_strtoul(argv[2], NULL, 16);
+		addr1 = hextoul(argv[2], NULL);
 	if (argc > 3)
-		addr2 = simple_strtoul(argv[3], NULL, 16);
+		addr2 = hextoul(argv[3], NULL);
 	if (argc > 4)
-		size = simple_strtoul(argv[4], NULL, 16);
+		size = hextoul(argv[4], NULL);
 	if (argc > 5)
-		vam = simple_strtoul(argv[5], NULL, 16);
+		vam = hextoul(argv[5], NULL);
 	if (argc > 6)
-		vdw = simple_strtoul(argv[6], NULL, 16);
+		vdw = hextoul(argv[6], NULL);
 
 	switch (cmd) {
 	case 'c':
diff --git a/cmd/ubi.c b/cmd/ubi.c
index cb14e3e..fe8ac58 100644
--- a/cmd/ubi.c
+++ b/cmd/ubi.c
@@ -661,8 +661,8 @@
 			return 1;
 		}
 
-		addr = simple_strtoul(argv[2], NULL, 16);
-		size = simple_strtoul(argv[4], NULL, 16);
+		addr = hextoul(argv[2], NULL);
+		size = hextoul(argv[4], NULL);
 
 		if (strlen(argv[1]) == 10 &&
 		    strncmp(argv[1] + 5, ".part", 5) == 0) {
@@ -671,7 +671,7 @@
 						(void *)addr, size);
 			} else {
 				size_t full_size;
-				full_size = simple_strtoul(argv[5], NULL, 16);
+				full_size = hextoul(argv[5], NULL);
 				ret = ubi_volume_begin_write(argv[3],
 						(void *)addr, size, full_size);
 			}
@@ -691,13 +691,13 @@
 
 		/* E.g., read volume size */
 		if (argc == 5) {
-			size = simple_strtoul(argv[4], NULL, 16);
+			size = hextoul(argv[4], NULL);
 			argc--;
 		}
 
 		/* E.g., read volume */
 		if (argc == 4) {
-			addr = simple_strtoul(argv[2], NULL, 16);
+			addr = hextoul(argv[2], NULL);
 			argc--;
 		}
 
diff --git a/cmd/ubifs.c b/cmd/ubifs.c
index a26b653..7a620c5 100644
--- a/cmd/ubifs.c
+++ b/cmd/ubifs.c
@@ -122,14 +122,14 @@
 	if (argc < 3)
 		return CMD_RET_USAGE;
 
-	addr = simple_strtoul(argv[1], &endp, 16);
+	addr = hextoul(argv[1], &endp);
 	if (endp == argv[1])
 		return CMD_RET_USAGE;
 
 	filename = argv[2];
 
 	if (argc == 4) {
-		size = simple_strtoul(argv[3], &endp, 16);
+		size = hextoul(argv[3], &endp);
 		if (endp == argv[3])
 			return CMD_RET_USAGE;
 	}
diff --git a/cmd/universe.c b/cmd/universe.c
index 5ff47dd..fb3a32d 100644
--- a/cmd/universe.c
+++ b/cmd/universe.c
@@ -307,17 +307,17 @@
 	if (argc > 1)
 		cmd = argv[1][0];
 	if (argc > 2)
-		addr1 = simple_strtoul(argv[2], NULL, 16);
+		addr1 = hextoul(argv[2], NULL);
 	if (argc > 3)
-		addr2 = simple_strtoul(argv[3], NULL, 16);
+		addr2 = hextoul(argv[3], NULL);
 	if (argc > 4)
-		size = simple_strtoul(argv[4], NULL, 16);
+		size = hextoul(argv[4], NULL);
 	if (argc > 5)
-		vam = simple_strtoul(argv[5], NULL, 16);
+		vam = hextoul(argv[5], NULL);
 	if (argc > 6)
-		pms = simple_strtoul(argv[6], NULL, 16);
+		pms = hextoul(argv[6], NULL);
 	if (argc > 7)
-		vdw = simple_strtoul(argv[7], NULL, 16);
+		vdw = hextoul(argv[7], NULL);
 
 	switch (cmd) {
 	case 'i':		/* init */
diff --git a/cmd/unlz4.c b/cmd/unlz4.c
index 4ae7f34..323ab46 100644
--- a/cmd/unlz4.c
+++ b/cmd/unlz4.c
@@ -18,9 +18,9 @@
 
 	switch (argc) {
 	case 4:
-		src = simple_strtoul(argv[1], NULL, 16);
-		dst = simple_strtoul(argv[2], NULL, 16);
-		dst_len = simple_strtoul(argv[3], NULL, 16);
+		src = hextoul(argv[1], NULL);
+		dst = hextoul(argv[2], NULL);
+		dst_len = hextoul(argv[3], NULL);
 		break;
 	default:
 		return CMD_RET_USAGE;
diff --git a/cmd/unzip.c b/cmd/unzip.c
index 9b28328..3d1f5f3 100644
--- a/cmd/unzip.c
+++ b/cmd/unzip.c
@@ -18,11 +18,11 @@
 
 	switch (argc) {
 		case 4:
-			dst_len = simple_strtoul(argv[3], NULL, 16);
+			dst_len = hextoul(argv[3], NULL);
 			/* fall through */
 		case 3:
-			src = simple_strtoul(argv[1], NULL, 16);
-			dst = simple_strtoul(argv[2], NULL, 16);
+			src = hextoul(argv[1], NULL);
+			dst = hextoul(argv[2], NULL);
 			break;
 		default:
 			return CMD_RET_USAGE;
@@ -60,11 +60,11 @@
 	if (ret < 0)
 		return CMD_RET_FAILURE;
 
-	addr = (unsigned char *)simple_strtoul(argv[3], NULL, 16);
-	length = simple_strtoul(argv[4], NULL, 16);
+	addr = (unsigned char *)hextoul(argv[3], NULL);
+	length = hextoul(argv[4], NULL);
 
 	if (5 < argc) {
-		writebuf = simple_strtoul(argv[5], NULL, 16);
+		writebuf = hextoul(argv[5], NULL);
 		if (6 < argc) {
 			startoffs = simple_strtoull(argv[6], NULL, 16);
 			if (7 < argc)
diff --git a/cmd/x86/mtrr.c b/cmd/x86/mtrr.c
index fc61a54..b213a94 100644
--- a/cmd/x86/mtrr.c
+++ b/cmd/x86/mtrr.c
@@ -78,8 +78,8 @@
 		printf("Invalid type name %s\n", typename);
 		return CMD_RET_USAGE;
 	}
-	start = simple_strtoul(argv[1], NULL, 16);
-	size = simple_strtoul(argv[2], NULL, 16);
+	start = hextoul(argv[1], NULL);
+	size = hextoul(argv[2], NULL);
 
 	base = start | type;
 	valid = native_read_msr(MTRR_PHYS_MASK_MSR(reg)) & MTRR_PHYS_MASK_VALID;
@@ -126,7 +126,7 @@
 	if (cmd != 'l') {
 		if (argc < 2)
 			return CMD_RET_USAGE;
-		reg = simple_strtoul(argv[1], NULL, 16);
+		reg = hextoul(argv[1], NULL);
 		if (reg >= reg_count) {
 			printf("Invalid register number\n");
 			return CMD_RET_USAGE;
diff --git a/cmd/ximg.c b/cmd/ximg.c
index ef738eb..65ba413 100644
--- a/cmd/ximg.c
+++ b/cmd/ximg.c
@@ -59,16 +59,16 @@
 	verify = env_get_yesno("verify");
 
 	if (argc > 1) {
-		addr = simple_strtoul(argv[1], NULL, 16);
+		addr = hextoul(argv[1], NULL);
 	}
 	if (argc > 2) {
-		part = simple_strtoul(argv[2], NULL, 16);
+		part = hextoul(argv[2], NULL);
 #if defined(CONFIG_FIT)
 		uname = argv[2];
 #endif
 	}
 	if (argc > 3) {
-		dest = simple_strtoul(argv[3], NULL, 16);
+		dest = hextoul(argv[3], NULL);
 	}
 
 	switch (genimg_get_format((void *)addr)) {
diff --git a/cmd/yaffs2.c b/cmd/yaffs2.c
index f29ebcc..27fbd1b 100644
--- a/cmd/yaffs2.c
+++ b/cmd/yaffs2.c
@@ -165,8 +165,8 @@
 	}
 
 	filename = argv[1];
-	value = simple_strtoul(argv[2], NULL, 16);
-	numValues = simple_strtoul(argv[3], NULL, 16);
+	value = hextoul(argv[2], NULL);
+	numValues = hextoul(argv[3], NULL);
 
 	printf("Writing value (%lx) %lx times to %s... ", value, numValues,
 	       filename);
@@ -188,7 +188,7 @@
 	}
 
 	filename = argv[1];
-	addr = simple_strtoul(argv[2], NULL, 16);
+	addr = hextoul(argv[2], NULL);
 
 	cmd_yaffs_mread_file(filename, (char *)addr);
 
@@ -207,8 +207,8 @@
 	}
 
 	filename = argv[1];
-	addr = simple_strtoul(argv[2], NULL, 16);
-	size = simple_strtoul(argv[3], NULL, 16);
+	addr = hextoul(argv[2], NULL);
+	size = hextoul(argv[3], NULL);
 
 	cmd_yaffs_mwrite_file(filename, (char *)addr, size);
 
diff --git a/cmd/zfs.c b/cmd/zfs.c
index e429ac8..6ef1b56 100644
--- a/cmd/zfs.c
+++ b/cmd/zfs.c
@@ -50,13 +50,13 @@
 		return CMD_RET_USAGE;
 
 	count = 0;
-	addr = simple_strtoul(argv[3], NULL, 16);
+	addr = hextoul(argv[3], NULL);
 	filename = env_get("bootfile");
 	switch (argc) {
 	case 3:
 		addr_str = env_get("loadaddr");
 		if (addr_str != NULL)
-			addr = simple_strtoul(addr_str, NULL, 16);
+			addr = hextoul(addr_str, NULL);
 		else
 			addr = CONFIG_SYS_LOAD_ADDR;
 
@@ -68,7 +68,7 @@
 		break;
 	case 6:
 		filename = argv[4];
-		count = simple_strtoul(argv[5], NULL, 16);
+		count = hextoul(argv[5], NULL);
 		break;
 
 	default:
diff --git a/cmd/zip.c b/cmd/zip.c
index 8ad3768..08afd62 100644
--- a/cmd/zip.c
+++ b/cmd/zip.c
@@ -16,12 +16,12 @@
 
 	switch (argc) {
 		case 5:
-			dst_len = simple_strtoul(argv[4], NULL, 16);
+			dst_len = hextoul(argv[4], NULL);
 			/* fall through */
 		case 4:
-			src = simple_strtoul(argv[1], NULL, 16);
-			src_len = simple_strtoul(argv[2], NULL, 16);
-			dst = simple_strtoul(argv[3], NULL, 16);
+			src = hextoul(argv[1], NULL);
+			src_len = hextoul(argv[2], NULL);
+			dst = hextoul(argv[3], NULL);
 			break;
 		default:
 			return cmd_usage(cmdtp);