[PATCH] arm64: dts: mt2712: Remove un-used property for PCIe

2019-03-18 Thread honghui.zhang
From: Honghui Zhang The "num-lanes" property for PCIe is not used, remove it. Signed-off-by: Honghui Zhang --- arch/arm64/boot/dts/mediatek/mt2712e.dtsi | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/arm64/boot/dts/mediatek/mt2712e.dtsi b/arch/arm64/boot/dts/mediatek/mt2712e.dtsi

[RFC PATCH v2] PCI/portdrv: Support for subtractive decode bridge

2019-02-13 Thread honghui.zhang
From: Honghui Zhang The Class Code for subtractive decode PCI-to-PCI bridge is 060401h, add one entry to make portdrv support this type bridge. Signed-off-by: Honghui Zhang --- drivers/pci/pcie/portdrv_pci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pci/pcie/portdrv_pci.c

[PATCH v3 2/2] PCI: mediatek: Enlarge PCIe2AHB window size to support 4GB DRAM

2019-01-31 Thread honghui.zhang
From: Honghui Zhang The PCIE_AXI_WINDOW0 defines the translate window size for the request from EP side. Request outside of this window will be treated as unsupported request. Enlarge this window size from fls(0x) to 2^33 to support 8GB translate address range then EP DMA is capable of

[PATCH v3 0/2] PCI: mediatek: enable whole MMIO range and enlarge the PCIe2AHB window size

2019-01-31 Thread honghui.zhang
From: Honghui Zhang Two patches: patch 1 enable whole MMIO range which also fix the complain of scripts/coccinelle/api/resource_size.cocci patch 2 enlarge the PCIe2AHB window size to support fully access of 4GB DRAM from EP DMA. v3: - update the changlog title for patch1 and update commit

[PATCH v3 1/2] PCI: mediatek: Enable the whole memory mapped IO range

2019-01-31 Thread honghui.zhang
From: Honghui Zhang Mediatek's HW assigned a bus address range(typically start from 0x2000_ to 0x2fff_ for both mt2712 and mt7622) for PCIe usage. This bus address range is called memory mapped IO range, when CPU or other HW access those address, PCIe RC HW should response to this

[PATCH v2 1/2] PCI: mediatek: Use resource_size function on resource object

2019-01-31 Thread honghui.zhang
From: Honghui Zhang scripts/coccinelle/api/resource_size.cocci complain about the following warning: pcie-mediatek.c:720:13-16: WARNING: Suspicious code. resource_size is maybe missing with mem Use resource_size(mem) instead of mem->end - mem->start to eliminate the complain. Since the MMIO

[PATCH v2 2/2] PCI: mediatek: Enlarge PCIe2AHB window size to support 4GB DRAM

2019-01-31 Thread honghui.zhang
From: Honghui Zhang The PCIE_AXI_WINDOW0 defines the translate window size for the request from EP side. Request outside of this window will be treated as unsupported request. Enlarge this window size from fls(0x) to 2^33 to support 8GB translate address range then EP DMA is capable of

[PATCH v2 0/2] PCI: mediatek: fix warning and enlarge the PCIe2AHB window size

2019-01-31 Thread honghui.zhang
From: Honghui Zhang Two patches: patch 1 fix the complain of scripts/coccinelle/api/resource_size.cocci patch 2 enlarge the PCIe2AHB window size to support fully access of 4GB DRAM from EP DMA. v2: - Fix the checkpatch complains for patch 1. - update the commit message and change title of

[PATCH] PCI: Mediatek: Use resource_size function on resource object

2019-01-01 Thread honghui.zhang
From: Honghui Zhang drivers/pci/pcie-mediatek.c:720:13-16: WARNING: Suspicious code. resource_size is maybe missing with mem Generated by: scripts/coccinelle/api/resource_size.cocci Signed-off-by: Honghui Zhang --- drivers/pci/controller/pcie-mediatek.c | 4 +--- 1 file changed, 1

[RFC PATCH] PCI/portdrv: Support for subtractive decode bridge

2018-12-13 Thread honghui.zhang
From: Honghui Zhang The Class Code for subtractive decode PCI-to-PCI bridge is 060401h, change the class_mask values to make portdrv support this type bridge. Signed-off-by: Honghui Zhang --- drivers/pci/pcie/portdrv_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 1/4] PCI: mediatek: Remove un-used variant in struct mtk_pcie_port

2018-12-13 Thread honghui.zhang
From: Honghui Zhang The "lane" variant in struct mtk_pcie_port is not used, remove it. Signed-off-by: Honghui Zhang --- drivers/pci/controller/pcie-mediatek.c | 8 1 file changed, 8 deletions(-) diff --git a/drivers/pci/controller/pcie-mediatek.c

[PATCH 2/4] dt-bindings: PCI: MediaTek: Remove un-used property

2018-12-13 Thread honghui.zhang
From: Honghui Zhang The "num-lanes" property is not used, remove it. Signed-off-by: Honghui Zhang --- Documentation/devicetree/bindings/pci/mediatek-pcie.txt | 8 1 file changed, 8 deletions(-) diff --git a/Documentation/devicetree/bindings/pci/mediatek-pcie.txt

[PATCH 4/4] arm64: dts: mt7622: Remove un-used property for PCIe

2018-12-13 Thread honghui.zhang
From: Honghui Zhang The "num-lanes" property for PCIe is not used, remove it. Signed-off-by: Honghui Zhang --- arch/arm64/boot/dts/mediatek/mt7622.dtsi | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/arm64/boot/dts/mediatek/mt7622.dtsi b/arch/arm64/boot/dts/mediatek/mt7622.dtsi

