From 44c3fb8a8a6cba2578dcabaff98f6f2eab3393f0 Mon Sep 17 00:00:00 2001 From: jmcneill Date: Wed, 12 Nov 2014 21:27:48 +0000 Subject: [PATCH] fix pll5x rate calculation --- sys/arch/arm/allwinner/awin_board.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/arch/arm/allwinner/awin_board.c b/sys/arch/arm/allwinner/awin_board.c index 874d7cef8eec..1b9137f5ccf4 100644 --- a/sys/arch/arm/allwinner/awin_board.c +++ b/sys/arch/arm/allwinner/awin_board.c @@ -1,4 +1,4 @@ -/* $NetBSD: awin_board.c,v 1.27 2014/11/10 17:55:25 jmcneill Exp $ */ +/* $NetBSD: awin_board.c,v 1.28 2014/11/12 21:27:48 jmcneill Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. * All rights reserved. @@ -36,7 +36,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: awin_board.c,v 1.27 2014/11/10 17:55:25 jmcneill Exp $"); +__KERNEL_RCSID(1, "$NetBSD: awin_board.c,v 1.28 2014/11/12 21:27:48 jmcneill Exp $"); #include #include @@ -518,7 +518,7 @@ awin_pll5x_get_rate(void) AWIN_CCM_OFFSET + AWIN_PLL5_CFG_REG); n = __SHIFTOUT(cfg, AWIN_PLL_CFG_FACTOR_N); - k = __SHIFTOUT(cfg, AWIN_PLL_CFG_FACTOR_K); + k = __SHIFTOUT(cfg, AWIN_PLL_CFG_FACTOR_K) + 1; p = __SHIFTOUT(cfg, AWIN_PLL5_OUT_EXT_DIV_P); return (AWIN_REF_FREQ * n * k) >> p;