[PATCH] PCI: bt1: Use common dw_pcie_ltssm enum for LTSSM states

Hans Zhang posted 1 patch 3 weeks, 1 day ago
drivers/pci/controller/dwc/pcie-bt1.c | 38 +--------------------------
1 file changed, 1 insertion(+), 37 deletions(-)
[PATCH] PCI: bt1: Use common dw_pcie_ltssm enum for LTSSM states
Posted by Hans Zhang 3 weeks, 1 day ago
Use the generic dw_pcie_ltssm enum from pcie-designware.h instead of
defining private LTSSM state macros. This eliminates duplication and
aligns the driver with common DesignWare core definitions.

Signed-off-by: Hans Zhang <18255117159@163.com>
---
 drivers/pci/controller/dwc/pcie-bt1.c | 38 +--------------------------
 1 file changed, 1 insertion(+), 37 deletions(-)

diff --git a/drivers/pci/controller/dwc/pcie-bt1.c b/drivers/pci/controller/dwc/pcie-bt1.c
index 1340edc18d12..429fab073bba 100644
--- a/drivers/pci/controller/dwc/pcie-bt1.c
+++ b/drivers/pci/controller/dwc/pcie-bt1.c
@@ -41,42 +41,6 @@
 
 #define BT1_CCU_PCIE_PMSC			0x148
 #define BT1_CCU_PCIE_LTSSM_STATE_MASK		GENMASK(5, 0)
-#define BT1_CCU_PCIE_LTSSM_DET_QUIET		0x00
-#define BT1_CCU_PCIE_LTSSM_DET_ACT		0x01
-#define BT1_CCU_PCIE_LTSSM_POLL_ACT		0x02
-#define BT1_CCU_PCIE_LTSSM_POLL_COMP		0x03
-#define BT1_CCU_PCIE_LTSSM_POLL_CONF		0x04
-#define BT1_CCU_PCIE_LTSSM_PRE_DET_QUIET	0x05
-#define BT1_CCU_PCIE_LTSSM_DET_WAIT		0x06
-#define BT1_CCU_PCIE_LTSSM_CFG_LNKWD_START	0x07
-#define BT1_CCU_PCIE_LTSSM_CFG_LNKWD_ACEPT	0x08
-#define BT1_CCU_PCIE_LTSSM_CFG_LNNUM_WAIT	0x09
-#define BT1_CCU_PCIE_LTSSM_CFG_LNNUM_ACEPT	0x0a
-#define BT1_CCU_PCIE_LTSSM_CFG_COMPLETE		0x0b
-#define BT1_CCU_PCIE_LTSSM_CFG_IDLE		0x0c
-#define BT1_CCU_PCIE_LTSSM_RCVR_LOCK		0x0d
-#define BT1_CCU_PCIE_LTSSM_RCVR_SPEED		0x0e
-#define BT1_CCU_PCIE_LTSSM_RCVR_RCVRCFG		0x0f
-#define BT1_CCU_PCIE_LTSSM_RCVR_IDLE		0x10
-#define BT1_CCU_PCIE_LTSSM_L0			0x11
-#define BT1_CCU_PCIE_LTSSM_L0S			0x12
-#define BT1_CCU_PCIE_LTSSM_L123_SEND_IDLE	0x13
-#define BT1_CCU_PCIE_LTSSM_L1_IDLE		0x14
-#define BT1_CCU_PCIE_LTSSM_L2_IDLE		0x15
-#define BT1_CCU_PCIE_LTSSM_L2_WAKE		0x16
-#define BT1_CCU_PCIE_LTSSM_DIS_ENTRY		0x17
-#define BT1_CCU_PCIE_LTSSM_DIS_IDLE		0x18
-#define BT1_CCU_PCIE_LTSSM_DISABLE		0x19
-#define BT1_CCU_PCIE_LTSSM_LPBK_ENTRY		0x1a
-#define BT1_CCU_PCIE_LTSSM_LPBK_ACTIVE		0x1b
-#define BT1_CCU_PCIE_LTSSM_LPBK_EXIT		0x1c
-#define BT1_CCU_PCIE_LTSSM_LPBK_EXIT_TOUT	0x1d
-#define BT1_CCU_PCIE_LTSSM_HOT_RST_ENTRY	0x1e
-#define BT1_CCU_PCIE_LTSSM_HOT_RST		0x1f
-#define BT1_CCU_PCIE_LTSSM_RCVR_EQ0		0x20
-#define BT1_CCU_PCIE_LTSSM_RCVR_EQ1		0x21
-#define BT1_CCU_PCIE_LTSSM_RCVR_EQ2		0x22
-#define BT1_CCU_PCIE_LTSSM_RCVR_EQ3		0x23
 #define BT1_CCU_PCIE_SMLH_LINKUP		BIT(6)
 #define BT1_CCU_PCIE_RDLH_LINKUP		BIT(7)
 #define BT1_CCU_PCIE_PM_LINKSTATE_L0S		BIT(8)