[PATCH 3/4] arm: dts: mt7623: Remove un-used property for PCIe

2018-12-13 Thread honghui.zhang
From: Honghui Zhang The "num-lanes" property for PCIe is not used, remove it. Signed-off-by: Honghui Zhang --- arch/arm/boot/dts/mt7623.dtsi | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/arm/boot/dts/mt7623.dtsi b/arch/arm/boot/dts/mt7623.dtsi index 1cdc346..4ca56d8 100644 ---

[PATCH 0/4] Cleanup un-used variant and un-used property for MediaTek PCIe

2018-12-13 Thread honghui.zhang
From: Honghui Zhang The "num-lanes" property in MediaTek's PCIe device node is not used by its driver or anyone else, cleanup those related code. Honghui Zhang (4): PCI: mediatek: Remove un-used variant in struct mtk_pcie_port dt-bindings: PCI: MediaTek: Remove un-used property arm: dts:

[PATCH v3] PCI: mediatek: Use devm_of_pci_get_host_bridge_resources() to parse DT

2018-11-29 Thread honghui.zhang
From: Honghui Zhang Use the devm_of_pci_get_host_bridge_resources() API in place of the PCI OF DT parser. Signed-off-by: Honghui Zhang Acked-by: Ryder Lee --- drivers/pci/controller/pcie-mediatek.c | 101 + 1 file changed, 27 insertions(+), 74 deletions(-)

[PATCH v3] PCI: mediatek: Use devm_of_pci_get_host_bridge_resources() to parse DT

2018-11-29 Thread honghui.zhang
From: Honghui Zhang Use the devm_of_pci_get_host_bridge_resources() API in place of the PCI OF DT parser. Signed-off-by: Honghui Zhang Acked-by: Ryder Lee --- drivers/pci/controller/pcie-mediatek.c | 101 + 1 file changed, 27 insertions(+), 74 deletions(-)

[PATCH v2] PCI: mediatek: Use devm_of_pci_get_host_bridge_resources() to parse DT

2018-11-07 Thread honghui.zhang
From: Honghui Zhang Use the devm_of_pci_get_host_bridge_resources() API in place of the PCI OF DT parser. Signed-off-by: Honghui Zhang --- drivers/pci/controller/pcie-mediatek.c | 98 +- 1 file changed, 24 insertions(+), 74 deletions(-) diff --git

[PATCH v2] PCI: mediatek: Use devm_of_pci_get_host_bridge_resources() to parse DT

2018-11-07 Thread honghui.zhang
From: Honghui Zhang Use the devm_of_pci_get_host_bridge_resources() API in place of the PCI OF DT parser. Signed-off-by: Honghui Zhang --- drivers/pci/controller/pcie-mediatek.c | 98 +- 1 file changed, 24 insertions(+), 74 deletions(-) diff --git

[PATCH] PCI: mediatek: Use devm_of_pci_get_host_bridge_resources() to parse DT

2018-10-17 Thread honghui.zhang
From: Honghui Zhang Use the devm_of_pci_get_host_bridge_resources() API in place of the PCI OF DT parser. Signed-off-by: Honghui Zhang --- drivers/pci/controller/pcie-mediatek.c | 109 + 1 file changed, 29 insertions(+), 80 deletions(-) diff --git

[PATCH] PCI: mediatek: Use devm_of_pci_get_host_bridge_resources() to parse DT

2018-10-17 Thread honghui.zhang
From: Honghui Zhang Use the devm_of_pci_get_host_bridge_resources() API in place of the PCI OF DT parser. Signed-off-by: Honghui Zhang --- drivers/pci/controller/pcie-mediatek.c | 109 + 1 file changed, 29 insertions(+), 80 deletions(-) diff --git

[PATCH v9 3/9] PCI: mediatek: Remove the redundant dev->pm_domain check

2018-10-16 Thread honghui.zhang
From: Honghui Zhang It's no needed to check whether device have pm_domain attached before calling the pm_runtime_XXX interface, remove it. Signed-off-by: Honghui Zhang Acked-by: Ryder Lee --- drivers/pci/controller/pcie-mediatek.c | 18 ++ 1 file changed, 6 insertions(+), 12

[PATCH v9 1/9] PCI: mediatek: Using slot's devfn for compare to fix mtk_pcie_find_port logic

2018-10-16 Thread honghui.zhang
From: Honghui Zhang The Mediatek's host controller has two slots, each with it's own control registers. The host driver need to identify which slot was connected in order to access the device's configuration space. There's problem for current host driver to find out which slot was connected to

[PATCH v9 2/9] PCI: Using PCI configuration space header type instead of class type to assign resource

2018-10-16 Thread honghui.zhang
From: Honghui Zhang The PCI configuration space header type defines the layout of the rest of the header (PCI r3.0 sec 6.1, PCIe r4.0 sec 7.5.1.1.9) while the resource assignment is based on the configuration space layout instead of its class type. Using configuration space header type instead

[PATCH v9 3/9] PCI: mediatek: Remove the redundant dev->pm_domain check

2018-10-16 Thread honghui.zhang
From: Honghui Zhang It's no needed to check whether device have pm_domain attached before calling the pm_runtime_XXX interface, remove it. Signed-off-by: Honghui Zhang Acked-by: Ryder Lee --- drivers/pci/controller/pcie-mediatek.c | 18 ++ 1 file changed, 6 insertions(+), 12

