summaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
Diffstat (limited to 'target')
-rw-r--r--target/Makefile2
-rw-r--r--target/appliances/default.options5
-rw-r--r--target/appliances/mpd.options16
-rw-r--r--target/arm/Makefile5
-rw-r--r--target/arm/bcm28xx/patches/3.18.8/0000-raspberry-pi.patch (renamed from target/arm/bcm28xx/patches/3.18.6/0000-raspberry-pi.patch)0
-rw-r--r--target/arm/bcm28xx/patches/3.18.8/0001-add-support-for-rpi-proto-hardware.patch (renamed from target/arm/bcm28xx/patches/3.18.6/0001-add-support-for-rpi-proto-hardware.patch)0
-rw-r--r--target/arm/bcm28xx/patches/3.18.8/0002-allow-to-control-volume-for-each-channel.patch (renamed from target/arm/bcm28xx/patches/3.18.6/0002-allow-to-control-volume-for-each-channel.patch)0
-rw-r--r--target/arm/solidrun-imx6/patches/3.18.8/solidrun-imx6-wlan.patch3252
-rw-r--r--target/config/Config.in.adk12
-rw-r--r--target/config/Config.in.cpu53
-rw-r--r--target/config/Config.in.fpu.default6
-rw-r--r--target/config/Config.in.kernelversion.choice6
-rw-r--r--target/config/Config.in.kernelversion.default2
-rw-r--r--target/config/Config.in.libc.choice1
-rw-r--r--target/config/Config.in.qemu2
-rw-r--r--target/cris/uclibc.config4
-rw-r--r--target/linux/config/Config.in.block4
-rw-r--r--target/linux/config/Config.in.cpu13
-rw-r--r--target/linux/config/Config.in.crypto14
-rw-r--r--target/linux/config/Config.in.debug1
-rw-r--r--target/linux/config/Config.in.fs4
-rw-r--r--target/linux/config/Config.in.fsnet4
-rw-r--r--target/linux/config/Config.in.graphics3
-rw-r--r--target/linux/config/Config.in.input2
-rw-r--r--target/linux/config/Config.in.ipsec14
-rw-r--r--target/linux/config/Config.in.ipvs1
-rw-r--r--target/linux/config/Config.in.kernel10
-rw-r--r--target/linux/config/Config.in.netfilter.core1
-rw-r--r--target/linux/config/Config.in.netfilter.ebt1
-rw-r--r--target/linux/config/Config.in.netfilter.ip46
-rw-r--r--target/linux/patches/3.18.6/microblaze-axi.patch11
-rw-r--r--target/linux/patches/3.18.8/bsd-compatibility.patch (renamed from target/linux/patches/3.18.6/bsd-compatibility.patch)0
-rw-r--r--target/linux/patches/3.18.8/cleankernel.patch (renamed from target/linux/patches/3.18.6/cleankernel.patch)0
-rw-r--r--target/linux/patches/3.18.8/cris-header.patch (renamed from target/linux/patches/3.18.6/cris-header.patch)0
-rw-r--r--target/linux/patches/3.18.8/defaults.patch (renamed from target/linux/patches/3.18.6/defaults.patch)0
-rw-r--r--target/linux/patches/3.18.8/export-symbol-for-exmap.patch (renamed from target/linux/patches/3.18.6/export-symbol-for-exmap.patch)0
-rw-r--r--target/linux/patches/3.18.8/gemalto.patch (renamed from target/linux/patches/3.18.6/gemalto.patch)0
-rw-r--r--target/linux/patches/3.18.8/initramfs-nosizelimit.patch (renamed from target/linux/patches/3.18.6/initramfs-nosizelimit.patch)0
-rw-r--r--target/linux/patches/3.18.8/lemote-rfkill.patch (renamed from target/linux/patches/3.18.6/lemote-rfkill.patch)0
-rw-r--r--target/linux/patches/3.18.8/microblaze-ethernet.patch (renamed from target/linux/patches/3.18.6/microblaze-ethernet.patch)0
-rw-r--r--target/linux/patches/3.18.8/mkpiggy.patch (renamed from target/linux/patches/3.18.6/mkpiggy.patch)0
-rw-r--r--target/linux/patches/3.18.8/mtd-rootfs.patch (renamed from target/linux/patches/3.18.6/mtd-rootfs.patch)0
-rw-r--r--target/linux/patches/3.18.8/nfsv3-tcp.patch (renamed from target/linux/patches/3.18.6/nfsv3-tcp.patch)0
-rw-r--r--target/linux/patches/3.18.8/non-static.patch (renamed from target/linux/patches/3.18.6/non-static.patch)0
-rw-r--r--target/linux/patches/3.18.8/patch-fblogo (renamed from target/linux/patches/3.18.6/patch-fblogo)0
-rw-r--r--target/linux/patches/3.18.8/patch-yaffs2 (renamed from target/linux/patches/3.18.6/patch-yaffs2)0
-rw-r--r--target/linux/patches/3.18.8/ppc64-missing-zlib.patch (renamed from target/linux/patches/3.18.6/ppc64-missing-zlib.patch)0
-rw-r--r--target/linux/patches/3.18.8/regmap-bool.patch (renamed from target/linux/patches/3.18.6/regmap-bool.patch)0
-rw-r--r--target/linux/patches/3.18.8/relocs.patch (renamed from target/linux/patches/3.18.6/relocs.patch)0
-rw-r--r--target/linux/patches/3.18.8/sgidefs.patch (renamed from target/linux/patches/3.18.6/sgidefs.patch)0
-rw-r--r--target/linux/patches/3.18.8/sortext.patch (renamed from target/linux/patches/3.18.6/sortext.patch)0
-rw-r--r--target/linux/patches/3.18.8/startup.patch (renamed from target/linux/patches/3.18.6/startup.patch)0
-rw-r--r--target/linux/patches/3.18.8/wlan-cf.patch (renamed from target/linux/patches/3.18.6/wlan-cf.patch)0
-rw-r--r--target/linux/patches/3.18.8/xargs.patch (renamed from target/linux/patches/3.18.6/xargs.patch)0
-rw-r--r--target/m68k/qemu-m68k/patches/3.18.8/m68k-coldfire-fec.patch (renamed from target/m68k/qemu-m68k/patches/3.18.6/m68k-coldfire-fec.patch)0
-rw-r--r--target/m68k/qemu-m68k/patches/3.18.8/qemu-coldfire.patch (renamed from target/m68k/qemu-m68k/patches/3.18.6/qemu-coldfire.patch)0
-rw-r--r--target/mips64/lemote-yeelong/patches/3.18.8/sm7xx-fb.patch (renamed from target/mips64/lemote-yeelong/patches/3.18.6/sm7xx-fb.patch)0
-rw-r--r--target/ppc/Makefile2
58 files changed, 3355 insertions, 102 deletions
diff --git a/target/Makefile b/target/Makefile
index 3291862ba..ddb395b55 100644
--- a/target/Makefile
+++ b/target/Makefile
@@ -106,6 +106,8 @@ config-prepare: $(ADK_TOPDIR)/.config
echo "no miniconfig found for target system"; \
exit 1; \
fi
+ @cd $(BUILD_DIR) && cmp -s .kernelconfig.board .kernelconfig || \
+ cp .kernelconfig.board .kernelconfig
endif
prepare: $(ADK_TARGET_ARCH)-prepare
diff --git a/target/appliances/default.options b/target/appliances/default.options
new file mode 100644
index 000000000..bf6ca0e25
--- /dev/null
+++ b/target/appliances/default.options
@@ -0,0 +1,5 @@
+config ADK_APPLIANCE_VERSION
+ prompt "version string"
+ string
+ help
+ Configure version for appliance
diff --git a/target/appliances/mpd.options b/target/appliances/mpd.options
new file mode 100644
index 000000000..dac0ba37c
--- /dev/null
+++ b/target/appliances/mpd.options
@@ -0,0 +1,16 @@
+choice
+prompt "Choose a GUI"
+depends on ADK_APPLIANCE_MPD
+
+config ADK_APPLIANCE_MPD_MPDBOX
+ bool "use mpdbox html/javascript frontend"
+ select ADK_PACKAGE_MPDBOX
+
+config ADK_APPLIANCE_MPD_YMPD
+ bool "use ympd frontend"
+ select ADK_PACKAGE_YMPD
+
+config ADK_APPLIANCE_MPD_NOGUI
+ bool "use no gui frontend"
+
+endchoice
diff --git a/target/arm/Makefile b/target/arm/Makefile
index 9efddfac9..634bee924 100644
--- a/target/arm/Makefile
+++ b/target/arm/Makefile
@@ -108,11 +108,10 @@ kernel-install: kernel-strip
dtb-install:
ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI),y)
- env $(KERNEL_MAKE_ENV) $(MAKE) -C $(LINUX_DIR) $(KERNEL_MAKE_OPTS) \
- dtbs $(MAKE_TRACE)
+ env $(KERNEL_MAKE_ENV) $(MAKE) $(KERNEL_MAKE_OPTS) dtbs $(MAKE_TRACE)
endif
ifeq ($(ADK_TARGET_SYSTEM_SOLIDRUN_IMX6),y)
- env $(KERNEL_MAKE_ENV) $(MAKE) -C $(LINUX_DIR) $(KERNEL_MAKE_OPTS) \
+ env $(KERNEL_MAKE_ENV) $(MAKE) $(KERNEL_MAKE_OPTS) \
imx6q-cubox-i.dtb imx6dl-cubox-i.dtb imx6dl-hummingboard.dtb imx6q-hummingboard.dtb $(MAKE_TRACE)
endif
for x in $(LINUX_DIR)/arch/arm/boot/dts/*.dtb; do \
diff --git a/target/arm/bcm28xx/patches/3.18.6/0000-raspberry-pi.patch b/target/arm/bcm28xx/patches/3.18.8/0000-raspberry-pi.patch
index b66bb6533..b66bb6533 100644
--- a/target/arm/bcm28xx/patches/3.18.6/0000-raspberry-pi.patch
+++ b/target/arm/bcm28xx/patches/3.18.8/0000-raspberry-pi.patch
diff --git a/target/arm/bcm28xx/patches/3.18.6/0001-add-support-for-rpi-proto-hardware.patch b/target/arm/bcm28xx/patches/3.18.8/0001-add-support-for-rpi-proto-hardware.patch
index d2c72cdd5..d2c72cdd5 100644
--- a/target/arm/bcm28xx/patches/3.18.6/0001-add-support-for-rpi-proto-hardware.patch
+++ b/target/arm/bcm28xx/patches/3.18.8/0001-add-support-for-rpi-proto-hardware.patch
diff --git a/target/arm/bcm28xx/patches/3.18.6/0002-allow-to-control-volume-for-each-channel.patch b/target/arm/bcm28xx/patches/3.18.8/0002-allow-to-control-volume-for-each-channel.patch
index 76634e2e8..76634e2e8 100644
--- a/target/arm/bcm28xx/patches/3.18.6/0002-allow-to-control-volume-for-each-channel.patch
+++ b/target/arm/bcm28xx/patches/3.18.8/0002-allow-to-control-volume-for-each-channel.patch
diff --git a/target/arm/solidrun-imx6/patches/3.18.8/solidrun-imx6-wlan.patch b/target/arm/solidrun-imx6/patches/3.18.8/solidrun-imx6-wlan.patch
new file mode 100644
index 000000000..3ab3081db
--- /dev/null
+++ b/target/arm/solidrun-imx6/patches/3.18.8/solidrun-imx6-wlan.patch
@@ -0,0 +1,3252 @@
+diff -Nur linux-3.18.8.orig/arch/arm/boot/dts/imx6qdl-cubox-i.dtsi linux-3.18.8/arch/arm/boot/dts/imx6qdl-cubox-i.dtsi
+--- linux-3.18.8.orig/arch/arm/boot/dts/imx6qdl-cubox-i.dtsi 2015-02-27 02:49:36.000000000 +0100
++++ linux-3.18.8/arch/arm/boot/dts/imx6qdl-cubox-i.dtsi 2015-03-02 03:23:14.000000000 +0100
+@@ -170,6 +170,28 @@
+ MX6QDL_PAD_SD2_DAT3__SD2_DATA3 0x13059
+ >;
+ };
++
++ pinctrl_cubox_i_usdhc2_100mhz: cubox-i-usdhc2-100mhz {
++ fsl,pins = <
++ MX6QDL_PAD_SD2_CMD__SD2_CMD 0x170b9
++ MX6QDL_PAD_SD2_CLK__SD2_CLK 0x100b9
++ MX6QDL_PAD_SD2_DAT0__SD2_DATA0 0x170b9
++ MX6QDL_PAD_SD2_DAT1__SD2_DATA1 0x170b9
++ MX6QDL_PAD_SD2_DAT2__SD2_DATA2 0x170b9
++ MX6QDL_PAD_SD2_DAT3__SD2_DATA3 0x130b9
++ >;
++ };
++
++ pinctrl_cubox_i_usdhc2_200mhz: cubox-i-usdhc2-200mhz {
++ fsl,pins = <
++ MX6QDL_PAD_SD2_CMD__SD2_CMD 0x170f9
++ MX6QDL_PAD_SD2_CLK__SD2_CLK 0x100f9
++ MX6QDL_PAD_SD2_DAT0__SD2_DATA0 0x170f9
++ MX6QDL_PAD_SD2_DAT1__SD2_DATA1 0x170f9
++ MX6QDL_PAD_SD2_DAT2__SD2_DATA2 0x170f9
++ MX6QDL_PAD_SD2_DAT3__SD2_DATA3 0x130f9
++ >;
++ };
+ };
+ };
+
+@@ -194,8 +216,10 @@
+ };
+
+ &usdhc2 {
+- pinctrl-names = "default";
++ pinctrl-names = "default", "state_100mhz", "state_200mhz";
+ pinctrl-0 = <&pinctrl_cubox_i_usdhc2_aux &pinctrl_cubox_i_usdhc2>;
++ pinctrl-1 = <&pinctrl_cubox_i_usdhc2_aux &pinctrl_cubox_i_usdhc2_100mhz>;
++ pinctrl-2 = <&pinctrl_cubox_i_usdhc2_aux &pinctrl_cubox_i_usdhc2_200mhz>;
+ vmmc-supply = <&reg_3p3v>;
+ cd-gpios = <&gpio1 4 0>;
+ status = "okay";
+diff -Nur linux-3.18.8.orig/arch/arm/boot/dts/imx6qdl-microsom.dtsi linux-3.18.8/arch/arm/boot/dts/imx6qdl-microsom.dtsi
+--- linux-3.18.8.orig/arch/arm/boot/dts/imx6qdl-microsom.dtsi 2015-02-27 02:49:36.000000000 +0100
++++ linux-3.18.8/arch/arm/boot/dts/imx6qdl-microsom.dtsi 2015-03-02 02:58:12.000000000 +0100
+@@ -1,15 +1,95 @@
+ /*
+ * Copyright (C) 2013,2014 Russell King
+ */
++#include <dt-bindings/gpio/gpio.h>
++/ {
++ regulators {
++ compatible = "simple-bus";
++
++ reg_brcm_osc: brcm-osc-reg {
++ compatible = "regulator-fixed";
++ enable-active-high;
++ gpio = <&gpio5 5 0>;
++ pinctrl-names = "default";
++ pinctrl-0 = <&pinctrl_microsom_brcm_osc_reg>;
++ regulator-name = "brcm_osc_reg";
++ regulator-min-microvolt = <3300000>;
++ regulator-max-microvolt = <3300000>;
++ regulator-always-on;
++ regulator-boot-on;
++ };
++
++ reg_brcm: brcm-reg {
++ compatible = "regulator-fixed";
++ enable-active-high;
++ gpio = <&gpio3 19 0>;
++ pinctrl-names = "default";
++ pinctrl-0 = <&pinctrl_microsom_brcm_reg>;
++ regulator-name = "brcm_reg";
++ regulator-min-microvolt = <3300000>;
++ regulator-max-microvolt = <3300000>;
++ startup-delay-us = <200000>;
++ };
++ };
++};
+
+ &iomuxc {
+ microsom {
++ pinctrl_microsom_brcm_bt: microsom-brcm-bt {
++ fsl,pins = <
++ MX6QDL_PAD_CSI0_DAT14__GPIO6_IO00 0x40013070
++ MX6QDL_PAD_CSI0_DAT15__GPIO6_IO01 0x40013070
++ MX6QDL_PAD_CSI0_DAT18__GPIO6_IO04 0x40013070
++ >;
++ };
++
++ pinctrl_microsom_brcm_osc_reg: microsom-brcm-osc-reg {
++ fsl,pins = <
++ MX6QDL_PAD_DISP0_DAT11__GPIO5_IO05 0x40013070
++ >;
++ };
++
++ pinctrl_microsom_brcm_reg: microsom-brcm-reg {
++ fsl,pins = <
++ MX6QDL_PAD_EIM_D19__GPIO3_IO19 0x40013070
++ >;
++ };
++
++ pinctrl_microsom_brcm_wifi: microsom-brcm-wifi {
++ fsl,pins = <
++ MX6QDL_PAD_GPIO_8__XTALOSC_REF_CLK_32K 0x1b0b0
++ MX6QDL_PAD_CSI0_DATA_EN__GPIO5_IO20 0x40013070
++ MX6QDL_PAD_CSI0_DAT8__GPIO5_IO26 0x40013070
++ MX6QDL_PAD_CSI0_DAT9__GPIO5_IO27 0x40013070
++ >;
++ };
++
+ pinctrl_microsom_uart1: microsom-uart1 {
+ fsl,pins = <
+ MX6QDL_PAD_CSI0_DAT10__UART1_TX_DATA 0x1b0b1
+ MX6QDL_PAD_CSI0_DAT11__UART1_RX_DATA 0x1b0b1
+ >;
+ };
++
++ pinctrl_microsom_uart4_1: microsom-uart4 {
++ fsl,pins = <
++ MX6QDL_PAD_CSI0_DAT12__UART4_TX_DATA 0x1b0b1
++ MX6QDL_PAD_CSI0_DAT13__UART4_RX_DATA 0x1b0b1
++ MX6QDL_PAD_CSI0_DAT16__UART4_RTS_B 0x1b0b1
++ MX6QDL_PAD_CSI0_DAT17__UART4_CTS_B 0x1b0b1
++ >;
++ };
++
++ pinctrl_microsom_usdhc1: microsom-usdhc1 {
++ fsl,pins = <
++ MX6QDL_PAD_SD1_CMD__SD1_CMD 0x17059
++ MX6QDL_PAD_SD1_CLK__SD1_CLK 0x10059
++ MX6QDL_PAD_SD1_DAT0__SD1_DATA0 0x17059
++ MX6QDL_PAD_SD1_DAT1__SD1_DATA1 0x17059
++ MX6QDL_PAD_SD1_DAT2__SD1_DATA2 0x17059
++ MX6QDL_PAD_SD1_DAT3__SD1_DATA3 0x17059
++ >;
++ };
+ };
+ };
+
+@@ -18,3 +98,23 @@
+ pinctrl-0 = <&pinctrl_microsom_uart1>;
+ status = "okay";
+ };
++
++/* UART4 - Connected to optional BRCM Wifi/BT/FM */
++&uart4 {
++ pinctrl-names = "default";
++ pinctrl-0 = <&pinctrl_microsom_brcm_bt &pinctrl_microsom_uart4_1>;
++ fsl,uart-has-rtscts;
++ status = "okay";
++};
++
++/* USDHC1 - Connected to optional BRCM Wifi/BT/FM */
++&usdhc1 {
++ card-external-vcc-supply = <&reg_brcm>;
++ card-reset-gpios = <&gpio5 26 GPIO_ACTIVE_LOW>, <&gpio6 0 GPIO_ACTIVE_LOW>;
++ keep-power-in-suspend;
++ non-removable;
++ pinctrl-names = "default";
++ pinctrl-0 = <&pinctrl_microsom_brcm_wifi &pinctrl_microsom_usdhc1>;
++ vmmc-supply = <&reg_brcm>;
++ status = "okay";
++};
+diff -Nur linux-3.18.8.orig/Documentation/devicetree/bindings/mmc/mmc.txt linux-3.18.8/Documentation/devicetree/bindings/mmc/mmc.txt
+--- linux-3.18.8.orig/Documentation/devicetree/bindings/mmc/mmc.txt 2015-02-27 02:49:36.000000000 +0100
++++ linux-3.18.8/Documentation/devicetree/bindings/mmc/mmc.txt 2015-03-02 03:25:33.000000000 +0100
+@@ -5,6 +5,8 @@
+ Interpreted by the OF core:
+ - reg: Registers location and length.
+ - interrupts: Interrupts used by the MMC controller.
++- clocks: Clocks needed for the host controller, if any.
++- clock-names: Goes with clocks above.
+
+ Card detection:
+ If no property below is supplied, host native card detect is used.
+@@ -43,6 +45,15 @@
+ - dsr: Value the card's (optional) Driver Stage Register (DSR) should be
+ programmed with. Valid range: [0 .. 0xffff].
+
++Card power and reset control:
++The following properties can be specified for cases where the MMC
++peripheral needs additional reset, regulator and clock lines. It is for
++example common for WiFi/BT adapters to have these separate from the main
++MMC bus:
++ - card-reset-gpios: Specify GPIOs for card reset (reset active low)
++ - card-external-vcc-supply: Regulator to drive (independent) card VCC
++ - clock with name "card_ext_clock": External clock provided to the card
++
+ *NOTE* on CD and WP polarity. To use common for all SD/MMC host controllers line
+ polarity properties, we have to fix the meaning of the "normal" and "inverted"
+ line levels. We choose to follow the SDHCI standard, which specifies both those
+diff -Nur linux-3.18.8.orig/drivers/mmc/core/core.c linux-3.18.8/drivers/mmc/core/core.c
+--- linux-3.18.8.orig/drivers/mmc/core/core.c 2015-02-27 02:49:36.000000000 +0100
++++ linux-3.18.8/drivers/mmc/core/core.c 2015-03-02 03:25:33.000000000 +0100
+@@ -13,11 +13,13 @@
+ #include <linux/module.h>
+ #include <linux/init.h>
+ #include <linux/interrupt.h>
++#include <linux/clk.h>
+ #include <linux/completion.h>
+ #include <linux/device.h>
+ #include <linux/delay.h>
+ #include <linux/pagemap.h>
+ #include <linux/err.h>
++#include <linux/gpio/consumer.h>
+ #include <linux/leds.h>
+ #include <linux/scatterlist.h>
+ #include <linux/log2.h>
+@@ -1507,6 +1509,43 @@
+ mmc_host_clk_release(host);
+ }
+
++static void mmc_card_power_up(struct mmc_host *host)
++{
++ int i;
++ struct gpio_desc **gds = host->card_reset_gpios;
++
++ for (i = 0; i < ARRAY_SIZE(host->card_reset_gpios); i++) {
++ if (gds[i]) {
++ dev_dbg(host->parent, "Asserting reset line %d", i);
++ gpiod_set_value(gds[i], 1);
++ }
++ }
++
++ if (host->card_regulator) {
++ dev_dbg(host->parent, "Enabling external regulator");
++ if (regulator_enable(host->card_regulator))
++ dev_err(host->parent, "Failed to enable external regulator");
++ }
++
++ if (host->card_clk) {
++ dev_dbg(host->parent, "Enabling external clock");
++ clk_prepare_enable(host->card_clk);
++ }
++
++ /* 2ms delay to let clocks and power settle */
++ mmc_delay(20);
++
++ for (i = 0; i < ARRAY_SIZE(host->card_reset_gpios); i++) {
++ if (gds[i]) {
++ dev_dbg(host->parent, "Deasserting reset line %d", i);
++ gpiod_set_value(gds[i], 0);
++ }
++ }
++
++ /* 2ms delay to after reset release */
++ mmc_delay(20);
++}
++
+ /*
+ * Apply power to the MMC stack. This is a two-stage process.
+ * First, we enable power to the card without the clock running.
+@@ -1523,6 +1562,9 @@
+ if (host->ios.power_mode == MMC_POWER_ON)
+ return;
+
++ /* Power up the card/module first, if needed */
++ mmc_card_power_up(host);
++
+ mmc_host_clk_hold(host);
+
+ host->ios.vdd = fls(ocr) - 1;
+diff -Nur linux-3.18.8.orig/drivers/mmc/core/host.c linux-3.18.8/drivers/mmc/core/host.c
+--- linux-3.18.8.orig/drivers/mmc/core/host.c 2015-02-27 02:49:36.000000000 +0100
++++ linux-3.18.8/drivers/mmc/core/host.c 2015-03-02 03:26:23.000000000 +0100
+@@ -12,14 +12,18 @@
+ * MMC host class device management
+ */
+
++#include <linux/kernel.h>
++#include <linux/clk.h>
+ #include <linux/device.h>
+ #include <linux/err.h>
++#include <linux/gpio/consumer.h>
+ #include <linux/idr.h>
+ #include <linux/of.h>
+ #include <linux/of_gpio.h>
+ #include <linux/pagemap.h>
+ #include <linux/export.h>
+ #include <linux/leds.h>
++#include <linux/regulator/consumer.h>
+ #include <linux/slab.h>
+ #include <linux/suspend.h>
+
+@@ -466,6 +470,66 @@
+
+ EXPORT_SYMBOL(mmc_of_parse);
+
++static int mmc_of_parse_child(struct mmc_host *host)
++{
++ struct device_node *np;
++ struct clk *clk;
++ int i;
++
++ if (!host->parent || !host->parent->of_node)
++ return 0;
++
++ np = host->parent->of_node;
++
++ host->card_regulator = regulator_get(host->parent, "card-external-vcc");
++ if (IS_ERR(host->card_regulator)) {
++ if (PTR_ERR(host->card_regulator) == -EPROBE_DEFER)
++ return PTR_ERR(host->card_regulator);
++ host->card_regulator = NULL;
++ }
++
++ /* Parse card power/reset/clock control */
++ if (of_find_property(np, "card-reset-gpios", NULL)) {
++ struct gpio_desc *gpd;
++ int level = 0;
++
++ /*
++ * If the regulator is enabled, then we can hold the
++ * card in reset with an active high resets. Otherwise,
++ * hold the resets low.
++ */
++ if (host->card_regulator && regulator_is_enabled(host->card_regulator))
++ level = 1;
++
++ for (i = 0; i < ARRAY_SIZE(host->card_reset_gpios); i++) {
++ gpd = devm_gpiod_get_index(host->parent, "card-reset", i);
++ if (IS_ERR(gpd)) {
++ if (PTR_ERR(gpd) == -EPROBE_DEFER)
++ return PTR_ERR(gpd);
++ break;
++ }
++ gpiod_direction_output(gpd, gpiod_is_active_low(gpd) | level);
++ host->card_reset_gpios[i] = gpd;
++ }
++
++ gpd = devm_gpiod_get_index(host->parent, "card-reset", ARRAY_SIZE(host->card_reset_gpios));
++ if (!IS_ERR(gpd)) {
++ dev_warn(host->parent, "More reset gpios than we can handle");
++ gpiod_put(gpd);
++ }
++ }
++
++ clk = of_clk_get_by_name(np, "card_ext_clock");
++ if (IS_ERR(clk)) {
++ if (PTR_ERR(clk) == -EPROBE_DEFER)
++ return PTR_ERR(clk);
++ clk = NULL;
++ }
++ host->card_clk = clk;
++
++ return 0;
++}
++
+ /**
+ * mmc_alloc_host - initialise the per-host structure.
+ * @extra: sizeof private data structure
+@@ -545,6 +609,10 @@
+ {
+ int err;
+
++ err = mmc_of_parse_child(host);
++ if (err)
++ return err;
++
+ WARN_ON((host->caps & MMC_CAP_SDIO_IRQ) &&
+ !host->ops->enable_sdio_irq);
+
+diff -Nur linux-3.18.8.orig/drivers/mmc/host/dw_mmc.c linux-3.18.8/drivers/mmc/host/dw_mmc.c
+--- linux-3.18.8.orig/drivers/mmc/host/dw_mmc.c 2015-02-27 02:49:36.000000000 +0100
++++ linux-3.18.8/drivers/mmc/host/dw_mmc.c 2015-03-02 03:25:56.000000000 +0100
+@@ -2211,6 +2211,8 @@
+ if (!mmc)
+ return -ENOMEM;
+
++ mmc_of_parse(mmc);
++
+ slot = mmc_priv(mmc);
+ slot->id = id;
+ slot->mmc = mmc;
+diff -Nur linux-3.18.8.orig/drivers/mmc/host/dw_mmc.c.orig linux-3.18.8/drivers/mmc/host/dw_mmc.c.orig
+--- linux-3.18.8.orig/drivers/mmc/host/dw_mmc.c.orig 1970-01-01 01:00:00.000000000 +0100
++++ linux-3.18.8/drivers/mmc/host/dw_mmc.c.orig 2015-02-27 02:49:36.000000000 +0100
+@@ -0,0 +1,2855 @@
++/*
++ * Synopsys DesignWare Multimedia Card Interface driver
++ * (Based on NXP driver for lpc 31xx)
++ *
++ * Copyright (C) 2009 NXP Semiconductors
++ * Copyright (C) 2009, 2010 Imagination Technologies Ltd.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ */
++
++#include <linux/blkdev.h>
++#include <linux/clk.h>
++#include <linux/debugfs.h>
++#include <linux/device.h>
++#include <linux/dma-mapping.h>
++#include <linux/err.h>
++#include <linux/init.h>
++#include <linux/interrupt.h>
++#include <linux/ioport.h>
++#include <linux/module.h>
++#include <linux/platform_device.h>
++#include <linux/seq_file.h>
++#include <linux/slab.h>
++#include <linux/stat.h>
++#include <linux/delay.h>
++#include <linux/irq.h>
++#include <linux/mmc/host.h>
++#include <linux/mmc/mmc.h>
++#include <linux/mmc/sd.h>
++#include <linux/mmc/sdio.h>
++#include <linux/mmc/dw_mmc.h>
++#include <linux/bitops.h>
++#include <linux/regulator/consumer.h>
++#include <linux/workqueue.h>
++#include <linux/of.h>
++#include <linux/of_gpio.h>
++#include <linux/mmc/slot-gpio.h>
++
++#include "dw_mmc.h"
++
++/* Common flag combinations */
++#define DW_MCI_DATA_ERROR_FLAGS (SDMMC_INT_DRTO | SDMMC_INT_DCRC | \
++ SDMMC_INT_HTO | SDMMC_INT_SBE | \
++ SDMMC_INT_EBE)
++#define DW_MCI_CMD_ERROR_FLAGS (SDMMC_INT_RTO | SDMMC_INT_RCRC | \
++ SDMMC_INT_RESP_ERR)
++#define DW_MCI_ERROR_FLAGS (DW_MCI_DATA_ERROR_FLAGS | \
++ DW_MCI_CMD_ERROR_FLAGS | SDMMC_INT_HLE)
++#define DW_MCI_SEND_STATUS 1
++#define DW_MCI_RECV_STATUS 2
++#define DW_MCI_DMA_THRESHOLD 16
++
++#define DW_MCI_FREQ_MAX 200000000 /* unit: HZ */
++#define DW_MCI_FREQ_MIN 400000 /* unit: HZ */
++
++#ifdef CONFIG_MMC_DW_IDMAC
++#define IDMAC_INT_CLR (SDMMC_IDMAC_INT_AI | SDMMC_IDMAC_INT_NI | \
++ SDMMC_IDMAC_INT_CES | SDMMC_IDMAC_INT_DU | \
++ SDMMC_IDMAC_INT_FBE | SDMMC_IDMAC_INT_RI | \
++ SDMMC_IDMAC_INT_TI)
++
++struct idmac_desc {
++ u32 des0; /* Control Descriptor */
++#define IDMAC_DES0_DIC BIT(1)
++#define IDMAC_DES0_LD BIT(2)
++#define IDMAC_DES0_FD BIT(3)
++#define IDMAC_DES0_CH BIT(4)
++#define IDMAC_DES0_ER BIT(5)
++#define IDMAC_DES0_CES BIT(30)
++#define IDMAC_DES0_OWN BIT(31)
++
++ u32 des1; /* Buffer sizes */
++#define IDMAC_SET_BUFFER1_SIZE(d, s) \
++ ((d)->des1 = ((d)->des1 & 0x03ffe000) | ((s) & 0x1fff))
++
++ u32 des2; /* buffer 1 physical address */
++
++ u32 des3; /* buffer 2 physical address */
++};
++#endif /* CONFIG_MMC_DW_IDMAC */
++
++static bool dw_mci_reset(struct dw_mci *host);
++
++#if defined(CONFIG_DEBUG_FS)
++static int dw_mci_req_show(struct seq_file *s, void *v)
++{
++ struct dw_mci_slot *slot = s->private;
++ struct mmc_request *mrq;
++ struct mmc_command *cmd;