Skip to content

Commit a1a205d

Browse files
Kefeng Wanghtejun
authored andcommitted
ahci: add support for Hisilicon sata
The hip04 SoC of hisilicon has an AHCI compliant SATA controller, and it is compliant with the ahci 1.3 and sata 3.0 specification. There is a wrong bit in HOST_CAP of hip04 sata controller, which enable unsupported feature of FBS, use AHCI_HFLAG_NO_FBS hflag to disable it. Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Kefeng Wang <kefeng.wang@linaro.org> Signed-off-by: Tejun Heo <tj@kernel.org>
1 parent f9f3691 commit a1a205d

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

‎Documentation/devicetree/bindings/ata/ahci-platform.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Required properties:
88
- "allwinner,sun4i-a10-ahci"
99
- "fsl,imx53-ahci"
1010
- "fsl,imx6q-ahci"
11+
- "hisilicon,hisi-ahci"
1112
- "ibm,476gtr-ahci"
1213
- "marvell,armada-380-ahci"
1314
- "snps,dwc-ahci"

‎drivers/ata/ahci_platform.c‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <linux/module.h>
1717
#include <linux/pm.h>
1818
#include <linux/device.h>
19+
#include <linux/of_device.h>
1920
#include <linux/platform_device.h>
2021
#include <linux/libata.h>
2122
#include <linux/ahci_platform.h>
@@ -33,6 +34,7 @@ static int ahci_probe(struct platform_device *pdev)
3334
struct device *dev = &pdev->dev;
3435
struct ahci_platform_data *pdata = dev_get_platdata(dev);
3536
struct ahci_host_priv *hpriv;
37+
unsigned long hflags = 0;
3638
int rc;
3739

3840
hpriv = ahci_platform_get_resources(pdev);
@@ -55,7 +57,11 @@ static int ahci_probe(struct platform_device *pdev)
5557
goto disable_resources;
5658
}
5759

58-
rc = ahci_platform_init_host(pdev, hpriv, &ahci_port_info, 0, 0, 0);
60+
if (of_device_is_compatible(dev->of_node, "hisilicon,hisi-ahci"))
61+
hflags |= AHCI_HFLAG_NO_FBS;
62+
63+
rc = ahci_platform_init_host(pdev, hpriv, &ahci_port_info,
64+
hflags, 0, 0);
5965
if (rc)
6066
goto pdata_exit;
6167

@@ -76,6 +82,7 @@ static const struct of_device_id ahci_of_match[] = {
7682
{ .compatible = "snps,exynos5440-ahci", },
7783
{ .compatible = "ibm,476gtr-ahci", },
7884
{ .compatible = "snps,dwc-ahci", },
85+
{ .compatible = "hisilicon,hisi-ahci", },
7986
{},
8087
};
8188
MODULE_DEVICE_TABLE(of, ahci_of_match);

0 commit comments

Comments
 (0)