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: submit/tizen/20160810.050017~22 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4ba80a5b6f451c54ea603e43ec1534944e20ba3f;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 863bbb3f64..99b6102510 100644 --- a/drivers/mmc/exynos_dw_mmc.c +++ b/drivers/mmc/exynos_dw_mmc.c @@ -83,6 +83,7 @@ static void exynos_dwmci_board_init(struct dwmci_host *host) static int exynos_dwmci_core_init(struct dwmci_host *host, int index) { unsigned int div; + int addr_config; unsigned long freq, sclk; struct dwmci_exynos_priv_data *priv = host->priv; @@ -114,6 +115,12 @@ static int exynos_dwmci_core_init(struct dwmci_host *host, int index) host->clksel = exynos_dwmci_clksel; host->dev_index = index; 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; + /* Add the mmc channel to be registered with mmc core */ if (add_dwmci(host, DWMMC_MAX_FREQ, DWMMC_MIN_FREQ)) { printf("DWMMC%d registration failed\n", index); diff --git a/include/dwmmc.h b/include/dwmmc.h index 05b0817fe1..8c99d34028 100644 --- a/include/dwmmc.h +++ b/include/dwmmc.h @@ -131,6 +131,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 * @@ -144,6 +145,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 */ @@ -160,6 +162,7 @@ struct dwmci_host { int dev_id; int buswidth; u32 fifoth_val; + int dma_64bit_address; struct mmc *mmc; void *priv;