From: Lukasz Majewski Date: Thu, 12 May 2016 11:02:19 +0000 (+0200) Subject: TPL: TM2: dwmmc: samsung: Add code to detect if dwmmc driver requires 64bit support X-Git-Tag: accepted/tizen/unified/20191107.062134~183 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=626c5ea6df5cf4a5f5641d4e55667309a4b53c03;p=platform%2Fkernel%2Fu-boot.git TPL: TM2: dwmmc: samsung: Add code to detect if dwmmc driver requires 64bit support Add to generic dwmmc driver code to check if this IP block require 64bit version of idma. Signed-off-by: Lukasz Majewski --- diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c index 435ccac..5667214 100644 --- a/drivers/mmc/exynos_dw_mmc.c +++ b/drivers/mmc/exynos_dw_mmc.c @@ -99,6 +99,7 @@ static void exynos_dwmci_board_init(struct dwmci_host *host) static int exynos_dwmci_core_init(struct dwmci_host *host) { unsigned int div; + int addr_config; unsigned long freq, sclk; if (host->bus_hz) @@ -122,6 +123,11 @@ static int exynos_dwmci_core_init(struct dwmci_host *host) host->clksel = exynos_dwmci_clksel; host->get_mmc_clk = exynos_dwmci_get_clk; + addr_config = DWMCI_GET_ADDR_CONFIG(dwmci_readl(host, DWMCI_HCON)); + if (addr_config == 1) + /* host supports IDMAC in 64-bit address mode */ + host->dma_64bit_address = 1; + #ifndef CONFIG_DM_MMC /* Add the mmc channel to be registered with mmc core */ if (add_dwmci(host, DWMMC_MAX_FREQ, DWMMC_MIN_FREQ)) { diff --git a/include/dwmmc.h b/include/dwmmc.h index f06720d..0b845da 100644 --- a/include/dwmmc.h +++ b/include/dwmmc.h @@ -140,6 +140,7 @@ /* quirks */ #define DWMCI_QUIRK_DISABLE_SMU (1 << 0) +#define DWMCI_GET_ADDR_CONFIG(x) (((x)>>27) & 0x1) /** * struct dwmci_host - Information about a designware MMC host * @@ -153,6 +154,7 @@ * @dev_id: Arbitrary device ID for use by controller * @buswidth: Bus width in bits (8 or 4) * @fifoth_val: Value for FIFOTH register (or 0 to leave unset) + * @dma_64bit_address: True only for devices supporting 64 bit DMA * @mmc: Pointer to generic MMC structure for this device * @priv: Private pointer for use by controller */ @@ -169,6 +171,7 @@ struct dwmci_host { int dev_id; int buswidth; u32 fifoth_val; + int dma_64bit_address; struct mmc *mmc; void *priv;