linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/9] ata: ahci_platform: support allwinner R40 AHCI
@ 2018-09-03 10:01 Corentin Labbe
  2018-09-03 10:01 ` [PATCH v5 1/9] dt-bindings: ata: ahci-platform: fix indentation of target-supply Corentin Labbe
                   ` (10 more replies)
  0 siblings, 11 replies; 17+ messages in thread
From: Corentin Labbe @ 2018-09-03 10:01 UTC (permalink / raw)
  To: axboe, hdegoede, mark.rutland, maxime.ripard, robh+dt, wens
  Cc: devicetree, linux-arm-kernel, linux-ide, linux-kernel,
	linux-sunxi, Corentin Labbe

This patchset add support for allwinner R40 AHCI controller.

The whole patchset is tested on sun8i-r40-bananapi-m2-ultra and
on sun7i-a20-cubieboard2 which doesnt have any of the ressources added
by this serie, so no regression should come with it.

Patchs 1-7 should go via the ata tree
Patchs 8,9 should go via the sunxi tree

Changes since v4:
- dropped PHY dedicated driver
- added the optionnal phy-supply

Changes since v3:
- Moved PHY code to a new sun4i-a10-phy-sata driver
- Removed reset code since ahci_platform support now reset controller.

Changes since V2
- Moved all ressources management to ahci_platform

Corentin Labbe (9):
  dt-bindings: ata: ahci-platform: fix indentation of target-supply
  ata: ahci_platform: add support for AHCI controller regulator
  dt-bindings: ata: ahci-platform: document ahci-supply
  ata: ahci_platform: add support for PHY controller regulator
  dt-bindings: ata: ahci-platform: document phy-supply
  ata: ahci_sunxi: add support for r40
  dt-bindings: ata: update ahci_sunxi bindings
  ARM: dts: sun8i: r40: add sata node
  ARM: dts: sun8i: sun8i-r40-bananapi-m2-ultra: enable AHCI

 .../devicetree/bindings/ata/ahci-platform.txt      |  6 ++-
 arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts  | 18 +++++++++
 arch/arm/boot/dts/sun8i-r40.dtsi                   | 13 ++++++
 drivers/ata/ahci.h                                 |  2 +
 drivers/ata/ahci_sunxi.c                           |  3 +-
 drivers/ata/libahci_platform.c                     | 46 +++++++++++++++++++++-
 6 files changed, 84 insertions(+), 4 deletions(-)

-- 
2.16.4


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v5 1/9] dt-bindings: ata: ahci-platform: fix indentation of target-supply
  2018-09-03 10:01 [PATCH v5 0/9] ata: ahci_platform: support allwinner R40 AHCI Corentin Labbe
@ 2018-09-03 10:01 ` Corentin Labbe
  2018-09-10 16:25   ` Rob Herring
  2018-09-03 10:01 ` [PATCH v5 2/9] ata: ahci_platform: add support for AHCI controller regulator Corentin Labbe
                   ` (9 subsequent siblings)
  10 siblings, 1 reply; 17+ messages in thread
From: Corentin Labbe @ 2018-09-03 10:01 UTC (permalink / raw)
  To: axboe, hdegoede, mark.rutland, maxime.ripard, robh+dt, wens
  Cc: devicetree, linux-arm-kernel, linux-ide, linux-kernel,
	linux-sunxi, Corentin Labbe

This patch fix the indentation of target-supply's ':'.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
 Documentation/devicetree/bindings/ata/ahci-platform.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/ata/ahci-platform.txt b/Documentation/devicetree/bindings/ata/ahci-platform.txt
index 5d5bd456d9d9..b88820b4c01e 100644
--- a/Documentation/devicetree/bindings/ata/ahci-platform.txt
+++ b/Documentation/devicetree/bindings/ata/ahci-platform.txt
@@ -47,7 +47,7 @@ Sub-nodes required properties:
 - reg		    : the port number
 And at least one of the following properties:
 - phys		    : reference to the SATA PHY node
