[PATCH v10 02/23] iommu/mediatek: Use a struct as the platform data

2019-08-21 Thread Yong Wu
Use a struct as the platform special data instead of the enumeration. This is a prepare patch for adding mt8183 iommu support. Signed-off-by: Yong Wu Reviewed-by: Matthias Brugger Reviewed-by: Evan Green --- drivers/iommu/mtk_iommu.c | 24 drivers/iommu/mtk_iommu.h

[PATCH v10 03/23] memory: mtk-smi: Use a general config_port interface

2019-08-21 Thread Yong Wu
mt8183, IPU0/1 and CCU connect with smi-common directly, they also are not the normal larb. Hence, we add a "larb_direct_to_common_mask" for these larbs which connect to smi-commmon directly. This is also a preparing patch for adding mt8183 SMI support. Signed-off-by: Yong Wu Reviewed-by

[PATCH v10 04/23] memory: mtk-smi: Use a struct for the platform data for smi-common

2019-08-21 Thread Yong Wu
8183. Signed-off-by: Yong Wu Reviewed-by: Matthias Brugger Reviewed-by: Evan Green --- drivers/memory/mtk-smi.c | 35 --- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c index 14f70cf..47df7d0

[PATCH v10 06/23] iommu/io-pgtable-arm-v7s: Add paddr_to_iopte and iopte_to_paddr helpers

2019-08-21 Thread Yong Wu
Add two helper functions: paddr_to_iopte and iopte_to_paddr. Signed-off-by: Yong Wu Reviewed-by: Robin Murphy Reviewed-by: Evan Green --- drivers/iommu/io-pgtable-arm-v7s.c | 45 -- 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/drivers

[PATCH v10 05/23] iommu/mediatek: Fix iova_to_phys PA start for 4GB mode

2019-08-21 Thread Yong Wu
: 30e2fccf9512 ("iommu/mediatek: Enlarge the validate PA range for 4GB mode") Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 26 +- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index c6e

[PATCH v10 07/23] iommu/io-pgtable-arm-v7s: Use ias/oas to check the valid iova/pa

2019-08-21 Thread Yong Wu
Use ias/oas to check the valid iova/pa. Synchronize this checking with io-pgtable-arm.c. Signed-off-by: Yong Wu --- drivers/iommu/io-pgtable-arm-v7s.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/io-pgtable-arm-v7s.c b/drivers/iommu/io-pgtable-arm-v7s.c

[PATCH v10 08/23] iommu/io-pgtable-arm-v7s: Rename the quirk from MTK_4GB to MTK_EXT

2019-08-21 Thread Yong Wu
In previous mt2712/mt8173, MediaTek extend the v7s to support 4GB dram. But in the latest mt8183, We extend it to support the PA up to 34bit. Then the "MTK_4GB" name is not so fit, This patch only change the quirk name to "MTK_EXT". Signed-off-by: Yong Wu --- drivers/iommu/

[PATCH v10 10/23] iommu/mediatek: Adjust the PA for the 4GB Mode

2019-08-21 Thread Yong Wu
ted our case. Both mt2712 and mt8173 support this "4GB mode" while the mt8183 don't. The PA in mt8183 won't remap. Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 26 -- drivers/iommu/mtk_iommu.h | 1 + 2 files changed, 17 insertions(+), 10 d

[PATCH v10 09/23] iommu/io-pgtable-arm-v7s: Extend to support PA[33:32] for MediaTek

2019-08-21 Thread Yong Wu
don't, thus keep it as is. Signed-off-by: Yong Wu --- drivers/iommu/io-pgtable-arm-v7s.c | 32 +--- include/linux/io-pgtable.h | 7 +++ 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/drivers/iommu/io-pgtable-arm-v7s.c b/drivers/iom

[PATCH v10 11/23] iommu/mediatek: Add bclk can be supported optionally

2019-08-21 Thread Yong Wu
In some SoCs, M4U doesn't have its "bclk", it will use the EMI clock instead which has always been enabled when entering kernel. Currently mt2712 and mt8173 have this bclk while mt8183 doesn't. This also is a preparing patch for mt8183. Signed-off-by: Yong Wu Reviewed-by:

[PATCH v10 12/23] iommu/mediatek: Add larb-id remapped support

2019-08-21 Thread Yong Wu
his also is a preparing patch for mt8183. Signed-off-by: Yong Wu Reviewed-by: Nicolas Boichat Reviewed-by: Evan Green Reviewed-by: Matthias Brugger --- drivers/iommu/mtk_iommu.c | 4 drivers/iommu/mtk_iommu.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/drivers/iommu/mtk_iommu.c b/

[PATCH v10 13/23] iommu/mediatek: Refine protect memory definition

2019-08-21 Thread Yong Wu
-off-by: Yong Wu Reviewed-by: Evan Green Reviewed-by: Matthias Brugger --- drivers/iommu/mtk_iommu.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 34f0203..947a8c6b8 100644 --- a/drivers/iommu

[PATCH v10 15/23] iommu/mediatek: Move vld_pa_rng into plat_data

2019-08-21 Thread Yong Wu
Both mt8173 and mt8183 don't have this vld_pa_rng(valid physical address range) register while mt2712 have. Move it into the plat_data. Signed-off-by: Yong Wu Reviewed-by: Evan Green Reviewed-by: Matthias Brugger --- drivers/iommu/mtk_iommu.c | 3 ++- drivers/iommu/mtk_iommu.h | 1 + 2

