Module Name: src
Committed By: jmcneill
Date: Fri Jun 2 11:01:15 UTC 2017
Modified Files:
src/sys/dev/ic: pl181.c pl181var.h
Log Message:
Separate clock frequency from maximum supported bus frequency.
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/ic/pl181.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/ic/pl181var.h
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/ic/pl181.c
diff -u src/sys/dev/ic/pl181.c:1.2 src/sys/dev/ic/pl181.c:1.3
--- src/sys/dev/ic/pl181.c:1.2 Thu Jun 1 16:57:12 2017
+++ src/sys/dev/ic/pl181.c Fri Jun 2 11:01:15 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: pl181.c,v 1.2 2017/06/01 16:57:12 jmcneill Exp $ */
+/* $NetBSD: pl181.c,v 1.3 2017/06/02 11:01:15 jmcneill Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <[email protected]>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pl181.c,v 1.2 2017/06/01 16:57:12 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pl181.c,v 1.3 2017/06/02 11:01:15 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -117,7 +117,8 @@ plmmc_init(struct plmmc_softc *sc)
saa.saa_sct = &plmmc_chip_functions;
saa.saa_sch = sc;
saa.saa_clkmin = 400;
- saa.saa_clkmax = sc->sc_clock_freq / 1000;
+ saa.saa_clkmax = sc->sc_max_freq > 0 ?
+ sc->sc_max_freq / 1000 : sc->sc_clock_freq / 1000;
saa.saa_caps = SMC_CAPS_4BIT_MODE | SMC_CAPS_SINGLE_ONLY;
sc->sc_sdmmc_dev = config_found(sc->sc_dev, &saa, NULL);
Index: src/sys/dev/ic/pl181var.h
diff -u src/sys/dev/ic/pl181var.h:1.1 src/sys/dev/ic/pl181var.h:1.2
--- src/sys/dev/ic/pl181var.h:1.1 Tue Jan 27 16:33:26 2015
+++ src/sys/dev/ic/pl181var.h Fri Jun 2 11:01:15 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: pl181var.h,v 1.1 2015/01/27 16:33:26 jmcneill Exp $ */
+/* $NetBSD: pl181var.h,v 1.2 2017/06/02 11:01:15 jmcneill Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <[email protected]>
@@ -35,6 +35,7 @@ struct plmmc_softc {
bus_space_handle_t sc_bsh;
void *sc_ih;
unsigned int sc_clock_freq;
+ unsigned int sc_max_freq;
device_t sc_sdmmc_dev;
kmutex_t sc_intr_lock;