[PATCH v3 07/15] iommu/mediatek: Add mmu1 support

2018-11-16 Thread Yong Wu
lue of that register is 0 which means all the larbs go to mmu0 defaultly. This is a prepare patch for adjust SMI_BUS_SEL for mt8183. Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 47 +-- 1 file changed, 29 insertions(+), 18 deletions(-) diff --

[PATCH v3 04/15] iommu/io-pgtable-arm-v7s: Add paddr_to_iopte and iopte_to_paddr helpers

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

[PATCH v3 03/15] memory: mtk-smi: Use a general config_port interface

2018-11-16 Thread Yong Wu
. In mt8183, IPU0/1 and CCU connect with smi-common directly, they also are not the normal larb. Hence, we add a "larb_special_mask" for these special larbs. This is also a prepare patch for adding mt8183 SMI support. Signed-off-by: Yong Wu --- drivers/memory/mtk-smi.c | 12 +--- 1 fi

[PATCH v3 00/15] MT8183 IOMMU SUPPORT

2018-11-16 Thread Yong Wu
rbs. 3) Refactor the larb-id 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://list

Re: [PATCH v5 12/20] memory: mtk-smi: Add gals support

2019-01-13 Thread Yong Wu
. On Tue, 2019-01-01 at 11:55 +0800, Yong Wu wrote: > In some SoCs like mt8183, SMI add GALS(Global Async Local Sync) module > which can help synchronize for the modules in different clock frequency. > It can be seen as a "asynchronous fifo". This is a example diagram: &

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

2018-09-17 Thread Yong Wu
On Sun, 2018-09-16 at 17:26 -0500, Rob Herring wrote: > On Mon, Sep 03, 2018 at 02:01:30PM +0800, Yong Wu wrote: > > This patch adds decriptions for mt8183 IOMMU and SMI. > > > > mt8183 has one M4U like mt8173 and is also MTK IOMMU gen2 which > > uses ARM Short-Descript

Re: [PATCH v3 06/15] iommu/mediatek: Add mt8183 IOMMU support

2018-12-03 Thread Yong Wu
Hi Matthias, Thanks very much for your review. On Mon, 2018-12-03 at 00:56 +0100, Matthias Brugger wrote: > > On 17/11/2018 03:35, Yong Wu wrote: > > The M4U IP blocks in mt8183 is MediaTek's generation2 M4U which use > > the ARM Short-descriptor like mt8173, and most o

Re: [PATCH v3 13/15] memory: mtk-smi: Get rid of need_larbid

2018-12-03 Thread Yong Wu
On Mon, 2018-12-03 at 00:04 +0100, Matthias Brugger wrote: > > On 17/11/2018 03:35, Yong Wu wrote: > > The "mediatek,larb-id" has already been parsed in MTK IOMMU driver. > > It's no need to parse it again in SMI driver. Only clean some codes. > > This patch

[PATCH] arm64: dts: Add m4u and smi-larbs nodes for mt8183

2019-03-24 Thread Yong Wu
Add nodes for M4U, smi-common, and smi-larbs. Signed-off-by: Yong Wu --- This one is based on MTK IOMMU v6[1] and basical nodes of clocks and powers. [1] https://patchwork.kernel.org/patch/10816827/ [2] https://patchwork.kernel.org/patch/10858941/ --- arch/arm64/boot/dts/mediatek/mt8183.dtsi

Re: [PATCH 04/13] iommu/mediatek: Add device_link between the consumer and the larb devices

2019-02-27 Thread Yong Wu
On Mon, 2019-02-25 at 15:54 -0800, Evan Green wrote: > On Mon, Dec 31, 2018 at 8:52 PM Yong Wu wrote: > > > > MediaTek IOMMU don't have its power-domain. all the consumer connect > > with smi-larb, then connect with smi-common. > > > > M4U

Re: [PATCH 02/13] driver core: Remove the link if there is no driver with AUTO flag

