All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] AHCI support for BCM63138
@ 2018-10-01 17:32 ` Florian Fainelli
  0 siblings, 0 replies; 12+ messages in thread
From: Florian Fainelli @ 2018-10-01 17:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: bcm-kernel-feedback-list, Florian Fainelli, Jens Axboe,
	Rob Herring, Mark Rutland,
	open list:LIBATA SUBSYSTEM Serial and Parallel ATA drivers,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS

Hi Jens,

This is a resend of the previous series posted here:

https://lkml.org/lkml/2018/9/20/1060

With a few minor changes:

- rebased against your for-4.20/libata branch
- added Rob's Reviewed-by to patch
- fixed the use of the reset controller API

Thank you!

Florian Fainelli (4):
  dt-bindings: ata: Document BCM63138 compatible string
  ata: ahci_brcm: Allow optional reset controller to be used
  ata: ahci_brcm: Match BCM63138 compatible strings
  ata: ahci_brcm: Allow using driver or DSL SoCs

 Documentation/devicetree/bindings/ata/brcm,sata-brcm.txt | 1 +
 drivers/ata/Kconfig                                      | 3 ++-
 drivers/ata/ahci_brcm.c                                  | 8 ++++++++
 3 files changed, 11 insertions(+), 1 deletion(-)

-- 
2.17.1

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

* [PATCH v2 0/4] AHCI support for BCM63138
@ 2018-10-01 17:32 ` Florian Fainelli
  0 siblings, 0 replies; 12+ messages in thread
From: Florian Fainelli @ 2018-10-01 17:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: bcm-kernel-feedback-list, Florian Fainelli, Jens Axboe,
	Rob Herring, Mark Rutland,
	open list:LIBATA SUBSYSTEM (Serial and Parallel ATA drivers),
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS

Hi Jens,

This is a resend of the previous series posted here:

https://lkml.org/lkml/2018/9/20/1060

With a few minor changes:

- rebased against your for-4.20/libata branch
- added Rob's Reviewed-by to patch
- fixed the use of the reset controller API

Thank you!

Florian Fainelli (4):
  dt-bindings: ata: Document BCM63138 compatible string
  ata: ahci_brcm: Allow optional reset controller to be used
  ata: ahci_brcm: Match BCM63138 compatible strings
  ata: ahci_brcm: Allow using driver or DSL SoCs

 Documentation/devicetree/bindings/ata/brcm,sata-brcm.txt | 1 +
 drivers/ata/Kconfig                                      | 3 ++-
 drivers/ata/ahci_brcm.c                                  | 8 ++++++++
 3 files changed, 11 insertions(+), 1 deletion(-)

-- 
2.17.1


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

* [PATCH v2 1/4] dt-bindings: ata: Document BCM63138 compatible string
  2018-10-01 17:32 ` Florian Fainelli
@ 2018-10-01 17:32   ` Florian Fainelli
  -1 siblings, 0 replies; 12+ messages in thread
From: Florian Fainelli @ 2018-10-01 17:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: bcm-kernel-feedback-list, Florian Fainelli, Jens Axboe,
	Rob Herring, Mark Rutland,
	open list:LIBATA SUBSYSTEM Serial and Parallel ATA drivers,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS

Document the compatible string "brcm,bcm63138-ahci" as a valid
compatible string for the standard Broadcom AHCI controller.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 Documentation/devicetree/bindings/ata/brcm,sata-brcm.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/ata/brcm,sata-brcm.txt b/Documentation/devicetree/bindings/ata/brcm,sata-brcm.txt
index 0a5b3b47f217..7713a413c6a7 100644
--- a/Documentation/devicetree/bindings/ata/brcm,sata-brcm.txt
+++ b/Documentation/devicetree/bindings/ata/brcm,sata-brcm.txt
@@ -9,6 +9,7 @@ Required properties:
 			"brcm,bcm7445-ahci"
 			"brcm,bcm-nsp-ahci"
 			"brcm,sata3-ahci"
+			"brcm,bcm63138-ahci"
 - reg                : register mappings for AHCI and SATA_TOP_CTRL
 - reg-names          : "ahci" and "top-ctrl"
 - interrupts         : interrupt mapping for SATA IRQ
-- 
2.17.1

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

