On Fri, Dec 06, 2019 at 03:27:49PM +0800, Dilip Kota wrote:Sure, will do it. Thanks for pointing it.
Add support to PCIe RC controller on Intel Gateway SoCs.This shouldn't be needed; there's a declaration in drivers/pci/pci.h.
PCIe controller is based of Synopsys DesignWare PCIe core.
Intel PCIe driver requires Upconfigure support, Fast Training
Sequence and link speed configurations. So adding the respective
helper functions in the PCIe DesignWare framework.
It also programs hardware autonomous speed during speed
configuration so defining it in pci_regs.h.
Also, mark Intel PCIe driver depends on MSI IRQ Domain
as Synopsys DesignWare framework depends on the
PCI_MSI_IRQ_DOMAIN.
Signed-off-by: Dilip Kota <eswara.kota@xxxxxxxxxxxxxxx>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@xxxxxxx>
Reviewed-by: Andrew Murray <andrew.murray@xxxxxxx>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
Acked-by: Gustavo Pimentel <gustavo.pimentel@xxxxxxxxxxxx>
--- a/drivers/pci/controller/dwc/pcie-designware.c
+++ b/drivers/pci/controller/dwc/pcie-designware.c
@@ -14,6 +14,8 @@
#include "pcie-designware.h"
+extern const unsigned char pcie_link_speed[];
My miss, i will update it.
+struct intel_pcie_soc {Looks a little strange to have the fields below lined up but the ones
+ unsigned int pcie_ver;
+ unsigned int pcie_atu_offset;
+ u32 num_viewport;
+};
above not.
There is no impact because RW1C bits of respective registers are 0s at the time of this function call.
+struct intel_pcie_port {I assume this is never used on registers where the "old & ~mask" part
+ struct dw_pcie pci;
+ void __iomem *app_base;
+ struct gpio_desc *reset_gpio;
+ u32 rst_intrvl;
+ u32 max_speed;
+ u32 link_gen;
+ u32 max_width;
+ u32 n_fts;
+ struct clk *core_clk;
+ struct reset_control *core_rst;
+ struct phy *phy;
+ u8 pcie_cap_ofst;
+};
+
+static void pcie_update_bits(void __iomem *base, u32 ofs, u32 mask, u32 val)
+{
+ u32 old;
+
+ old = readl(base + ofs);
+ val = (old & ~mask) | (val & mask);
+
+ if (val != old)
+ writel(val, base + ofs);
contains RW1C bits? If there are RW1C bits in that part, this will
corrupt them.
I will correct it.
+ if (!lpp->pcie_cap_ofst) {Some of your messages start with a capital letter, others not.
+ ret = dw_pcie_find_capability(&lpp->pci, PCI_CAP_ID_EXP);
+ if (!ret) {
+ ret = -ENXIO;
+ dev_err(dev, "Invalid PCIe capability offset\n");
Ok, i will change it.
+int intel_pcie_msi_init(struct pcie_port *pp)You might add a comment here like the one at
ks_pcie_am654_msi_host_init(). Since the users of the
.msi_host_init() function pointer only call the function if the
pointer is non-NULL, it's not completely obvious why you have this
stub function.
Ok, i will fix it.
+{s/to not to/to not/
+ /* PCIe MSI/MSIx is handled by MSI in x86 processor */
+ return 0;
+}
+ /*
+ * Intel PCIe doesn't configure IO region, so set viewport
+ * to not to perform IO region access.
I will remove the print then!
+ */Probably superfluous.
+ pci->num_viewport = data->num_viewport;
+
+ dev_info(dev, "Intel PCIe Root Complex Port init done\n");
+Since the return value is known here:
+ return ret;
return 0;
+}