@@ -108,7 +72,7 @@
 #define BT1_CCU_PCIE_LTSSM_LINKUP(_pmsc) \
 ({ \
 	int __state = FIELD_GET(BT1_CCU_PCIE_LTSSM_STATE_MASK, _pmsc); \
-	__state >= BT1_CCU_PCIE_LTSSM_L0 && __state <= BT1_CCU_PCIE_LTSSM_L2_WAKE; \
+	__state >= DW_PCIE_LTSSM_L0 && __state <= DW_PCIE_LTSSM_L2_WAKE; \
 })
 
 /* Baikal-T1 PCIe specific control registers */

base-commit: 1c9982b4961334c1edb0745a04cabd34bc2de675
-- 
2.34.1
Re: [PATCH] PCI: bt1: Use common dw_pcie_ltssm enum for LTSSM states
Posted by Shawn Lin 2 weeks, 6 days ago
Hi Hans,

在 2026/03/15 星期日 23:40, Hans Zhang 写道:
> Use the generic dw_pcie_ltssm enum from pcie-designware.h instead of
> defining private LTSSM state macros. This eliminates duplication and
> aligns the driver with common DesignWare core d

No, this driver's removed due to the sanction policy in this community..

efinitions.
> 
> Signed-off-by: Hans Zhang <18255117159@163.com>
> ---
>   drivers/pci/controller/dwc/pcie-bt1.c | 38 +--------------------------
>   1 file changed, 1 insertion(+), 37 deletions(-)
> 
> diff --git a/drivers/pci/controller/dwc/pcie-bt1.c b/drivers/pci/controller/dwc/pcie-bt1.c
> index 1340edc18d12..429fab073bba 100644
> --- a/drivers/pci/controller/dwc/pcie-bt1.c
> +++ b/drivers/pci/controller/dwc/pcie-bt1.c
> @@ -41,42 +41,6 @@
>   
>   #define BT1_CCU_PCIE_PMSC			0x148
>   #define BT1_CCU_PCIE_LTSSM_STATE_MASK		GENMASK(5, 0)
> -#define BT1_CCU_PCIE_LTSSM_DET_QUIET		0x00
> -#define BT1_CCU_PCIE_LTSSM_DET_ACT		0x01
> -#define BT1_CCU_PCIE_LTSSM_POLL_ACT		0x02
> -#define BT1_CCU_PCIE_LTSSM_POLL_COMP		0x03
> -#define BT1_CCU_PCIE_LTSSM_POLL_CONF		0x04
> -#define BT1_CCU_PCIE_LTSSM_PRE_DET_QUIET	0x05
> -#define BT1_CCU_PCIE_LTSSM_DET_WAIT		0x06
> -#define BT1_CCU_PCIE_LTSSM_CFG_LNKWD_START	0x07
> -#define BT1_CCU_PCIE_LTSSM_CFG_LNKWD_ACEPT	0x08
> -#define BT1_CCU_PCIE_LTSSM_CFG_LNNUM_WAIT	0x09
> -#define BT1_CCU_PCIE_LTSSM_CFG_LNNUM_ACEPT	0x0a
> -#define BT1_CCU_PCIE_LTSSM_CFG_COMPLETE		0x0b
> -#define BT1_CCU_PCIE_LTSSM_CFG_IDLE		0x0c
> -#define BT1_CCU_PCIE_LTSSM_RCVR_LOCK		0x0d
> -#define BT1_CCU_PCIE_LTSSM_RCVR_SPEED		0x0e
> -#define BT1_CCU_PCIE_LTSSM_RCVR_RCVRCFG		0x0f
> -#define BT1_CCU_PCIE_LTSSM_RCVR_IDLE		0x10
> -#define BT1_CCU_PCIE_LTSSM_L0			0x11
> -#define BT1_CCU_PCIE_LTSSM_L0S			0x12
> -#define BT1_CCU_PCIE_LTSSM_L123_SEND_IDLE	0x13
> -#define BT1_CCU_PCIE_LTSSM_L1_IDLE		0x14
> -#define BT1_CCU_PCIE_LTSSM_L2_IDLE		0x15
> -#define BT1_CCU_PCIE_LTSSM_L2_WAKE		0x16
> -#define BT1_CCU_PCIE_LTSSM_DIS_ENTRY		0x17
> -#define BT1_CCU_PCIE_LTSSM_DIS_IDLE		0x18
> -#define BT1_CCU_PCIE_LTSSM_DISABLE		0x19
> -#define BT1_CCU_PCIE_LTSSM_LPBK_ENTRY		0x1a
> -#define BT1_CCU_PCIE_LTSSM_LPBK_ACTIVE		0x1b
> -#define BT1_CCU_PCIE_LTSSM_LPBK_EXIT		0x1c
> -#define BT1_CCU_PCIE_LTSSM_LPBK_EXIT_TOUT	0x1d
> -#define BT1_CCU_PCIE_LTSSM_HOT_RST_ENTRY	0x1e
> -#define BT1_CCU_PCIE_LTSSM_HOT_RST		0x1f
> -#define BT1_CCU_PCIE_LTSSM_RCVR_EQ0		0x20
> -#define BT1_CCU_PCIE_LTSSM_RCVR_EQ1		0x21
> -#define BT1_CCU_PCIE_LTSSM_RCVR_EQ2		0x22
> -#define BT1_CCU_PCIE_LTSSM_RCVR_EQ3		0x23
>   #define BT1_CCU_PCIE_SMLH_LINKUP		BIT(6)
>   #define BT1_CCU_PCIE_RDLH_LINKUP		BIT(7)
>   #define BT1_CCU_PCIE_PM_LINKSTATE_L0S		BIT(8)
> @@ -108,7 +72,7 @@
>   #define BT1_CCU_PCIE_LTSSM_LINKUP(_pmsc) \
>   ({ \
>   	int __state = FIELD_GET(BT1_CCU_PCIE_LTSSM_STATE_MASK, _pmsc); \
> -	__state >= BT1_CCU_PCIE_LTSSM_L0 && __state <= BT1_CCU_PCIE_LTSSM_L2_WAKE; \
> +	__state >= DW_PCIE_LTSSM_L0 && __state <= DW_PCIE_LTSSM_L2_WAKE; \
>   })
>   
>   /* Baikal-T1 PCIe specific control registers */
> 
> base-commit: 1c9982b4961334c1edb0745a04cabd34bc2de675
> 
Re: [PATCH] PCI: bt1: Use common dw_pcie_ltssm enum for LTSSM states
Posted by Hans Zhang 2 weeks, 6 days ago