2019-02-27 Thread Yong Wu
On Mon, 2019-02-25 at 15:53 -0800, Evan Green wrote: > On Mon, Dec 31, 2018 at 8:52 PM Yong Wu wrote: > > > > DL_FLAG_AUTOREMOVE_CONSUMER/SUPPLIER means "Remove the link > > automatically on consumer/supplier driver unbind", that means we should > &

Re: [PATCH 11/13] iommu/mediatek: Use builtin_platform_driver

2019-02-27 Thread Yong Wu
On Mon, 2019-02-25 at 15:56 -0800, Evan Green wrote: > On Mon, Dec 31, 2018 at 8:53 PM Yong Wu wrote: > > > > 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, s

Re: [PATCH 03/13] iommu/mediatek: Add probe_defer for smi-larb

2019-02-27 Thread Yong Wu
On Mon, 2019-02-25 at 15:54 -0800, Evan Green wrote: > On Mon, Dec 31, 2018 at 8:52 PM Yong Wu wrote: > > > > The iommu consumer should use device_link to connect with the > > smi-larb(supplier). then the smi-larb should run before the iommu > > consumer. Here we d

Re: [PATCH 05/13] memory: mtk-smi: Add device-link between smi-larb and smi-common

2019-02-27 Thread Yong Wu
On Mon, 2019-02-25 at 15:54 -0800, Evan Green wrote: > On Mon, Dec 31, 2018 at 8:52 PM Yong Wu wrote: > > > > Normally, If the smi-larb HW need work, we should enable the smi-common > > HW power and clock firstly. > > This patch adds device-link between the smi-larb dev

Re: [PATCH v6 12/22] memory: mtk-smi: Add gals support

2019-03-13 Thread Yong Wu
Hi Matthias, A gentle ping for all the smi part here. >From Joerg, your review is expected before he apply. Thanks in advance. On Sun, 2019-02-17 at 17:04 +0800, Yong Wu wrote: > In some SoCs like mt8183, SMI add GALS(Global Async Local Sync) module > which can help synchronize for th

Re: [PATCH 04/13] iommu/mediatek: Add device_link between the consumer and the larb devices

2019-03-13 Thread Yong Wu
Hi Robin, sorry for reply so late. On Wed, 2019-02-27 at 19:30 +, Robin Murphy wrote: > On 01/01/2019 04:51, Yong Wu wrote: > > MediaTek IOMMU don't have its power-domain. all the consumer connect > > with smi-larb, then connect with smi-common. > &

Re: [PATCH 02/13] driver core: Remove the link if there is no driver with AUTO flag

2019-03-13 Thread Yong Wu
On Tue, 2019-03-12 at 16:17 -0700, Evan Green wrote: > On Tue, Mar 12, 2019 at 7:21 AM Matthias Brugger > wrote: > > > > > > > > On 05/03/2019 20:03, Evan Green wrote: > > > On Wed, Feb 27, 2019 at 6:33 AM Yong Wu wrote: > > >> > &g

[PATCH v6 11/22] iommu/mediatek: Move vld_pa_rng into plat_data

2019-02-17 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 --- drivers/iommu/mtk_iommu.c | 3 ++- drivers/iommu/mtk_iommu.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git

[PATCH v6 14/22] iommu/mediatek: Add mmu1 support

2019-02-17 Thread Yong Wu
lue of that 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 --- drivers/iommu/mtk_iommu.c | 46 +- 1 file changed, 29 insertions(+),

[PATCH v6 17/22] memory: mtk-smi: Get rid of need_larbid

2019-02-17 Thread Yong Wu
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 --- driv

[PATCH v6 16/22] memory: mtk-smi: Add bus_sel for mt8183

2019-02-17 Thread Yong Wu
: Matthias Brugger Signed-off-by: Yong Wu --- drivers/memory/mtk-smi.c | 22 -- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c index 9790801..08cf40d 100644 --- a/drivers/memory/mtk-smi.c +++ b/drivers/memory/mtk

