[Armadeus-commitlog] armadeus branch, master, updated. armadeus-5.3-109-g92141db
Brought to you by:
sszy
|
From: Sébastien S. <ss...@us...> - 2014-02-12 10:46:24
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 92141dbb6c8dbcca2295da1eed25cbfeb23c7d1e (commit)
via 4d0e97cefca41f71cc69f041e41708cb30dec637 (commit)
via 9df038bc50b9673d63175baff6c0f91ea349674a (commit)
from 36e7f11158f76025d90f70ec386339f76859357a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 92141dbb6c8dbcca2295da1eed25cbfeb23c7d1e
Author: Sébastien Szymanski <ss...@us...>
Date: Wed Feb 12 11:46:31 2014 +0100
[BUILDROOT] apf6: add apf6failsafe_defconfig
commit 4d0e97cefca41f71cc69f041e41708cb30dec637
Author: Sébastien Szymanski <ss...@us...>
Date: Wed Feb 12 11:40:28 2014 +0100
[LINUX] 3.14: mmc: sdhci: a few fixes on timeout and max_discard_to
These patches are from Dong Aisheng, see [1].
[1] http://comments.gmane.org/gmane.linux.kernel.mmc/24182
commit 9df038bc50b9673d63175baff6c0f91ea349674a
Author: Sébastien Szymanski <ss...@us...>
Date: Wed Feb 12 11:12:37 2014 +0100
[BUILDROOT] apf6: Fix CONFIG_CMDLINE default value.
-----------------------------------------------------------------------
Summary of changes:
.../{apf6_defconfig => apf6failsafe_defconfig} | 18 +---
.../device/armadeus/apf6/apf6-linux-3.14.config | 2 +-
.../apf6/apf6failsafe-linux-3.14-rc2.config | 1 +
...-3.14.config => apf6failsafe-linux-3.14.config} | 62 ++--------
...i-add-platfrom-get_max_timeout_count-hook.patch | 59 ++++++++++
...mx-fix-incorrect-max_discard_to-for-uSDHC.patch | 54 +++++++++
...5-mmc-sdhci-add-platform-set_timeout-hook.patch | 84 +++++++++++++
...t-the-correct-max-timeout-value-for-uSDHC.patch | 62 ++++++++++
...y-for-SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK.patch | 123 ++++++++++++++++++++
9 files changed, 398 insertions(+), 67 deletions(-)
copy buildroot/configs/{apf6_defconfig => apf6failsafe_defconfig} (66%)
create mode 120000 buildroot/target/device/armadeus/apf6/apf6failsafe-linux-3.14-rc2.config
copy buildroot/target/device/armadeus/apf6/{apf6-linux-3.14.config => apf6failsafe-linux-3.14.config} (83%)
create mode 100644 patches/linux/3.14/0498-v2-1-5-mmc-sdhci-add-platfrom-get_max_timeout_count-hook.patch
create mode 100644 patches/linux/3.14/0499-v2-2-5-mmc-sdhci-esdhc-imx-fix-incorrect-max_discard_to-for-uSDHC.patch
create mode 100644 patches/linux/3.14/0500-v2-3-5-mmc-sdhci-add-platform-set_timeout-hook.patch
create mode 100644 patches/linux/3.14/0501-v2-4-5-mmc-sdhci-esdhc-imx-set-the-correct-max-timeout-value-for-uSDHC.patch
create mode 100644 patches/linux/3.14/0502-v2-5-5-mmc-sdhci-calculate-max_discard_to-dynamically-for-SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK.patch
diff --git a/buildroot/configs/apf6_defconfig b/buildroot/configs/apf6failsafe_defconfig
similarity index 66%
copy from buildroot/configs/apf6_defconfig
copy to buildroot/configs/apf6failsafe_defconfig
index f289b14..f01081a 100644
--- a/buildroot/configs/apf6_defconfig
+++ b/buildroot/configs/apf6failsafe_defconfig
@@ -1,7 +1,6 @@
BR2_arm=y
BR2_cortex_a9=y
BR2_TOOLCHAIN_EXTERNAL=y
-BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM201305=y
BR2_TARGET_GENERIC_HOSTNAME="apf6"
BR2_TARGET_GENERIC_ISSUE="Welcome to Armadeus development platform !"
BR2_TARGET_GENERIC_GETTY_PORT="ttymxc3"
@@ -15,25 +14,16 @@ BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="3.14-rc2"
BR2_LINUX_KERNEL_PATCH="../patches/linux/$(BR2_LINUX_KERNEL_VERSION)"
BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
-BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME)-linux-$(BR2_LINUX_KERNEL_VERSION).config"
+BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="$(BR2_BOARD_PATH)/$(BR2_BOARD_NAME)failsafe-linux-$(BR2_LINUX_KERNEL_VERSION).config"
BR2_LINUX_KERNEL_ZIMAGE=y
BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx6q-apf6dev imx6dl-apf6dev"
-BR2_LINUX_KERNEL_INSTALL_TARGET=y
BR2_PACKAGE_E2FSPROGS=y
-BR2_PACKAGE_LINUX_FIRMWARE=y
-BR2_PACKAGE_LINUX_FIRMWARE_TI_WL127X=y
BR2_PACKAGE_MMC_UTILS=y
-BR2_PACKAGE_TI_UTILS=y
-BR2_PACKAGE_TSLIB=y
-BR2_PACKAGE_BLUEZ_UTILS=y
-BR2_PACKAGE_DROPBEAR=y
-BR2_PACKAGE_IW=y
-BR2_PACKAGE_WIRELESS_TOOLS=y
-BR2_PACKAGE_WPA_SUPPLICANT=y
-BR2_PACKAGE_WPA_SUPPLICANT_CLI=y
-BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE=y
BR2_PACKAGE_UTIL_LINUX_BINARIES=y
BR2_PACKAGE_UTIL_LINUX_FSCK=y
+BR2_TARGET_ROOTFS_CPIO=y
+BR2_TARGET_ROOTFS_CPIO_GZIP=y
+BR2_TARGET_ROOTFS_CPIO_UIMAGE=y
BR2_TARGET_ROOTFS_EXT2=y
BR2_TARGET_ROOTFS_EXT2_4=y
diff --git a/buildroot/target/device/armadeus/apf6/apf6-linux-3.14.config b/buildroot/target/device/armadeus/apf6/apf6-linux-3.14.config
index eea7d0a..10b243d 100644
--- a/buildroot/target/device/armadeus/apf6/apf6-linux-3.14.config
+++ b/buildroot/target/device/armadeus/apf6/apf6-linux-3.14.config
@@ -43,7 +43,7 @@ CONFIG_SMP=y
CONFIG_VMSPLIT_2G=y
CONFIG_PREEMPT_VOLUNTARY=y
CONFIG_AEABI=y
-CONFIG_CMDLINE="noinitrd console=ttymxc0,115200"
+CONFIG_CMDLINE="noinitrd console=ttymxc3,115200"
CONFIG_VFP=y
CONFIG_NEON=y
CONFIG_BINFMT_MISC=m
diff --git a/buildroot/target/device/armadeus/apf6/apf6failsafe-linux-3.14-rc2.config b/buildroot/target/device/armadeus/apf6/apf6failsafe-linux-3.14-rc2.config
new file mode 120000
index 0000000..b23fbcc
--- /dev/null
+++ b/buildroot/target/device/armadeus/apf6/apf6failsafe-linux-3.14-rc2.config
@@ -0,0 +1 @@
+apf6failsafe-linux-3.14.config
\ No newline at end of file
diff --git a/buildroot/target/device/armadeus/apf6/apf6-linux-3.14.config b/buildroot/target/device/armadeus/apf6/apf6failsafe-linux-3.14.config
similarity index 83%
copy from buildroot/target/device/armadeus/apf6/apf6-linux-3.14.config
copy to buildroot/target/device/armadeus/apf6/apf6failsafe-linux-3.14.config
index eea7d0a..f330375 100644
--- a/buildroot/target/device/armadeus/apf6/apf6-linux-3.14.config
+++ b/buildroot/target/device/armadeus/apf6/apf6failsafe-linux-3.14.config
@@ -37,13 +37,11 @@ CONFIG_SOC_IMX53=y
CONFIG_SOC_IMX6Q=y
CONFIG_SOC_IMX6SL=y
CONFIG_SOC_VF610=y
-CONFIG_PCI=y
-CONFIG_PCI_IMX6=y
CONFIG_SMP=y
CONFIG_VMSPLIT_2G=y
CONFIG_PREEMPT_VOLUNTARY=y
CONFIG_AEABI=y
-CONFIG_CMDLINE="noinitrd console=ttymxc0,115200"
+CONFIG_CMDLINE="noinitrd console=ttymxc3,115200"
CONFIG_VFP=y
CONFIG_NEON=y
CONFIG_BINFMT_MISC=m
@@ -62,20 +60,7 @@ CONFIG_IP_PNP_DHCP=y
# CONFIG_INET_LRO is not set
CONFIG_IPV6=y
CONFIG_NETFILTER=y
-CONFIG_BT=m
-CONFIG_BT_RFCOMM=m
-CONFIG_BT_RFCOMM_TTY=y
-CONFIG_BT_BNEP=m
-CONFIG_BT_HIDP=m
-CONFIG_BT_HCIBTSDIO=m
-CONFIG_BT_HCIUART=m
-CONFIG_BT_HCIUART_H4=y
-CONFIG_BT_HCIUART_BCSP=y
-CONFIG_BT_HCIUART_LL=y
-CONFIG_CFG80211=y
-CONFIG_NL80211_TESTMODE=y
-CONFIG_CFG80211_WEXT=y
-CONFIG_MAC80211=y
+# CONFIG_WIRELESS is not set
CONFIG_RFKILL=y
CONFIG_RFKILL_INPUT=y
CONFIG_DEVTMPFS=y
@@ -130,10 +115,7 @@ CONFIG_SMC91X=y
CONFIG_SMC911X=y
CONFIG_SMSC911X=y
# CONFIG_NET_VENDOR_STMICRO is not set
-# CONFIG_RTL_CARDS is not set
-CONFIG_WL_TI=y
-CONFIG_WL12XX=m
-CONFIG_WLCORE_SDIO=m
+# CONFIG_WLAN is not set
# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
CONFIG_INPUT_EVDEV=y
CONFIG_INPUT_EVBUG=m
@@ -178,33 +160,16 @@ CONFIG_REGULATOR_ANATOP=y
CONFIG_REGULATOR_DA9052=y
CONFIG_REGULATOR_MC13783=y
CONFIG_REGULATOR_MC13892=y
-CONFIG_MEDIA_SUPPORT=y
-CONFIG_MEDIA_CAMERA_SUPPORT=y
-CONFIG_V4L_PLATFORM_DRIVERS=y
-CONFIG_SOC_CAMERA=y
-CONFIG_VIDEO_MX3=y
-CONFIG_V4L_MEM2MEM_DRIVERS=y
-CONFIG_VIDEO_CODA=y
-CONFIG_SOC_CAMERA_OV2640=y
CONFIG_DRM=y
+CONFIG_FB=y
CONFIG_BACKLIGHT_LCD_SUPPORT=y
CONFIG_LCD_CLASS_DEVICE=y
CONFIG_LCD_L4F00242T03=y
CONFIG_LCD_PLATFORM=y
CONFIG_BACKLIGHT_CLASS_DEVICE=y
-CONFIG_BACKLIGHT_PWM=y
CONFIG_FRAMEBUFFER_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
CONFIG_LOGO=y
-CONFIG_SOUND=y
-CONFIG_SND=y
-CONFIG_SND_SOC=y
-CONFIG_SND_IMX_SOC=y
-CONFIG_SND_SOC_PHYCORE_AC97=y
-CONFIG_SND_SOC_EUKREA_TLV320=y
-CONFIG_SND_SOC_IMX_WM8962=y
-CONFIG_SND_SOC_IMX_SGTL5000=y
-CONFIG_SND_SOC_IMX_SPDIF=y
-CONFIG_SND_SOC_IMX_MC13783=y
CONFIG_USB=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_MXC=y
@@ -238,18 +203,7 @@ CONFIG_RTC_DRV_SNVS=y
CONFIG_DMADEVICES=y
CONFIG_IMX_SDMA=y
CONFIG_MXS_DMA=y
-CONFIG_STAGING=y
-CONFIG_DRM_IMX=y
-CONFIG_DRM_IMX_FB_HELPER=y
-CONFIG_DRM_IMX_PARALLEL_DISPLAY=y
-CONFIG_DRM_IMX_TVE=y
-CONFIG_DRM_IMX_LDB=y
-CONFIG_DRM_IMX_IPUV3_CORE=y
-CONFIG_DRM_IMX_IPUV3=y
-CONFIG_DRM_IMX_HDMI=y
# CONFIG_IOMMU_SUPPORT is not set
-CONFIG_PWM=y
-CONFIG_PWM_IMX=y
CONFIG_EXT2_FS=y
CONFIG_EXT2_FS_XATTR=y
CONFIG_EXT2_FS_POSIX_ACL=y
@@ -291,13 +245,17 @@ CONFIG_PROVE_LOCKING=y
# CONFIG_FTRACE is not set
# CONFIG_ARM_UNWIND is not set
CONFIG_SECURITYFS=y
+CONFIG_CRYPTO_CCM=y
+CONFIG_CRYPTO_ECB=m
+CONFIG_CRYPTO_SHA256=m
+CONFIG_CRYPTO_ARC4=y
# CONFIG_CRYPTO_ANSI_CPRNG is not set
# CONFIG_CRYPTO_HW is not set
CONFIG_CRC_CCITT=m
CONFIG_CRC_T10DIF=y
CONFIG_CRC7=m
CONFIG_LIBCRC32C=m
+CONFIG_AVERAGE=y
CONFIG_FONTS=y
CONFIG_FONT_8x8=y
CONFIG_FONT_8x16=y
-
diff --git a/patches/linux/3.14/0498-v2-1-5-mmc-sdhci-add-platfrom-get_max_timeout_count-hook.patch b/patches/linux/3.14/0498-v2-1-5-mmc-sdhci-add-platfrom-get_max_timeout_count-hook.patch
new file mode 100644
index 0000000..f72b70a
--- /dev/null
+++ b/patches/linux/3.14/0498-v2-1-5-mmc-sdhci-add-platfrom-get_max_timeout_count-hook.patch
@@ -0,0 +1,59 @@
+From patchwork Tue Dec 17 08:16:27 2013
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v2,1/5] mmc: sdhci: add platfrom get_max_timeout_count hook
+From: Aisheng Dong <b2...@fr...>
+X-Patchwork-Id: 3359651
+Message-Id: <138...@fr...>
+To: <lin...@vg...>
+Cc: ulf...@li..., sha...@li...,
+ ed....@al...,
+ s....@pe..., adr...@in...,
+ vla...@me..., cj...@la..., b2...@fr...,
+ lin...@li...
+Date: Tue, 17 Dec 2013 16:16:27 +0800
+
+Currently the max_discard_to is simply got by (1 << 27) / host->timeout_clk
+which is assumed to be the maximum timeout value, however, some platforms
+maximum timeout counter may not be 1 << 27, e.g. i.MX uSDHC is 1 << 28.
+Thus 1 << 27 may not be correct for such platforms.
+
+It is also possible that other platforms may have different problems.
+To be flexible, we add a get_max_timeout_count hook to get the correct
+maximum timeout value for these platforms.
+
+Signed-off-by: Dong Aisheng <b2...@fr...>
+
+---
+drivers/mmc/host/sdhci.c | 4 +++-
+ drivers/mmc/host/sdhci.h | 1 +
+ 2 files changed, 4 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
+index cc00bed..7fef3bb 100644
+--- a/drivers/mmc/host/sdhci.c
++++ b/drivers/mmc/host/sdhci.c
+@@ -2942,7 +2942,9 @@ int sdhci_add_host(struct sdhci_host *host)
+ if (host->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK)
+ host->timeout_clk = mmc->f_max / 1000;
+
+- mmc->max_discard_to = (1 << 27) / host->timeout_clk;
++ mmc->max_discard_to = host->ops->get_max_timeout_count ?
++ host->ops->get_max_timeout_count(host) : 1 << 27;
++ mmc->max_discard_to /= host->timeout_clk;
+
+ mmc->caps |= MMC_CAP_SDIO_IRQ | MMC_CAP_ERASE | MMC_CAP_CMD23;
+
+diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
+index 0a3ed01..acba9a7 100644
+--- a/drivers/mmc/host/sdhci.h
++++ b/drivers/mmc/host/sdhci.h
+@@ -281,6 +281,7 @@ struct sdhci_ops {
+ unsigned int (*get_max_clock)(struct sdhci_host *host);
+ unsigned int (*get_min_clock)(struct sdhci_host *host);
+ unsigned int (*get_timeout_clock)(struct sdhci_host *host);
++ unsigned int (*get_max_timeout_count)(struct sdhci_host *host);
+ int (*platform_bus_width)(struct sdhci_host *host,
+ int width);
+ void (*platform_send_init_74_clocks)(struct sdhci_host *host,
diff --git a/patches/linux/3.14/0499-v2-2-5-mmc-sdhci-esdhc-imx-fix-incorrect-max_discard_to-for-uSDHC.patch b/patches/linux/3.14/0499-v2-2-5-mmc-sdhci-esdhc-imx-fix-incorrect-max_discard_to-for-uSDHC.patch
new file mode 100644
index 0000000..b04b849
--- /dev/null
+++ b/patches/linux/3.14/0499-v2-2-5-mmc-sdhci-esdhc-imx-fix-incorrect-max_discard_to-for-uSDHC.patch
@@ -0,0 +1,54 @@
+From patchwork Tue Dec 17 08:16:28 2013
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v2, 2/5] mmc: sdhci-esdhc-imx: fix incorrect max_discard_to for uSDHC
+From: Aisheng Dong <b2...@fr...>
+X-Patchwork-Id: 3359661
+Message-Id: <138...@fr...>
+To: <lin...@vg...>
+Cc: ulf...@li..., sha...@li...,
+ ed....@al...,
+ s....@pe..., adr...@in...,
+ vla...@me..., cj...@la..., b2...@fr...,
+ lin...@li...
+Date: Tue, 17 Dec 2013 16:16:28 +0800
+
+The default sdhci code use the 1 << 27 as the max timeout counter to
+to calculate the max_discard_to, however it's not correct for uSDHC
+since its the max counter is 1 << 28.
+Implement esdhc_get_max_timeout to handle it correctly.
+
+Signed-off-by: Dong Aisheng <b2...@fr...>
+
+---
+drivers/mmc/host/sdhci-esdhc-imx.c | 9 +++++++++
+ 1 files changed, 9 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
+index de2655e..5d9b56d 100644
+--- a/drivers/mmc/host/sdhci-esdhc-imx.c
++++ b/drivers/mmc/host/sdhci-esdhc-imx.c
+@@ -880,6 +880,14 @@ static int esdhc_set_uhs_signaling(struct sdhci_host *host, unsigned int uhs)
+ return esdhc_change_pinstate(host, uhs);
+ }
+
++static unsigned int esdhc_get_max_timeout_count(struct sdhci_host *host)
++{
++ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
++ struct pltfm_imx_data *imx_data = pltfm_host->priv;
++
++ return esdhc_is_usdhc(imx_data) ? 1 << 28 : 1 << 27;
++}
++
+ static struct sdhci_ops sdhci_esdhc_ops = {
+ .read_l = esdhc_readl_le,
+ .read_w = esdhc_readw_le,
+@@ -892,6 +900,7 @@ static struct sdhci_ops sdhci_esdhc_ops = {
+ .get_ro = esdhc_pltfm_get_ro,
+ .platform_bus_width = esdhc_pltfm_bus_width,
+ .set_uhs_signaling = esdhc_set_uhs_signaling,
++ .get_max_timeout_count = esdhc_get_max_timeout_count,
+ };
+
+ static const struct sdhci_pltfm_data sdhci_esdhc_imx_pdata = {
diff --git a/patches/linux/3.14/0500-v2-3-5-mmc-sdhci-add-platform-set_timeout-hook.patch b/patches/linux/3.14/0500-v2-3-5-mmc-sdhci-add-platform-set_timeout-hook.patch
new file mode 100644
index 0000000..916f8af
--- /dev/null
+++ b/patches/linux/3.14/0500-v2-3-5-mmc-sdhci-add-platform-set_timeout-hook.patch
@@ -0,0 +1,84 @@
+From patchwork Tue Dec 17 08:16:29 2013
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v2,3/5] mmc: sdhci: add platform set_timeout hook
+From: Aisheng Dong <b2...@fr...>
+X-Patchwork-Id: 3359671
+Message-Id: <138...@fr...>
+To: <lin...@vg...>
+Cc: ulf...@li..., sha...@li...,
+ ed....@al...,
+ s....@pe..., adr...@in...,
+ vla...@me..., cj...@la..., b2...@fr...,
+ lin...@li...
+Date: Tue, 17 Dec 2013 16:16:29 +0800
+
+Currently the common code assume 0xE is the maximum timeout counter
+value and use it to write into the timeout counter register.
+However, it's fairly possible that some other SoCs may have different
+max timeout register value. That means 0xE may be incorrect and
+becomes meaningless.
+
+It's also possible that other platforms has different timeout
+calculation algorithm. To be flexible, this patch provides a .set_timeout
+hook for those platforms to set the timeout on their way if they need.
+
+Signed-off-by: Dong Aisheng <b2...@fr...>
+
+---
+drivers/mmc/host/sdhci.c | 19 ++++++++++++++-----
+ drivers/mmc/host/sdhci.h | 2 ++
+ 2 files changed, 16 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
+index 7fef3bb..47ecf50 100644
+--- a/drivers/mmc/host/sdhci.c
++++ b/drivers/mmc/host/sdhci.c
+@@ -726,19 +726,28 @@ static void sdhci_set_transfer_irqs(struct sdhci_host *host)
+ sdhci_clear_set_irqs(host, dma_irqs, pio_irqs);
+ }
+
+-static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd)
++static void sdhci_set_timeout(struct sdhci_host *host, struct mmc_command *cmd)
+ {
+ u8 count;
++
++ if (host->ops->set_timeout) {
++ host->ops->set_timeout(host, cmd);
++ } else {
++ count = sdhci_calc_timeout(host, cmd);
++ sdhci_writeb(host, count, SDHCI_TIMEOUT_CONTROL);
++ }
++}
++
++static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_command *cmd)
++{
+ u8 ctrl;
+ struct mmc_data *data = cmd->data;
+ int ret;
+
+ WARN_ON(host->data);
+
+- if (data || (cmd->flags & MMC_RSP_BUSY)) {
+- count = sdhci_calc_timeout(host, cmd);
+- sdhci_writeb(host, count, SDHCI_TIMEOUT_CONTROL);
+- }
++ if (data || (cmd->flags & MMC_RSP_BUSY))
++ sdhci_set_timeout(host, cmd);
+
+ if (!data)
+ return;
+diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
+index acba9a7..25c1572 100644
+--- a/drivers/mmc/host/sdhci.h
++++ b/drivers/mmc/host/sdhci.h
+@@ -282,6 +282,8 @@ struct sdhci_ops {
+ unsigned int (*get_min_clock)(struct sdhci_host *host);
+ unsigned int (*get_timeout_clock)(struct sdhci_host *host);
+ unsigned int (*get_max_timeout_count)(struct sdhci_host *host);
++ void (*set_timeout)(struct sdhci_host *host,
++ struct mmc_command *cmd);
+ int (*platform_bus_width)(struct sdhci_host *host,
+ int width);
+ void (*platform_send_init_74_clocks)(struct sdhci_host *host,
diff --git a/patches/linux/3.14/0501-v2-4-5-mmc-sdhci-esdhc-imx-set-the-correct-max-timeout-value-for-uSDHC.patch b/patches/linux/3.14/0501-v2-4-5-mmc-sdhci-esdhc-imx-set-the-correct-max-timeout-value-for-uSDHC.patch
new file mode 100644
index 0000000..464e1c8
--- /dev/null
+++ b/patches/linux/3.14/0501-v2-4-5-mmc-sdhci-esdhc-imx-set-the-correct-max-timeout-value-for-uSDHC.patch
@@ -0,0 +1,62 @@
+From patchwork Tue Dec 17 08:16:30 2013
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v2, 4/5] mmc: sdhci-esdhc-imx: set the correct max timeout value for
+ uSDHC
+From: Aisheng Dong <b2...@fr...>
+X-Patchwork-Id: 3359681
+Message-Id: <138...@fr...>
+To: <lin...@vg...>
+Cc: ulf...@li..., sha...@li...,
+ ed....@al...,
+ s....@pe..., adr...@in...,
+ vla...@me..., cj...@la..., b2...@fr...,
+ lin...@li...
+Date: Tue, 17 Dec 2013 16:16:30 +0800
+
+The default sdhci driver write 0xE into timeout counter register to
+set the maximum timeout. The value is not correct for uSDHC since the
+max counter value for uSDHC is 0xF.
+Instead of using common timeout code in sdhci, we implement esdhc_set_timeout
+to handle the difference between eSDHC and uSDHC.
+
+Currently we simply set the max timeout value as before.
+But in the future, we probably may implement IMX specific timeout
+setting algorithm and use suitable timeout for different CMDs.
+
+Signed-off-by: Dong Aisheng <b2...@fr...>
+
+---
+drivers/mmc/host/sdhci-esdhc-imx.c | 11 +++++++++++
+ 1 files changed, 11 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
+index 5d9b56d..2a04847 100644
+--- a/drivers/mmc/host/sdhci-esdhc-imx.c
++++ b/drivers/mmc/host/sdhci-esdhc-imx.c
+@@ -888,6 +888,16 @@ static unsigned int esdhc_get_max_timeout_count(struct sdhci_host *host)
+ return esdhc_is_usdhc(imx_data) ? 1 << 28 : 1 << 27;
+ }
+
++static void esdhc_set_timeout(struct sdhci_host *host, struct mmc_command *cmd)
++{
++ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
++ struct pltfm_imx_data *imx_data = pltfm_host->priv;
++
++ /* use maximum timeout counter */
++ sdhci_writeb(host, esdhc_is_usdhc(imx_data) ? 0xF : 0xE,
++ SDHCI_TIMEOUT_CONTROL);
++}
++
+ static struct sdhci_ops sdhci_esdhc_ops = {
+ .read_l = esdhc_readl_le,
+ .read_w = esdhc_readw_le,
+@@ -901,6 +911,7 @@ static struct sdhci_ops sdhci_esdhc_ops = {
+ .platform_bus_width = esdhc_pltfm_bus_width,
+ .set_uhs_signaling = esdhc_set_uhs_signaling,
+ .get_max_timeout_count = esdhc_get_max_timeout_count,
++ .set_timeout = esdhc_set_timeout,
+ };
+
+ static const struct sdhci_pltfm_data sdhci_esdhc_imx_pdata = {
diff --git a/patches/linux/3.14/0502-v2-5-5-mmc-sdhci-calculate-max_discard_to-dynamically-for-SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK.patch b/patches/linux/3.14/0502-v2-5-5-mmc-sdhci-calculate-max_discard_to-dynamically-for-SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK.patch
new file mode 100644
index 0000000..020dfc4
--- /dev/null
+++ b/patches/linux/3.14/0502-v2-5-5-mmc-sdhci-calculate-max_discard_to-dynamically-for-SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK.patch
@@ -0,0 +1,123 @@
+From patchwork Tue Dec 17 08:16:31 2013
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v2, 5/5] mmc: sdhci: calculate max_discard_to dynamically for
+ SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK
+From: Aisheng Dong <b2...@fr...>
+X-Patchwork-Id: 3359691
+Message-Id: <138...@fr...>
+To: <lin...@vg...>
+Cc: ulf...@li..., sha...@li...,
+ ed....@al...,
+ s....@pe..., adr...@in...,
+ vla...@me..., cj...@la..., b2...@fr...,
+ lin...@li...
+Date: Tue, 17 Dec 2013 16:16:31 +0800
+
+For host controllers using SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK, since the card
+clock is changed dynamically for different cards, it does not make sense
+to use the maximum host clock to calculate max_discard_to which may lead
+the max_discard_to to be much smaller than its capbility and affect the card
+discard performance a lot.
+e.g. the host clock is 200Mhz, but the card is working on 50Mhz. Then the
+max_discard_to is only 1/4 of its real capbility.
+
+In this patch, it uses the actual_clock to calculate the max_discard_to
+dynamically as long as a new clock speed is set.
+
+Tested with a high speed SDHC card shows:
+Originally:
+mmc1: new high speed SDHC card at address aaaa
+mmc1: calculated max. discard sectors 49152 for timeout 1355 ms
+Now:
+mmc1: new high speed SDHC card at address aaaa
+mmc1: calculated max. discard sectors 712704 for timeout 5422 ms
+The max_discard_sectors will increase a lot which will also improve discard
+performance a lot.
+
+The one known limitation of this approach is that it does not cover the special
+case for user changes the clock via sysfs, since the max_discard_to is only
+initialised for one time during the mmc queue init.
+
+Signed-off-by: Dong Aisheng <b2...@fr...>
+
+---
+drivers/mmc/host/sdhci.c | 47 +++++++++++++++++++++++++++------------------
+ 1 files changed, 28 insertions(+), 19 deletions(-)
+
+diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
+index 47ecf50..a104bb1 100644
+--- a/drivers/mmc/host/sdhci.c
++++ b/drivers/mmc/host/sdhci.c
+@@ -1155,7 +1155,7 @@ static void sdhci_set_clock(struct sdhci_host *host, unsigned int clock)
+ if (host->ops->set_clock) {
+ host->ops->set_clock(host, clock);
+ if (host->quirks & SDHCI_QUIRK_NONSTANDARD_CLOCK)
+- return;
++ goto out;
+ }
+
+ sdhci_writew(host, 0, SDHCI_CLOCK_CONTROL);
+@@ -1254,6 +1254,16 @@ clock_set:
+
+ out:
+ host->clock = clock;
++
++ /* update timeout_clk and max_discard_to once the SDCLK is changed */
++ if (host->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK && clock) {
++ host->timeout_clk = host->mmc->actual_clock ?
++ host->mmc->actual_clock / 1000 :
++ host->clock / 1000;
++ host->mmc->max_discard_to = host->ops->get_max_timeout_count ?
++ host->ops->get_max_timeout_count(host) : 1 << 27;
++ host->mmc->max_discard_to /= host->timeout_clk;
++ }
+ }
+
+ static inline void sdhci_update_clock(struct sdhci_host *host)
+@@ -2933,27 +2943,26 @@ int sdhci_add_host(struct sdhci_host *host)
+ } else
+ mmc->f_min = host->max_clk / SDHCI_MAX_DIV_SPEC_200;
+
+- host->timeout_clk =
+- (caps[0] & SDHCI_TIMEOUT_CLK_MASK) >> SDHCI_TIMEOUT_CLK_SHIFT;
+- if (host->timeout_clk == 0) {
+- if (host->ops->get_timeout_clock) {
+- host->timeout_clk = host->ops->get_timeout_clock(host);
+- } else if (!(host->quirks &
+- SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK)) {
+- pr_err("%s: Hardware doesn't specify timeout clock "
+- "frequency.\n", mmc_hostname(mmc));
+- return -ENODEV;
++ if (!(host->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK)) {
++ host->timeout_clk = (caps[0] & SDHCI_TIMEOUT_CLK_MASK) >>
++ SDHCI_TIMEOUT_CLK_SHIFT;
++ if (host->timeout_clk == 0) {
++ if (host->ops->get_timeout_clock) {
++ host->timeout_clk =
++ host->ops->get_timeout_clock(host);
++ } else {
++ pr_err("%s: Hardware doesn't specify timeout"
++ "clock frequency.\n", mmc_hostname(mmc));
++ return -ENODEV;
++ }
+ }
+- }
+- if (caps[0] & SDHCI_TIMEOUT_CLK_UNIT)
+- host->timeout_clk *= 1000;
+-
+- if (host->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK)
+- host->timeout_clk = mmc->f_max / 1000;
++ if (caps[0] & SDHCI_TIMEOUT_CLK_UNIT)
++ host->timeout_clk *= 1000;
+
+- mmc->max_discard_to = host->ops->get_max_timeout_count ?
++ mmc->max_discard_to = host->ops->get_max_timeout_count ?
+ host->ops->get_max_timeout_count(host) : 1 << 27;
+- mmc->max_discard_to /= host->timeout_clk;
++ mmc->max_discard_to /= host->timeout_clk;
++ }
+
+ mmc->caps |= MMC_CAP_SDIO_IRQ | MMC_CAP_ERASE | MMC_CAP_CMD23;
+
hooks/post-receive
--
armadeus
|