summaryrefslogtreecommitdiff
path: root/board/freescale
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-07-24 18:03:29 +0300
committerTom Rini <trini@konsulko.com>2021-08-02 20:32:14 +0300
commit7e5f460ec457fe310156e399198a41eb0ce1e98c (patch)
tree7e89e4d15fcea2d2263c4b4af1be69905537ef42 /board/freescale
parent031725f8cdf33e836d19f35d3fe82c5baa5a2976 (diff)
downloadu-boot-7e5f460ec457fe310156e399198a41eb0ce1e98c.tar.xz
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>
Diffstat (limited to 'board/freescale')
-rw-r--r--board/freescale/common/cmd_esbc_validate.c2
-rw-r--r--board/freescale/common/fsl_validate.c2
-rw-r--r--board/freescale/common/sys_eeprom.c4
-rw-r--r--board/freescale/lx2160a/eth_lx2160aqds.c2
-rw-r--r--board/freescale/lx2160a/eth_lx2162aqds.c2
-rw-r--r--board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c2
-rw-r--r--board/freescale/p2041rdb/cpld.c4
7 files changed, 9 insertions, 9 deletions
diff --git a/board/freescale/common/cmd_esbc_validate.c b/board/freescale/common/cmd_esbc_validate.c
index 638aa3c19a..6c096266b4 100644
--- a/board/freescale/common/cmd_esbc_validate.c
+++ b/board/freescale/common/cmd_esbc_validate.c
@@ -40,7 +40,7 @@ static int do_esbc_validate(struct cmd_tbl *cmdtp, int flag, int argc,
hash_str = argv[2];
/* First argument - header address -32/64bit */
- haddr = (uintptr_t)simple_strtoul(argv[1], NULL, 16);
+ haddr = (uintptr_t)hextoul(argv[1], NULL);
/* With esbc_validate command, Image address must be
* part of header. So, the function is called
diff --git a/board/freescale/common/fsl_validate.c b/board/freescale/common/fsl_validate.c
index 564a8b3b54..066aa9a7c3 100644
--- a/board/freescale/common/fsl_validate.c
+++ b/board/freescale/common/fsl_validate.c
@@ -767,7 +767,7 @@ static inline int str2longbe(const char *p, ulong *num)
if (!p) {
return 0;
} else {
- tmp = simple_strtoul(p, &endptr, 16);
+ tmp = hextoul(p, &endptr);
if (sizeof(ulong) == 4)
*num = cpu_to_be32(tmp);
else
diff --git a/board/freescale/common/sys_eeprom.c b/board/freescale/common/sys_eeprom.c
index be0fda0638..9e73056a29 100644
--- a/board/freescale/common/sys_eeprom.c
+++ b/board/freescale/common/sys_eeprom.c
@@ -378,7 +378,7 @@ static void set_mac_address(unsigned int index, const char *string)
}
for (i = 0; *p && (i < 6); i++) {
- e.mac[index][i] = simple_strtoul(p, &p, 16);
+ e.mac[index][i] = hextoul(p, &p);
if (*p == ':')
p++;
}
@@ -452,7 +452,7 @@ int do_mac(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
set_date(argv[2]);
break;
case 'p': /* MAC table size */
- e.mac_count = simple_strtoul(argv[2], NULL, 16);
+ e.mac_count = hextoul(argv[2], NULL);
update_crc();
break;
case '0' ... '9': /* "mac 0" through "mac 22" */
diff --git a/board/freescale/lx2160a/eth_lx2160aqds.c b/board/freescale/lx2160a/eth_lx2160aqds.c
index 437f0bc4cf..a2b6442b54 100644
--- a/board/freescale/lx2160a/eth_lx2160aqds.c
+++ b/board/freescale/lx2160a/eth_lx2160aqds.c
@@ -416,7 +416,7 @@ static inline void do_dpmac_config(int dpmac, const char *arg_dpmacid,
env_dpmac, phy_num + 1, arg_dpmacid);
else
wriop_set_phy_address(dpmac, phy_num,
- simple_strtoul(ret, NULL, 16));
+ hextoul(ret, NULL));
}
/*search mdio in dpmac arg*/
diff --git a/board/freescale/lx2160a/eth_lx2162aqds.c b/board/freescale/lx2160a/eth_lx2162aqds.c
index b742c1ff52..3b04dea39c 100644
--- a/board/freescale/lx2160a/eth_lx2162aqds.c
+++ b/board/freescale/lx2160a/eth_lx2162aqds.c
@@ -437,7 +437,7 @@ static inline void do_dpmac_config(int dpmac, const char *arg_dpmacid,
env_dpmac, phy_num + 1, arg_dpmacid);
else
wriop_set_phy_address(dpmac, phy_num,
- simple_strtoul(ret, NULL, 16));
+ hextoul(ret, NULL));
}
/*search mdio in dpmac arg*/
diff --git a/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c b/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c
index 8273384f2d..cf4d9c11b8 100644
--- a/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c
+++ b/board/freescale/p1_p2_rdb_pc/p1_p2_rdb_pc.c
@@ -281,7 +281,7 @@ int board_early_init_r(void)
/* If a VSC7385 microcode image is present, then upload it. */
tmp = env_get("vscfw_addr");
if (tmp) {
- vscfw_addr = simple_strtoul(tmp, NULL, 16);
+ vscfw_addr = hextoul(tmp, NULL);
printf("uploading VSC7385 microcode from %x\n", vscfw_addr);
if (vsc7385_upload_firmware((void *)vscfw_addr,
CONFIG_VSC7385_IMAGE_SIZE))
diff --git a/board/freescale/p2041rdb/cpld.c b/board/freescale/p2041rdb/cpld.c
index b042fe3bcb..a1908b8a57 100644
--- a/board/freescale/p2041rdb/cpld.c
+++ b/board/freescale/p2041rdb/cpld.c
@@ -100,8 +100,8 @@ int cpld_cmd(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
else
cpld_set_defbank();
} else if (strcmp(argv[1], "lane_mux") == 0) {
- u32 lane = simple_strtoul(argv[2], NULL, 16);
- u8 val = (u8)simple_strtoul(argv[3], NULL, 16);
+ u32 lane = hextoul(argv[2], NULL);
+ u8 val = (u8)hextoul(argv[3], NULL);
u8 reg = CPLD_READ(serdes_mux);
switch (lane) {