[PATCH v6 18/22] iommu/mediatek: Fix VLD_PA_RNG register backup when suspend

2019-02-17 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 --- drivers/iommu/mtk_iommu.c | 2 ++ dri

[PATCH v6 15/22] memory: mtk-smi: Invoke pm runtime_callback to enable clocks

2019-02-17 Thread Yong Wu
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 --- drivers/memory/mtk-smi.c | 113 ++- 1 file changed, 72 insertions(+), 41 deletions(-) diff --git

[PATCH v6 13/22] iommu/mediatek: Add mt8183 IOMMU support

2019-02-17 Thread Yong Wu
eans 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 ---

[PATCH v6 19/22] iommu/mediatek: Add shutdown callback

2019-02-17 Thread Yong Wu
This patch only improve the shutdown flow. The shutdown callback will mute the M4U HW when the system shutdown. Signed-off-by: Yong Wu Reviewed-by: Evan Green --- drivers/iommu/mtk_iommu.c| 6 ++ drivers/iommu/mtk_iommu_v1.c | 6 ++ 2 files changed, 12 insertions(+) diff --git

[PATCH v6 22/22] iommu/mediatek: Switch to SPDX license identifier

2019-02-17 Thread Yong Wu
Switch to SPDX license identifier for MediaTek iommu/smi and their header files. Signed-off-by: Yong Wu Reviewed-by: Rob Herring Reviewed-by: Evan Green --- drivers/iommu/mtk_iommu.c | 10 +- drivers/iommu/mtk_iommu.h | 10 +- drivers

[PATCH v6 21/22] iommu/mediatek: Fix iova_to_phys PA start for 4GB mode

2019-02-17 Thread Yong Wu
hus, we always add bit32 for PA when entering mtk_iommu_map. But in the iova_to_phys, the CPU don't need this bit32 if the PA is from 0x1_4000_ to 0x1__. This patch discards the bit32 in this iova_to_phys in the 4GB mode. Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c |

[PATCH v6 20/22] iommu/mediatek: Rename enable_4GB to dram_is_4gb

2019-02-17 Thread Yong Wu
This patch only rename the variable name from enable_4GB to dram_is_4gb for readable. Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 10 +- drivers/iommu/mtk_iommu.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu

[PATCH v6 10/22] iommu/mediatek: Move reset_axi into plat_data

2019-02-17 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: Yong Wu

Re: [PATCH v6 06/20] iommu/io-pgtable-arm-v7s: Extend MediaTek 4GB Mode

2019-02-17 Thread Yong Wu
On Tue, 2019-02-05 at 15:11 -0800, Evan Green wrote: > On Fri, Feb 1, 2019 at 1:42 AM Yong Wu wrote: > > > > On Thu, 2019-01-31 at 11:23 -0800, Evan Green wrote: > > > On Wed, Jan 30, 2019 at 10:59 PM Yong Wu wrote: > > > > > > > > On

[PATCH v6 00/22] MT8183 IOMMU SUPPORT

2019-02-17 Thread Yong Wu
Fix typo in the commit message of dt-binding. 2) Change larb2/larb3 to the special larbs. 3) Refactor the larb-id 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 iopt

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

2019-02-17 Thread Yong Wu
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 space

[PATCH v6 03/22] memory: mtk-smi: Use a general config_port interface

2019-02-17 Thread Yong Wu
. In 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 v6 05/22] iommu/io-pgtable-arm-v7s: Add paddr_to_iopte and iopte_to_paddr helpers

2019-02-17 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 v6 06/22] iommu/io-pgtable-arm-v7s: Extend MediaTek 4GB Mode

2019-02-17 Thread Yong Wu
ss could be over 4GB, the mt8183 support it while the previous mt8173 don't. thus keep it as is. Signed-off-by: Yong Wu Reviewed-by: Robin Murphy --- Comparing the previous version, I add MTK_4GB quirk always since mtk_iommu has already controlled the PA itself. Helped from Evan. --- drivers/iommu/