On 2026/3/17 14:22, Shawn Lin wrote:
> Hi Hans,
> 
> 在 2026/03/15 星期日 23:40, Hans Zhang 写道:
>> Use the generic dw_pcie_ltssm enum from pcie-designware.h instead of
>> defining private LTSSM state macros. This eliminates duplication and
>> aligns the driver with common DesignWare core d
> 
> No, this driver's removed due to the sanction policy in this community..
> 
> efinitions.

Hi Shawn,

Thank you very much for your reply and reminder.

Best regards,
Hans


>>
>> Signed-off-by: Hans Zhang <18255117159@163.com>
>> ---
>>   drivers/pci/controller/dwc/pcie-bt1.c | 38 +--------------------------
>>   1 file changed, 1 insertion(+), 37 deletions(-)
>>
>> diff --git a/drivers/pci/controller/dwc/pcie-bt1.c b/drivers/pci/ 
>> controller/dwc/pcie-bt1.c
>> index 1340edc18d12..429fab073bba 100644
>> --- a/drivers/pci/controller/dwc/pcie-bt1.c
>> +++ b/drivers/pci/controller/dwc/pcie-bt1.c
>> @@ -41,42 +41,6 @@
>>   #define BT1_CCU_PCIE_PMSC            0x148
>>   #define BT1_CCU_PCIE_LTSSM_STATE_MASK        GENMASK(5, 0)
>> -#define BT1_CCU_PCIE_LTSSM_DET_QUIET        0x00
>> -#define BT1_CCU_PCIE_LTSSM_DET_ACT        0x01
>> -#define BT1_CCU_PCIE_LTSSM_POLL_ACT        0x02
>> -#define BT1_CCU_PCIE_LTSSM_POLL_COMP        0x03
>> -#define BT1_CCU_PCIE_LTSSM_POLL_CONF        0x04
>> -#define BT1_CCU_PCIE_LTSSM_PRE_DET_QUIET    0x05
>> -#define BT1_CCU_PCIE_LTSSM_DET_WAIT        0x06
>> -#define BT1_CCU_PCIE_LTSSM_CFG_LNKWD_START    0x07
>> -#define BT1_CCU_PCIE_LTSSM_CFG_LNKWD_ACEPT    0x08
>> -#define BT1_CCU_PCIE_LTSSM_CFG_LNNUM_WAIT    0x09
>> -#define BT1_CCU_PCIE_LTSSM_CFG_LNNUM_ACEPT    0x0a
>> -#define BT1_CCU_PCIE_LTSSM_CFG_COMPLETE        0x0b
>> -#define BT1_CCU_PCIE_LTSSM_CFG_IDLE        0x0c
>> -#define BT1_CCU_PCIE_LTSSM_RCVR_LOCK        0x0d
>> -#define BT1_CCU_PCIE_LTSSM_RCVR_SPEED        0x0e
>> -#define BT1_CCU_PCIE_LTSSM_RCVR_RCVRCFG        0x0f
>> -#define BT1_CCU_PCIE_LTSSM_RCVR_IDLE        0x10
>> -#define BT1_CCU_PCIE_LTSSM_L0            0x11
>> -#define BT1_CCU_PCIE_LTSSM_L0S            0x12
>> -#define BT1_CCU_PCIE_LTSSM_L123_SEND_IDLE    0x13
>> -#define BT1_CCU_PCIE_LTSSM_L1_IDLE        0x14
>> -#define BT1_CCU_PCIE_LTSSM_L2_IDLE        0x15
>> -#define BT1_CCU_PCIE_LTSSM_L2_WAKE        0x16
>> -#define BT1_CCU_PCIE_LTSSM_DIS_ENTRY        0x17
>> -#define BT1_CCU_PCIE_LTSSM_DIS_IDLE        0x18
>> -#define BT1_CCU_PCIE_LTSSM_DISABLE        0x19
>> -#define BT1_CCU_PCIE_LTSSM_LPBK_ENTRY        0x1a
>> -#define BT1_CCU_PCIE_LTSSM_LPBK_ACTIVE        0x1b
>> -#define BT1_CCU_PCIE_LTSSM_LPBK_EXIT        0x1c
>> -#define BT1_CCU_PCIE_LTSSM_LPBK_EXIT_TOUT    0x1d
>> -#define BT1_CCU_PCIE_LTSSM_HOT_RST_ENTRY    0x1e
>> -#define BT1_CCU_PCIE_LTSSM_HOT_RST        0x1f
>> -#define BT1_CCU_PCIE_LTSSM_RCVR_EQ0        0x20
>> -#define BT1_CCU_PCIE_LTSSM_RCVR_EQ1        0x21
>> -#define BT1_CCU_PCIE_LTSSM_RCVR_EQ2        0x22
>> -#define BT1_CCU_PCIE_LTSSM_RCVR_EQ3        0x23
>>   #define BT1_CCU_PCIE_SMLH_LINKUP        BIT(6)
>>   #define BT1_CCU_PCIE_RDLH_LINKUP        BIT(7)
>>   #define BT1_CCU_PCIE_PM_LINKSTATE_L0S        BIT(8)
>> @@ -108,7 +72,7 @@
>>   #define BT1_CCU_PCIE_LTSSM_LINKUP(_pmsc) \
>>   ({ \
>>       int __state = FIELD_GET(BT1_CCU_PCIE_LTSSM_STATE_MASK, _pmsc); \
>> -    __state >= BT1_CCU_PCIE_LTSSM_L0 && __state <= 
>> BT1_CCU_PCIE_LTSSM_L2_WAKE; \
>> +    __state >= DW_PCIE_LTSSM_L0 && __state <= DW_PCIE_LTSSM_L2_WAKE; \
>>   })
>>   /* Baikal-T1 PCIe specific control registers */
>>
>> base-commit: 1c9982b4961334c1edb0745a04cabd34bc2de675
>>