[PATCH v2 0/2] PCI: mediatek: Fixups for the IRQ handle routine and MT7622's class code

2017-12-20 Thread honghui.zhang
From: Honghui Zhang Two fixups for mediatek's host bridge: The first patch fixup the IRQ handle routine to avoid IRQ reentry which may exist for both MT2712 and MT7622. The second patch fixup class type for MT7622. Change Since v1: - Add the second patch. - Make

[PATCH v2 1/2] PCI: mediatek: Clear IRQ status after IRQ dispatched to avoid reentry

2017-12-20 Thread honghui.zhang
From: Honghui Zhang There maybe a same IRQ reentry scenario after IRQ received in current IRQ handle flow: EP device PCIe host driverEP driver 1. issue an IRQ 2. received IRQ 3. clear IRQ

[PATCH v2 2/2] PCI: mediatek: Fixup class type for MT7622

2017-12-20 Thread honghui.zhang
From: Honghui Zhang The host bridge of MT7622 has hardware code the class code to an arbitrary, meaningless value, fix that. Signed-off-by: Honghui Zhang --- drivers/pci/host/pcie-mediatek.c | 12 1 file changed, 12

[PATCH v3 4/4] arm: dts: mediatek: add larbid property for larb

2017-08-03 Thread honghui.zhang
From: Honghui Zhang Add mediatek's hardware id information for smi larb. Signed-off-by: Honghui Zhang --- arch/arm/boot/dts/mt2701.dtsi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/boot/dts/mt2701.dtsi

[PATCH v3 3/4] dt-bindings: mediatek: add descriptions for larbid

2017-08-03 Thread honghui.zhang
From: Honghui Zhang This patch add larbid descritptions for mediatek's gen1 smi larb hardware. Acked-by: Rob Herring Signed-off-by: Honghui Zhang --- .../bindings/memory-controllers/mediatek,smi-larb.txt | 15

[PATCH v3 1/4] memory: mtk-smi: Use of_device_get_match_data helper

2017-08-03 Thread honghui.zhang
From: Honghui Zhang Replace custom code with generic helper to retrieve driver data. Signed-off-by: Honghui Zhang --- drivers/memory/mtk-smi.c | 14 ++ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git

[PATCH v3 0/4] Add larbid init routine for mediatek's gen1 smi larb driver

2017-08-03 Thread honghui.zhang
From: Honghui Zhang Mediatek's gen1 smi need the hardware larb-id to identify the offset for the register which controls whether enable iommu for this larb. In the commit 3c8f4ad85c4b ("memory/mediatek: add support for mt2701"), the larbid was used without properly

[PATCH v2 3/3] arm: dts: mediatek: add larbid property for larb

2017-07-28 Thread honghui.zhang
From: Honghui Zhang Add mediatek's hardware id information for smi larb. Signed-off-by: Honghui Zhang --- arch/arm/boot/dts/mt2701.dtsi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/boot/dts/mt2701.dtsi

[PATCH v2 2/3] dt-bindings: mediatek: add descriptions for larbid

2017-07-28 Thread honghui.zhang
From: Honghui Zhang This patch add larbid descritptions for mediatek's gen1 smi larb hardware. Signed-off-by: Honghui Zhang --- .../bindings/memory-controllers/mediatek,smi-larb.txt | 15 +++ 1 file changed, 15

[PATCH v2 1/3] memory: mtk-smi: add larbid handle routine

2017-07-28 Thread honghui.zhang
From: Honghui Zhang In the commit 3c8f4ad85c4b ("memory/mediatek: add support for mt2701"), the larb->larbid was added but not initialized. Mediatek's gen1 smi need this hardware larbid information to get the register offset which controls whether enable iommu for

[PATCH 3/3] arm: dts: mediatek: add larbid property for larb

2017-07-26 Thread honghui.zhang
From: Honghui Zhang Add mediatek's hardware id information for smi larb. Signed-off-by: Honghui Zhang --- arch/arm/boot/dts/mt2701.dtsi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/boot/dts/mt2701.dtsi