[PATCH v6 08/22] iommu/mediatek: Add larb-id remapped support

2019-02-17 Thread Yong Wu
lso is a preparing patch for mt8183. Signed-off-by: Yong Wu Reviewed-by: Nicolas Boichat Reviewed-by: Evan Green --- 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/drivers/iommu/mtk_iommu.c index 685f

[PATCH v6 09/22] iommu/mediatek: Refine protect memory definition

2019-02-17 Thread Yong Wu
-off-by: Yong Wu --- 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 3bf7b76..483f6e8 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -52,12 +52,9

[PATCH v6 02/22] iommu/mediatek: Use a struct as the platform data

2019-02-17 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 v6 12/22] memory: mtk-smi: Add gals support

2019-02-17 Thread Yong Wu
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 preparing patch fo

[PATCH v6 07/22] iommu/mediatek: Add bclk can be supported optionally

2019-02-17 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 v6 04/22] memory: mtk-smi: Use a struct for the platform data for smi-common

2019-02-17 Thread Yong Wu
mt8183. 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 9fd6b3d..8a2f968

Re: [PATCH v6 21/22] iommu/mediatek: Fix iova_to_phys PA start for 4GB mode

2019-02-20 Thread Yong Wu
On Tue, 2019-02-19 at 15:33 -0800, Evan Green wrote: > On Sun, Feb 17, 2019 at 1:09 AM Yong Wu wrote: > > > > In the 4GB mode, the physical address is remapped, > > > > Here is the detailed remap relationship. > > CPU PA ->HW PA > > 0x4

Re: [PATCH v5 17/20] memory: mtk-smi: Get rid of need_larbid

2019-02-01 Thread Yong Wu
On Thu, 2019-01-31 at 09:45 -0800, Evan Green wrote: > On Wed, Jan 30, 2019 at 7:22 PM Yong Wu wrote: > > > > On Wed, 2019-01-30 at 11:11 -0800, Evan Green wrote: > > > On Mon, Dec 31, 2018 at 7:59 PM Yong Wu wrote: > > > > > > > > The "m

Re: [PATCH v6 06/20] iommu/io-pgtable-arm-v7s: Extend MediaTek 4GB Mode

2019-02-01 Thread Yong Wu
On Thu, 2019-01-31 at 11:23 -0800, Evan Green wrote: > On Wed, Jan 30, 2019 at 10:59 PM Yong Wu wrote: > > > > On Wed, 2019-01-30 at 10:28 -0800, Evan Green wrote: > > > On Mon, Dec 31, 2018 at 7:57 PM Yong Wu wrote: > > > > > > > > MediaTek extend

Re: [PATCH v5 10/20] iommu/mediatek: Move reset_axi into plat_data

2019-01-30 Thread Yong Wu
On Wed, 2019-01-30 at 10:30 -0800, Evan Green wrote: > On Mon, Dec 31, 2018 at 7:58 PM Yong Wu wrote: > > > > In mt8173 and mt8183, 0x48 is REG_MMU_STANDARD_AXI_MODE while > > it is extended to REG_MMU_CTRL which contains _STANDARD_AXI_MODE in > > the other SoCs. I move

Re: [PATCH v5 17/20] memory: mtk-smi: Get rid of need_larbid

2019-01-30 Thread Yong Wu
On Wed, 2019-01-30 at 11:11 -0800, Evan Green wrote: > On Mon, Dec 31, 2018 at 7:59 PM Yong Wu wrote: > > > > The "mediatek,larb-id" has already been parsed in MTK IOMMU driver. > > It's no need to parse it again in SMI driver. Only clean some codes. > >

Re: [PATCH v5 14/20] iommu/mediatek: Add mmu1 support

