MCPcopy Create free account
hub / github.com/F-Stack/f-stack / bcm_sdhost_read_multi_4

Function bcm_sdhost_read_multi_4

freebsd/arm/broadcom/bcm2835/bcm2835_sdhost.c:1006–1032  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1004}
1005
1006static void
1007bcm_sdhost_read_multi_4(device_t dev, struct sdhci_slot *slot, bus_size_t off,
1008 uint32_t *data, bus_size_t count)
1009{
1010 struct bcm_sdhost_softc *sc = device_get_softc(dev);
1011 bus_size_t i;
1012 bus_size_t avail;
1013 uint32_t edm;
1014
1015 mtx_lock(&sc->mtx);
1016
1017 dprintf("%s: off=%08lx count=%08lx\n", __func__, off, count);
1018
1019 for (i = 0; i < count;) {
1020 edm = RD4(sc, HC_DEBUG);
1021 avail = ((edm >> 4) & 0x1f);
1022 if (i + avail > count)
1023 avail = count - i;
1024 if (avail > 0)
1025 bus_space_read_multi_4(sc->sc_bst, sc->sc_bsh,
1026 HC_DATAPORT, data + i, avail);
1027 i += avail;
1028 DELAY(1);
1029 }
1030
1031 mtx_unlock(&sc->mtx);
1032}
1033
1034static void
1035bcm_sdhost_write_1(device_t dev, struct sdhci_slot *slot,

Callers

nothing calls this directly

Calls 6

device_get_softcFunction · 0.85
bus_space_read_multi_4Function · 0.85
RD4Function · 0.70
mtx_lockFunction · 0.50
DELAYFunction · 0.50
mtx_unlockFunction · 0.50

Tested by

no test coverage detected