AHCI support for BCM63138
Subsystems (2)
v2 cover 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(-)
Signature · 1 line
2.17.1
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.
--- Documentation/devicetree/bindings/ata/brcm,sata-brcm.txt | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/ata/brcm,sata-brcm.txt +1 -0
@@ -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
Signature · 1 line
2.17.1
PATCH v2 2/4 ata: ahci_brcm: Allow optional reset controller to be used
In reply to Florian FainelliOn BCM63138, we need to reset the AHCI core prior to start utilizing it, grab the reset controller device cookie and do that.
--- drivers/ata/ahci_brcm.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/ata/ahci_brcm.c +7 -0
@@ -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 ;
Signature · 1 line
2.17.1
PATCH v2 3/4 ata: ahci_brcm: Match BCM63138 compatible strings
In reply to Florian FainelliMatch the "brcm,bcm63138-ahci" compatible string in order to allow this driver to probe on such platforms.
--- drivers/ata/ahci_brcm.c | 1 + 1 file changed, 1 insertion(+)
drivers/ata/ahci_brcm.c +1 -0
@@ -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 }, {}, };
Signature · 1 line
2.17.1
PATCH v2 4/4 ata: ahci_brcm: Allow using driver or DSL SoCs
In reply to Florian FainelliThe 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.
--- drivers/ata/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/ata/Kconfig +2 -1
@@ -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.
Signature · 1 line
2.17.1
Jens Axboe
AppliedQuoted 11 lines · Florian Fainelli
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.
Signature · 1 line
Jens Axboe