2019-01-30 Thread Yong Wu
On Wed, 2019-01-30 at 10:55 -0800, Evan Green wrote: > On Mon, Dec 31, 2018 at 7:59 PM Yong Wu wrote: > > > > Normally the M4U HW connect EMI with smi. the diagram is like below: > > EMI > >| > > M4U > >

Re: [PATCH v6 06/20] iommu/io-pgtable-arm-v7s: Extend MediaTek 4GB Mode

2019-01-30 Thread Yong Wu
On Wed, 2019-01-30 at 10:28 -0800, Evan Green wrote: > On Mon, Dec 31, 2018 at 7:57 PM Yong Wu wrote: > > > > MediaTek extend the arm v7s descriptor to support the dram over 4GB. > > > > In the mt2712 and mt8173, it's called "4GB mode", the phy

Re: [PATCH v5 15/20] memory: mtk-smi: Invoke pm runtime_callback to enable clocks

2019-01-30 Thread Yong Wu
On Wed, 2019-01-30 at 11:05 -0800, Evan Green wrote: > On Mon, Dec 31, 2018 at 7:59 PM Yong Wu wrote: > > > > This patch only move the clk_prepare_enable and config_port into the > > runtime suspend/resume callback. It doesn't change the code content > > and sequence.

Re: [PATCH v5 13/20] iommu/mediatek: Add mt8183 IOMMU support

2019-01-30 Thread Yong Wu
On Wed, 2019-01-30 at 10:31 -0800, Evan Green wrote: > On Mon, Dec 31, 2018 at 7:59 PM Yong Wu wrote: > > > > The M4U IP blocks in mt8183 is MediaTek's generation2 M4U which use > > the ARM Short-descriptor like mt8173, and most of the HW registers > > are the s

Re: [PATCH v5 16/20] memory: mtk-smi: Add bus_sel for mt8183

2019-01-30 Thread Yong Wu
On Wed, 2019-01-30 at 11:07 -0800, Evan Green wrote: > On Mon, Dec 31, 2018 at 7:59 PM Yong Wu wrote: > > > > There are 2 mmu cells in a M4U HW. we could adjust some larbs entering > > mmu0 or mmu1 to balance the bandwidth via the smi-common register > > SMI_BUS_SEL(0x2

Re: [PATCH v5 01/20] dt-bindings: mediatek: Add binding for mt8183 IOMMU and SMI

2019-01-30 Thread Yong Wu
Hi Evan, Thanks very much for reviewing this patchset. On Wed, 2019-01-30 at 10:27 -0800, Evan Green wrote: > On Mon, Dec 31, 2018 at 7:56 PM Yong Wu wrote: > > > > This patch adds decriptions for mt8183 IOMMU and SMI. > > > > mt8183 has only one M4U like mt8173 and i

Re: [PATCH v5 19/20] iommu/mediatek: Add shutdown callback

2019-01-30 Thread Yong Wu
On Wed, 2019-01-30 at 11:12 -0800, Evan Green wrote: > On Mon, Dec 31, 2018 at 8:00 PM Yong Wu wrote: > > > > In the reboot burning test, if some Multimedia HW has something wrong, > > It may keep send the invalid request to IOMMU. In order to avoid > > affect the reboo

Re: [PATCH v5 11/20] iommu/mediatek: Move vld_pa_rng into plat_data

2019-01-30 Thread Yong Wu
On Wed, 2019-01-30 at 10:30 -0800, Evan Green wrote: > On Mon, Dec 31, 2018 at 7:58 PM Yong Wu wrote: > > > > 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. > >

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

2019-06-10 Thread Yong Wu
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 spaces ar

[PATCH v7 05/21] iommu/io-pgtable-arm-v7s: Add paddr_to_iopte and iopte_to_paddr helpers

2019-06-10 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 v7 04/21] memory: mtk-smi: Use a struct for the platform data for smi-common

2019-06-10 Thread Yong Wu
mt8183. 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 9fd6b3d..8a2f968

