Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/acpi acpi: sdhc: Support sdhci-caps and sdhci-caps-m...
details: https://anonhg.NetBSD.org/src/rev/563228cf214c
branches: trunk
changeset: 359590:563228cf214c
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Tue Jan 11 22:32:44 2022 +0000
description:
acpi: sdhc: Support sdhci-caps and sdhci-caps-mask properties.
diffstat:
sys/dev/acpi/sdhc_acpi.c | 23 +++++++++++++++++++++--
1 files changed, 21 insertions(+), 2 deletions(-)
diffs (51 lines):
diff -r 3b5ce8ad9865 -r 563228cf214c sys/dev/acpi/sdhc_acpi.c
--- a/sys/dev/acpi/sdhc_acpi.c Tue Jan 11 19:47:34 2022 +0000
+++ b/sys/dev/acpi/sdhc_acpi.c Tue Jan 11 22:32:44 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sdhc_acpi.c,v 1.15 2021/12/28 13:41:12 jmcneill Exp $ */
+/* $NetBSD: sdhc_acpi.c,v 1.16 2022/01/11 22:32:44 jmcneill Exp $ */
/*
* Copyright (c) 2016 Kimihiro Nonaka <nonaka%NetBSD.org@localhost>
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sdhc_acpi.c,v 1.15 2021/12/28 13:41:12 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdhc_acpi.c,v 1.16 2022/01/11 22:32:44 jmcneill Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -148,6 +148,7 @@
struct acpi_irq *irq;
ACPI_STATUS rv;
ACPI_INTEGER clock_freq;
+ ACPI_INTEGER caps, caps_mask;
sc->sc.sc_dev = self;
sc->sc.sc_dmat = aa->aa_dmat;
@@ -216,6 +217,24 @@
sc->sc.sc_flags |= SDHC_FLAG_NO_CLKBASE;
}
+ /* Capability overrides */
+ caps = caps_mask = 0;
+ acpi_dsd_integer(aa->aa_node->ad_handle, "sdhci-caps-mask", &caps_mask);
+ acpi_dsd_integer(aa->aa_node->ad_handle, "sdhci-caps", &caps);
+ if (caps || caps_mask) {
+ sc->sc.sc_caps = bus_space_read_4(sc->sc_memt, sc->sc_memh,
+ SDHC_CAPABILITIES);
+ sc->sc.sc_caps &= ~(caps_mask & 0xffffffff);
+ sc->sc.sc_caps |= (caps & 0xffffffff);
+ if (((caps | caps_mask) >> 32) != 0) {
+ sc->sc.sc_caps2 = bus_space_read_4(sc->sc_memt,
+ sc->sc_memh, SDHC_CAPABILITIES2);
+ sc->sc.sc_caps2 &= ~(caps_mask >> 32);
+ sc->sc.sc_caps2 |= (caps >> 32);
+ }
+ sc->sc.sc_flags |= SDHC_FLAG_HOSTCAPS;
+ }
+
if (sdhc_host_found(&sc->sc, sc->sc_memt, sc->sc_memh,
sc->sc_memsize) != 0) {
aprint_error_dev(self, "couldn't initialize host\n");
Home |
Main Index |
Thread Index |
Old Index