[PATCH v10 14/23] iommu/mediatek: Move reset_axi into plat_data

2019-08-21 Thread Yong Wu
In mt8173 and mt8183, 0x48 is REG_MMU_STANDARD_AXI_MODE while it is REG_MMU_CTRL in the other SoCs, and the bits meaning is completely different with the REG_MMU_STANDARD_AXI_MODE. This patch moves this property to plat_data, it's also a preparing patch for mt8183. Signed-off-by: Yo

[PATCH v10 16/23] memory: mtk-smi: Add gals support

2019-08-21 Thread Yong Wu
above, we add "gals0" and "gals1" clocks for smi-common and add a "gals" clock for smi-larb. This patch adds gals clock supporting in the SMI. Note that some larbs may still don't have the "gals" clock like larb1 and larb4 above. This is also a pre

[PATCH v10 17/23] iommu/mediatek: Add mt8183 IOMMU support

2019-08-21 Thread Yong Wu
dard ttbr0[1] means the S bit which is enabled defaultly, Hence, we add a mask. 5) mt8183 HW has a GALS modules, SMI should enable "has_gals" support. 6) mt8183 need reset_axi like mt8173. 7) the larb-id in smi-common is remapped. M4U should add its larbid_remap. Signed-off-by: Yong Wu R

[PATCH v10 18/23] iommu/mediatek: Add mmu1 support

2019-08-21 Thread Yong Wu
hat register is 0 which means all the larbs go to mmu0 defaultly. This is a preparing patch for adjusting SMI_BUS_SEL for mt8183. Signed-off-by: Yong Wu Reviewed-by: Evan Green Reviewed-by: Matthias Brugger --- drivers/iommu/mtk_iommu.c | 46 +- 1 f

[PATCH v10 21/23] iommu/mediatek: Fix VLD_PA_RNG register backup when suspend

2019-08-21 Thread Yong Wu
The register VLD_PA_RNG(0x118) was forgot to backup while adding 4GB mode support for mt2712. this patch add it. Fixes: 30e2fccf9512 ("iommu/mediatek: Enlarge the validate PA range for 4GB mode") Signed-off-by: Yong Wu Reviewed-by: Evan Green Reviewed-by: Matthias Brugger --- dri

[PATCH v10 20/23] memory: mtk-smi: Add bus_sel for mt8183

2019-08-21 Thread Yong Wu
that. CC: Matthias Brugger Signed-off-by: Yong Wu Reviewed-by: Evan Green Reviewed-by: Matthias Brugger --- drivers/memory/mtk-smi.c | 24 ++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c index 2bb55b86..289e

[PATCH v10 19/23] memory: mtk-smi: Invoke pm runtime_callback to enable clocks