[PATCH 1/3] memory: mtk-smi: add larbid init routine

2017-07-26 Thread honghui.zhang
From: Honghui Zhang In the commit 3c8f4ad85c4b ("memory/mediatek: add support for mt2701"), the larb->larbid was added but not initialized. Mediatek's gen1 smi need this hardware larbid information to get the register offset which controls whether enable iommu for

[PATCH 0/3] Add larbid init routine for mediatek's gen1 smi larb driver

2017-07-26 Thread honghui.zhang
From: Honghui Zhang Mediatek's gen1 smi need the hardware larbid to identify the offset for the register which controls whether enable iommu for this larb. In the commit 3c8f4ad85c4b ("memory/mediatek: add support for mt2701"), the larbid was used without properly

[PATCH 2/3] dt-bindings: mediatek: add descriptions for larbid

2017-07-26 Thread honghui.zhang
From: Honghui Zhang This patch add larbid descritptions for mediatek's gen1 smi larb hardware. Signed-off-by: Honghui Zhang --- .../bindings/memory-controllers/mediatek,smi-larb.txt | 15 +++ 1 file changed, 15

[PATCH v2] memory: mtk-smi: Use of_device_get_match_data helper

2017-07-26 Thread honghui.zhang
From: Honghui Zhang Replace custom code with generic helper to retrieve driver data. Signed-off-by: Honghui Zhang --- drivers/memory/mtk-smi.c | 14 ++ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git

[PATCH] memory: mtk-smi: Use of_device_get_match_data helper

2017-07-26 Thread honghui.zhang
From: Honghui Zhang Replace custom code with generic helper to retrieve driver data. Signed-off-by: Honghui Zhang --- drivers/memory/mtk-smi.c | 18 -- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git

[PATCH] memory: mtk-smi: Use of_device_get_match_data helper

2017-07-26 Thread honghui.zhang
From: Honghui Zhang Replace custom code with generic helper to retrieve driver data. Signed-off-by: Honghui Zhang --- drivers/memory/mtk-smi.c | 14 ++ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git

[PATCH] dt-binding: correct the larb port offset defines for mt2701

2016-08-11 Thread honghui.zhang
From: Honghui Zhang larb2 have 23 ports, the LARB3_PORT_OFFSET should be LARB2_PORT_OFFSET plus larb2's port number, it should be 44 instead of 43. Signed-off-by: Honghui Zhang --- include/dt-bindings/memory/mt2701-larb-port.h | 2 +- 1

[RFC PATCH] iommu: create direct_mapping after device attached

2016-07-20 Thread honghui.zhang
From: Honghui Zhang For mtk iommu, the domain_finalize was called in device attatch, the mtk iommu iopgt ops was allocated and initialized in domain_finalize, the iommu_group_create_direct_mappings would call the map interface to implement the map. If it's earlier

[PATCH v4 2/5] iommu/mediatek: move the common struct into header file

2016-06-08 Thread honghui.zhang
From: Honghui Zhang Move the struct defines of mtk iommu into a new header files for common use. Signed-off-by: Honghui Zhang --- drivers/iommu/mtk_iommu.c | 48 + drivers/iommu/mtk_iommu.h | 77

[PATCH v4 1/5] dt-bindings: mediatek: add descriptions for mediatek mt2701 iommu and smi

2016-06-08 Thread honghui.zhang
From: Honghui Zhang This patch defines the local arbitor port IDs for mediatek SoC MT2701 and add descriptions of binding for mediatek generation one iommu and smi. Signed-off-by: Honghui Zhang Acked-by: Rob Herring ---

[PATCH v4 0/5] MT2701 iommu support

2016-06-08 Thread honghui.zhang
From: Honghui Zhang Mediatek's m4u(Multimedia Memory Management Unit) and SMI(Smart Multimedia Interface)have two generations HW. They basically sharing the same hardware block diagram, but have some difference as below: Generation one m4u only supports one

