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/arch/arm/cpu/armv8/fsl-layerscape/soc.c b/arch/arm/cpu/armv8/fsl-layerscape/soc.c
index 0562d28..1641b65 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/soc.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/soc.c
@@ -277,7 +277,7 @@
 	ulong interval_mhz = get_bus_freq(0) / (1000 * 1000);
 
 	if (interval)
-		interval_mhz = simple_strtoul(interval, NULL, 10);
+		interval_mhz = dectoul(interval, NULL);
 
 	return interval_mhz;
 }
diff --git a/arch/arm/mach-imx/cmd_dek.c b/arch/arm/mach-imx/cmd_dek.c
index 40df10d..1e3cfee 100644
--- a/arch/arm/mach-imx/cmd_dek.c
+++ b/arch/arm/mach-imx/cmd_dek.c
@@ -302,7 +302,7 @@
 
 	src_addr = hextoul(argv[1], NULL);
 	dst_addr = hextoul(argv[2], NULL);
-	len = simple_strtoul(argv[3], NULL, 10);
+	len = dectoul(argv[3], NULL);
 
 	return blob_encap_dek(src_addr, dst_addr, len);
 }
diff --git a/arch/arm/mach-imx/cmd_mfgprot.c b/arch/arm/mach-imx/cmd_mfgprot.c
index 29074fc..1e866b7 100644
--- a/arch/arm/mach-imx/cmd_mfgprot.c
+++ b/arch/arm/mach-imx/cmd_mfgprot.c
@@ -72,7 +72,7 @@
 			return CMD_RET_USAGE;
 
 		m_addr = hextoul(argv[2], NULL);
-		m_size = simple_strtoul(argv[3], NULL, 10);
+		m_size = dectoul(argv[3], NULL);
 		m_ptr = map_physmem(m_addr, m_size, MAP_NOCACHE);
 		if (!m_ptr)
 			return -ENOMEM;
diff --git a/arch/arm/mach-imx/imx8/snvs_security_sc.c b/arch/arm/mach-imx/imx8/snvs_security_sc.c
index 7c34ce6..507b5b4 100644
--- a/arch/arm/mach-imx/imx8/snvs_security_sc.c
+++ b/arch/arm/mach-imx/imx8/snvs_security_sc.c
@@ -726,7 +726,7 @@
 	if (argc != (2 + 1))
 		return CMD_RET_USAGE;
 
-	conf.pad = simple_strtoul(argv[++idx], NULL, 10);
+	conf.pad = dectoul(argv[++idx], NULL);
 	conf.mux_conf = hextoul(argv[++idx], NULL);
 
 	err = apply_tamper_pin_list_config(&conf, 1);
diff --git a/arch/arm/mach-keystone/cmd_clock.c b/arch/arm/mach-keystone/cmd_clock.c
index 7165d66..72dc394 100644
--- a/arch/arm/mach-keystone/cmd_clock.c
+++ b/arch/arm/mach-keystone/cmd_clock.c
@@ -42,9 +42,9 @@
 	else
 		goto pll_cmd_usage;
 