2019-08-21 Thread Yong Wu
so it gives a chance to get rid of mtk_smi_larb_get/put which could be a next topic. CC: Matthias Brugger Signed-off-by: Yong Wu Reviewed-by: Evan Green Reviewed-by: Matthias Brugger --- drivers/memory/mtk-smi.c | 113 ++- 1 file changed, 72 insertions(+

[PATCH v10 22/23] memory: mtk-smi: Get rid of need_larbid

2019-08-21 Thread Yong Wu
d for mt2712 which have 2 M4Us. In the other SoCs, we can get the larb-id from M4U in which the larbs in the "mediatek,larbs" always are ordered. Correspondingly, the larb_nr in the "struct mtk_smi_iommu" could also be deleted. CC: Matthias Brugger Signed-off-by: Yong Wu R

[PATCH v10 23/23] iommu/mediatek: Clean up struct mtk_smi_iommu

2019-08-21 Thread Yong Wu
Remove the "struct mtk_smi_iommu" to simplify the code since it has only one item in it right now. Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c| 4 ++-- drivers/iommu/mtk_iommu.h| 6 +++--- drivers/iommu/mtk_iommu_v1.c | 4 ++-- drivers/memory/mtk-smi.c | 6 +++--

Re: [PATCH v10 09/23] iommu/io-pgtable-arm-v7s: Extend to support PA[33:32] for MediaTek

2019-08-22 Thread Yong Wu
On Wed, 2019-08-21 at 16:24 +0100, Will Deacon wrote: > On Wed, Aug 21, 2019 at 09:53:12PM +0800, Yong Wu wrote: > > MediaTek extend the arm v7s descriptor to support up to 34 bits PA where > > the bit32 and bit33 are encoded in the bit9 and bit4 of the PTE > > respectivel

Re: [PATCH v10 09/23] iommu/io-pgtable-arm-v7s: Extend to support PA[33:32] for MediaTek

2019-08-22 Thread Yong Wu
On Wed, 2019-08-21 at 16:34 +0100, Robin Murphy wrote: > On 21/08/2019 16:24, Will Deacon wrote: > > On Wed, Aug 21, 2019 at 09:53:12PM +0800, Yong Wu wrote: > >> MediaTek extend the arm v7s descriptor to support up to 34 bits PA where > >> the bit32 and bit33 are enco

Re: [PATCH v10 09/23] iommu/io-pgtable-arm-v7s: Extend to support PA[33:32] for MediaTek

2019-08-22 Thread Yong Wu
e: > > > > On 2019-08-22 9:56 am, Yong Wu wrote: > > > > > On Wed, 2019-08-21 at 16:24 +0100, Will Deacon wrote: > > > > > > On Wed, Aug 21, 2019 at 09:53:12PM +0800, Yong Wu wrote: > > > > > > > MediaTek extend the arm v7s descripto

[PATCH v11 01/23] dt-bindings: mediatek: Add binding for mt8183 IOMMU and SMI

2019-08-23 Thread Yong Wu
t; clocks for smi-common and add a "gals" clock for smi-larb. >From the diagram above, IPU0/IPU1(Image Processor Unit) and CCU(Camera Control Unit) is connected with smi-common directly, we can take them as "larb2", "larb3" and "larb7", and their register

[PATCH v11 00/23] MT8183 IOMMU SUPPORT

2019-08-23 Thread Yong Wu
remapped array(larbid_remapped), then we don't need add the new function(mtk_iommu_get_larbid). 4) Add a new patch for v7s two helpers(paddr_to_iopte and iopte_to_paddr). 5) Change some comment for MTK 4GB mode. v1: base on v4.19-rc1. http://lists.infradead.org/pipermail/lin

[PATCH v11 07/23] iommu/io-pgtable-arm-v7s: Use ias/oas to check the valid iova/pa

2019-08-23 Thread Yong Wu
Use ias/oas to check the valid iova/pa. Synchronize this checking with io-pgtable-arm.c. Signed-off-by: Yong Wu Acked-by: Will Deacon --- drivers/iommu/io-pgtable-arm-v7s.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/io-pgtable-arm-v7s.c b/drivers/iommu

[PATCH v11 03/23] memory: mtk-smi: Use a general config_port interface

2019-08-23 Thread Yong Wu
mt8183, IPU0/1 and CCU connect with smi-common directly, they also are not the normal larb. Hence, we add a "larb_direct_to_common_mask" for these larbs which connect to smi-commmon directly. This is also a preparing patch for adding mt8183 SMI support. Signed-off-by: Yong Wu Reviewed-by

[PATCH v11 06/23] iommu/io-pgtable-arm-v7s: Add paddr_to_iopte and iopte_to_paddr helpers

2019-08-23 Thread Yong Wu
Add two helper functions: paddr_to_iopte and iopte_to_paddr. Signed-off-by: Yong Wu Reviewed-by: Robin Murphy Reviewed-by: Evan Green --- drivers/iommu/io-pgtable-arm-v7s.c | 45 -- 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/drivers

[PATCH v11 14/23] iommu/mediatek: Move reset_axi into plat_data

2019-08-23 Thread Yong Wu
In mt8173 and mt8183, 0x48 is REG_MMU_STANDARD_AXI_MODE while it is REG_MMU_CTRL in the other SoCs, and the bits meaning is completely different with the REG_MMU_STANDARD_AXI_MODE. This patch moves this property to plat_data, it's also a preparing patch for mt8183. Signed-off-by: Yo

[PATCH v11 16/23] memory: mtk-smi: Add gals support

2019-08-23 Thread Yong Wu
above, we add "gals0" and "gals1" clocks for smi-common and add a "gals" clock for smi-larb. This patch adds gals clock supporting in the SMI. Note that some larbs may still don't have the "gals" clock like larb1 and larb4 above. This is also a pre

[PATCH v11 10/23] iommu/mediatek: Adjust the PA for the 4GB Mode

2019-08-23 Thread Yong Wu
ted our case. Both mt2712 and mt8173 support this "4GB mode" while the mt8183 don't. The PA in mt8183 won't remap. Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 26 -- drivers/iommu/mtk_iommu.h | 1 + 2 files changed, 17 insertions(+), 10 d

[PATCH v11 15/23] iommu/mediatek: Move vld_pa_rng into plat_data

2019-08-23 Thread Yong Wu
Both mt8173 and mt8183 don't have this vld_pa_rng(valid physical address range) register while mt2712 have. Move it into the plat_data. Signed-off-by: Yong Wu Reviewed-by: Evan Green Reviewed-by: Matthias Brugger --- drivers/iommu/mtk_iommu.c | 3 ++- drivers/iommu/mtk_iommu.h | 1 + 2

[PATCH v11 11/23] iommu/mediatek: Add bclk can be supported optionally

2019-08-23 Thread Yong Wu
In some SoCs, M4U doesn't have its "bclk", it will use the EMI clock instead which has always been enabled when entering kernel. Currently mt2712 and mt8173 have this bclk while mt8183 doesn't. This also is a preparing patch for mt8183. Signed-off-by: Yong Wu Reviewed-by:

[PATCH v11 19/23] memory: mtk-smi: Invoke pm runtime_callback to enable clocks

2019-08-23 Thread Yong Wu
so it gives a chance to get rid of mtk_smi_larb_get/put which could be a next topic. CC: Matthias Brugger Signed-off-by: Yong Wu Reviewed-by: Evan Green Reviewed-by: Matthias Brugger --- drivers/memory/mtk-smi.c | 113 ++- 1 file changed, 72 insertions(+

[PATCH v11 22/23] memory: mtk-smi: Get rid of need_larbid

2019-08-23 Thread Yong Wu
d for mt2712 which have 2 M4Us. In the other SoCs, we can get the larb-id from M4U in which the larbs in the "mediatek,larbs" always are ordered. Correspondingly, the larb_nr in the "struct mtk_smi_iommu" could also be deleted. CC: Matthias Brugger Signed-off-by: Yong Wu R

[PATCH v11 04/23] memory: mtk-smi: Use a struct for the platform data for smi-common

2019-08-23 Thread Yong Wu
8183. Signed-off-by: Yong Wu Reviewed-by: Matthias Brugger Reviewed-by: Evan Green --- drivers/memory/mtk-smi.c | 35 --- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c index 14f70cf..47df7d0

[PATCH v11 17/23] iommu/mediatek: Add mt8183 IOMMU support

2019-08-23 Thread Yong Wu
dard ttbr0[1] means the S bit which is enabled defaultly, Hence, we add a mask. 5) mt8183 HW has a GALS modules, SMI should enable "has_gals" support. 6) mt8183 need reset_axi like mt8173. 7) the larb-id in smi-common is remapped. M4U should add its larbid_remap. Signed-off-by: Yong Wu R

