Skip to content

Commit 803f9fb

Browse files
Richard Zhufloatious
authored andcommitted
ata: ahci_imx: Enlarge RX water mark for i.MX8QM SATA
The RXWM(RxWaterMark) sets the minimum number of free location within the RX FIFO before the watermark is exceeded which in turn will cause the Transport Layer to instruct the Link Layer to transmit HOLDS to the transmitting end. Based on the default RXWM value 0x20, RX FIFO overflow might be observed on i.MX8QM MEK board, when some Gen3 SATA disks are used. The FIFO overflow will result in CRC error, internal error and protocol error, then the SATA link is not stable anymore. To fix this issue, enlarge RX water mark setting from 0x20 to 0x29. Signed-off-by: Richard Zhu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Niklas Cassel <[email protected]>
1 parent 3156e1b commit 803f9fb

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/ata/ahci_imx.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ enum {
4545
/* Clock Reset Register */
4646
IMX_CLOCK_RESET = 0x7f3f,
4747
IMX_CLOCK_RESET_RESET = 1 << 0,
48+
/* IMX8QM SATA specific control registers */
49+
IMX8QM_SATA_AHCI_PTC = 0xc8,
50+
IMX8QM_SATA_AHCI_PTC_RXWM_MASK = GENMASK(6, 0),
51+
IMX8QM_SATA_AHCI_PTC_RXWM = 0x29,
4852
};
4953

5054
enum ahci_imx_type {
@@ -466,6 +470,12 @@ static int imx8_sata_enable(struct ahci_host_priv *hpriv)
466470
phy_power_off(imxpriv->cali_phy0);
467471
phy_exit(imxpriv->cali_phy0);
468472

473+
/* RxWaterMark setting */
474+
val = readl(hpriv->mmio + IMX8QM_SATA_AHCI_PTC);
475+
val &= ~IMX8QM_SATA_AHCI_PTC_RXWM_MASK;
476+
val |= IMX8QM_SATA_AHCI_PTC_RXWM;
477+
writel(val, hpriv->mmio + IMX8QM_SATA_AHCI_PTC);
478+
469479
return 0;
470480

471481
err_sata_phy_exit:

0 commit comments

Comments
 (0)