Re: [RFC PATCH 02/12] pci: host: pcie-dra7xx: add support for pcie-dra7xx controller
From: Kishon Vijay Abraham I <hidden>
Date: 2014-03-27 05:27:12
Also in:
linux-arm-kernel, linux-omap, linux-pci, lkml
On Thursday 27 March 2014 09:13 AM, Jingoo Han wrote:
On Wednesday, March 26, 2014 10:58 PM, Kishon Vijay Abraham I wrote:quoted
Added support for pcie controller in dra7xx. This driver re-uses the designware core code that is already present in kernel. Signed-off-by: Kishon Vijay Abraham I <redacted>Hi Kishon, Long time no see! I added trivial comments.
yeah, these were in my TODO for a long time. Sorry for it though.
quoted
--- Documentation/devicetree/bindings/pci/ti-pci.txt | 35 ++ drivers/pci/host/Kconfig | 10 + drivers/pci/host/Makefile | 1 + drivers/pci/host/pcie-dra7xx.c | 411 ++++++++++++++++++++++How about using 'pci-' prefix? As it was discussed earlier, 'pci-' prefix is more proper.quoted
4 files changed, 457 insertions(+) create mode 100644 Documentation/devicetree/bindings/pci/ti-pci.txt create mode 100644 drivers/pci/host/pcie-dra7xx.c[.....]quoted
--- /dev/null +++ b/drivers/pci/host/pcie-dra7xx.c[.....]quoted
+#define PCIECTRL_TI_CONF_IRQSTATUS_MAIN 0x0024 +#define PCIECTRL_TI_CONF_IRQENABLE_SET_MAIN 0x0028I don't think that it's good to add vendor names such as TI to SFR names. How about adding 'DRA7XX' or just removing 'TI'? 1. PCIECTRL_DRA7XX_CONF_IRQSTATUS_MAIN
ok.
2. PCIECTRL_CONF_IRQSTATUS_MAIN [.....]quoted
+enum dra7xx_pcie_device_type { + DRA7XX_PCIE_UNKNOWN_TYPE, + DRA7XX_PCIE_EP_TYPE, + DRA7XX_PCIE_LEG_EP_TYPE, + DRA7XX_PCIE_RC_TYPE, +};This driver can support only RC mode, so, these enum can be removed. [.....]quoted
+ of_property_read_u32(node, "ti,device-type", &device_type); + switch (device_type) { + case DRA7XX_PCIE_RC_TYPE: + dra7xx_pcie_writel(dra7xx->base, + PCIECTRL_TI_CONF_DEVICE_TYPE, DEVICE_TYPE_RC); + break; + case DRA7XX_PCIE_EP_TYPE: + dra7xx_pcie_writel(dra7xx->base, + PCIECTRL_TI_CONF_DEVICE_TYPE, DEVICE_TYPE_EP); + break; + case DRA7XX_PCIE_LEG_EP_TYPE: + dra7xx_pcie_writel(dra7xx->base, + PCIECTRL_TI_CONF_DEVICE_TYPE, DEVICE_TYPE_LEG_EP); + break; + default: + dev_dbg(dev, "UNKNOWN device type %d\n", device_type); + }Thus, this switch can be removed.
sure. Thanks Kishon