-- target-supply    : regulator for SATA target power
+- target-supply     : regulator for SATA target power
 
 Examples:
         sata@ffe08000 {
-- 
2.16.4


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v5 2/9] ata: ahci_platform: add support for AHCI controller regulator
  2018-09-03 10:01 [PATCH v5 0/9] ata: ahci_platform: support allwinner R40 AHCI Corentin Labbe
  2018-09-03 10:01 ` [PATCH v5 1/9] dt-bindings: ata: ahci-platform: fix indentation of target-supply Corentin Labbe
@ 2018-09-03 10:01 ` Corentin Labbe
  2018-09-03 10:01 ` [PATCH v5 3/9] dt-bindings: ata: ahci-platform: document ahci-supply Corentin Labbe
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 17+ messages in thread
From: Corentin Labbe @ 2018-09-03 10:01 UTC (permalink / raw)
  To: axboe, hdegoede, mark.rutland, maxime.ripard, robh+dt, wens
  Cc: devicetree, linux-arm-kernel, linux-ide, linux-kernel,
	linux-sunxi, Corentin Labbe

The SoC R40 AHCI controller need a regulator to work.
So this patch add a way to add an optional regulator on AHCI controller.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
 drivers/ata/ahci.h             |  1 +
 drivers/ata/libahci_platform.c | 26 ++++++++++++++++++++++++--
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h
index 6a1515f0da40..1415f1012de5 100644
--- a/drivers/ata/ahci.h
+++ b/drivers/ata/ahci.h
@@ -352,6 +352,7 @@ struct ahci_host_priv {
 	struct clk		*clks[AHCI_MAX_CLKS]; /* Optional */
 	struct reset_control	*rsts;		/* Optional */
 	struct regulator	**target_pwrs;	/* Optional */
+	struct regulator	*ahci_regulator;/* Optional */
 	/*
 	 * If platform uses PHYs. There is a 1:1 relation between the port number and
 	 * the PHY position in this array.
diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c
index c92c10d55374..a886b61476a3 100644
--- a/drivers/ata/libahci_platform.c
+++ b/drivers/ata/libahci_platform.c
@@ -139,7 +139,7 @@ EXPORT_SYMBOL_GPL(ahci_platform_disable_clks);
  * ahci_platform_enable_regulators - Enable regulators
  * @hpriv: host private area to store config values
  *
- * This function enables all the regulators found in
+ * This function enables all the regulators found in controller and
  * hpriv->target_pwrs, if any.  If a regulator fails to be enabled, it
  * disables all the regulators already enabled in reverse order and
  * returns an error.
@@ -151,6 +151,12 @@ int ahci_platform_enable_regulators(struct ahci_host_priv *hpriv)
 {
 	int rc, i;
 
+	if (hpriv->ahci_regulator) {
+		rc = regulator_enable(hpriv->ahci_regulator);
+		if (rc)
+			return rc;
+	}
+
 	for (i = 0; i < hpriv->nports; i++) {
 		if (!hpriv->target_pwrs[i])
 			continue;
@@ -167,6 +173,8 @@ int ahci_platform_enable_regulators(struct ahci_host_priv *hpriv)
 		if (hpriv->target_pwrs[i])
 			regulator_disable(hpriv->target_pwrs[i]);
 
+	if (hpriv->ahci_regulator)
+		regulator_disable(hpriv->ahci_regulator);
 	return rc;
 }
 EXPORT_SYMBOL_GPL(ahci_platform_enable_regulators);
@@ -175,7 +183,8 @@ EXPORT_SYMBOL_GPL(ahci_platform_enable_regulators);
  * ahci_platform_disable_regulators - Disable regulators
  * @hpriv: host private area to store config values
  *
- * This function disables all regulators found in hpriv->target_pwrs.
+ * This function disables all regulators found in hpriv->target_pwrs and
+ * AHCI controller.
  */
 void ahci_platform_disable_regulators(struct ahci_host_priv *hpriv)
 {
@@ -186,6 +195,9 @@ void ahci_platform_disable_regulators(struct ahci_host_priv *hpriv)
 			continue;
 		regulator_disable(hpriv->target_pwrs[i]);
 	}
+
+	if (hpriv->ahci_regulator)
+		regulator_disable(hpriv->ahci_regulator);
 }
 EXPORT_SYMBOL_GPL(ahci_platform_disable_regulators);
 /**
@@ -351,6 +363,7 @@ static int ahci_platform_get_regulator(struct ahci_host_priv *hpriv, u32 port,
  *
  * 1) mmio registers (IORESOURCE_MEM 0, mandatory)
  * 2) regulator for controlling the targets power (optional)
+ *    regulator for controlling the AHCI controller (optional)
  * 3) 0 - AHCI_MAX_CLKS clocks, as specified in the devs devicetree node,
  *    or for non devicetree enabled platforms a single clock
  * 4) resets, if flags has AHCI_PLATFORM_GET_RESETS (optional)
@@ -408,6 +421,15 @@ struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev,
 		hpriv->clks[i] = clk;
 	}
 
+	hpriv->ahci_regulator = devm_regulator_get_optional(dev, "ahci");
+	if (IS_ERR(hpriv->ahci_regulator)) {
+		rc = PTR_ERR(hpriv->ahci_regulator);
+		if (rc == -EPROBE_DEFER)
+			goto err_out;
+		rc = 0;
+		hpriv->ahci_regulator = NULL;
+	}
+
 	if (flags & AHCI_PLATFORM_GET_RESETS) {
 		hpriv->rsts = devm_reset_control_array_get_optional_shared(dev);
 		if (IS_ERR(hpriv->rsts)) {
-- 
2.16.4


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v5 3/9] dt-bindings: ata: ahci-platform: document ahci-supply
  2018-09-03 10:01 [PATCH v5 0/9] ata: ahci_platform: support allwinner R40 AHCI Corentin Labbe
  2018-09-03 10:01 ` [PATCH v5 1/9] dt-bindings: ata: ahci-platform: fix indentation of target-supply Corentin Labbe
  2018-09-03 10:01 ` [PATCH v5 2/9] ata: ahci_platform: add support for AHCI controller regulator Corentin Labbe
@ 2018-09-03 10:01 ` Corentin Labbe
  2018-09-03 10:01 ` [PATCH v5 4/9] ata: ahci_platform: add support for PHY controller regulator Corentin Labbe
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 17+ messages in thread
From: Corentin Labbe @ 2018-09-03 10:01 UTC (permalink / raw)
  To: axboe, hdegoede, mark.rutland, maxime.ripard, robh+dt, wens
  Cc: devicetree, linux-arm-kernel, linux-ide, linux-kernel,
	linux-sunxi, Corentin Labbe

This patch document the new optional ahci-supply.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
---
 Documentation/devicetree/bindings/ata/ahci-platform.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/ata/ahci-platform.txt b/Documentation/devicetree/bindings/ata/ahci-platform.txt
index b88820b4c01e..f495774c8af9 100644
--- a/Documentation/devicetree/bindings/ata/ahci-platform.txt
+++ b/Documentation/devicetree/bindings/ata/ahci-platform.txt
@@ -33,6 +33,7 @@ Optional properties:
 - target-supply     : regulator for SATA target power
 - phys              : reference to the SATA PHY node
 - phy-names         : must be "sata-phy"
+- ahci-supply       : regulator for AHCI controller
 - ports-implemented : Mask that indicates which ports that the HBA supports
 		      are available for software to use. Useful if PORTS_IMPL
 		      is not programmed by the BIOS, which is true with
-- 
2.16.4


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v5 4/9] ata: ahci_platform: add support for PHY controller regulator
  2018-09-03 10:01 [PATCH v5 0/9] ata: ahci_platform: support allwinner R40 AHCI Corentin Labbe
                   ` (2 preceding siblings ...)
  2018-09-03 10:01 ` [PATCH v5 3/9] dt-bindings: ata: ahci-platform: document ahci-supply Corentin Labbe
@ 2018-09-03 10:01 ` Corentin Labbe
  2018-09-03 10:01 ` [PATCH v5 5/9] dt-bindings: ata: ahci-platform: document phy-supply Corentin Labbe
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 17+ messages in thread
From: Corentin Labbe @ 2018-09-03 10:01 UTC (permalink / raw)
  To: axboe, hdegoede, mark.rutland, maxime.ripard, robh+dt, wens
  Cc: devicetree, linux-arm-kernel, linux-ide, linux-kernel,
	linux-sunxi, Corentin Labbe

The SoC R40 AHCI controller need a PHY regulator to work.
But since the PHY is embedded in the controller, we cannot do a DT node for it,
since phy-supply works only in node with a PHY compatible.
So this patch adds a way to add an optional phy-supply regulator on AHCI controller node.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
 drivers/ata/ahci.h             |  1 +
 drivers/ata/libahci_platform.c | 20 ++++++++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h
index 1415f1012de5..ef356e70e6de 100644
--- a/drivers/ata/ahci.h
+++ b/drivers/ata/ahci.h
@@ -353,6 +353,7 @@ struct ahci_host_priv {
 	struct reset_control	*rsts;		/* Optional */
 	struct regulator	**target_pwrs;	/* Optional */
 	struct regulator	*ahci_regulator;/* Optional */
+	struct regulator	*phy_regulator;/* Optional */
 	/*
 	 * If platform uses PHYs. There is a 1:1 relation between the port number and
 	 * the PHY position in this array.
diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c
index a886b61476a3..dc4d79b1c9ae 100644
--- a/drivers/ata/libahci_platform.c
+++ b/drivers/ata/libahci_platform.c
@@ -157,6 +157,12 @@ int ahci_platform_enable_regulators(struct ahci_host_priv *hpriv)
 			return rc;
 	}
 
+	if (hpriv->phy_regulator) {
+		rc = regulator_enable(hpriv->phy_regulator);
+		if (rc)
+			goto disable_ahci_pwrs;
+	}
+
 	for (i = 0; i < hpriv->nports; i++) {
 		if (!hpriv->target_pwrs[i])
 			continue;
@@ -173,6 +179,9 @@ int ahci_platform_enable_regulators(struct ahci_host_priv *hpriv)
 		if (hpriv->target_pwrs[i])
 			regulator_disable(hpriv->target_pwrs[i]);
 
+	if (hpriv->phy_regulator)
+		regulator_disable(hpriv->phy_regulator);
+disable_ahci_pwrs:
 	if (hpriv->ahci_regulator)
 		regulator_disable(hpriv->ahci_regulator);
 	return rc;
@@ -198,6 +207,8 @@ void ahci_platform_disable_regulators(struct ahci_host_priv *hpriv)
 
 	if (hpriv->ahci_regulator)
 		regulator_disable(hpriv->ahci_regulator);
+	if (hpriv->phy_regulator)
+		regulator_disable(hpriv->phy_regulator);
 }
 EXPORT_SYMBOL_GPL(ahci_platform_disable_regulators);
 /**
@@ -430,6 +441,15 @@ struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev,
 		hpriv->ahci_regulator = NULL;
 	}
 
+	hpriv->phy_regulator = devm_regulator_get_optional(dev, "phy");
+	if (IS_ERR(hpriv->phy_regulator)) {
+		rc = PTR_ERR(hpriv->phy_regulator);
+		if (rc == -EPROBE_DEFER)
+			goto err_out;
+		rc = 0;
+		hpriv->phy_regulator = NULL;
+	}
+
 	if (flags & AHCI_PLATFORM_GET_RESETS) {
 		hpriv->rsts = devm_reset_control_array_get_optional_shared(dev);
 		if (IS_ERR(hpriv->rsts)) {
-- 
2.16.4


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v5 5/9] dt-bindings: ata: ahci-platform: document phy-supply
  2018-09-03 10:01 [PATCH v5 0/9] ata: ahci_platform: support allwinner R40 AHCI Corentin Labbe
                   ` (3 preceding siblings ...)
  2018-09-03 10:01 ` [PATCH v5 4/9] ata: ahci_platform: add support for PHY controller regulator Corentin Labbe
@ 2018-09-03 10:01 ` Corentin Labbe
  2018-09-10 18:18   ` Rob Herring
  2018-09-03 10:01 ` [PATCH v5 6/9] ata: ahci_sunxi: add support for r40 Corentin Labbe
                   ` (5 subsequent siblings)
  10 siblings, 1 reply; 17+ messages in thread
From: Corentin Labbe @ 2018-09-03 10:01 UTC (permalink / raw)
  To: axboe, hdegoede, mark.rutland, maxime.ripard, robh+dt, wens
  Cc: devicetree, linux-arm-kernel, linux-ide, linux-kernel,
	linux-sunxi, Corentin Labbe

This patch document the new optional phy-supply.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
 Documentation/devicetree/bindings/ata/ahci-platform.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/ata/ahci-platform.txt b/Documentation/devicetree/bindings/ata/ahci-platform.txt
index f495774c8af9..45b451961612 100644
--- a/Documentation/devicetree/bindings/ata/ahci-platform.txt
+++ b/Documentation/devicetree/bindings/ata/ahci-platform.txt
@@ -31,6 +31,7 @@ Optional properties:
 - clocks            : a list of phandle + clock specifier pairs
 - resets            : a list of phandle + reset specifier pairs
 - target-supply     : regulator for SATA target power
+- phy-supply        : regulator for PHY power
 - phys              : reference to the SATA PHY node
 - phy-names         : must be "sata-phy"
 - ahci-supply       : regulator for AHCI controller
-- 
2.16.4


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v5 6/9] ata: ahci_sunxi: add support for r40
  2018-09-03 10:01 [PATCH v5 0/9] ata: ahci_platform: support allwinner R40 AHCI Corentin Labbe
                   ` (4 preceding siblings ...)
  2018-09-03 10:01 ` [PATCH v5 5/9] dt-bindings: ata: ahci-platform: document phy-supply Corentin Labbe
@ 2018-09-03 10:01 ` Corentin Labbe
  2018-09-03 10:01 ` [PATCH v5 7/9] dt-bindings: ata: update ahci_sunxi bindings Corentin Labbe
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 17+ messages in thread
From: Corentin Labbe @ 2018-09-03 10:01 UTC (permalink / raw)
  To: axboe, hdegoede, mark.rutland, maxime.ripard, robh+dt, wens
  Cc: devicetree, linux-arm-kernel, linux-ide, linux-kernel,
	linux-sunxi, Corentin Labbe

This patch add the r40 compatible to the ahci_sunxi's supported list of
compatible.

Since R40 need ahci_platform to handle the reset controller, we also add
the new AHCI_PLATFORM_GET_RESETS flag for ahci_platform_get_resources().
This has no consequence for older platform (a10, a20) since the reset is
optional.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
 drivers/ata/ahci_sunxi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/ata/ahci_sunxi.c b/drivers/ata/ahci_sunxi.c
index 631610b72aa5..911710643305 100644
--- a/drivers/ata/ahci_sunxi.c
+++ b/drivers/ata/ahci_sunxi.c
@@ -181,7 +181,7 @@ static int ahci_sunxi_probe(struct platform_device *pdev)
 	struct ahci_host_priv *hpriv;
 	int rc;
 
-	hpriv = ahci_platform_get_resources(pdev, 0);
+	hpriv = ahci_platform_get_resources(pdev, AHCI_PLATFORM_GET_RESETS);
 	if (IS_ERR(hpriv))
 		return PTR_ERR(hpriv);
 
@@ -250,6 +250,7 @@ static SIMPLE_DEV_PM_OPS(ahci_sunxi_pm_ops, ahci_platform_suspend,
 
 static const struct of_device_id ahci_sunxi_of_match[] = {
 	{ .compatible = "allwinner,sun4i-a10-ahci", },
+	{ .compatible = "allwinner,sun8i-r40-ahci", },
 	{ },
 };
 MODULE_DEVICE_TABLE(of, ahci_sunxi_of_match);
-- 
2.16.4


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v5 7/9] dt-bindings: ata: update ahci_sunxi bindings
  2018-09-03 10:01 [PATCH v5 0/9] ata: ahci_platform: support allwinner R40 AHCI Corentin Labbe
                   ` (5 preceding siblings ...)
  2018-09-03 10:01 ` [PATCH v5 6/9] ata: ahci_sunxi: add support for r40 Corentin Labbe
@ 2018-09-03 10:01 ` Corentin Labbe
  2018-09-10 18:18   ` Rob Herring
  2018-09-03 10:02 ` [PATCH v5 8/9] ARM: dts: sun8i: r40: add sata node Corentin Labbe
                   ` (3 subsequent siblings)
  10 siblings, 1 reply; 17+ messages in thread
From: Corentin Labbe @ 2018-09-03 10:01 UTC (permalink / raw)
  To: axboe, hdegoede, mark.rutland, maxime.ripard, robh+dt, wens
  Cc: devicetree, linux-arm-kernel, linux-ide, linux-kernel,
	linux-sunxi, Corentin Labbe

This patch update binding with the new R40 compatible.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
 Documentation/devicetree/bindings/ata/ahci-platform.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/ata/ahci-platform.txt b/Documentation/devicetree/bindings/ata/ahci-platform.txt
index 45b451961612..e30fd106df4f 100644
--- a/Documentation/devicetree/bindings/ata/ahci-platform.txt
+++ b/Documentation/devicetree/bindings/ata/ahci-platform.txt
@@ -10,6 +10,7 @@ PHYs.
 Required properties:
 - compatible        : compatible string, one of:
   - "allwinner,sun4i-a10-ahci"
+  - "allwinner,sun8i-r40-ahci"
   - "brcm,iproc-ahci"
   - "hisilicon,hisi-ahci"
   - "cavium,octeon-7130-ahci"
@@ -44,6 +45,7 @@ Required properties when using sub-nodes:
 - #address-cells    : number of cells to encode an address
 - #size-cells       : number of cells representing the size of an address
 
+For allwinner,sun8i-r40-ahci, the reset propertie must be present.
 
 Sub-nodes required properties:
 - reg		    : the port number
-- 
2.16.4


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v5 8/9] ARM: dts: sun8i: r40: add sata node
  2018-09-03 10:01 [PATCH v5 0/9] ata: ahci_platform: support allwinner R40 AHCI Corentin Labbe
                   ` (6 preceding siblings ...)
  2018-09-03 10:01 ` [PATCH v5 7/9] dt-bindings: ata: update ahci_sunxi bindings Corentin Labbe
@ 2018-09-03 10:02 ` Corentin Labbe
  2018-09-03 10:02 ` [PATCH v5 9/9] ARM: dts: sun8i: sun8i-r40-bananapi-m2-ultra: enable AHCI Corentin Labbe
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 17+ messages in thread
From: Corentin Labbe @ 2018-09-03 10:02 UTC (permalink / raw)
  To: axboe, hdegoede, mark.rutland, maxime.ripard, robh+dt, wens
  Cc: devicetree, linux-arm-kernel, linux-ide, linux-kernel,
	linux-sunxi, Corentin Labbe, Icenowy Zheng

R40 have a sata controller which is the same as A20.
This patch adds a DT node for it.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
 arch/arm/boot/dts/sun8i-r40.dtsi | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-r40.dtsi b/arch/arm/boot/dts/sun8i-r40.dtsi
index 852c2ccc3268..d27c522e1918 100644
--- a/arch/arm/boot/dts/sun8i-r40.dtsi
+++ b/arch/arm/boot/dts/sun8i-r40.dtsi
@@ -550,6 +550,19 @@
 			#size-cells = <0>;
 		};
 
+		ahci: sata@1c18000 {
+			compatible = "allwinner,sun8i-r40-ahci";
+			reg = <0x01c18000 0x1000>;
+			interrupts = <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&ccu CLK_BUS_SATA>, <&ccu CLK_SATA>;
+			resets = <&ccu RST_BUS_SATA>;
+			resets-name = "ahci";
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+
+		};
+
 		gmac: ethernet@1c50000 {
 			compatible = "allwinner,sun8i-r40-gmac";
 			syscon = <&ccu>;
-- 
2.16.4


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v5 9/9] ARM: dts: sun8i: sun8i-r40-bananapi-m2-ultra: enable AHCI
  2018-09-03 10:01 [PATCH v5 0/9] ata: ahci_platform: support allwinner R40 AHCI Corentin Labbe
                   ` (7 preceding siblings ...)
  2018-09-03 10:02 ` [PATCH v5 8/9] ARM: dts: sun8i: r40: add sata node Corentin Labbe
@ 2018-09-03 10:02 ` Corentin Labbe
  2018-09-03 12:42 ` [PATCH v5 0/9] ata: ahci_platform: support allwinner R40 AHCI Maxime Ripard
  2018-09-03 14:26 ` Jens Axboe
  10 siblings, 0 replies; 17+ messages in thread
