* [U-Boot] [PATCH] powerpc/t4240qds: add support of reading Core voltage
@ 2015-08-25 8:30 shh.xie at gmail.com
2015-10-14 20:29 ` York Sun
0 siblings, 1 reply; 3+ messages in thread
From: shh.xie at gmail.com @ 2015-08-25 8:30 UTC (permalink / raw)
To: u-boot
From: Shaohui Xie <Shaohui.Xie@freescale.com>
A U-boot CMD vdd_read is implemented to read Core voltage.
Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
---
board/freescale/t4qds/t4240qds.c | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/board/freescale/t4qds/t4240qds.c b/board/freescale/t4qds/t4240qds.c
index 4f2cccd..56273e4 100644
--- a/board/freescale/t4qds/t4240qds.c
+++ b/board/freescale/t4qds/t4240qds.c
@@ -887,8 +887,38 @@ static int do_vdd_adjust(cmd_tbl_t *cmdtp,
return 0;
}
+static int do_vdd_read(cmd_tbl_t *cmdtp,
+ int flag, int argc,
+ char * const argv[])
+{
+ int vdd, ret;
+
+ if (argc < 1)
+ return CMD_RET_USAGE;
+
+ ret = select_i2c_ch_pca9547(I2C_MUX_CH_VOL_MONITOR);
+ if (ret) {
+ printf("VID: I2c failed to switch channel\n");
+ return 0;
+ }
+
+ vdd = read_voltage();
+ if (vdd < 0)
+ printf("VID: Could not read voltage\n");
+ else
+ printf("VID: Core voltage is@%d mV\n", vdd);
+
+ return 0;
+}
+
U_BOOT_CMD(
vdd_override, 2, 0, do_vdd_adjust,
"Override VDD",
"- override with the voltage specified in mV, eg. 1050"
);
+
+U_BOOT_CMD(
+ vdd_read, 1, 0, do_vdd_read,
+ "read VDD",
+ " - Read the voltage specified in mV"
+)
--
2.1.0.27.g96db324
^ permalink raw reply related [flat|nested] 3+ messages in thread* [U-Boot] [PATCH] powerpc/t4240qds: add support of reading Core voltage
2015-08-25 8:30 [U-Boot] [PATCH] powerpc/t4240qds: add support of reading Core voltage shh.xie at gmail.com
@ 2015-10-14 20:29 ` York Sun
2015-10-15 2:20 ` Shaohui Xie
0 siblings, 1 reply; 3+ messages in thread
From: York Sun @ 2015-10-14 20:29 UTC (permalink / raw)
To: u-boot
On 08/25/2015 01:30 AM, shh.xie at gmail.com wrote:
> From: Shaohui Xie <Shaohui.Xie@freescale.com>
>
> A U-boot CMD vdd_read is implemented to read Core voltage.
>
> Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
> ---
> board/freescale/t4qds/t4240qds.c | 30 ++++++++++++++++++++++++++++++
> 1 file changed, 30 insertions(+)
>
> diff --git a/board/freescale/t4qds/t4240qds.c b/board/freescale/t4qds/t4240qds.c
> index 4f2cccd..56273e4 100644
> --- a/board/freescale/t4qds/t4240qds.c
> +++ b/board/freescale/t4qds/t4240qds.c
> @@ -887,8 +887,38 @@ static int do_vdd_adjust(cmd_tbl_t *cmdtp,
> return 0;
> }
>
> +static int do_vdd_read(cmd_tbl_t *cmdtp,
> + int flag, int argc,
> + char * const argv[])
> +{
> + int vdd, ret;
> +
> + if (argc < 1)
> + return CMD_RET_USAGE;
> +
> + ret = select_i2c_ch_pca9547(I2C_MUX_CH_VOL_MONITOR);
> + if (ret) {
> + printf("VID: I2c failed to switch channel\n");
> + return 0;
> + }
> +
> + vdd = read_voltage();
> + if (vdd < 0)
> + printf("VID: Could not read voltage\n");
> + else
> + printf("VID: Core voltage is at %d mV\n", vdd);
> +
> + return 0;
> +}
> +
> U_BOOT_CMD(
> vdd_override, 2, 0, do_vdd_adjust,
> "Override VDD",
> "- override with the voltage specified in mV, eg. 1050"
> );
> +
> +U_BOOT_CMD(
> + vdd_read, 1, 0, do_vdd_read,
> + "read VDD",
> + " - Read the voltage specified in mV"
> +)
>
Can you explain why you need this command? You already get the voltage if you
run bdinfo. If you override vdd, you also get a print.
York
^ permalink raw reply [flat|nested] 3+ messages in thread* [U-Boot] [PATCH] powerpc/t4240qds: add support of reading Core voltage
2015-10-14 20:29 ` York Sun
@ 2015-10-15 2:20 ` Shaohui Xie
0 siblings, 0 replies; 3+ messages in thread
From: Shaohui Xie @ 2015-10-15 2:20 UTC (permalink / raw)
To: u-boot
> On 08/25/2015 01:30 AM, shh.xie at gmail.com wrote:
> > From: Shaohui Xie <Shaohui.Xie@freescale.com>
> >
> > A U-boot CMD vdd_read is implemented to read Core voltage.
>
> Can you explain why you need this command? You already get the voltage if
> you run bdinfo. If you override vdd, you also get a print.
>
[S.H] there was a request that the commands override_vdd and vdd_read should be
Supported pair wise on T4240QDS, like what T2080RDB does...
So if the request is not really necessary, we can drop it.
Thanks!
Shaohui
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-10-15 2:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-25 8:30 [U-Boot] [PATCH] powerpc/t4240qds: add support of reading Core voltage shh.xie at gmail.com
2015-10-14 20:29 ` York Sun
2015-10-15 2:20 ` Shaohui Xie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox