Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/fdt Enable apb_pclk clock if present



details:   https://anonhg.NetBSD.org/src/rev/eddffb2c7e92
branches:  trunk
changeset: 362108:eddffb2c7e92
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun May 27 19:54:45 2018 +0000

description:
Enable apb_pclk clock if present

diffstat:

 sys/dev/fdt/dw_apb_uart.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (39 lines):

diff -r 1c3f22779d13 -r eddffb2c7e92 sys/dev/fdt/dw_apb_uart.c
--- a/sys/dev/fdt/dw_apb_uart.c Sun May 27 17:16:39 2018 +0000
+++ b/sys/dev/fdt/dw_apb_uart.c Sun May 27 19:54:45 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dw_apb_uart.c,v 1.1 2018/05/27 17:14:23 jmcneill Exp $ */
+/* $NetBSD: dw_apb_uart.c,v 1.2 2018/05/27 19:54:45 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: dw_apb_uart.c,v 1.1 2018/05/27 17:14:23 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: dw_apb_uart.c,v 1.2 2018/05/27 19:54:45 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -55,6 +55,7 @@
        void *ssc_ih;
 
        struct clk *ssc_clk;
+       struct clk *ssc_pclk;
        struct fdtbus_reset *ssc_rst;
 };
 
@@ -115,6 +116,12 @@
                return;
        }
 
+       ssc->ssc_pclk = fdtbus_clock_get(faa->faa_phandle, "apb_pclk");
+       if (ssc->ssc_pclk != NULL && clk_enable(ssc->ssc_pclk) != 0) {
+               aprint_error(": couldn't enable peripheral clock\n");
+               return;
+       }
+
        ssc->ssc_rst = fdtbus_reset_get_index(faa->faa_phandle, 0);
        if (ssc->ssc_rst && fdtbus_reset_deassert(ssc->ssc_rst) != 0) {
                aprint_error(": couldn't de-assert reset\n");



Home | Main Index | Thread Index | Old Index