From: Corentin Labbe @ 2018-09-03 10:02 UTC (permalink / raw)
  To: axboe, hdegoede, mark.rutland, maxime.ripard, robh+dt, wens
  Cc: devicetree, linux-arm-kernel, linux-ide, linux-kernel,
	linux-sunxi, Corentin Labbe

This patch enable the AHCI controller.
Since this controller need two regulator, this patch add them.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
 arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
index a891a387e8f1..438b7b44dab3 100644
--- a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
+++ b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts
@@ -105,6 +105,12 @@
 	};
 };
 
+&ahci {
+	ahci-supply = <&reg_dldo4>;
+	phy-supply = <&reg_eldo3>;
+	status = "okay";
+};
+
 &de {
 	status = "okay";
 };
@@ -250,6 +256,18 @@
 	regulator-name = "vcc-wifi";
 };
 
+&reg_dldo4 {
+	regulator-min-microvolt = <2500000>;
+	regulator-max-microvolt = <2500000>;
+	regulator-name = "vdd2v5-sata";
+};
+
+&reg_eldo3 {
+	regulator-min-microvolt = <1200000>;
+	regulator-max-microvolt = <1200000>;
+	regulator-name = "vdd1v2-sata";
+};
+
 &tcon_tv0 {
 	status = "okay";
 };