[PATCH v9 1/9] PCI: mediatek: Using slot's devfn for compare to fix mtk_pcie_find_port logic

2018-10-16 Thread honghui.zhang
From: Honghui Zhang The Mediatek's host controller has two slots, each with it's own control registers. The host driver need to identify which slot was connected in order to access the device's configuration space. There's problem for current host driver to find out which slot was connected to

[PATCH v9 2/9] PCI: Using PCI configuration space header type instead of class type to assign resource

2018-10-16 Thread honghui.zhang
From: Honghui Zhang The PCI configuration space header type defines the layout of the rest of the header (PCI r3.0 sec 6.1, PCIe r4.0 sec 7.5.1.1.9) while the resource assignment is based on the configuration space layout instead of its class type. Using configuration space header type instead

[PATCH v9 5/9] PCI: mediatek: Move the mtk_pcie_startup_port_v2 function's define after mtk_pcie_setup_irq

2018-10-16 Thread honghui.zhang
From: Honghui Zhang This is a prepare patch to fix enable MSI logic, move the function's define later to avoid forward declaration of mtk_pcie_enable_msi in the future. No functional changed. Signed-off-by: Honghui Zhang Acked-by: Ryder Lee --- drivers/pci/controller/pcie-mediatek.c | 138

[PATCH v9 5/9] PCI: mediatek: Move the mtk_pcie_startup_port_v2 function's define after mtk_pcie_setup_irq

2018-10-16 Thread honghui.zhang
From: Honghui Zhang This is a prepare patch to fix enable MSI logic, move the function's define later to avoid forward declaration of mtk_pcie_enable_msi in the future. No functional changed. Signed-off-by: Honghui Zhang Acked-by: Ryder Lee --- drivers/pci/controller/pcie-mediatek.c | 138

[PATCH v9 8/9] PCI: mediatek: Save the GIC IRQ in mtk_pcie_port

2018-10-16 Thread honghui.zhang
From: Honghui Zhang Need to save the PCIe's GIC IRQ for dispose_irq, this is a prepare patch for add mediatek PCIe module support to tear down the IRQ, no functional changed. Signed-off-by: Honghui Zhang Acked-by: Ryder Lee --- drivers/pci/controller/pcie-mediatek.c | 9 ++--- 1 file

[PATCH v9 8/9] PCI: mediatek: Save the GIC IRQ in mtk_pcie_port

2018-10-16 Thread honghui.zhang
From: Honghui Zhang Need to save the PCIe's GIC IRQ for dispose_irq, this is a prepare patch for add mediatek PCIe module support to tear down the IRQ, no functional changed. Signed-off-by: Honghui Zhang Acked-by: Ryder Lee --- drivers/pci/controller/pcie-mediatek.c | 9 ++--- 1 file

[PATCH v9 7/9] PCI: mediatek: Add system PM support for MT2712 and MT7622

2018-10-16 Thread honghui.zhang
From: Honghui Zhang In order to reduce the PCIe power consuming while system suspend, the physical layer should be gated. And the PCIe link should be re-established and the related control register values should be re-initialized after system resume. Register suspend_noirq & resume_noirq

[PATCH v9 0/9] PCI: mediatek: fixup find_port, enable_msi and add PM, module support

2018-10-16 Thread honghui.zhang
From: Honghui Zhang This patchset includes misc patchs: The patch 1 fixup the mtk_pcie_find_port logic which will cause system could not touch the EP's configuration space that connected to PCIe slot 1. The patch fixup the PCI core defect which assign resource base on device's class type.

[PATCH v9 4/9] PCI: mediatek: Convert to use pci_host_probe()

2018-10-16 Thread honghui.zhang
From: Honghui Zhang Part of mtk_pcie_register_host is an open-coded version of pci_host_probe(). So instead of duplicating this code, use pci_host_probe() directly and remove mtk_pcie_register_host. Signed-off-by: Honghui Zhang Acked-by: Ryder Lee --- drivers/pci/controller/pcie-mediatek.c |

[PATCH v9 7/9] PCI: mediatek: Add system PM support for MT2712 and MT7622

2018-10-16 Thread honghui.zhang
From: Honghui Zhang In order to reduce the PCIe power consuming while system suspend, the physical layer should be gated. And the PCIe link should be re-established and the related control register values should be re-initialized after system resume. Register suspend_noirq & resume_noirq

[PATCH v9 0/9] PCI: mediatek: fixup find_port, enable_msi and add PM, module support

2018-10-16 Thread honghui.zhang
From: Honghui Zhang This patchset includes misc patchs: The patch 1 fixup the mtk_pcie_find_port logic which will cause system could not touch the EP's configuration space that connected to PCIe slot 1. The patch fixup the PCI core defect which assign resource base on device's class type.

[PATCH v9 4/9] PCI: mediatek: Convert to use pci_host_probe()

2018-10-16 Thread honghui.zhang
From: Honghui Zhang Part of mtk_pcie_register_host is an open-coded version of pci_host_probe(). So instead of duplicating this code, use pci_host_probe() directly and remove mtk_pcie_register_host. Signed-off-by: Honghui Zhang Acked-by: Ryder Lee --- drivers/pci/controller/pcie-mediatek.c |

[PATCH v9 9/9] PCI: mediatek: Add loadable kernel module support

2018-10-16 Thread honghui.zhang
From: Honghui Zhang Implement remove callback function for Mediatek PCIe driver to add loadable kernel module support. Signed-off-by: Honghui Zhang Reviewed-by: Ryder Lee --- drivers/pci/controller/Kconfig | 2 +- drivers/pci/controller/pcie-mediatek.c | 51

