Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

phy: cadence: Sierra: Add TI J721E specific PCIe multilink lane configuration

This patch adds workaround for TI J721E errata i2183
(https://www.ti.com/lit/er/sprz455a/sprz455a.pdf).
PCIe fails to link up if SERDES lanes not used by PCIe are assigned to
another protocol. For example, link training fails if lanes 2 and 3 are
assigned to another protocol while lanes 0 and 1 are used for PCIe to
form a two lane link. This failure is due to an incorrect tie-off on an
internal status signal indicating electrical idle.

Status signals going from SERDES to PCIe Controller are tied-off when a
lane is not assigned to PCIe. Signal indicating electrical idle is
incorrectly tied-off to a state that indicates non-idle. As a result,
PCIe sees unused lanes to be out of electrical idle and this causes
LTSSM to exit Detect.Quiet state without waiting for 12ms timeout to
occur. If a receiver is not detected on the first receiver detection
attempt in Detect.Active state, LTSSM goes back to Detect.Quiet and
again moves forward to Detect.Active state without waiting for 12ms as
required by PCIe base specification. Since wait time in Detect.Quiet is
skipped, multiple receiver detect operations are performed back-to-back
without allowing time for capacitance on the transmit lines to
discharge. This causes subsequent receiver detection to always fail even
if a receiver gets connected eventually.

The workaround only works for 1-lane PCIe configuration. This workaround
involves enabling receiver detect override by setting TX_RCVDET_OVRD_PREG_j
register of the lane running PCIe to 0x2. This causes SERDES to indicate
successful receiver detect when LTSSM is in Detect.Active state, whether a
receiver is actually present or not. If the receiver is present, LTSSM
proceeds to link up as expected. However if receiver is not present, LTSSM
will time out in Polling.Configuration substate since the expected training
sequence packets will not be received.

Signed-off-by: Swapnil Jakhade <sjakhade@cadence.com>
Link: https://lore.kernel.org/r/20220303055026.24899-1-sjakhade@cadence.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Swapnil Jakhade and committed by
Vinod Koul
e72659b6 2404387f

+190 -3
+190 -3
drivers/phy/cadence/phy-cadence-sierra.c
··· 83 83 #define SIERRA_DFE_BIASTRIM_PREG 0x04C 84 84 #define SIERRA_DRVCTRL_ATTEN_PREG 0x06A 85 85 #define SIERRA_DRVCTRL_BOOST_PREG 0x06F 86 + #define SIERRA_TX_RCVDET_OVRD_PREG 0x072 86 87 #define SIERRA_CLKPATHCTRL_TMR_PREG 0x081 87 88 #define SIERRA_RX_CREQ_FLTR_A_MODE3_PREG 0x085 88 89 #define SIERRA_RX_CREQ_FLTR_A_MODE2_PREG 0x086 ··· 1685 1684 .num_regs = ARRAY_SIZE(ml_pcie_100_no_ssc_ln_regs), 1686 1685 }; 1687 1686 1687 + /* 1688 + * TI J721E: 1689 + * refclk100MHz_32b_PCIe_ln_no_ssc, multilink, using_plllc, 1690 + * cmn_pllcy_anaclk0_1Ghz, xcvr_pllclk_fullrt_500mhz 1691 + */ 1692 + static const struct cdns_reg_pairs ti_ml_pcie_100_no_ssc_ln_regs[] = { 1693 + {0xFC08, SIERRA_DET_STANDEC_A_PREG}, 1694 + {0x001D, SIERRA_PSM_A3IN_TMR_PREG}, 1695 + {0x0004, SIERRA_PSC_LN_A3_PREG}, 1696 + {0x0004, SIERRA_PSC_LN_A4_PREG}, 1697 + {0x0004, SIERRA_PSC_LN_IDLE_PREG}, 1698 + {0x1555, SIERRA_DFE_BIASTRIM_PREG}, 1699 + {0x9703, SIERRA_DRVCTRL_BOOST_PREG}, 1700 + {0x8055, SIERRA_RX_CREQ_FLTR_A_MODE3_PREG}, 1701 + {0x80BB, SIERRA_RX_CREQ_FLTR_A_MODE2_PREG}, 1702 + {0x8351, SIERRA_RX_CREQ_FLTR_A_MODE1_PREG}, 1703 + {0x8349, SIERRA_RX_CREQ_FLTR_A_MODE0_PREG}, 1704 + {0x0002, SIERRA_CREQ_DCBIASATTEN_OVR_PREG}, 1705 + {0x9800, SIERRA_RX_CTLE_CAL_PREG}, 1706 + {0x5624, SIERRA_DEQ_CONCUR_CTRL2_PREG}, 1707 + {0x000F, SIERRA_DEQ_EPIPWR_CTRL2_PREG}, 1708 + {0x00FF, SIERRA_DEQ_FAST_MAINT_CYCLES_PREG}, 1709 + {0x4C4C, SIERRA_DEQ_ERRCMP_CTRL_PREG}, 1710 + {0x02FA, SIERRA_DEQ_OFFSET_CTRL_PREG}, 1711 + {0x02FA, SIERRA_DEQ_GAIN_CTRL_PREG}, 1712 + {0x0041, SIERRA_DEQ_GLUT0}, 1713 + {0x0082, SIERRA_DEQ_GLUT1}, 1714 + {0x00C3, SIERRA_DEQ_GLUT2}, 1715 + {0x0145, SIERRA_DEQ_GLUT3}, 1716 + {0x0186, SIERRA_DEQ_GLUT4}, 1717 + {0x09E7, SIERRA_DEQ_ALUT0}, 1718 + {0x09A6, SIERRA_DEQ_ALUT1}, 1719 + {0x0965, SIERRA_DEQ_ALUT2}, 1720 + {0x08E3, SIERRA_DEQ_ALUT3}, 1721 + {0x00FA, SIERRA_DEQ_DFETAP0}, 1722 + {0x00FA, SIERRA_DEQ_DFETAP1}, 1723 + {0x00FA, SIERRA_DEQ_DFETAP2}, 1724 + {0x00FA, SIERRA_DEQ_DFETAP3}, 1725 + {0x00FA, SIERRA_DEQ_DFETAP4}, 1726 + {0x000F, SIERRA_DEQ_PRECUR_PREG}, 1727 + {0x0280, SIERRA_DEQ_POSTCUR_PREG}, 1728 + {0x8F00, SIERRA_DEQ_POSTCUR_DECR_PREG}, 1729 + {0x3C0F, SIERRA_DEQ_TAU_CTRL1_SLOW_MAINT_PREG}, 1730 + {0x1C0C, SIERRA_DEQ_TAU_CTRL2_PREG}, 1731 + {0x0100, SIERRA_DEQ_TAU_CTRL3_PREG}, 1732 + {0x5E82, SIERRA_DEQ_OPENEYE_CTRL_PREG}, 1733 + {0x002B, SIERRA_CPI_TRIM_PREG}, 1734 + {0x0003, SIERRA_EPI_CTRL_PREG}, 1735 + {0x803F, SIERRA_SDFILT_H2L_A_PREG}, 1736 + {0x0004, SIERRA_RXBUFFER_CTLECTRL_PREG}, 1737 + {0x2010, SIERRA_RXBUFFER_RCDFECTRL_PREG}, 1738 + {0x4432, SIERRA_RXBUFFER_DFECTRL_PREG}, 1739 + {0x0002, SIERRA_TX_RCVDET_OVRD_PREG} 1740 + }; 1741 + 1742 + static struct cdns_sierra_vals ti_ml_pcie_100_no_ssc_ln_vals = { 1743 + .reg_pairs = ti_ml_pcie_100_no_ssc_ln_regs, 1744 + .num_regs = ARRAY_SIZE(ti_ml_pcie_100_no_ssc_ln_regs), 1745 + }; 1746 + 1688 1747 /* refclk100MHz_32b_PCIe_cmn_pll_int_ssc, pcie_links_using_plllc, pipe_bw_3 */ 1689 1748 static const struct cdns_reg_pairs pcie_100_int_ssc_plllc_cmn_regs[] = { 1690 1749 {0x000E, SIERRA_CMN_PLLLC_MODE_PREG}, ··· 1826 1765 .num_regs = ARRAY_SIZE(ml_pcie_100_int_ssc_ln_regs), 1827 1766 }; 1828 1767 1768 + /* 1769 + * TI J721E: 1770 + * refclk100MHz_32b_PCIe_ln_int_ssc, multilink, using_plllc, 1771 + * cmn_pllcy_anaclk0_1Ghz, xcvr_pllclk_fullrt_500mhz 1772 + */ 1773 + static const struct cdns_reg_pairs ti_ml_pcie_100_int_ssc_ln_regs[] = { 1774 + {0xFC08, SIERRA_DET_STANDEC_A_PREG}, 1775 + {0x001D, SIERRA_PSM_A3IN_TMR_PREG}, 1776 + {0x0004, SIERRA_PSC_LN_A3_PREG}, 1777 + {0x0004, SIERRA_PSC_LN_A4_PREG}, 1778 + {0x0004, SIERRA_PSC_LN_IDLE_PREG}, 1779 + {0x1555, SIERRA_DFE_BIASTRIM_PREG}, 1780 + {0x9703, SIERRA_DRVCTRL_BOOST_PREG}, 1781 + {0x813E, SIERRA_CLKPATHCTRL_TMR_PREG}, 1782 + {0x8047, SIERRA_RX_CREQ_FLTR_A_MODE3_PREG}, 1783 + {0x808F, SIERRA_RX_CREQ_FLTR_A_MODE2_PREG}, 1784 + {0x808F, SIERRA_RX_CREQ_FLTR_A_MODE1_PREG}, 1785 + {0x808F, SIERRA_RX_CREQ_FLTR_A_MODE0_PREG}, 1786 + {0x0002, SIERRA_CREQ_DCBIASATTEN_OVR_PREG}, 1787 + {0x9800, SIERRA_RX_CTLE_CAL_PREG}, 1788 + {0x033C, SIERRA_RX_CTLE_MAINTENANCE_PREG}, 1789 + {0x44CC, SIERRA_CREQ_EQ_OPEN_EYE_THRESH_PREG}, 1790 + {0x5624, SIERRA_DEQ_CONCUR_CTRL2_PREG}, 1791 + {0x000F, SIERRA_DEQ_EPIPWR_CTRL2_PREG}, 1792 + {0x00FF, SIERRA_DEQ_FAST_MAINT_CYCLES_PREG}, 1793 + {0x4C4C, SIERRA_DEQ_ERRCMP_CTRL_PREG}, 1794 + {0x02FA, SIERRA_DEQ_OFFSET_CTRL_PREG}, 1795 + {0x02FA, SIERRA_DEQ_GAIN_CTRL_PREG}, 1796 + {0x0041, SIERRA_DEQ_GLUT0}, 1797 + {0x0082, SIERRA_DEQ_GLUT1}, 1798 + {0x00C3, SIERRA_DEQ_GLUT2}, 1799 + {0x0145, SIERRA_DEQ_GLUT3}, 1800 + {0x0186, SIERRA_DEQ_GLUT4}, 1801 + {0x09E7, SIERRA_DEQ_ALUT0}, 1802 + {0x09A6, SIERRA_DEQ_ALUT1}, 1803 + {0x0965, SIERRA_DEQ_ALUT2}, 1804 + {0x08E3, SIERRA_DEQ_ALUT3}, 1805 + {0x00FA, SIERRA_DEQ_DFETAP0}, 1806 + {0x00FA, SIERRA_DEQ_DFETAP1}, 1807 + {0x00FA, SIERRA_DEQ_DFETAP2}, 1808 + {0x00FA, SIERRA_DEQ_DFETAP3}, 1809 + {0x00FA, SIERRA_DEQ_DFETAP4}, 1810 + {0x000F, SIERRA_DEQ_PRECUR_PREG}, 1811 + {0x0280, SIERRA_DEQ_POSTCUR_PREG}, 1812 + {0x8F00, SIERRA_DEQ_POSTCUR_DECR_PREG}, 1813 + {0x3C0F, SIERRA_DEQ_TAU_CTRL1_SLOW_MAINT_PREG}, 1814 + {0x1C0C, SIERRA_DEQ_TAU_CTRL2_PREG}, 1815 + {0x0100, SIERRA_DEQ_TAU_CTRL3_PREG}, 1816 + {0x5E82, SIERRA_DEQ_OPENEYE_CTRL_PREG}, 1817 + {0x002B, SIERRA_CPI_TRIM_PREG}, 1818 + {0x0003, SIERRA_EPI_CTRL_PREG}, 1819 + {0x803F, SIERRA_SDFILT_H2L_A_PREG}, 1820 + {0x0004, SIERRA_RXBUFFER_CTLECTRL_PREG}, 1821 + {0x2010, SIERRA_RXBUFFER_RCDFECTRL_PREG}, 1822 + {0x4432, SIERRA_RXBUFFER_DFECTRL_PREG}, 1823 + {0x0002, SIERRA_TX_RCVDET_OVRD_PREG} 1824 + }; 1825 + 1826 + static struct cdns_sierra_vals ti_ml_pcie_100_int_ssc_ln_vals = { 1827 + .reg_pairs = ti_ml_pcie_100_int_ssc_ln_regs, 1828 + .num_regs = ARRAY_SIZE(ti_ml_pcie_100_int_ssc_ln_regs), 1829 + }; 1830 + 1829 1831 /* refclk100MHz_32b_PCIe_cmn_pll_ext_ssc, pcie_links_using_plllc, pipe_bw_3 */ 1830 1832 static const struct cdns_reg_pairs pcie_100_ext_ssc_plllc_cmn_regs[] = { 1831 1833 {0x2106, SIERRA_CMN_PLLLC_LF_COEFF_MODE1_PREG}, ··· 1962 1838 static struct cdns_sierra_vals ml_pcie_100_ext_ssc_ln_vals = { 1963 1839 .reg_pairs = ml_pcie_100_ext_ssc_ln_regs, 1964 1840 .num_regs = ARRAY_SIZE(ml_pcie_100_ext_ssc_ln_regs), 1841 + }; 1842 + 1843 + /* 1844 + * TI J721E: 1845 + * refclk100MHz_32b_PCIe_ln_ext_ssc, multilink, using_plllc, 1846 + * cmn_pllcy_anaclk0_1Ghz, xcvr_pllclk_fullrt_500mhz 1847 + */ 1848 + static const struct cdns_reg_pairs ti_ml_pcie_100_ext_ssc_ln_regs[] = { 1849 + {0xFC08, SIERRA_DET_STANDEC_A_PREG}, 1850 + {0x001D, SIERRA_PSM_A3IN_TMR_PREG}, 1851 + {0x0004, SIERRA_PSC_LN_A3_PREG}, 1852 + {0x0004, SIERRA_PSC_LN_A4_PREG}, 1853 + {0x0004, SIERRA_PSC_LN_IDLE_PREG}, 1854 + {0x1555, SIERRA_DFE_BIASTRIM_PREG}, 1855 + {0x9703, SIERRA_DRVCTRL_BOOST_PREG}, 1856 + {0x813E, SIERRA_CLKPATHCTRL_TMR_PREG}, 1857 + {0x8047, SIERRA_RX_CREQ_FLTR_A_MODE3_PREG}, 1858 + {0x808F, SIERRA_RX_CREQ_FLTR_A_MODE2_PREG}, 1859 + {0x808F, SIERRA_RX_CREQ_FLTR_A_MODE1_PREG}, 1860 + {0x808F, SIERRA_RX_CREQ_FLTR_A_MODE0_PREG}, 1861 + {0x0002, SIERRA_CREQ_DCBIASATTEN_OVR_PREG}, 1862 + {0x9800, SIERRA_RX_CTLE_CAL_PREG}, 1863 + {0x033C, SIERRA_RX_CTLE_MAINTENANCE_PREG}, 1864 + {0x44CC, SIERRA_CREQ_EQ_OPEN_EYE_THRESH_PREG}, 1865 + {0x5624, SIERRA_DEQ_CONCUR_CTRL2_PREG}, 1866 + {0x000F, SIERRA_DEQ_EPIPWR_CTRL2_PREG}, 1867 + {0x00FF, SIERRA_DEQ_FAST_MAINT_CYCLES_PREG}, 1868 + {0x4C4C, SIERRA_DEQ_ERRCMP_CTRL_PREG}, 1869 + {0x02FA, SIERRA_DEQ_OFFSET_CTRL_PREG}, 1870 + {0x02FA, SIERRA_DEQ_GAIN_CTRL_PREG}, 1871 + {0x0041, SIERRA_DEQ_GLUT0}, 1872 + {0x0082, SIERRA_DEQ_GLUT1}, 1873 + {0x00C3, SIERRA_DEQ_GLUT2}, 1874 + {0x0145, SIERRA_DEQ_GLUT3}, 1875 + {0x0186, SIERRA_DEQ_GLUT4}, 1876 + {0x09E7, SIERRA_DEQ_ALUT0}, 1877 + {0x09A6, SIERRA_DEQ_ALUT1}, 1878 + {0x0965, SIERRA_DEQ_ALUT2}, 1879 + {0x08E3, SIERRA_DEQ_ALUT3}, 1880 + {0x00FA, SIERRA_DEQ_DFETAP0}, 1881 + {0x00FA, SIERRA_DEQ_DFETAP1}, 1882 + {0x00FA, SIERRA_DEQ_DFETAP2}, 1883 + {0x00FA, SIERRA_DEQ_DFETAP3}, 1884 + {0x00FA, SIERRA_DEQ_DFETAP4}, 1885 + {0x000F, SIERRA_DEQ_PRECUR_PREG}, 1886 + {0x0280, SIERRA_DEQ_POSTCUR_PREG}, 1887 + {0x8F00, SIERRA_DEQ_POSTCUR_DECR_PREG}, 1888 + {0x3C0F, SIERRA_DEQ_TAU_CTRL1_SLOW_MAINT_PREG}, 1889 + {0x1C0C, SIERRA_DEQ_TAU_CTRL2_PREG}, 1890 + {0x0100, SIERRA_DEQ_TAU_CTRL3_PREG}, 1891 + {0x5E82, SIERRA_DEQ_OPENEYE_CTRL_PREG}, 1892 + {0x002B, SIERRA_CPI_TRIM_PREG}, 1893 + {0x0003, SIERRA_EPI_CTRL_PREG}, 1894 + {0x803F, SIERRA_SDFILT_H2L_A_PREG}, 1895 + {0x0004, SIERRA_RXBUFFER_CTLECTRL_PREG}, 1896 + {0x2010, SIERRA_RXBUFFER_RCDFECTRL_PREG}, 1897 + {0x4432, SIERRA_RXBUFFER_DFECTRL_PREG}, 1898 + {0x0002, SIERRA_TX_RCVDET_OVRD_PREG} 1899 + }; 1900 + 1901 + static struct cdns_sierra_vals ti_ml_pcie_100_ext_ssc_ln_vals = { 1902 + .reg_pairs = ti_ml_pcie_100_ext_ssc_ln_regs, 1903 + .num_regs = ARRAY_SIZE(ti_ml_pcie_100_ext_ssc_ln_regs), 1965 1904 }; 1966 1905 1967 1906 /* refclk100MHz_32b_PCIe_cmn_pll_no_ssc */ ··· 2486 2299 [INTERNAL_SSC] = &pcie_100_int_ssc_ln_vals, 2487 2300 }, 2488 2301 [TYPE_QSGMII] = { 2489 - [NO_SSC] = &ml_pcie_100_no_ssc_ln_vals, 2490 - [EXTERNAL_SSC] = &ml_pcie_100_ext_ssc_ln_vals, 2491 - [INTERNAL_SSC] = &ml_pcie_100_int_ssc_ln_vals, 2302 + [NO_SSC] = &ti_ml_pcie_100_no_ssc_ln_vals, 2303 + [EXTERNAL_SSC] = &ti_ml_pcie_100_ext_ssc_ln_vals, 2304 + [INTERNAL_SSC] = &ti_ml_pcie_100_int_ssc_ln_vals, 2492 2305 }, 2493 2306 }, 2494 2307 [TYPE_USB] = {