aboutsummaryrefslogtreecommitdiff
path: root/board/cavium/thunderx/atf.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-07-24 09:03:30 -0600
committerTom Rini <trini@konsulko.com>2021-08-02 13:32:14 -0400
commit0b1284eb52578e15ec611adc5fee1a9ae68dadea (patch)
tree2d83815e93fc16decbaa5671fd660ade0ec74532 /board/cavium/thunderx/atf.c
parent7e5f460ec457fe310156e399198a41eb0ce1e98c (diff)
downloadu-boot-0b1284eb52578e15ec611adc5fee1a9ae68dadea.zip
u-boot-0b1284eb52578e15ec611adc5fee1a9ae68dadea.tar.gz
u-boot-0b1284eb52578e15ec611adc5fee1a9ae68dadea.tar.bz2
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>
Diffstat (limited to 'board/cavium/thunderx/atf.c')
-rw-r--r--board/cavium/thunderx/atf.c24
1 files changed, 12 insertions, 12 deletions
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 @@ int do_atf(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
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")) {