[PATCH v9 6/9] PCI: mediatek: Fixup enable MSI logic by enable MSI after clock enabled

2018-10-16 Thread honghui.zhang
From: Honghui Zhang The commit 43e6409db64d ("PCI: mediatek: Add MSI support for MT2712 and MT7622") added MSI support but enable MSI in wrong place, clocks was not enabled when enable MSI. This patch fix this issue by calling mtk_pcie_enable_msi in mtk_pcie_startup_port_v2 since the clock was

[PATCH v9 6/9] PCI: mediatek: Fixup enable MSI logic by enable MSI after clock enabled

2018-10-16 Thread honghui.zhang
From: Honghui Zhang The commit 43e6409db64d ("PCI: mediatek: Add MSI support for MT2712 and MT7622") added MSI support but enable MSI in wrong place, clocks was not enabled when enable MSI. This patch fix this issue by calling mtk_pcie_enable_msi in mtk_pcie_startup_port_v2 since the clock was

[PATCH v9 9/9] PCI: mediatek: Add loadable kernel module support

2018-10-16 Thread honghui.zhang
From: Honghui Zhang Implement remove callback function for Mediatek PCIe driver to add loadable kernel module support. Signed-off-by: Honghui Zhang Reviewed-by: Ryder Lee --- drivers/pci/controller/Kconfig | 2 +- drivers/pci/controller/pcie-mediatek.c | 51

[PATCH v8 7/9] PCI: mediatek: Add system PM support for MT2712 and MT7622

2018-10-15 Thread honghui.zhang
From: Honghui Zhang In order to reduce the PCIe power consuming while system suspend, the physical layer should be gated. And the PCIe link should be re-established and the related control register values should be re-initialized after system resume. Register suspend_noirq & resume_noirq

[PATCH v8 6/9] PCI: mediatek: Fixup enable MSI logic by enable MSI after clock enabled

2018-10-15 Thread honghui.zhang
From: Honghui Zhang The commit 43e6409db64d ("PCI: mediatek: Add MSI support for MT2712 and MT7622") added MSI support but enable MSI in wrong place, clocks was not enabled when enable MSI. This patch fix this issue by calling mtk_pcie_enable_msi in mtk_pcie_startup_port_v2 since the clock was

[PATCH v8 7/9] PCI: mediatek: Add system PM support for MT2712 and MT7622

2018-10-15 Thread honghui.zhang
From: Honghui Zhang In order to reduce the PCIe power consuming while system suspend, the physical layer should be gated. And the PCIe link should be re-established and the related control register values should be re-initialized after system resume. Register suspend_noirq & resume_noirq

[PATCH v8 6/9] PCI: mediatek: Fixup enable MSI logic by enable MSI after clock enabled

2018-10-15 Thread honghui.zhang
From: Honghui Zhang The commit 43e6409db64d ("PCI: mediatek: Add MSI support for MT2712 and MT7622") added MSI support but enable MSI in wrong place, clocks was not enabled when enable MSI. This patch fix this issue by calling mtk_pcie_enable_msi in mtk_pcie_startup_port_v2 since the clock was

[PATCH v8 2/9] PCI: mediatek: Fix class type for MT7622 as PCI_CLASS_BRIDGE_PCI

2018-10-15 Thread honghui.zhang
From: Honghui Zhang The commit 101c92dc80c8 ("PCI: mediatek: Set up vendor ID and class type for MT7622") have set the class type for MT7622 as un-properly value of PCI_CLASS_BRIDGE_HOST. The PCIe controller of MT7622 is complexed with Root Port and PCI-to-PCI bridge, the bridge has type 1

[PATCH v8 1/9] PCI: mediatek: Using slot's devfn for compare to fix mtk_pcie_find_port logic

2018-10-15 Thread honghui.zhang
From: Honghui Zhang The Mediatek's host controller has two slots, each with it's own control registers. The host driver need to identify which slot was connected in order to access the device's configuration space. There's problem for current host driver to find out which slot was connected to

[PATCH v8 8/9] PCI: mediatek: Save the GIC IRQ in mtk_pcie_port

2018-10-15 Thread honghui.zhang
From: Honghui Zhang Need to save the PCIe's GIC IRQ for dispose_irq, this is a prepare patch for add mediatek PCIe module support to tear down the IRQ, no functional changed. Signed-off-by: Honghui Zhang Acked-by: Ryder Lee --- drivers/pci/controller/pcie-mediatek.c | 9 ++--- 1 file

[PATCH v8 2/9] PCI: mediatek: Fix class type for MT7622 as PCI_CLASS_BRIDGE_PCI

2018-10-15 Thread honghui.zhang
From: Honghui Zhang The commit 101c92dc80c8 ("PCI: mediatek: Set up vendor ID and class type for MT7622") have set the class type for MT7622 as un-properly value of PCI_CLASS_BRIDGE_HOST. The PCIe controller of MT7622 is complexed with Root Port and PCI-to-PCI bridge, the bridge has type 1

[PATCH v8 1/9] PCI: mediatek: Using slot's devfn for compare to fix mtk_pcie_find_port logic

2018-10-15 Thread honghui.zhang
From: Honghui Zhang The Mediatek's host controller has two slots, each with it's own control registers. The host driver need to identify which slot was connected in order to access the device's configuration space. There's problem for current host driver to find out which slot was connected to

[PATCH v8 8/9] PCI: mediatek: Save the GIC IRQ in mtk_pcie_port

