Module Name:    src
Committed By:   jmcneill
Date:           Wed Nov 11 12:49:10 UTC 2015

Modified Files:
        src/sys/arch/arm/nvidia: soc_tegra124.c

Log Message:
make VDD_CPU programming a bit easier to understand, and while here, actually 
program it to 1.4V as intended instead of 1.39V


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/nvidia/soc_tegra124.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/nvidia/soc_tegra124.c
diff -u src/sys/arch/arm/nvidia/soc_tegra124.c:1.6 src/sys/arch/arm/nvidia/soc_tegra124.c:1.7
--- src/sys/arch/arm/nvidia/soc_tegra124.c:1.6	Wed Jun  3 11:43:18 2015
+++ src/sys/arch/arm/nvidia/soc_tegra124.c	Wed Nov 11 12:49:10 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: soc_tegra124.c,v 1.6 2015/06/03 11:43:18 skrll Exp $ */
+/* $NetBSD: soc_tegra124.c,v 1.7 2015/11/11 12:49:10 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill <[email protected]>
@@ -30,7 +30,7 @@
 #include "opt_multiprocessor.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: soc_tegra124.c,v 1.6 2015/06/03 11:43:18 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: soc_tegra124.c,v 1.7 2015/11/11 12:49:10 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -77,9 +77,12 @@ static struct tegra124_cpufreq_rate {
 void
 tegra124_cpuinit(void)
 {
-	/* Set VDD_CPU voltage to 1.4V */
 	tegra_car_periph_i2c_enable(4, 204000000);
-	tegra_i2c_dvc_write(0x40, 0x4f00, 2);
+
+	/* Set VDD_CPU voltage to 1.4V */
+	const u_int target_mv = 1400;
+	const u_int sd0_vsel = (target_mv - 600) / 10;
+	tegra_i2c_dvc_write(0x40, (sd0_vsel << 8) | 00, 2);
 	delay(10000);
 
 	tegra_cpufreq_register(&tegra124_cpufreq_func);

Reply via email to