From 8ebde4f0b3e513a41b388893a66ade4a6c292465 Mon Sep 17 00:00:00 2001 From: Matt Reimer Date: Mon, 23 Feb 2015 14:52:22 -0700 Subject: mmc: s5p: properly mask SELBASECLK Properly mask SELBASECLK by using an actual mask rather than the number of bits to shift in order to create the mask. Signed-off-by: Matt Reimer Acked-by: Jaehoon Chung diff --git a/drivers/mmc/s5p_sdhci.c b/drivers/mmc/s5p_sdhci.c index 3899372..0eec731 100644 --- a/drivers/mmc/s5p_sdhci.c +++ b/drivers/mmc/s5p_sdhci.c @@ -30,7 +30,7 @@ static void s5p_sdhci_set_control_reg(struct sdhci_host *host) sdhci_writel(host, SDHCI_CTRL4_DRIVE_MASK(0x3), SDHCI_CONTROL4); val = sdhci_readl(host, SDHCI_CONTROL2); - val &= SDHCI_CTRL2_SELBASECLK_SHIFT; + val &= SDHCI_CTRL2_SELBASECLK_MASK(3); val |= SDHCI_CTRL2_ENSTAASYNCCLR | SDHCI_CTRL2_ENCMDCNFMSK | -- cgit v0.10.2 From e113fe3c06e34c9d29bd8952955558d585e4f80c Mon Sep 17 00:00:00 2001 From: Matt Reimer Date: Mon, 23 Feb 2015 14:56:58 -0700 Subject: mmc: sdhci: don't clobber adjacent registers SDHCI_HOST_CONTROL is a byte-sized register, so don't write to it as if it were a long, as that would result in clobbering the three registers following. Signed-off-by: Matt Reimer diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c index 82d7984..1f8917b 100644 --- a/drivers/mmc/sdhci.c +++ b/drivers/mmc/sdhci.c @@ -412,7 +412,7 @@ static 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); -- cgit v0.10.2 From 3c1fcb770b046c04eab25963ab2c427dff725875 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Tue, 17 Mar 2015 15:46:38 -0500 Subject: sdhci: fix warnings on 64-bit builds Change addresses to unsigned long to be compatible with 64-bit builds. Regardless of fixing warnings, the device is still only 32-bit capable. Signed-off-by: Rob Herring Cc: Pantelis Antoniou diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c index 1f8917b..5332e61 100644 --- a/drivers/mmc/sdhci.c +++ b/drivers/mmc/sdhci.c @@ -194,13 +194,13 @@ static 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); } -- cgit v0.10.2 From 3a48944bc9a7455fec97e9df74c3d5bb600d3d7c Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Tue, 17 Mar 2015 15:46:39 -0500 Subject: mv_sdhci: fix warnings on 64-bit builds Change addresses to unsigned long to be compatible with 64-bit builds. Regardless of fixing warnings, the device is still only 32-bit capable. Signed-off-by: Rob Herring Cc: Pantelis Antoniou diff --git a/drivers/mmc/mv_sdhci.c b/drivers/mmc/mv_sdhci.c index 63e1f90..75fa014 100644 --- a/drivers/mmc/mv_sdhci.c +++ b/drivers/mmc/mv_sdhci.c @@ -12,7 +12,7 @@ static struct sdhci_ops mv_ops; static inline void mv_sdhci_writeb(struct sdhci_host *host, u8 val, int reg) { struct mmc *mmc = host->mmc; - u32 ata = (u32)host->ioaddr + SD_CE_ATA_2; + u32 ata = (unsigned long)host->ioaddr + SD_CE_ATA_2; if (!IS_SD(mmc) && reg == SDHCI_HOST_CONTROL) { if (mmc->bus_width == 8) @@ -30,7 +30,7 @@ static inline void mv_sdhci_writeb(struct sdhci_host *host, u8 val, int reg) #endif /* CONFIG_MMC_SDHCI_IO_ACCESSORS */ static char *MVSDH_NAME = "mv_sdh"; -int mv_sdh_init(u32 regbase, u32 max_clk, u32 min_clk, u32 quirks) +int mv_sdh_init(unsigned long regbase, u32 max_clk, u32 min_clk, u32 quirks) { struct sdhci_host *host = NULL; host = (struct sdhci_host *)malloc(sizeof(struct sdhci_host)); -- cgit v0.10.2