for-5.2/libata-20190507

-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEEwPw5LcreJtl1+l5K99NY+ylx4KYFAlzR9NsQHGF4Ym9lQGtl
 cm5lbC5kawAKCRD301j7KXHgpqL7D/9neb+L91FyDczbJwdw0hxqZ6geKpR5oIKQ
 6C3tP6TpWXJbyvARCaaCrRl3TYNeFb/k39ji8/n2LycPIc55LI80ZSYamWUTgtqw
 n6/fBLHYrTnQGV/ns2cK8DBxLcTPbqGixQbWpq6yHVzCYHpWPky0oqG6syiR5GnE
 E7r6l+lwiKZ3B6x80Z9v5VmXg7me4BTNB8w/L5ps0jdxvquClzAFSv71sCi4MmRf
 K/ma8B1yjakLWfFKh61MSHp2n5w6X3ld+mex8bmwIMifWr0lU5Gyr83Km+LQzh5Z
 ETcbZkMcbuwQ8nZxtiztuIWmkgohZdpjhejZRtHxNIkQrL2gzqBlNKMKuPkysJYQ
 7jrxATb5QaM7k3Ff2kxqVRL12IgHM19wtmZ/S8cAQnf05qktCejgX+P5q93GWH5n
 jlHIQ84mLge7eolawzIfomW3afTAJavtjkmAsIkU+7hImIGC5pgwtccA1JvXWwwt
 +W57uSwq7+LnMlLs05Nw9lH3mb87emVdXx5iINIMmdedkOLDN4q7XJB2c67UNXvI
 EV2CHyTseiC4WaA/H5kHbFb0iqziwKkCauoGV6aW7PJkEOGwbfyfenYR4lSc9kmb
 S2wXg1UUcGNL9U3U+SL/gviCqu1GICVFPDCF0rFfeiTg/9BTJZxRSa3gIjZ+NrZz
 i1RTUfhGcg==
 =TfnW
 -----END PGP SIGNATURE-----

Merge tag 'for-5.2/libata-20190507' of git://git.kernel.dk/linux-block

Pull libata updates from Jens Axboe:
 "Just two minor fixes queued up for 5.2, adding support for two
  different platforms to ahci"

* tag 'for-5.2/libata-20190507' of git://git.kernel.dk/linux-block:
  ahci: qoriq: add ls1028a platforms support
  ahci: qoriq: add lx2160 platforms support
This commit is contained in:
Linus Torvalds 2019-05-07 18:43:36 -07:00
commit e4eaa9efbf

View file