-- 
2.16.4


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH v5 0/9] ata: ahci_platform: support allwinner R40 AHCI
  2018-09-03 10:01 [PATCH v5 0/9] ata: ahci_platform: support allwinner R40 AHCI Corentin Labbe
                   ` (8 preceding siblings ...)
  2018-09-03 10:02 ` [PATCH v5 9/9] ARM: dts: sun8i: sun8i-r40-bananapi-m2-ultra: enable AHCI Corentin Labbe
@ 2018-09-03 12:42 ` Maxime Ripard
  2018-09-03 12:58   ` Hans de Goede
  2018-09-03 14:26 ` Jens Axboe
  10 siblings, 1 reply; 17+ messages in thread
From: Maxime Ripard @ 2018-09-03 12:42 UTC (permalink / raw)
  To: Corentin Labbe
  Cc: axboe, hdegoede, mark.rutland, robh+dt, wens, devicetree,
	linux-arm-kernel, linux-ide, linux-kernel, linux-sunxi

[-- Attachment #1: Type: text/plain, Size: 586 bytes --]

On Mon, Sep 03, 2018 at 12:01:52PM +0200, Corentin Labbe wrote:
> This patchset add support for allwinner R40 AHCI controller.
> 
> The whole patchset is tested on sun8i-r40-bananapi-m2-ultra and
> on sun7i-a20-cubieboard2 which doesnt have any of the ressources added
> by this serie, so no regression should come with it.
> 
> Patchs 1-7 should go via the ata tree
> Patchs 8,9 should go via the sunxi tree
>

Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>

Thanks!
Maxime

-- 
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v5 0/9] ata: ahci_platform: support allwinner R40 AHCI
  2018-09-03 12:42 ` [PATCH v5 0/9] ata: ahci_platform: support allwinner R40 AHCI Maxime Ripard
