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

Function ti_sdhci_write_1

freebsd/arm/ti/ti_sdhci.c:248–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

246}
247
248static void
249ti_sdhci_write_1(device_t dev, struct sdhci_slot *slot, bus_size_t off,
250 uint8_t val)
251{
252 struct ti_sdhci_softc *sc = device_get_softc(dev);
253 uint32_t val32;
254
255#ifdef MMCCAM
256 uint32_t newval32;
257 if (off == SDHCI_HOST_CONTROL) {
258 val32 = ti_mmchs_read_4(sc, MMCHS_CON);
259 newval32 = val32;
260 if (val & SDHCI_CTRL_8BITBUS) {
261 device_printf(dev, "Custom-enabling 8-bit bus\n");
262 newval32 |= MMCHS_CON_DW8;
263 } else {
264 device_printf(dev, "Custom-disabling 8-bit bus\n");
265 newval32 &= ~MMCHS_CON_DW8;
266 }
267 if (newval32 != val32)
268 ti_mmchs_write_4(sc, MMCHS_CON, newval32);
269 }
270#endif
271 val32 = RD4(sc, off & ~3);
272 val32 &= ~(0xff << (off & 3) * 8);
273 val32 |= (val << (off & 3) * 8);
274
275 WR4(sc, off & ~3, val32);
276}
277
278static void
279ti_sdhci_write_2(device_t dev, struct sdhci_slot *slot, bus_size_t off,

Callers 1

ti_sdhci_hw_initFunction · 0.85

Calls 6

device_get_softcFunction · 0.85
ti_mmchs_read_4Function · 0.85
device_printfFunction · 0.85
ti_mmchs_write_4Function · 0.85
RD4Function · 0.70
WR4Function · 0.70

Tested by

no test coverage detected