@@ -69,6 +69,7 @@ enum imx6_pcie_variants {
69
69
IMX8MQ_EP ,
70
70
IMX8MM_EP ,
71
71
IMX8MP_EP ,
72
+ IMX95_EP ,
72
73
};
73
74
74
75
#define IMX6_PCIE_FLAG_IMX6_PHY BIT(0)
@@ -78,6 +79,7 @@ enum imx6_pcie_variants {
78
79
#define IMX6_PCIE_FLAG_HAS_APP_RESET BIT(4)
79
80
#define IMX6_PCIE_FLAG_HAS_PHY_RESET BIT(5)
80
81
#define IMX6_PCIE_FLAG_HAS_SERDES BIT(6)
82
+ #define IMX6_PCIE_FLAG_SUPPORT_64BIT BIT(7)
81
83
82
84
#define imx6_check_flag (pci , val ) (pci->drvdata->flags & val)
83
85
@@ -610,6 +612,7 @@ static int imx6_pcie_enable_ref_clk(struct imx6_pcie *imx6_pcie)
610
612
break ;
611
613
case IMX7D :
612
614
case IMX95 :
615
+ case IMX95_EP :
613
616
break ;
614
617
case IMX8MM :
615
618
case IMX8MM_EP :
@@ -1044,6 +1047,23 @@ static const struct pci_epc_features imx8m_pcie_epc_features = {
1044
1047
.align = SZ_64K ,
1045
1048
};
1046
1049
1050
+ /*
1051
+ * BAR# | Default BAR enable | Default BAR Type | Default BAR Size | BAR Sizing Scheme
1052
+ * ================================================================================================
1053
+ * BAR0 | Enable | 64-bit | 1 MB | Programmable Size
1054
+ * BAR1 | Disable | 32-bit | 64 KB | Fixed Size
1055
+ * BAR1 should be disabled if BAR0 is 64bit.
1056
+ * BAR2 | Enable | 32-bit | 1 MB | Programmable Size
1057
+ * BAR3 | Enable | 32-bit | 64 KB | Programmable Size
1058
+ * BAR4 | Enable | 32-bit | 1M | Programmable Size
1059
+ * BAR5 | Enable | 32-bit | 64 KB | Programmable Size
1060
+ */
1061
+ static const struct pci_epc_features imx95_pcie_epc_features = {
1062
+ .msi_capable = true,
1063
+ .bar [BAR_1 ] = { .type = BAR_FIXED , .fixed_size = SZ_64K , },
1064
+ .align = SZ_4K ,
1065
+ };
1066
+
1047
1067
static const struct pci_epc_features *
1048
1068
imx6_pcie_ep_get_features (struct dw_pcie_ep * ep )
1049
1069
{
@@ -1086,6 +1106,18 @@ static int imx6_add_pcie_ep(struct imx6_pcie *imx6_pcie,
1086
1106
1087
1107
pci -> dbi_base2 = pci -> dbi_base + pcie_dbi2_offset ;
1088
1108
1109
+ /*
1110
+ * FIXME: Ideally, dbi2 base address should come from DT. But since only IMX95 is defining
1111
+ * "dbi2" in DT, "dbi_base2" is set to NULL here for that platform alone so that the DWC
1112
+ * core code can fetch that from DT. But once all platform DTs were fixed, this and the
1113
+ * above "dbi_base2" setting should be removed.
1114
+ */
1115
+ if (device_property_match_string (dev , "reg-names" , "dbi2" ) >= 0 )
1116
+ pci -> dbi_base2 = NULL ;
1117
+
1118
+ if (imx6_check_flag (imx6_pcie , IMX6_PCIE_FLAG_SUPPORT_64BIT ))
1119
+ dma_set_mask_and_coherent (dev , DMA_BIT_MASK (64 ));
1120
+
1089
1121
ret = dw_pcie_ep_init (ep );
1090
1122
if (ret ) {
1091
1123
dev_err (dev , "failed to initialize endpoint\n" );
@@ -1556,6 +1588,20 @@ static const struct imx6_pcie_drvdata drvdata[] = {
1556
1588
.mode_mask [0 ] = IMX6Q_GPR12_DEVICE_TYPE ,
1557
1589
.epc_features = & imx8m_pcie_epc_features ,
1558
1590
},
1591
+ [IMX95_EP ] = {
1592
+ .variant = IMX95_EP ,
1593
+ .flags = IMX6_PCIE_FLAG_HAS_SERDES |
1594
+ IMX6_PCIE_FLAG_SUPPORT_64BIT ,
1595
+ .clk_names = imx8mq_clks ,
1596
+ .clks_cnt = ARRAY_SIZE (imx8mq_clks ),
1597
+ .ltssm_off = IMX95_PE0_GEN_CTRL_3 ,
1598
+ .ltssm_mask = IMX95_PCIE_LTSSM_EN ,
1599
+ .mode_off [0 ] = IMX95_PE0_GEN_CTRL_1 ,
1600
+ .mode_mask [0 ] = IMX95_PCIE_DEVICE_TYPE ,
1601
+ .init_phy = imx95_pcie_init_phy ,
1602
+ .epc_features = & imx95_pcie_epc_features ,
1603
+ .mode = DW_PCIE_EP_TYPE ,
1604
+ },
1559
1605
};
1560
1606
1561
1607
static const struct of_device_id imx6_pcie_of_match [] = {
@@ -1570,6 +1616,7 @@ static const struct of_device_id imx6_pcie_of_match[] = {
1570
1616
{ .compatible = "fsl,imx8mq-pcie-ep" , .data = & drvdata [IMX8MQ_EP ], },
1571
1617
{ .compatible = "fsl,imx8mm-pcie-ep" , .data = & drvdata [IMX8MM_EP ], },
1572
1618
{ .compatible = "fsl,imx8mp-pcie-ep" , .data = & drvdata [IMX8MP_EP ], },
1619
+ { .compatible = "fsl,imx95-pcie-ep" , .data = & drvdata [IMX95_EP ], },
1573
1620
{},
1574
1621
};
1575
1622
0 commit comments