aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-imx/imx8/snvs_security_sc.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-07-24 09:03:29 -0600
committerTom Rini <trini@konsulko.com>2021-08-02 13:32:14 -0400
commit7e5f460ec457fe310156e399198a41eb0ce1e98c (patch)
tree7e89e4d15fcea2d2263c4b4af1be69905537ef42 /arch/arm/mach-imx/imx8/snvs_security_sc.c
parent031725f8cdf33e836d19f35d3fe82c5baa5a2976 (diff)
downloadu-boot-7e5f460ec457fe310156e399198a41eb0ce1e98c.zip
u-boot-7e5f460ec457fe310156e399198a41eb0ce1e98c.tar.gz
u-boot-7e5f460ec457fe310156e399198a41eb0ce1e98c.tar.bz2
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 'arch/arm/mach-imx/imx8/snvs_security_sc.c')
-rw-r--r--arch/arm/mach-imx/imx8/snvs_security_sc.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/arch/arm/mach-imx/imx8/snvs_security_sc.c b/arch/arm/mach-imx/imx8/snvs_security_sc.c
index 6f9b1c9..7c34ce6 100644
--- a/arch/arm/mach-imx/imx8/snvs_security_sc.c
+++ b/arch/arm/mach-imx/imx8/snvs_security_sc.c
@@ -638,24 +638,24 @@ static int do_snvs_cfg(struct cmd_tbl *cmdtp, int flag, int argc,
if (argc != (NB_REGISTERS + 1))
return CMD_RET_USAGE;
- conf.hp.lock = simple_strtoul(argv[++idx], NULL, 16);
- conf.hp.secvio_ctl = simple_strtoul(argv[++idx], NULL, 16);
- conf.lp.lock = simple_strtoul(argv[++idx], NULL, 16);
- conf.lp.secvio_ctl = simple_strtoul(argv[++idx], NULL, 16);
- conf.lp.tamper_filt_cfg = simple_strtoul(argv[++idx], NULL, 16);
- conf.lp.tamper_det_cfg = simple_strtoul(argv[++idx], NULL, 16);
- conf.lp.tamper_det_cfg2 = simple_strtoul(argv[++idx], NULL, 16);
- conf.lp.tamper_filt1_cfg = simple_strtoul(argv[++idx], NULL, 16);
- conf.lp.tamper_filt2_cfg = simple_strtoul(argv[++idx], NULL, 16);
- conf.lp.act_tamper1_cfg = simple_strtoul(argv[++idx], NULL, 16);
- conf.lp.act_tamper2_cfg = simple_strtoul(argv[++idx], NULL, 16);
- conf.lp.act_tamper3_cfg = simple_strtoul(argv[++idx], NULL, 16);
- conf.lp.act_tamper4_cfg = simple_strtoul(argv[++idx], NULL, 16);
- conf.lp.act_tamper5_cfg = simple_strtoul(argv[++idx], NULL, 16);
- conf.lp.act_tamper_ctl = simple_strtoul(argv[++idx], NULL, 16);
- conf.lp.act_tamper_clk_ctl = simple_strtoul(argv[++idx], NULL, 16);
- conf.lp.act_tamper_routing_ctl1 = simple_strtoul(argv[++idx], NULL, 16);
- conf.lp.act_tamper_routing_ctl2 = simple_strtoul(argv[++idx], NULL, 16);
+ conf.hp.lock = hextoul(argv[++idx], NULL);
+ conf.hp.secvio_ctl = hextoul(argv[++idx], NULL);
+ conf.lp.lock = hextoul(argv[++idx], NULL);
+ conf.lp.secvio_ctl = hextoul(argv[++idx], NULL);
+ conf.lp.tamper_filt_cfg = hextoul(argv[++idx], NULL);
+ conf.lp.tamper_det_cfg = hextoul(argv[++idx], NULL);
+ conf.lp.tamper_det_cfg2 = hextoul(argv[++idx], NULL);
+ conf.lp.tamper_filt1_cfg = hextoul(argv[++idx], NULL);
+ conf.lp.tamper_filt2_cfg = hextoul(argv[++idx], NULL);
+ conf.lp.act_tamper1_cfg = hextoul(argv[++idx], NULL);
+ conf.lp.act_tamper2_cfg = hextoul(argv[++idx], NULL);
+ conf.lp.act_tamper3_cfg = hextoul(argv[++idx], NULL);
+ conf.lp.act_tamper4_cfg = hextoul(argv[++idx], NULL);
+ conf.lp.act_tamper5_cfg = hextoul(argv[++idx], NULL);
+ conf.lp.act_tamper_ctl = hextoul(argv[++idx], NULL);
+ conf.lp.act_tamper_clk_ctl = hextoul(argv[++idx], NULL);
+ conf.lp.act_tamper_routing_ctl1 = hextoul(argv[++idx], NULL);
+ conf.lp.act_tamper_routing_ctl2 = hextoul(argv[++idx], NULL);
err = apply_snvs_config(&conf);
@@ -690,12 +690,12 @@ static int do_snvs_dgo_cfg(struct cmd_tbl *cmdtp, int flag, int argc,
if (argc != (6 + 1))
return CMD_RET_USAGE;
- conf.tamper_offset_ctl = simple_strtoul(argv[++idx], NULL, 16);
- conf.tamper_pull_ctl = simple_strtoul(argv[++idx], NULL, 16);
- conf.tamper_ana_test_ctl = simple_strtoul(argv[++idx], NULL, 16);
- conf.tamper_sensor_trim_ctl = simple_strtoul(argv[++idx], NULL, 16);
- conf.tamper_misc_ctl = simple_strtoul(argv[++idx], NULL, 16);
- conf.tamper_core_volt_mon_ctl = simple_strtoul(argv[++idx], NULL, 16);
+ conf.tamper_offset_ctl = hextoul(argv[++idx], NULL);
+ conf.tamper_pull_ctl = hextoul(argv[++idx], NULL);
+ conf.tamper_ana_test_ctl = hextoul(argv[++idx], NULL);
+ conf.tamper_sensor_trim_ctl = hextoul(argv[++idx], NULL);
+ conf.tamper_misc_ctl = hextoul(argv[++idx], NULL);
+ conf.tamper_core_volt_mon_ctl = hextoul(argv[++idx], NULL);
err = apply_snvs_dgo_config(&conf);
@@ -727,7 +727,7 @@ static int do_tamper_pin_cfg(struct cmd_tbl *cmdtp, int flag, int argc,
return CMD_RET_USAGE;
conf.pad = simple_strtoul(argv[++idx], NULL, 10);
- conf.mux_conf = simple_strtoul(argv[++idx], NULL, 16);
+ conf.mux_conf = hextoul(argv[++idx], NULL);
err = apply_tamper_pin_list_config(&conf, 1);
@@ -761,8 +761,8 @@ static int do_snvs_clear_status(struct cmd_tbl *cmdtp, int flag, int argc,
if (argc != (2 + 1))
return CMD_RET_USAGE;
- conf.lp.status = simple_strtoul(argv[++idx], NULL, 16);
- conf.lp.tamper_det_status = simple_strtoul(argv[++idx], NULL, 16);
+ conf.lp.status = hextoul(argv[++idx], NULL);
+ conf.lp.tamper_det_status = hextoul(argv[++idx], NULL);
scierr = check_write_secvio_config(SC_CONF_OFFSET_OF(lp.status),
&conf.lp.status, NULL, NULL, NULL,