aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mvebu
diff options
context:
space:
mode:
authorJonas Gorski <jogo@openwrt.org>2013-02-04 10:19:28 +0000
committerJonas Gorski <jogo@openwrt.org>2013-02-04 10:19:28 +0000
commitd37d39b0e807736dd71bc38ed55a8c8f59c11e41 (patch)
treecb6c6f12f0251a9f69ba6602e85d58df75127d29 /target/linux/mvebu
parent6381f75bd6f853a64688147377a5374b5ecb3181 (diff)
downloadupstream-d37d39b0e807736dd71bc38ed55a8c8f59c11e41.tar.gz
upstream-d37d39b0e807736dd71bc38ed55a8c8f59c11e41.tar.bz2
upstream-d37d39b0e807736dd71bc38ed55a8c8f59c11e41.zip
kernel: generic: update to 3.8-rc6
Signed-off-by: Jonas Gorski <jogo@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35478 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/mvebu')
-rw-r--r--target/linux/mvebu/Makefile2
-rw-r--r--target/linux/mvebu/patches-3.8/005-arm_mvebu_use_global_interrupts_for_gpio.patch166
-rw-r--r--target/linux/mvebu/patches-3.8/006-mmc_mvsdio_use_slot_gpio.patch76
-rw-r--r--target/linux/mvebu/patches-3.8/007-mmc_mvsdio_use_slot_gpio_for_cd.patch90
-rw-r--r--target/linux/mvebu/patches-3.8/008-mmc_mvsdio_implement_a_device_tree_binding.patch60
-rw-r--r--target/linux/mvebu/patches-3.8/009-mmc_mvsdio_add_pinctrl.patch30
-rw-r--r--target/linux/mvebu/patches-3.8/035-arm_mvebu_the_core_pcie_driver.patch2
7 files changed, 170 insertions, 256 deletions
diff --git a/target/linux/mvebu/Makefile b/target/linux/mvebu/Makefile
index 76a88a17ac..52e667b7e9 100644
--- a/target/linux/mvebu/Makefile
+++ b/target/linux/mvebu/Makefile
@@ -13,7 +13,7 @@ FEATURES:=targz usb jffs2 pci pcie gpio
CFLAGS:=-Os -pipe -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp
MAINTAINER:=Florian Fainelli <florian@openwrt.org>
-LINUX_VERSION:=3.8-rc4
+LINUX_VERSION:=3.8-rc6
include $(INCLUDE_DIR)/target.mk
diff --git a/target/linux/mvebu/patches-3.8/005-arm_mvebu_use_global_interrupts_for_gpio.patch b/target/linux/mvebu/patches-3.8/005-arm_mvebu_use_global_interrupts_for_gpio.patch
deleted file mode 100644
index e190a3301f..0000000000
--- a/target/linux/mvebu/patches-3.8/005-arm_mvebu_use_global_interrupts_for_gpio.patch
+++ /dev/null
@@ -1,166 +0,0 @@
-The Armada XP GPIO controller has two ways of notifying interrupts:
-using global interrupts or using per-CPU interrupts. In an attempt to
-use the best available features, the 'marvell,armadaxp-gpio'
-compatible string selects a variant of the gpio-mvebu driver that
-makes use of the per-CPU interrupts.
-
-Unfortunately, this doesn't work properly in a SMP context, because we
-fall into cases where the GPIO interrupt is enabled on CPU X at the
-GPIO controller level, but on CPU Y at the interrupt controller
-level. It is not yet clear how to fix that easily.
-
-So for 3.8, our approach is to switch to global interrupts for GPIOs,
-so that we do not fall into this per-CPU interrupts problem.
-
-This patch therefore fixes GPIO interrupts on Armada XP
-platforms. Without this patch, GPIO interrupts simply do not work
-reliably, because their proper operation depends on which CPU the code
-requesting the interrupt is running.
-
-Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
----
-This is 3.8-rc material.
----
- arch/arm/boot/dts/armada-xp-mv78230.dtsi | 14 ++++++--------
- arch/arm/boot/dts/armada-xp-mv78260.dtsi | 21 +++++++++------------
- arch/arm/boot/dts/armada-xp-mv78460.dtsi | 21 +++++++++------------
- 3 files changed, 24 insertions(+), 32 deletions(-)
-
---- a/arch/arm/boot/dts/armada-xp-mv78230.dtsi
-+++ b/arch/arm/boot/dts/armada-xp-mv78230.dtsi
-@@ -50,27 +50,25 @@
- };
-
- gpio0: gpio@d0018100 {
-- compatible = "marvell,armadaxp-gpio";
-- reg = <0xd0018100 0x40>,
-- <0xd0018800 0x30>;
-+ compatible = "marvell,orion-gpio";
-+ reg = <0xd0018100 0x40>;
- ngpios = <32>;
- gpio-controller;
- #gpio-cells = <2>;
- interrupt-controller;
- #interrupts-cells = <2>;
-- interrupts = <16>, <17>, <18>, <19>;
-+ interrupts = <82>, <83>, <84>, <85>;
- };
-
- gpio1: gpio@d0018140 {
-- compatible = "marvell,armadaxp-gpio";
-- reg = <0xd0018140 0x40>,
-- <0xd0018840 0x30>;
-+ compatible = "marvell,orion-gpio";
-+ reg = <0xd0018140 0x40>;
- ngpios = <17>;
- gpio-controller;
- #gpio-cells = <2>;
- interrupt-controller;
- #interrupts-cells = <2>;
-- interrupts = <20>, <21>, <22>;
-+ interrupts = <87>, <88>, <89>;
- };
- };
- };
---- a/arch/arm/boot/dts/armada-xp-mv78260.dtsi
-+++ b/arch/arm/boot/dts/armada-xp-mv78260.dtsi
-@@ -51,39 +51,36 @@
- };
-
- gpio0: gpio@d0018100 {
-- compatible = "marvell,armadaxp-gpio";
-- reg = <0xd0018100 0x40>,
-- <0xd0018800 0x30>;
-+ compatible = "marvell,orion-gpio";
-+ reg = <0xd0018100 0x40>;
- ngpios = <32>;
- gpio-controller;
- #gpio-cells = <2>;
- interrupt-controller;
- #interrupts-cells = <2>;
-- interrupts = <16>, <17>, <18>, <19>;
-+ interrupts = <82>, <83>, <84>, <85>;
- };
-
- gpio1: gpio@d0018140 {
-- compatible = "marvell,armadaxp-gpio";
-- reg = <0xd0018140 0x40>,
-- <0xd0018840 0x30>;
-+ compatible = "marvell,orion-gpio";
-+ reg = <0xd0018140 0x40>;
- ngpios = <32>;
- gpio-controller;
- #gpio-cells = <2>;
- interrupt-controller;
- #interrupts-cells = <2>;
-- interrupts = <20>, <21>, <22>, <23>;
-+ interrupts = <87>, <88>, <89>, <90>;
- };
-
- gpio2: gpio@d0018180 {
-- compatible = "marvell,armadaxp-gpio";
-- reg = <0xd0018180 0x40>,
-- <0xd0018870 0x30>;
-+ compatible = "marvell,orion-gpio";
-+ reg = <0xd0018180 0x40>;
- ngpios = <3>;
- gpio-controller;
- #gpio-cells = <2>;
- interrupt-controller;
- #interrupts-cells = <2>;
-- interrupts = <24>;
-+ interrupts = <91>;
- };
-
- ethernet@d0034000 {
---- a/arch/arm/boot/dts/armada-xp-mv78460.dtsi
-+++ b/arch/arm/boot/dts/armada-xp-mv78460.dtsi
-@@ -66,39 +66,36 @@
- };
-
- gpio0: gpio@d0018100 {
-- compatible = "marvell,armadaxp-gpio";
-- reg = <0xd0018100 0x40>,
-- <0xd0018800 0x30>;
-+ compatible = "marvell,orion-gpio";
-+ reg = <0xd0018100 0x40>;
- ngpios = <32>;
- gpio-controller;
- #gpio-cells = <2>;
- interrupt-controller;
- #interrupts-cells = <2>;
-- interrupts = <16>, <17>, <18>, <19>;
-+ interrupts = <82>, <83>, <84>, <85>;
- };
-
- gpio1: gpio@d0018140 {
-- compatible = "marvell,armadaxp-gpio";
-- reg = <0xd0018140 0x40>,
-- <0xd0018840 0x30>;
-+ compatible = "marvell,orion-gpio";
-+ reg = <0xd0018140 0x40>;
- ngpios = <32>;
- gpio-controller;
- #gpio-cells = <2>;
- interrupt-controller;
- #interrupts-cells = <2>;
-- interrupts = <20>, <21>, <22>, <23>;
-+ interrupts = <87>, <88>, <89>, <90>;
- };
-
- gpio2: gpio@d0018180 {
-- compatible = "marvell,armadaxp-gpio";
-- reg = <0xd0018180 0x40>,
-- <0xd0018870 0x30>;
-+ compatible = "marvell,orion-gpio";
-+ reg = <0xd0018180 0x40>;
- ngpios = <3>;
- gpio-controller;
- #gpio-cells = <2>;
- interrupt-controller;
- #interrupts-cells = <2>;
-- interrupts = <24>;
-+ interrupts = <91>;
- };
-
- ethernet@d0034000 {
diff --git a/target/linux/mvebu/patches-3.8/006-mmc_mvsdio_use_slot_gpio.patch b/target/linux/mvebu/patches-3.8/006-mmc_mvsdio_use_slot_gpio.patch
index 35a2d8e528..7bb8c20d5d 100644
--- a/target/linux/mvebu/patches-3.8/006-mmc_mvsdio_use_slot_gpio.patch
+++ b/target/linux/mvebu/patches-3.8/006-mmc_mvsdio_use_slot_gpio.patch
@@ -1,3 +1,20 @@
+From patchwork Wed Jan 16 13:13:57 2013
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [2/5] mmc: mvsdio: use slot-gpio infrastructure for write protect gpio
+Date: Wed, 16 Jan 2013 13:13:57 -0000
+From: Andrew Lunn <andrew@lunn.ch>
+X-Patchwork-Id: 1987931
+Message-Id: <1358342040-7130-3-git-send-email-andrew@lunn.ch>
+To: Jason Cooper <jason@lakedaemon.net>
+Cc: linux ARM <linux-arm-kernel@lists.infradead.org>,
+ linux-mmc@vger.kernel.org, linux@arm.linux.org.uk,
+ Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
+ Andrew Lunn <andrew@lunn.ch>
+
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
The MMC core subsystem provides in drivers/mmc/core/slot-gpio.c a nice
set of helper functions to simplify the management of the write
protect GPIO in MMC host drivers. This patch migrates the mvsdio
@@ -6,9 +23,14 @@ simpler, and therefore ease the process of adding a Device Tree
binding for this driver.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Signed-off-by: Andrew Lunn <andrew@lunn.ch>
+Tested-by: Stefan Peter <s.peter@mpl.ch>
+Tested-by: Florian Fainelli <florian@openwrt.org>
+Signed-off-by: Jason Cooper <jason@lakedaemon.net>
+
---
- drivers/mmc/host/mvsdio.c | 34 +++++-----------------------------
- 1 file changed, 5 insertions(+), 29 deletions(-)
+drivers/mmc/host/mvsdio.c | 30 +++++-------------------------
+ 1 file changed, 5 insertions(+), 25 deletions(-)
--- a/drivers/mmc/host/mvsdio.c
+++ b/drivers/mmc/host/mvsdio.c
@@ -20,15 +42,15 @@ Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
#include <asm/sizes.h>
#include <asm/unaligned.h>
-@@ -54,7 +55,6 @@ struct mvsd_host {
- int irq;
+@@ -52,7 +53,6 @@ struct mvsd_host {
+ struct device *dev;
struct clk *clk;
int gpio_card_detect;
- int gpio_write_protect;
};
#define mvsd_write(offs, val) writel(val, iobase + (offs))
-@@ -566,20 +566,6 @@ static void mvsd_enable_sdio_irq(struct
+@@ -564,20 +564,6 @@ static void mvsd_enable_sdio_irq(struct
spin_unlock_irqrestore(&host->lock, flags);
}
@@ -49,7 +71,7 @@ Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
static void mvsd_power_up(struct mvsd_host *host)
{
void __iomem *iobase = host->base;
-@@ -676,7 +662,7 @@ static void mvsd_set_ios(struct mmc_host
+@@ -674,7 +660,7 @@ static void mvsd_set_ios(struct mmc_host
static const struct mmc_host_ops mvsd_ops = {
.request = mvsd_request,
@@ -58,15 +80,15 @@ Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
.set_ios = mvsd_set_ios,
.enable_sdio_irq = mvsd_enable_sdio_irq,
};
-@@ -798,15 +784,7 @@ static int __init mvsd_probe(struct plat
+@@ -793,15 +779,7 @@ static int __init mvsd_probe(struct plat
if (!host->gpio_card_detect)
mmc->caps |= MMC_CAP_NEEDS_POLL;
- if (mvsd_data->gpio_write_protect) {
-- ret = gpio_request(mvsd_data->gpio_write_protect,
-- DRIVER_NAME " wp");
+- ret = devm_gpio_request_one(&pdev->dev,
+- mvsd_data->gpio_write_protect,
+- GPIOF_IN, DRIVER_NAME " wp");
- if (ret == 0) {
-- gpio_direction_input(mvsd_data->gpio_write_protect);
- host->gpio_write_protect =
- mvsd_data->gpio_write_protect;
- }
@@ -75,23 +97,19 @@ Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
setup_timer(&host->timer, mvsd_timeout_timer, (unsigned long)host);
platform_set_drvdata(pdev, mmc);
-@@ -831,8 +809,7 @@ out:
- free_irq(gpio_to_irq(host->gpio_card_detect), host);
- gpio_free(host->gpio_card_detect);
- }
-- if (host->gpio_write_protect)
-- gpio_free(host->gpio_write_protect);
-+ mmc_gpio_free_ro(mmc);
- if (host->base)
- iounmap(host->base);
- }
-@@ -861,8 +838,7 @@ static int __exit mvsd_remove(struct pla
- }
- mmc_remove_host(mmc);
- free_irq(host->irq, host);
-- if (host->gpio_write_protect)
-- gpio_free(host->gpio_write_protect);
+@@ -820,6 +798,7 @@ static int __init mvsd_probe(struct plat
+
+ out:
+ if (mmc) {
+ mmc_gpio_free_ro(mmc);
- del_timer_sync(&host->timer);
- mvsd_power_down(host);
- iounmap(host->base);
+ if (!IS_ERR(host->clk))
+ clk_disable_unprepare(host->clk);
+ mmc_free_host(mmc);
+@@ -834,6 +813,7 @@ static int __exit mvsd_remove(struct pla
+
+ struct mvsd_host *host = mmc_priv(mmc);
+
++ mmc_gpio_free_ro(mmc);
+ mmc_remove_host(mmc);
+ del_timer_sync(&host->timer);
+ mvsd_power_down(host);
diff --git a/target/linux/mvebu/patches-3.8/007-mmc_mvsdio_use_slot_gpio_for_cd.patch b/target/linux/mvebu/patches-3.8/007-mmc_mvsdio_use_slot_gpio_for_cd.patch
index bede3bf7e3..a1b3b8723a 100644
--- a/target/linux/mvebu/patches-3.8/007-mmc_mvsdio_use_slot_gpio_for_cd.patch
+++ b/target/linux/mvebu/patches-3.8/007-mmc_mvsdio_use_slot_gpio_for_cd.patch
@@ -1,3 +1,20 @@
+From patchwork Wed Jan 16 13:13:58 2013
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [3/5] mmc: mvsdio: use slot-gpio for card detect gpio
+Date: Wed, 16 Jan 2013 13:13:58 -0000
+From: Andrew Lunn <andrew@lunn.ch>
+X-Patchwork-Id: 1987941
+Message-Id: <1358342040-7130-4-git-send-email-andrew@lunn.ch>
+To: Jason Cooper <jason@lakedaemon.net>
+Cc: linux ARM <linux-arm-kernel@lists.infradead.org>,
+ linux-mmc@vger.kernel.org, linux@arm.linux.org.uk,
+ Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
+ Andrew Lunn <andrew@lunn.ch>
+
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
The MMC core subsystem provides in drivers/mmc/core/slot-gpio.c a nice
set of helper functions to simplify the management of the card detect
GPIO in MMC host drivers. This patch migrates the mvsdio driver to
@@ -6,21 +23,26 @@ therefore ease the process of adding a Device Tree binding for this
driver.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Signed-off-by: Andrew Lunn <andrew@lunn.ch>
+Tested-by: Stefan Peter <s.peter@mpl.ch>
+Tested-by: Florian Fainelli <florian@openwrt.org>
+Signed-off-by: Jason Cooper <jason@lakedaemon.net>
+
---
- drivers/mmc/host/mvsdio.c | 44 +++++++++-----------------------------------
- 1 file changed, 9 insertions(+), 35 deletions(-)
+drivers/mmc/host/mvsdio.c | 39 +++++++++------------------------------
+ 1 file changed, 9 insertions(+), 30 deletions(-)
--- a/drivers/mmc/host/mvsdio.c
+++ b/drivers/mmc/host/mvsdio.c
-@@ -54,7 +54,6 @@ struct mvsd_host {
- struct resource *res;
- int irq;
+@@ -52,7 +52,6 @@ struct mvsd_host {
+ struct mmc_host *mmc;
+ struct device *dev;
struct clk *clk;
- int gpio_card_detect;
};
#define mvsd_write(offs, val) writel(val, iobase + (offs))
-@@ -540,13 +539,6 @@ static void mvsd_timeout_timer(unsigned
+@@ -538,13 +537,6 @@ static void mvsd_timeout_timer(unsigned
mmc_request_done(host->mmc, mrq);
}
@@ -34,24 +56,27 @@ Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
static void mvsd_enable_sdio_irq(struct mmc_host *mmc, int enable)
{
struct mvsd_host *host = mmc_priv(mmc);
-@@ -765,23 +757,11 @@ static int __init mvsd_probe(struct plat
+@@ -757,26 +749,11 @@ static int __init mvsd_probe(struct plat
+ if (!IS_ERR(host->clk))
clk_prepare_enable(host->clk);
- }
- if (mvsd_data->gpio_card_detect) {
-- ret = gpio_request(mvsd_data->gpio_card_detect,
-- DRIVER_NAME " cd");
+- ret = devm_gpio_request_one(&pdev->dev,
+- mvsd_data->gpio_card_detect,
+- GPIOF_IN, DRIVER_NAME " cd");
- if (ret == 0) {
-- gpio_direction_input(mvsd_data->gpio_card_detect);
- irq = gpio_to_irq(mvsd_data->gpio_card_detect);
-- ret = request_irq(irq, mvsd_card_detect_irq,
-- IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING,
-- DRIVER_NAME " cd", host);
+- ret = devm_request_irq(&pdev->dev, irq,
+- mvsd_card_detect_irq,
+- IRQ_TYPE_EDGE_RISING |
+- IRQ_TYPE_EDGE_FALLING,
+- DRIVER_NAME " cd", host);
- if (ret == 0)
- host->gpio_card_detect =
- mvsd_data->gpio_card_detect;
- else
-- gpio_free(mvsd_data->gpio_card_detect);
+- devm_gpio_free(&pdev->dev,
+- mvsd_data->gpio_card_detect);
- }
- }
- if (!host->gpio_card_detect)
@@ -63,7 +88,7 @@ Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
mmc->caps |= MMC_CAP_NEEDS_POLL;
mmc_gpio_request_ro(mmc, mvsd_data->gpio_write_protect);
-@@ -794,9 +774,9 @@ static int __init mvsd_probe(struct plat
+@@ -789,15 +766,16 @@ static int __init mvsd_probe(struct plat
pr_notice("%s: %s driver initialized, ",
mmc_hostname(mmc), DRIVER_NAME);
@@ -75,27 +100,18 @@ Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
else
printk("lacking card detect (fall back to polling)\n");
return 0;
-@@ -805,10 +785,7 @@ out:
- if (host) {
- if (host->irq)
- free_irq(host->irq, host);
-- if (host->gpio_card_detect) {
-- free_irq(gpio_to_irq(host->gpio_card_detect), host);
-- gpio_free(host->gpio_card_detect);
-- }
-+ mmc_gpio_free_cd(mmc);
- mmc_gpio_free_ro(mmc);
- if (host->base)
- iounmap(host->base);
-@@ -832,10 +809,7 @@ static int __exit mvsd_remove(struct pla
- if (mmc) {
- struct mvsd_host *host = mmc_priv(mmc);
-- if (host->gpio_card_detect) {
-- free_irq(gpio_to_irq(host->gpio_card_detect), host);
-- gpio_free(host->gpio_card_detect);
-- }
+ out:
+ if (mmc) {
+ mmc_gpio_free_cd(mmc);
- mmc_remove_host(mmc);
- free_irq(host->irq, host);
mmc_gpio_free_ro(mmc);
+ if (!IS_ERR(host->clk))
+ clk_disable_unprepare(host->clk);
+@@ -813,6 +791,7 @@ static int __exit mvsd_remove(struct pla
+
+ struct mvsd_host *host = mmc_priv(mmc);
+
++ mmc_gpio_free_cd(mmc);
+ mmc_gpio_free_ro(mmc);
+ mmc_remove_host(mmc);
+ del_timer_sync(&host->timer);
diff --git a/target/linux/mvebu/patches-3.8/008-mmc_mvsdio_implement_a_device_tree_binding.patch b/target/linux/mvebu/patches-3.8/008-mmc_mvsdio_implement_a_device_tree_binding.patch
index 7aa7856675..baec5a1467 100644
--- a/target/linux/mvebu/patches-3.8/008-mmc_mvsdio_implement_a_device_tree_binding.patch
+++ b/target/linux/mvebu/patches-3.8/008-mmc_mvsdio_implement_a_device_tree_binding.patch
@@ -1,3 +1,20 @@
+From patchwork Wed Jan 16 13:13:59 2013
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [4/5] mmc: mvsdio: implement a Device Tree binding
+Date: Wed, 16 Jan 2013 13:13:59 -0000
+From: Andrew Lunn <andrew@lunn.ch>
+X-Patchwork-Id: 1987921
+Message-Id: <1358342040-7130-5-git-send-email-andrew@lunn.ch>
+To: Jason Cooper <jason@lakedaemon.net>
+Cc: linux ARM <linux-arm-kernel@lists.infradead.org>,
+ linux-mmc@vger.kernel.org, linux@arm.linux.org.uk,
+ Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
+ Andrew Lunn <andrew@lunn.ch>
+
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
This patch adds a simple Device Tree binding for the mvsdio driver, as
well as the necessary documentation for it. Compatibility with non-DT
platforms is preserved, by keeping the platform_data based
@@ -11,10 +28,15 @@ reference is not mandatory, but the clock frequency must be passed in
the "clock" field of the mvsdio_platform_data structure.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Signed-off-by: Andrew Lunn <andrew@lunn.ch>
+Tested-by: Stefan Peter <s.peter@mpl.ch>
+Tested-by: Florian Fainelli <florian@openwrt.org>
+Signed-off-by: Jason Cooper <jason@lakedaemon.net>
+
---
- .../devicetree/bindings/mmc/orion-sdio.txt | 17 ++++++
- drivers/mmc/host/mvsdio.c | 60 +++++++++++++++-----
- 2 files changed, 62 insertions(+), 15 deletions(-)
+.../devicetree/bindings/mmc/orion-sdio.txt | 17 ++++++
+ drivers/mmc/host/mvsdio.c | 62 +++++++++++++++-----
+ 2 files changed, 64 insertions(+), 15 deletions(-)
create mode 100644 Documentation/devicetree/bindings/mmc/orion-sdio.txt
--- /dev/null
@@ -48,7 +70,7 @@ Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
#include <linux/mmc/host.h>
#include <linux/mmc/slot-gpio.h>
-@@ -683,17 +685,17 @@ mv_conf_mbus_windows(struct mvsd_host *h
+@@ -681,17 +683,17 @@ mv_conf_mbus_windows(struct mvsd_host *h
static int __init mvsd_probe(struct platform_device *pdev)
{
@@ -68,19 +90,20 @@ Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+ if (!r || irq < 0)
return -ENXIO;
- r = request_mem_region(r->start, SZ_1K, DRIVER_NAME);
-@@ -710,7 +712,35 @@ static int __init mvsd_probe(struct plat
+ mmc = mmc_alloc_host(sizeof(struct mvsd_host), &pdev->dev);
+@@ -703,8 +705,37 @@ static int __init mvsd_probe(struct plat
+ host = mmc_priv(mmc);
host->mmc = mmc;
host->dev = &pdev->dev;
- host->res = r;
- host->base_clock = mvsd_data->clock / 2;
+- host->clk = ERR_PTR(-EINVAL);
+
+ /* Some non-DT platforms do not pass a clock, and the clock
+ frequency is passed through platform_data. On DT platforms,
+ a clock must always be passed, even if there is no gatable
+ clock associated to the SDIO interface (it can simply be a
+ fixed rate clock). */
-+ host->clk = clk_get(&pdev->dev, NULL);
++ host->clk = devm_clk_get(&pdev->dev, NULL);
+ if (!IS_ERR(host->clk))
+ clk_prepare_enable(host->clk);
+
@@ -97,8 +120,10 @@ Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+ } else {
+ const struct mvsdio_platform_data *mvsd_data;
+ mvsd_data = pdev->dev.platform_data;
-+ if (!mvsd_data)
-+ return -ENXIO;
++ if (!mvsd_data) {
++ ret = -ENXIO;
++ goto out;
++ }
+ host->base_clock = mvsd_data->clock / 2;
+ gpio_card_detect = mvsd_data->gpio_card_detect;
+ gpio_write_protect = mvsd_data->gpio_write_protect;
@@ -106,16 +131,15 @@ Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
mmc->ops = &mvsd_ops;
-@@ -750,21 +780,14 @@ static int __init mvsd_probe(struct plat
- } else
- host->irq = irq;
+@@ -743,20 +774,14 @@ static int __init mvsd_probe(struct plat
+ goto out;
+ }
- /* Not all platforms can gate the clock, so it is not
- an error if the clock does not exists. */
-- host->clk = clk_get(&pdev->dev, NULL);
-- if (!IS_ERR(host->clk)) {
+- host->clk = devm_clk_get(&pdev->dev, NULL);
+- if (!IS_ERR(host->clk))
- clk_prepare_enable(host->clk);
-- }
-
- if (gpio_is_valid(mvsd_data->gpio_card_detect)) {
- ret = mmc_gpio_request_cd(mmc, mvsd_data->gpio_card_detect);
@@ -131,7 +155,7 @@ Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
setup_timer(&host->timer, mvsd_timeout_timer, (unsigned long)host);
platform_set_drvdata(pdev, mmc);
-@@ -776,7 +799,7 @@ static int __init mvsd_probe(struct plat
+@@ -768,7 +793,7 @@ static int __init mvsd_probe(struct plat
mmc_hostname(mmc), DRIVER_NAME);
if (!(mmc->caps & MMC_CAP_NEEDS_POLL))
printk("using GPIO %d for card detection\n",
@@ -140,7 +164,7 @@ Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
else
printk("lacking card detect (fall back to polling)\n");
return 0;
-@@ -855,12 +878,19 @@ static int mvsd_resume(struct platform_d
+@@ -832,12 +857,19 @@ static int mvsd_resume(struct platform_d
#define mvsd_resume NULL
#endif
diff --git a/target/linux/mvebu/patches-3.8/009-mmc_mvsdio_add_pinctrl.patch b/target/linux/mvebu/patches-3.8/009-mmc_mvsdio_add_pinctrl.patch
index 9f98bda135..394ca5b9fa 100644
--- a/target/linux/mvebu/patches-3.8/009-mmc_mvsdio_add_pinctrl.patch
+++ b/target/linux/mvebu/patches-3.8/009-mmc_mvsdio_add_pinctrl.patch
@@ -1,3 +1,20 @@
+From patchwork Wed Jan 16 13:14:00 2013
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [5/5] mmc: mvsdio: add pinctrl integration
+Date: Wed, 16 Jan 2013 13:14:00 -0000
+From: Andrew Lunn <andrew@lunn.ch>
+X-Patchwork-Id: 1987901
+Message-Id: <1358342040-7130-6-git-send-email-andrew@lunn.ch>
+To: Jason Cooper <jason@lakedaemon.net>
+Cc: linux ARM <linux-arm-kernel@lists.infradead.org>,
+ linux-mmc@vger.kernel.org, linux@arm.linux.org.uk,
+ Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
+ Andrew Lunn <andrew@lunn.ch>
+
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
On many Marvell SoCs, the pins used for the SDIO interface are part of
the MPP pins, that are muxable pins. In order to get the muxing of
those pins correct, this commit integrates the mvsdio driver with the
@@ -9,8 +26,13 @@ platforms have yet been fully converted to using the pinctrl
infrastructure.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Signed-off-by: Andrew Lunn <andrew@lunn.ch>
+Tested-by: Stefan Peter <s.peter@mpl.ch>
+Tested-by: Florian Fainelli <florian@openwrt.org>
+Signed-off-by: Jason Cooper <jason@lakedaemon.net>
+
---
- drivers/mmc/host/mvsdio.c | 6 ++++++
+drivers/mmc/host/mvsdio.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/drivers/mmc/host/mvsdio.c
@@ -23,7 +45,7 @@ Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
#include <asm/sizes.h>
#include <asm/unaligned.h>
-@@ -692,6 +693,7 @@ static int __init mvsd_probe(struct plat
+@@ -690,6 +691,7 @@ static int __init mvsd_probe(struct plat
struct resource *r;
int ret, irq;
int gpio_card_detect, gpio_write_protect;
@@ -31,9 +53,9 @@ Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
irq = platform_get_irq(pdev, 0);
-@@ -713,6 +715,10 @@ static int __init mvsd_probe(struct plat
+@@ -706,6 +708,10 @@ static int __init mvsd_probe(struct plat
+ host->mmc = mmc;
host->dev = &pdev->dev;
- host->res = r;
+ pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
+ if (IS_ERR(pinctrl))
diff --git a/target/linux/mvebu/patches-3.8/035-arm_mvebu_the_core_pcie_driver.patch b/target/linux/mvebu/patches-3.8/035-arm_mvebu_the_core_pcie_driver.patch
index 1cc5f5a0c5..aa4e1f426d 100644
--- a/target/linux/mvebu/patches-3.8/035-arm_mvebu_the_core_pcie_driver.patch
+++ b/target/linux/mvebu/patches-3.8/035-arm_mvebu_the_core_pcie_driver.patch
@@ -158,7 +158,7 @@ Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
--- a/arch/arm/mach-mvebu/Makefile
+++ b/arch/arm/mach-mvebu/Makefile
-@@ -5,3 +5,4 @@ obj-y += system-controller.o
+@@ -7,3 +7,4 @@ obj-y += system-controller.o
obj-$(CONFIG_MACH_ARMADA_370_XP) += armada-370-xp.o irq-armada-370-xp.o addr-map.o coherency.o coherency_ll.o pmsu.o
obj-$(CONFIG_SMP) += platsmp.o headsmp.o
obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o