[PATCH v11 05/23] iommu/mediatek: Fix iova_to_phys PA start for 4GB mode

2019-08-23 Thread Yong Wu
: 30e2fccf9512 ("iommu/mediatek: Enlarge the validate PA range for 4GB mode") Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 26 +- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index c6e

[PATCH v11 02/23] iommu/mediatek: Use a struct as the platform data

2019-08-23 Thread Yong Wu
Use a struct as the platform special data instead of the enumeration. This is a prepare patch for adding mt8183 iommu support. Signed-off-by: Yong Wu Reviewed-by: Matthias Brugger Reviewed-by: Evan Green --- drivers/iommu/mtk_iommu.c | 24 drivers/iommu/mtk_iommu.h

[PATCH v11 18/23] iommu/mediatek: Add mmu1 support

2019-08-23 Thread Yong Wu
hat register is 0 which means all the larbs go to mmu0 defaultly. This is a preparing patch for adjusting SMI_BUS_SEL for mt8183. Signed-off-by: Yong Wu Reviewed-by: Evan Green Reviewed-by: Matthias Brugger --- drivers/iommu/mtk_iommu.c | 46 +- 1 f

[PATCH v11 23/23] iommu/mediatek: Clean up struct mtk_smi_iommu

2019-08-23 Thread Yong Wu
Remove the "struct mtk_smi_iommu" to simplify the code since it has only one item in it right now. Signed-off-by: Yong Wu Reviewed-by: Matthias Brugger --- drivers/iommu/mtk_iommu.c| 4 ++-- drivers/iommu/mtk_iommu.h| 6 +++--- drivers/iommu/mtk_iommu_v1.c | 4 ++-- drivers/

[PATCH v11 21/23] iommu/mediatek: Fix VLD_PA_RNG register backup when suspend

2019-08-23 Thread Yong Wu
The register VLD_PA_RNG(0x118) was forgot to backup while adding 4GB mode support for mt2712. this patch add it. Fixes: 30e2fccf9512 ("iommu/mediatek: Enlarge the validate PA range for 4GB mode") Signed-off-by: Yong Wu Reviewed-by: Evan Green Reviewed-by: Matthias Brugger --- dri

[PATCH v11 12/23] iommu/mediatek: Add larb-id remapped support

2019-08-23 Thread Yong Wu
his also is a preparing patch for mt8183. Signed-off-by: Yong Wu Reviewed-by: Nicolas Boichat Reviewed-by: Evan Green Reviewed-by: Matthias Brugger --- drivers/iommu/mtk_iommu.c | 4 drivers/iommu/mtk_iommu.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/drivers/iommu/mtk_iommu.c b/

[PATCH v11 20/23] memory: mtk-smi: Add bus_sel for mt8183

2019-08-23 Thread Yong Wu
that. CC: Matthias Brugger Signed-off-by: Yong Wu Reviewed-by: Evan Green Reviewed-by: Matthias Brugger --- drivers/memory/mtk-smi.c | 24 ++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c index 2bb55b86..289e

[PATCH v11 13/23] iommu/mediatek: Refine protect memory definition

2019-08-23 Thread Yong Wu
-off-by: Yong Wu Reviewed-by: Evan Green Reviewed-by: Matthias Brugger --- drivers/iommu/mtk_iommu.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 34f0203..947a8c6b8 100644 --- a/drivers/iommu

[PATCH v11 08/23] iommu/io-pgtable-arm-v7s: Rename the quirk from MTK_4GB to MTK_EXT

2019-08-23 Thread Yong Wu
In previous mt2712/mt8173, MediaTek extend the v7s to support 4GB dram. But in the latest mt8183, We extend it to support the PA up to 34bit. Then the "MTK_4GB" name is not so fit, This patch only change the quirk name to "MTK_EXT". Signed-off-by: Yong Wu Acked-by: Will

[PATCH v11 09/23] iommu/io-pgtable-arm-v7s: Extend to support PA[33:32] for MediaTek

2019-08-23 Thread Yong Wu
don't, thus keep it as is. Signed-off-by: Yong Wu Acked-by: Will Deacon --- drivers/iommu/io-pgtable-arm-v7s.c | 40 +++--- include/linux/io-pgtable.h | 7 +++ 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/drivers/iommu/io-pgtabl

[PATCH v3 00/14] Clean up "mediatek,larb" after adding device_link