[PATCH v7 02/21] iommu/mediatek: Use a struct as the platform data

2019-06-10 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 v7 10/21] iommu/mediatek: Move reset_axi into plat_data

2019-06-10 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: Yong Wu

[PATCH v7 11/21] iommu/mediatek: Move vld_pa_rng into plat_data

2019-06-10 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 --- drivers/iommu/mtk_iommu.c | 3 ++- drivers/iommu/mtk_iommu.h | 1 + 2 files changed, 3 insertions(+), 1

[PATCH v7 12/21] memory: mtk-smi: Add gals support

2019-06-10 Thread Yong Wu
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 preparing patch fo

[PATCH v7 17/21] memory: mtk-smi: Get rid of need_larbid

2019-06-10 Thread Yong Wu
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 Rev

[PATCH v7 15/21] memory: mtk-smi: Invoke pm runtime_callback to enable clocks

2019-06-10 Thread Yong Wu
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 --- drivers/memory/mtk-smi.c | 113 ++- 1 file changed, 72 insertions(+), 41 deletions(-) diff --git

[PATCH v7 13/21] iommu/mediatek: Add mt8183 IOMMU support

2019-06-10 Thread Yong Wu
eans 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 Reviewed-by:

Re: [PATCH v2 02/12] iommu/mediatek: Add probe_defer for smi-larb

2019-06-21 Thread Yong Wu
On Wed, 2019-06-19 at 15:52 +0200, Matthias Brugger wrote: > > On 10/06/2019 14:55, Yong Wu wrote: > > The iommu consumer should use device_link to connect with the > > smi-larb(supplier). then the smi-larb should run before the iommu > > consumer. Here we delay the io

Re: [PATCH v7 19/21] iommu/mediatek: Rename enable_4GB to dram_is_4gb

2019-06-21 Thread Yong Wu
On Fri, 2019-06-21 at 12:10 +0200, Matthias Brugger wrote: > > On 20/06/2019 15:59, Yong Wu wrote: > > On Tue, 2019-06-18 at 18:06 +0200, Matthias Brugger wrote: > >> > >> On 10/06/2019 14:17, Yong Wu wrote: > >>> This patch only rename the variable

Re: [PATCH v2 05/12] media: mtk-jpeg: Get rid of mtk_smi_larb_get/put

2019-06-21 Thread Yong Wu
On Thu, 2019-06-20 at 17:20 +0200, Matthias Brugger wrote: > > On 10/06/2019 14:55, Yong Wu wrote: > > 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

Re: [PATCH v7 17/21] memory: mtk-smi: Get rid of need_larbid

2019-06-20 Thread Yong Wu
On Tue, 2019-06-18 at 15:45 +0200, Matthias Brugger wrote: > > On 10/06/2019 14:17, Yong Wu wrote: > > The "mediatek,larb-id" has already been parsed in MTK IOMMU driver. > > It's no need to parse it again in SMI driver. Only clean some codes. > > This patch

Re: [PATCH v7 20/21] iommu/mediatek: Fix iova_to_phys PA start for 4GB mode

2019-06-20 Thread Yong Wu
On Tue, 2019-06-18 at 18:35 +0200, Matthias Brugger wrote: > > On 10/06/2019 14:17, Yong Wu wrote: > > In the 4GB mode, the physical address is remapped, > > > > Here is the detailed remap relationship. > > CPU PA ->HW PA > > 0x4000

Re: [PATCH v7 19/21] iommu/mediatek: Rename enable_4GB to dram_is_4gb

2019-06-20 Thread Yong Wu
On Tue, 2019-06-18 at 18:06 +0200, Matthias Brugger wrote: > > On 10/06/2019 14:17, Yong Wu wrote: > > This patch only rename the variable name from enable_4GB to > > dram_is_4gb for readable. > > From my understanding this is true when available RAM > 4GB so I

[PATCH v7 00/21] MT8183 IOMMU SUPPORT

