Skip to contentSkip to conversation

Add support for the Armada-370-based Seagate NAS

PATCH Superseded Simon Guinot 2 participants 7 messages Sep 30, 2015

Subsystems (5)

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v4 cover Add support for the Armada-370-based Seagate NAS

Hi,

This patch series adds support for the Seagate machines based on the Armada-370 Marvell SoC. This includes the Personal Cloud 1 and 2-Bay and the Seagate NAS 2 and 4-Bay.

The purpose for this new version is to fix a cpuidle issue on Personal Cloud boards. Due to an hardware bug, all the CPU power supply units are turned off (instead of 1.1V only) when entering in "deepidle" mode. This triggers a CPU reset. As a consequence, we need a way to disable "deepidle" mode for this boards.

As an answer, a patch introducing a "broken-idle" coherency-fabric DT property has been added to the series. This new property allows to disable cpuidle support if not supported by hardware.

Additionally, a patch enabling the "broken-idle" option for Armada 38x SoCs has been added as well. Since cpuidle is also broken on this SoCs, it makes sense to enable the "broken-idle" property with them.

Thanks,

Simon

Changes for v2:
- Rename DTS files using the products names.
- Update model and compatible properties as well.
- Add some information allowing to identify the devices in the commit message and in the DTS files headers.
- Remove duplicated rtc alias in armada-370-seagate-nas-xbay.dtsi.

Changes for v3:
- Use GPIO_ACTIVE_HIGH instead of 0 in gpios property (gpio-fan node).
- Fix spelling for Personal Cloud DTS files: 'personal' instead of 'personnal'.
- Add Andrew's Acked-by.

Changes for v4:
- Introduces a DT coherency-fabric property: broken-idle.
- Use this new property to disable cpuidle support on Personal Cloud boards.
- Use this new property with Armada 38x SoCs as well.

Thanks,

Simon

Simon Guinot (2):
ARM: mvebu: add DT support for Seagate Personal Cloud
ARM: mvebu: enable options for Seagate NAS in mvebu_v7_defconfig

Vincent Donnefort (3):
ARM: mvebu: add broken-idle option
ARM: mvebu: enable broken-idle on Armada 38x
ARM: mvebu: add DT support for Seagate NAS 2 and 4-Bay

 .../devicetree/bindings/arm/coherency-fabric.txt   |   4 +
 arch/arm/boot/dts/Makefile                         |   4 +
 arch/arm/boot/dts/armada-370-seagate-nas-2bay.dts  |  36 ++++
 arch/arm/boot/dts/armada-370-seagate-nas-4bay.dts  | 133 ++++++++++++
 arch/arm/boot/dts/armada-370-seagate-nas-xbay.dtsi | 231 +++++++++++++++++++++
 .../dts/armada-370-seagate-personal-cloud-2bay.dts |  51 +++++
 .../boot/dts/armada-370-seagate-personal-cloud.dts |  37 ++++
 .../dts/armada-370-seagate-personal-cloud.dtsi     | 178 ++++++++++++++++
 arch/arm/boot/dts/armada-38x.dtsi                  |   1 +
 arch/arm/configs/mvebu_v7_defconfig                |   9 +-
 arch/arm/mach-mvebu/pmsu.c                         |  32 ++-
 11 files changed, 709 insertions(+), 7 deletions(-)
 create mode 100644 arch/arm/boot/dts/armada-370-seagate-nas-2bay.dts
 create mode 100644 arch/arm/boot/dts/armada-370-seagate-nas-4bay.dts
 create mode 100644 arch/arm/boot/dts/armada-370-seagate-nas-xbay.dtsi
 create mode 100644 arch/arm/boot/dts/armada-370-seagate-personal-cloud-2bay.dts
 create mode 100644 arch/arm/boot/dts/armada-370-seagate-personal-cloud.dts
 create mode 100644 arch/arm/boot/dts/armada-370-seagate-personal-cloud.dtsi
Signature · 1 line
2.1.4
#1 lore raw

PATCH v4 1/5 ARM: mvebu: add broken-idle option

From: Vincent Donnefort <[email protected]>

The broken-idle option can be activated from the coherency-fabric DT node. This property allows to disable the idle capability, when the hardware doesn't support it, like the Seagate Personal Cloud boards.

---
 .../devicetree/bindings/arm/coherency-fabric.txt   |  4 +++
 arch/arm/mach-mvebu/pmsu.c                         | 32 ++++++++++++++++++----
 2 files changed, 30 insertions(+), 6 deletions(-)