-	cmd_pll_data.pll_m   = simple_strtoul(argv[2], NULL, 10);
-	cmd_pll_data.pll_d   = simple_strtoul(argv[3], NULL, 10);
-	cmd_pll_data.pll_od  = simple_strtoul(argv[4], NULL, 10);
+	cmd_pll_data.pll_m   = dectoul(argv[2], NULL);
+	cmd_pll_data.pll_d   = dectoul(argv[3], NULL);
+	cmd_pll_data.pll_od  = dectoul(argv[4], NULL);
 
 	printf("Trying to set pll %d; mult %d; div %d; OD %d\n",
 	       cmd_pll_data.pll, cmd_pll_data.pll_m,
@@ -72,7 +72,7 @@
 	if (argc != 2)
 		goto getclk_cmd_usage;
 
-	clk = simple_strtoul(argv[1], NULL, 10);
+	clk = dectoul(argv[1], NULL);
 
 	freq = ks_clk_get_rate(clk);
 	if (freq)
@@ -101,7 +101,7 @@
 	if (argc != 3)
 		goto psc_cmd_usage;
 
-	psc_module = simple_strtoul(argv[1], NULL, 10);
+	psc_module = dectoul(argv[1], NULL);
 	if (strcmp(argv[2], "en") == 0) {
 		res = psc_enable_module(psc_module);
 		printf("psc_enable_module(%d) - %s\n", psc_module,
diff --git a/arch/arm/mach-kirkwood/cpu.c b/arch/arm/mach-kirkwood/cpu.c
index 339ae7f..3953aa9 100644
--- a/arch/arm/mach-kirkwood/cpu.c
+++ b/arch/arm/mach-kirkwood/cpu.c
@@ -125,7 +125,7 @@
 		return;
 
 	/* read sysrstdelay value */
-	sysrst_dly = (u32) simple_strtoul(s, NULL, 10);
+	sysrst_dly = (u32)dectoul(s, NULL);
 
 	/* read SysRst Length counter register (bits 28:0) */
 	sysrst_cnt = (0x1fffffff & readl(KW_REG_SYSRST_CNT));
diff --git a/arch/arm/mach-nexell/clock.c b/arch/arm/mach-nexell/clock.c
index d5b46a8..24fa204 100644
--- a/arch/arm/mach-nexell/clock.c
+++ b/arch/arm/mach-nexell/clock.c
@@ -592,7 +592,7 @@
 			c = strrchr((const char *)str, (int)'.');
 			if (!c || !cdev->peri)
 				break;
-		devid = simple_strtoul(++c, NULL, 10);
+		devid = dectoul(++c, NULL);
 		if (cdev->peri->dev_id == devid)
 			break;
 		}
diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c b/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c
index bf9a686..be53a52 100644
--- a/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c
+++ b/arch/arm/mach-stm32mp/cmd_stm32prog/cmd_stm32prog.c
@@ -59,7 +59,7 @@
 		return CMD_RET_USAGE;
 	}
 
-	dev = (int)simple_strtoul(argv[2], NULL, 10);
+	dev = (int)dectoul(argv[2], NULL);
 
 	addr = STM32_DDR_BASE;
 	size = 0;
diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
index 96ebc6d..26fe8b6 100644
--- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
+++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c
@@ -253,7 +253,7 @@
 				result = -EINVAL;
 			else
 				part->bin_nb =
-					simple_strtoul(&p[7], NULL, 10);
+					dectoul(&p[7], NULL);
 		}
 	} else if (!strcmp(p, "System")) {
 		part->part_type = PART_SYSTEM;
diff --git a/arch/powerpc/cpu/mpc83xx/ecc.c b/arch/powerpc/cpu/mpc83xx/ecc.c
index 68a7a78..7a8ec7f 100644
--- a/arch/powerpc/cpu/mpc83xx/ecc.c
+++ b/arch/powerpc/cpu/mpc83xx/ecc.c
@@ -138,7 +138,7 @@
 	}
 	if (argc == 3) {
 		if (strcmp(argv[1], "sbecnt") == 0) {
-			val = simple_strtoul(argv[2], NULL, 10);
+			val = dectoul(argv[2], NULL);
 			if (val > 255) {
 				printf("Incorrect Counter value, "
 				       "should be 0..255\n");
@@ -151,7 +151,7 @@
 			ddr->err_sbe = val;
 			return 0;
 		} else if (strcmp(argv[1], "sbethr") == 0) {
-			val = simple_strtoul(argv[2], NULL, 10);
+			val = dectoul(argv[2], NULL);
 			if (val > 255) {
 				printf("Incorrect Counter value, "
 				       "should be 0..255\n");
diff --git a/board/Arcturus/ucp1020/ucp1020.c b/board/Arcturus/ucp1020/ucp1020.c
index 24d1d57..ee8a9e0 100644
--- a/board/Arcturus/ucp1020/ucp1020.c
+++ b/board/Arcturus/ucp1020/ucp1020.c
@@ -52,7 +52,7 @@
  */
 int name_to_gpio(const char *name)
 {
-	int gpio = 31 - simple_strtoul(name, NULL, 10);
+	int gpio = 31 - dectoul(name, NULL);
 
 	if (gpio < 16)
 		gpio = -1;
diff --git a/board/BuS/eb_cpu5282/eb_cpu5282.c b/board/BuS/eb_cpu5282/eb_cpu5282.c
index 5829299..b739bc3 100644
--- a/board/BuS/eb_cpu5282/eb_cpu5282.c
+++ b/board/BuS/eb_cpu5282/eb_cpu5282.c
@@ -194,13 +194,13 @@
 	printf("Init Video as ");
 	s = env_get("displaywidth");
 	if (s != NULL)
-		display_width = simple_strtoul(s, NULL, 10);
+		display_width = dectoul(s, NULL);
 	else
 		display_width = 256;
 
 	s = env_get("displayheight");
 	if (s != NULL)
-		display_height = simple_strtoul(s, NULL, 10);
+		display_height = dectoul(s, NULL);
 	else
 		display_height = 256;
 
@@ -234,8 +234,8 @@
 
 	switch (argc) {
 	case 3:
-		side = simple_strtoul(argv[1], NULL, 10);
-		bright = simple_strtoul(argv[2], NULL, 10);
+		side = dectoul(argv[1], NULL);
+		bright = dectoul(argv[2], NULL);
 		if ((side >= 0) && (side <= 3) &&
 			(bright >= 0) && (bright <= 1000)) {
 			vcxk_setbrightness(side, bright);
diff --git a/board/atmel/common/board.c b/board/atmel/common/board.c
index eee5c35..c93c0e5 100644
--- a/board/atmel/common/board.c
+++ b/board/atmel/common/board.c
@@ -47,7 +47,7 @@
 			break;
 		}
 	}
-	pda = simple_strtoul((const char *)buf, NULL, 10);
+	pda = dectoul((const char *)buf, NULL);
 
 	switch (pda) {
 	case 7000:
diff --git a/board/cavium/thunderx/atf.c b/board/cavium/thunderx/atf.c
index 582af6f..1a039c5 100644
--- a/board/cavium/thunderx/atf.c
+++ b/board/cavium/thunderx/atf.c
@@ -236,47 +236,47 @@
 
 	if ((argc == 5) && !strcmp(argv[1], "readmmc")) {
 		buffer = (void *)hextoul(argv[2], NULL);
-		offset = simple_strtoul(argv[3], NULL, 10);
-		size = simple_strtoul(argv[4], NULL, 10);
+		offset = dectoul(argv[3], NULL);
+		size = dectoul(argv[4], NULL);
 
 		ret = atf_read_mmc(offset, buffer, size);
 	} else if ((argc == 5) && !strcmp(argv[1], "readnor")) {
 		buffer = (void *)hextoul(argv[2], NULL);
-		offset = simple_strtoul(argv[3], NULL, 10);
-		size = simple_strtoul(argv[4], NULL, 10);
+		offset = dectoul(argv[3], NULL);
+		size = dectoul(argv[4], NULL);
 
 		ret = atf_read_nor(offset, buffer, size);
 	} else if ((argc == 5) && !strcmp(argv[1], "writemmc")) {
 		buffer = (void *)hextoul(argv[2], NULL);
-		offset = simple_strtoul(argv[3], NULL, 10);
-		size = simple_strtoul(argv[4], NULL, 10);
+		offset = dectoul(argv[3], NULL);
+		size = dectoul(argv[4], NULL);
 
 		ret = atf_write_mmc(offset, buffer, size);
 	} else if ((argc == 5) && !strcmp(argv[1], "writenor")) {
 		buffer = (void *)hextoul(argv[2], NULL);
-		offset = simple_strtoul(argv[3], NULL, 10);
-		size = simple_strtoul(argv[4], NULL, 10);
+		offset = dectoul(argv[3], NULL);
+		size = dectoul(argv[4], NULL);
 
 		ret = atf_write_nor(offset, buffer, size);
 	} else if ((argc == 2) && !strcmp(argv[1], "part")) {
 		atf_print_part_table();
 	} else if ((argc == 4) && !strcmp(argv[1], "erasenor")) {
-		offset = simple_strtoul(argv[2], NULL, 10);
-		size = simple_strtoul(argv[3], NULL, 10);
+		offset = dectoul(argv[2], NULL);
+		size = dectoul(argv[3], NULL);
 
 		ret = atf_erase_nor(offset, size);
 	} else if ((argc == 2) && !strcmp(argv[1], "envcount")) {
 		ret = atf_env_count();
 		printf("Number of environment strings: %zd\n", ret);
 	} else if ((argc == 3) && !strcmp(argv[1], "envstring")) {
-		index = simple_strtoul(argv[2], NULL, 10);
+		index = dectoul(argv[2], NULL);
 		ret = atf_env_string(index, str);
 		if (ret > 0)
 			printf("Environment string %d: %s\n", index, str);
 		else
 			printf("Return code: %zd\n", ret);
 	} else if ((argc == 3) && !strcmp(argv[1], "dramsize")) {
-		node = simple_strtoul(argv[2], NULL, 10);
+		node = dectoul(argv[2], NULL);
 		ret = atf_dram_size(node);
 		printf("DRAM size: %zd Mbytes\n", ret >> 20);
 	} else if ((argc == 2) && !strcmp(argv[1], "nodes")) {
diff --git a/board/compulab/common/eeprom.c b/board/compulab/common/eeprom.c
index 5206cf5..b41c64d 100644
--- a/board/compulab/common/eeprom.c
+++ b/board/compulab/common/eeprom.c
@@ -153,7 +153,7 @@
 	 */
 	if (cl_eeprom_layout == LAYOUT_LEGACY) {
 		sprintf(str, "%x", board_rev);
-		board_rev = simple_strtoul(str, NULL, 10);
+		board_rev = dectoul(str, NULL);
 	}
 
 	return board_rev;
diff --git a/board/compulab/common/omap3_display.c b/board/compulab/common/omap3_display.c
index cb9ebae..4ed3b9c 100644
--- a/board/compulab/common/omap3_display.c
+++ b/board/compulab/common/omap3_display.c
@@ -244,7 +244,7 @@
 	int divisor, pixclock_val;
 	char *pixclk_start = pixclock;
 
-	pixclock_val = simple_strtoul(pixclock, &pixclock, 10);
+	pixclock_val = dectoul(pixclock, &pixclock);
 	divisor = DIV_ROUND_UP(PIXEL_CLK_NUMERATOR, pixclock_val);
 	/* 0 and 1 are illegal values for PCD */
 	if (divisor <= 1)
diff --git a/board/davinci/da8xxevm/da850evm.c b/board/davinci/da8xxevm/da850evm.c
index 383a861..6c75231 100644
--- a/board/davinci/da8xxevm/da850evm.c
+++ b/board/davinci/da8xxevm/da850evm.c
@@ -284,7 +284,7 @@
 
 	s = env_get("maxcpuclk");
 	if (s)
-		maxcpuclk = simple_strtoul(s, NULL, 10);
+		maxcpuclk = dectoul(s, NULL);
 
 	if (maxcpuclk >= 456000000)
 		rev = 3;
diff --git a/board/freescale/common/pixis.c b/board/freescale/common/pixis.c
index 4127fbc..6fdb110 100644
--- a/board/freescale/common/pixis.c
+++ b/board/freescale/common/pixis.c
@@ -403,10 +403,10 @@
 		mulconst = 1;
 		for (i = 0; i < j; i++)
 			mulconst *= 10;
-		decval = simple_strtoul(decarr, NULL, 10);
+		decval = dectoul(decarr, NULL);
 	}
 
-	intval = simple_strtoul(intarr, NULL, 10);
+	intval = dectoul(intarr, NULL);
 	intval = intval * mulconst;
 
 	return intval + decval;
@@ -489,9 +489,9 @@
 		unsigned long corepll;
 		unsigned long mpxpll;
 
-		sysclk = simple_strtoul(p_cf_sysclk, NULL, 10);
+		sysclk = dectoul(p_cf_sysclk, NULL);
 		corepll = strfractoint(p_cf_corepll);
-		mpxpll = simple_strtoul(p_cf_mpxpll, NULL, 10);
+		mpxpll = dectoul(p_cf_mpxpll, NULL);
 
 		if (!(set_px_sysclk(sysclk)
 		      && set_px_corepll(corepll)
diff --git a/board/freescale/common/sys_eeprom.c b/board/freescale/common/sys_eeprom.c
index 9e73056..35df8ba 100644
--- a/board/freescale/common/sys_eeprom.c
+++ b/board/freescale/common/sys_eeprom.c
@@ -456,7 +456,7 @@
 		update_crc();
 		break;
 	case '0' ... '9':	/* "mac 0" through "mac 22" */
-		set_mac_address(simple_strtoul(argv[1], NULL, 10), argv[2]);
+		set_mac_address(dectoul(argv[1], NULL), argv[2]);
 		break;
 	case 'h':	/* help */
 	default:
diff --git a/board/gateworks/gw_ventana/gsc.c b/board/gateworks/gw_ventana/gsc.c
index ffed6b5..59fd1b6 100644
--- a/board/gateworks/gw_ventana/gsc.c
+++ b/board/gateworks/gw_ventana/gsc.c
@@ -277,7 +277,7 @@
 	if (argc < 2)
 		return CMD_RET_USAGE;
 
-	secs = simple_strtoul(argv[1], NULL, 10);
+	secs = dectoul(argv[1], NULL);
 	printf("GSC Sleeping for %ld seconds\n", secs);
 
 	i2c_set_bus_num(0);
@@ -322,7 +322,7 @@
 		int timeout = 0;
 
 		if (argc > 2)
-			timeout = simple_strtoul(argv[2], NULL, 10);
+			timeout = dectoul(argv[2], NULL);
 		i2c_set_bus_num(0);
 		if (gsc_i2c_read(GSC_SC_ADDR, GSC_SC_CTRL1, 1, &reg, 1))
 			return CMD_RET_FAILURE;
diff --git a/board/gateworks/gw_ventana/gw_ventana.c b/board/gateworks/gw_ventana/gw_ventana.c
index 6a0382d..912075d 100644
--- a/board/gateworks/gw_ventana/gw_ventana.c
+++ b/board/gateworks/gw_ventana/gw_ventana.c
@@ -471,7 +471,7 @@
 
 	if (serial) {
 		serialnr->high = 0;
-		serialnr->low = simple_strtoul(serial, NULL, 10);
+		serialnr->low = dectoul(serial, NULL);
 	} else if (ventana_info.model[0]) {
 		serialnr->high = 0;
 		serialnr->low = ventana_info.serial;
diff --git a/board/gateworks/venice/gsc.c b/board/gateworks/venice/gsc.c
index c75bc6f..271bc8c 100644
--- a/board/gateworks/venice/gsc.c
+++ b/board/gateworks/venice/gsc.c
@@ -660,7 +660,7 @@
 	if (strcasecmp(argv[1], "sleep") == 0) {
 		if (argc < 3)
 			return CMD_RET_USAGE;
-		if (!gsc_sleep(simple_strtoul(argv[2], NULL, 10)))
+		if (!gsc_sleep(dectoul(argv[2], NULL)))
 			return CMD_RET_SUCCESS;
 	} else if (strcasecmp(argv[1], "hwmon") == 0) {
 		if (!gsc_hwmon())
diff --git a/board/gdsys/common/cmd_ioloop.c b/board/gdsys/common/cmd_ioloop.c
index 658756d..1412421 100644
--- a/board/gdsys/common/cmd_ioloop.c
+++ b/board/gdsys/common/cmd_ioloop.c
@@ -275,13 +275,13 @@
 	if (argc < 2)
 		return CMD_RET_USAGE;
 
-	fpga = simple_strtoul(argv[1], NULL, 10);
+	fpga = dectoul(argv[1], NULL);
 
 	/*
 	 * If another parameter, it is the report rate in packets.
 	 */
 	if (argc > 2)
-		rate = simple_strtoul(argv[2], NULL, 10);
+		rate = dectoul(argv[2], NULL);
 
 	/* Enable receive path */
 	FPGA_SET_REG(fpga, ep.rx_tx_control, CTRL_PROC_RECEIVE_ENABLE);
@@ -388,18 +388,18 @@
 	/*
 	 * FPGA is specified since argc > 2
 	 */
-	fpga = simple_strtoul(argv[1], NULL, 10);
+	fpga = dectoul(argv[1], NULL);
 
 	/*
 	 * packet size is specified since argc > 2
 	 */
-	size = simple_strtoul(argv[2], NULL, 10);
+	size = dectoul(argv[2], NULL);
 
 	/*
 	 * If another parameter, it is the test rate in packets per second.
 	 */
 	if (argc > 3)
-		rate = simple_strtoul(argv[3], NULL, 10);
+		rate = dectoul(argv[3], NULL);
 
 	/* enable receive path */
 	FPGA_SET_REG(fpga, ep.rx_tx_control, CTRL_PROC_RECEIVE_ENABLE);
@@ -463,13 +463,13 @@
 	/*
 	 * packet size is specified since argc > 1
 	 */
-	size = simple_strtoul(argv[2], NULL, 10);
+	size = dectoul(argv[2], NULL);
 
 	/*
 	 * If another parameter, it is the test rate in packets per second.
 	 */
 	if (argc > 2)
-		rate = simple_strtoul(argv[3], NULL, 10);
+		rate = dectoul(argv[3], NULL);
 
 	/* Enable receive path */
 	misc_set_enabled(dev, true);
@@ -514,7 +514,7 @@
 		return CMD_RET_FAILURE;
 
 	if (argc > 1) {
-		int i = simple_strtoul(argv[1], NULL, 10);
+		int i = dectoul(argv[1], NULL);
 
 		snprintf(name, sizeof(name), "ioep%d", i);
 
diff --git a/board/samsung/common/exynos5-dt.c b/board/samsung/common/exynos5-dt.c
index 1318ea7..0d77a57f 100644
--- a/board/samsung/common/exynos5-dt.c
+++ b/board/samsung/common/exynos5-dt.c
@@ -169,7 +169,7 @@
 	if (board_is_odroidxu4() || board_is_odroidhc1() || board_is_odroidhc2())
 		return info;
 
-	dev_num = simple_strtoul(devstr, NULL, 10);
+	dev_num = dectoul(devstr, NULL);
 
 	mmc = find_mmc_device(dev_num);
 	if (!mmc)
diff --git a/board/samsung/odroid/odroid.c b/board/samsung/odroid/odroid.c
index 90aab62..35e4cee 100644
--- a/board/samsung/odroid/odroid.c
+++ b/board/samsung/odroid/odroid.c
@@ -85,7 +85,7 @@
 	char *alt_boot;
 	int dev_num;
 
-	dev_num = simple_strtoul(devstr, NULL, 10);
+	dev_num = dectoul(devstr, NULL);
 
 	mmc = find_mmc_device(dev_num);
 	if (!mmc)
diff --git a/board/siemens/taurus/taurus.c b/board/siemens/taurus/taurus.c
index cad16f9..dae064d 100644
--- a/board/siemens/taurus/taurus.c
+++ b/board/siemens/taurus/taurus.c
@@ -394,10 +394,9 @@
 	unsigned long boot_retry = 0;
 	char boot_buf[10];
 
-	upgrade_available = simple_strtoul(env_get("upgrade_available"), NULL,
-					   10);
+	upgrade_available = dectoul(env_get("upgrade_available"), NULL);
 	if (upgrade_available) {
-		boot_retry = simple_strtoul(env_get("boot_retries"), NULL, 10);
+		boot_retry = dectoul(env_get("boot_retries"), NULL);
 		boot_retry++;
 		sprintf(boot_buf, "%lx", boot_retry);
 		env_set("boot_retries", boot_buf);
diff --git a/board/sifive/unmatched/hifive-platform-i2c-eeprom.c b/board/sifive/unmatched/hifive-platform-i2c-eeprom.c
index b230a71..2b985b9 100644
--- a/board/sifive/unmatched/hifive-platform-i2c-eeprom.c
+++ b/board/sifive/unmatched/hifive-platform-i2c-eeprom.c
@@ -324,7 +324,7 @@
 {
 	unsigned long p;
 
-	p = simple_strtoul(string, &string, 10);
+	p = dectoul(string, &string);
 	if (p > U8_MAX) {
 		printf("%s must not be greater than %d\n", "PCB revision",
 		       U8_MAX);
@@ -366,7 +366,7 @@
 {
 	unsigned long p;
 
-	p = simple_strtoul(string, &string, 10);
+	p = dectoul(string, &string);
 	if (p > U8_MAX) {
 		printf("%s must not be greater than %d\n", "BOM variant",
 		       U8_MAX);
@@ -389,7 +389,7 @@
 {
 	unsigned long p;
 
-	p = simple_strtoul(string, &string, 10);
+	p = dectoul(string, &string);
 	if (p > U16_MAX) {
 		printf("%s must not be greater than %d\n", "Product ID",
 		       U16_MAX);
diff --git a/board/synopsys/hsdk/env-lib.c b/board/synopsys/hsdk/env-lib.c
index e225838..fd54ac7 100644
--- a/board/synopsys/hsdk/env-lib.c
+++ b/board/synopsys/hsdk/env-lib.c
@@ -254,7 +254,7 @@
 	if (map[i].type == ENV_HEX)
 		map[i].val->val = hextoul(argv[1], &endp);
 	else
-		map[i].val->val = simple_strtoul(argv[1], &endp, 10);
+		map[i].val->val = dectoul(argv[1], &endp);
 
 	map[i].val->set = true;
 
diff --git a/board/toradex/common/tdx-cfg-block.c b/board/toradex/common/tdx-cfg-block.c
index 93eb20c..e4f9a0d 100644
--- a/board/toradex/common/tdx-cfg-block.c
+++ b/board/toradex/common/tdx-cfg-block.c
@@ -548,7 +548,7 @@
 		len = cli_readline(message);
 	}
 
-	tdx_serial = simple_strtoul(console_buffer, NULL, 10);
+	tdx_serial = dectoul(console_buffer, NULL);
 
 	return 0;
 }
@@ -566,14 +566,14 @@
 	/* Get hardware information from the first 8 digits */
 	tag->ver_major = barcode[4] - '0';
 	tag->ver_minor = barcode[5] - '0';
-	tag->ver_assembly = simple_strtoul(revision, NULL, 10);
+	tag->ver_assembly = dectoul(revision, NULL);
 
 	barcode[4] = '\0';
-	tag->prodid = simple_strtoul(barcode, NULL, 10);
+	tag->prodid = dectoul(barcode, NULL);
 
 	/* Parse second part of the barcode (serial number */
 	barcode += 8;
-	*serial = simple_strtoul(barcode, NULL, 10);
+	*serial = dectoul(barcode, NULL);
 
 	return 0;
 }
@@ -710,7 +710,7 @@
 	tdx_car_hw_tag.ver_assembly = pid8[7] - '0';
 
 	pid8[4] = '\0';
-	tdx_car_hw_tag.prodid = simple_strtoul(pid8, NULL, 10);
+	tdx_car_hw_tag.prodid = dectoul(pid8, NULL);
 
 	/* Valid Tag */
 	write_tag(config_block, &offset, TAG_VALID, NULL, 0);
@@ -754,7 +754,7 @@
 
 	sprintf(message, "Choose your carrier board (provide ID): ");
 	len = cli_readline(message);
-	tdx_car_hw_tag.prodid = simple_strtoul(console_buffer, NULL, 10);
+	tdx_car_hw_tag.prodid = dectoul(console_buffer, NULL);
 
 	do {
 		sprintf(message, "Enter carrier board version (e.g. V1.1B): V");
@@ -770,7 +770,7 @@
 		len = cli_readline(message);
 	}
 
-	tdx_car_serial = simple_strtoul(console_buffer, NULL, 10);
+	tdx_car_serial = dectoul(console_buffer, NULL);
 
 	return 0;
 }
diff --git a/board/varisys/common/sys_eeprom.c b/board/varisys/common/sys_eeprom.c
index 1bf5436..8f624e5 100644
--- a/board/varisys/common/sys_eeprom.c
+++ b/board/varisys/common/sys_eeprom.c
@@ -368,7 +368,7 @@
 		update_crc();
 		break;
 	case '0' ... '9':	/* "mac 0" through "mac 22" */
-		set_mac_address(simple_strtoul(argv[1], NULL, 10), argv[2]);
+		set_mac_address(dectoul(argv[1], NULL), argv[2]);
 		break;
 	case 'h':	/* help */
 	default:
diff --git a/board/work-microwave/work_92105/work_92105_display.c b/board/work-microwave/work_92105/work_92105_display.c
index fecbbbd..e8e559c 100644
--- a/board/work-microwave/work_92105/work_92105_display.c
+++ b/board/work-microwave/work_92105/work_92105_display.c
@@ -233,8 +233,7 @@
 	/* set display contrast */
 	display_contrast_str = env_get("fwopt_dispcontrast");
 	if (display_contrast_str)
-		display_contrast = simple_strtoul(display_contrast_str,
-			NULL, 10);
+		display_contrast = dectoul(display_contrast_str, NULL);
 	i2c_write(0x2c, 0x00, 1, &display_contrast, 1);
 
 	/* request GPO_15 as an output initially set to 1 */
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");
diff --git a/common/bedbug.c b/common/bedbug.c
index 6e1fb58..c76fa48 100644
--- a/common/bedbug.c
+++ b/common/bedbug.c
@@ -1007,7 +1007,7 @@
 	if (txt[0] == '0' && (txt[1] == 'x' || txt[1] == 'X'))	/* hex */
 		val = hextoul(&txt[2], NULL);
 	else						/* decimal */
-		val = simple_strtoul (txt, NULL, 10);
+		val = dectoul(txt, NULL);
 
 	if (is_neg)
 		val = -val;
diff --git a/common/lcd_console.c b/common/lcd_console.c
index 1a246c4..9c0ff44 100644
--- a/common/lcd_console.c
+++ b/common/lcd_console.c
@@ -229,8 +229,8 @@
 	if (argc != 3)
 		return CMD_RET_USAGE;
 
-	col = simple_strtoul(argv[1], NULL, 10);
-	row = simple_strtoul(argv[2], NULL, 10);
+	col = dectoul(argv[1], NULL);
+	row = dectoul(argv[2], NULL);
 	lcd_position_cursor(col, row);
 
 	return 0;
diff --git a/disk/part_amiga.c b/disk/part_amiga.c
index 7eea60b..ac7ada5 100644
--- a/disk/part_amiga.c
+++ b/disk/part_amiga.c
@@ -135,7 +135,7 @@
 
     s = env_get("amiga_scanlimit");
     if (s)
-	limit = simple_strtoul(s, NULL, 10);
+	limit = dectoul(s, NULL);
     else
 	limit = AMIGA_BLOCK_LIMIT;
 
@@ -175,7 +175,7 @@
 
     s = env_get("amiga_scanlimit");
     if (s)
-	limit = simple_strtoul(s, NULL, 10);
+	limit = dectoul(s, NULL);
     else
 	limit = AMIGA_BLOCK_LIMIT;
 
diff --git a/drivers/dfu/dfu_mmc.c b/drivers/dfu/dfu_mmc.c
index e63fa84..3dab5a5 100644
--- a/drivers/dfu/dfu_mmc.c
+++ b/drivers/dfu/dfu_mmc.c
@@ -348,7 +348,7 @@
 	const char *argv[3];
 	const char **parg = argv;
 
-	dfu->data.mmc.dev_num = simple_strtoul(devstr, NULL, 10);
+	dfu->data.mmc.dev_num = dectoul(devstr, NULL);
 
 	for (; parg < argv + sizeof(argv) / sizeof(*argv); ++parg) {
 		*parg = strsep(&s, " ");
diff --git a/drivers/dfu/dfu_mtd.c b/drivers/dfu/dfu_mtd.c
index a31d480..0b7f177 100644
--- a/drivers/dfu/dfu_mtd.c
+++ b/drivers/dfu/dfu_mtd.c
@@ -279,7 +279,7 @@
 
 		dfu->layout = DFU_RAW_ADDR;
 
-		part = simple_strtoul(s, &s, 10);
+		part = dectoul(s, &s);
 
 		sprintf(mtd_id, "%s,%d", devstr, part - 1);
 		printf("using id '%s'\n", mtd_id);
diff --git a/drivers/dfu/dfu_nand.c b/drivers/dfu/dfu_nand.c
index 6ddf80b..e53b35e 100644
--- a/drivers/dfu/dfu_nand.c
+++ b/drivers/dfu/dfu_nand.c
@@ -215,9 +215,9 @@
 
 		dfu->layout = DFU_RAW_ADDR;
 
-		dev = simple_strtoul(s, &s, 10);
+		dev = dectoul(s, &s);
 		s++;
-		part = simple_strtoul(s, &s, 10);
+		part = dectoul(s, &s);
 
 		sprintf(mtd_id, "%s%d,%d", "nand", dev, part - 1);
 		debug("using id '%s'\n", mtd_id);
diff --git a/drivers/dfu/dfu_sf.c b/drivers/dfu/dfu_sf.c
index ef52319..7e64ab7 100644
--- a/drivers/dfu/dfu_sf.c
+++ b/drivers/dfu/dfu_sf.c
@@ -184,9 +184,9 @@
 
 		dfu->layout = DFU_RAW_ADDR;
 
-		dev = simple_strtoul(s, &s, 10);
+		dev = dectoul(s, &s);
 		s++;
-		part = simple_strtoul(s, &s, 10);
+		part = dectoul(s, &s);
 
 		sprintf(mtd_id, "%s%d,%d", "nor", dev, part - 1);
 		printf("using id '%s'\n", mtd_id);
diff --git a/drivers/dfu/dfu_virt.c b/drivers/dfu/dfu_virt.c
index 62605bc..80c99cb 100644
--- a/drivers/dfu/dfu_virt.c
+++ b/drivers/dfu/dfu_virt.c
@@ -38,7 +38,7 @@
 
 	dfu->dev_type = DFU_DEV_VIRT;
 	dfu->layout = DFU_RAW_ADDR;
-	dfu->data.virt.dev_num = simple_strtoul(devstr, NULL, 10);
+	dfu->data.virt.dev_num = dectoul(devstr, NULL);
 
 	dfu->write_medium = dfu_write_medium_virt;
 	dfu->get_medium_size = dfu_get_medium_size_virt;
diff --git a/drivers/gpio/gpio-uclass.c b/drivers/gpio/gpio-uclass.c
index 131099c..8c77777 100644
--- a/drivers/gpio/gpio-uclass.c
+++ b/drivers/gpio/gpio-uclass.c
@@ -122,7 +122,7 @@
 	int numeric;
 	int ret;
 
-	numeric = isdigit(*name) ? simple_strtoul(name, NULL, 10) : -1;
+	numeric = isdigit(*name) ? dectoul(name, NULL) : -1;
 	for (ret = uclass_first_device(UCLASS_GPIO, &dev);
 	     dev;
 	     ret = uclass_next_device(&dev)) {
diff --git a/drivers/gpio/mxs_gpio.c b/drivers/gpio/mxs_gpio.c
index 5775a22..7b9d88a 100644
--- a/drivers/gpio/mxs_gpio.c
+++ b/drivers/gpio/mxs_gpio.c
@@ -123,12 +123,12 @@
 	unsigned bank, pin;
 	char *end;
 
-	bank = simple_strtoul(name, &end, 10);
+	bank = dectoul(name, &end);
 
 	if (!*end || *end != ':')
 		return bank;
 
-	pin = simple_strtoul(end + 1, NULL, 10);
+	pin = dectoul(end + 1, NULL);
 
 	return (bank << MXS_PAD_BANK_SHIFT) | (pin << MXS_PAD_PIN_SHIFT);
 }
diff --git a/drivers/gpio/tca642x.c b/drivers/gpio/tca642x.c
index 7007c7a..7f67f96 100644
--- a/drivers/gpio/tca642x.c
+++ b/drivers/gpio/tca642x.c
@@ -262,11 +262,11 @@
 
 	/* arg2 used as chip number or pin number */
 	if (argc > 2)
-		ul_arg2 = simple_strtoul(argv[2], NULL, 10);
+		ul_arg2 = dectoul(argv[2], NULL);
 
 	/* arg3 used as pin or invert value */
 	if (argc > 3)
-		ul_arg3 = simple_strtoul(argv[3], NULL, 10) & 0x1;
+		ul_arg3 = dectoul(argv[3], NULL) & 0x1;
 
 	switch ((int)c->cmd) {
 	case TCA642X_CMD_INFO:
diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c
index 60613b7..5bdcede 100644
--- a/drivers/net/e1000.c
+++ b/drivers/net/e1000.c
@@ -5796,7 +5796,7 @@
 	}
 
 	/* Make sure we can find the requested e1000 card */
-	cardnum = simple_strtoul(argv[1], NULL, 10);
+	cardnum = dectoul(argv[1], NULL);
 #ifdef CONFIG_DM_ETH
 	e1000_name(name, cardnum);
 	ret = uclass_get_device_by_name(UCLASS_ETH, name, &dev);
diff --git a/drivers/net/fsl-mc/mc.c b/drivers/net/fsl-mc/mc.c
index 3712221..d52c986 100644
--- a/drivers/net/fsl-mc/mc.c
+++ b/drivers/net/fsl-mc/mc.c
@@ -642,7 +642,7 @@
 	char *timeout_ms_env_var = env_get(MC_BOOT_TIMEOUT_ENV_VAR);
 
 	if (timeout_ms_env_var) {
-		timeout_ms = simple_strtoul(timeout_ms_env_var, NULL, 10);
+		timeout_ms = dectoul(timeout_ms_env_var, NULL);
 		if (timeout_ms == 0) {
 			printf("fsl-mc: WARNING: Invalid value for \'"
 			       MC_BOOT_TIMEOUT_ENV_VAR
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index f1d0630..cec96c5 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -87,7 +87,7 @@
 				return -1;	/* ncip is 0.0.0.0 */
 			p = strchr(env_get("ncip"), ':');
 			if (p != NULL) {
-				nc_out_port = simple_strtoul(p + 1, NULL, 10);
+				nc_out_port = dectoul(p + 1, NULL);
 				nc_in_port = nc_out_port;
 			}
 		} else {
@@ -96,10 +96,10 @@
 
 		p = env_get("ncoutport");
 		if (p != NULL)
-			nc_out_port = simple_strtoul(p, NULL, 10);
+			nc_out_port = dectoul(p, NULL);
 		p = env_get("ncinport");
 		if (p != NULL)
-			nc_in_port = simple_strtoul(p, NULL, 10);
+			nc_in_port = dectoul(p, NULL);
 
 		if (is_broadcast(nc_ip))
 			/* broadcast MAC address */
diff --git a/drivers/net/pfe_eth/pfe_firmware.c b/drivers/net/pfe_eth/pfe_firmware.c
index ac86e33..ad5bc3c 100644
--- a/drivers/net/pfe_eth/pfe_firmware.c
+++ b/drivers/net/pfe_eth/pfe_firmware.c
@@ -298,7 +298,7 @@
 	if (!p) {
 		max_fw_count = 2;
 	} else {
-		max_fw_count = simple_strtoul(p, NULL, 10);
+		max_fw_count = dectoul(p, NULL);
 		if (max_fw_count)
 			max_fw_count = 3;
 		else
diff --git a/drivers/net/phy/b53.c b/drivers/net/phy/b53.c
index 695fac4..c706e2b 100644
--- a/drivers/net/phy/b53.c
+++ b/drivers/net/phy/b53.c
@@ -648,7 +648,7 @@
 
 	page = hextoul(argv[1], NULL);
 	offset = hextoul(argv[2], NULL);
-	width = simple_strtoul(argv[3], NULL, 10);
+	width = dectoul(argv[3], NULL);
 
 	switch (width) {
 	case 8:
@@ -700,7 +700,7 @@
 
 	page = hextoul(argv[1], NULL);
 	offset = hextoul(argv[2], NULL);
-	width = simple_strtoul(argv[3], NULL, 10);
+	width = dectoul(argv[3], NULL);
 	if (width == 48 || width == 64)
 		value64 = simple_strtoull(argv[4], NULL, 16);
 	else
diff --git a/drivers/net/phy/mv88e6352.c b/drivers/net/phy/mv88e6352.c
index 07a8e50..5606076 100644
--- a/drivers/net/phy/mv88e6352.c
+++ b/drivers/net/phy/mv88e6352.c
@@ -238,9 +238,9 @@
 	u16 value = 0, phyaddr, reg, port;
 	int ret;
 
-	phyaddr = simple_strtoul(argv[1], NULL, 10);
-	port = simple_strtoul(argv[2], NULL, 10);
-	reg = simple_strtoul(argv[3], NULL, 10);
+	phyaddr = dectoul(argv[1], NULL);
+	port = dectoul(argv[2], NULL);
+	reg = dectoul(argv[3], NULL);
 
 	ret = sw_reg_read(name, phyaddr, port, reg, &value);
 	printf("%#x\n", value);
@@ -253,9 +253,9 @@
 	u16 value = 0, phyaddr, reg, port;
 	int ret;
 
-	phyaddr = simple_strtoul(argv[1], NULL, 10);
-	port = simple_strtoul(argv[2], NULL, 10);
-	reg = simple_strtoul(argv[3], NULL, 10);
+	phyaddr = dectoul(argv[1], NULL);
+	port = dectoul(argv[2], NULL);
+	reg = dectoul(argv[3], NULL);
 	value = hextoul(argv[4], NULL);
 
 	ret = sw_reg_write(name, phyaddr, port, reg, value);
diff --git a/drivers/net/qe/dm_qe_uec.c b/drivers/net/qe/dm_qe_uec.c
index eb0501b..a12c8cd 100644
--- a/drivers/net/qe/dm_qe_uec.c
+++ b/drivers/net/qe/dm_qe_uec.c
@@ -938,7 +938,7 @@
 		return QE_CLK_NONE;
 
 	if (strncasecmp(source, "brg", 3) == 0) {
-		i = simple_strtoul(source + 3, NULL, 10);
+		i = dectoul(source + 3, NULL);
 		if (i >= 1 && i <= 16)
 			return (QE_BRG1 - 1) + i;
 		else
@@ -946,7 +946,7 @@
 	}
 
 	if (strncasecmp(source, "clk", 3) == 0) {
-		i = simple_strtoul(source + 3, NULL, 10);
+		i = dectoul(source + 3, NULL);
 		if (i >= 1 && i <= 24)
 			return (QE_CLK1 - 1) + i;
 		else
diff --git a/drivers/pinctrl/nexell/pinctrl-nexell.c b/drivers/pinctrl/nexell/pinctrl-nexell.c
index 6b01f47..20497a7 100644
--- a/drivers/pinctrl/nexell/pinctrl-nexell.c
+++ b/drivers/pinctrl/nexell/pinctrl-nexell.c
@@ -34,7 +34,7 @@
 		idx++;
 	}
 	bank[idx] = '\0';
-	*pin = (u32)simple_strtoul(&pin_name[++idx], NULL, 10);
+	*pin = (u32)dectoul(&pin_name[++idx], NULL);
 
 	/* lookup the pin bank data using the pin bank name */
 	for (idx = 0; idx < nr_banks; idx++)
diff --git a/drivers/pinctrl/pinctrl-uclass.c b/drivers/pinctrl/pinctrl-uclass.c
index ea7275c..dfe60b6 100644
--- a/drivers/pinctrl/pinctrl-uclass.c
+++ b/drivers/pinctrl/pinctrl-uclass.c
@@ -69,7 +69,7 @@
 		 * If statename is not found in "pinctrl-names",
 		 * assume statename is just the integer state ID.
 		 */
-		state = simple_strtoul(statename, &end, 10);
+		state = dectoul(statename, &end);
 		if (*end)
 			return -EINVAL;
 	}
diff --git a/drivers/ram/octeon/octeon_ddr.c b/drivers/ram/octeon/octeon_ddr.c
index e7b61d3..42daf06 100644
--- a/drivers/ram/octeon/octeon_ddr.c
+++ b/drivers/ram/octeon/octeon_ddr.c
@@ -2544,7 +2544,7 @@
 
 	eptr = env_get("limit_dram_mbytes");
 	if (eptr) {
-		unsigned int mbytes = simple_strtoul(eptr, NULL, 10);
+		unsigned int mbytes = dectoul(eptr, NULL);
 
 		if (mbytes > 0) {
 			memsize_mbytes = mbytes;
diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c
index 2b4feac..8171b17 100644
--- a/drivers/serial/serial-uclass.c
+++ b/drivers/serial/serial-uclass.c
@@ -395,7 +395,7 @@
 		/*
 		 * Switch to new baudrate if new baudrate is supported
 		 */
-		baudrate = simple_strtoul(value, NULL, 10);
+		baudrate = dectoul(value, NULL);
 
 		/* Not actually changing */
 		if (gd->baudrate == baudrate)
diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c
index dea25a0..ebbd219 100644
--- a/drivers/serial/serial.c
+++ b/drivers/serial/serial.c
@@ -61,7 +61,7 @@
 		/*
 		 * Switch to new baudrate if new baudrate is supported
 		 */
-		baudrate = simple_strtoul(value, NULL, 10);
+		baudrate = dectoul(value, NULL);
 
 		/* Not actually changing */
 		if (gd->baudrate == baudrate)
diff --git a/drivers/usb/cdns3/gadget.c b/drivers/usb/cdns3/gadget.c
index 83dbb5a..fcaeab9 100644
--- a/drivers/usb/cdns3/gadget.c
+++ b/drivers/usb/cdns3/gadget.c
@@ -1659,7 +1659,7 @@
 		/* ep name pattern likes epXin or epXout */
 		char c[2] = {ep->name[2], '\0'};
 
-		num = simple_strtoul(c, NULL, 10);
+		num = dectoul(c, NULL);
 
 		priv_ep = ep_to_cdns3_ep(ep);
 		if (cdns3_ep_dir_is_correct(desc, priv_ep)) {
diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c
index 7da334f..01337d6 100644
--- a/drivers/usb/gadget/epautoconf.c
+++ b/drivers/usb/gadget/epautoconf.c
@@ -144,7 +144,7 @@
 
 	/* report address */
 	if (isdigit(ep->name[2])) {
-		u8	num = simple_strtoul(&ep->name[2], NULL, 10);
+		u8	num = dectoul(&ep->name[2], NULL);
 		desc->bEndpointAddress |= num;
 #ifdef	MANY_ENDPOINTS
 	} else if (desc->bEndpointAddress & USB_DIR_IN) {
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 16922ff..4307328 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -2401,8 +2401,7 @@
 	usb_gadget_connect(gadget);
 
 	if (env_get("cdc_connect_timeout"))
-		timeout = simple_strtoul(env_get("cdc_connect_timeout"),
-						NULL, 10) * CONFIG_SYS_HZ;
+		timeout = dectoul(env_get("cdc_connect_timeout"), NULL) * CONFIG_SYS_HZ;
 	ts = get_timer(0);
 	while (!dev->network_started) {
 		/* Handle control-c and timeouts */
diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c
index 8f7d987..8132efa 100644
--- a/drivers/video/vidconsole-uclass.c
+++ b/drivers/video/vidconsole-uclass.c
@@ -692,8 +692,8 @@
 
 	if (uclass_first_device_err(UCLASS_VIDEO_CONSOLE, &dev))
 		return CMD_RET_FAILURE;
-	col = simple_strtoul(argv[1], NULL, 10);
-	row = simple_strtoul(argv[2], NULL, 10);
+	col = dectoul(argv[1], NULL);
+	row = dectoul(argv[2], NULL);
 	vidconsole_position_cursor(dev, col, row);
 
 	return 0;
diff --git a/examples/standalone/atmel_df_pow2.c b/examples/standalone/atmel_df_pow2.c
index 9c74f49..dcb25da 100644
--- a/examples/standalone/atmel_df_pow2.c
+++ b/examples/standalone/atmel_df_pow2.c
@@ -141,11 +141,12 @@
 		if (line[0] == '\0')
 			continue;
 
-		bus = cs = simple_strtoul(line, &p, 10);
+		bus = dectoul(line, &p);
+		cs = bus;
 		if (*p) {
 			if (*p == ':') {
 				++p;
-				cs = simple_strtoul(p, &p, 10);
+				cs = dectoul(p, &p);
 			}
 			if (*p) {
 				puts("invalid format, please try again\n");
diff --git a/include/vsprintf.h b/include/vsprintf.h
index 5a268ab..c30e91f 100644
--- a/include/vsprintf.h
+++ b/include/vsprintf.h
@@ -38,6 +38,19 @@
 unsigned long hextoul(const char *cp, char **endp);
 
 /**
+ * dec_strtoul - convert a string in decimal to an unsigned long
+ *
+ * @param cp	The string to be converted
+ * @param endp	Updated to point to the first character not converted
+ * @return value decoded from string (0 if invalid)
+ *
+ * Converts a decimal string to an unsigned long. If there are invalid
+ * characters at the end these are ignored. In the worst case, if all characters
+ * are invalid, 0 is returned
+ */
+unsigned long dectoul(const char *cp, char **endp);
+
+/**
  * strict_strtoul - convert a string to an unsigned long strictly
  * @param cp	The string to be converted
  * @param base	The number base to use
diff --git a/lib/dhry/cmd_dhry.c b/lib/dhry/cmd_dhry.c
index d55ab54..77b52a2 100644
--- a/lib/dhry/cmd_dhry.c
+++ b/lib/dhry/cmd_dhry.c
@@ -16,7 +16,7 @@
 	int iterations = 1000000;
 
 	if (argc > 1)
-		iterations = simple_strtoul(argv[1], NULL, 10);
+		iterations = dectoul(argv[1], NULL);
 
 	start = get_timer(0);
 	dhry(iterations);
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 4b097fb..07c7ebe 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -405,7 +405,7 @@
 			continue;
 
 		/* Get the alias number */
-		number = simple_strtoul(path + name_len, NULL, 10);
+		number = dectoul(path + name_len, NULL);
 		if (number < 0 || number >= maxcount) {
 			debug("%s: warning: alias '%s' is out of range\n",
 			      __func__, path);
diff --git a/lib/net_utils.c b/lib/net_utils.c
index f596c8f..72a3b09 100644
--- a/lib/net_utils.c
+++ b/lib/net_utils.c
@@ -23,7 +23,7 @@
 		return addr;
 
 	for (addr.s_addr = 0, i = 0; i < 4; ++i) {
-		ulong val = s ? simple_strtoul(s, &e, 10) : 0;
+		ulong val = s ? dectoul(s, &e) : 0;
 		if (val > 255) {
 			addr.s_addr = 0;
 			return addr;
diff --git a/lib/strto.c b/lib/strto.c
index 57d6216..72903a5 100644
--- a/lib/strto.c
+++ b/lib/strto.c
@@ -54,6 +54,11 @@
 	return simple_strtoul(cp, endp, 16);
 }
 
+ulong dectoul(const char *cp, char **endp)
+{
+	return simple_strtoul(cp, endp, 10);
+}
+
 int strict_strtoul(const char *cp, unsigned int base, unsigned long *res)
 {
 	char *tail;
@@ -164,7 +169,7 @@
 	if (isdigit(end[-1])) {
 		for (p = end - 1; p > str; p--) {
 			if (!isdigit(*p))
-				return simple_strtoul(p + 1, NULL, 10);
+				return dectoul(p + 1, NULL);
 		}
 	}
 
diff --git a/net/bootp.c b/net/bootp.c
index 163af41e..655b9cc 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -740,7 +740,7 @@
 
 	ep = env_get("bootpretryperiod");
 	if (ep != NULL)
-		time_taken_max = simple_strtoul(ep, NULL, 10);
+		time_taken_max = dectoul(ep, NULL);
 	else
 		time_taken_max = TIMEOUT_MS;
 
diff --git a/net/eth-uclass.c b/net/eth-uclass.c
index c2a97d7..0da0e85 100644
--- a/net/eth-uclass.c
+++ b/net/eth-uclass.c
@@ -128,7 +128,7 @@
 	/* Must be longer than 3 to be an alias */
 	if (!strncmp(devname, "eth", len) && strlen(devname) > len) {
 		startp = devname + len;
-		seq = simple_strtoul(startp, &endp, 10);
+		seq = dectoul(startp, &endp);
 	}
 
 	ret = uclass_get(UCLASS_ETH, &uc);
@@ -241,7 +241,7 @@
 	struct udevice *dev;
 
 	/* look for an index after "eth" */
-	index = simple_strtoul(name + 3, NULL, 10);
+	index = dectoul(name + 3, NULL);
 
 	retval = uclass_find_device_by_seq(UCLASS_ETH, index, &dev);
 	if (!retval) {
diff --git a/net/eth_legacy.c b/net/eth_legacy.c
index 96ed5a4..f383ccc 100644
--- a/net/eth_legacy.c
+++ b/net/eth_legacy.c
@@ -114,7 +114,7 @@
 		return 0;
 
 	/* look for an index after "eth" */
-	index = simple_strtoul(name + 3, NULL, 10);
+	index = dectoul(name + 3, NULL);
 
 	dev = eth_devices;
 	do {
diff --git a/net/net.c b/net/net.c
index b58f306..c2992a0 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1591,7 +1591,7 @@
 	if (*s < '0' || *s > '9')
 		id = VLAN_NONE;
 	else
-		id = (ushort)simple_strtoul(s, NULL, 10);
+		id = (ushort)dectoul(s, NULL);
 
 	return htons(id);
 }
diff --git a/net/tftp.c b/net/tftp.c
index 00ab7ca..5baf528 100644
--- a/net/tftp.c
+++ b/net/tftp.c
@@ -554,8 +554,7 @@
 		for (i = 0; i+8 < len; i++) {
 			if (strcasecmp((char *)pkt + i, "blksize") == 0) {
 				tftp_block_size = (unsigned short)
-					simple_strtoul((char *)pkt + i + 8,
-						       NULL, 10);
+					dectoul((char *)pkt + i + 8, NULL);
 				debug("Blocksize oack: %s, %d\n",
 				      (char *)pkt + i + 8, tftp_block_size);
 				if (tftp_block_size > tftp_block_size_option) {
@@ -566,8 +565,7 @@
 			}
 			if (strcasecmp((char *)pkt + i, "timeout") == 0) {
 				timeout_val_rcvd = (unsigned short)
-					simple_strtoul((char *)pkt + i + 8,
-						       NULL, 10);
+					dectoul((char *)pkt + i + 8, NULL);
 				debug("Timeout oack: %s, %d\n",
 				      (char *)pkt + i + 8, timeout_val_rcvd);
 				if (timeout_val_rcvd != (timeout_ms / 1000)) {
@@ -578,16 +576,15 @@
 			}
 #ifdef CONFIG_TFTP_TSIZE
 			if (strcasecmp((char *)pkt + i, "tsize") == 0) {
-				tftp_tsize = simple_strtoul((char *)pkt + i + 6,
-							   NULL, 10);
+				tftp_tsize = dectoul((char *)pkt + i + 6,
+						     NULL);
 				debug("size = %s, %d\n",
 				      (char *)pkt + i + 6, tftp_tsize);
 			}
 #endif
 			if (strcasecmp((char *)pkt + i,  "windowsize") == 0) {
 				tftp_windowsize =
-					simple_strtoul((char *)pkt + i + 11,
-						       NULL, 10);
+					dectoul((char *)pkt + i + 11, NULL);
 				debug("windowsize = %s, %d\n",
 				      (char *)pkt + i + 11, tftp_windowsize);
 			}
diff --git a/test/str_ut.c b/test/str_ut.c
index 4c3b566..19f2c12 100644
--- a/test/str_ut.c
+++ b/test/str_ut.c
@@ -117,6 +117,18 @@
 }
 STR_TEST(str_hextoul, 0);
 
+static int str_dectoul(struct unit_test_state *uts)
+{
+	char *endp;
+
+	/* Just a simple test, since we know this uses simple_strtoul() */
+	ut_asserteq(1099, dectoul(str2, &endp));
+	ut_asserteq(4, endp - str2);
+
+	return 0;
+}
+STR_TEST(str_dectoul, 0);
+
 int do_ut_str(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 {
 	struct unit_test *tests = UNIT_TEST_SUITE_START(str_test);