2018-10-15 Thread honghui.zhang
From: Honghui Zhang Need to save the PCIe's GIC IRQ for dispose_irq, this is a prepare patch for add mediatek PCIe module support to tear down the IRQ, no functional changed. Signed-off-by: Honghui Zhang Acked-by: Ryder Lee --- drivers/pci/controller/pcie-mediatek.c | 9 ++--- 1 file

[PATCH v8 5/9] PCI: mediatek: Move the mtk_pcie_startup_port_v2 function's define after mtk_pcie_setup_irq

2018-10-15 Thread honghui.zhang
From: Honghui Zhang This is a prepare patch to fix enable MSI logic, move the function's define later to avoid forward declaration of mtk_pcie_enable_msi in the future. No functional changed. Signed-off-by: Honghui Zhang Acked-by: Ryder Lee --- drivers/pci/controller/pcie-mediatek.c | 138

[PATCH v8 5/9] PCI: mediatek: Move the mtk_pcie_startup_port_v2 function's define after mtk_pcie_setup_irq

2018-10-15 Thread honghui.zhang
From: Honghui Zhang This is a prepare patch to fix enable MSI logic, move the function's define later to avoid forward declaration of mtk_pcie_enable_msi in the future. No functional changed. Signed-off-by: Honghui Zhang Acked-by: Ryder Lee --- drivers/pci/controller/pcie-mediatek.c | 138

[PATCH v8 9/9] PCI: mediatek: Add loadable kernel module support

2018-10-15 Thread honghui.zhang
From: Honghui Zhang Implement remove callback function for Mediatek PCIe driver to add loadable kernel module support. Signed-off-by: Honghui Zhang Reviewed-by: Ryder Lee --- drivers/pci/controller/Kconfig | 2 +- drivers/pci/controller/pcie-mediatek.c | 51

[PATCH v8 3/9] PCI: mediatek: Remove the redundant dev->pm_domain check

2018-10-15 Thread honghui.zhang
From: Honghui Zhang It's no needed to check whether device have pm_domain attached before calling the pm_runtime_XXX interface, remove it. Signed-off-by: Honghui Zhang Acked-by: Ryder Lee --- drivers/pci/controller/pcie-mediatek.c | 18 ++ 1 file changed, 6 insertions(+), 12

[PATCH v8 9/9] PCI: mediatek: Add loadable kernel module support

2018-10-15 Thread honghui.zhang
From: Honghui Zhang Implement remove callback function for Mediatek PCIe driver to add loadable kernel module support. Signed-off-by: Honghui Zhang Reviewed-by: Ryder Lee --- drivers/pci/controller/Kconfig | 2 +- drivers/pci/controller/pcie-mediatek.c | 51

[PATCH v8 3/9] PCI: mediatek: Remove the redundant dev->pm_domain check

2018-10-15 Thread honghui.zhang
From: Honghui Zhang It's no needed to check whether device have pm_domain attached before calling the pm_runtime_XXX interface, remove it. Signed-off-by: Honghui Zhang Acked-by: Ryder Lee --- drivers/pci/controller/pcie-mediatek.c | 18 ++ 1 file changed, 6 insertions(+), 12

[PATCH v8 0/9] PCI: mediatek: fixup find_port, enable_msi and add PM, module support

2018-10-15 Thread honghui.zhang
From: Honghui Zhang This patchset includes misc patchs: The patch 1 fixup the mtk_pcie_find_port logic which will cause system could not touch the EP's configuration space that connected to PCIe slot 1. The patch 2 fixup the class type for MT7622. The patch 6 fixup the enable msi logic, the

[PATCH v8 0/9] PCI: mediatek: fixup find_port, enable_msi and add PM, module support

2018-10-15 Thread honghui.zhang
From: Honghui Zhang This patchset includes misc patchs: The patch 1 fixup the mtk_pcie_find_port logic which will cause system could not touch the EP's configuration space that connected to PCIe slot 1. The patch 2 fixup the class type for MT7622. The patch 6 fixup the enable msi logic, the

[PATCH v8 4/9] PCI: mediatek: Convert to use pci_host_probe()

2018-10-15 Thread honghui.zhang
From: Honghui Zhang Part of mtk_pcie_register_host is an open-coded version of pci_host_probe(). So instead of duplicating this code, use pci_host_probe() directly and remove mtk_pcie_register_host. Signed-off-by: Honghui Zhang Acked-by: Ryder Lee --- drivers/pci/controller/pcie-mediatek.c |

[PATCH v8 4/9] PCI: mediatek: Convert to use pci_host_probe()

2018-10-15 Thread honghui.zhang
From: Honghui Zhang Part of mtk_pcie_register_host is an open-coded version of pci_host_probe(). So instead of duplicating this code, use pci_host_probe() directly and remove mtk_pcie_register_host. Signed-off-by: Honghui Zhang Acked-by: Ryder Lee --- drivers/pci/controller/pcie-mediatek.c |

[PATCH v7 6/9] PCI: mediatek: Fixup enable MSI logic by enable MSI after clock enabled

2018-10-14 Thread honghui.zhang
From: Honghui Zhang The commit 43e6409db64d ("PCI: mediatek: Add MSI support for MT2712 and MT7622") added MSI support but enable MSI in wrong place, clocks was not enabled when enable MSI. This patch fix this issue by calling mtk_pcie_enable_msi in mtk_pcie_startup_port_v2 since the clock was

[PATCH v7 3/9] PCI: mediatek: Remove the redundant dev->pm_domain check