@ -53,11 +53,13 @@
enum ahci_qoriq_type {
AHCI_LS1021A,
AHCI_LS1028A,
AHCI_LS1043A,
AHCI_LS2080A,
AHCI_LS1046A,
AHCI_LS1088A,
AHCI_LS2088A,
AHCI_LX2160A,
};
struct ahci_qoriq_priv {
@ -67,13 +69,17 @@ struct ahci_qoriq_priv {
bool is_dmacoherent;
};
static bool ecc_initialized;
static const struct of_device_id ahci_qoriq_of_match[] = {
{ .compatible = "fsl,ls1021a-ahci", .data = (void *)AHCI_LS1021A},
{ .compatible = "fsl,ls1028a-ahci", .data = (void *)AHCI_LS1028A},
{ .compatible = "fsl,ls1043a-ahci", .data = (void *)AHCI_LS1043A},
{ .compatible = "fsl,ls2080a-ahci", .data = (void *)AHCI_LS2080A},
{ .compatible = "fsl,ls1046a-ahci", .data = (void *)AHCI_LS1046A},
{ .compatible = "fsl,ls1088a-ahci", .data = (void *)AHCI_LS1088A},
{ .compatible = "fsl,ls2088a-ahci", .data = (void *)AHCI_LS2088A},
{ .compatible = "fsl,lx2160a-ahci", .data = (void *)AHCI_LX2160A},
{},
};
MODULE_DEVICE_TABLE(of, ahci_qoriq_of_match);
@ -165,9 +171,10 @@ static int ahci_qoriq_phy_init(struct ahci_host_priv *hpriv)
switch (qpriv->type) {
case AHCI_LS1021A:
if (!qpriv->ecc_addr)
if (!(qpriv->ecc_addr || ecc_initialized))
return -EINVAL;
writel(SATA_ECC_DISABLE, qpriv->ecc_addr);
else if (qpriv->ecc_addr && !ecc_initialized)
writel(SATA_ECC_DISABLE, qpriv->ecc_addr);
writel(AHCI_PORT_PHY_1_CFG, reg_base + PORT_PHY1);
writel(LS1021A_PORT_PHY2, reg_base + PORT_PHY2);
writel(LS1021A_PORT_PHY3, reg_base + PORT_PHY3);
@ -180,10 +187,12 @@ static int ahci_qoriq_phy_init(struct ahci_host_priv *hpriv)
break;
case AHCI_LS1043A:
if (!qpriv->ecc_addr)
if (!(qpriv->ecc_addr || ecc_initialized))
return -EINVAL;
writel(readl(qpriv->ecc_addr) | ECC_DIS_ARMV8_CH2,
qpriv->ecc_addr);
else if (qpriv->ecc_addr && !ecc_initialized)
writel(readl(qpriv->ecc_addr) |
ECC_DIS_ARMV8_CH2,
qpriv->ecc_addr);
writel(AHCI_PORT_PHY_1_CFG, reg_base + PORT_PHY1);
writel(AHCI_PORT_PHY2_CFG, reg_base + PORT_PHY2);
writel(AHCI_PORT_PHY3_CFG, reg_base + PORT_PHY3);
@ -202,10 +211,12 @@ static int ahci_qoriq_phy_init(struct ahci_host_priv *hpriv)
break;
case AHCI_LS1046A:
if (!qpriv->ecc_addr)
if (!(qpriv->ecc_addr || ecc_initialized))
return -EINVAL;
writel(readl(qpriv->ecc_addr) | ECC_DIS_ARMV8_CH2,
qpriv->ecc_addr);
else if (qpriv->ecc_addr && !ecc_initialized)
writel(readl(qpriv->ecc_addr) |
ECC_DIS_ARMV8_CH2,
qpriv->ecc_addr);
writel(AHCI_PORT_PHY_1_CFG, reg_base + PORT_PHY1);
writel(AHCI_PORT_PHY2_CFG, reg_base + PORT_PHY2);
writel(AHCI_PORT_PHY3_CFG, reg_base + PORT_PHY3);
@ -214,11 +225,15 @@ static int ahci_qoriq_phy_init(struct ahci_host_priv *hpriv)
writel(AHCI_PORT_AXICC_CFG, reg_base + PORT_AXICC);
break;
case AHCI_LS1028A:
case AHCI_LS1088A:
if (!qpriv->ecc_addr)
case AHCI_LX2160A:
if (!(qpriv->ecc_addr || ecc_initialized))
return -EINVAL;
writel(readl(qpriv->ecc_addr) | ECC_DIS_LS1088A,
qpriv->ecc_addr);
else if (qpriv->ecc_addr && !ecc_initialized)
writel(readl(qpriv->ecc_addr) |
ECC_DIS_LS1088A,
qpriv->ecc_addr);
writel(AHCI_PORT_PHY_1_CFG, reg_base + PORT_PHY1);
writel(AHCI_PORT_PHY2_CFG, reg_base + PORT_PHY2);
writel(AHCI_PORT_PHY3_CFG, reg_base + PORT_PHY3);
@ -237,6 +252,7 @@ static int ahci_qoriq_phy_init(struct ahci_host_priv *hpriv)
break;
}
ecc_initialized = true;
return 0;
}
@ -264,13 +280,18 @@ static int ahci_qoriq_probe(struct platform_device *pdev)
qoriq_priv->type = (enum ahci_qoriq_type)of_id->data;
res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
"sata-ecc");
if (res) {
qoriq_priv->ecc_addr = devm_ioremap_resource(dev, res);
if (IS_ERR(qoriq_priv->ecc_addr))
return PTR_ERR(qoriq_priv->ecc_addr);
if (unlikely(!ecc_initialized)) {
res = platform_get_resource_byname(pdev,
IORESOURCE_MEM,
"sata-ecc");
if (res) {
qoriq_priv->ecc_addr =
devm_ioremap_resource(dev, res);
if (IS_ERR(qoriq_priv->ecc_addr))
return PTR_ERR(qoriq_priv->ecc_addr);
}
}
qoriq_priv->is_dmacoherent = of_dma_is_coherent(np);
rc = ahci_platform_enable_resources(hpriv);