* [PATCH v2 1/4] dt-bindings: ata: Document BCM63138 compatible string
@ 2018-10-01 17:32   ` Florian Fainelli
  0 siblings, 0 replies; 12+ messages in thread
From: Florian Fainelli @ 2018-10-01 17:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: bcm-kernel-feedback-list, Florian Fainelli, Jens Axboe,
	Rob Herring, Mark Rutland,
	open list:LIBATA SUBSYSTEM (Serial and Parallel ATA drivers),
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS

Document the compatible string "brcm,bcm63138-ahci" as a valid
compatible string for the standard Broadcom AHCI controller.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 Documentation/devicetree/bindings/ata/brcm,sata-brcm.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/ata/brcm,sata-brcm.txt b/Documentation/devicetree/bindings/ata/brcm,sata-brcm.txt
index 0a5b3b47f217..7713a413c6a7 100644
--- a/Documentation/devicetree/bindings/ata/brcm,sata-brcm.txt
+++ b/Documentation/devicetree/bindings/ata/brcm,sata-brcm.txt
@@ -9,6 +9,7 @@ Required properties:
 			"brcm,bcm7445-ahci"
 			"brcm,bcm-nsp-ahci"
 			"brcm,sata3-ahci"
+			"brcm,bcm63138-ahci"
 - reg                : register mappings for AHCI and SATA_TOP_CTRL
 - reg-names          : "ahci" and "top-ctrl"
 - interrupts         : interrupt mapping for SATA IRQ
-- 
2.17.1


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

* [PATCH v2 2/4] ata: ahci_brcm: Allow optional reset controller to be used
  2018-10-01 17:32 ` Florian Fainelli
@ 2018-10-01 17:33   ` Florian Fainelli
  -1 siblings, 0 replies; 12+ messages in thread
From: Florian Fainelli @ 2018-10-01 17:33 UTC (permalink / raw)
  To: linux-kernel
  Cc: bcm-kernel-feedback-list, Florian Fainelli, Jens Axboe,
	Rob Herring, Mark Rutland,
	open list:LIBATA SUBSYSTEM Serial and Parallel ATA drivers,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS

On BCM63138, we need to reset the AHCI core prior to start utilizing it,
grab the reset controller device cookie and do that.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/ata/ahci_brcm.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/ata/ahci_brcm.c b/drivers/ata/ahci_brcm.c
index f3d557777d82..0e401b7c0856 100644
--- a/drivers/ata/ahci_brcm.c
+++ b/drivers/ata/ahci_brcm.c
@@ -25,6 +25,7 @@
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>
+#include <linux/reset.h>
 #include <linux/string.h>
 
 #include "ahci.h"
@@ -94,6 +95,7 @@ struct brcm_ahci_priv {
 	u32 port_mask;
 	u32 quirks;
 	enum brcm_ahci_version version;
+	struct reset_control *rcdev;
 };
 
 static inline u32 brcm_sata_readreg(void __iomem *addr)
@@ -411,6 +413,11 @@ static int brcm_ahci_probe(struct platform_device *pdev)
 	if (IS_ERR(priv->top_ctrl))
 		return PTR_ERR(priv->top_ctrl);
 
+	/* Reset is optional depending on platform */
+	priv->rcdev = devm_reset_control_get(&pdev->dev, "ahci");
+	if (!IS_ERR_OR_NULL(priv->rcdev))
+		reset_control_deassert(priv->rcdev);
+
 	if ((priv->version == BRCM_SATA_BCM7425) ||
 		(priv->version == BRCM_SATA_NSP)) {
 		priv->quirks |= BRCM_AHCI_QUIRK_NO_NCQ;
-- 
2.17.1

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

* [PATCH v2 2/4] ata: ahci_brcm: Allow optional reset controller to be used
@ 2018-10-01 17:33   ` Florian Fainelli
  0 siblings, 0 replies; 12+ messages in thread
From: Florian Fainelli @ 2018-10-01 17:33 UTC (permalink / raw)
  To: linux-kernel
  Cc: bcm-kernel-feedback-list, Florian Fainelli, Jens Axboe,
	Rob Herring, Mark Rutland,
	open list:LIBATA SUBSYSTEM (Serial and Parallel ATA drivers),
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS

On BCM63138, we need to reset the AHCI core prior to start utilizing it,
grab the reset controller device cookie and do that.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/ata/ahci_brcm.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/ata/ahci_brcm.c b/drivers/ata/ahci_brcm.c
index f3d557777d82..0e401b7c0856 100644
--- a/drivers/ata/ahci_brcm.c
+++ b/drivers/ata/ahci_brcm.c
@@ -25,6 +25,7 @@
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>
+#include <linux/reset.h>
 #include <linux/string.h>
 
 #include "ahci.h"
@@ -94,6 +95,7 @@ struct brcm_ahci_priv {
 	u32 port_mask;
 	u32 quirks;
 	enum brcm_ahci_version version;
+	struct reset_control *rcdev;
 };
 
 static inline u32 brcm_sata_readreg(void __iomem *addr)
@@ -411,6 +413,11 @@ static int brcm_ahci_probe(struct platform_device *pdev)
 	if (IS_ERR(priv->top_ctrl))
 		return PTR_ERR(priv->top_ctrl);
 
