From d977cbc2093f5bffb19e00ea36f465f28fb97b8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Wed, 9 Aug 2017 09:26:46 +0200 Subject: [PATCH] [arm64] Add sdhci device for Espressobin This completes the fix for #871049 --- debian/changelog | 4 +- ...l-armada-37xx-Enable-uSD-on-ESPRESSO.patch | 71 +++++++++++++++++++ ...l-Enable-second-SDHCI-controller-in-.patch | 67 +++++++++++++++++ debian/patches/series | 2 + 4 files changed, 142 insertions(+), 2 deletions(-) create mode 100644 debian/patches/features/arm64/ARM64-dts-marvell-armada-37xx-Enable-uSD-on-ESPRESSO.patch create mode 100644 debian/patches/features/arm64/arm64-dts-marvell-Enable-second-SDHCI-controller-in-.patch diff --git a/debian/changelog b/debian/changelog index 8721767d3..23c5f2243 100644 --- a/debian/changelog +++ b/debian/changelog @@ -259,8 +259,8 @@ linux (4.12.5-1~exp1) UNRELEASED; urgency=medium * media: saa7164: fix double fetch PCIe access condition (CVE-2017-8831) [ Uwe Kleine-König ] - * [arm64] enable MMC_SDHCI_XENON and MVNETA for Espressobin - (Closes: #871049) + * [arm64] enable MMC_SDHCI_XENON and MVNETA for Espressobin and enable + respective device in its device tree (Closes: #871049) -- Ben Hutchings Tue, 18 Jul 2017 13:26:41 +0100 diff --git a/debian/patches/features/arm64/ARM64-dts-marvell-armada-37xx-Enable-uSD-on-ESPRESSO.patch b/debian/patches/features/arm64/ARM64-dts-marvell-armada-37xx-Enable-uSD-on-ESPRESSO.patch new file mode 100644 index 000000000..f9088ec5d --- /dev/null +++ b/debian/patches/features/arm64/ARM64-dts-marvell-armada-37xx-Enable-uSD-on-ESPRESSO.patch @@ -0,0 +1,71 @@ +From: Marcin Wojtas +Date: Fri, 21 Jul 2017 01:50:36 +0200 +Subject: [PATCH] ARM64: dts: marvell: armada-37xx: Enable uSD on ESPRESSObin +Origin: https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=9be778f6c6d8f90ff2fad88d1770e2a7843aee43 +Bug-Debian: https://bugs.debian.org/871049 + +The ESPRESSObin board exposes one of the SDHCI interfaces +via J1 uSD slot. This patch enables it. + +Tested-by: Miquel Raynal +Signed-off-by: Marcin Wojtas +Signed-off-by: Zbigniew Bodek +[gregory.clement@free-electrons.com: removed "no-1-8-v"] +Signed-off-by: Gregory CLEMENT +--- + .../boot/dts/marvell/armada-3720-espressobin.dts | 25 ++++++++++++++++++++++ + 1 file changed, 25 insertions(+) + +diff --git a/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts b/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts +index b1af3f988b29..2ce52ba74f73 100644 +--- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts ++++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts +@@ -45,6 +45,7 @@ + + /dts-v1/; + ++#include + #include "armada-372x.dtsi" + + / { +@@ -59,6 +60,20 @@ + device_type = "memory"; + reg = <0x00000000 0x00000000 0x00000000 0x20000000>; + }; ++ ++ vcc_sd_reg1: regulator { ++ compatible = "regulator-gpio"; ++ regulator-name = "vcc_sd1"; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-boot-on; ++ ++ gpios = <&gpionb 4 GPIO_ACTIVE_HIGH>; ++ gpios-states = <0>; ++ states = <1800000 0x1 ++ 3300000 0x0>; ++ enable-active-high; ++ }; + }; + + /* J9 */ +@@ -71,6 +86,16 @@ + status = "okay"; + }; + ++/* J1 */ ++&sdhci1 { ++ wp-inverted; ++ bus-width = <4>; ++ cd-gpios = <&gpionb 3 GPIO_ACTIVE_LOW>; ++ marvell,pad-type = "sd"; ++ vqmmc-supply = <&vcc_sd_reg1>; ++ status = "okay"; ++}; ++ + /* Exported on the micro USB connector J5 through an FTDI */ + &uart0 { + status = "okay"; +-- +2.13.2 + diff --git a/debian/patches/features/arm64/arm64-dts-marvell-Enable-second-SDHCI-controller-in-.patch b/debian/patches/features/arm64/arm64-dts-marvell-Enable-second-SDHCI-controller-in-.patch new file mode 100644 index 000000000..0bdc9797f --- /dev/null +++ b/debian/patches/features/arm64/arm64-dts-marvell-Enable-second-SDHCI-controller-in-.patch @@ -0,0 +1,67 @@ +From 1208d2f0c84120d4e3eb2caf663a9a8b784b38ba Mon Sep 17 00:00:00 2001 +From: Konstantin Porotchkin +Date: Tue, 23 May 2017 16:11:40 +0300 +Subject: [PATCH] arm64: dts: marvell: Enable second SDHCI controller in Armada + 37xx +Origin: https://git.kernel.org/linus/1208d2f0c84120d4e3eb2caf663a9a8b784b38ba +Bug-Debian: https://bugs.debian.org/871049 + +The Armada 37xx SoCs has 2 SDHCI interfaces. This patch adds the second +one. + +Moreover, the Armada 37xx DB v2 board populates the 2 SDHCI interfaces. + +The second interface is using pluggable module that can either +have an SD connector or eMMC on it. +This patch adds support for SD module in the device DT. + +[ gregory.clement@free-electrons.com: + - Add more detail in commit log + - Sort the dt node in address order + - Document the SD slot in the dts ] + +Signed-off-by: Konstantin Porotchkin +Signed-off-by: Gregory CLEMENT +--- + arch/arm64/boot/dts/marvell/armada-3720-db.dts | 9 +++++++++ + arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 11 +++++++++++ + 2 files changed, 20 insertions(+) + +--- a/arch/arm64/boot/dts/marvell/armada-3720-db.dts ++++ b/arch/arm64/boot/dts/marvell/armada-3720-db.dts +@@ -113,6 +113,15 @@ + status = "okay"; + }; + ++/* SD slot module on CON14(V2.0)/CON15(V1.4) */ ++&sdhci1 { ++ wp-inverted; ++ cd-gpios = <&gpiosb 2 GPIO_ACTIVE_LOW>; ++ bus-width = <4>; ++ marvell,pad-type = "sd"; ++ status = "okay"; ++}; ++ + &spi0 { + status = "okay"; + pinctrl-names = "default"; +--- a/arch/arm64/boot/dts/marvell/armada-37xx.dtsi ++++ b/arch/arm64/boot/dts/marvell/armada-37xx.dtsi +@@ -288,6 +288,17 @@ + }; + }; + ++ sdhci1: sdhci@d0000 { ++ compatible = "marvell,armada-3700-sdhci", ++ "marvell,sdhci-xenon"; ++ reg = <0xd0000 0x300>, ++ <0x1e808 0x4>; ++ interrupts = ; ++ clocks = <&nb_periph_clk 0>; ++ clock-names = "core"; ++ status = "disabled"; ++ }; ++ + sdhci0: sdhci@d8000 { + compatible = "marvell,armada-3700-sdhci", + "marvell,sdhci-xenon"; diff --git a/debian/patches/series b/debian/patches/series index 774c306b6..6cf81f4f3 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -73,6 +73,8 @@ features/arm/arm-dts-rockchip-add-arm-mali-gpu-node-for-rk3288.patch features/arm/arm-dts-rockchip-enable-arm-mali-gpu-on-rk3288-rock2.patch features/arm/arm-dts-rockchip-enable-arm-mali-gpu-on-rk3288-firef.patch features/arm/arm-dts-rockchip-enable-arm-mali-gpu-on-rk3288-veyro.patch +features/arm64/arm64-dts-marvell-Enable-second-SDHCI-controller-in-.patch +features/arm64/ARM64-dts-marvell-armada-37xx-Enable-uSD-on-ESPRESSO.patch # Miscellaneous bug fixes bugfix/all/kbuild-use-nostdinc-in-compile-tests.patch