|
124 | 124 | #define PORT_TUNSTAT_PERST_ACK_PEND BIT(1)
|
125 | 125 | #define PORT_PREFMEM_ENABLE 0x00994
|
126 | 126 |
|
| 127 | +/* T602x (M2-pro and co) */ |
| 128 | +#define PORT_T602X_MSIADDR 0x016c |
| 129 | +#define PORT_T602X_MSIADDR_HI 0x0170 |
| 130 | +#define PORT_T602X_PERST 0x082c |
| 131 | +#define PORT_T602X_RID2SID 0x3000 |
| 132 | +#define PORT_T602X_MSIMAP 0x3800 |
| 133 | + |
127 | 134 | #define PORT_MSIMAP_ENABLE BIT(31)
|
128 | 135 | #define PORT_MSIMAP_TARGET GENMASK(7, 0)
|
129 | 136 |
|
@@ -158,6 +165,18 @@ static const struct hw_info t8103_hw = {
|
158 | 165 | .max_rid2sid = 64,
|
159 | 166 | };
|
160 | 167 |
|
| 168 | +static const struct hw_info t602x_hw = { |
| 169 | + .phy_lane_ctl = 0, |
| 170 | + .port_msiaddr = PORT_T602X_MSIADDR, |
| 171 | + .port_msiaddr_hi = PORT_T602X_MSIADDR_HI, |
| 172 | + .port_refclk = 0, |
| 173 | + .port_perst = PORT_T602X_PERST, |
| 174 | + .port_rid2sid = PORT_T602X_RID2SID, |
| 175 | + .port_msimap = PORT_T602X_MSIMAP, |
| 176 | + /* 16 on t602x, guess for autodetect on future HW */ |
| 177 | + .max_rid2sid = 512, |
| 178 | +}; |
| 179 | + |
161 | 180 | struct apple_pcie {
|
162 | 181 | struct mutex lock;
|
163 | 182 | struct device *dev;
|
@@ -425,6 +444,7 @@ static int apple_pcie_port_setup_irq(struct apple_pcie_port *port)
|
425 | 444 | /* Disable all interrupts */
|
426 | 445 | writel_relaxed(~0, port->base + PORT_INTMSK);
|
427 | 446 | writel_relaxed(~0, port->base + PORT_INTSTAT);
|
| 447 | + writel_relaxed(~0, port->base + PORT_LINKCMDSTS); |
428 | 448 |
|
429 | 449 | irq_set_chained_handler_and_data(irq, apple_port_irq_handler, port);
|
430 | 450 |
|
@@ -863,6 +883,7 @@ static int apple_pcie_probe(struct platform_device *pdev)
|
863 | 883 | }
|
864 | 884 |
|
865 | 885 | static const struct of_device_id apple_pcie_of_match[] = {
|
| 886 | + { .compatible = "apple,t6020-pcie", .data = &t602x_hw }, |
866 | 887 | { .compatible = "apple,pcie", .data = &t8103_hw },
|
867 | 888 | { }
|
868 | 889 | };
|
|
0 commit comments