summaryrefslogtreecommitdiff
path: root/recipes-kernel/linux/linux-toradex-mainline-4.14/0017-mmc-read-mmc-alias-from-device-tree.patch
diff options
context:
space:
mode:
authorMarcel Ziswiler <marcel.ziswiler@toradex.com>2018-04-20 11:34:14 +0200
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2018-06-18 15:59:16 +0200
commit19d270b8a11457da3b2f8c049517d0ddf2bd7426 (patch)
tree2a4c67e6bc6b8d8cd97de594ec6e55054552185d /recipes-kernel/linux/linux-toradex-mainline-4.14/0017-mmc-read-mmc-alias-from-device-tree.patch
parentd777e812beda3c6e42bf440f5561ed2d8786e74e (diff)
linux-toradex-mainline: more patches also for apalis t30
Move the USB device aka gadget fix from Tezi to here. Add patches to force fixed IDs for SDMMC controllers. Add patch to fix for PLL_U rate configuration (T30). Add Apalis T30 specific patch for PCIe fix hacks. Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Acked-by: Stefan Agner <stefan.agner@toradex.com> (cherry picked from commit 7da6da579b7d90b7ca6560c880bd3f58ecb73df2)
Diffstat (limited to 'recipes-kernel/linux/linux-toradex-mainline-4.14/0017-mmc-read-mmc-alias-from-device-tree.patch')
-rw-r--r--recipes-kernel/linux/linux-toradex-mainline-4.14/0017-mmc-read-mmc-alias-from-device-tree.patch69
1 files changed, 69 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-toradex-mainline-4.14/0017-mmc-read-mmc-alias-from-device-tree.patch b/recipes-kernel/linux/linux-toradex-mainline-4.14/0017-mmc-read-mmc-alias-from-device-tree.patch
new file mode 100644
index 0000000..1fdf688
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-mainline-4.14/0017-mmc-read-mmc-alias-from-device-tree.patch
@@ -0,0 +1,69 @@
+From 1caa89027b94c5d52f9459890f123ebb6fb5d5a9 Mon Sep 17 00:00:00 2001
+Message-Id: <1caa89027b94c5d52f9459890f123ebb6fb5d5a9.1529072479.git.marcel.ziswiler@toradex.com>
+In-Reply-To: <fb4764e8eb658d35e8fc62ae79c77e1f6e2b0ef3.1529072479.git.marcel.ziswiler@toradex.com>
+References: <fb4764e8eb658d35e8fc62ae79c77e1f6e2b0ef3.1529072479.git.marcel.ziswiler@toradex.com>
+From: Stefan Agner <stefan@agner.ch>
+Date: Fri, 29 Apr 2016 10:32:17 -0700
+Subject: [PATCH 17/27] mmc: read mmc alias from device tree
+
+To get the SD/MMC host device ID, read the alias from the device
+tree.
+
+This is useful in case a SoC has multipe SD/MMC host controllers while
+the second controller should logically be the first device (e.g. if
+the second controller is connected to an internal eMMC). Combined
+with block device numbering using MMC/SD host device ID, this
+results in predictable name assignment of the internal eMMC block
+device.
+
+Signed-off-by: Stefan Agner <stefan@agner.ch>
+Signed-off-by: Dmitry Torokhov <dtor@chromium.org>
+[dianders: rebase + roll in http://crosreview.com/259916]
+Signed-off-by: Douglas Anderson <dianders@chromium.org>
+---
+ drivers/mmc/core/host.c | 17 ++++++++++++++++-
+ 1 file changed, 16 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
+index 841b9ce01a8e..e4fdd5c0ec0b 100644
+--- a/drivers/mmc/core/host.c
++++ b/drivers/mmc/core/host.c
+@@ -353,11 +353,26 @@ struct mmc_host *mmc_alloc_host(int extra, struct device *dev)
+ {
+ int err;
+ struct mmc_host *host;
++ int id;
+
+ host = kzalloc(sizeof(struct mmc_host) + extra, GFP_KERNEL);
+ if (!host)
+ return NULL;
+
++ /* If OF aliases exist, start dynamic assignment after highest */
++ id = of_alias_get_highest_id("mmc");
++ id = (id < 0) ? 0 : id + 1;
++
++ /* If this devices has OF node, maybe it has an alias */
++ if (dev->of_node) {
++ int of_id = of_alias_get_id(dev->of_node, "mmc");
++
++ if (of_id < 0)
++ dev_warn(dev, "/aliases ID not available\n");
++ else
++ id = of_id;
++ }
++
+ /* scanning will be enabled when we're ready */
+ host->rescan_disable = 1;
+
+@@ -368,7 +383,7 @@ struct mmc_host *mmc_alloc_host(int extra, struct device *dev)
+ }
+
+ spin_lock(&mmc_host_lock);
+- err = ida_get_new(&mmc_host_ida, &host->index);
++ err = ida_get_new_above(&mmc_host_ida, id, &host->index);
+ spin_unlock(&mmc_host_lock);
+
+ if (err == -EAGAIN) {
+--
+2.14.4
+