TPL: TM2: dwmmc: samsung: Add code to detect if dwmmc driver requires 64bit support
authorLukasz Majewski <l.majewski@samsung.com>
Thu, 12 May 2016 11:02:19 +0000 (13:02 +0200)
committerJaehoon Chung <jh80.chung@samsung.com>
Wed, 18 May 2016 06:32:12 +0000 (15:32 +0900)
Add to generic dwmmc driver code to check if this IP block require 64bit version
of idma.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
drivers/mmc/exynos_dw_mmc.c
include/dwmmc.h

index 863bbb3..99b6102 100644 (file)
@@ -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);
index 05b0817..8c99d34 100644 (file)
 /* 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
  *
  * @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;