diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2012-06-17 10:13:34 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2012-06-17 10:13:34 +0200 |
commit | be50d959ce1955e21ea81912c545ff1bafb71580 (patch) | |
tree | 55025e1192364d18adbd41fcce72d305ca77ed33 | |
parent | db11abf88b817940f9d15a16391c2b7ca11757e5 (diff) | |
download | platform-pengutronix-raspberrypi-be50d959ce1955e21ea81912c545ff1bafb71580.tar.gz platform-pengutronix-raspberrypi-be50d959ce1955e21ea81912c545ff1bafb71580.tar.xz |
kernel: new patches
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
16 files changed, 779 insertions, 0 deletions
diff --git a/patches/linux-3.1.9/0058-mmc-sd-Handle-SD3.0-cards-not-supporting-UHS-I-bus-s.patch b/patches/linux-3.1.9/0058-mmc-sd-Handle-SD3.0-cards-not-supporting-UHS-I-bus-s.patch new file mode 100644 index 0000000..1bfb8bb --- /dev/null +++ b/patches/linux-3.1.9/0058-mmc-sd-Handle-SD3.0-cards-not-supporting-UHS-I-bus-s.patch @@ -0,0 +1,62 @@ +From 8d7c5395d15160ffc26e5490167c49dff511b74f Mon Sep 17 00:00:00 2001 +From: Subhash Jadavani <subhashj@codeaurora.org> +Date: Wed, 10 Aug 2011 11:16:01 +0530 +Subject: [PATCH] mmc: sd: Handle SD3.0 cards not supporting UHS-I bus speed + mode + +Here is Essential conditions to indicate Version 3.00 Card +(SD_SPEC=2 and SD_SPEC3=1) : +(1) The card shall support CMD6 +(2) The card shall support CMD8 +(3) The card shall support CMD42 +(4) User area capacity shall be up to 2GB (SDSC) or 32GB (SDHC) + User area capacity shall be more than or equal to 32GB and + up to 2TB (SDXC) +(5) Speed Class shall be supported (SDHC or SDXC) + +So even if SD card doesn't support any of the newly defined +UHS-I bus speed mode, it can advertise itself as SD3.0 cards +as long as it supports all the essential conditions of +SD3.0 cards. Given this, these type of cards should atleast +run in High Speed mode @50MHZ if it supports HS. + +But current initialization sequence for SD3.0 cards is +such that these non-UHS-I SD3.0 cards runs in Default +Speed mode @25MHz. + +This patch makes sure that these non-UHS-I SD3.0 cards run +in High Speed Mode @50MHz. + +Tested this patch with SanDisk Extreme SDHC 8GB Class 10 card. + +Reported-by: "Hiremath, Vaibhav" <hvaibhav@ti.com> +Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org> +Signed-off-by: Chris Ball <cjb@laptop.org> +--- + drivers/mmc/core/sd.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c +index 4c281a4..c813ee3 100644 +--- a/drivers/mmc/core/sd.c ++++ b/drivers/mmc/core/sd.c +@@ -306,6 +306,9 @@ static int mmc_read_switch(struct mmc_card *card) + goto out; + } + ++ if (status[13] & UHS_SDR50_BUS_SPEED) ++ card->sw_caps.hs_max_dtr = 50000000; ++ + if (card->scr.sda_spec3) { + card->sw_caps.sd3_bus_mode = status[13]; + +@@ -348,9 +351,6 @@ static int mmc_read_switch(struct mmc_card *card) + } + + card->sw_caps.sd3_curr_limit = status[7]; +- } else { +- if (status[13] & 0x02) +- card->sw_caps.hs_max_dtr = 50000000; + } + + out: diff --git a/patches/linux-3.1.9/0059-mmc-use-really-long-write-timeout-to-deal-with-crapp.patch b/patches/linux-3.1.9/0059-mmc-use-really-long-write-timeout-to-deal-with-crapp.patch new file mode 100644 index 0000000..53ff0e7 --- /dev/null +++ b/patches/linux-3.1.9/0059-mmc-use-really-long-write-timeout-to-deal-with-crapp.patch @@ -0,0 +1,60 @@ +From 872a8ff772ded51403bd8a46f80b1bf9706b76cd Mon Sep 17 00:00:00 2001 +From: Paul Walmsley <paul@pwsan.com> +Date: Mon, 12 Mar 2012 10:58:00 -0600 +Subject: [PATCH] mmc: use really long write timeout to deal with crappy cards + +mmc: use really long write timeout to deal with crappy cards + +Several people have noticed that crappy SD cards take much longer to +complete multiple block writes than the 300ms that Linux specifies. +Try to work around this by using a three second write timeout instead. + +This is a generalized version of a patch from Chase Maupin +<Chase.Maupin@ti.com>, whose patch description said: + +* With certain SD cards timeouts like the following have been seen + due to an improper calculation of the dto value: + mmcblk0: error -110 transferring data, sector 4126233, nr 8, + card status 0xc00 +* By removing the dto calculation and setting the timeout value + to the maximum specified by the SD card specification part A2 + section 2.2.15 these timeouts can be avoided. +* This change has been used by beagleboard users as well as the + Texas Instruments SDK without a negative impact. +* There are multiple discussion threads about this but the most + relevant ones are: + * http://talk.maemo.org/showthread.php?p=1000707#post1000707 + * http://www.mail-archive.com/linux-omap@vger.kernel.org/msg42213.html +* Original proposal for this fix was done by Sukumar Ghoral of + Texas Instruments +* Tested using a Texas Instruments AM335x EVM + +Signed-off-by: Paul Walmsley <paul@pwsan.com> +Tested-by: Tony Lindgren <tony@atomide.com> +Signed-off-by: Chris Ball <cjb@laptop.org> +--- + drivers/mmc/core/core.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c +index d637982..a14ddf96 100644 +--- a/drivers/mmc/core/core.c ++++ b/drivers/mmc/core/core.c +@@ -396,10 +396,14 @@ void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card) + + if (data->flags & MMC_DATA_WRITE) + /* +- * The limit is really 250 ms, but that is +- * insufficient for some crappy cards. ++ * The MMC spec "It is strongly recommended ++ * for hosts to implement more than 500ms ++ * timeout value even if the card indicates ++ * the 250ms maximum busy length." Even the ++ * previous value of 300ms is known to be ++ * insufficient for some cards. + */ +- limit_us = 300000; ++ limit_us = 3000000; + else + limit_us = 100000; + diff --git a/patches/linux-3.1.9/0060-mmc-core-Set-correct-bus-mode-before-card-init.patch b/patches/linux-3.1.9/0060-mmc-core-Set-correct-bus-mode-before-card-init.patch new file mode 100644 index 0000000..72ce2dc --- /dev/null +++ b/patches/linux-3.1.9/0060-mmc-core-Set-correct-bus-mode-before-card-init.patch @@ -0,0 +1,99 @@ +From f3320b75d0d51c9cca8df24369e34b664b235b7d Mon Sep 17 00:00:00 2001 +From: Stefan Nilsson XK <stefan.xk.nilsson@stericsson.com> +Date: Thu, 15 Sep 2011 17:50:38 +0200 +Subject: [PATCH] mmc: core: Set correct bus mode before card init + +Earlier all cards where initiated with bus mode set as OPENDRAIN, and then +later switched to PUSHPULL. According to the MMC/SD/SDIO specifications +only MMC cards use OPENDRAIN during init. For both SD and SDIO the bus +mode shall be PUSHPULL before attempting to init the card. + +The consequence of having incorrect bus mode can lead to not being able +to detect the card. Therefore the default behavior have now been changed +to PUSHPULL in mmc_power_up, and will only be temporarily switched when +trying to attach or init a MMC card. + +Signed-off-by: Stefan Nilsson XK <stefan.xk.nilsson@stericsson.com> +Signed-off-by: Ulf HANSSON <ulf.hansson@stericsson.com> +Acked-by: Linus Walleij <linus.walleij@linaro.org> +Signed-off-by: Chris Ball <cjb@laptop.org> +--- + drivers/mmc/core/core.c | 8 +++----- + drivers/mmc/core/mmc.c | 8 ++++++++ + drivers/mmc/core/sd.c | 2 -- + drivers/mmc/core/sdio.c | 2 -- + 4 files changed, 11 insertions(+), 9 deletions(-) + +diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c +index a14ddf96..04a141f 100644 +--- a/drivers/mmc/core/core.c ++++ b/drivers/mmc/core/core.c +@@ -1123,13 +1123,11 @@ static void mmc_power_up(struct mmc_host *host) + bit = fls(host->ocr_avail) - 1; + + host->ios.vdd = bit; +- if (mmc_host_is_spi(host)) { ++ if (mmc_host_is_spi(host)) + host->ios.chip_select = MMC_CS_HIGH; +- host->ios.bus_mode = MMC_BUSMODE_PUSHPULL; +- } else { ++ else + host->ios.chip_select = MMC_CS_DONTCARE; +- host->ios.bus_mode = MMC_BUSMODE_OPENDRAIN; +- } ++ host->ios.bus_mode = MMC_BUSMODE_PUSHPULL; + host->ios.power_mode = MMC_POWER_UP; + host->ios.bus_width = MMC_BUS_WIDTH_1; + host->ios.timing = MMC_TIMING_LEGACY; +diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c +index 6952f77..89bb40d 100644 +--- a/drivers/mmc/core/mmc.c ++++ b/drivers/mmc/core/mmc.c +@@ -550,6 +550,10 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, + BUG_ON(!host); + WARN_ON(!host->claimed); + ++ /* Set correct bus mode for MMC before attempting init */ ++ if (!mmc_host_is_spi(host)) ++ mmc_set_bus_mode(host, MMC_BUSMODE_OPENDRAIN); ++ + /* + * Since we're changing the OCR value, we seem to + * need to tell some cards to go back to the idle +@@ -1019,6 +1023,10 @@ int mmc_attach_mmc(struct mmc_host *host) + BUG_ON(!host); + WARN_ON(!host->claimed); + ++ /* Set correct bus mode for MMC before attempting attach */ ++ if (!mmc_host_is_spi(host)) ++ mmc_set_bus_mode(host, MMC_BUSMODE_OPENDRAIN); ++ + err = mmc_send_op_cond(host, 0, &ocr); + if (err) + return err; +diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c +index c813ee3..fd55228 100644 +--- a/drivers/mmc/core/sd.c ++++ b/drivers/mmc/core/sd.c +@@ -929,8 +929,6 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr, + err = mmc_send_relative_addr(host, &card->rca); + if (err) + return err; +- +- mmc_set_bus_mode(host, MMC_BUSMODE_PUSHPULL); + } + + if (!oldcard) { +diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c +index ac492ac..698d813 100644 +--- a/drivers/mmc/core/sdio.c ++++ b/drivers/mmc/core/sdio.c +@@ -408,8 +408,6 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, + */ + if (oldcard) + oldcard->rca = card->rca; +- +- mmc_set_bus_mode(host, MMC_BUSMODE_PUSHPULL); + } + + /* diff --git a/patches/linux-3.1.9/0061-mmc-core-Add-quirk-for-long-data-read-time.patch b/patches/linux-3.1.9/0061-mmc-core-Add-quirk-for-long-data-read-time.patch new file mode 100644 index 0000000..b068ccc --- /dev/null +++ b/patches/linux-3.1.9/0061-mmc-core-Add-quirk-for-long-data-read-time.patch @@ -0,0 +1,90 @@ +From e4f6da232f57a77388881a9c6f5fd3e6f3d2708d Mon Sep 17 00:00:00 2001 +From: Stefan Nilsson XK <stefan.xk.nilsson@stericsson.com> +Date: Thu, 3 Nov 2011 09:44:12 +0100 +Subject: [PATCH] mmc: core: Add quirk for long data read time + +Adds a quirk that sets the data read timeout to a fixed value instead +of relying on the information in the CSD. The timeout value chosen +is 300ms since that has proven enough for the problematic cards found, +but could be increased if other cards require this. + +This patch also enables this quirk for certain Micron cards known to +have this problem. + +Signed-off-by: Stefan Nilsson XK <stefan.xk.nilsson@stericsson.com> +Signed-off-by: Ulf Hansson <ulf.hansson@stericsson.com> +Acked-by: Linus Walleij <linus.walleij@linaro.org> +Cc: <stable@kernel.org> +Signed-off-by: Chris Ball <cjb@laptop.org> +--- + drivers/mmc/card/block.c | 8 ++++++++ + drivers/mmc/core/core.c | 12 ++++++++++++ + include/linux/mmc/card.h | 6 ++++++ + 3 files changed, 26 insertions(+) + +diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c +index 4c1a648..d62f4cd 100644 +--- a/drivers/mmc/card/block.c ++++ b/drivers/mmc/card/block.c +@@ -1492,6 +1492,14 @@ static const struct mmc_fixup blk_fixups[] = + MMC_QUIRK_BLK_NO_CMD23), + MMC_FIXUP("MMC32G", 0x11, CID_OEMID_ANY, add_quirk_mmc, + MMC_QUIRK_BLK_NO_CMD23), ++ ++ /* ++ * Some Micron MMC cards needs longer data read timeout than ++ * indicated in CSD. ++ */ ++ MMC_FIXUP(CID_NAME_ANY, 0x13, 0x200, add_quirk_mmc, ++ MMC_QUIRK_LONG_READ_TIME), ++ + END_FIXUP + }; + +diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c +index 04a141f..f5d2890 100644 +--- a/drivers/mmc/core/core.c ++++ b/drivers/mmc/core/core.c +@@ -415,6 +415,18 @@ void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card) + data->timeout_clks = 0; + } + } ++ ++ /* ++ * Some cards require longer data read timeout than indicated in CSD. ++ * Address this by setting the read timeout to a "reasonably high" ++ * value. For the cards tested, 300ms has proven enough. If necessary, ++ * this value can be increased if other problematic cards require this. ++ */ ++ if (mmc_card_long_read_time(card) && data->flags & MMC_DATA_READ) { ++ data->timeout_ns = 300000000; ++ data->timeout_clks = 0; ++ } ++ + /* + * Some cards need very high timeouts if driven in SPI mode. + * The worst observed timeout was 900ms after writing a +diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h +index b460fc2..97c4740 100644 +--- a/include/linux/mmc/card.h ++++ b/include/linux/mmc/card.h +@@ -188,6 +188,7 @@ struct mmc_card { + #define MMC_QUIRK_DISABLE_CD (1<<5) /* disconnect CD/DAT[3] resistor */ + #define MMC_QUIRK_INAND_CMD38 (1<<6) /* iNAND devices have broken CMD38 */ + #define MMC_QUIRK_BLK_NO_CMD23 (1<<7) /* Avoid CMD23 for regular multiblock */ ++#define MMC_QUIRK_LONG_READ_TIME (1<<9) /* Data read time > CSD says */ + + unsigned int erase_size; /* erase size in sectors */ + unsigned int erase_shift; /* if erase unit is power 2 */ +@@ -377,6 +378,11 @@ static inline int mmc_card_nonstd_func_interface(const struct mmc_card *c) + return c->quirks & MMC_QUIRK_NONSTD_FUNC_IF; + } + ++static inline int mmc_card_long_read_time(const struct mmc_card *c) ++{ ++ return c->quirks & MMC_QUIRK_LONG_READ_TIME; ++} ++ + #define mmc_card_name(c) ((c)->cid.prod_name) + #define mmc_card_id(c) (dev_name(&(c)->dev)) + diff --git a/patches/linux-3.1.9/0062-sdhci-bcm2708-speed-up-DMA-sync.patch b/patches/linux-3.1.9/0062-sdhci-bcm2708-speed-up-DMA-sync.patch new file mode 100644 index 0000000..08939d5 --- /dev/null +++ b/patches/linux-3.1.9/0062-sdhci-bcm2708-speed-up-DMA-sync.patch @@ -0,0 +1,24 @@ +From d64b84ca8c171596b68bf125d266c84306ac421c Mon Sep 17 00:00:00 2001 +From: Grigori Goronzy <greg@blackbox> +Date: Mon, 4 Jun 2012 04:27:48 +0200 +Subject: [PATCH] sdhci-bcm2708: speed up DMA sync + +Experiments show that it doesn't really take that long to sync, so we +can reduce the poll interval slightly. Might improve performance a bit. +--- + drivers/mmc/host/sdhci-bcm2708.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c +index 7136998..9aebdfb 100644 +--- a/drivers/mmc/host/sdhci-bcm2708.c ++++ b/drivers/mmc/host/sdhci-bcm2708.c +@@ -907,7 +907,7 @@ static void sdhci_bcm2708_dma_complete_irq(struct sdhci_host *host, + while (0 != (sdhci_bcm2708_raw_readl(host, SDHCI_PRESENT_STATE) + & state_mask) && --timeout > 0) + { +- udelay(100); ++ udelay(30); + continue; + } + if (timeout <= 0) diff --git a/patches/linux-3.1.9/0063-sdhci-bcm2708-remove-custom-clock-handling.patch b/patches/linux-3.1.9/0063-sdhci-bcm2708-remove-custom-clock-handling.patch new file mode 100644 index 0000000..f903151 --- /dev/null +++ b/patches/linux-3.1.9/0063-sdhci-bcm2708-remove-custom-clock-handling.patch @@ -0,0 +1,97 @@ +From 9f144964006fb10db9436c5982c26d0ee9d8ec32 Mon Sep 17 00:00:00 2001 +From: Grigori Goronzy <greg@blackbox> +Date: Mon, 11 Jun 2012 18:52:04 +0200 +Subject: [PATCH] sdhci-bcm2708: remove custom clock handling + +The custom clock handling code is redundant and buggy. The MMC/SDHCI +subsystem does a better job than it, so remove it for good. +--- + drivers/mmc/host/sdhci-bcm2708.c | 65 +------------------------------------- + 1 file changed, 1 insertion(+), 64 deletions(-) + +diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c +index 9aebdfb..c964911 100644 +--- a/drivers/mmc/host/sdhci-bcm2708.c ++++ b/drivers/mmc/host/sdhci-bcm2708.c +@@ -359,68 +359,9 @@ void sdhci_bcm2708_writeb(struct sdhci_host *host, u8 val, int reg) + + static unsigned int sdhci_bcm2708_get_max_clock(struct sdhci_host *host) + { +- return 20000000; // this value is in Hz (20MHz) ++ return BCM2708_EMMC_CLOCK_FREQ; + } + +-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); +-} +- +-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 * +@@ -1307,11 +1248,7 @@ static struct sdhci_ops sdhci_bcm2708_ops = { + #else + #error The BCM2708 SDHCI driver needs CONFIG_MMC_SDHCI_IO_ACCESSORS to be set + #endif +- //.enable_dma = NULL, +- .set_clock = sdhci_bcm2708_set_clock, + .get_max_clock = sdhci_bcm2708_get_max_clock, +- //.get_min_clock = NULL, +- .get_timeout_clock = sdhci_bcm2708_get_timeout_clock, + + .enable = sdhci_bcm2708_enable, + .disable = sdhci_bcm2708_disable, diff --git a/patches/linux-3.1.9/0064-sdhci-bcm2708-add-additional-quirks.patch b/patches/linux-3.1.9/0064-sdhci-bcm2708-add-additional-quirks.patch new file mode 100644 index 0000000..791298a --- /dev/null +++ b/patches/linux-3.1.9/0064-sdhci-bcm2708-add-additional-quirks.patch @@ -0,0 +1,29 @@ +From 7a6fba9809c8d3a7fb1b2d0c40e0eae335127a6a Mon Sep 17 00:00:00 2001 +From: Grigori Goronzy <greg@blackbox> +Date: Mon, 11 Jun 2012 18:53:59 +0200 +Subject: [PATCH] sdhci-bcm2708: add additional quirks + +Some additional quirks are needed for correct operation. +There's no SDHCI capabilities register documented, and it always reads +zero, so add SDHCI_QUIRK_MISSING_CAPS. Apparently +SDHCI_QUIRK_NO_HISPD_BIT is needed for many cards to work correctly in +high-speed mode, so add it as well. +--- + drivers/mmc/host/sdhci-bcm2708.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c +index c964911..16c918b 100644 +--- a/drivers/mmc/host/sdhci-bcm2708.c ++++ b/drivers/mmc/host/sdhci-bcm2708.c +@@ -1311,7 +1311,9 @@ static int __devinit sdhci_bcm2708_probe(struct platform_device *pdev) + host->quirks = SDHCI_QUIRK_BROKEN_CARD_DETECTION | + SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK | + SDHCI_QUIRK_BROKEN_TIMEOUT_VAL | +- SDHCI_QUIRK_NONSTANDARD_CLOCK; ++ SDHCI_QUIRK_MISSING_CAPS | ++ SDHCI_QUIRK_NO_HISPD_BIT; ++ + #ifdef CONFIG_MMC_SDHCI_BCM2708_DMA + host->flags = SDHCI_USE_PLATDMA; + #endif diff --git a/patches/linux-3.1.9/0065-sdhci-bcm2708-add-allow_highspeed-parameter.patch b/patches/linux-3.1.9/0065-sdhci-bcm2708-add-allow_highspeed-parameter.patch new file mode 100644 index 0000000..9ef75f2 --- /dev/null +++ b/patches/linux-3.1.9/0065-sdhci-bcm2708-add-allow_highspeed-parameter.patch @@ -0,0 +1,47 @@ +From 420806e5adabd8343b362b4a1d7f64f22b394dbf Mon Sep 17 00:00:00 2001 +From: Grigori Goronzy <greg@blackbox> +Date: Mon, 11 Jun 2012 18:57:13 +0200 +Subject: [PATCH] sdhci-bcm2708: add allow_highspeed parameter + +Add a parameter to disable high-speed mode for the few cards that +still might have problems. High-speed mode is enabled by default. +--- + drivers/mmc/host/sdhci-bcm2708.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c +index 16c918b..a8aae16 100644 +--- a/drivers/mmc/host/sdhci-bcm2708.c ++++ b/drivers/mmc/host/sdhci-bcm2708.c +@@ -135,6 +135,8 @@ static inline unsigned long int since_ns(hptime_t t) + return (unsigned long)((hptime() - t) * HPTIME_CLK_NS); + } + ++static bool allow_highspeed = 1; ++ + #if 0 + static void hptime_test(void) + { +@@ -1381,7 +1383,8 @@ static int __devinit sdhci_bcm2708_probe(struct platform_device *pdev) + host_priv->dma_chan, host_priv->dma_chan_base, + host_priv->dma_irq); + +- host->mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED; ++ if (allow_highspeed) ++ host->mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED; + #endif + + ret = sdhci_add_host(host); +@@ -1487,8 +1490,12 @@ static void __exit sdhci_drv_exit(void) + module_init(sdhci_drv_init); + module_exit(sdhci_drv_exit); + ++module_param(allow_highspeed, bool, 0444); ++ + MODULE_DESCRIPTION("Secure Digital Host Controller Interface platform driver"); + MODULE_AUTHOR("Broadcom <info@broadcom.com>"); + MODULE_LICENSE("GPL v2"); + MODULE_ALIAS("platform:"DRIVER_NAME); + ++MODULE_PARM_DESC(allow_highspeed, "Allow high speed transfers modes"); ++ diff --git a/patches/linux-3.1.9/0066-sdhci-bcm2708-assume-50-MHz-eMMC-clock.patch b/patches/linux-3.1.9/0066-sdhci-bcm2708-assume-50-MHz-eMMC-clock.patch new file mode 100644 index 0000000..1e97d62 --- /dev/null +++ b/patches/linux-3.1.9/0066-sdhci-bcm2708-assume-50-MHz-eMMC-clock.patch @@ -0,0 +1,25 @@ +From f1a14aea8494dc019eb145a08f2f26022efd7731 Mon Sep 17 00:00:00 2001 +From: Grigori Goronzy <greg@blackbox> +Date: Mon, 11 Jun 2012 18:58:40 +0200 +Subject: [PATCH] sdhci-bcm2708: assume 50 MHz eMMC clock + +80 MHz clock isnt't suited well to be dividable to get SD clocks of 25 +MHz (default mode) or 50 MHz (high speed mode). 50 MHz are perfect to +drive the SD interface at ideal frequencies. +--- + drivers/mmc/host/sdhci-bcm2708.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c +index a8aae16..64b956b 100644 +--- a/drivers/mmc/host/sdhci-bcm2708.c ++++ b/drivers/mmc/host/sdhci-bcm2708.c +@@ -74,7 +74,7 @@ + #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 BCM2708_EMMC_CLOCK_FREQ 50000000 + + #define POWER_OFF 0 + #define POWER_LAZY_OFF 1 diff --git a/patches/linux-3.1.9/0067-Allow-emmc-clock-to-be-specified-as-command-line-par.patch b/patches/linux-3.1.9/0067-Allow-emmc-clock-to-be-specified-as-command-line-par.patch new file mode 100644 index 0000000..9e9b6dc --- /dev/null +++ b/patches/linux-3.1.9/0067-Allow-emmc-clock-to-be-specified-as-command-line-par.patch @@ -0,0 +1,45 @@ +From 598d87246fde30287f0c423cc761e26600dd7c17 Mon Sep 17 00:00:00 2001 +From: popcornmix <popcornmix@gmail.com> +Date: Sat, 16 Jun 2012 22:31:55 +0100 +Subject: [PATCH] Allow emmc clock to be specified as command line parameter + +--- + drivers/mmc/host/sdhci-bcm2708.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c +index 64b956b..3beb323 100644 +--- a/drivers/mmc/host/sdhci-bcm2708.c ++++ b/drivers/mmc/host/sdhci-bcm2708.c +@@ -136,6 +136,7 @@ static inline unsigned long int since_ns(hptime_t t) + } + + static bool allow_highspeed = 1; ++static bool emmc_clock_freq = BCM2708_EMMC_CLOCK_FREQ; + + #if 0 + static void hptime_test(void) +@@ -361,7 +362,7 @@ void sdhci_bcm2708_writeb(struct sdhci_host *host, u8 val, int reg) + + static unsigned int sdhci_bcm2708_get_max_clock(struct sdhci_host *host) + { +- return BCM2708_EMMC_CLOCK_FREQ; ++ return emmc_clock_freq; + } + + /*****************************************************************************\ +@@ -1491,6 +1492,7 @@ module_init(sdhci_drv_init); + module_exit(sdhci_drv_exit); + + module_param(allow_highspeed, bool, 0444); ++module_param(emmc_clock_freq, bool, 0444); + + MODULE_DESCRIPTION("Secure Digital Host Controller Interface platform driver"); + MODULE_AUTHOR("Broadcom <info@broadcom.com>"); +@@ -1498,4 +1500,6 @@ MODULE_LICENSE("GPL v2"); + MODULE_ALIAS("platform:"DRIVER_NAME); + + MODULE_PARM_DESC(allow_highspeed, "Allow high speed transfers modes"); ++MODULE_PARM_DESC(emmc_clock_freq, "Specify the speed of emmc clock"); ++ + diff --git a/patches/linux-3.1.9/0068-sdhci-bcm2708-raise-DMA-sync-timeout.patch b/patches/linux-3.1.9/0068-sdhci-bcm2708-raise-DMA-sync-timeout.patch new file mode 100644 index 0000000..9c75a72 --- /dev/null +++ b/patches/linux-3.1.9/0068-sdhci-bcm2708-raise-DMA-sync-timeout.patch @@ -0,0 +1,29 @@ +From 682bc2a568462089005c32aed2a0d7a2faa59cf8 Mon Sep 17 00:00:00 2001 +From: popcornmix <popcornmix@gmail.com> +Date: Sat, 16 Jun 2012 22:35:38 +0100 +Subject: [PATCH] sdhci-bcm2708: raise DMA sync timeout + +Commit d64b84c by accident reduced the maximum overall DMA sync +timeout. The maximum overall timeout was reduced from 100ms to 30ms, +which isn't enough for many cards. Increase it to 150ms, just to be +extra safe. According to commit 872a8ff in the MMC subsystem, some +cards require crazy long timeouts (3s), but as we're busy-waiting, +and shouldn't delay for such a long time, let's hope 150ms will be +enough for most cards. +--- + drivers/mmc/host/sdhci-bcm2708.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c +index 3beb323..85bf3ce 100644 +--- a/drivers/mmc/host/sdhci-bcm2708.c ++++ b/drivers/mmc/host/sdhci-bcm2708.c +@@ -840,7 +840,7 @@ static void sdhci_bcm2708_dma_complete_irq(struct sdhci_host *host, + We get CRC and DEND errors unless we wait for + the SD controller to finish reading/writing to the card. */ + u32 state_mask; +- int timeout=1000; ++ int timeout=5000; + + DBG("PDMA over - sync card\n"); + if (data->flags & MMC_DATA_READ) diff --git a/patches/linux-3.1.9/0069-Fix-bool-int-error.patch b/patches/linux-3.1.9/0069-Fix-bool-int-error.patch new file mode 100644 index 0000000..a33e076 --- /dev/null +++ b/patches/linux-3.1.9/0069-Fix-bool-int-error.patch @@ -0,0 +1,22 @@ +From 1ccd0107253e1dd14ee78a1e3eb0ed723d8fa595 Mon Sep 17 00:00:00 2001 +From: popcornmix <popcornmix@gmail.com> +Date: Sat, 16 Jun 2012 23:26:28 +0100 +Subject: [PATCH] Fix bool/int error + +--- + drivers/mmc/host/sdhci-bcm2708.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c +index 85bf3ce..eedd724 100644 +--- a/drivers/mmc/host/sdhci-bcm2708.c ++++ b/drivers/mmc/host/sdhci-bcm2708.c +@@ -1492,7 +1492,7 @@ module_init(sdhci_drv_init); + module_exit(sdhci_drv_exit); + + module_param(allow_highspeed, bool, 0444); +-module_param(emmc_clock_freq, bool, 0444); ++module_param(emmc_clock_freq, int, 0444); + + MODULE_DESCRIPTION("Secure Digital Host Controller Interface platform driver"); + MODULE_AUTHOR("Broadcom <info@broadcom.com>"); diff --git a/patches/linux-3.1.9/0070-Fix-bool-int-error-part-2.patch b/patches/linux-3.1.9/0070-Fix-bool-int-error-part-2.patch new file mode 100644 index 0000000..70ca93a --- /dev/null +++ b/patches/linux-3.1.9/0070-Fix-bool-int-error-part-2.patch @@ -0,0 +1,22 @@ +From 6273fcbf72461c2bd3757a8b6c9ed175955b25c1 Mon Sep 17 00:00:00 2001 +From: popcornmix <popcornmix@gmail.com> +Date: Sat, 16 Jun 2012 23:46:08 +0100 +Subject: [PATCH] Fix bool/int error, part 2 + +--- + drivers/mmc/host/sdhci-bcm2708.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/mmc/host/sdhci-bcm2708.c b/drivers/mmc/host/sdhci-bcm2708.c +index eedd724..13abbc9 100644 +--- a/drivers/mmc/host/sdhci-bcm2708.c ++++ b/drivers/mmc/host/sdhci-bcm2708.c +@@ -136,7 +136,7 @@ static inline unsigned long int since_ns(hptime_t t) + } + + static bool allow_highspeed = 1; +-static bool emmc_clock_freq = BCM2708_EMMC_CLOCK_FREQ; ++static int emmc_clock_freq = BCM2708_EMMC_CLOCK_FREQ; + + #if 0 + static void hptime_test(void) diff --git a/patches/linux-3.1.9/0071-More-config-options-for-iptables-device-mapper-PPP_M.patch b/patches/linux-3.1.9/0071-More-config-options-for-iptables-device-mapper-PPP_M.patch new file mode 100644 index 0000000..7a39211 --- /dev/null +++ b/patches/linux-3.1.9/0071-More-config-options-for-iptables-device-mapper-PPP_M.patch @@ -0,0 +1,90 @@ +From 3238b19ecbe0e67258013717511c8f559a88e097 Mon Sep 17 00:00:00 2001 +From: popcornmix <popcornmix@gmail.com> +Date: Sat, 16 Jun 2012 23:49:52 +0100 +Subject: [PATCH] More config options for iptables, device mapper, PPP_MPPE + +--- + arch/arm/configs/bcmrpi_defconfig | 38 +++++++++++++++++++++++++++++++++++-- + 1 file changed, 36 insertions(+), 2 deletions(-) + +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 39ef11f..7754da0 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -160,6 +160,10 @@ CONFIG_IP_NF_FILTER=m + CONFIG_IP_NF_TARGET_REJECT=m + CONFIG_IP_NF_TARGET_LOG=m + CONFIG_IP_NF_TARGET_ULOG=m ++CONFIG_NF_NAT=m ++CONFIG_IP_NF_TARGET_MASQUERADE=m ++CONFIG_IP_NF_TARGET_NETMAP=m ++CONFIG_IP_NF_TARGET_REDIRECT=m + CONFIG_IP_NF_MANGLE=m + CONFIG_IP_NF_TARGET_ECN=m + CONFIG_IP_NF_TARGET_TTL=m +@@ -183,6 +187,29 @@ CONFIG_IP6_NF_FILTER=m + CONFIG_IP6_NF_TARGET_REJECT=m + CONFIG_IP6_NF_MANGLE=m + CONFIG_IP6_NF_RAW=m ++CONFIG_BRIDGE_NF_EBTABLES=m ++CONFIG_BRIDGE_EBT_BROUTE=m ++CONFIG_BRIDGE_EBT_T_FILTER=m ++CONFIG_BRIDGE_EBT_T_NAT=m ++CONFIG_BRIDGE_EBT_802_3=m ++CONFIG_BRIDGE_EBT_AMONG=m ++CONFIG_BRIDGE_EBT_ARP=m ++CONFIG_BRIDGE_EBT_IP=m ++CONFIG_BRIDGE_EBT_IP6=m ++CONFIG_BRIDGE_EBT_LIMIT=m ++CONFIG_BRIDGE_EBT_MARK=m ++CONFIG_BRIDGE_EBT_PKTTYPE=m ++CONFIG_BRIDGE_EBT_STP=m ++CONFIG_BRIDGE_EBT_VLAN=m ++CONFIG_BRIDGE_EBT_ARPREPLY=m ++CONFIG_BRIDGE_EBT_DNAT=m ++CONFIG_BRIDGE_EBT_MARK_T=m ++CONFIG_BRIDGE_EBT_REDIRECT=m ++CONFIG_BRIDGE_EBT_SNAT=m ++CONFIG_BRIDGE_EBT_LOG=m ++CONFIG_BRIDGE_EBT_ULOG=m ++CONFIG_BRIDGE_EBT_NFLOG=m ++CONFIG_BRIDGE=m + CONFIG_NET_PKTGEN=m + CONFIG_IRDA=m + CONFIG_IRLAN=m +@@ -224,7 +251,6 @@ CONFIG_NET_9P=m + CONFIG_NFC=m + CONFIG_NFC_PN533=m + CONFIG_DEVTMPFS=y +-CONFIG_CONNECTOR=m + CONFIG_BLK_DEV_LOOP=y + CONFIG_BLK_DEV_CRYPTOLOOP=m + CONFIG_BLK_DEV_NBD=m +@@ -238,6 +264,14 @@ CONFIG_BLK_DEV_SR=m + CONFIG_SCSI_MULTI_LUN=y + # CONFIG_SCSI_LOWLEVEL is not set + CONFIG_MD=y ++CONFIG_BLK_DEV_DM=m ++CONFIG_DM_CRYPT=m ++CONFIG_DM_SNAPSHOT=m ++CONFIG_DM_MIRROR=m ++CONFIG_DM_RAID=m ++CONFIG_DM_LOG_USERSPACE=m ++CONFIG_DM_ZERO=m ++CONFIG_DM_DELAY=m + CONFIG_NETDEVICES=y + CONFIG_TUN=m + CONFIG_PHYLIB=m +@@ -309,6 +343,7 @@ CONFIG_PPP_ASYNC=m + CONFIG_PPP_SYNC_TTY=m + CONFIG_PPP_DEFLATE=m + CONFIG_PPP_BSDCOMP=m ++CONFIG_PPP_MPPE=m + CONFIG_PPPOE=m + CONFIG_SLIP=m + CONFIG_SLIP_COMPRESSED=y +@@ -720,4 +755,3 @@ CONFIG_CRYPTO_DEFLATE=m + # CONFIG_CRYPTO_HW is not set + CONFIG_CRC_ITU_T=y + CONFIG_LIBCRC32C=y +- diff --git a/patches/linux-3.1.9/0072-Explicitly-set-usb-host-channels-to-8-as-in-the-spec.patch b/patches/linux-3.1.9/0072-Explicitly-set-usb-host-channels-to-8-as-in-the-spec.patch new file mode 100644 index 0000000..80a0b7d --- /dev/null +++ b/patches/linux-3.1.9/0072-Explicitly-set-usb-host-channels-to-8-as-in-the-spec.patch @@ -0,0 +1,23 @@ +From 3fc65f9f291fb19cad434968a4a0f66ab749e637 Mon Sep 17 00:00:00 2001 +From: popcornmix <popcornmix@gmail.com> +Date: Sun, 17 Jun 2012 00:14:54 +0100 +Subject: [PATCH] Explicitly set usb host channels to 8, as in the spec + +--- + drivers/usb/host/dwc_otg/dwc_otg_core_if.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_core_if.h b/drivers/usb/host/dwc_otg/dwc_otg_core_if.h +index 4a78b03..25aae5e 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_core_if.h ++++ b/drivers/usb/host/dwc_otg/dwc_otg_core_if.h +@@ -267,7 +267,8 @@ extern int32_t dwc_otg_get_param_max_packet_count(dwc_otg_core_if_t * core_if); + extern int dwc_otg_set_param_host_channels(dwc_otg_core_if_t * core_if, + int32_t val); + extern int32_t dwc_otg_get_param_host_channels(dwc_otg_core_if_t * core_if); +-#define dwc_param_host_channels_default 12 ++//#define dwc_param_host_channels_default 12 ++#define dwc_param_host_channels_default 8// Broadcom BCM2708 + + /** The number of endpoints in addition to EP0 available for device + * mode operations. diff --git a/patches/linux-3.1.9/series b/patches/linux-3.1.9/series index 6f6e61b..ff54335 100644 --- a/patches/linux-3.1.9/series +++ b/patches/linux-3.1.9/series @@ -55,3 +55,18 @@ 0055-bcm2835-ctl-fix-alsamixer-control.patch 0056-bcm2835-ctl-limit-maximal-volume-to-4db.patch 0057-Add-iptables-and-devtmpfs_mount-to-non-cutdown-confi.patch +0058-mmc-sd-Handle-SD3.0-cards-not-supporting-UHS-I-bus-s.patch +0059-mmc-use-really-long-write-timeout-to-deal-with-crapp.patch +0060-mmc-core-Set-correct-bus-mode-before-card-init.patch +0061-mmc-core-Add-quirk-for-long-data-read-time.patch +0062-sdhci-bcm2708-speed-up-DMA-sync.patch +0063-sdhci-bcm2708-remove-custom-clock-handling.patch +0064-sdhci-bcm2708-add-additional-quirks.patch +0065-sdhci-bcm2708-add-allow_highspeed-parameter.patch +0066-sdhci-bcm2708-assume-50-MHz-eMMC-clock.patch +0067-Allow-emmc-clock-to-be-specified-as-command-line-par.patch +0068-sdhci-bcm2708-raise-DMA-sync-timeout.patch +0069-Fix-bool-int-error.patch +0070-Fix-bool-int-error-part-2.patch +0071-More-config-options-for-iptables-device-mapper-PPP_M.patch +0072-Explicitly-set-usb-host-channels-to-8-as-in-the-spec.patch |