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 for A31, when enabling pll, wait for ...



details:   https://anonhg.NetBSD.org/src/rev/926c99e10707
branches:  trunk
changeset: 334733:926c99e10707
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Thu Dec 04 02:12:07 2014 +0000

description:
for A31, when enabling pll, wait for pll to become stable before returning

diffstat:

 sys/arch/arm/allwinner/awin_board.c |  25 +++++++++++++++++++++++--
 1 files changed, 23 insertions(+), 2 deletions(-)

diffs (60 lines):

diff -r 3f9940565967 -r 926c99e10707 sys/arch/arm/allwinner/awin_board.c
--- a/sys/arch/arm/allwinner/awin_board.c       Thu Dec 04 02:11:03 2014 +0000
+++ b/sys/arch/arm/allwinner/awin_board.c       Thu Dec 04 02:12:07 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: awin_board.c,v 1.28 2014/11/12 21:27:48 jmcneill Exp $ */
+/*     $NetBSD: awin_board.c,v 1.29 2014/12/04 02:12:07 jmcneill Exp $ */
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -36,7 +36,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: awin_board.c,v 1.28 2014/11/12 21:27:48 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: awin_board.c,v 1.29 2014/12/04 02:12:07 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -345,6 +345,13 @@
        if (ncfg != ocfg) {
                bus_space_write_4(bst, bsh,
                    AWIN_CCM_OFFSET + AWIN_PLL6_CFG_REG, ncfg);
+
+               if (awin_chip_id() == AWIN_CHIP_ID_A31) {
+                       do {
+                               ncfg = bus_space_read_4(bst, bsh,
+                                   AWIN_CCM_OFFSET + AWIN_PLL6_CFG_REG);
+                       } while ((ncfg & AWIN_A31_PLL6_CFG_LOCK) == 0);
+               }
        }
 #if 0
        printf(" [pll6=%#x->%#x:n=%ju k=%ju m=%ju] ",
@@ -390,6 +397,13 @@
        if (ncfg != ocfg) {
                bus_space_write_4(bst, bsh,
                    AWIN_CCM_OFFSET + AWIN_PLL2_CFG_REG, ncfg);
+
+               if (awin_chip_id() == AWIN_CHIP_ID_A31) {
+                       do {
+                               ncfg = bus_space_read_4(bst, bsh,
+                                   AWIN_CCM_OFFSET + AWIN_PLL2_CFG_REG);
+                       } while ((ncfg & AWIN_A31_PLL2_CFG_LOCK) == 0);
+               }
        }
 }
 
@@ -459,6 +473,13 @@
        if (ncfg != ocfg) {
                bus_space_write_4(bst, bsh,
                    AWIN_CCM_OFFSET + AWIN_PLL7_CFG_REG, ncfg);
+
+               if (awin_chip_id() == AWIN_CHIP_ID_A31) {
+                       do {
+                               ncfg = bus_space_read_4(bst, bsh,
+                                   AWIN_CCM_OFFSET + AWIN_PLL7_CFG_REG);
+                       } while ((ncfg & AWIN_A31_PLL7_CFG_LOCK) == 0);
+               }
        }
 }
 



Home | Main Index | Thread Index | Old Index