Documentation/devicetree/bindings/arm/coherency-fabric.txt +4 -0
index 8dd46617c889..1b6268dbe477 100644
@@ -27,6 +27,10 @@ Required properties:
  * For "marvell,armada-380-coherency-fabric", only one pair is needed
    for the per-CPU fabric registers.
 
+Optional properties:
+
+- broken-idle: Must be set when the Idle mode is not supported by the hardware.
+
 Examples:
 
 coherency-fabric at d0020200 {
arch/arm/mach-mvebu/pmsu.c +26 -6
index e8fdb9ceedf0..953ab62f0593 100644
@@ -379,6 +379,16 @@ static struct notifier_block mvebu_v7_cpu_pm_notifier = {
 
 static struct platform_device mvebu_v7_cpuidle_device;
 
+static int broken_idle(struct device_node *np)
+{
+	if (of_get_property(np, "broken-idle", NULL)) {
+		pr_warn("CPU idle is currently broken: disabling");
+		return 0;
+	}
+
+	return 1;
+}
+
 static __init int armada_370_cpuidle_init(void)
 {
 	struct device_node *np;
@@ -387,7 +397,9 @@ static __init int armada_370_cpuidle_init(void)
 	np = of_find_compatible_node(NULL, NULL, "marvell,coherency-fabric");
 	if (!np)
 		return -ENODEV;
-	of_node_put(np);
+
+	if (!broken_idle(np))
+		goto end;
 
 	/*
 	 * On Armada 370, there is "a slow exit process from the deep
@@ -406,6 +418,8 @@ static __init int armada_370_cpuidle_init(void)
 	mvebu_v7_cpuidle_device.dev.platform_data = armada_370_xp_cpu_suspend;
 	mvebu_v7_cpuidle_device.name = "cpuidle-armada-370";
 
+end:
+	of_node_put(np);
 	return 0;
 }
 
@@ -415,13 +429,14 @@ static __init int armada_38x_cpuidle_init(void)
 	void __iomem *mpsoc_base;
 	u32 reg;
 
-	pr_warn("CPU idle is currently broken on Armada 38x: disabling\n");
-	return 0;
-
 	np = of_find_compatible_node(NULL, NULL,
 				     "marvell,armada-380-coherency-fabric");
 	if (!np)
 		return -ENODEV;
+
+	if (!broken_idle(np))
+		goto end;
+
 	of_node_put(np);
 
 	np = of_find_compatible_node(NULL, NULL,
@@ -430,7 +445,6 @@ static __init int armada_38x_cpuidle_init(void)
 		return -ENODEV;
 	mpsoc_base = of_iomap(np, 0);
 	BUG_ON(!mpsoc_base);
-	of_node_put(np);
 
 	/* Set up reset mask when powering down the cpus */
 	reg = readl(mpsoc_base + MPCORE_RESET_CTL);
@@ -450,6 +464,8 @@ static __init int armada_38x_cpuidle_init(void)
 	mvebu_v7_cpuidle_device.dev.platform_data = armada_38x_cpu_suspend;
 	mvebu_v7_cpuidle_device.name = "cpuidle-armada-38x";
 
+end:
+	of_node_put(np);
 	return 0;
 }
 
@@ -460,12 +476,16 @@ static __init int armada_xp_cpuidle_init(void)
 	np = of_find_compatible_node(NULL, NULL, "marvell,coherency-fabric");
 	if (!np)
 		return -ENODEV;
-	of_node_put(np);
+
+	if (!broken_idle(np))
+		goto end;
 
 	mvebu_cpu_resume = armada_370_xp_cpu_resume;
 	mvebu_v7_cpuidle_device.dev.platform_data = armada_370_xp_cpu_suspend;
 	mvebu_v7_cpuidle_device.name = "cpuidle-armada-xp";
 
+end:
+	of_node_put(np);
 	return 0;
 }
 
Signature · 1 line
2.1.4
#2 lore raw

PATCH v4 2/5 ARM: mvebu: enable broken-idle on Armada 38x

In reply to Simon Guinot

From: Vincent Donnefort <[email protected]>

Following the broken-idle DT property introduction, this patch enables this option for the Armada 38x SoCs. This allows to deactivate the idle state which is currently broken on this SoCs.

---
 arch/arm/boot/dts/armada-38x.dtsi | 1 +
 1 file changed, 1 insertion(+)
arch/arm/boot/dts/armada-38x.dtsi +1 -0
index f9f2347d9995..6d29afe12892 100644
@@ -422,6 +422,7 @@
 			coherency-fabric at 21010 {
 				compatible = "marvell,armada-380-coherency-fabric";
 				reg = <0x21010 0x1c>;
+				broken-idle;
 			};
 
 			pmsu at 22000 {
Signature · 1 line
2.1.4
#3 lore raw

PATCH v4 2/5 ARM: mvebu: enable broken-idle on Armada 38x

Hi Simon and Vincent,

Quoted 5 lines · Simon Guinot

From: Vincent Donnefort <[email protected]>

Following the broken-idle DT property introduction, this patch enables this option for the Armada 38x SoCs. This allows to deactivate the idle state which is currently broken on this SoCs.

As explained in the previous email I would like that Armada 38x don't use this flag.

Thanks,

Gregory

Quoted 18 lines
---
 arch/arm/boot/dts/armada-38x.dtsi | 1 +
 1 file changed, 1 insertion(+)
arch/arm/boot/dts/armada-38x.dtsi +1 -0
index f9f2347d9995..6d29afe12892 100644
@@ -422,6 +422,7 @@
 			coherency-fabric at 21010 {
 				compatible = "marvell,armada-380-coherency-fabric";
 				reg = <0x21010 0x1c>;
+				broken-idle;
 			};
 
 			pmsu at 22000 {
Signature · 4 lines
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#4 lore raw

PATCH v4 3/5 ARM: mvebu: add DT support for Seagate NAS 2 and 4-Bay

In reply to Simon Guinot

From: Vincent Donnefort <[email protected]>

This patch adds DT support for the Seagate NAS 2 and 4-Bay.

Here are some information allowing to identify these devices:

Product name                 | Seagate NAS 2-Bay | Seagate NAS 4-Bay
Code name (board/PCB)        | Dart 2-Bay        | Dart 4-Bay
Model name (case sticker)    | SRPD20            | SRPD40
Material desc (product spec) | STCTxxxxxxx       | STCUxxxxxxx

Chipset list (common):
- SoC Marvell Armada 370 88F6707, CPU @1.2GHz
- SDRAM memory: 512MB DDR3 600MHz (16-bits bandwidth)
- NAND flash 256MB, 8-bits (Micron MT29F2G08AAB or Hinyx H27U2G8F2CTR-BC)
- 2 SATA II ports (SoC)
- 1 Ethernet Gigabit ports (PHY Marvell 88E1518)
- 2 USB3 host ports (PCIe controller ASM1042)
- GPIO fan (4 speeds)
- External I2C RTC (MCP7940NT)
- 3 push buttons (power, backup and reset)
- 2 SATA LEDs (bi-color, blue and red)
- 1 power LED (bi-color, blue and red)

Only on 4-Bay models:
- 2 extra SATA III ports (PCIe AHCI controller Marvell 88SE9170)
- 1 extra Ethernet Gigabit ports (PHY Marvell 88E1518)
- I2C GPIO expander (PCA9554A)
- 2 extra SATA LEDs (bi-color, blue and red)

Note that support for the white SATA LEDs associated with HDDs 0 and 1 is missing. A dedicated LED driver is needed.

---
 arch/arm/boot/dts/Makefile                         |   2 +
 arch/arm/boot/dts/armada-370-seagate-nas-2bay.dts  |  36 ++++
 arch/arm/boot/dts/armada-370-seagate-nas-4bay.dts  | 133 ++++++++++++
 arch/arm/boot/dts/armada-370-seagate-nas-xbay.dtsi | 231 +++++++++++++++++++++
 4 files changed, 402 insertions(+)
 create mode 100644 arch/arm/boot/dts/armada-370-seagate-nas-2bay.dts
 create mode 100644 arch/arm/boot/dts/armada-370-seagate-nas-4bay.dts
 create mode 100644 arch/arm/boot/dts/armada-370-seagate-nas-xbay.dtsi

Changes for v2:
- Rename DTS files using the products names.
- Update model and compatible properties as well.
- Add some information allowing to identify the devices in the commit message and in the DTS files headers.
- Remove duplicated rtc alias in armada-370-seagate-nas-xbay.dtsi.

Changes for v3:
- Use GPIO_ACTIVE_HIGH instead of 0 in gpios property (gpio-fan node).
- Add Andrew's Acked-by.

arch/arm/boot/dts/Makefile +2 -0
index 1c5f22525a8b..a0cc0b63db41 100644
@@ -710,6 +710,8 @@ dtb-$(CONFIG_MACH_ARMADA_370) += \
 	armada-370-netgear-rn102.dtb \
 	armada-370-netgear-rn104.dtb \
 	armada-370-rd.dtb \
+	armada-370-seagate-nas-2bay.dtb \
+	armada-370-seagate-nas-4bay.dtb \
 	armada-370-synology-ds213j.dtb
 dtb-$(CONFIG_MACH_ARMADA_375) += \
 	armada-375-db.dtb
arch/arm/boot/dts/armada-370-seagate-nas-2bay.dts new file +36 -0
new file mode 100644
index 000000000000..fef0110a8d8a
@@ -0,0 +1,36 @@
+/*
+ * Device Tree file for Seagate NAS 2-Bay (Armada 370 SoC).
+ *
+ * Copyright (C) 2015 Seagate
+ *
+ * Author: Vincent Donnefort <[email protected]>
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+/*
+ * Here are some information allowing to identify the device:
+ *
+ * Product name                 : Seagate NAS 2-Bay
+ * Code name (board/PCB)        : Dart 2-Bay
+ * Model name (case sticker)    : SRPD20
+ * Material desc (product spec) : STCTxxxxxxx
+ */
+
+/dts-v1/;
+#include "armada-370-seagate-nas-xbay.dtsi"
+
+/ {
+	model = "Seagate NAS 2-Bay (Dart, SRPD20)";
+	compatible = "seagate,dart-2", "marvell,armada370", "marvell,armada-370-xp";
+
+	gpio-fan {
+		gpio-fan,speed-map =
+			<   0 3
+			  950 2
+			 1400 1
+			 1800 0>;
+	};
+};
arch/arm/boot/dts/armada-370-seagate-nas-4bay.dts new file +133 -0

133 lines not on this page · raw message

arch/arm/boot/dts/armada-370-seagate-nas-xbay.dtsi new file +231 -0

231 lines not on this page · raw message

Signature · 1 line
2.1.4
#5 lore raw

PATCH v4 4/5 ARM: mvebu: add DT support for Seagate Personal Cloud

In reply to Simon Guinot

This patch adds DT support for the Seagate Personal Cloud 1 and 2-Bay.

Here are some information allowing to identify these devices:

Product name                 | Personal Cloud | Personal Cloud 2-Bay
Code name (board/PCB)        | Cumulus        | Cumulus Max
Model name (case sticker)    | SRN21C         | SRN22C
Material desc (product spec) | STCRxxxxxxx    | STCSxxxxxxx

Chipset list:
- SoC Marvell Armada 370 88F6707, CPU @1GHz
- SDRAM memory: 512MB DDR3 667MHz (16-bits bandwidth)
- SPI flash 1MB (Macronix MX25L8006E)
- 1 or 2 SATA internal ports
- 1 Ethernet Gigabit port (PHY Marvell 88E1518)
- 1 USB3 host port (PCIe controller ASM1042)
- 1 USB2 host port (SoC)
- 2 push buttons (power and reset)
- 1 SATA LED (bi-color, white and red)

Note that support for the white SATA LED is missing. A dedicated LED driver is needed.

---
 arch/arm/boot/dts/Makefile                         |   2 +
 .../dts/armada-370-seagate-personal-cloud-2bay.dts |  51 ++++++
 .../boot/dts/armada-370-seagate-personal-cloud.dts |  37 +++++
 .../dts/armada-370-seagate-personal-cloud.dtsi     | 178 +++++++++++++++++++++
 4 files changed, 268 insertions(+)
 create mode 100644 arch/arm/boot/dts/armada-370-seagate-personal-cloud-2bay.dts
 create mode 100644 arch/arm/boot/dts/armada-370-seagate-personal-cloud.dts
 create mode 100644 arch/arm/boot/dts/armada-370-seagate-personal-cloud.dtsi

Changes for v2:
- Rename DTS files using the products names.
- Update model and compatible properties as well.
- Add some information allowing to identify the devices in the commit message and in the DTS files headers.

Changes for v3:
- Fix spelling for Personal Cloud DTS files: 'personal' instead of 'personnal'.
- Add Andrew's Acked-by.

Changes for v4:
- Add "broken-idle" property in the coherency-fabric DT node.

arch/arm/boot/dts/Makefile +2 -0
index a0cc0b63db41..8e83da127a9c 100644
@@ -712,6 +712,8 @@ dtb-$(CONFIG_MACH_ARMADA_370) += \
 	armada-370-rd.dtb \
 	armada-370-seagate-nas-2bay.dtb \
 	armada-370-seagate-nas-4bay.dtb \
+	armada-370-seagate-personal-cloud.dtb \
+	armada-370-seagate-personal-cloud-2bay.dtb \
 	armada-370-synology-ds213j.dtb
 dtb-$(CONFIG_MACH_ARMADA_375) += \
 	armada-375-db.dtb
arch/arm/boot/dts/armada-370-seagate-personal-cloud-2bay.dts new file +51 -0

51 lines not on this page · raw message

arch/arm/boot/dts/armada-370-seagate-personal-cloud.dts new file +37 -0
new file mode 100644
index 000000000000..aad39e97af43
@@ -0,0 +1,37 @@
+/*
+ * Device Tree file for Seagate Personal Cloud NAS (Armada 370 SoC).
+ *
+ * Copyright (C) 2015 Seagate
+ *
+ * Author: Simon Guinot <[email protected]>
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+/*
+ * Here are some information allowing to identify the device:
+ *
+ * Product name                 : Seagate Personal Cloud
+ * Code name (board/PCB)        : Cumulus
+ * Model name (case sticker)    : SRN21C
+ * Material desc (product spec) : STCRxxxxxxx
+ */
+
+/dts-v1/;
+#include "armada-370-seagate-personal-cloud.dtsi"
+
+/ {
+	model = "Seagate Personal Cloud (Cumulus, SRN21C)";
+	compatible = "seagate,cumulus", "marvell,armada370", "marvell,armada-370-xp";
+
+	soc {
+		internal-regs {
+			sata at a0000 {
+				status = "okay";
+				nr-ports = <1>;
+			};
+		};
+	};
+};
arch/arm/boot/dts/armada-370-seagate-personal-cloud.dtsi new file +178 -0

178 lines not on this page · raw message

Signature · 1 line
2.1.4
#6 lore raw

PATCH v4 5/5 ARM: mvebu: enable options for Seagate NAS in mvebu_v7_defconfig

In reply to Simon Guinot

This patch enables the following options needed by the Seagate Personal Cloud 1 and 2-Bay and the Seagate NAS 2 and 4-Bay:

SATA_AHCI
POWER_RESET_GPIO
RTC_DRV_DS1307
RTC_DRV_PCF8563

Additionnally this patch also enables NEW_LEDS which was missing for some reasons.

---
 arch/arm/configs/mvebu_v7_defconfig | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Changes for v3:
- Add Andrew's Acked-by.

arch/arm/configs/mvebu_v7_defconfig +8 -1
index 13fcd020e375..c6729bf0a8dd 100644
@@ -61,6 +61,7 @@ CONFIG_MTD_SPI_NOR=y
 CONFIG_EEPROM_AT24=y
 CONFIG_BLK_DEV_SD=y
 CONFIG_ATA=y
+CONFIG_SATA_AHCI=y
 CONFIG_AHCI_MVEBU=y
 CONFIG_SATA_MV=y
 CONFIG_NETDEVICES=y
@@ -85,6 +86,9 @@ CONFIG_SPI=y
 CONFIG_SPI_ORION=y
 CONFIG_GPIO_SYSFS=y
 CONFIG_GPIO_PCA953X=y
+CONFIG_POWER_SUPPLY=y
+CONFIG_POWER_RESET=y
+CONFIG_POWER_RESET_GPIO=y
 CONFIG_SENSORS_GPIO_FAN=y
 CONFIG_THERMAL=y
 CONFIG_ARMADA_THERMAL=y
@@ -111,12 +115,15 @@ CONFIG_MMC_SDHCI_PLTFM=y
 CONFIG_MMC_SDHCI_DOVE=y
 CONFIG_MMC_SDHCI_PXAV3=y
 CONFIG_MMC_MVSDIO=y
-CONFIG_LEDS_GPIO=y
+CONFIG_NEW_LEDS=y
 CONFIG_LEDS_CLASS=y
+CONFIG_LEDS_GPIO=y
 CONFIG_LEDS_TRIGGERS=y
 CONFIG_LEDS_TRIGGER_TIMER=y
 CONFIG_LEDS_TRIGGER_HEARTBEAT=y
 CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_DS1307=y
+CONFIG_RTC_DRV_PCF8563=y
 CONFIG_RTC_DRV_S35390A=y
 CONFIG_RTC_DRV_MV=y
 CONFIG_RTC_DRV_ARMADA38X=y
Signature · 1 line
2.1.4