2018-10-14 Thread honghui.zhang
From: Honghui Zhang It's no needed to check whether device have pm_domain attached before calling the pm_runtime_XXX interface, remove it. Signed-off-by: Honghui Zhang --- drivers/pci/controller/pcie-mediatek.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff

[PATCH v7 6/9] PCI: mediatek: Fixup enable MSI logic by enable MSI after clock enabled

2018-10-14 Thread honghui.zhang
From: Honghui Zhang The commit 43e6409db64d ("PCI: mediatek: Add MSI support for MT2712 and MT7622") added MSI support but enable MSI in wrong place, clocks was not enabled when enable MSI. This patch fix this issue by calling mtk_pcie_enable_msi in mtk_pcie_startup_port_v2 since the clock was

[PATCH v7 3/9] PCI: mediatek: Remove the redundant dev->pm_domain check

2018-10-14 Thread honghui.zhang
From: Honghui Zhang It's no needed to check whether device have pm_domain attached before calling the pm_runtime_XXX interface, remove it. Signed-off-by: Honghui Zhang --- drivers/pci/controller/pcie-mediatek.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff

[PATCH v7 8/9] PCI: mediatek: Save the GIC IRQ in mtk_pcie_port

2018-10-14 Thread honghui.zhang
From: Honghui Zhang Need to save the PCIe's GIC IRQ for dispose_irq, this is a prepare patch for add mediatek PCIe module support to tear down the IRQ, no functional changed. Signed-off-by: Honghui Zhang --- drivers/pci/controller/pcie-mediatek.c | 9 ++--- 1 file changed, 6

[PATCH v7 8/9] PCI: mediatek: Save the GIC IRQ in mtk_pcie_port

2018-10-14 Thread honghui.zhang
From: Honghui Zhang Need to save the PCIe's GIC IRQ for dispose_irq, this is a prepare patch for add mediatek PCIe module support to tear down the IRQ, no functional changed. Signed-off-by: Honghui Zhang --- drivers/pci/controller/pcie-mediatek.c | 9 ++--- 1 file changed, 6

[PATCH v7 5/9] PCI: mediatek: Move the mtk_pcie_startup_port_v2 function's define after mtk_pcie_setup_irq

2018-10-14 Thread honghui.zhang
From: Honghui Zhang This is a prepare patch to fix enable MSI logic, move the function's define later to avoid forward declaration of mtk_pcie_enable_msi in the future. No functional changed. Signed-off-by: Honghui Zhang --- drivers/pci/controller/pcie-mediatek.c | 138

[PATCH v7 2/9] PCI: mediatek: Fix class type for MT7622 as PCI_CLASS_BRIDGE_PCI

2018-10-14 Thread honghui.zhang
From: Honghui Zhang The commit 101c92dc80c8 ("PCI: mediatek: Set up vendor ID and class type for MT7622") have set the class type for MT7622 as un-properly value of PCI_CLASS_BRIDGE_HOST. The PCIe controller of MT7622 is complexed with Root Port and PCI-to-PCI bridge, the bridge has type 1

[PATCH v7 9/9] PCI: mediatek: Add loadable kernel module support

2018-10-14 Thread honghui.zhang
From: Honghui Zhang Implement remove callback function for Mediatek PCIe driver to add loadable kernel module support. Signed-off-by: Honghui Zhang Reviewed-by: Ryder Lee --- drivers/pci/controller/Kconfig | 2 +- drivers/pci/controller/pcie-mediatek.c | 51

[PATCH v7 5/9] PCI: mediatek: Move the mtk_pcie_startup_port_v2 function's define after mtk_pcie_setup_irq

2018-10-14 Thread honghui.zhang
From: Honghui Zhang This is a prepare patch to fix enable MSI logic, move the function's define later to avoid forward declaration of mtk_pcie_enable_msi in the future. No functional changed. Signed-off-by: Honghui Zhang --- drivers/pci/controller/pcie-mediatek.c | 138

[PATCH v7 2/9] PCI: mediatek: Fix class type for MT7622 as PCI_CLASS_BRIDGE_PCI

2018-10-14 Thread honghui.zhang
From: Honghui Zhang The commit 101c92dc80c8 ("PCI: mediatek: Set up vendor ID and class type for MT7622") have set the class type for MT7622 as un-properly value of PCI_CLASS_BRIDGE_HOST. The PCIe controller of MT7622 is complexed with Root Port and PCI-to-PCI bridge, the bridge has type 1

[PATCH v7 9/9] PCI: mediatek: Add loadable kernel module support

2018-10-14 Thread honghui.zhang
From: Honghui Zhang Implement remove callback function for Mediatek PCIe driver to add loadable kernel module support. Signed-off-by: Honghui Zhang Reviewed-by: Ryder Lee --- drivers/pci/controller/Kconfig | 2 +- drivers/pci/controller/pcie-mediatek.c | 51

[PATCH v7 1/9] PCI: mediatek: Using slot's devfn for compare to fix mtk_pcie_find_port logic

2018-10-14 Thread honghui.zhang
From: Honghui Zhang The Mediatek's host controller has two slots, each with it's own control registers. The host driver need to identify which slot was connected in order to access the device's configuration space. There's problem for current host driver to find out which slot was connected to

[PATCH v7 1/9] PCI: mediatek: Using slot's devfn for compare to fix mtk_pcie_find_port logic

2018-10-14 Thread honghui.zhang
From: Honghui Zhang The Mediatek's host controller has two slots, each with it's own control registers. The host driver need to identify which slot was connected in order to access the device's configuration space. There's problem for current host driver to find out which slot was connected to

