@@ -260,7 +260,6 @@ struct tegra_pcie_dw {
260260 u32 msi_ctrl_int ;
261261 u32 num_lanes ;
262262 u32 cid ;
263- u32 cfg_link_cap_l1sub ;
264263 u32 ras_des_cap ;
265264 u32 pcie_cap_base ;
266265 u32 aspm_cmrt ;
@@ -475,8 +474,7 @@ static irqreturn_t tegra_pcie_ep_irq_thread(int irq, void *arg)
475474 return IRQ_HANDLED ;
476475
477476 /* If EP doesn't advertise L1SS, just return */
478- val = dw_pcie_readl_dbi (pci , pcie -> cfg_link_cap_l1sub );
479- if (!(val & (PCI_L1SS_CAP_ASPM_L1_1 | PCI_L1SS_CAP_ASPM_L1_2 )))
477+ if (!pci -> l1ss_support )
480478 return IRQ_HANDLED ;
481479
482480 /* Check if BME is set to '1' */
@@ -608,24 +606,6 @@ static struct pci_ops tegra_pci_ops = {
608606};
609607
610608#if defined(CONFIG_PCIEASPM )
611- static void disable_aspm_l11 (struct tegra_pcie_dw * pcie )
612- {
613- u32 val ;
614-
615- val = dw_pcie_readl_dbi (& pcie -> pci , pcie -> cfg_link_cap_l1sub );
616- val &= ~PCI_L1SS_CAP_ASPM_L1_1 ;
617- dw_pcie_writel_dbi (& pcie -> pci , pcie -> cfg_link_cap_l1sub , val );
618- }
619-
620- static void disable_aspm_l12 (struct tegra_pcie_dw * pcie )
621- {
622- u32 val ;
623-
624- val = dw_pcie_readl_dbi (& pcie -> pci , pcie -> cfg_link_cap_l1sub );
625- val &= ~PCI_L1SS_CAP_ASPM_L1_2 ;
626- dw_pcie_writel_dbi (& pcie -> pci , pcie -> cfg_link_cap_l1sub , val );
627- }
628-
629609static inline u32 event_counter_prog (struct tegra_pcie_dw * pcie , u32 event )
630610{
631611 u32 val ;
@@ -682,10 +662,9 @@ static int aspm_state_cnt(struct seq_file *s, void *data)
682662static void init_host_aspm (struct tegra_pcie_dw * pcie )
683663{
684664 struct dw_pcie * pci = & pcie -> pci ;
685- u32 val ;
665+ u32 l1ss , val ;
686666
687- val = dw_pcie_find_ext_capability (pci , PCI_EXT_CAP_ID_L1SS );
688- pcie -> cfg_link_cap_l1sub = val + PCI_L1SS_CAP ;
667+ l1ss = dw_pcie_find_ext_capability (pci , PCI_EXT_CAP_ID_L1SS );
689668
690669 pcie -> ras_des_cap = dw_pcie_find_ext_capability (& pcie -> pci ,
691670 PCI_EXT_CAP_ID_VNDR );
@@ -697,11 +676,11 @@ static void init_host_aspm(struct tegra_pcie_dw *pcie)
697676 PCIE_RAS_DES_EVENT_COUNTER_CONTROL , val );
698677
699678 /* Program T_cmrt and T_pwr_on values */
700- val = dw_pcie_readl_dbi (pci , pcie -> cfg_link_cap_l1sub );
679+ val = dw_pcie_readl_dbi (pci , l1ss + PCI_L1SS_CAP );
701680 val &= ~(PCI_L1SS_CAP_CM_RESTORE_TIME | PCI_L1SS_CAP_P_PWR_ON_VALUE );
702681 val |= (pcie -> aspm_cmrt << 8 );
703682 val |= (pcie -> aspm_pwr_on_t << 19 );
704- dw_pcie_writel_dbi (pci , pcie -> cfg_link_cap_l1sub , val );
683+ dw_pcie_writel_dbi (pci , l1ss + PCI_L1SS_CAP , val );
705684
706685 if (pcie -> supports_clkreq )
707686 pci -> l1ss_support = true;
@@ -729,8 +708,6 @@ static void init_debugfs(struct tegra_pcie_dw *pcie)
729708 aspm_state_cnt );
730709}
731710#else
732- static inline void disable_aspm_l12 (struct tegra_pcie_dw * pcie ) { return ; }
733- static inline void disable_aspm_l11 (struct tegra_pcie_dw * pcie ) { return ; }
734711static inline void init_host_aspm (struct tegra_pcie_dw * pcie ) { return ; }
735712static inline void init_debugfs (struct tegra_pcie_dw * pcie ) { return ; }
736713#endif
@@ -934,12 +911,6 @@ static int tegra_pcie_dw_host_init(struct dw_pcie_rp *pp)
934911
935912 init_host_aspm (pcie );
936913
937- /* Disable ASPM-L1SS advertisement if there is no CLKREQ routing */
938- if (!pcie -> supports_clkreq ) {
939- disable_aspm_l11 (pcie );
940- disable_aspm_l12 (pcie );
941- }
942-
943914 if (!pcie -> of_data -> has_l1ss_exit_fix ) {
944915 val = dw_pcie_readl_dbi (pci , GEN3_RELATED_OFF );
945916 val &= ~GEN3_RELATED_OFF_GEN3_ZRXDC_NONCOMPL ;
@@ -1874,12 +1845,6 @@ static void pex_ep_event_pex_rst_deassert(struct tegra_pcie_dw *pcie)
18741845
18751846 init_host_aspm (pcie );
18761847
1877- /* Disable ASPM-L1SS advertisement if there is no CLKREQ routing */
1878- if (!pcie -> supports_clkreq ) {
1879- disable_aspm_l11 (pcie );
1880- disable_aspm_l12 (pcie );
1881- }
1882-
18831848 if (!pcie -> of_data -> has_l1ss_exit_fix ) {
18841849 val = dw_pcie_readl_dbi (pci , GEN3_RELATED_OFF );
18851850 val &= ~GEN3_RELATED_OFF_GEN3_ZRXDC_NONCOMPL ;
0 commit comments