kernel: bump 4.19 to 4.19.91
[openwrt/staging/wigyori.git] / target / linux / ipq806x / patches-4.19 / 0071-6-PCI-qcom-Force-GEN1-support.patch
1 From 4910cfd150342ec7b038892262923c725a9c4001 Mon Sep 17 00:00:00 2001
2 From: Sham Muthayyan <smuthayy@codeaurora.org>
3 Date: Wed, 7 Sep 2016 16:44:28 +0530
4 Subject: PCI: qcom: Force GEN1 support
5
6 Change-Id: Ica54ddb737d7b851469deab1745f54bf431bd3f0
7 Signed-off-by: Sham Muthayyan <smuthayy@codeaurora.org>
8 ---
9
10 --- a/drivers/pci/controller/dwc/pcie-qcom.c
11 +++ b/drivers/pci/controller/dwc/pcie-qcom.c
12 @@ -122,6 +122,8 @@
13 #define PCIE20_v3_PARF_SLV_ADDR_SPACE_SIZE 0x358
14 #define SLV_ADDR_SPACE_SZ 0x10000000
15
16 +#define PCIE20_LNK_CONTROL2_LINK_STATUS2 0xA0
17 +
18 #define QCOM_PCIE_2_1_0_MAX_SUPPLY 3
19 struct qcom_pcie_resources_2_1_0 {
20 struct clk *iface_clk;
21 @@ -212,6 +214,7 @@ struct qcom_pcie {
22 struct phy *phy;
23 struct gpio_desc *reset;
24 const struct qcom_pcie_ops *ops;
25 + uint32_t force_gen1;
26 };
27
28 #define to_qcom_pcie(x) dev_get_drvdata((x)->dev)
29 @@ -504,6 +507,11 @@ static int qcom_pcie_init_2_1_0(struct q
30
31 /* wait for clock acquisition */
32 usleep_range(1000, 1500);
33 + if (pcie->force_gen1) {
34 + writel_relaxed((readl_relaxed(
35 + pcie->pci->dbi_base + PCIE20_LNK_CONTROL2_LINK_STATUS2) | 1),
36 + pcie->pci->dbi_base + PCIE20_LNK_CONTROL2_LINK_STATUS2);
37 + }
38
39
40 /* Set the Max TLP size to 2K, instead of using default of 4K */
41 @@ -1367,6 +1375,8 @@ static int qcom_pcie_probe(struct platfo
42 struct dw_pcie *pci;
43 struct qcom_pcie *pcie;
44 int ret;
45 + uint32_t force_gen1 = 0;
46 + struct device_node *np = pdev->dev.of_node;
47
48 pcie = devm_kzalloc(dev, sizeof(*pcie), GFP_KERNEL);
49 if (!pcie)
50 @@ -1397,6 +1407,9 @@ static int qcom_pcie_probe(struct platfo
51 goto err_pm_runtime_put;
52 }
53
54 + of_property_read_u32(np, "force_gen1", &force_gen1);
55 + pcie->force_gen1 = force_gen1;
56 +
57 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "parf");
58 pcie->parf = devm_ioremap_resource(dev, res);
59 if (IS_ERR(pcie->parf)) {