linux: update RPi patches

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2012-06-10 13:22:29 +02:00
parent 6f4be78ccf
commit 3854b84513
2 changed files with 638 additions and 922 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,191 +0,0 @@
diff -Naur linux-3.2.18.patch/arch/arm/mach-bcm2708/power.c linux-3.2.18.patch1/arch/arm/mach-bcm2708/power.c
diff -Naur linux-3.2.18.patch/arch/arm/mach-bcm2708/power.c.orig linux-3.2.18.patch1/arch/arm/mach-bcm2708/power.c.orig
diff -Naur linux-3.2.18.patch/arch/arm/mach-bcm2708/power.c.rej linux-3.2.18.patch1/arch/arm/mach-bcm2708/power.c.rej
diff -Naur linux-3.2.18.patch/drivers/mmc/host/sdhci-bcm2708.c linux-3.2.18.patch1/drivers/mmc/host/sdhci-bcm2708.c
--- linux-3.2.18.patch/drivers/mmc/host/sdhci-bcm2708.c 2012-05-29 22:56:49.727672891 +0200
+++ linux-3.2.18.patch1/drivers/mmc/host/sdhci-bcm2708.c 2012-05-30 01:47:10.213442208 +0200
@@ -26,9 +26,7 @@
#include <linux/highmem.h>
#include <linux/platform_device.h>
#include <linux/module.h>
-#include <linux/mmc/mmc.h>
#include <linux/mmc/host.h>
-#include <linux/mmc/sd.h>
#include <linux/io.h>
#include <linux/dma-mapping.h>
@@ -73,9 +71,6 @@
#define BCM2708_SDHCI_SLEEP_TIMEOUT 1000 /* msecs */
-/* Mhz clock that the EMMC core is running at. Should match the platform clockman settings */
-#define BCM2708_EMMC_CLOCK_FREQ 80000000
-
#define POWER_OFF 0
#define POWER_LAZY_OFF 1
#define POWER_ON 2
@@ -233,9 +228,6 @@
u32 ier;
#if USE_SPACED_WRITES_2CLK
- static bool timeout_disabled = false;
- unsigned int ns_2clk = 0;
-
/* The Arasan has a bugette whereby it may lose the content of
* successive writes to registers that are within two SD-card clock
* cycles of each other (a clock domain crossing problem).
@@ -247,7 +239,7 @@
/* host->clock is the clock freq in Hz */
static hptime_t last_write_hpt;
hptime_t now = hptime();
- ns_2clk = 2000000000/host->clock;
+ unsigned int ns_2clk = 2000000000/host->clock;
if (now == last_write_hpt || now == last_write_hpt+1) {
/* we can't guarantee any significant time has
@@ -263,27 +255,6 @@
}
last_write_hpt = now;
}
-#if USE_SOFTWARE_TIMEOUTS
- /* The Arasan is clocked for timeouts using the SD clock which is too
- * fast for ERASE commands and causes issues. So we disable timeouts
- * for ERASE */
- if (host->cmd != NULL && host->cmd->opcode == MMC_ERASE &&
- reg == (SDHCI_COMMAND & ~3)) {
- mod_timer(&host->timer,
- jiffies + SOFTWARE_ERASE_TIMEOUT_SEC * HZ);
- ier = readl(host->ioaddr + SDHCI_SIGNAL_ENABLE);
- ier &= ~SDHCI_INT_DATA_TIMEOUT;
- writel(ier, host->ioaddr + SDHCI_SIGNAL_ENABLE);
- timeout_disabled = true;
- udelay((ns_2clk+1000-1)/1000);
- } else if (timeout_disabled) {
- ier = readl(host->ioaddr + SDHCI_SIGNAL_ENABLE);
- ier |= SDHCI_INT_DATA_TIMEOUT;
- writel(ier, host->ioaddr + SDHCI_SIGNAL_ENABLE);
- timeout_disabled = false;
- udelay((ns_2clk+1000-1)/1000);
- }
-#endif
writel(val, host->ioaddr + reg);
#else
void __iomem * regaddr = host->ioaddr + reg;
@@ -359,68 +330,14 @@
static unsigned int sdhci_bcm2708_get_max_clock(struct sdhci_host *host)
{
- return 20000000; // this value is in Hz (20MHz)
+ return 100000000; // this value is in Hz (100MHz/4)
}
static unsigned int sdhci_bcm2708_get_timeout_clock(struct sdhci_host *host)
{
- if(host->clock)
- return (host->clock / 1000); // this value is in kHz (100MHz)
- else
- return (sdhci_bcm2708_get_max_clock(host) / 1000);
+ return 100000; // this value is in kHz (100MHz/4)
}
-static void sdhci_bcm2708_set_clock(struct sdhci_host *host, unsigned int clock)
-{
- int div = 0;
- u16 clk = 0;
- unsigned long timeout;
-
- if (clock == host->clock)
- return;
-
- sdhci_writew(host, 0, SDHCI_CLOCK_CONTROL);
-
- if (clock == 0)
- goto out;
-
- if (BCM2708_EMMC_CLOCK_FREQ <= clock)
- div = 1;
- else {
- for (div = 2; div < SDHCI_MAX_DIV_SPEC_300; div += 2) {
- if ((BCM2708_EMMC_CLOCK_FREQ / div) <= clock)
- break;
- }
- }
-
- DBG( "desired SD clock: %d, actual: %d\n",
- clock, BCM2708_EMMC_CLOCK_FREQ / div);
-
- clk |= (div & SDHCI_DIV_MASK) << SDHCI_DIVIDER_SHIFT;
- clk |= ((div & SDHCI_DIV_HI_MASK) >> SDHCI_DIV_MASK_LEN)
- << SDHCI_DIVIDER_HI_SHIFT;
- clk |= SDHCI_CLOCK_INT_EN;
-
- sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL);
-
- timeout = 20;
- while (!((clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL))
- & SDHCI_CLOCK_INT_STABLE)) {
- if (timeout == 0) {
- printk(KERN_ERR "%s: Internal clock never "
- "stabilised.\n", mmc_hostname(host->mmc));
- return;
- }
- timeout--;
- mdelay(1);
- }
-
- clk |= SDHCI_CLOCK_CARD_EN;
- sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL);
-out:
- host->clock = clock;
- }
-
/*****************************************************************************\
* *
* DMA Operation *
@@ -1308,7 +1225,7 @@
#error The BCM2708 SDHCI driver needs CONFIG_MMC_SDHCI_IO_ACCESSORS to be set
#endif
//.enable_dma = NULL,
- .set_clock = sdhci_bcm2708_set_clock,
+ //.set_clock = NULL,
.get_max_clock = sdhci_bcm2708_get_max_clock,
//.get_min_clock = NULL,
.get_timeout_clock = sdhci_bcm2708_get_timeout_clock,
@@ -1372,9 +1289,7 @@
host->irq = platform_get_irq(pdev, 0);
host->quirks = SDHCI_QUIRK_BROKEN_CARD_DETECTION |
- SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
- SDHCI_QUIRK_BROKEN_TIMEOUT_VAL |
- SDHCI_QUIRK_NONSTANDARD_CLOCK;
+ SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK;
#ifdef CONFIG_MMC_SDHCI_BCM2708_DMA
host->flags = SDHCI_USE_PLATDMA;
#endif
@@ -1441,8 +1356,6 @@
host_priv->cb_base, (unsigned)host_priv->cb_handle,
host_priv->dma_chan, host_priv->dma_chan_base,
host_priv->dma_irq);
-
- host->mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED;
#endif
ret = sdhci_add_host(host);
diff -Naur linux-3.2.18.patch/drivers/mmc/host/sdhci.c linux-3.2.18.patch1/drivers/mmc/host/sdhci.c
--- linux-3.2.18.patch/drivers/mmc/host/sdhci.c 2012-05-29 22:56:49.729672929 +0200
+++ linux-3.2.18.patch1/drivers/mmc/host/sdhci.c 2012-05-30 01:39:05.363004871 +0200
@@ -2927,11 +2927,8 @@
mmc->caps |= MMC_CAP_MAX_CURRENT_200;
}
- if(host->ops->voltage_broken) {
- ocr_avail |= MMC_VDD_32_33 | MMC_VDD_33_34;
- // Cannot support UHS modes is we are stuck at 3.3V;
- mmc->caps &= ~(MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 | MMC_CAP_UHS_SDR104 | MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_DDR50);
- }
+ if(host->ops->voltage_broken)
+ ocr_avail |= MMC_VDD_29_30 | MMC_VDD_30_31;
mmc->ocr_avail = ocr_avail;
mmc->ocr_avail_sdio = ocr_avail;
diff -Naur linux-3.2.18.patch/drivers/mmc/host/sdhci.c.orig linux-3.2.18.patch1/drivers/mmc/host/sdhci.c.orig