2018-10-01 17:33:53

by Florian Fainelli

[permalink] [raw]
Subject: [PATCH v2 0/4] AHCI support for BCM63138

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



2018-10-01 17:33:55

by Florian Fainelli

[permalink] [raw]
Subject: [PATCH v2 1/4] dt-bindings: ata: Document BCM63138 compatible string

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

Reviewed-by: Rob Herring <[email protected]>
Signed-off-by: Florian Fainelli <[email protected]>
---
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


2018-10-01 17:33:58

by Florian Fainelli

[permalink] [raw]
Subject: [PATCH v2 2/4] ata: ahci_brcm: Allow optional reset controller to be used

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 <[email protected]>
---
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


2018-10-01 17:34:04

by Florian Fainelli

[permalink] [raw]
Subject: [PATCH v2 4/4] ata: ahci_brcm: Allow using driver or DSL SoCs

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 <[email protected]>
---
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


2018-10-01 17:34:11

by Florian Fainelli

[permalink] [raw]
Subject: [PATCH v2 3/4] ata: ahci_brcm: Match BCM63138 compatible strings

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

Signed-off-by: Florian Fainelli <[email protected]>
---
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


2018-10-01 22:41:44

by Jens Axboe

[permalink] [raw]
Subject: Re: [PATCH v2 0/4] AHCI support for BCM63138

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