aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTang Yuantian <Yuantian.Tang@nxp.com>2017-01-20 01:59:35 -0500
committerTejun Heo <tj@kernel.org>2017-01-20 08:31:14 -0500
commit01f2901a264d954d3985e8bce1bf637ae52d4918 (patch)
tree51139123279dbae5939421293d94bcff80f496dd
parent386dc3b87a04fe4929bc3afb83660f050a5a0faa (diff)
ahci: qoriq: report error when ecc register address is missing in dts
For ls1021a, and armv8 chasis 2 socs, sata ecc must be disabled. If ecc register is not found in sata node in dts, report error. This is a chip erratum described as bellow: The Read DMA operations get early termination indication from the controller. This issue is observed as CRC error in the status registers. The issue is due to address collision at address 0 in the dual port memory. The read is a dummy read to flush out the header, but due to collision the controller logs the mbit error reported by the ECC check logic. This results in the early termination of the Read DMA operation by the controller. The issue happens to all the interface speeds(GEN1/2/3) for all the products. Workaround: Disable ECC feature on those platforms. Signed-off-by: Tang Yuantian <yuantian.tang@nxp.com> Signed-off-by: Tejun Heo <tj@kernel.org>
-rw-r--r--drivers/ata/ahci_qoriq.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/ata/ahci_qoriq.c b/drivers/ata/ahci_qoriq.c
index 01ef66270a46..137b1c76f259 100644
--- a/drivers/ata/ahci_qoriq.c
+++ b/drivers/ata/ahci_qoriq.c
@@ -46,7 +46,7 @@
46#define LS1021A_AXICC_ADDR 0xC0 46#define LS1021A_AXICC_ADDR 0xC0
47 47
48#define SATA_ECC_DISABLE 0x00020000 48#define SATA_ECC_DISABLE 0x00020000
49#define LS1046A_SATA_ECC_DIS 0x80000000 49#define ECC_DIS_ARMV8_CH2 0x80000000
50 50
51enum ahci_qoriq_type { 51enum ahci_qoriq_type {
52 AHCI_LS1021A, 52 AHCI_LS1021A,
@@ -158,6 +158,8 @@ static int ahci_qoriq_phy_init(struct ahci_host_priv *hpriv)
158 158
159 switch (qpriv->type) { 159 switch (qpriv->type) {
160 case AHCI_LS1021A: 160 case AHCI_LS1021A:
161 if (!qpriv->ecc_addr)
162 return -EINVAL;
161 writel(SATA_ECC_DISABLE, qpriv->ecc_addr); 163 writel(SATA_ECC_DISABLE, qpriv->ecc_addr);
162 writel(AHCI_PORT_PHY_1_CFG, reg_base + PORT_PHY1); 164 writel(AHCI_PORT_PHY_1_CFG, reg_base + PORT_PHY1);
163 writel(LS1021A_PORT_PHY2, reg_base + PORT_PHY2); 165 writel(LS1021A_PORT_PHY2, reg_base + PORT_PHY2);
@@ -171,6 +173,9 @@ static int ahci_qoriq_phy_init(struct ahci_host_priv *hpriv)
171 break; 173 break;
172 174
173 case AHCI_LS1043A: 175 case AHCI_LS1043A:
176 if (!qpriv->ecc_addr)
177 return -EINVAL;
178 writel(ECC_DIS_ARMV8_CH2, qpriv->ecc_addr);
174 writel(AHCI_PORT_PHY_1_CFG, reg_base + PORT_PHY1); 179 writel(AHCI_PORT_PHY_1_CFG, reg_base + PORT_PHY1);
175 writel(AHCI_PORT_TRANS_CFG, reg_base + PORT_TRANS); 180 writel(AHCI_PORT_TRANS_CFG, reg_base + PORT_TRANS);
176 if (qpriv->is_dmacoherent) 181 if (qpriv->is_dmacoherent)
@@ -185,7 +190,9 @@ static int ahci_qoriq_phy_init(struct ahci_host_priv *hpriv)
185 break; 190 break;
186 191
187 case AHCI_LS1046A: 192 case AHCI_LS1046A:
188 writel(LS1046A_SATA_ECC_DIS, qpriv->ecc_addr); 193 if (!qpriv->ecc_addr)
194 return -EINVAL;
195 writel(ECC_DIS_ARMV8_CH2, qpriv->ecc_addr);
189 writel(AHCI_PORT_PHY_1_CFG, reg_base + PORT_PHY1); 196 writel(AHCI_PORT_PHY_1_CFG, reg_base + PORT_PHY1);
190 writel(AHCI_PORT_TRANS_CFG, reg_base + PORT_TRANS); 197 writel(AHCI_PORT_TRANS_CFG, reg_base + PORT_TRANS);
191 if (qpriv->is_dmacoherent) 198 if (qpriv->is_dmacoherent)