[Armadeus-commitlog] SF.net SVN: armadeus:[1038] trunk/buildroot/target/device/armadeus/linux/ kern
Brought to you by:
sszy
|
From: <ar...@us...> - 2009-01-30 08:26:59
|
Revision: 1038
http://armadeus.svn.sourceforge.net/armadeus/?rev=1038&view=rev
Author: artemys
Date: 2009-01-30 08:26:56 +0000 (Fri, 30 Jan 2009)
Log Message:
-----------
[LINUX] Reorg of imxmmc patches
Modified Paths:
--------------
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-040-armadeus-imx_mmc.patch
Added Paths:
-----------
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-040-armadeus-imxmmc-add_controller_driven_card_detection.patch
trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-040-armadeus-imxmmc-correct_some_freezes.patch
Modified: trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-040-armadeus-imx_mmc.patch
===================================================================
--- trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-040-armadeus-imx_mmc.patch 2009-01-29 16:30:28 UTC (rev 1037)
+++ trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-040-armadeus-imx_mmc.patch 2009-01-30 08:26:56 UTC (rev 1038)
@@ -23,77 +23,3 @@
}
EXPORT_SYMBOL(imx_set_mmc_info);
---- linux-org/drivers/mmc/host/imxmmc.c 2006-10-20 00:13:38.000000000 +0200
-+++ linux-imx/drivers/mmc/host/imxmmc.c 2006-10-20 00:05:56.000000000 +0200
-@@ -901,6 +901,25 @@ static int platform_device_irq(struct pl
- return NO_IRQ;
- }
-
-+static int imxmci_card_present(void)
-+{
-+ static int lsCurrentState = 1;
-+ static int lsTrials = 3;
-+ int lSampleState = (MMC_STATUS & STATUS_CARD_PRESENCE)?1:0;
-+
-+ if (!(MMC_STATUS & STATUS_CARD_BUS_CLK_RUN)
-+ && (lSampleState != lsCurrentState)) {
-+ if (0 == --lsTrials) {
-+ lsCurrentState = lSampleState;
-+ lsTrials = 3;
-+ }
-+ } else {
-+ lsTrials = 3;
-+ }
-+
-+ return(lsCurrentState);
-+}
-+
- static void imxmci_check_status(unsigned long data)
- {
- struct imxmci_host *host = (struct imxmci_host *)data;
-@@ -1022,6 +1041,9 @@ static int imxmci_probe(struct platform_
- ret = request_irq(host->irq, imxmci_irq, 0, DRIVER_NAME, host);
- if (ret)
- goto out;
-+
-+ if (!host->pdata->card_present)
-+ host->pdata->card_present = imxmci_card_present;
-
- host->present = host->pdata->card_present();
- init_timer(&host->timer);
---- linux-org/arch/arm/mach-imx/include/mach/imx-regs.h 2006-10-20 00:13:49.000000000 +0200
-+++ linux-imx/arch/arm/mach-imx/include/mach/imx-regs.h 2006-10-18 22:47:19.000000000 +0200
-@@ -166,7 +166,7 @@
- #define PB9_AF_MS_PI1 ( GPIO_PORTB | GPIO_AF | 9 )
- #define PB10_PF_SD_DAT2 ( GPIO_PORTB | GPIO_PF | GPIO_PUEN | 10 )
- #define PB10_AF_MS_SCLKI ( GPIO_PORTB | GPIO_AF | 10 )
--#define PB11_PF_SD_DAT3 ( GPIO_PORTB | GPIO_PF | 11 )
-+#define PB11_PF_SD_DAT3 ( GPIO_PORTB | GPIO_PF | GPIO_PUEN | 11 )
- #define PB11_AF_MS_SDIO ( GPIO_PORTB | GPIO_AF | 11 )
- #define PB12_PF_SD_CLK ( GPIO_PORTB | GPIO_PF | 12 )
- #define PB12_AF_MS_SCLK0 ( GPIO_PORTB | GPIO_AF | 12 )
---- linux-org/drivers/mmc/host/imxmmc.c 2008-01-28 17:36:24.000000000 +0100
-+++ linux-imx/drivers/mmc/host/imxmmc.c 2008-01-28 17:36:47.000000000 +0100
-@@ -217,7 +217,7 @@ static int imxmci_busy_wait_for_status(s
-
- /* The busy-wait is expected there for clock <8MHz due to SDHC hardware flaws */
- if(!(stat_mask & STATUS_END_CMD_RESP) || (host->mmc->ios.clock>=8000000))
-- dev_info(mmc_dev(host->mmc), "busy wait for %d usec in %s, STATUS = 0x%x (0x%x)\n",
-+ dev_dbg(mmc_dev(host->mmc), "busy wait for %d usec in %s, STATUS = 0x%x (0x%x)\n",
- loops, where, *pstat, stat_mask);
- return loops;
- }
---- linux-org/drivers/mmc/host/imxmmc.c 2008-06-02 04:25:41.000000000 +0200
-+++ linux-imx/drivers/mmc/host/imxmmc.c 2008-06-02 04:22:21.000000000 +0200
-@@ -333,6 +333,12 @@ static void imxmci_start_cmd(struct imxm
- /* Ensure, that clock are stopped else command programming and start fails */
- imxmci_stop_clock(host);
-
-+ /*force check of busy bit DO after CMD25 + CMD12
-+ to avoid hang up of the controler */
-+ if( cmd->opcode == 13){
-+ cmdat |= CMD_DAT_CONT_BUSY;
-+ }
-+
- if (cmd->flags & MMC_RSP_BUSY)
- cmdat |= CMD_DAT_CONT_BUSY;
Added: trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-040-armadeus-imxmmc-add_controller_driven_card_detection.patch
===================================================================
--- trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-040-armadeus-imxmmc-add_controller_driven_card_detection.patch (rev 0)
+++ trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-040-armadeus-imxmmc-add_controller_driven_card_detection.patch 2009-01-30 08:26:56 UTC (rev 1038)
@@ -0,0 +1,63 @@
+
+i.MXL MMC controller has a built-in card detection. This patch makes it
+available for the one who doesn't want to sacrifice a GPIO to do that.
+
+Detection relies on SD_DAT3 pin being pulled high when a card is
+inserted. So chip's internal pull-down resistor is activated to have
+this pin low by default (recommended by MMC specs in any case).
+
+Signed-off-by: Julien Boibessot <jul...@ar...>
+Signed-off-by: Eric Jarrige <jo...@ar...>
+
+--- linux-org/drivers/mmc/host/imxmmc.c
++++ linux-imx/drivers/mmc/host/imxmmc.c
+@@ -901,6 +901,27 @@
+ .get_ro = imxmci_get_ro,
+ };
+
++/* Controller built-in card detection */
++static int imxmci_card_present(void)
++{
++ static int current_state = 1;
++ static int nb_trials = 3;
++ int new_state = (MMC_STATUS & STATUS_CARD_PRESENCE) ? 1 : 0;
++
++ /* Take state into account only if data are not being transmitted */
++ if (!(MMC_STATUS & STATUS_CARD_BUS_CLK_RUN)
++ && (new_state != current_state)) {
++ if (0 == --nb_trials) {
++ current_state = new_state;
++ nb_trials = 3;
++ }
++ } else {
++ nb_trials = 3;
++ }
++
++ return current_state;
++}
++
+ static void imxmci_check_status(unsigned long data)
+ {
+ struct imxmci_host *host = (struct imxmci_host *)data;
+@@ -1022,6 +1041,10 @@
+ ret = request_irq(host->irq, imxmci_irq, 0, DRIVER_NAME, host);
+ if (ret)
+ goto out;
++
++ /* If no way of detecting card is given, use built-in method */
++ if (!host->pdata->card_present)
++ host->pdata->card_present = imxmci_card_present;
+
+ if (host->pdata && host->pdata->card_present)
+ host->present = host->pdata->card_present(mmc_dev(mmc));
+--- linux-org/arch/arm/mach-imx/include/mach/imx-regs.h
++++ linux-imx/arch/arm/mach-imx/include/mach/imx-regs.h
+@@ -172,7 +172,7 @@
+ #define PB9_AF_MS_PI1 ( GPIO_PORTB | GPIO_AF | 9 )
+ #define PB10_PF_SD_DAT2 ( GPIO_PORTB | GPIO_PF | GPIO_PUEN | 10 )
+ #define PB10_AF_MS_SCLKI ( GPIO_PORTB | GPIO_AF | 10 )
+-#define PB11_PF_SD_DAT3 ( GPIO_PORTB | GPIO_PF | 11 )
++#define PB11_PF_SD_DAT3 ( GPIO_PORTB | GPIO_PF | GPIO_PUEN | 11 )
+ #define PB11_AF_MS_SDIO ( GPIO_PORTB | GPIO_AF | 11 )
+ #define PB12_PF_SD_CLK ( GPIO_PORTB | GPIO_PF | 12 )
+ #define PB12_AF_MS_SCLK0 ( GPIO_PORTB | GPIO_AF | 12 )
Added: trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-040-armadeus-imxmmc-correct_some_freezes.patch
===================================================================
--- trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-040-armadeus-imxmmc-correct_some_freezes.patch (rev 0)
+++ trunk/buildroot/target/device/armadeus/linux/kernel-patches/2.6.27.2/linux-2.6.27.2-040-armadeus-imxmmc-correct_some_freezes.patch 2009-01-30 08:26:56 UTC (rev 1038)
@@ -0,0 +1,25 @@
+--- linux-org/drivers/mmc/host/imxmmc.c
++++ linux-imx/drivers/mmc/host/imxmmc.c
+@@ -217,7 +217,7 @@ static int imxmci_busy_wait_for_status(s
+
+ /* The busy-wait is expected there for clock <8MHz due to SDHC hardware flaws */
+ if(!(stat_mask & STATUS_END_CMD_RESP) || (host->mmc->ios.clock>=8000000))
+- dev_info(mmc_dev(host->mmc), "busy wait for %d usec in %s, STATUS = 0x%x (0x%x)\n",
++ dev_dbg(mmc_dev(host->mmc), "busy wait for %d usec in %s, STATUS = 0x%x (0x%x)\n",
+ loops, where, *pstat, stat_mask);
+ return loops;
+ }
+--- linux-org/drivers/mmc/host/imxmmc.c
++++ linux-imx/drivers/mmc/host/imxmmc.c
+@@ -333,6 +333,12 @@ static void imxmci_start_cmd(struct imxm
+ /* Ensure, that clock are stopped else command programming and start fails */
+ imxmci_stop_clock(host);
+
++ /*force check of busy bit DO after CMD25 + CMD12
++ to avoid hang up of the controler */
++ if( cmd->opcode == 13){
++ cmdat |= CMD_DAT_CONT_BUSY;
++ }
++
+ if (cmd->flags & MMC_RSP_BUSY)
+ cmdat |= CMD_DAT_CONT_BUSY;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|