+	/* Reset is optional depending on platform */
+	priv->rcdev = devm_reset_control_get(&pdev->dev, "ahci");
+	if (!IS_ERR_OR_NULL(priv->rcdev))
+		reset_control_deassert(priv->rcdev);
+
 	if ((priv->version == BRCM_SATA_BCM7425) ||
 		(priv->version == BRCM_SATA_NSP)) {
 		priv->quirks |= BRCM_AHCI_QUIRK_NO_NCQ;
-- 
2.17.1


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

* [PATCH v2 3/4] ata: ahci_brcm: Match BCM63138 compatible strings
  2018-10-01 17:32 ` Florian Fainelli
@ 2018-10-01 17:33   ` Florian Fainelli
  -1 siblings, 0 replies; 12+ messages in thread
From: Florian Fainelli @ 2018-10-01 17:33 UTC (permalink / raw)
  To: linux-kernel
  Cc: bcm-kernel-feedback-list, Florian Fainelli, Jens Axboe,
	Rob Herring, Mark Rutland,
	open list:LIBATA SUBSYSTEM Serial and Parallel ATA drivers,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS

Match the "brcm,bcm63138-ahci" compatible string in order to allow this
driver to probe on such platforms.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/ata/ahci_brcm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/ata/ahci_brcm.c b/drivers/ata/ahci_brcm.c
index 0e401b7c0856..fba5a3044c8a 100644
--- a/drivers/ata/ahci_brcm.c
+++ b/drivers/ata/ahci_brcm.c
@@ -383,6 +383,7 @@ static struct scsi_host_template ahci_platform_sht = {
 static const struct of_device_id ahci_of_match[] = {
 	{.compatible = "brcm,bcm7425-ahci", .data = (void *)BRCM_SATA_BCM7425},
 	{.compatible = "brcm,bcm7445-ahci", .data = (void *)BRCM_SATA_BCM7445},
+	{.compatible = "brcm,bcm63138-ahci", .data = (void *)BRCM_SATA_BCM7445},
 	{.compatible = "brcm,bcm-nsp-ahci", .data = (void *)BRCM_SATA_NSP},
 	{},
 };
-- 
2.17.1

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

* [PATCH v2 3/4] ata: ahci_brcm: Match BCM63138 compatible strings
@ 2018-10-01 17:33   ` Florian Fainelli
  0 siblings, 0 replies; 12+ messages in thread
From: Florian Fainelli @ 2018-10-01 17:33 UTC (permalink / raw)
  To: linux-kernel
  Cc: bcm-kernel-feedback-list, Florian Fainelli, Jens Axboe,
	Rob Herring, Mark Rutland,
	open list:LIBATA SUBSYSTEM (Serial and Parallel ATA drivers),
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS

Match the "brcm,bcm63138-ahci" compatible string in order to allow this
driver to probe on such platforms.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/ata/ahci_brcm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/ata/ahci_brcm.c b/drivers/ata/ahci_brcm.c
index 0e401b7c0856..fba5a3044c8a 100644
--- a/drivers/ata/ahci_brcm.c
+++ b/drivers/ata/ahci_brcm.c
@@ -383,6 +383,7 @@ static struct scsi_host_template ahci_platform_sht = {
 static const struct of_device_id ahci_of_match[] = {
 	{.compatible = "brcm,bcm7425-ahci", .data = (void *)BRCM_SATA_BCM7425},
 	{.compatible = "brcm,bcm7445-ahci", .data = (void *)BRCM_SATA_BCM7445},
+	{.compatible = "brcm,bcm63138-ahci", .data = (void *)BRCM_SATA_BCM7445},
 	{.compatible = "brcm,bcm-nsp-ahci", .data = (void *)BRCM_SATA_NSP},
 	{},
 };
-- 
2.17.1


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

* [PATCH v2 4/4] ata: ahci_brcm: Allow using driver or DSL SoCs
  2018-10-01 17:32 ` Florian Fainelli
@ 2018-10-01 17:33   ` Florian Fainelli
  -1 siblings, 0 replies; 12+ messages in thread
From: Florian Fainelli @ 2018-10-01 17:33 UTC (permalink / raw)
  To: linux-kernel
  Cc: bcm-kernel-feedback-list, Florian Fainelli, Jens Axboe,
	Rob Herring, Mark Rutland,
	open list:LIBATA SUBSYSTEM Serial and Parallel ATA drivers,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS

The Broadcom STB AHCI controller is the same as the one found on DSL
SoCs, so we will utilize the same driver on these systems as well.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/ata/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 39b181d6bd0d..99698d7fe585 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -121,7 +121,8 @@ config SATA_AHCI_PLATFORM
 
 config AHCI_BRCM
 	tristate "Broadcom AHCI SATA support"
-	depends on ARCH_BRCMSTB || BMIPS_GENERIC || ARCH_BCM_NSP
+	depends on ARCH_BRCMSTB || BMIPS_GENERIC || ARCH_BCM_NSP || \
+		   ARCH_BCM_63XX
 	help
 	  This option enables support for the AHCI SATA3 controller found on
 	  Broadcom SoC's.
-- 
2.17.1

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

* [PATCH v2 4/4] ata: ahci_brcm: Allow using driver or DSL SoCs
@ 2018-10-01 17:33   ` Florian Fainelli
  0 siblings, 0 replies; 12+ messages in thread
From: Florian Fainelli @ 2018-10-01 17:33 UTC (permalink / raw)
  To: linux-kernel
  Cc: bcm-kernel-feedback-list, Florian Fainelli, Jens Axboe,
	Rob Herring, Mark Rutland,
	open list:LIBATA SUBSYSTEM (Serial and Parallel ATA drivers),
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS

The Broadcom STB AHCI controller is the same as the one found on DSL
SoCs, so we will utilize the same driver on these systems as well.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/ata/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 39b181d6bd0d..99698d7fe585 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -121,7 +121,8 @@ config SATA_AHCI_PLATFORM
 
 config AHCI_BRCM
 	tristate "Broadcom AHCI SATA support"
-	depends on ARCH_BRCMSTB || BMIPS_GENERIC || ARCH_BCM_NSP
+	depends on ARCH_BRCMSTB || BMIPS_GENERIC || ARCH_BCM_NSP || \
+		   ARCH_BCM_63XX
 	help
 	  This option enables support for the AHCI SATA3 controller found on
 	  Broadcom SoC's.
-- 
2.17.1


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

* Re: [PATCH v2 0/4] AHCI support for BCM63138
  2018-10-01 17:32 ` Florian Fainelli
@ 2018-10-01 22:39   ` Jens Axboe
  -1 siblings, 0 replies; 12+ messages in thread
From: Jens Axboe @ 2018-10-01 22:39 UTC (permalink / raw)
  To: Florian Fainelli, linux-kernel
  Cc: bcm-kernel-feedback-list, Rob Herring, Mark Rutland,
	open list:LIBATA SUBSYSTEM (Serial and Parallel ATA drivers),
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS

On 10/1/18 11:32 AM, Florian Fainelli wrote:
> Hi Jens,
> 
> This is a resend of the previous series posted here:
> 
> https://lkml.org/lkml/2018/9/20/1060
> 
> With a few minor changes:
> 
> - rebased against your for-4.20/libata branch
> - added Rob's Reviewed-by to patch
> - fixed the use of the reset controller API

Thanks, applied for 4.20.

-- 
Jens Axboe

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

* Re: [PATCH v2 0/4] AHCI support for BCM63138
@ 2018-10-01 22:39   ` Jens Axboe
  0 siblings, 0 replies; 12+ messages in thread
From: Jens Axboe @ 2018-10-01 22:39 UTC (permalink / raw)
  To: Florian Fainelli, linux-kernel
  Cc: bcm-kernel-feedback-list, Rob Herring, Mark Rutland,
	open list:LIBATA SUBSYSTEM (Serial and Parallel ATA drivers),
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS

On 10/1/18 11:32 AM, Florian Fainelli wrote:
> Hi Jens,
> 
> This is a resend of the previous series posted here:
> 
> https://lkml.org/lkml/2018/9/20/1060
> 
> With a few minor changes:
> 
> - rebased against your for-4.20/libata branch
> - added Rob's Reviewed-by to patch
> - fixed the use of the reset controller API

Thanks, applied for 4.20.

-- 
Jens Axboe


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

end of thread, other threads:[~2018-10-01 22:39 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-01 17:32 [PATCH v2 0/4] AHCI support for BCM63138 Florian Fainelli
2018-10-01 17:32 ` Florian Fainelli
2018-10-01 17:32 ` [PATCH v2 1/4] dt-bindings: ata: Document BCM63138 compatible string Florian Fainelli
2018-10-01 17:32   ` Florian Fainelli
2018-10-01 17:33 ` [PATCH v2 2/4] ata: ahci_brcm: Allow optional reset controller to be used Florian Fainelli
2018-10-01 17:33   ` Florian Fainelli
2018-10-01 17:33 ` [PATCH v2 3/4] ata: ahci_brcm: Match BCM63138 compatible strings Florian Fainelli
2018-10-01 17:33   ` Florian Fainelli
2018-10-01 17:33 ` [PATCH v2 4/4] ata: ahci_brcm: Allow using driver or DSL SoCs Florian Fainelli
2018-10-01 17:33   ` Florian Fainelli
2018-10-01 22:39 ` [PATCH v2 0/4] AHCI support for BCM63138 Jens Axboe
2018-10-01 22:39   ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.