[PATCH v7 7/9] PCI: mediatek: Add system PM support for MT2712 and MT7622

2018-10-14 Thread honghui.zhang
From: Honghui Zhang In order to reduce the PCIe power consuming while system suspend, the physical layer should be gated. And the PCIe link should be re-established and the related control register values should be re-initialized after system resume. Register suspend_noirq & resume_noirq

[PATCH v7 0/9] PCI: mediatek: fixup find_port, enable_msi and add PM, module support

2018-10-14 Thread honghui.zhang
From: Honghui Zhang This patchset includes misc patchs: The patch 1 fixup the mtk_pcie_find_port logic which will cause system could not touch the EP's configuration space that connected to PCIe slot 1. The patch 2 fixup the class type for MT7622. The patch 6 fixup the enable msi logic, the

[PATCH v7 4/9] PCI: mediatek: Convert to use pci_host_probe()

2018-10-14 Thread honghui.zhang
From: Honghui Zhang Part of mtk_pcie_register_host is an open-coded version of pci_host_probe(). So instead of duplicating this code, use pci_host_probe() directly and remove mtk_pcie_register_host. Signed-off-by: Honghui Zhang --- drivers/pci/controller/pcie-mediatek.c | 37

[PATCH v7 7/9] PCI: mediatek: Add system PM support for MT2712 and MT7622

2018-10-14 Thread honghui.zhang
From: Honghui Zhang In order to reduce the PCIe power consuming while system suspend, the physical layer should be gated. And the PCIe link should be re-established and the related control register values should be re-initialized after system resume. Register suspend_noirq & resume_noirq

[PATCH v7 0/9] PCI: mediatek: fixup find_port, enable_msi and add PM, module support

2018-10-14 Thread honghui.zhang
From: Honghui Zhang This patchset includes misc patchs: The patch 1 fixup the mtk_pcie_find_port logic which will cause system could not touch the EP's configuration space that connected to PCIe slot 1. The patch 2 fixup the class type for MT7622. The patch 6 fixup the enable msi logic, the

[PATCH v7 4/9] PCI: mediatek: Convert to use pci_host_probe()

2018-10-14 Thread honghui.zhang
From: Honghui Zhang Part of mtk_pcie_register_host is an open-coded version of pci_host_probe(). So instead of duplicating this code, use pci_host_probe() directly and remove mtk_pcie_register_host. Signed-off-by: Honghui Zhang --- drivers/pci/controller/pcie-mediatek.c | 37

[PATCH v6 9/9] PCI: mediatek: Add loadable kernel module support

2018-10-07 Thread honghui.zhang
From: Honghui Zhang Implement remove callback function for Mediatek PCIe driver to add loadable kernel module support. Signed-off-by: Honghui Zhang Reviewed-by: Ryder Lee --- drivers/pci/controller/Kconfig | 2 +- drivers/pci/controller/pcie-mediatek.c | 52

[PATCH v6 2/9] PCI: mediatek: Fixup class ID for MT7622 as PCI_CLASS_BRIDGE_PCI

2018-10-07 Thread honghui.zhang
From: Honghui Zhang The PCIe controller of MT7622 has TYPE 1 configuration space type, but the HW default class type values is invalid. The commit 101c92dc80c8 ("PCI: mediatek: Set up vendor ID and class type for MT7622") have set the class ID for MT7622 as PCI_CLASS_BRIDGE_HOST, but it's not

[PATCH v6 9/9] PCI: mediatek: Add loadable kernel module support

2018-10-07 Thread honghui.zhang
From: Honghui Zhang Implement remove callback function for Mediatek PCIe driver to add loadable kernel module support. Signed-off-by: Honghui Zhang Reviewed-by: Ryder Lee --- drivers/pci/controller/Kconfig | 2 +- drivers/pci/controller/pcie-mediatek.c | 52

[PATCH v6 2/9] PCI: mediatek: Fixup class ID for MT7622 as PCI_CLASS_BRIDGE_PCI

2018-10-07 Thread honghui.zhang
From: Honghui Zhang The PCIe controller of MT7622 has TYPE 1 configuration space type, but the HW default class type values is invalid. The commit 101c92dc80c8 ("PCI: mediatek: Set up vendor ID and class type for MT7622") have set the class ID for MT7622 as PCI_CLASS_BRIDGE_HOST, but it's not

[PATCH v6 7/9] PCI: mediatek: Add system pm support for MT2712 and MT7622

2018-10-07 Thread honghui.zhang
From: Honghui Zhang In order to reduce the PCIe power consuming while system suspend, the physical layer should be gated. And the PCIe link should be re-established and the related control register values should be re-initialized after system resume. Register suspend_noirq & resume_noirq

[PATCH v6 3/9] PCI: mediatek: Remove the redundant dev->pm_domain check

2018-10-07 Thread honghui.zhang
From: Honghui Zhang It's no needed to check whether device have pm_domain attached before calling the pm_runtime_XXX interface, remove it. Signed-off-by: Honghui Zhang Acked-by: Ryder Lee --- drivers/pci/controller/pcie-mediatek.c | 18 ++ 1 file changed, 6 insertions(+), 12

[PATCH v6 4/9] PCI: mediatek: Convert to use pci_host_probe()

2018-10-07 Thread honghui.zhang
From: Honghui Zhang Part of mtk_pcie_register_host is an open-coded version of pci_host_probe(). So instead of duplicating this code, use pci_host_probe() directly and remove mtk_pcie_register_host. Signed-off-by: Honghui Zhang Acked-by: Ryder Lee --- drivers/pci/controller/pcie-mediatek.c |

