Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/sdhci/sdhci.c
Show First 20 Lines • Show All 716 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
static int | static int | ||||
sdhci_dma_alloc(struct sdhci_slot *slot) | sdhci_dma_alloc(struct sdhci_slot *slot) | ||||
{ | { | ||||
int err; | int err; | ||||
if (!(slot->quirks & SDHCI_QUIRK_BROKEN_SDMA_BOUNDARY)) { | if (!(slot->quirks & SDHCI_QUIRK_BROKEN_SDMA_BOUNDARY)) { | ||||
if (MAXPHYS <= 1024 * 4) | if (maxphys <= 1024 * 4) | ||||
slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_4K; | slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_4K; | ||||
else if (MAXPHYS <= 1024 * 8) | else if (maxphys <= 1024 * 8) | ||||
slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_8K; | slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_8K; | ||||
else if (MAXPHYS <= 1024 * 16) | else if (maxphys <= 1024 * 16) | ||||
slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_16K; | slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_16K; | ||||
else if (MAXPHYS <= 1024 * 32) | else if (maxphys <= 1024 * 32) | ||||
slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_32K; | slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_32K; | ||||
else if (MAXPHYS <= 1024 * 64) | else if (maxphys <= 1024 * 64) | ||||
slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_64K; | slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_64K; | ||||
else if (MAXPHYS <= 1024 * 128) | else if (maxphys <= 1024 * 128) | ||||
slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_128K; | slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_128K; | ||||
else if (MAXPHYS <= 1024 * 256) | else if (maxphys <= 1024 * 256) | ||||
slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_256K; | slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_256K; | ||||
else | else | ||||
slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_512K; | slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_512K; | ||||
} | } | ||||
slot->sdma_bbufsz = SDHCI_SDMA_BNDRY_TO_BBUFSZ(slot->sdma_boundary); | slot->sdma_bbufsz = SDHCI_SDMA_BNDRY_TO_BBUFSZ(slot->sdma_boundary); | ||||
/* | /* | ||||
* Allocate the DMA tag for an SDMA bounce buffer. | * Allocate the DMA tag for an SDMA bounce buffer. | ||||
▲ Show 20 Lines • Show All 1,783 Lines • ▼ Show 20 Lines | if (slot == NULL) { | ||||
xpt_done(ccb); | xpt_done(ccb); | ||||
return; | return; | ||||
} | } | ||||
mtx_assert(&slot->sim_mtx, MA_OWNED); | mtx_assert(&slot->sim_mtx, MA_OWNED); | ||||
switch (ccb->ccb_h.func_code) { | switch (ccb->ccb_h.func_code) { | ||||
case XPT_PATH_INQ: | case XPT_PATH_INQ: | ||||
mmc_path_inq(&ccb->cpi, "Deglitch Networks", sim, MAXPHYS); | mmc_path_inq(&ccb->cpi, "Deglitch Networks", sim, maxphys); | ||||
break; | break; | ||||
case XPT_GET_TRAN_SETTINGS: | case XPT_GET_TRAN_SETTINGS: | ||||
{ | { | ||||
struct ccb_trans_settings *cts = &ccb->cts; | struct ccb_trans_settings *cts = &ccb->cts; | ||||
uint32_t max_data; | uint32_t max_data; | ||||
if (sdhci_debug > 1) | if (sdhci_debug > 1) | ||||
▲ Show 20 Lines • Show All 235 Lines • Show Last 20 Lines |