2019-06-10 Thread Yong Wu
) 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/linux-mediatek/2018-September/014881.html Yong Wu (21): dt-bindings: mediatek: Add binding for mt8183 IOMMU and S

[PATCH v2 10/12] iommu/mediatek: Use builtin_platform_driver

2019-06-10 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 v2 09/12] memory: mtk-smi: Get rid of mtk_smi_larb_get/put

2019-06-10 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 v2 11/12] arm: dts: mediatek: Get rid of mediatek,larb for MM nodes

2019-06-10 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

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

2019-06-10 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 v7 21/21] iommu/mediatek: Switch to SPDX license identifier

2019-06-10 Thread Yong Wu
Switch to SPDX license identifier for MediaTek iommu/smi and their header files. Signed-off-by: Yong Wu Reviewed-by: Rob Herring Reviewed-by: Evan Green --- drivers/iommu/mtk_iommu.c | 10 +- drivers/iommu/mtk_iommu.h | 10 +- drivers

[PATCH v7 18/21] iommu/mediatek: Fix VLD_PA_RNG register backup when suspend

2019-06-10 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 --- drivers/iommu/mtk_iommu.c | 2 ++ dri

[PATCH v7 19/21] iommu/mediatek: Rename enable_4GB to dram_is_4gb

2019-06-10 Thread Yong Wu
This patch only rename the variable name from enable_4GB to dram_is_4gb for readable. Signed-off-by: Yong Wu Reviewed-by: Evan Green --- drivers/iommu/mtk_iommu.c | 10 +- drivers/iommu/mtk_iommu.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/iommu

[PATCH v7 20/21] iommu/mediatek: Fix iova_to_phys PA start for 4GB mode

2019-06-10 Thread Yong Wu
PA range for 4GB mode") Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 67cab2d..34f2e40 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iomm

[PATCH v7 16/21] memory: mtk-smi: Add bus_sel for mt8183

2019-06-10 Thread Yong Wu
: Matthias Brugger Signed-off-by: Yong Wu Reviewed-by: Evan Green --- drivers/memory/mtk-smi.c | 22 -- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c index 9790801..08cf40d 100644 --- a/drivers/memory/mtk-smi.c

[PATCH v7 08/21] iommu/mediatek: Add larb-id remapped support

2019-06-10 Thread Yong Wu
lso is a preparing patch for mt8183. Signed-off-by: Yong Wu Reviewed-by: Nicolas Boichat Reviewed-by: Evan Green --- 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/drivers/iommu/mtk_iommu.c index 264d

[PATCH v7 09/21] iommu/mediatek: Refine protect memory definition

2019-06-10 Thread Yong Wu
-off-by: Yong Wu Reviewed-by: Evan Green --- 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 ad838b9..d38dfa2 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c

[PATCH v2 00/12] Clean up "mediatek,larb" after adding device_link

2019-06-10 Thread Yong Wu
.linuxfoundation.org/pipermail/iommu/2019-January/032387.html Yong Wu (12): dt-binding: mediatek: Get rid of mediatek,larb for multimedia HW iommu/mediatek: Add probe_defer for smi-larb iommu/mediatek: Add device_link between the consumer and the larb devices memory: mtk-smi: Add device-l

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

2019-06-10 Thread Yong Wu
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 Doc

[PATCH v2 02/12] iommu/mediatek: Add probe_defer for smi-larb

2019-06-10 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 v7 06/21] iommu/io-pgtable-arm-v7s: Extend MediaTek 4GB Mode

2019-06-10 Thread Yong Wu
ss could be over 4GB, the mt8183 support it while the previous mt8173 don't. thus keep it as is. Signed-off-by: Yong Wu Reviewed-by: Robin Murphy Reviewed-by: Evan Green --- drivers/iommu/io-pgtable-arm-v7s.c | 31 --- drivers/iommu/mtk_iommu.c | 20 +

[PATCH v7 07/21] iommu/mediatek: Add bclk can be supported optionally