@ 2018-09-03 12:58   ` Hans de Goede
  0 siblings, 0 replies; 17+ messages in thread
From: Hans de Goede @ 2018-09-03 12:58 UTC (permalink / raw)
  To: Maxime Ripard, Corentin Labbe
  Cc: axboe, mark.rutland, robh+dt, wens, devicetree, linux-arm-kernel,
	linux-ide, linux-kernel, linux-sunxi

Hi,

On 03-09-18 14:42, Maxime Ripard wrote:
> On Mon, Sep 03, 2018 at 12:01:52PM +0200, Corentin Labbe wrote:
>> This patchset add support for allwinner R40 AHCI controller.
>>
>> The whole patchset is tested on sun8i-r40-bananapi-m2-ultra and
>> on sun7i-a20-cubieboard2 which doesnt have any of the ressources added
>> by this serie, so no regression should come with it.
>>
>> Patchs 1-7 should go via the ata tree
>> Patchs 8,9 should go via the sunxi tree
>>
> 
> Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>

The entire series looks good to me too:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v5 0/9] ata: ahci_platform: support allwinner R40 AHCI
  2018-09-03 10:01 [PATCH v5 0/9] ata: ahci_platform: support allwinner R40 AHCI Corentin Labbe
                   ` (9 preceding siblings ...)
  2018-09-03 12:42 ` [PATCH v5 0/9] ata: ahci_platform: support allwinner R40 AHCI Maxime Ripard
@ 2018-09-03 14:26 ` Jens Axboe
  2018-09-05  7:25   ` Maxime Ripard
  10 siblings, 1 reply; 17+ messages in thread
From: Jens Axboe @ 2018-09-03 14:26 UTC (permalink / raw)
  To: Corentin Labbe, hdegoede, mark.rutland, maxime.ripard, robh+dt, wens
  Cc: devicetree, linux-arm-kernel, linux-ide, linux-kernel, linux-sunxi

On 9/3/18 4:01 AM, Corentin Labbe wrote:
> This patchset add support for allwinner R40 AHCI controller.
> 
> The whole patchset is tested on sun8i-r40-bananapi-m2-ultra and
> on sun7i-a20-cubieboard2 which doesnt have any of the ressources added
> by this serie, so no regression should come with it.
> 
> Patchs 1-7 should go via the ata tree
> Patchs 8,9 should go via the sunxi tree

Applied 1-7 for 4.20, thanks everyone.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v5 0/9] ata: ahci_platform: support allwinner R40 AHCI
  2018-09-03 14:26 ` Jens Axboe