2019-09-03 Thread Yong Wu
e consumer and smi-larb into iommu_add_device from Robin. 3) add DL_FLAG_AUTOREMOVE_CONSUMER even though the smi is built-in from Evan. 4) Remove the shutdown callback in iommu. v1: https://lists.linuxfoundation.org/pipermail/iommu/2019-January/032387.html Yong Wu (13): dt-binding: medi

[PATCH v3 01/14] dt-binding: mediatek: Get rid of mediatek, larb for multimedia HW

2019-09-03 Thread Yong Wu
sumer connects with from iommu id in the "iommus=" property. Signed-off-by: Yong Wu Reviewed-by: Rob Herring Reviewed-by: Evan Green --- .../devicetree/bindings/display/mediatek/mediatek,disp.txt | 9 - .../devicetree/bindings/media/mediatek-jpeg-decoder.txt | 4

[PATCH v3 02/14] iommu/mediatek: Add probe_defer for smi-larb

2019-09-03 Thread Yong Wu
consumer drivers run before smi-larb, the supplier link_status is DL_DEV_NO_DRIVER(0) in the device_link_add, then device_links_driver_bound will use WARN_ON to complain that the link_status of supplier is not right. This is a preparing patch for adding device_link. Signed-off-by: Yong Wu

[PATCH v3 04/14] memory: mtk-smi: Add device-link between smi-larb and smi-common

2019-09-03 Thread Yong Wu
, Add DL_FLAG_STATELESS to avoid the smi-common clocks be gated when probe. CC: Matthias Brugger Suggested-by: Tomasz Figa Signed-off-by: Yong Wu --- drivers/memory/mtk-smi.c | 19 ++- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/memory/mtk-smi.c b

[PATCH v3 03/14] iommu/mediatek: Add device_link between the consumer and the larb devices

2019-09-03 Thread Yong Wu
/ Suggested-by: Tomasz Figa Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c| 17 + drivers/iommu/mtk_iommu_v1.c | 18 +- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index b138b94..2511b

[PATCH v3 05/14] media: mtk-jpeg: Get rid of mtk_smi_larb_get/put

2019-09-03 Thread Yong Wu
MediaTek IOMMU has already added device_link between the consumer and smi-larb device. If the jpg device call the pm_runtime_get_sync, the smi-larb's pm_runtime_get_sync also be called automatically. CC: Rick Chang Signed-off-by: Yong Wu Reviewed-by: Evan Green --- drivers/media/platfor

[PATCH v3 06/14] media: mtk-mdp: Get rid of mtk_smi_larb_get/put

2019-09-03 Thread Yong Wu
MediaTek IOMMU has already added the device_link between the consumer and smi-larb device. If the mdp device call the pm_runtime_get_sync, the smi-larb's pm_runtime_get_sync also be called automatically. CC: Minghsiu Tsai Signed-off-by: Yong Wu Reviewed-by: Evan Green --- drivers/

[PATCH v3 09/14] memory: mtk-smi: Get rid of mtk_smi_larb_get/put

2019-09-03 Thread Yong Wu
After adding device_link between the iommu consumer and smi-larb, the pm_runtime_get(_sync) of smi-larb and smi-common will be called automatically. we can get rid of mtk_smi_larb_get/put. CC: Matthias Brugger Signed-off-by: Yong Wu Reviewed-by: Evan Green --- drivers/memory/mtk-smi.c | 14

[PATCH v3 10/14] iommu/mediatek: Use builtin_platform_driver

2019-09-03 Thread Yong Wu
MediaTek IOMMU should wait for smi larb which need wait for the power domain(mtk-scpsys.c) and the multimedia ccf who both are module init. Thus, subsys_initcall for MediaTek IOMMU is not helpful. Switch to builtin_platform_driver. Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c| 31

[PATCH v3 08/14] drm/mediatek: Get rid of mtk_smi_larb_get/put

2019-09-03 Thread Yong Wu
MediaTek IOMMU has already added the device_link between the consumer and smi-larb device. If the drm device call the pm_runtime_get_sync, the smi-larb's pm_runtime_get_sync also be called automatically. CC: CK Hu CC: Philipp Zabel Signed-off-by: Yong Wu Reviewed-by: Evan Green --- dr

[PATCH v3 12/14] drm/mediatek: Add pm runtime support for ovl and rdma

2019-09-03 Thread Yong Wu
-by: Yong Wu --- drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 5 + drivers/gpu/drm/mediatek/mtk_disp_rdma.c| 5 + drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 18 -- drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c | 9 + drivers/gpu/drm/mediatek

[PATCH v3 07/14] media: mtk-vcodec: Get rid of mtk_smi_larb_get/put

2019-09-03 Thread Yong Wu
MediaTek IOMMU has already added the device_link between the consumer and smi-larb device. If the vcodec device call the pm_runtime_get_sync, the smi-larb's pm_runtime_get_sync also be called automatically. CC: Tiffany Lin Signed-off-by: Yong Wu Reviewed-by: Evan Green --- .../media/pla

[PATCH v3 11/14] memory: mtk-smi: Use device_is_bound to check if smi-common is ready

2019-09-03 Thread Yong Wu
smi-larb driver should run after smi-common, Use device_is_bound to confirm whether smicommon driver is ready. CC: Matthias Brugger Signed-off-by: Yong Wu --- drivers/memory/mtk-smi.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/memory/mtk-smi.c b/drivers

[PATCH v3 14/14] arm64: dts: mediatek: Get rid of mediatek, larb for MM nodes