[PATCH v4 4/5] iommu/mediatek: add support for mtk iommu generation one HW

2016-06-08 Thread honghui.zhang
From: Honghui Zhang Mediatek SoC's M4U has two generations of HW architcture. Generation one uses flat, one layer pagetable, and was shipped with ARM architecture, it only supports 4K size page mapping. MT2701 SoC uses this generation one m4u HW. Generation two uses

[PATCH v4 3/5] memory/mediatek: add support for mt2701

2016-06-08 Thread honghui.zhang
From: Honghui Zhang Mediatek SMI has two generations of HW architecture, mt8173 uses the second generation of SMI HW while mt2701 uses the first generation HW of SMI. There's slight differences between the two generations, for generation 2, the register which control

[PATCH] iommu/mediatek: Do not call of_node_put in mtk_iommu_of_xlate

2016-06-08 Thread honghui.zhang
From: Honghui Zhang The device_node will be released in of_iommu_configure, it may be double released if call of_node_put in mtk_iommu_of_xlate. Signed-off-by: Honghui Zhang --- drivers/iommu/mtk_iommu.c | 1 - 1 file changed, 1

[PATCH v3 0/5] MT2701 iommu support

2016-05-27 Thread honghui.zhang
From: Honghui Zhang Mediatek's m4u(Multimedia Memory Management Unit) and SMI(Smart Multimedia Interface)have two generations HW. They basically sharing the same hardware block diagram, but have some difference as below: Generation one m4u only supports one

[PATCH v3 3/5] memory/mediatek: add support for mt2701

2016-05-27 Thread honghui.zhang
From: Honghui Zhang Mediatek SMI has two generations of HW architecture, mt8173 uses the second generation of SMI HW while mt2701 uses the first generation HW of SMI. There's slight differences between the two generations, for generation 2, the register which control

[PATCH v3 4/5] iommu/mediatek: add support for mtk iommu generation one HW

2016-05-27 Thread honghui.zhang
From: Honghui Zhang Mediatek SoC's M4U has two generations of HW architcture. Generation one uses flat, one layer pagetable, and was shipped with ARM architecture, it only supports 4K size page mapping. MT2701 SoC uses this generation one m4u HW. Generation two uses

[PATCH v3 1/5] dt-bindings: mediatek: add descriptions for mediatek mt2701 iommu and smi

2016-05-27 Thread honghui.zhang
From: Honghui Zhang This patch defines the local arbitor port IDs for mediatek SoC MT2701 and add descriptions of binding for mediatek generation one iommu and smi. Signed-off-by: Honghui Zhang Acked-by: Rob Herring ---

[PATCH v3 5/5] ARM: dts: mt2701: add iommu/smi dtsi node for mt2701

2016-05-27 Thread honghui.zhang
From: Honghui Zhang Add the dtsi node of iommu and smi for mt2701. Signed-off-by: Honghui Zhang --- arch/arm/boot/dts/mt2701.dtsi | 51 +++ 1 file changed, 51 insertions(+) diff --git

[PATCH v3 2/5] iommu/mediatek: move the common struct into header file

2016-05-27 Thread honghui.zhang
From: Honghui Zhang Move the struct defines of mtk iommu into a new header files for common use. Signed-off-by: Honghui Zhang --- drivers/iommu/mtk_iommu.c | 48 + drivers/iommu/mtk_iommu.h | 77

[PATCH v2 2/5] iommu/mediatek: move the common struct into header file

2016-05-19 Thread honghui.zhang
From: Honghui Zhang Move the struct defines of mtk iommu into a new header files for common use. Signed-off-by: Honghui Zhang --- drivers/iommu/mtk_iommu.c | 62 +--- drivers/iommu/mtk_iommu.h | 90

[PATCH 5/5] ARM: dts: mt2701: add iommu/smi dtsi node for mt2701