@ 2018-09-05  7:25   ` Maxime Ripard
  0 siblings, 0 replies; 17+ messages in thread
From: Maxime Ripard @ 2018-09-05  7:25 UTC (permalink / raw)
  To: Jens Axboe
  Cc: Corentin Labbe, hdegoede, mark.rutland, robh+dt, wens,
	devicetree, linux-arm-kernel, linux-ide, linux-kernel,
	linux-sunxi

[-- Attachment #1: Type: text/plain, Size: 647 bytes --]

On Mon, Sep 03, 2018 at 08:26:22AM -0600, Jens Axboe wrote:
> On 9/3/18 4:01 AM, Corentin Labbe wrote:
> > This patchset add support for allwinner R40 AHCI controller.
> > 
> > The whole patchset is tested on sun8i-r40-bananapi-m2-ultra and
> > on sun7i-a20-cubieboard2 which doesnt have any of the ressources added
> > by this serie, so no regression should come with it.
> > 
> > Patchs 1-7 should go via the ata tree
> > Patchs 8,9 should go via the sunxi tree
> 
> Applied 1-7 for 4.20, thanks everyone.

Applied 8 and 9, thanks!
Maxime

-- 
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v5 1/9] dt-bindings: ata: ahci-platform: fix indentation of target-supply
  2018-09-03 10:01 ` [PATCH v5 1/9] dt-bindings: ata: ahci-platform: fix indentation of target-supply Corentin Labbe
