Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/rockchip Fix soft reset logic



details:   https://anonhg.NetBSD.org/src/rev/9d577c100a55
branches:  trunk
changeset: 319969:9d577c100a55
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun Jun 17 11:52:38 2018 +0000

description:
Fix soft reset logic

diffstat:

 sys/arch/arm/rockchip/rk_cru.c |  16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diffs (46 lines):

diff -r 4ca90b950dc6 -r 9d577c100a55 sys/arch/arm/rockchip/rk_cru.c
--- a/sys/arch/arm/rockchip/rk_cru.c    Sun Jun 17 07:13:02 2018 +0000
+++ b/sys/arch/arm/rockchip/rk_cru.c    Sun Jun 17 11:52:38 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rk_cru.c,v 1.1 2018/06/16 00:19:04 jmcneill Exp $ */
+/* $NetBSD: rk_cru.c,v 1.2 2018/06/17 11:52:38 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -30,7 +30,7 @@
 #include "opt_fdt_arm.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rk_cru.c,v 1.1 2018/06/16 00:19:04 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rk_cru.c,v 1.2 2018/06/17 11:52:38 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -64,10 +64,10 @@
 {
        struct rk_cru_softc * const sc = device_private(dev);
        const uintptr_t reset_id = (uintptr_t)priv;
-       const bus_size_t reg = CRU_SOFTRST_CON0 + (reset_id / 32) * 4;
-       const u_int shift = reset_id % 32;
+       const bus_size_t reg = CRU_SOFTRST_CON0 + (reset_id / 16) * 4;
+       const u_int shift = reset_id % 16;
 
-       CRU_WRITE(sc, reg, (1 << (shift + 16)) | (0 << shift));
+       CRU_WRITE(sc, reg, (1 << (shift + 16)) | (1 << shift));
 
        return 0;
 }
@@ -77,10 +77,10 @@
 {
        struct rk_cru_softc * const sc = device_private(dev);
        const uintptr_t reset_id = (uintptr_t)priv;
-       const bus_size_t reg = CRU_SOFTRST_CON0 + (reset_id / 32) * 4;
-       const u_int shift = reset_id % 32;
+       const bus_size_t reg = CRU_SOFTRST_CON0 + (reset_id / 16) * 4;
+       const u_int shift = reset_id % 16;
 
-       CRU_WRITE(sc, reg, (1 << (shift + 16)) | (1 << shift));
+       CRU_WRITE(sc, reg, (1 << (shift + 16)) | (0 << shift));
 
        return 0;
 }



Home | Main Index | Thread Index | Old Index