2019-09-03 Thread Yong Wu
After adding device_link between the IOMMU consumer and smi, the mediatek,larb is unnecessary now. CC: Matthias Brugger Signed-off-by: Yong Wu Reviewed-by: Evan Green --- arch/arm64/boot/dts/mediatek/mt8173.dtsi | 15 --- 1 file changed, 15 deletions(-) diff --git a/arch/arm64

[PATCH v3 13/14] arm: dts: mediatek: Get rid of mediatek, larb for MM nodes

2019-09-03 Thread Yong Wu
After adding device_link between the IOMMU consumer and smi, the mediatek,larb is unnecessary now. CC: Matthias Brugger Signed-off-by: Yong Wu Reviewed-by: Evan Green --- arch/arm/boot/dts/mt2701.dtsi | 1 - arch/arm/boot/dts/mt7623.dtsi | 1 - 2 files changed, 2 deletions(-) diff --git a

Re: [PATCH v3 06/14] media: mtk-mdp: Get rid of mtk_smi_larb_get/put

2019-09-04 Thread Yong Wu
sync, > > the smi-larb's pm_runtime_get_sync also be called automatically. > > > > CC: Minghsiu Tsai > > Signed-off-by: Yong Wu > > Reviewed-by: Evan Green > > --- > > drivers/media/platform/mtk-mdp/mtk_mdp_comp.c | 38 > > --

[PATCH] iommu/mediatek: Move the tlb_sync into tlb_flush

2019-09-29 Thread Yong Wu
affect the multimedia performance. Fixes: 4d689b619445 ("iommu/io-pgtable-arm-v7s: Convert to IOMMU API TLB sync") Signed-off-by: Chao Hao Signed-off-by: Yong Wu --- This patch looks break the logic for tlb_flush and tlb_sync. I'm not sure if it is reasonable. If someone has

Re: [PATCH] iommu/mediatek: Move the tlb_sync into tlb_flush

2019-10-08 Thread Yong Wu
Hi Tomasz, Sorry for reply late. On Wed, 2019-10-02 at 14:18 +0900, Tomasz Figa wrote: > Hi Yong, > > On Mon, Sep 30, 2019 at 2:42 PM Yong Wu wrote: > > > > The commit 4d689b619445 ("iommu/io-pgtable-arm-v7s: Convert to IOMMU API > > TLB sync") help move th

Re: [PATCH] iommu/mediatek: Move the tlb_sync into tlb_flush

