Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/samsung get fifo depth from fdt, use default cl...
details: https://anonhg.NetBSD.org/src/rev/a39d6b021f43
branches: trunk
changeset: 812698:a39d6b021f43
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Sun Dec 27 20:49:01 2015 +0000
description:
get fifo depth from fdt, use default clock parent for biu
diffstat:
sys/arch/arm/samsung/exynos_dwcmmc.c | 34 ++++++++++------------------------
1 files changed, 10 insertions(+), 24 deletions(-)
diffs (89 lines):
diff -r d9d198757b92 -r a39d6b021f43 sys/arch/arm/samsung/exynos_dwcmmc.c
--- a/sys/arch/arm/samsung/exynos_dwcmmc.c Sun Dec 27 19:50:31 2015 +0000
+++ b/sys/arch/arm/samsung/exynos_dwcmmc.c Sun Dec 27 20:49:01 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: exynos_dwcmmc.c,v 1.1 2015/12/26 23:13:50 jmcneill Exp $ */
+/* $NetBSD: exynos_dwcmmc.c,v 1.2 2015/12/27 20:49:01 jmcneill Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: exynos_dwcmmc.c,v 1.1 2015/12/26 23:13:50 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: exynos_dwcmmc.c,v 1.2 2015/12/27 20:49:01 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -81,11 +81,10 @@
struct dwc_mmc_softc *sc = &esc->sc;
struct fdt_attach_args * const faa = aux;
const int phandle = faa->faa_phandle;
- struct clk *clk_cpll;
char intrstr[128];
bus_addr_t addr;
bus_size_t size;
- u_int bus_width, ciu_div;
+ u_int bus_width, ciu_div, fifo_depth;
int error;
if (fdtbus_get_reg(phandle, 0, &addr, &size) != 0) {
@@ -96,35 +95,28 @@
if (of_getprop_uint32(phandle, "bus-width", &bus_width)) {
bus_width = 4;
}
+ if (of_getprop_uint32(phandle, "fifo-depth", &fifo_depth)) {
+ fifo_depth = 64;
+ }
if (of_getprop_uint32(phandle, "samsung,dw-mshc-ciu-div", &ciu_div)) {
aprint_error(": missing samsung,dw-mshc-ciu-div property\n");
return;
}
- clk_cpll = clk_get("sclk_cpll");
- if (clk_cpll == NULL) {
- aprint_error(": clock \"sclk_cpll\" not found\n");
- return;
- }
esc->sc_clk_biu = fdtbus_clock_get(phandle, "biu");
if (esc->sc_clk_biu == NULL) {
aprint_error(": couldn't get clock biu\n");
return;
}
- error = clk_set_parent(esc->sc_clk_biu, clk_cpll);
- if (error) {
- aprint_error(": couldn't set clock biu parent: %d\n", error);
- return;
- }
-
esc->sc_clk_ciu = fdtbus_clock_get(phandle, "ciu");
if (esc->sc_clk_ciu == NULL) {
aprint_error(": couldn't get clock ciu\n");
return;
}
- error = clk_set_rate(esc->sc_clk_ciu, 666000000);
+
+ error = clk_enable(esc->sc_clk_biu);
if (error) {
- aprint_error(": couldn't set clock ciu rate: %d\n", error);
+ aprint_error(": couldn't enable clock biu: %d\n", error);
return;
}
error = clk_enable(esc->sc_clk_ciu);
@@ -143,14 +135,8 @@
return;
}
- sc->sc_flags |= DWC_MMC_F_USE_HOLD_REG;
-#if 0
- sc->sc_flags = DWC_MMC_F_USE_HOLD_REG | DWC_MMC_F_PWREN_CLEAR |
- DWC_MMC_F_FORCE_CLK;
-#endif
-
sc->sc_clock_freq = clk_get_rate(esc->sc_clk_ciu) / (ciu_div + 1);
- sc->sc_fifo_depth = 64;
+ sc->sc_fifo_depth = fifo_depth;
esc->sc_pin_cd = fdtbus_gpio_acquire(phandle, "cd-gpios",
GPIO_PIN_INPUT);
Home |
Main Index |
Thread Index |
Old Index