aboutsummaryrefslogtreecommitdiff
path: root/external/xscom-utils
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2016-08-30 07:20:34 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-09-06 16:24:16 +1000
commit5fff4b8c750657272fe03f9032a8f7911e1e5b20 (patch)
treeb9401d858c1cf5769f09d2012a8ba83881ea1a96 /external/xscom-utils
parentd4b92ad3328c1dd332a18fe6de6751198d8de2ab (diff)
downloadskiboot-5fff4b8c750657272fe03f9032a8f7911e1e5b20.zip
skiboot-5fff4b8c750657272fe03f9032a8f7911e1e5b20.tar.gz
skiboot-5fff4b8c750657272fe03f9032a8f7911e1e5b20.tar.bz2
getscom/getsram/putscom: Parse chip-id as hex
We print the chip-id in hex (without a leading 0x), but we fail to parse that same value correctly in getscom/getsram/putscom: # getscom -l ... 80000000 | DD2.0 | Centaur memory buffer # getscom -c 80000000 201140a Error -19 reading XSCOM Fix this by assuming base 16 when parsing chip-id. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'external/xscom-utils')
-rw-r--r--external/xscom-utils/getscom.c2
-rw-r--r--external/xscom-utils/getsram.c2
-rw-r--r--external/xscom-utils/putscom.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/external/xscom-utils/getscom.c b/external/xscom-utils/getscom.c
index e6eb54d..fd5aeb6 100644
--- a/external/xscom-utils/getscom.c
+++ b/external/xscom-utils/getscom.c
@@ -101,7 +101,7 @@ int main(int argc, char *argv[])
addr = strtoull(optarg, NULL, 16);
break;
case 'c':
- chip_id = strtoul(optarg, NULL, 0);
+ chip_id = strtoul(optarg, NULL, 16);
break;
case 'h':
print_usage(0);
diff --git a/external/xscom-utils/getsram.c b/external/xscom-utils/getsram.c
index 569f60e..65acc19 100644
--- a/external/xscom-utils/getsram.c
+++ b/external/xscom-utils/getsram.c
@@ -58,7 +58,7 @@ int main(int argc, char *argv[])
addr = strtoull(optarg, NULL, 16);
break;
case 'c':
- chip_id = strtoul(optarg, NULL, 0);
+ chip_id = strtoul(optarg, NULL, 16);
break;
case 'n':
occ_channel = strtoul(optarg, NULL, 0);
diff --git a/external/xscom-utils/putscom.c b/external/xscom-utils/putscom.c
index 01a71c6..7eaa59e 100644
--- a/external/xscom-utils/putscom.c
+++ b/external/xscom-utils/putscom.c
@@ -61,7 +61,7 @@ int main(int argc, char *argv[])
got_val = true;
break;
case 'c':
- chip_id = strtoul(optarg, NULL, 0);
+ chip_id = strtoul(optarg, NULL, 16);
break;
case 'v':
printf("xscom utils version %s\n", version);