2019-10-08 Thread Yong Wu
On Wed, 2019-10-02 at 11:35 +0100, Robin Murphy wrote: > On 02/10/2019 06:18, Tomasz Figa wrote: > > Hi Yong, > > > > On Mon, Sep 30, 2019 at 2:42 PM Yong Wu wrote: > >> > >> The commit 4d689b619445 ("iommu/io-pgtable-arm-v7s: Convert to IOMMU API >

Re: [PATCH] iommu/mediatek: Move the tlb_sync into tlb_flush

2019-10-08 Thread Yong Wu
On Mon, 2019-09-30 at 13:09 +0100, Will Deacon wrote: > On Mon, Sep 30, 2019 at 01:42:22PM +0800, Yong Wu wrote: > > The commit 4d689b619445 ("iommu/io-pgtable-arm-v7s: Convert to IOMMU API > > TLB sync") help move the tlb_sync of unmap from v7s into the iommu > >

[PATCH] memory: mtk-smi: Add PM suspend and resume ops

2019-10-09 Thread Yong Wu
27;s clocks after the multimedia devices. Fixes: 4f0a1a1ae351 ("memory: mtk-smi: Invoke pm runtime_callback to enable clocks") Signed-off-by: Anan Sun Signed-off-by: Yong Wu --- base on v5.4-rc1. --- drivers/memory/mtk-smi.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers

[PATCH v2 1/4] iommu/mediatek: Correct the flush_iotlb_all callback

2019-10-09 Thread Yong Wu
Use the correct tlb_flush_all instead of the original one. Fixes: 4d689b619445 ("iommu/io-pgtable-arm-v7s: Convert to IOMMU API TLB sync") Signed-off-by: Yong Wu --- 1. rebase on v5.4-rc1 2. v1: https://lore.kernel.org/linux-iommu/CAAFQd5C3U7pZo4SSUJ52Q7E+0FaUoORQFbQC5

[PATCH v2 3/4] iommu/mediatek: Use writel for TLB range invalidation

2019-10-09 Thread Yong Wu
Use writel for the register F_MMU_INV_RANGE which is for triggering the HW work. We expect all the setting(iova_start/iova_end...) have already been finished before F_MMU_INV_RANGE. Signed-off-by: Anan.Sun Signed-off-by: Yong Wu --- This is a improvement rather than fixing a issue. --- drivers

[PATCH v2 2/4] iommu/mediatek: Move the tlb_sync into tlb_flush

2019-10-09 Thread Yong Wu
ot;iommu/io-pgtable-arm-v7s: Convert to IOMMU API TLB sync") Signed-off-by: Chao Hao Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 63 +-- drivers/iommu/mtk_iommu.h | 1 - 2 files changed, 17 insertions(+), 47 deletions(-) diff --git a/

[PATCH v2 4/4] iommu/mediatek: Reduce the tlb flush timeout value

2019-10-09 Thread Yong Wu
Reduce the tlb timeout value from 10us to 1000us. the original value is so long that affect the multimedia performance. This is only a minor improvement rather than fixing a issue. Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

Re: [PATCH] iommu/mediatek: Move the tlb_sync into tlb_flush

2019-10-09 Thread Yong Wu
On Wed, 2019-10-09 at 16:56 +0900, Tomasz Figa wrote: > On Tue, Oct 8, 2019 at 5:09 PM Yong Wu wrote: > > > > Hi Tomasz, > > > > Sorry for reply late. > > > > On Wed, 2019-10-02 at 14:18 +0900, Tomasz Figa wrote: > > > Hi Yong, > >

Re: [PATCH v2 3/4] iommu/mediatek: Use writel for TLB range invalidation

2019-10-11 Thread Yong Wu
On Fri, 2019-10-11 at 17:29 +0100, Will Deacon wrote: > On Wed, Oct 09, 2019 at 09:19:02PM +0800, Yong Wu wrote: > > Use writel for the register F_MMU_INV_RANGE which is for triggering the > > HW work. We expect all the setting(iova_start/iova_end...) have already > >

[PATCH v3 2/7] iommu/mediatek: Add pgtlock in the iotlb_sync

2019-10-13 Thread Yong Wu
s: Convert to IOMMU API TLB sync") Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 76b9388..5f594d6 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iomm

[PATCH v3 1/7] iommu/mediatek: Correct the flush_iotlb_all callback

2019-10-13 Thread Yong Wu
Use the correct tlb_flush_all instead of the original one. Fixes: 4d689b619445 ("iommu/io-pgtable-arm-v7s: Convert to IOMMU API TLB sync") Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/mtk_iommu.c

[PATCH v3 4/7] iommu/mediatek: Delete the leaf in the tlb flush

2019-10-13 Thread Yong Wu
In our tlb range flush, we don't care the "leaf". Remove it to simplify the code. no functional change. Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 16 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/iommu/mtk_iommu.c

[PATCH v3 0/7] Improve tlb range flush

2019-10-13 Thread Yong Wu
: https://lore.kernel.org/linux-iommu/1570627143-29441-1-git-send-email-yong...@mediatek.com/T/#t 1. rebase on v5.4-rc1 2. only split to several patches. v1: https://lore.kernel.org/linux-iommu/CAAFQd5C3U7pZo4SSUJ52Q7E+0FaUoORQFbQC5RhCHBhi=nf...@mail.gmail.com/T/#t Yong Wu (7): iommu/mediatek

[PATCH v3 3/7] iommu/mediatek: Use gather to achieve the tlb range flush

2019-10-13 Thread Yong Wu
n acquired. Suggested-by: Tomasz Figa Signed-off-by: Yong Wu --- 1) This is the special case backtrace: mtk_iommu_iotlb_sync+0x50/0xa0 mtk_iommu_tlb_flush_page_nosync+0x5c/0xd0 __arm_v7s_unmap+0x174/0x598 arm_v7s_unmap+0x30/0x48 mtk_iommu_unmap+0x50/0x78 __iommu_unmap+0xa4/0xf8 2) The ch

[PATCH v3 7/7] iommu/mediatek: Reduce the tlb flush timeout value

2019-10-13 Thread Yong Wu
Reduce the tlb timeout value from 10us to 1000us. the original value is so long that affect the multimedia performance. This is only a minor improvement rather than fixing a issue. Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH v3 5/7] iommu/mediatek: Move the tlb_sync into tlb_flush

2019-10-13 Thread Yong Wu
Right now, the tlb_add_flush_nosync and tlb_sync always appear together. we merge the two functions into one. No functional change. mtk_iommu_tlb_add_flush_nosync mtk_iommu_tlb_sync Signed-off-by: Chao Hao Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 36

[PATCH v3 6/7] iommu/mediatek: Use writel for TLB range invalidation

2019-10-13 Thread Yong Wu
Use writel for the register F_MMU_INV_RANGE which is for triggering the HW work. We expect all the setting(iova_start/iova_end...) have already been finished before F_MMU_INV_RANGE. Signed-off-by: Anan.Sun Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 3 +-- 1 file changed, 1

Re: [PATCH v2 3/4] iommu/mediatek: Use writel for TLB range invalidation

2019-10-14 Thread Yong Wu
On Mon, 2019-10-14 at 22:11 +0100, Will Deacon wrote: > On Sat, Oct 12, 2019 at 02:23:47PM +0800, Yong Wu wrote: > > On Fri, 2019-10-11 at 17:29 +0100, Will Deacon wrote: > > > On Wed, Oct 09, 2019 at 09:19:02PM +0800, Yong Wu wrote: > > > > Use writel for the registe

Re: [PATCH v3 4/7] iommu/mediatek: Delete the leaf in the tlb flush

2019-10-14 Thread Yong Wu
On Mon, 2019-10-14 at 15:22 +0100, Robin Murphy wrote: > On 14/10/2019 07:38, Yong Wu wrote: > > In our tlb range flush, we don't care the "leaf". Remove it to simplify > > the code. no functional change. > > Presumably you don't care about the granu

Re: [PATCH v3 6/7] iommu/mediatek: Use writel for TLB range invalidation

2019-10-14 Thread Yong Wu
On Mon, 2019-10-14 at 15:04 +0100, Robin Murphy wrote: > On 14/10/2019 07:38, Yong Wu wrote: > > Use writel for the register F_MMU_INV_RANGE which is for triggering the > > HW work. We expect all the setting(iova_start/iova_end...) have already > > been finished before F_MM