[PATCH v6 3/9] PCI: mediatek: Remove the redundant dev->pm_domain check

2018-10-07 Thread honghui.zhang
From: Honghui Zhang It's no needed to check whether device have pm_domain attached before calling the pm_runtime_XXX interface, remove it. Signed-off-by: Honghui Zhang Acked-by: Ryder Lee --- drivers/pci/controller/pcie-mediatek.c | 18 ++ 1 file changed, 6 insertions(+), 12

[PATCH v6 4/9] PCI: mediatek: Convert to use pci_host_probe()

2018-10-07 Thread honghui.zhang
From: Honghui Zhang Part of mtk_pcie_register_host is an open-coded version of pci_host_probe(). So instead of duplicating this code, use pci_host_probe() directly and remove mtk_pcie_register_host. Signed-off-by: Honghui Zhang Acked-by: Ryder Lee --- drivers/pci/controller/pcie-mediatek.c |

[PATCH v6 7/9] PCI: mediatek: Add system pm support for MT2712 and MT7622

2018-10-07 Thread honghui.zhang
From: Honghui Zhang In order to reduce the PCIe power consuming while system suspend, the physical layer should be gated. And the PCIe link should be re-established and the related control register values should be re-initialized after system resume. Register suspend_noirq & resume_noirq

[PATCH v6 8/9] PCI: mediatek: Save the GIC IRQ in mtk_pcie_port

2018-10-07 Thread honghui.zhang
From: Honghui Zhang Need to save the PCIe's GIC IRQ for dispose_irq, this is a prepare patch for add mediatek PCIe module support to tear down the IRQ, no functional changed. Signed-off-by: Honghui Zhang Acked-by: Ryder Lee --- drivers/pci/controller/pcie-mediatek.c | 9 ++--- 1 file

[PATCH v6 8/9] PCI: mediatek: Save the GIC IRQ in mtk_pcie_port

2018-10-07 Thread honghui.zhang
From: Honghui Zhang Need to save the PCIe's GIC IRQ for dispose_irq, this is a prepare patch for add mediatek PCIe module support to tear down the IRQ, no functional changed. Signed-off-by: Honghui Zhang Acked-by: Ryder Lee --- drivers/pci/controller/pcie-mediatek.c | 9 ++--- 1 file

[PATCH v6 5/9] PCI: mediatek: Move the mtk_pcie_startup_port_v2 function's define after mtk_pcie_setup_irq

2018-10-07 Thread honghui.zhang
From: Honghui Zhang This is a prepare patch to fix enable MSI logic, move the function's define later to avoid forward declaration of mtk_pcie_enable_msi in the future. No functional changed. Signed-off-by: Honghui Zhang Acked-by: Ryder Lee --- drivers/pci/controller/pcie-mediatek.c | 138

[PATCH v6 1/9] PCI: mediatek: Using slot's devfn for compare to fix mtk_pcie_find_port logic

2018-10-07 Thread honghui.zhang
From: Honghui Zhang The Mediatek's host controller has two slots, each with it's own control registers. The host driver need to identify which slot was connected in order to access the device's configuration space. There's problem for current host driver to find out which slot was connected to

[PATCH v6 6/9] PCI: mediatek: Fixup enable msi logic by enable msi after clock enabled

2018-10-07 Thread honghui.zhang
From: Honghui Zhang The commit 43e6409db64d ("PCI: mediatek: Add MSI support for MT2712 and MT7622") added MSI support but enable MSI in wrong place, clocks was not enabled when enable MSI. This patch fix this issue by calling mtk_pcie_enable_msi in mtk_pcie_startup_port_v2 since the clock was

[PATCH v6 0/9] PCI: mediatek: fixup find_port, enable_msi and add pm, module support

2018-10-07 Thread honghui.zhang
From: Honghui Zhang This patchset includes misc patchs: The patch 1 fixup the mtk_pcie_find_port logic which will cause system could not touch the EP's configuration space that connected to PCIe slot 1. The patch 2 fixup the class type for MT7622. The patch 6 fixup the enable msi logic, the

[PATCH v6 5/9] PCI: mediatek: Move the mtk_pcie_startup_port_v2 function's define after mtk_pcie_setup_irq

2018-10-07 Thread honghui.zhang
From: Honghui Zhang This is a prepare patch to fix enable MSI logic, move the function's define later to avoid forward declaration of mtk_pcie_enable_msi in the future. No functional changed. Signed-off-by: Honghui Zhang Acked-by: Ryder Lee --- drivers/pci/controller/pcie-mediatek.c | 138

[PATCH v6 1/9] PCI: mediatek: Using slot's devfn for compare to fix mtk_pcie_find_port logic

2018-10-07 Thread honghui.zhang
From: Honghui Zhang The Mediatek's host controller has two slots, each with it's own control registers. The host driver need to identify which slot was connected in order to access the device's configuration space. There's problem for current host driver to find out which slot was connected to

[PATCH v6 6/9] PCI: mediatek: Fixup enable msi logic by enable msi after clock enabled

2018-10-07 Thread honghui.zhang
From: Honghui Zhang The commit 43e6409db64d ("PCI: mediatek: Add MSI support for MT2712 and MT7622") added MSI support but enable MSI in wrong place, clocks was not enabled when enable MSI. This patch fix this issue by calling mtk_pcie_enable_msi in mtk_pcie_startup_port_v2 since the clock was

  1   2   3   4   >