global: Convert simple_strtoul() with decimal to dectoul()

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

Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/cmd/avb.c b/cmd/avb.c
index 02b4b1f..783f51b 100644
--- a/cmd/avb.c
+++ b/cmd/avb.c
@@ -366,7 +366,7 @@
 		return CMD_RET_USAGE;
 
 	name = argv[1];
-	bytes = simple_strtoul(argv[2], &endp, 10);
+	bytes = dectoul(argv[2], &endp);
 	if (*endp && *endp != '\n')
 		return CMD_RET_USAGE;
 
diff --git a/cmd/axi.c b/cmd/axi.c
index c676819..0c80fef 100644
--- a/cmd/axi.c
+++ b/cmd/axi.c
@@ -120,7 +120,7 @@
 		int i;
 
 		/* show specific bus */
-		i = simple_strtoul(argv[1], NULL, 10);
+		i = dectoul(argv[1], NULL);
 
 		struct udevice *bus;
 		int ret;
@@ -153,7 +153,7 @@
 
 		printf("Current bus is %d\n", bus_no);
 	} else {
-		bus_no = simple_strtoul(argv[1], NULL, 10);
+		bus_no = dectoul(argv[1], NULL);
 		printf("Setting bus to %d\n", bus_no);
 
 		ret = axi_set_cur_bus(bus_no);
@@ -193,7 +193,7 @@
 	}
 
 	if ((flag & CMD_FLAG_REPEAT) == 0) {
-		size = simple_strtoul(argv[1], NULL, 10);
+		size = dectoul(argv[1], NULL);
 
 		/*
 		 * Address is specified since argc >= 3
@@ -273,7 +273,7 @@
 	if (argc <= 3 || argc >= 6)
 		return CMD_RET_USAGE;
 
-	size = simple_strtoul(argv[1], NULL, 10);
+	size = dectoul(argv[1], NULL);
 
 	switch (size) {
 	case 8:
diff --git a/cmd/bind.c b/cmd/bind.c
index af2f22c..07c629e 100644
--- a/cmd/bind.c
+++ b/cmd/bind.c
@@ -218,13 +218,13 @@
 			return CMD_RET_USAGE;
 		ret = unbind_by_node_path(argv[1]);
 	} else if (!by_node && bind) {
-		int index = (argc > 2) ? simple_strtoul(argv[2], NULL, 10) : 0;
+		int index = (argc > 2) ? dectoul(argv[2], NULL) : 0;
 
 		if (argc != 4)
 			return CMD_RET_USAGE;
 		ret = bind_by_class_index(argv[1], index, argv[3]);
 	} else if (!by_node && !bind) {
-		int index = (argc > 2) ? simple_strtoul(argv[2], NULL, 10) : 0;
+		int index = (argc > 2) ? dectoul(argv[2], NULL) : 0;
 
 		if (argc == 3)
 			ret = unbind_by_class_index(argv[1], index);
diff --git a/cmd/binop.c b/cmd/binop.c
index bb5adc3..592e914 100644
--- a/cmd/binop.c
+++ b/cmd/binop.c
@@ -89,7 +89,7 @@
 	else
 		return CMD_RET_USAGE;
 
-	len = simple_strtoul(lenarg, NULL, 10);
+	len = dectoul(lenarg, NULL);
 
 	src1 = malloc(len);
 	src2 = malloc(len);
diff --git a/cmd/blk_common.c b/cmd/blk_common.c
index 0898798..4e442f2 100644
--- a/cmd/blk_common.c
+++ b/cmd/blk_common.c
@@ -40,7 +40,7 @@
 		return CMD_RET_USAGE;
 	case 3:
 		if (strncmp(argv[1], "dev", 3) == 0) {
-			int dev = (int)simple_strtoul(argv[2], NULL, 10);
+			int dev = (int)dectoul(argv[2], NULL);
 
 			if (!blk_show_device(if_type, dev)) {
 				*cur_devnump = dev;
@@ -50,7 +50,7 @@
 			}
 			return 0;
 		} else if (strncmp(argv[1], "part", 4) == 0) {
-			int dev = (int)simple_strtoul(argv[2], NULL, 10);
+			int dev = (int)dectoul(argv[2], NULL);
 
 			if (blk_print_part_devnum(if_type, dev)) {
 				printf("\n%s device %d not available\n",
diff --git a/cmd/bmp.c b/cmd/bmp.c
index f4fe97d..071ba90 100644
--- a/cmd/bmp.c
+++ b/cmd/bmp.c
@@ -131,11 +131,11 @@
 		if (!strcmp(argv[2], "m"))
 			x = BMP_ALIGN_CENTER;
 		else
-			x = simple_strtoul(argv[2], NULL, 10);
+			x = dectoul(argv[2], NULL);
 		if (!strcmp(argv[3], "m"))
 			y = BMP_ALIGN_CENTER;
 		else
-			y = simple_strtoul(argv[3], NULL, 10);
+			y = dectoul(argv[3], NULL);
 		break;
 	default:
 		return CMD_RET_USAGE;
diff --git a/cmd/clk.c b/cmd/clk.c
index 7ece245..dbbdc31 100644
--- a/cmd/clk.c
+++ b/cmd/clk.c
@@ -120,7 +120,7 @@
 	s32 freq;
 	struct udevice *dev;
 
-	freq = simple_strtoul(argv[2], NULL, 10);
+	freq = dectoul(argv[2], NULL);
 
 	dev = clk_lookup(argv[1]);
 
diff --git a/cmd/clone.c b/cmd/clone.c
index 32473a0..a906207 100644
--- a/cmd/clone.c
+++ b/cmd/clone.c
@@ -34,7 +34,7 @@
 		printf("Unable to open destination device\n");
 		return 1;
 	}
-	requested = simple_strtoul(argv[5], &unit, 10);
+	requested = dectoul(argv[5], &unit);
 	srcbz = srcdesc->blksz;
 	destbz = destdesc->blksz;
 
diff --git a/cmd/cros_ec.c b/cmd/cros_ec.c
index abda5d6..a40f589 100644
--- a/cmd/cros_ec.c
+++ b/cmd/cros_ec.c
@@ -501,11 +501,11 @@
 
 		if (argc < 3)
 			return CMD_RET_USAGE;
-		index = simple_strtoul(argv[2], &endp, 10);
+		index = dectoul(argv[2], &endp);
 		if (*argv[2] == 0 || *endp != 0)
 			return CMD_RET_USAGE;
 		if (argc > 3) {
-			state = simple_strtoul(argv[3], &endp, 10);
+			state = dectoul(argv[3], &endp);
 			if (*argv[3] == 0 || *endp != 0)
 				return CMD_RET_USAGE;
 			ret = cros_ec_set_ldo(dev, index, state);
diff --git a/cmd/demo.c b/cmd/demo.c
index a2957f7..571f562 100644
--- a/cmd/demo.c
+++ b/cmd/demo.c
@@ -106,7 +106,7 @@
 		return CMD_RET_USAGE;
 
 	if (argc) {
-		devnum = simple_strtoul(argv[0], NULL, 10);
+		devnum = dectoul(argv[0], NULL);
 		ret = uclass_get_device(UCLASS_DEMO, devnum, &demo_dev);
 		if (ret)
 			return cmd_process_error(cmdtp, ret);
diff --git a/cmd/exit.c b/cmd/exit.c
index 923f087..2c71326 100644
--- a/cmd/exit.c
+++ b/cmd/exit.c
@@ -11,7 +11,7 @@
 		   char *const argv[])
 {
 	if (argc > 1)
-		return simple_strtoul(argv[1], NULL, 10);
+		return dectoul(argv[1], NULL);
 
 	return 0;
 }
diff --git a/cmd/flash.c b/cmd/flash.c
index bc93e98..819febc 100644
--- a/cmd/flash.c
+++ b/cmd/flash.c
@@ -57,7 +57,7 @@
 		return 0;
 	*p++ = '\0';
 
-	bank = simple_strtoul (str, &ep, 10);
+	bank = dectoul(str, &ep);
 	if (ep == str || *ep != '\0' ||
 		bank < 1 || bank > CONFIG_SYS_MAX_FLASH_BANKS ||
 		(fp = &flash_info[bank - 1])->flash_id == FLASH_UNKNOWN)
@@ -67,12 +67,12 @@
 	if ((p = strchr (str, '-')) != NULL)
 		*p++ = '\0';
 
-	first = simple_strtoul (str, &ep, 10);
+	first = dectoul(str, &ep);
 	if (ep == str || *ep != '\0' || first >= fp->sector_count)
 		return -1;
 
 	if (p != NULL) {
-		last = simple_strtoul (p, &ep, 10);
+		last = dectoul(p, &ep);
 		if (ep == p || *ep != '\0' ||
 			last < first || last >= fp->sector_count)
 			return -1;
diff --git a/cmd/gpio.c b/cmd/gpio.c
index 4fdb313..4150024 100644
--- a/cmd/gpio.c
+++ b/cmd/gpio.c
@@ -17,7 +17,7 @@
 
 __weak int name_to_gpio(const char *name)
 {
-	return simple_strtoul(name, NULL, 10);
+	return dectoul(name, NULL);
 }
 
 enum gpio_cmd {
@@ -99,7 +99,7 @@
 
 			p = gpio_name + banklen;
 			if (gpio_name && *p) {
-				offset = simple_strtoul(p, NULL, 10);
+				offset = dectoul(p, NULL);
 				gpio_get_description(dev, bank_name, offset,
 						     &flags, true);
 			} else {
diff --git a/cmd/gpt.c b/cmd/gpt.c
index 17f2b83..f818fbb 100644
--- a/cmd/gpt.c
+++ b/cmd/gpt.c
@@ -985,7 +985,7 @@
 #endif
 		return CMD_RET_USAGE;
 
-	dev = (int)simple_strtoul(argv[3], &ep, 10);
+	dev = (int)dectoul(argv[3], &ep);
 	if (!ep || ep[0] != '\0') {
 		printf("'%s' is not a number\n", argv[3]);
 		return CMD_RET_USAGE;
diff --git a/cmd/i2c.c b/cmd/i2c.c
index 631222c..c7c08c4 100644
--- a/cmd/i2c.c
+++ b/cmd/i2c.c
@@ -1079,7 +1079,7 @@
 	 */
 	delay = 1000;
 	if (argc > 3)
-		delay = simple_strtoul(argv[4], NULL, 10);
+		delay = dectoul(argv[4], NULL);
 	/*
 	 * Run the loop...
 	 */
@@ -1765,7 +1765,7 @@
 		int i;
 
 		/* show specific bus */
-		i = simple_strtoul(argv[1], NULL, 10);
+		i = dectoul(argv[1], NULL);
 #if CONFIG_IS_ENABLED(DM_I2C)
 		struct udevice *bus;
 		int ret;
@@ -1833,7 +1833,7 @@
 #endif
 		printf("Current bus is %d\n", bus_no);
 	} else {
-		bus_no = simple_strtoul(argv[1], NULL, 10);
+		bus_no = dectoul(argv[1], NULL);
 #if defined(CONFIG_SYS_I2C_LEGACY)
 		if (bus_no >= CONFIG_SYS_NUM_I2C_BUSES) {
 			printf("Invalid bus %d\n", bus_no);
@@ -1884,7 +1884,7 @@
 		/* querying current speed */
 		printf("Current bus speed=%d\n", speed);
 	} else {
-		speed = simple_strtoul(argv[1], NULL, 10);
+		speed = dectoul(argv[1], NULL);
 		printf("Setting bus speed to %d Hz\n", speed);
 #if CONFIG_IS_ENABLED(DM_I2C)
 		ret = dm_i2c_set_bus_speed(bus, speed);
diff --git a/cmd/led.c b/cmd/led.c
index aa77519..48a02ba 100644
--- a/cmd/led.c
+++ b/cmd/led.c
@@ -93,7 +93,7 @@
 	if (cmd == LEDST_BLINK) {
 		if (argc < 4)
 			return CMD_RET_USAGE;
-		freq_ms = simple_strtoul(argv[3], NULL, 10);
+		freq_ms = dectoul(argv[3], NULL);
 	}
 #endif
 	ret = led_get_by_label(led_label, &dev);
diff --git a/cmd/legacy_led.c b/cmd/legacy_led.c
index 86cd969..5256255 100644
--- a/cmd/legacy_led.c
+++ b/cmd/legacy_led.c
@@ -129,7 +129,7 @@
 				if (argc != 4)
 					return CMD_RET_USAGE;
 
-				freq = simple_strtoul(argv[3], NULL, 10);
+				freq = dectoul(argv[3], NULL);
 				__led_blink(led_commands[i].mask, freq);
 			}
 			/* Need to set only 1 led if led_name wasn't 'all' */
diff --git a/cmd/load.c b/cmd/load.c
index ec3eed1..381ed1b 100644
--- a/cmd/load.c
+++ b/cmd/load.c
@@ -70,7 +70,7 @@
 		offset = simple_strtol(argv[1], NULL, 16);
 	}
 	if (argc == 3) {
-		load_baudrate = (int)simple_strtoul(argv[2], NULL, 10);
+		load_baudrate = (int)dectoul(argv[2], NULL);
 
 		/* default to current baudrate */
 		if (load_baudrate == 0)
@@ -264,7 +264,7 @@
 		size = hextoul(argv[2], NULL);
 	}
 	if (argc == 4) {
-		save_baudrate = (int)simple_strtoul(argv[3], NULL, 10);
+		save_baudrate = (int)dectoul(argv[3], NULL);
 
 		/* default to current baudrate */
 		if (save_baudrate == 0)
@@ -446,7 +446,7 @@
 		offset = hextoul(argv[1], NULL);
 	}
 	if (argc == 3) {
-		load_baudrate = (int)simple_strtoul(argv[2], NULL, 10);
+		load_baudrate = (int)dectoul(argv[2], NULL);
 
 		/* default to current baudrate */
 		if (load_baudrate == 0)
diff --git a/cmd/log.c b/cmd/log.c
index 72380c5..c377aee 100644
--- a/cmd/log.c
+++ b/cmd/log.c
@@ -352,7 +352,7 @@
 	if (argc < 7)
 		return CMD_RET_USAGE;
 	cat = log_get_cat_by_name(argv[1]);
-	level = simple_strtoul(argv[2], &end, 10);
+	level = dectoul(argv[2], &end);
 	if (end == argv[2]) {
 		level = log_get_level_by_name(argv[2]);
 
@@ -366,7 +366,7 @@
 		return CMD_RET_USAGE;
 	}
 	file = argv[3];
-	line = simple_strtoul(argv[4], NULL, 10);
+	line = dectoul(argv[4], NULL);
 	func = argv[5];
 	msg = argv[6];
 	if (_log(cat, level, file, line, func, "%s\n", msg))
diff --git a/cmd/mbr.c b/cmd/mbr.c
index da2e3a4..e7e2298 100644
--- a/cmd/mbr.c
+++ b/cmd/mbr.c
@@ -269,7 +269,7 @@
 	if (argc != 4 && argc != 5)
 		return CMD_RET_USAGE;
 
-	dev = (int)simple_strtoul(argv[3], &ep, 10);
+	dev = (int)dectoul(argv[3], &ep);
 	if (!ep || ep[0] != '\0') {
 		printf("'%s' is not a number\n", argv[3]);
 		return CMD_RET_USAGE;
diff --git a/cmd/mem.c b/cmd/mem.c
index 0978df5..b751138 100644
--- a/cmd/mem.c
+++ b/cmd/mem.c
@@ -189,7 +189,7 @@
 	if (argc < 4)
 		return CMD_RET_USAGE;
 
-	count = simple_strtoul(argv[3], NULL, 10);
+	count = dectoul(argv[3], NULL);
 
 	for (;;) {
 		do_mem_md (NULL, 0, 3, argv);
@@ -217,7 +217,7 @@
 	if (argc < 4)
 		return CMD_RET_USAGE;
 
-	count = simple_strtoul(argv[3], NULL, 10);
+	count = dectoul(argv[3], NULL);
 
 	for (;;) {
 		do_mem_mw (NULL, 0, 3, argv);
diff --git a/cmd/mmc.c b/cmd/mmc.c
index f722778..c67ad76 100644
--- a/cmd/mmc.c
+++ b/cmd/mmc.c
@@ -519,10 +519,10 @@
 	if (argc == 1) {
 		dev = curr_device;
 	} else if (argc == 2) {
-		dev = simple_strtoul(argv[1], NULL, 10);
+		dev = dectoul(argv[1], NULL);
 	} else if (argc == 3) {
-		dev = (int)simple_strtoul(argv[1], NULL, 10);
-		part = (int)simple_strtoul(argv[2], NULL, 10);
+		dev = (int)dectoul(argv[1], NULL);
+		part = (int)dectoul(argv[2], NULL);
 		if (part > PART_ACCESS_MASK) {
 			printf("#part_num shouldn't be larger than %d\n",
 			       PART_ACCESS_MASK);
@@ -572,9 +572,9 @@
 			if (i + 2 >= argc)
 				return -1;
 			pconf->user.enh_start =
-				simple_strtoul(argv[i+1], NULL, 10);
+				dectoul(argv[i + 1], NULL);
 			pconf->user.enh_size =
-				simple_strtoul(argv[i+2], NULL, 10);
+				dectoul(argv[i + 2], NULL);
 			i += 3;
 		} else if (!strcmp(argv[i], "wrrel")) {
 			if (i + 1 >= argc)
@@ -603,7 +603,7 @@
 
 	if (1 >= argc)
 		return -1;
-	pconf->gp_part[pidx].size = simple_strtoul(argv[0], NULL, 10);
+	pconf->gp_part[pidx].size = dectoul(argv[0], NULL);
 
 	i = 1;
 	while (i < argc) {
@@ -721,10 +721,10 @@
 
 	if (argc != 5)
 		return CMD_RET_USAGE;
-	dev = simple_strtoul(argv[1], NULL, 10);
-	width = simple_strtoul(argv[2], NULL, 10);
-	reset = simple_strtoul(argv[3], NULL, 10);
-	mode = simple_strtoul(argv[4], NULL, 10);
+	dev = dectoul(argv[1], NULL);
+	width = dectoul(argv[2], NULL);
+	reset = dectoul(argv[3], NULL);
+	mode = dectoul(argv[4], NULL);
 
 	mmc = init_mmc_device(dev, false);
 	if (!mmc)
@@ -785,9 +785,9 @@
 
 	if (argc != 4)
 		return CMD_RET_USAGE;
-	dev = simple_strtoul(argv[1], NULL, 10);
-	bootsize = simple_strtoul(argv[2], NULL, 10);
-	rpmbsize = simple_strtoul(argv[3], NULL, 10);
+	dev = dectoul(argv[1], NULL);
+	bootsize = dectoul(argv[2], NULL);
+	rpmbsize = dectoul(argv[3], NULL);
 
 	mmc = init_mmc_device(dev, false);
 	if (!mmc)
@@ -842,7 +842,7 @@
 	if (argc != 2 && argc != 3 && argc != 5)
 		return CMD_RET_USAGE;
 
-	dev = simple_strtoul(argv[1], NULL, 10);
+	dev = dectoul(argv[1], NULL);
 
 	mmc = init_mmc_device(dev, false);
 	if (!mmc)
@@ -856,9 +856,9 @@
 	if (argc == 2 || argc == 3)
 		return mmc_partconf_print(mmc, argc == 3 ? argv[2] : NULL);
 
-	ack = simple_strtoul(argv[2], NULL, 10);
-	part_num = simple_strtoul(argv[3], NULL, 10);
-	access = simple_strtoul(argv[4], NULL, 10);
+	ack = dectoul(argv[2], NULL);
+	part_num = dectoul(argv[3], NULL);
+	access = dectoul(argv[4], NULL);
 
 	/* acknowledge to be sent during boot operation */
 	return mmc_set_part_conf(mmc, ack, part_num, access);
@@ -879,8 +879,8 @@
 	if (argc != 3)
 		return CMD_RET_USAGE;
 
-	dev = simple_strtoul(argv[1], NULL, 10);
-	enable = simple_strtoul(argv[2], NULL, 10);
+	dev = dectoul(argv[1], NULL);
+	enable = dectoul(argv[2], NULL);
 
 	if (enable > 2) {
 		puts("Invalid RST_n_ENABLE value\n");
@@ -937,7 +937,7 @@
 	if (argc != 2)
 		return CMD_RET_USAGE;
 
-	dev = simple_strtoul(argv[1], NULL, 10);
+	dev = dectoul(argv[1], NULL);
 
 	mmc = init_mmc_device(dev, false);
 	if (!mmc)
diff --git a/cmd/mp.c b/cmd/mp.c
index c2b5235..8d14401 100644
--- a/cmd/mp.c
+++ b/cmd/mp.c
@@ -36,7 +36,7 @@
 	if (argc < 3)
 		return CMD_RET_USAGE;
 
-	cpuid = simple_strtoul(argv[1], NULL, 10);
+	cpuid = dectoul(argv[1], NULL);
 	if (!is_core_valid(cpuid)) {
 		printf ("Core num: %lu is not valid\n",	cpuid);
 		return 1;
diff --git a/cmd/nand.c b/cmd/nand.c
index 34371b9..d381053 100644
--- a/cmd/nand.c
+++ b/cmd/nand.c
@@ -424,7 +424,7 @@
 			return 0;
 		}
 
-		dev = (int)simple_strtoul(argv[2], NULL, 10);
+		dev = (int)dectoul(argv[2], NULL);
 		set_dev(dev);
 
 		return 0;
diff --git a/cmd/nvedit.c b/cmd/nvedit.c
index 02a99b4..ddc715b 100644
--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
@@ -423,7 +423,7 @@
 	 * the size.  Otherwise we echo it as part of the
 	 * message.
 	 */
-	i = simple_strtoul(argv[argc - 1], &endptr, 10);
+	i = dectoul(argv[argc - 1], &endptr);
 	if (*endptr != '\0') {			/* no size */
 		size = CONFIG_SYS_CBSIZE - 1;
 	} else {				/* size given */
diff --git a/cmd/optee_rpmb.c b/cmd/optee_rpmb.c
index 0d6b1cb..e0e44bb 100644
--- a/cmd/optee_rpmb.c
+++ b/cmd/optee_rpmb.c
@@ -195,7 +195,7 @@
 		return CMD_RET_USAGE;
 
 	name = argv[1];
-	bytes = simple_strtoul(argv[2], &endp, 10);
+	bytes = dectoul(argv[2], &endp);
 	if (*endp && *endp != '\n')
 		return CMD_RET_USAGE;
 
diff --git a/cmd/osd.c b/cmd/osd.c
index 8557894..c8c62d4 100644
--- a/cmd/osd.c
+++ b/cmd/osd.c
@@ -211,7 +211,7 @@
 		int i, res;
 
 		/* show specific OSD */
-		i = simple_strtoul(argv[1], NULL, 10);
+		i = dectoul(argv[1], NULL);
 
 		res = uclass_get_device_by_seq(UCLASS_VIDEO_OSD, i, &osd);
 		if (res) {
@@ -240,7 +240,7 @@
 			osd_no = -1;
 		printf("Current osd is %d\n", osd_no);
 	} else {
-		osd_no = simple_strtoul(argv[1], NULL, 10);
+		osd_no = dectoul(argv[1], NULL);
 		printf("Setting osd to %d\n", osd_no);
 
 		res = cmd_osd_set_osd_num(osd_no);
diff --git a/cmd/pcap.c b/cmd/pcap.c
index c751980..ab5c1a7 100644
--- a/cmd/pcap.c
+++ b/cmd/pcap.c
@@ -19,7 +19,7 @@
 		return CMD_RET_USAGE;
 
 	addr = hextoul(argv[1], NULL);
-	size = simple_strtoul(argv[2], NULL, 10);
+	size = dectoul(argv[2], NULL);
 
 	return pcap_init(addr, size) ? CMD_RET_FAILURE : CMD_RET_SUCCESS;
 }
diff --git a/cmd/pstore.c b/cmd/pstore.c
index c6973ae..9fac8c7 100644
--- a/cmd/pstore.c
+++ b/cmd/pstore.c
@@ -279,7 +279,7 @@
 				- pstore_ftrace_size - pstore_console_size;
 
 		if (argc > 2) {
-			ptr += simple_strtoul(argv[2], NULL, 10)
+			ptr += dectoul(argv[2], NULL)
 				* pstore_record_size;
 			ptr_end = ptr + pstore_record_size;
 		}
diff --git a/cmd/pwm.c b/cmd/pwm.c
index e1f97c7..87d840a 100644
--- a/cmd/pwm.c
+++ b/cmd/pwm.c
@@ -66,7 +66,7 @@
 		return CMD_RET_USAGE;
 	}
 
-	pwm_dev = simple_strtoul(str_pwm, NULL, 10);
+	pwm_dev = dectoul(str_pwm, NULL);
 	ret = uclass_get_device(UCLASS_PWM, pwm_dev, &dev);
 	if (ret) {
 		printf("pwm: '%s' not found\n", str_pwm);
@@ -74,22 +74,22 @@
 	}
 
 	str_channel = *argv;
-	channel = simple_strtoul(str_channel, NULL, 10);
+	channel = dectoul(str_channel, NULL);
 	argc--;
 	argv++;
 
 	if (sub_cmd == PWM_SET_INVERT) {
 		str_enable = *argv;
-		pwm_enable = simple_strtoul(str_enable, NULL, 10);
+		pwm_enable = dectoul(str_enable, NULL);
 		ret = pwm_set_invert(dev, channel, pwm_enable);
 	} else if (sub_cmd == PWM_SET_CONFIG) {
 		str_period = *argv;
 		argc--;
 		argv++;
-		period_ns = simple_strtoul(str_period, NULL, 10);
+		period_ns = dectoul(str_period, NULL);
 
 		str_duty = *argv;
-		duty_ns = simple_strtoul(str_duty, NULL, 10);
+		duty_ns = dectoul(str_duty, NULL);
 
 		ret = pwm_set_config(dev, channel, period_ns, duty_ns);
 	} else if (sub_cmd == PWM_SET_ENABLE) {
diff --git a/cmd/remoteproc.c b/cmd/remoteproc.c
index 2a0e575..ca3b436 100644
--- a/cmd/remoteproc.c
+++ b/cmd/remoteproc.c
@@ -84,7 +84,7 @@
 			return 0;
 		printf("Few Remote Processors failed to be initialized\n");
 	} else if (argc == 2) {
-		id = (int)simple_strtoul(argv[1], NULL, 10);
+		id = (int)dectoul(argv[1], NULL);
 		if (!rproc_dev_init(id))
 			return 0;
 		printf("Remote Processor %d failed to be initialized\n", id);
@@ -129,7 +129,7 @@
 	if (argc != 4)
 		return CMD_RET_USAGE;
 
-	id = (int)simple_strtoul(argv[1], NULL, 10);
+	id = (int)dectoul(argv[1], NULL);
 	addr = hextoul(argv[2], NULL);
 
 	size = hextoul(argv[3], NULL);
@@ -167,7 +167,7 @@
 	if (argc != 2)
 		return CMD_RET_USAGE;
 
-	id = (int)simple_strtoul(argv[1], NULL, 10);
+	id = (int)dectoul(argv[1], NULL);
 
 	if (!strcmp(argv[0], "start")) {
 		ret = rproc_start(id);
diff --git a/cmd/rtc.c b/cmd/rtc.c
index 784879e..75d4b64 100644
--- a/cmd/rtc.c
+++ b/cmd/rtc.c
@@ -130,7 +130,7 @@
 
 	idx = curr_rtc;
 	if (!strcmp(argv[0], "dev") && argc >= 2)
-		idx = simple_strtoul(argv[1], NULL, 10);
+		idx = dectoul(argv[1], NULL);
 
 	ret = uclass_get_device(UCLASS_RTC, idx, &dev);
 	if (ret) {
diff --git a/cmd/sata.c b/cmd/sata.c
index aa396c1..76da190 100644
--- a/cmd/sata.c
+++ b/cmd/sata.c
@@ -88,7 +88,7 @@
 		int devnum = 0;
 
 		if (argc == 3)
-			devnum = (int)simple_strtoul(argv[2], NULL, 10);
+			devnum = (int)dectoul(argv[2], NULL);
 		if (!strcmp(argv[1], "stop"))
 			return sata_remove(devnum);
 
diff --git a/cmd/sleep.c b/cmd/sleep.c
index 1fff400..c741b4a 100644
--- a/cmd/sleep.c
+++ b/cmd/sleep.c
@@ -20,7 +20,7 @@
 	if (argc != 2)
 		return CMD_RET_USAGE;
 
-	delay = simple_strtoul(argv[1], NULL, 10) * CONFIG_SYS_HZ;
+	delay = dectoul(argv[1], NULL) * CONFIG_SYS_HZ;
 
 	frpart = strchr(argv[1], '.');
 
diff --git a/cmd/sound.c b/cmd/sound.c
index fdcde36..f82f2aa 100644
--- a/cmd/sound.c
+++ b/cmd/sound.c
@@ -41,9 +41,9 @@
 	int freq = 400;
 
 	if (argc > 1)
-		msec = simple_strtoul(argv[1], NULL, 10);
+		msec = dectoul(argv[1], NULL);
 	if (argc > 2)
-		freq = simple_strtoul(argv[2], NULL, 10);
+		freq = dectoul(argv[2], NULL);
 
 	ret = uclass_first_device_err(UCLASS_SOUND, &dev);
 	if (!ret)
diff --git a/cmd/spi.c b/cmd/spi.c
index 4aea191..bdbdbac 100644
--- a/cmd/spi.c
+++ b/cmd/spi.c
@@ -114,20 +114,20 @@
 	{
 		if (argc >= 2) {
 			mode = CONFIG_DEFAULT_SPI_MODE;
-			bus = simple_strtoul(argv[1], &cp, 10);
+			bus = dectoul(argv[1], &cp);
 			if (*cp == ':') {
-				cs = simple_strtoul(cp+1, &cp, 10);
+				cs = dectoul(cp + 1, &cp);
 			} else {
 				cs = bus;
 				bus = CONFIG_DEFAULT_SPI_BUS;
 			}
 			if (*cp == '.')
-				mode = simple_strtoul(cp+1, &cp, 10);
+				mode = dectoul(cp + 1, &cp);
 			if (*cp == '@')
-				freq = simple_strtoul(cp+1, &cp, 10);
+				freq = dectoul(cp + 1, &cp);
 		}
 		if (argc >= 3)
-			bitlen = simple_strtoul(argv[2], NULL, 10);
+			bitlen = dectoul(argv[2], NULL);
 		if (argc >= 4) {
 			cp = argv[3];
 			for(j = 0; *cp; j++, cp++) {
diff --git a/cmd/ti/pd.c b/cmd/ti/pd.c
index 9e820b8..008668f 100644
--- a/cmd/ti/pd.c
+++ b/cmd/ti/pd.c
@@ -119,8 +119,8 @@
 	if (!data)
 		return CMD_RET_FAILURE;
 
-	psc_id = simple_strtoul(argv[1], NULL, 10);
-	lpsc_id = simple_strtoul(argv[2], NULL, 10);
+	psc_id = dectoul(argv[1], NULL);
+	lpsc_id = dectoul(argv[2], NULL);
 
 	for (i = 0; i < data->num_lpsc; i++) {
 		lpsc = &data->lpsc[i];
diff --git a/cmd/tpm-common.c b/cmd/tpm-common.c
index a48c060..1d5442c 100644
--- a/cmd/tpm-common.c
+++ b/cmd/tpm-common.c
@@ -302,7 +302,7 @@
 	int rc;
 
 	if (argc == 2) {
-		num = simple_strtoul(argv[1], NULL, 10);
+		num = dectoul(argv[1], NULL);
 
 		rc = tpm_set_device(num);
 		if (rc)
diff --git a/cmd/ufs.c b/cmd/ufs.c
index 858cd49..d4a1e66 100644
--- a/cmd/ufs.c
+++ b/cmd/ufs.c
@@ -16,7 +16,7 @@
 	if (argc >= 2) {
 		if (!strcmp(argv[1], "init")) {
 			if (argc == 3) {
-				dev = simple_strtoul(argv[2], NULL, 10);
+				dev = dectoul(argv[2], NULL);
 				ret = ufs_probe_dev(dev);
 				if (ret)
 					return CMD_RET_FAILURE;
diff --git a/cmd/usb.c b/cmd/usb.c
index b9ec29a..3d87376 100644
--- a/cmd/usb.c
+++ b/cmd/usb.c
@@ -690,7 +690,7 @@
 			 * have multiple controllers and the device numbering
 			 * starts at 1 on each bus.
 			 */
-			i = simple_strtoul(argv[2], NULL, 10);
+			i = dectoul(argv[2], NULL);
 			printf("config for device %d\n", i);
 			udev = usb_find_device(i);
 			if (udev == NULL) {
@@ -706,13 +706,13 @@
 	if (strncmp(argv[1], "test", 4) == 0) {
 		if (argc < 5)
 			return CMD_RET_USAGE;
-		i = simple_strtoul(argv[2], NULL, 10);
+		i = dectoul(argv[2], NULL);
 		udev = usb_find_device(i);
 		if (udev == NULL) {
 			printf("Device %d does not exist.\n", i);
 			return 1;
 		}
-		i = simple_strtoul(argv[3], NULL, 10);
+		i = dectoul(argv[3], NULL);
 		return usb_test(udev, i, argv[4]);
 	}
 #ifdef CONFIG_USB_STORAGE
diff --git a/cmd/w1.c b/cmd/w1.c
index d0f0ee1..3209e65 100644
--- a/cmd/w1.c
+++ b/cmd/w1.c
@@ -51,16 +51,16 @@
 	u8 buf[512];
 
 	if (argc > 2)
-		bus_n = simple_strtoul(argv[2], NULL, 10);
+		bus_n = dectoul(argv[2], NULL);
 
 	if (argc > 3)
-		dev_n = simple_strtoul(argv[3], NULL, 10);
+		dev_n = dectoul(argv[3], NULL);
 
 	if (argc > 4)
-		offset = simple_strtoul(argv[4], NULL, 10);
+		offset = dectoul(argv[4], NULL);
 
 	if (argc > 5)
-		len = simple_strtoul(argv[5], NULL, 10);
+		len = dectoul(argv[5], NULL);
 
 	if (len > 512) {
 		printf("len needs to be <= 512\n");