Re: [PATCH v3 3/7] iommu/mediatek: Use gather to achieve the tlb range flush

2019-10-14 Thread Yong Wu
On Mon, 2019-10-14 at 15:21 +0100, Robin Murphy wrote: > On 14/10/2019 07:38, Yong Wu wrote: > > Use the iommu_gather mechanism to achieve the tlb range flush. > > Gather the iova range in the "tlb_add_page", then flush the merged iova > > range in iotlb_sync. >

[PATCH v4 1/7] iommu/mediatek: Correct the flush_iotlb_all callback

2019-10-15 Thread Yong Wu
Use the correct tlb_flush_all instead of the original one. Fixes: 4d689b619445 ("iommu/io-pgtable-arm-v7s: Convert to IOMMU API TLB sync") Signed-off-by: Yong Wu Reviewed-by: Robin Murphy --- drivers/iommu/mtk_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v4 0/7] Improve tlb range flush

2019-10-15 Thread Yong Wu
k.com/T/#t 1. rebase on v5.4-rc1 2. only split to several patches. v1: https://lore.kernel.org/linux-iommu/CAAFQd5C3U7pZo4SSUJ52Q7E+0FaUoORQFbQC5RhCHBhi=nf...@mail.gmail.com/T/#t Yong Wu (7): iommu/mediatek: Correct the flush_iotlb_all callback iommu/mediatek: Add a new tlb_lock for tlb_flu

[PATCH v4 2/7] iommu/mediatek: Add a new tlb_lock for tlb_flush

2019-10-15 Thread Yong Wu
b619445 ("iommu/io-pgtable-arm-v7s: Convert to IOMMU API TLB sync") Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 23 ++- drivers/iommu/mtk_iommu.h | 1 + 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/

[PATCH v4 7/7] iommu/mediatek: Reduce the tlb flush timeout value

2019-10-15 Thread Yong Wu
Reduce the tlb timeout value from 10us to 1000us. the original value is so long that affect the multimedia performance. This is only a minor improvement rather than fixing a issue. Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH v4 5/7] iommu/mediatek: Move the tlb_sync into tlb_flush

2019-10-15 Thread Yong Wu
Right now, the tlb_add_flush_nosync and tlb_sync always appear together. we merge the two functions into one(also move the tlb_lock into the new function). No functional change. Signed-off-by: Chao Hao Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 45

[PATCH v4 4/7] iommu/mediatek: Delete the leaf in the tlb_flush

2019-10-15 Thread Yong Wu
In our tlb range flush, we don't care the "leaf". Remove it to simplify the code. no functional change. "granule" also is unnecessary for us, Keep it satisfy the format of tlb_flush_walk. Signed-off-by: Yong Wu Reviewed-by: Robin Murphy --- drive

[PATCH v4 3/7] iommu/mediatek: Use gather to achieve the tlb range flush

2019-10-15 Thread Yong Wu
Use the iommu_gather mechanism to achieve the tlb range flush. Gather the iova range in the "tlb_add_page", then flush the merged iova range in iotlb_sync. Suggested-by: Tomasz Figa Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 12 1 file changed, 8 insert

[PATCH v4 6/7] iommu/mediatek: Get rid of the pgtlock

2019-10-15 Thread Yong Wu
Now we have tlb_lock for the HW tlb flush, then pgtable code hasn't needed the external "pgtlock" for a while. this patch remove the "pgtlock". Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 25 +++-- 1 file changed, 3 insertions(+), 22 d

Re: [PATCH v4 3/7] iommu/mediatek: Use gather to achieve the tlb range flush

2019-10-24 Thread Yong Wu
On Wed, 2019-10-23 at 17:55 +0100, Will Deacon wrote: > On Wed, Oct 16, 2019 at 11:33:08AM +0800, Yong Wu wrote: > > Use the iommu_gather mechanism to achieve the tlb range flush. > > Gather the iova range in the "tlb_add_page", then flush the merged iov

Re: [PATCH v4 2/7] iommu/mediatek: Add a new tlb_lock for tlb_flush

2019-10-24 Thread Yong Wu
On Wed, 2019-10-23 at 17:52 +0100, Will Deacon wrote: > On Wed, Oct 16, 2019 at 11:33:07AM +0800, Yong Wu wrote: > > The commit 4d689b619445 ("iommu/io-pgtable-arm-v7s: Convert to IOMMU API > > TLB sync") help move the tlb_sync of unmap from v7s into the iommu > >

[PATCH v5 1/7] iommu/mediatek: Correct the flush_iotlb_all callback

2019-11-03 Thread Yong Wu
Use the correct tlb_flush_all instead of the original one. Fixes: 4d689b619445 ("iommu/io-pgtable-arm-v7s: Convert to IOMMU API TLB sync") Signed-off-by: Yong Wu Reviewed-by: Robin Murphy --- drivers/iommu/mtk_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v5 3/7] iommu/mediatek: Use gather to achieve the tlb range flush

2019-11-03 Thread Yong Wu
Use the iommu_gather mechanism to achieve the tlb range flush. Gather the iova range in the "tlb_add_page", then flush the merged iova range in iotlb_sync. Suggested-by: Tomasz Figa Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 12 1 file changed, 8 insert

<    1   2   3   4   5   6   7   8   9   10   >