Module Name: src Committed By: jmcneill Date: Sun May 27 19:54:46 UTC 2018
Modified Files: src/sys/dev/fdt: dw_apb_uart.c Log Message: Enable apb_pclk clock if present To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/dev/fdt/dw_apb_uart.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/fdt/dw_apb_uart.c diff -u src/sys/dev/fdt/dw_apb_uart.c:1.1 src/sys/dev/fdt/dw_apb_uart.c:1.2 --- src/sys/dev/fdt/dw_apb_uart.c:1.1 Sun May 27 17:14:23 2018 +++ src/sys/dev/fdt/dw_apb_uart.c Sun May 27 19:54:45 2018 @@ -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 <jmcne...@invisible.ca> @@ -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 @@ struct dw_apb_uart_softc { void *ssc_ih; struct clk *ssc_clk; + struct clk *ssc_pclk; struct fdtbus_reset *ssc_rst; }; @@ -115,6 +116,12 @@ dw_apb_uart_attach(device_t parent, devi 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");