@ 2018-09-10 16:25   ` Rob Herring
  0 siblings, 0 replies; 17+ messages in thread
From: Rob Herring @ 2018-09-10 16:25 UTC (permalink / raw)
  To: Corentin Labbe
  Cc: axboe, hdegoede, mark.rutland, maxime.ripard, wens, devicetree,
	linux-arm-kernel, linux-ide, linux-kernel, linux-sunxi

On Mon, Sep 03, 2018 at 12:01:53PM +0200, Corentin Labbe wrote:
> This patch fix the indentation of target-supply's ':'.
> 
> Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
> ---
>  Documentation/devicetree/bindings/ata/ahci-platform.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Please add acks/reviewed-bys when posting new versions.

Rob

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v5 5/9] dt-bindings: ata: ahci-platform: document phy-supply
  2018-09-03 10:01 ` [PATCH v5 5/9] dt-bindings: ata: ahci-platform: document phy-supply Corentin Labbe
@ 2018-09-10 18:18   ` Rob Herring
  0 siblings, 0 replies; 17+ messages in thread
From: Rob Herring @ 2018-09-10 18:18 UTC (permalink / raw)
  To: Corentin Labbe
  Cc: axboe, hdegoede, mark.rutland, maxime.ripard, wens, devicetree,
	linux-arm-kernel, linux-ide, linux-kernel, linux-sunxi

On Mon, Sep 03, 2018 at 12:01:57PM +0200, Corentin Labbe wrote:
> This patch document the new optional phy-supply.
> 
> Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
> ---
>  Documentation/devicetree/bindings/ata/ahci-platform.txt | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/devicetree/bindings/ata/ahci-platform.txt b/Documentation/devicetree/bindings/ata/ahci-platform.txt
> index f495774c8af9..45b451961612 100644
> --- a/Documentation/devicetree/bindings/ata/ahci-platform.txt
> +++ b/Documentation/devicetree/bindings/ata/ahci-platform.txt
> @@ -31,6 +31,7 @@ Optional properties:
>  - clocks            : a list of phandle + clock specifier pairs
>  - resets            : a list of phandle + reset specifier pairs
>  - target-supply     : regulator for SATA target power
> +- phy-supply        : regulator for PHY power

This should be mutually exclusive with the phys property. If you have a 
phy node, then its supply belongs there.

>  - phys              : reference to the SATA PHY node
>  - phy-names         : must be "sata-phy"
>  - ahci-supply       : regulator for AHCI controller
> -- 
> 2.16.4
> 

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v5 7/9] dt-bindings: ata: update ahci_sunxi bindings
  2018-09-03 10:01 ` [PATCH v5 7/9] dt-bindings: ata: update ahci_sunxi bindings Corentin Labbe
