summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorPatrick Wildt <patrick@cvs.openbsd.org>2022-01-18 11:36:22 +0000
committerPatrick Wildt <patrick@cvs.openbsd.org>2022-01-18 11:36:22 +0000
commit21d25310401e65a6b3b3fe1df50e3fbe43cdc0f0 (patch)
tree906403bd570c95529ffdbc73fbf0420194a6dd21 /sys/arch
parente2c18389ad572a97d17e4da054ae4bd45189dec6 (diff)
Improve how quirks are handled on sdhc(4)-compatible drivers. So far
we have passed a modified version of the contents in the capabilities register if we wanted to override what sdhc(4) would otherwise read. Unfortunately there's a second capabilities register that we did not yet take into consideration, which is why to disable DDR50 support we created a quirk flag in the softc. The sdhc(4) ACPI nodes have a way to mask and set bits in both of the capabilities register, which is a flexible approach to solving that issue and using that for our sdhc(4) drivers even improves readability. ok kettenis@
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/armv7/marvell/mvpxa.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/arch/armv7/marvell/mvpxa.c b/sys/arch/armv7/marvell/mvpxa.c
index 27aaef3a4cb..aaa2b939a06 100644
--- a/sys/arch/armv7/marvell/mvpxa.c
+++ b/sys/arch/armv7/marvell/mvpxa.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mvpxa.c,v 1.3 2021/10/24 17:52:27 mpi Exp $ */
+/* $OpenBSD: mvpxa.c,v 1.4 2022/01/18 11:36:21 patrick Exp $ */
/*
* Copyright (c) 2017 Mark Kettenis
* Copyright (c) 2017 Patrick Wildt <patrick@blueri.se>
@@ -111,7 +111,7 @@ mvpxa_attach(struct device *parent, struct device *self, void *aux)
{
struct mvpxa_softc *sc = (struct mvpxa_softc *)self;
struct fdt_attach_args *faa = aux;
- uint32_t caps;
+ uint64_t capmask = 0, capset = 0;
if (faa->fa_nreg < 3) {
printf(": not enough registers\n");
@@ -162,11 +162,11 @@ mvpxa_attach(struct device *parent, struct device *self, void *aux)
sc->sc.sc_host = &sc->sc_host;
sc->sc.sc_dmat = faa->fa_dmat;
- caps = bus_space_read_4(sc->sc_iot, sc->sc_ioh, SDHC_CAPABILITIES);
if (OF_getproplen(faa->fa_node, "no-1-8-v") >= 0)
- caps &= ~SDHC_VOLTAGE_SUPP_1_8V;
+ capmask |= SDHC_VOLTAGE_SUPP_1_8V;
- sdhc_host_found(&sc->sc, sc->sc_iot, sc->sc_ioh, sc->sc_size, 1, caps);
+ sdhc_host_found(&sc->sc, sc->sc_iot, sc->sc_ioh, sc->sc_size, 1,
+ capmask, capset);
return;
unmap: