Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/allwinner PLL7 setup for HDMI on A20
details: https://anonhg.NetBSD.org/src/rev/80925b33cea7
branches: trunk
changeset: 332200:80925b33cea7
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Thu Sep 11 02:16:15 2014 +0000
description:
PLL7 setup for HDMI on A20
diffstat:
sys/arch/arm/allwinner/awin_board.c | 26 ++++++++++++++++++++++++--
sys/arch/arm/allwinner/awin_var.h | 3 ++-
2 files changed, 26 insertions(+), 3 deletions(-)
diffs (61 lines):
diff -r 12d4da587b0c -r 80925b33cea7 sys/arch/arm/allwinner/awin_board.c
--- a/sys/arch/arm/allwinner/awin_board.c Thu Sep 11 00:50:39 2014 +0000
+++ b/sys/arch/arm/allwinner/awin_board.c Thu Sep 11 02:16:15 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_board.c,v 1.17 2014/09/07 22:21:36 jmcneill Exp $ */
+/* $NetBSD: awin_board.c,v 1.18 2014/09/11 02:16:15 jmcneill Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -35,7 +35,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: awin_board.c,v 1.17 2014/09/07 22:21:36 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: awin_board.c,v 1.18 2014/09/11 02:16:15 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -335,3 +335,25 @@
AWIN_CCM_OFFSET + AWIN_PLL2_CFG_REG, ncfg);
}
}
+
+void
+awin_pll7_enable(void)
+{
+ bus_space_tag_t bst = &awin_bs_tag;
+ bus_space_handle_t bsh = awin_core_bsh;
+
+ /*
+ * HDMI needs PLL7 to be 29700000 Hz
+ */
+ const uint32_t ocfg = bus_space_read_4(bst, bsh,
+ AWIN_CCM_OFFSET + AWIN_PLL7_CFG_REG);
+
+ uint32_t ncfg = ocfg;
+ ncfg &= ~(AWIN_PLL7_MODE_SEL|AWIN_PLL7_FRAC_SET|AWIN_PLL7_FACTOR_M);
+ ncfg |= AWIN_PLL7_FRAC_SET;
+ ncfg |= AWIN_PLL_CFG_ENABLE;
+ if (ncfg != ocfg) {
+ bus_space_write_4(bst, bsh,
+ AWIN_CCM_OFFSET + AWIN_PLL7_CFG_REG, ncfg);
+ }
+}
diff -r 12d4da587b0c -r 80925b33cea7 sys/arch/arm/allwinner/awin_var.h
--- a/sys/arch/arm/allwinner/awin_var.h Thu Sep 11 00:50:39 2014 +0000
+++ b/sys/arch/arm/allwinner/awin_var.h Thu Sep 11 02:16:15 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_var.h,v 1.15 2014/09/09 13:56:30 jmcneill Exp $ */
+/* $NetBSD: awin_var.h,v 1.16 2014/09/11 02:16:15 jmcneill Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -91,6 +91,7 @@
void awin_dma_bootstrap(psize_t);
void awin_pll2_enable(void);
void awin_pll6_enable(void);
+void awin_pll7_enable(void);
void awin_cpu_hatch(struct cpu_info *);
#define AWIN_CHIP_ID_A10 0x1623
Home |
Main Index |
Thread Index |
Old Index