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 rk3399: add definition for the watchdo...



details:   https://anonhg.NetBSD.org/src/rev/dd985c7d1041
branches:  trunk
changeset: 966223:dd985c7d1041
user:      tnn <tnn%NetBSD.org@localhost>
date:      Sat Oct 19 12:55:21 2019 +0000

description:
rk3399: add definition for the watchdog timer clock gate

The watchdog timer clock gate is a bit special because it's a secure
gate that can only be accessed from EL3. We still need a dummy gate
definition for it so that dwcwdt(4) can infer the frequency via the
parent clock. The gate is enabled by default by U-Boot.

diffstat:

 sys/arch/arm/rockchip/rk3399_cru.c |   7 +++++--
 sys/arch/arm/rockchip/rk_cru.h     |  11 ++++++++++-
 2 files changed, 15 insertions(+), 3 deletions(-)

diffs (53 lines):

diff -r ed24925ba06d -r dd985c7d1041 sys/arch/arm/rockchip/rk3399_cru.c
--- a/sys/arch/arm/rockchip/rk3399_cru.c        Sat Oct 19 06:40:20 2019 +0000
+++ b/sys/arch/arm/rockchip/rk3399_cru.c        Sat Oct 19 12:55:21 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rk3399_cru.c,v 1.9 2019/08/04 17:09:07 tnn Exp $ */
+/* $NetBSD: rk3399_cru.c,v 1.10 2019/10/19 12:55:21 tnn Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: rk3399_cru.c,v 1.9 2019/08/04 17:09:07 tnn Exp $");
+__KERNEL_RCSID(1, "$NetBSD: rk3399_cru.c,v 1.10 2019/10/19 12:55:21 tnn Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -804,6 +804,9 @@
        RK_GATE(RK3399_PCLK_SPI4, "pclk_rkspi4", "pclk_perilp1", CLKGATE_CON(23), 13),
        RK_GATE(RK3399_PCLK_SPI5, "pclk_rkspi5", "hclk_perilp1", CLKGATE_CON(34), 5),
 
+       /* Watchdog */
+       RK_SECURE_GATE(RK3399_PCLK_WDT, "pclk_wdt", "pclk_alive" /*, SECURE_CLKGATE_CON(3), 8 */),
+
        /* PCIe */
        RK_GATE(RK3399_ACLK_PERF_PCIE, "aclk_perf_pcie", "aclk_perihp", CLKGATE_CON(20), 2),
        RK_GATE(RK3399_ACLK_PCIE, "aclk_pcie", "aclk_perihp", CLKGATE_CON(20), 10),
diff -r ed24925ba06d -r dd985c7d1041 sys/arch/arm/rockchip/rk_cru.h
--- a/sys/arch/arm/rockchip/rk_cru.h    Sat Oct 19 06:40:20 2019 +0000
+++ b/sys/arch/arm/rockchip/rk_cru.h    Sat Oct 19 12:55:21 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rk_cru.h,v 1.4 2018/09/01 19:35:53 jmcneill Exp $ */
+/* $NetBSD: rk_cru.h,v 1.5 2019/10/19 12:55:21 tnn Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -268,6 +268,15 @@
                .get_parent = rk_cru_gate_get_parent,           \
        }
 
+#define        RK_SECURE_GATE(_id, _name, _pname)                      \
+       {                                                       \
+               .id = (_id),                                    \
+               .type = RK_CRU_GATE,                            \
+               .base.name = (_name),                           \
+               .u.gate.parent = (_pname),                      \
+               .get_parent = rk_cru_gate_get_parent,           \
+       }
+
 /* Mux clocks */
 
 struct rk_cru_mux {



Home | Main Index | Thread Index | Old Index