@ 2018-09-10 18:18   ` Rob Herring
  0 siblings, 0 replies; 17+ messages in thread
From: Rob Herring @ 2018-09-10 18:18 UTC (permalink / raw)
  To: Corentin Labbe
  Cc: axboe, hdegoede, mark.rutland, maxime.ripard, robh+dt, wens,
	devicetree, linux-arm-kernel, linux-ide, linux-kernel,
	linux-sunxi, Corentin Labbe

On Mon,  3 Sep 2018 12:01:59 +0200, Corentin Labbe wrote:
> This patch update binding with the new R40 compatible.
> 
> Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
> ---
>  Documentation/devicetree/bindings/ata/ahci-platform.txt | 2 ++
>  1 file changed, 2 insertions(+)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2018-09-10 18:18 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-03 10:01 [PATCH v5 0/9] ata: ahci_platform: support allwinner R40 AHCI Corentin Labbe
2018-09-03 10:01 ` [PATCH v5 1/9] dt-bindings: ata: ahci-platform: fix indentation of target-supply Corentin Labbe
2018-09-10 16:25   ` Rob Herring
2018-09-03 10:01 ` [PATCH v5 2/9] ata: ahci_platform: add support for AHCI controller regulator Corentin Labbe
2018-09-03 10:01 ` [PATCH v5 3/9] dt-bindings: ata: ahci-platform: document ahci-supply Corentin Labbe
2018-09-03 10:01 ` [PATCH v5 4/9] ata: ahci_platform: add support for PHY controller regulator Corentin Labbe
2018-09-03 10:01 ` [PATCH v5 5/9] dt-bindings: ata: ahci-platform: document phy-supply Corentin Labbe
2018-09-10 18:18   ` Rob Herring
2018-09-03 10:01 ` [PATCH v5 6/9] ata: ahci_sunxi: add support for r40 Corentin Labbe
2018-09-03 10:01 ` [PATCH v5 7/9] dt-bindings: ata: update ahci_sunxi bindings Corentin Labbe
2018-09-10 18:18   ` Rob Herring
2018-09-03 10:02 ` [PATCH v5 8/9] ARM: dts: sun8i: r40: add sata node Corentin Labbe
2018-09-03 10:02 ` [PATCH v5 9/9] ARM: dts: sun8i: sun8i-r40-bananapi-m2-ultra: enable AHCI Corentin Labbe
2018-09-03 12:42 ` [PATCH v5 0/9] ata: ahci_platform: support allwinner R40 AHCI Maxime Ripard
2018-09-03 12:58   ` Hans de Goede
2018-09-03 14:26 ` Jens Axboe
2018-09-05  7:25   ` Maxime Ripard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).