5050#define PIO_COMPLETION_STATUS_MASK GENMASK(9, 7)
5151#define PIO_COMPLETION_STATUS_OK 0
5252#define PIO_COMPLETION_STATUS_UR 1
53- #define PIO_COMPLETION_STATUS_CRS 2
53+ #define PIO_COMPLETION_STATUS_RRS 2
5454#define PIO_COMPLETION_STATUS_CA 4
5555#define PIO_NON_POSTED_REQ BIT(10)
5656#define PIO_ERR_STATUS BIT(11)
@@ -262,7 +262,7 @@ enum {
262262
263263#define MSI_IRQ_NUM 32
264264
265- #define CFG_RD_CRS_VAL 0xffff0001
265+ #define CFG_RD_RRS_VAL 0xffff0001
266266
267267struct advk_pcie {
268268 struct platform_device * pdev ;
@@ -649,7 +649,7 @@ static void advk_pcie_setup_hw(struct advk_pcie *pcie)
649649 advk_pcie_train_link (pcie );
650650}
651651
652- static int advk_pcie_check_pio_status (struct advk_pcie * pcie , bool allow_crs , u32 * val )
652+ static int advk_pcie_check_pio_status (struct advk_pcie * pcie , bool allow_rrs , u32 * val )
653653{
654654 struct device * dev = & pcie -> pdev -> dev ;
655655 u32 reg ;
@@ -669,7 +669,7 @@ static int advk_pcie_check_pio_status(struct advk_pcie *pcie, bool allow_crs, u3
669669 * 2) value Unsupported Request(1) of COMPLETION_STATUS(bit9:7) only
670670 * means a PIO write error, and for PIO read it is successful with
671671 * a read value of 0xFFFFFFFF.
672- * 3) value Completion Retry Status(CRS ) of COMPLETION_STATUS(bit9:7)
672+ * 3) value Config Request Retry Status(RRS ) of COMPLETION_STATUS(bit9:7)
673673 * only means a PIO write error, and for PIO read it is successful
674674 * with a read value of 0xFFFF0001.
675675 * 4) value Completer Abort (CA) of COMPLETION_STATUS(bit9:7) means
@@ -694,10 +694,10 @@ static int advk_pcie_check_pio_status(struct advk_pcie *pcie, bool allow_crs, u3
694694 strcomp_status = "UR" ;
695695 ret = - EOPNOTSUPP ;
696696 break ;
697- case PIO_COMPLETION_STATUS_CRS :
698- if (allow_crs && val ) {
699- /* PCIe r4 .0, sec 2.3.2, says:
700- * If CRS Software Visibility is enabled:
697+ case PIO_COMPLETION_STATUS_RRS :
698+ if (allow_rrs && val ) {
699+ /* PCIe r6 .0, sec 2.3.2, says:
700+ * If Configuration RRS Software Visibility is enabled:
701701 * For a Configuration Read Request that includes both
702702 * bytes of the Vendor ID field of a device Function's
703703 * Configuration Space Header, the Root Complex must
@@ -706,30 +706,30 @@ static int advk_pcie_check_pio_status(struct advk_pcie *pcie, bool allow_crs, u3
706706 * all '1's for any additional bytes included in the
707707 * request.
708708 *
709- * So CRS in this case is not an error status.
709+ * So RRS in this case is not an error status.
710710 */
711- * val = CFG_RD_CRS_VAL ;
711+ * val = CFG_RD_RRS_VAL ;
712712 strcomp_status = NULL ;
713713 ret = 0 ;
714714 break ;
715715 }
716- /* PCIe r4 .0, sec 2.3.2, says:
717- * If CRS Software Visibility is not enabled, the Root Complex
716+ /* PCIe r6 .0, sec 2.3.2, says:
717+ * If RRS Software Visibility is not enabled, the Root Complex
718718 * must re-issue the Configuration Request as a new Request.
719- * If CRS Software Visibility is enabled: For a Configuration
719+ * If RRS Software Visibility is enabled: For a Configuration
720720 * Write Request or for any other Configuration Read Request,
721721 * the Root Complex must re-issue the Configuration Request as
722722 * a new Request.
723723 * A Root Complex implementation may choose to limit the number
724- * of Configuration Request/CRS Completion Status loops before
724+ * of Configuration Request/RRS Completion Status loops before
725725 * determining that something is wrong with the target of the
726726 * Request and taking appropriate action, e.g., complete the
727727 * Request to the host as a failed transaction.
728728 *
729729 * So return -EAGAIN and caller (pci-aardvark.c driver) will
730730 * re-issue request again up to the PIO_RETRY_CNT retries.
731731 */
732- strcomp_status = "CRS " ;
732+ strcomp_status = "RRS " ;
733733 ret = - EAGAIN ;
734734 break ;
735735 case PIO_COMPLETION_STATUS_CA :
@@ -920,8 +920,8 @@ advk_pci_bridge_emul_pcie_conf_write(struct pci_bridge_emul *bridge,
920920
921921 case PCI_EXP_RTCTL : {
922922 u16 rootctl = le16_to_cpu (bridge -> pcie_conf .rootctl );
923- /* Only emulation of PMEIE and CRSSVE bits is provided */
924- rootctl &= PCI_EXP_RTCTL_PMEIE | PCI_EXP_RTCTL_CRSSVE ;
923+ /* Only emulation of PMEIE and RRS_SVE bits is provided */
924+ rootctl &= PCI_EXP_RTCTL_PMEIE | PCI_EXP_RTCTL_RRS_SVE ;
925925 bridge -> pcie_conf .rootctl = cpu_to_le16 (rootctl );
926926 break ;
927927 }
@@ -1075,7 +1075,7 @@ static int advk_sw_pci_bridge_init(struct advk_pcie *pcie)
10751075 bridge -> pcie_conf .slotsta = cpu_to_le16 (PCI_EXP_SLTSTA_PDS );
10761076
10771077 /* Indicates supports for Completion Retry Status */
1078- bridge -> pcie_conf .rootcap = cpu_to_le16 (PCI_EXP_RTCAP_CRSVIS );
1078+ bridge -> pcie_conf .rootcap = cpu_to_le16 (PCI_EXP_RTCAP_RRS_SV );
10791079
10801080 bridge -> subsystem_vendor_id = advk_readl (pcie , PCIE_CORE_SSDEV_ID_REG ) & 0xffff ;
10811081 bridge -> subsystem_id = advk_readl (pcie , PCIE_CORE_SSDEV_ID_REG ) >> 16 ;
@@ -1141,7 +1141,7 @@ static int advk_pcie_rd_conf(struct pci_bus *bus, u32 devfn,
11411141{
11421142 struct advk_pcie * pcie = bus -> sysdata ;
11431143 int retry_count ;
1144- bool allow_crs ;
1144+ bool allow_rrs ;
11451145 u32 reg ;
11461146 int ret ;
11471147
@@ -1153,16 +1153,16 @@ static int advk_pcie_rd_conf(struct pci_bus *bus, u32 devfn,
11531153 size , val );
11541154
11551155 /*
1156- * Completion Retry Status is possible to return only when reading all
1157- * 4 bytes from PCI_VENDOR_ID and PCI_DEVICE_ID registers at once and
1158- * CRSSVE flag on Root Bridge is enabled.
1156+ * Configuration Request Retry Status (RRS) is possible to return
1157+ * only when reading both bytes from PCI_VENDOR_ID at once and
1158+ * RRS_SVE flag on Root Port is enabled.
11591159 */
1160- allow_crs = (where == PCI_VENDOR_ID ) && (size == 4 ) &&
1160+ allow_rrs = (where == PCI_VENDOR_ID ) && (size >= 2 ) &&
11611161 (le16_to_cpu (pcie -> bridge .pcie_conf .rootctl ) &
1162- PCI_EXP_RTCTL_CRSSVE );
1162+ PCI_EXP_RTCTL_RRS_SVE );
11631163
11641164 if (advk_pcie_pio_is_running (pcie ))
1165- goto try_crs ;
1165+ goto try_rrs ;
11661166
11671167 /* Program the control register */
11681168 reg = advk_readl (pcie , PIO_CTRL );
@@ -1189,12 +1189,12 @@ static int advk_pcie_rd_conf(struct pci_bus *bus, u32 devfn,
11891189
11901190 ret = advk_pcie_wait_pio (pcie );
11911191 if (ret < 0 )
1192- goto try_crs ;
1192+ goto try_rrs ;
11931193
11941194 retry_count += ret ;
11951195
11961196 /* Check PIO status and get the read result */
1197- ret = advk_pcie_check_pio_status (pcie , allow_crs , val );
1197+ ret = advk_pcie_check_pio_status (pcie , allow_rrs , val );
11981198 } while (ret == - EAGAIN && retry_count < PIO_RETRY_CNT );
11991199
12001200 if (ret < 0 )
@@ -1207,13 +1207,13 @@ static int advk_pcie_rd_conf(struct pci_bus *bus, u32 devfn,
12071207
12081208 return PCIBIOS_SUCCESSFUL ;
12091209
1210- try_crs :
1210+ try_rrs :
12111211 /*
1212- * If it is possible, return Completion Retry Status so that caller
1213- * tries to issue the request again instead of failing.
1212+ * If it is possible, return Configuration Request Retry Status so
1213+ * that caller tries to issue the request again instead of failing.
12141214 */
1215- if (allow_crs ) {
1216- * val = CFG_RD_CRS_VAL ;
1215+ if (allow_rrs ) {
1216+ * val = CFG_RD_RRS_VAL ;
12171217 return PCIBIOS_SUCCESSFUL ;
12181218 }
12191219
0 commit comments