bcm2835_dma: rip out the "use_dma" flag, make it non-optional

Now that it works for the Raspberry Pi 4, we can discontinue our workarounds
that were put in place to at least get a bootable kernel for other testing.
This commit is contained in:
Kyle Evans 2019-11-23 01:47:17 +00:00
parent d7399dfdba
commit d5f1d33c67
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=355026

View File

@ -113,7 +113,6 @@ struct bcm_mmc_conf {
int clock_src;
int default_freq;
int quirks;
bool use_dma;
int emmc_dreq;
};
@ -124,7 +123,6 @@ struct bcm_mmc_conf bcm2835_sdhci_conf = {
.quirks = SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
SDHCI_QUIRK_BROKEN_TIMEOUT_VAL | SDHCI_QUIRK_DONT_SET_HISPD_BIT |
SDHCI_QUIRK_MISSING_CAPS,
.use_dma = true
.emmc_dreq = BCM_DMA_DREQ_EMMC,
};
@ -133,7 +131,6 @@ struct bcm_mmc_conf bcm2838_emmc2_conf = {
.clock_src = -1,
.default_freq = BCM2838_DEFAULT_SDHCI_FREQ,
.quirks = 0,
.use_dma = true
.emmc_dreq = BCM_DMA_DREQ_NONE,
};
@ -319,37 +316,35 @@ bcm_sdhci_attach(device_t dev)
sdhci_init_slot(dev, &sc->sc_slot, 0);
if (sc->conf->use_dma) {
sc->sc_dma_ch = bcm_dma_allocate(BCM_DMA_CH_ANY);
if (sc->sc_dma_ch == BCM_DMA_CH_INVALID)
goto fail;
sc->sc_dma_ch = bcm_dma_allocate(BCM_DMA_CH_ANY);
if (sc->sc_dma_ch == BCM_DMA_CH_INVALID)
goto fail;
err = bcm_dma_setup_intr(sc->sc_dma_ch, bcm_sdhci_dma_intr, sc);
if (err != 0) {
device_printf(dev,
"cannot setup dma interrupt handler\n");
err = ENXIO;
goto fail;
}
err = bcm_dma_setup_intr(sc->sc_dma_ch, bcm_sdhci_dma_intr, sc);
if (err != 0) {
device_printf(dev,
"cannot setup dma interrupt handler\n");
err = ENXIO;
goto fail;
}
/* Allocate bus_dma resources. */
err = bus_dma_tag_create(bus_get_dma_tag(dev),
1, 0, bcm283x_dmabus_peripheral_lowaddr(),
BUS_SPACE_MAXADDR, NULL, NULL,
BCM_DMA_MAXSIZE, ALLOCATED_DMA_SEGS, BCM_SDHCI_BUFFER_SIZE,
BUS_DMA_ALLOCNOW, NULL, NULL,
&sc->sc_dma_tag);
/* Allocate bus_dma resources. */
err = bus_dma_tag_create(bus_get_dma_tag(dev),
1, 0, bcm283x_dmabus_peripheral_lowaddr(),
BUS_SPACE_MAXADDR, NULL, NULL,
BCM_DMA_MAXSIZE, ALLOCATED_DMA_SEGS, BCM_SDHCI_BUFFER_SIZE,
BUS_DMA_ALLOCNOW, NULL, NULL,
&sc->sc_dma_tag);
if (err) {
device_printf(dev, "failed allocate DMA tag");
goto fail;
}
if (err) {
device_printf(dev, "failed allocate DMA tag");
goto fail;
}
err = bus_dmamap_create(sc->sc_dma_tag, 0, &sc->sc_dma_map);
if (err) {
device_printf(dev, "bus_dmamap_create failed\n");
goto fail;
}
err = bus_dmamap_create(sc->sc_dma_tag, 0, &sc->sc_dma_map);
if (err) {
device_printf(dev, "bus_dmamap_create failed\n");
goto fail;
}
/* FIXME: Fix along with other BUS_SPACE_PHYSADDR instances */
@ -725,9 +720,6 @@ bcm_sdhci_will_handle_transfer(device_t dev, struct sdhci_slot *slot)
{
struct bcm_sdhci_softc *sc = device_get_softc(slot->bus);
if (!sc->conf->use_dma)
return (0);
/*
* This indicates that we somehow let a data interrupt slip by into the
* SDHCI framework, when it should not have. This really needs to be