DRA72/DRA74: Add 2 lane support
Subsystems (4)
cover DRA72/DRA74: Add 2 lane support
Add driver modifications in pci-dra7xx to get x2 mode working in DRA72 and DRA74. Certain modifications is needed in PHY driver also which will be sent as a separate series.
Certain board modifications has to be done in order to test x2 mode in dra72-evm.
These patches were created on pci next.
Changes from RFC:
*) .b1co_mode_sel_mask is now set with the correct value. *) cleanup the patch
Kishon Vijay Abraham I (2):
pci: host: pci-dra7xx: use "num-lanes" property to find phy count
pci: host: pci-dra7xx: Enable x2 mode support
Documentation/devicetree/bindings/pci/ti-pci.txt | 8 +- drivers/pci/host/pci-dra7xx.c | 104 +++++++++++++++++++--- 2 files changed, 97 insertions(+), 15 deletions(-)
Signature · 6 lines
1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 1/2 pci: host: pci-dra7xx: use "num-lanes" property to find phy count
use "num-lanes" property to find phy count instead of the number phy-names property.
--- drivers/pci/host/pci-dra7xx.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-)
drivers/pci/host/pci-dra7xx.c +11 -12
@@ -70,7 +70,7 @@struct dra7xx_pcie {void __iomem *base;struct phy **phy; -int phy_count; +int lanes;struct device *dev;struct pcie_port pp; };
@@ -364,7 +364,7 @@ static int __init dra7xx_pcie_probe(struct platform_device *pdev)int ret;int irq;int i; -int phy_count; +u32 lanes;struct phy **phy;void __iomem *base;struct resource *res;
@@ -402,17 +402,16 @@ static int __init dra7xx_pcie_probe(struct platform_device *pdev)if (!base)return -ENOMEM ; - phy_count =of_property_count_strings (np,"phy-names" ); -if (phy_count <0 ) { -dev_err (dev,"unable to find the strings\n" ); -return phy_count; +if (of_property_read_u32 (np,"num-lanes" , &lanes)) { +dev_err (dev,"Failed to parse the number of lanes\n" ); +return -EINVAL ; } - phy =devm_kzalloc (dev,sizeof (*phy) * phy_count,GFP_KERNEL ); + phy =devm_kzalloc (dev,sizeof (*phy) * lanes,GFP_KERNEL );if (!phy)return -ENOMEM ; -for (i =0 ; i < phy_count; i++) { +for (i =0 ; i < lanes; i++) {snprintf (name,sizeof (name),"pcie-phy%d" , i); phy[i] =devm_phy_get (dev, name);if (IS_ERR (phy[i]))
@@ -432,7 +431,7 @@ static int __init dra7xx_pcie_probe(struct platform_device *pdev) dra7xx->base = base; dra7xx->phy = phy; dra7xx->dev = dev; - dra7xx->phy_count = phy_count; + dra7xx->lanes = lanes;pm_runtime_enable (dev); ret =pm_runtime_get_sync (dev);
@@ -489,7 +488,7 @@ static int __exit dra7xx_pcie_remove(struct platform_device *pdev)struct dra7xx_pcie *dra7xx =platform_get_drvdata (pdev);struct pcie_port *pp = &dra7xx->pp;struct device *dev = &pdev->dev; -int count = dra7xx->phy_count; +int count = dra7xx->lanes;if (pp->irq_domain)irq_domain_remove (pp->irq_domain);
@@ -535,7 +534,7 @@ static int dra7xx_pcie_resume(struct device *dev)static int dra7xx_pcie_suspend_noirq (struct device *dev) {struct dra7xx_pcie *dra7xx =dev_get_drvdata (dev); -int count = dra7xx->phy_count; +int count = dra7xx->lanes;while (count--) {phy_power_off (dra7xx->phy[count]);
@@ -548,7 +547,7 @@ static int dra7xx_pcie_suspend_noirq(struct device *dev)static int dra7xx_pcie_resume_noirq (struct device *dev) {struct dra7xx_pcie *dra7xx =dev_get_drvdata (dev); -int phy_count = dra7xx->phy_count; +int phy_count = dra7xx->lanes;int ret;int i;
Signature · 1 line
1.7.9.5
PATCH 2/2 pci: host: pci-dra7xx: Enable x2 mode support
In reply to Kishon Vijay Abraham IPerform syscon configurations to get x2 mode to working in DRA74x and DRA72x. Also add a new compatible string to dfferentiate DRA72x and DRA74x, since b1c0 mask is different for both these platforms.
--- Documentation/devicetree/bindings/pci/ti-pci.txt | 8 ++- drivers/pci/host/pci-dra7xx.c | 81 +++++++++++++++++++++- 2 files changed, 86 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/pci/ti-pci.txt +7 -1
@@ -1,7 +1,9 @@ TI PCI Controllers PCIe Designware Controller - - compatible: Should be "ti,dra7-pcie"" + - compatible: "ti,dra7-pcie" is deprecated + Should be "ti,dra746-pcie" for DRA74x + Should be "ti,dra726-pcie" for DRA72x - reg : Two register ranges as listed in the reg-names property - reg-names : The first entry must be "ti-conf" for the TI specific registers The second entry must be "rc-dbics" for the designware pcie
@@ -14,6 +16,10 @@ PCIe Designware Controller where <X> is the instance number of the pcie from the HW spec. - interrupts : Two interrupt entries must be specified. The first one is for main interrupt line and the second for MSI interrupt line. + - syscon-lane-conf : phandle/offset pair. Phandle to the system control module and the + register offset to specify 1 lane or 2 lane. + - syscon-lane-sel : phandle/offset pair. Phandle to the system control module and the + register offset to specify lane selection. - #address-cells, #size-cells, #interrupt-cells,
drivers/pci/host/pci-dra7xx.c +79 -2
122 lines not on this page · raw message
Signature · 1 line
1.7.9.5
Rob Herring
maintainerRe: [PATCH 2/2] pci: host: pci-dra7xx: Enable x2 mode support
Quoted 26 lines · Kishon Vijay Abraham I
Perform syscon configurations to get x2 mode to working in DRA74x and DRA72x. Also add a new compatible string to dfferentiate DRA72x and DRA74x, since b1c0 mask is different for both these platforms.
Signed-off-by Kishon Vijay Abraham I <[email protected]>--- Documentation/devicetree/bindings/pci/ti-pci.txt | 8 ++- drivers/pci/host/pci-dra7xx.c | 81 +++++++++++++++++++++- 2 files changed, 86 insertions(+), 3 deletions(-)Documentation/devicetree/bindings/pci/ti-pci.txt +3
-1@@ -1,7 +1,9 @@ TI PCI Controllers PCIe Designware Controller - - compatible: Should be "ti,dra7-pcie"" + - compatible: "ti,dra7-pcie" is deprecated + Should be "ti,dra746-pcie" for DRA74x + Should be "ti,dra726-pcie" for DRA72x - reg : Two register ranges as listed in the reg-names property - reg-names : The first entry must be "ti-conf" for the TI specific registers The second entry must be "rc-dbics" for the designware pcie
Documentation/devicetree/bindings/pci/ti-pci.txt PCIe Designware Controller · line 22
Quoted 7 lines
Documentation/devicetree/bindings/pci/ti-pci.txt +4
-0@@ -14,6 +16,10 @@ PCIe Designware Controller where <X> is the instance number of the pcie from the HW spec. - interrupts : Two interrupt entries must be specified. The first one is for main interrupt line and the second for MSI interrupt line. + - syscon-lane-conf : phandle/offset pair. Phandle to the system control module and the + register offset to specify 1 lane or 2 lane. + - syscon-lane-sel : phandle/offset pair. Phandle to the system control module and the + register offset to specify lane selection.
These should have a ti prefix.
Quoted 3 lines
Documentation/devicetree/bindings/pci/ti-pci.txt +0
-0- #address-cells, #size-cells, #interrupt-cells,
Re: [PATCH 2/2] pci: host: pci-dra7xx: Enable x2 mode support
Hi,
Quoted 28 lines · Rob Herring
Quoted 27 lines · Kishon Vijay Abraham I
Perform syscon configurations to get x2 mode to working in DRA74x and DRA72x. Also add a new compatible string to dfferentiate DRA72x and DRA74x, since b1c0 mask is different for both these platforms.
Signed-off-by Kishon Vijay Abraham I <[email protected]>--- Documentation/devicetree/bindings/pci/ti-pci.txt | 8 ++- drivers/pci/host/pci-dra7xx.c | 81 +++++++++++++++++++++- 2 files changed, 86 insertions(+), 3 deletions(-)Documentation/devicetree/bindings/pci/ti-pci.txt +3
-1@@ -1,7 +1,9 @@ TI PCI Controllers PCIe Designware Controller - - compatible: Should be "ti,dra7-pcie"" + - compatible: "ti,dra7-pcie" is deprecated + Should be "ti,dra746-pcie" for DRA74x + Should be "ti,dra726-pcie" for DRA72x - reg : Two register ranges as listed in the reg-names property - reg-names : The first entry must be "ti-conf" for the TI specific registers The second entry must be "rc-dbics" for the designware pcie@@ -14,6 +16,10 @@ PCIe Designware Controller where <X> is the instance number of the pcie from the HW spec.
Quoted 8 lines
Documentation/devicetree/bindings/pci/ti-pci.txt PCIe Designware Controller · line 22
Quoted 6 lines
Documentation/devicetree/bindings/pci/ti-pci.txt +4
-0- interrupts : Two interrupt entries must be specified. The first one is for main interrupt line and the second for MSI interrupt line. + - syscon-lane-conf : phandle/offset pair. Phandle to the system control module and the + register offset to specify 1 lane or 2 lane. + - syscon-lane-sel : phandle/offset pair. Phandle to the system control module and the + register offset to specify lane selection.These should have a ti prefix.
Okay. Will fix that and post a new version.
Thanks
Kishon
Quoted 4 lines
Documentation/devicetree/bindings/pci/ti-pci.txt PCIe Designware Controller · line 25
Quoted 4 lines
Documentation/devicetree/bindings/pci/ti-pci.txt +0
-0- #address-cells, #size-cells, #interrupt-cells,
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
[+cc Richard]
Hi Kishon,
Quoted 13 lines · Kishon Vijay Abraham I
Add driver modifications in pci-dra7xx to get x2 mode working in DRA72 and DRA74. Certain modifications is needed in PHY driver also which will be sent as a separate series.
Certain board modifications has to be done in order to test x2 mode in dra72-evm.
These patches were created on pci next.
Changes from RFC:
*) .b1co_mode_sel_mask is now set with the correct value. *) cleanup the patch
Quoted 7 lines
Kishon Vijay Abraham I (2):
pci: host: pci-dra7xx: use "num-lanes" property to find phy count
pci: host: pci-dra7xx: Enable x2 mode supportDocumentation/devicetree/bindings/pci/ti-pci.txt | 8 +- drivers/pci/host/pci-dra7xx.c | 104 +++++++++++++++++++--- 2 files changed, 97 insertions(+), 15 deletions(-)
Apparently dra7xx in mainline doesn't work [1]. Until that's resolved, I'm going to ignore dra7xx patches.
Bjorn
[1] http://lkml.kernel.org/r/20160106214518.GA6106-bi+AKbBUZKY6gyzm1THtWbp2dZbC/[email protected]
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 22 lines · Bjorn Helgaas
[+cc Richard]
Hi Kishon,
Quoted 17 lines · Kishon Vijay Abraham I
Add driver modifications in pci-dra7xx to get x2 mode working in DRA72 and DRA74. Certain modifications is needed in PHY driver also which will be sent as a separate series.
Certain board modifications has to be done in order to test x2 mode in dra72-evm.
These patches were created on pci next.
Changes from RFC:
*) .b1co_mode_sel_mask is now set with the correct value. *) cleanup the patchKishon Vijay Abraham I (2):
pci: host: pci-dra7xx: use "num-lanes" property to find phy count
pci: host: pci-dra7xx: Enable x2 mode support
Quoted 6 lines
Quoted 3 lines
Documentation/devicetree/bindings/pci/ti-pci.txt | 8 +- drivers/pci/host/pci-dra7xx.c | 104 +++++++++++++++++++--- 2 files changed, 97 insertions(+), 15 deletions(-)Apparently dra7xx in mainline doesn't work [1]. Until that's resolved, I'm going to ignore dra7xx patches.
Agreed. Guys, please do the development _and_ testing on the mainline kernel. We do have the mainline kernel usable for probably a few tens of omap SoC variants. If you have issues using dra7 with mainline, please fix those issues ASAP.
Ideally of course please also use the device you're working on to send out the patches :)
Regards,
Tony
Quoted 1 line
Hi Tony,
Quoted 27 lines · Tony Lindgren
Quoted 26 lines · Bjorn Helgaas
[+cc Richard]
Hi Kishon,
Quoted 20 lines · Kishon Vijay Abraham I
Add driver modifications in pci-dra7xx to get x2 mode working in DRA72 and DRA74. Certain modifications is needed in PHY driver also which will be sent as a separate series.
Certain board modifications has to be done in order to test x2 mode in dra72-evm.
These patches were created on pci next.
Changes from RFC:
*) .b1co_mode_sel_mask is now set with the correct value. *) cleanup the patchKishon Vijay Abraham I (2):
pci: host: pci-dra7xx: use "num-lanes" property to find phy count
pci: host: pci-dra7xx: Enable x2 mode supportDocumentation/devicetree/bindings/pci/ti-pci.txt | 8 +- drivers/pci/host/pci-dra7xx.c | 104 +++++++++++++++++++--- 2 files changed, 97 insertions(+), 15 deletions(-)
Quoted 7 lines
Quoted 2 lines
Apparently dra7xx in mainline doesn't work [1]. Until that's resolved, I'm going to ignore dra7xx patches.
Agreed. Guys, please do the development _and_ testing on the mainline kernel. We do have the mainline kernel usable for probably a few tens of omap SoC variants. If you have issues using dra7 with mainline, please fix those issues ASAP.
Here Bjorn meant pci-dra7xx is broken in mainline and not the dra7xx boot as such. (which is due to the absence of reset controller driver). All the patches to pci-dra7xx were tested on mainline kernel (having out-of-tree reset patches since the reset controller driver is not merged).
Quoted 3 lines
Ideally of course please also use the device you're working on to send out the patches :)
dra7x is the only device that use this pci driver and all the patches to pci-dra7xx have been tested on both dra7 and dra72 boards.
Thanks
Kishon