2019-06-10 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 v7 14/21] iommu/mediatek: Add mmu1 support

2019-06-10 Thread Yong Wu
lue of that 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 --- drivers/iommu/mtk_iommu.c | 46 +- 1 file changed, 29 insertions(+),

[PATCH v7 03/21] memory: mtk-smi: Use a general config_port interface

2019-06-10 Thread Yong Wu
. In 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 v2 08/12] drm/mediatek: Get rid of mtk_smi_larb_get/put

2019-06-10 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 --- drivers

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

2019-06-10 Thread Yong Wu
-by: Tomasz Figa Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c| 12 drivers/iommu/mtk_iommu_v1.c | 13 - 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index f7599d8..7b70574 100644 --- a/drivers

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

2019-06-10 Thread Yong Wu
: Matthias Brugger Suggested-by: Tomasz Figa Signed-off-by: Yong Wu --- drivers/memory/mtk-smi.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c index 9688341..98b1180 100644 --- a/drivers/memory/mtk-smi.c

[PATCH v2 05/12] media: mtk-jpeg: Get rid of mtk_smi_larb_get/put

2019-06-10 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/platform/mtk

[PATCH v2 07/12] media: mtk-vcodec: Get rid of mtk_smi_larb_get/put

2019-06-10 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/platform

[PATCH v2 06/12] media: mtk-mdp: Get rid of mtk_smi_larb_get/put

2019-06-10 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/media

Re: [PATCH v7 14/21] iommu/mediatek: Add mmu1 support

2019-06-18 Thread Yong Wu
On Tue, 2019-06-18 at 15:19 +0900, Tomasz Figa wrote: > On Mon, Jun 10, 2019 at 9:21 PM Yong Wu wrote: > > > > Normally the M4U HW connect EMI with smi. the diagram is like below: > > EMI > >| > > M4U > >

Re: [PATCH v7 16/21] memory: mtk-smi: Add bus_sel for mt8183

2019-06-18 Thread Yong Wu
On Mon, 2019-06-17 at 18:23 +0200, Matthias Brugger wrote: > > On 10/06/2019 14:17, Yong Wu wrote: > > There are 2 mmu cells in a M4U HW. we could adjust some larbs entering > > mmu0 or mmu1 to balance the bandwidth via the smi-common register > > SMI_BUS_SEL(0x220)

Re: [PATCH v2 08/12] drm/mediatek: Get rid of mtk_smi_larb_get/put

2019-06-18 Thread Yong Wu
On Tue, 2019-06-18 at 14:35 +0800, CK Hu wrote: > Hi, Yong: > > On Mon, 2019-06-10 at 20:55 +0800, Yong Wu wrote: > > MediaTek IOMMU has already added the device_link between the consumer > > and smi-larb device. If the drm device call the pm_runtime_get_syn

Re: [PATCH v8 07/21] iommu/io-pgtable-arm-v7s: Extend MediaTek 4GB Mode

2019-07-11 Thread Yong Wu
On Wed, 2019-07-10 at 15:36 +0100, Will Deacon wrote: > On Sat, Jun 29, 2019 at 10:09:13AM +0800, Yong Wu wrote: > > MediaTek extend the arm v7s descriptor to support the dram over 4GB. > > > > In the mt2712 and mt8173, it's called "4GB mode", the physical

Re: [PATCH v8 07/21] iommu/io-pgtable-arm-v7s: Extend MediaTek 4GB Mode

2019-07-13 Thread Yong Wu
On Thu, 2019-07-11 at 13:31 +0100, Will Deacon wrote: > On Thu, Jul 11, 2019 at 07:53:56PM +0800, Yong Wu wrote: > > On Wed, 2019-07-10 at 15:36 +0100, Will Deacon wrote: > > > On Sat, Jun 29, 2019 at 10:09:13AM +0800, Yong Wu wrote: > > > > MediaTek extend the

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