Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/nvidia fix divider calculations for hdmi, and t...
details: https://anonhg.NetBSD.org/src/rev/38fb384fe657
branches: trunk
changeset: 342468:38fb384fe657
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Wed Dec 23 12:43:25 2015 +0000
description:
fix divider calculations for hdmi, and treat clock ID 211 as pll_p_out0 instead of directly pll_p
diffstat:
sys/arch/arm/nvidia/tegra124_car.c | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
diffs (54 lines):
diff -r 73cecb29fbb2 -r 38fb384fe657 sys/arch/arm/nvidia/tegra124_car.c
--- a/sys/arch/arm/nvidia/tegra124_car.c Wed Dec 23 11:58:10 2015 +0000
+++ b/sys/arch/arm/nvidia/tegra124_car.c Wed Dec 23 12:43:25 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra124_car.c,v 1.1 2015/12/22 22:10:36 jmcneill Exp $ */
+/* $NetBSD: tegra124_car.c,v 1.2 2015/12/23 12:43:25 jmcneill Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tegra124_car.c,v 1.1 2015/12/22 22:10:36 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra124_car.c,v 1.2 2015/12/23 12:43:25 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -191,7 +191,7 @@
{ 208, "pll_c3" },
{ 209, "pll_m" },
{ 210, "pll_m_out1" },
- { 211, "pll_p" },
+ { 211, "pll_p_out0" },
{ 212, "pll_p_out1" },
{ 213, "pll_p_out2" },
{ 214, "pll_p_out3" },
@@ -1113,6 +1113,7 @@
bus_space_tag_t bst = sc->sc_bst;
bus_space_handle_t bsh = sc->sc_bsh;
struct clk *clk_parent;
+ u_int raw_div;
uint32_t v;
KASSERT(tclk->type == TEGRA_CLK_DIV);
@@ -1144,13 +1145,13 @@
v &= ~CAR_CLKSRC_SATA_AUX_CLK_ENB;
}
break;
- case CAR_CLKSRC_HDMI_REG:
-
- break;
}
- const u_int raw_div = rate ? howmany(parent_rate * 2, rate) - 2 : 0;
- //const u_int raw_div = rate ? (parent_rate * 2) / rate - 2 : 0;
+ if (rate) {
+ raw_div = (parent_rate * 2) / rate - 2;
+ } else {
+ raw_div = __SHIFTOUT(tdiv->bits, tdiv->bits);
+ }
v &= ~tdiv->bits;
v |= __SHIFTIN(raw_div, tdiv->bits);
Home |
Main Index |
Thread Index |
Old Index