]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - drivers/mmc/sdhci.c
sdhci: fix warnings on 64-bit builds
[people/ms/u-boot.git] / drivers / mmc / sdhci.c
index 3125d13ba3ce8e8e2552248e41c059bd31e5fb3c..5332e61cae6bae2c454182e7d4c75d94ded6beb3 100644 (file)
@@ -124,7 +124,7 @@ static int sdhci_transfer_data(struct sdhci_host *host, struct mmc_data *data,
 #endif
 #define CONFIG_SDHCI_CMD_DEFAULT_TIMEOUT       100
 
-int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd,
+static int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd,
                       struct mmc_data *data)
 {
        struct sdhci_host *host = mmc->priv;
@@ -194,13 +194,13 @@ int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd,
 
 #ifdef CONFIG_MMC_SDMA
                if (data->flags == MMC_DATA_READ)
-                       start_addr = (unsigned int)data->dest;
+                       start_addr = (unsigned long)data->dest;
                else
-                       start_addr = (unsigned int)data->src;
+                       start_addr = (unsigned long)data->src;
                if ((host->quirks & SDHCI_QUIRK_32BIT_DMA_ADDR) &&
                                (start_addr & 0x7) != 0x0) {
                        is_aligned = 0;
-                       start_addr = (unsigned int)aligned_buffer;
+                       start_addr = (unsigned long)aligned_buffer;
                        if (data->flags != MMC_DATA_READ)
                                memcpy(aligned_buffer, data->src, trans_bytes);
                }
@@ -355,7 +355,7 @@ static void sdhci_set_power(struct sdhci_host *host, unsigned short power)
        sdhci_writeb(host, pwr, SDHCI_POWER_CONTROL);
 }
 
-void sdhci_set_ios(struct mmc *mmc)
+static void sdhci_set_ios(struct mmc *mmc)
 {
        u32 ctrl;
        struct sdhci_host *host = mmc->priv;
@@ -374,7 +374,8 @@ void sdhci_set_ios(struct mmc *mmc)
                                (host->quirks & SDHCI_QUIRK_USE_WIDE8))
                        ctrl |= SDHCI_CTRL_8BITBUS;
        } else {
-               if (SDHCI_GET_VERSION(host) >= SDHCI_SPEC_300)
+               if ((SDHCI_GET_VERSION(host) >= SDHCI_SPEC_300) ||
+                               (host->quirks & SDHCI_QUIRK_USE_WIDE8))
                        ctrl &= ~SDHCI_CTRL_8BITBUS;
                if (mmc->bus_width == 4)
                        ctrl |= SDHCI_CTRL_4BITBUS;
@@ -393,7 +394,7 @@ void sdhci_set_ios(struct mmc *mmc)
        sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);
 }
 
-int sdhci_init(struct mmc *mmc)
+static int sdhci_init(struct mmc *mmc)
 {
        struct sdhci_host *host = mmc->priv;
 
@@ -411,7 +412,7 @@ int sdhci_init(struct mmc *mmc)
        if (host->quirks & SDHCI_QUIRK_NO_CD) {
                unsigned int status;
 
-               sdhci_writel(host, SDHCI_CTRL_CD_TEST_INS | SDHCI_CTRL_CD_TEST,
+               sdhci_writeb(host, SDHCI_CTRL_CD_TEST_INS | SDHCI_CTRL_CD_TEST,
                        SDHCI_HOST_CONTROL);
 
                status = sdhci_readl(host, SDHCI_PRESENT_STATE);