2016-05-19 Thread honghui.zhang
From: Honghui Zhang Add the dtsi node of iommu and smi for mt2701. Signed-off-by: Honghui Zhang --- arch/arm/boot/dts/mt2701.dtsi | 51 +++ 1 file changed, 51 insertions(+) diff --git

[PATCH v2 0/5] MT2701 iommu support

2016-05-19 Thread honghui.zhang
From: Honghui Zhang Mediatek's m4u(Multimedia Memory Management Unit) and SMI(Smart Multimedia Interface)have two generations HW. They basically sharing the same hardware block diagram, but have some difference as below: Generation one m4u only supports one

[PATCH v2 4/5] iommu/mediatek: add support for mtk iommu generation one HW

2016-05-19 Thread honghui.zhang
From: Honghui Zhang Mediatek SoC's M4U has two generations of HW architcture. Generation one uses flat, one layer pagetable, and was shipped with ARM architecture, it only supports 4K size page mapping. MT2701 SoC uses this generation one m4u HW. Generation two uses

[PATCH v2 1/5] dt-bindings: mediatek: add descriptions for mediatek mt2701 iommu and smi

2016-05-19 Thread honghui.zhang
From: Honghui Zhang This patch defines the local arbitor port IDs for mediatek SoC MT2701 and add descriptions of binding for mediatek generation one iommu and smi. Signed-off-by: Honghui Zhang ---

[PATCH v2 3/5] memory/mediatek: add support for mt2701

2016-05-19 Thread honghui.zhang
From: Honghui Zhang Mediatek SMI has two generations of HW architecture, mt8173 uses the second generation of SMI HW while mt2701 uses the first generation HW of SMI. There's slight differences between the two generations, for generation 2, the register which control

[PATCH 4/5] iommu/mediatek: add support for mtk iommu generation one HW

2016-05-09 Thread honghui.zhang
From: Honghui Zhang Mediatek SoC's M4U have two generations of HW architcture. Generation one use flat, one layer pagetable, and was shipped with ARM architecture, it only support 4K size page mapping. MT2701 SoC use this generation one m4u HW. Generation two uses the

[PATCH 2/5] iommu/mediatek: move the common struct into header file

2016-05-09 Thread honghui.zhang
From: Honghui Zhang Move the struct defines of mtk iommu into a new header files for common use. Signed-off-by: Honghui Zhang --- drivers/iommu/mtk_iommu.c | 62 +--- drivers/iommu/mtk_iommu.h | 90

[PATCH 0/5] MT2701 iommu support

2016-05-09 Thread honghui.zhang
From: Honghui Zhang Mediatek's m4u(Multimedia Memory Management Unit) and SMI(Smart Multimedia Interface)have two generations HW. They basically sharing the same hardware block diagram, but have some difference as below: Generation one m4u only support one layer,

[PATCH 5/5] ARM: dts: mt2701: add iommu/smi dtsi node for mt2701

2016-05-09 Thread honghui.zhang
From: Honghui Zhang Add the dtsi node of iommu and smi for mt2701. Signed-off-by: Honghui Zhang --- arch/arm/boot/dts/mt2701.dtsi | 51 +++ 1 file changed, 51 insertions(+) diff --git

[PATCH 3/5] memory/mediatek: add support for mt2701

2016-05-09 Thread honghui.zhang
From: Honghui Zhang Mediatek SMI have two generation HW architecture, mt8173 use the secondary generation of SMI HW while mt2701 use the first generation HW of SMI. There's slight differences between the two generation, for generation 2, the register which control

[PATCH 1/5] dt-bindings: mediatek: add descriptions for mediatek mt2701 iommu and smi

2016-05-09 Thread honghui.zhang
From: Honghui Zhang This patch defines the local arbitor port IDs for mediatek SoC MT2701 and add descriptions of binding for mediatek generation one iommu and smi. Signed-off-by: Honghui Zhang ---