Re: [PATCH v4 2/3] iommu/mediatek: add flag for legacy ivrp paddr

2020-09-14 Thread Matthias Brugger
On 07/09/2020 12:16, Fabien Parent wrote: Add a new flag in order to select which IVRP_PADDR format is used by an SoC. Signed-off-by: Fabien Parent Reviewed-by: Yong Wu Reviewed-by: Matthias Brugger --- v4: no change v3: set LEGACY_IVRP_PADDR as a flag instead of platform data v2

Re: [trivial PATCH] treewide: Convert switch/case fallthrough; to break;

2020-09-10 Thread Matthias Brugger
default: dev_err_ratelimited(dev->dev, "tx urb failed: %d\n", urb->status); - fallthrough; - case 0: break; } Reviewed-by: Matthias Brugger

Re: Aw: [PATCH 00/18] Convert arch/arm to use iommu-dma

2020-08-27 Thread Matthias Brugger
On 27/08/2020 14:31, Frank Wunderlich wrote: Tested full series on bananapi r2 (mt7623/mt2701, 5.9-rc1 + hdmi-patches), works so far fbcon+x without issues Tested-by: Frank Wunderlich Thanks for testing. Robin this is especially relevant for: [PATCH 09/18] iommu/mediatek-v1: Add

Re: [RESEND PATCH v4] iommu/mediatek: check 4GB mode by reading infracfg

2020-08-27 Thread Matthias Brugger
Cc: Yong Wu Cc: Yingjoe Chen Cc: Christoph Hellwig Cc: Rob Herring Cc: Matthias Brugger Signed-off-by: Miles Chen Reviewed-by: Matthias Brugger --- Change since v3 - use lore.kernel.org links - move "change since..." after "---" Change since v2: - determi

Re: [PATCH v3] iommu/mediatek: check 4GB mode by reading infracfg

2020-07-22 Thread Matthias Brugger
ob Herring Cc: Matthias Brugger Signed-off-by: Miles Chen The formating should look like this: In previous discussion [1] and [2], we found that it is risky to use max_pfn or totalram_pages to tell if 4GB mode is enabled. Check 4GB mode by reading infracfg register, remove the usage of the u

Re: [PATCH v2] iommu/mediatek: check 4GB mode by reading infracfg

2020-07-21 Thread Matthias Brugger
On 21/07/2020 13:24, Yong Wu wrote: On Tue, 2020-07-21 at 11:40 +0200, Matthias Brugger wrote: On 21/07/2020 04:16, Miles Chen wrote: In previous discussion [1] and [2], we found that it is risky to use max_pfn or totalram_pages to tell if 4GB mode is enabled. Check 4GB mode by reading

Re: [PATCH v2] iommu/mediatek: check 4GB mode by reading infracfg

2020-07-21 Thread Matthias Brugger
/733 [2] https://lkml.org/lkml/2020/6/4/136 [3] https://lkml.org/lkml/2020/7/15/1147 Cc: Mike Rapoport Cc: David Hildenbrand Cc: Yong Wu Cc: Yingjoe Chen Cc: Christoph Hellwig Cc: Yong Wu Cc: Chao Hao Cc: Rob Herring Cc: Matthias Brugger Signed-off-by: Miles Chen --- drivers/iommu

Re: [PATCH 4/4] iommu/mediatek: check 4GB mode by reading infracfg

2020-07-15 Thread Matthias Brugger
On 02/07/2020 11:37, Miles Chen wrote: In previous disscusion [1] and [2], we found that it is risky to use max_pfn or totalram_pages to tell if 4GB mode is enabled. Check 4GB mode by reading infracfg register, remove the usage of the unexported symbol max_pfn. [1]

Re: [PATCH] iommu/mediatek: Include liunx/dma-mapping.h

2020-07-13 Thread Matthias Brugger
On 13/07/2020 12:16, Joerg Roedel wrote: From: Joerg Roedel This fixes a compile error when cross-compiling the driver on x86-32. Signed-off-by: Joerg Roedel Reviewed-by: Matthias Brugger --- drivers/iommu/mtk_iommu.h | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers

Re: [PATCH 01/21] dt-binding: memory: mediatek: Add a common larb-port header file

2020-07-12 Thread Matthias Brugger
On 11/07/2020 08:48, Yong Wu wrote: Put all the macros about smi larb/port togethers, this is a preparing patch for extending LARB_NR and adding new dom-id support. Signed-off-by: Yong Wu --- include/dt-bindings/memory/mt2712-larb-port.h | 2 +-

Re: [PATCH v6 07/10] iommu/mediatek: Add REG_MMU_WR_LEN_CTRL register definition

2020-07-10 Thread Matthias Brugger
) in MMU_WR_LEN_CTRL register. Cc: Matthias Brugger Signed-off-by: Chao Hao Reviewed-by: Matthias Brugger --- drivers/iommu/mtk_iommu.c | 11 +++ drivers/iommu/mtk_iommu.h | 1 + 2 files changed, 12 insertions(+) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index

Re: [PATCH v6 09/10] iommu/mediatek: Modify MMU_CTRL register setting

2020-07-06 Thread Matthias Brugger
e bit > when setting F_MMU_TF_PROT_TO_PROGRAM_ADDR as otherwise the > bit will be cleared and IOMMU performance will drop. > > Cc: Matthias Brugger > Cc: Yong Wu > Signed-off-by: Chao Hao Reviewed-by: Matthias Brugger > --- > drivers/iommu/mtk_iommu.c | 8 +--- &

Re: [PATCH v6 06/10] iommu/mediatek: Add sub_comm id in translation fault

2020-07-06 Thread Matthias Brugger
common_id above. > > We can also distinguish if the M4U HW has sub_common by HAS_SUB_COMM > macro. > > Cc: Matthias Brugger > Signed-off-by: Chao Hao > Reviewed-by: Yong Wu Reviewed-by: Matthias Brugger > --- > drivers/iommu/mtk_iommu.c | 21 ++--- &g

Re: [PATCH v6 04/10] iommu/mediatek: Setting MISC_CTRL register

2020-07-06 Thread Matthias Brugger
ands with > higher priority. Otherwise the sending of write commands will be done in > order. The feature is controlled by OUT_ORDER_WR_EN platform data flag. > > Cc: Matthias Brugger > Suggested-by: Yong Wu > Signed-off-by: Chao Hao Reviewed-by: Matthias Brugger > --- > dr

Re: [PATCH v6 03/10] iommu/mediatek: Use a u32 flags to describe different HW features

2020-07-06 Thread Matthias Brugger
and check for a flag present. >> No functional change. >> >> Cc: Yong Wu >> Suggested-by: Matthias Brugger >> Signed-off-by: Chao Hao >> Reviewed-by: Matthias Brugger >> --- >> drivers/iommu/mtk_iommu.c | 28 +--- >>

Re: [PATCH v5 07/10] iommu/mediatek: Add REG_MMU_WR_LEN register definition

2020-07-01 Thread Matthias Brugger
On 30/06/2020 12:59, chao hao wrote: > On Mon, 2020-06-29 at 12:16 +0200, Matthias Brugger wrote: >> >> On 29/06/2020 09:13, Chao Hao wrote: >>> Some platforms(ex: mt6779) need to improve performance by setting >>> REG_MMU_WR_LEN register. And we can use WR_THRO

Re: [PATCH v5 04/10] iommu/mediatek: Setting MISC_CTRL register

2020-07-01 Thread Matthias Brugger
On 30/06/2020 12:53, chao hao wrote: > On Mon, 2020-06-29 at 11:28 +0200, Matthias Brugger wrote: >> >> On 29/06/2020 09:13, Chao Hao wrote: >>> Add F_MMU_IN_ORDER_WR_EN and F_MMU_STANDARD_AXI_MODE_BIT definition >>> in MISC_CTRL register. >>> F_

Re: [PATCH v5 10/10] iommu/mediatek: Add mt6779 basic support

2020-06-29 Thread Matthias Brugger
On 29/06/2020 09:13, Chao Hao wrote: > 1. Start from mt6779, INVLDT_SEL move to offset=0x2c, so we add >REG_MMU_INV_SEL_GEN2 definition and mt6779 uses it. > 2. Add mt6779_data to support mm_iommu HW init. > > Cc: Yong Wu > Cc: Matthias Brugger > Signed-off-by

Re: [PATCH v5 09/10] iommu/mediatek: Modify MMU_CTRL register setting

2020-06-29 Thread Matthias Brugger
cleared and IOMMU performance will drop. > Suggested-by: Matthias Brugger > Suggested-by: Yong Wu > Signed-off-by: Chao Hao > --- > drivers/iommu/mtk_iommu.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/iommu/mtk_iommu.c b/dri

Re: [PATCH v5 07/10] iommu/mediatek: Add REG_MMU_WR_LEN register definition

2020-06-29 Thread Matthias Brugger
g mechanism(bit[5][21]=0) in MMU_WR_LEN_CTRL register. > > Cc: Matthias Brugger > Signed-off-by: Chao Hao > --- > drivers/iommu/mtk_iommu.c | 10 ++ > drivers/iommu/mtk_iommu.h | 2 ++ > 2 files changed, 12 insertions(+) > > diff --git a/drivers/iommu/mtk_iommu

Re: [PATCH v5 08/10] iommu/mediatek: Extend protect pa alignment value

2020-06-29 Thread Matthias Brugger
On 29/06/2020 09:13, Chao Hao wrote: > Starting with mt6779, iommu needs to extend to 256 bytes from 128 > bytes which can send the max number of data for memory protection > pa alignment. So we can use a separate patch to modify it. > > Suggested-by: Matthias Brugger > S

Re: [PATCH v5 04/10] iommu/mediatek: Setting MISC_CTRL register

2020-06-29 Thread Matthias Brugger
ormal read command? > F_MMU_IN_ORDER_WR_EN: > If we set F_MMU_IN_ORDER_WR_EN(bit[1][17] = 0, out-of-order write), iommu > will re-order write command and send more higher priority write command > instead of sending write command in order. The feature be controlled > by OUT_ORDER_EN macro defi

Re: [PATCH v5 03/10] iommu/mediatek: Modify the usage of mtk_iommu_plat_data structure

2020-06-29 Thread Matthias Brugger
ested-by: Matthias Brugger > Signed-off-by: Chao Hao Reviewed-by: Matthias Brugger > --- > drivers/iommu/mtk_iommu.c | 23 --- > drivers/iommu/mtk_iommu.h | 16 ++-- > 2 files changed, 22 insertions(+), 17 deletions(-) > > diff --git a/dr

Re: [PATCH v4 6/7] iommu/mediatek: Add REG_MMU_WR_LEN definition preparing for mt6779

2020-06-21 Thread Matthias Brugger
On 19/06/2020 12:56, chao hao wrote: > On Wed, 2020-06-17 at 11:22 +0200, Matthias Brugger wrote: >> >> On 17/06/2020 05:00, Chao Hao wrote: >>> Some platforms(ex: mt6779) have a new register called by REG_MMU_WR_LEN >>> to improve performance. >>&g

Re: [PATCH v4 7/7] iommu/mediatek: Add mt6779 basic support

2020-06-18 Thread Matthias Brugger
On 18/06/2020 13:54, chao hao wrote: > On Wed, 2020-06-17 at 11:33 +0200, Matthias Brugger wrote: >> >> On 17/06/2020 05:00, Chao Hao wrote: >>> 1. Start from mt6779, INVLDT_SEL move to offset=0x2c, so we add >>>REG_MMU_INV_SEL_GEN2 definition

Re: [PATCH v4 3/7] iommu/mediatek: Set MISC_CTRL register

2020-06-17 Thread Matthias Brugger
On 17/06/2020 05:00, Chao Hao wrote: > Add F_MMU_IN_ORDER_WR_EN definition in MISC_CTRL. > In order to improve performance, we always disable STANDARD_AXI_MODE > and IN_ORDER_WR_EN in MISC_CTRL. > > Change since v3: The changelog should go below the '---' as we don't want this in the git

Re: [PATCH v4 7/7] iommu/mediatek: Add mt6779 basic support

2020-06-17 Thread Matthias Brugger
On 17/06/2020 05:00, Chao Hao wrote: > 1. Start from mt6779, INVLDT_SEL move to offset=0x2c, so we add >REG_MMU_INV_SEL_GEN2 definition and mt6779 uses it. > 2. Change PROTECT_PA_ALIGN from 128 byte to 256 byte. > 3. For REG_MMU_CTRL_REG register, we only need to change bit[2:0], >

Re: [PATCH v4 6/7] iommu/mediatek: Add REG_MMU_WR_LEN definition preparing for mt6779

2020-06-17 Thread Matthias Brugger
On 17/06/2020 05:00, Chao Hao wrote: > Some platforms(ex: mt6779) have a new register called by REG_MMU_WR_LEN > to improve performance. > This patch add this register definition. Please be more specific what this register is about. > > Signed-off-by: Chao Hao > --- >

Re: [PATCH v4 5/7] iommu/mediatek: Add sub_comm id in translation fault

2020-06-17 Thread Matthias Brugger
On 17/06/2020 05:00, Chao Hao wrote: > The max larb number that a iommu HW support is 8(larb0~larb7 in the below > diagram). > If the larb's number is over 8, we use a sub_common for merging > several larbs into one larb. At this case, we will extend larb_id: > bit[11:9] means common-id; >

Re: [PATCH v4 4/7] iommu/mediatek: Move inv_sel_reg into the plat_data

2020-06-17 Thread Matthias Brugger
On 17/06/2020 05:00, Chao Hao wrote: > For mt6779, MMU_INV_SEL register's offset is changed from > 0x38 to 0x2c, so we can put inv_sel_reg in the plat_data to > use it. > In addition, we renamed it to REG_MMU_INV_SEL_GEN1 and use it > before mt6779. > > Change since v3: > 1. Fix coding style >

Re: [PATCH v4 2/7] iommu/mediatek: Rename the register STANDARD_AXI_MODE(0x48) to MISC_CTRL

2020-06-17 Thread Matthias Brugger
n. So rename REG_MMU_MISC_CTRL may be more proper. > > This patch only rename the register name, no functional change. > > Signed-off-by: Chao Hao > Reviewed-by: Yong Wu Reviewed-by: Matthias Brugger > --- > drivers/iommu/mtk_iommu.c | 14 +++--- > drivers/iommu/mtk_i

Re: [PATCH 2/3] arm64: mm: reserve hugetlb CMA after numa_init

2020-06-09 Thread Matthias Brugger
On 08/06/2020 02:50, Song Bao Hua (Barry Song) wrote: > > >> -Original Message----- >> From: Matthias Brugger [mailto:matthias@gmail.com] >> Sent: Monday, June 8, 2020 8:15 AM >> To: Roman Gushchin ; Song Bao Hua (Barry Song) >> >> Cc: cata

Re: [PATCH 2/3] arm64: mm: reserve hugetlb CMA after numa_init

2020-06-07 Thread Matthias Brugger
On 03/06/2020 05:22, Roman Gushchin wrote: > On Wed, Jun 03, 2020 at 02:42:30PM +1200, Barry Song wrote: >> hugetlb_cma_reserve() is called at the wrong place. numa_init has not been >> done yet. so all reserved memory will be located at node0. >> >> Cc: Roman Gushchin >> Signed-off-by: Barry

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

2019-08-22 Thread Matthias Brugger
On 21/08/2019 15:53, Yong Wu wrote: > 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 ++-- > d

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

2019-06-21 Thread Matthias Brugger
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 name from enable_4GB to >>> dram_is_4gb for readable. >> >> From my

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

2019-06-20 Thread Matthias Brugger
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_get_sync also be called automatically. Please help me out find this relation. I seem to

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

2019-06-20 Thread Matthias Brugger
CCing Sascha On 20/06/2019 11:35, Matthias Brugger wrote: > > > On 13/06/2019 10:14, Pi-Hsun Shih wrote: >> Hi, >> When I tested this patch series (Based on linux 5.2.0-rc2, and with >> various other patch series about MT8183) with lockdep enabled, and I'm >

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

2019-06-20 Thread Matthias Brugger
9ec/0xcb8 > [5.465503] kthread+0x2b8/0x2d0 > [5.468727] ret_from_fork+0x10/0x18 > > On Mon, Jun 10, 2019 at 8:21 PM Yong Wu wrote: >> ... > > > On Mon, Jun 10, 2019 at 8:21 PM Yong Wu wrote: > >> There are 2 mmu cells in a M4U HW. we could adju

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

2019-06-19 Thread Matthias Brugger
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 iommu driver until the smi driver is > ready, then all the iommu consumer always is after the smi

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

2019-06-18 Thread Matthias Brugger
On 18/06/2019 14:10, Yong Wu wrote: > 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 band

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

2019-06-18 Thread Matthias Brugger
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_ 0x1_4000_ (Add bit32) > 0x8000_ 0x1_8000_ ... > 0xc000_ 0x1_c000_ ...

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

2019-06-18 Thread Matthias Brugger
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 think the name should be something like dram_bigger_4gb otherwise it may create confusion again.

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

2019-06-18 Thread Matthias Brugger
tk_smi_iommu" could also > be deleted. > I think we can get rid of struct mtk_smi_iommu and just add the struct mtk_smi_larb_iommu larb_imu[MTK_LARB_NR_MAX] directly to mtk_iommu_data, passing just that array to the components bind function. Never the less this patch looks fine: Revi

Re: [PATCH v7 21/21] iommu/mediatek: Switch to SPDX license identifier

2019-06-17 Thread Matthias Brugger
On 10/06/2019 14:18, Yong Wu wrote: > 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 Reviewed-by: Matthias Brugger > --- > d

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

2019-06-17 Thread Matthias Brugger
u > Reviewed-by: Evan Green Reviewed-by: Matthias Brugger > --- > drivers/iommu/mtk_iommu.c | 2 ++ > drivers/iommu/mtk_iommu.h | 1 + > 2 files changed, 3 insertions(+) > > diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c > index 6053b8b..86158d8 1006

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

2019-06-17 Thread Matthias Brugger
On 13/06/2019 10:20, Pi-Hsun Shih wrote: > (Sorry for the possibly double-posting, my last mail got rejected by > some mailing lists.) > > Hi, > When I tested this patch series (Based on linux 5.2.0-rc2, and with > various other patch series about MT8183) with lockdep enabled, and I'm > seeing

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

2019-06-17 Thread Matthias Brugger
e of smi-common is completely different with smi_ao_base > of gen1, thus I add new variable for that. > > CC: Matthias Brugger > Signed-off-by: Yong Wu > Reviewed-by: Evan Green > --- > drivers/memory/mtk-smi.c | 22 -- > 1 file changed, 20 insertions(

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

2019-06-17 Thread Matthias Brugger
(SMI_BUS_SEL need to be restored after smi-common resume every time.) > Also 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 >

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

2019-06-17 Thread Matthias Brugger
atch 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 file changed, 29 insertions(+), 17 deletions(-)

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

2019-06-17 Thread Matthias Brugger
> 7) the larb-id in smi-common is remapped. M4U should add its larbid_remap. > > Signed-off-by: Yong Wu > Reviewed-by: Evan Green Reviewed-by: Matthias Brugger > --- > drivers/iommu/mtk_iommu.c | 15 --- > drivers/iommu/mtk_iommu.h | 1 + > drivers/memory/

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

2019-06-17 Thread Matthias Brugger
i-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 for mt8183 which has GALS. > > CC: Matthias Brugger > Signed-off-by: Yong Wu >

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

2019-06-17 Thread Matthias Brugger
On 10/06/2019 14:17, 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. > > Signed-off-by: Yong Wu > Reviewed-by: Evan Green Reviewed-by: Matthias Brugger > --

Re: [PATCH v7 10/21] iommu/mediatek: Move reset_axi into plat_data

2019-06-17 Thread Matthias Brugger
lso 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, 3 insertions(+)

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

2019-06-17 Thread Matthias Brugger
the complex MACRO and use a common if-else > instead. > > Signed-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/dr

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

2019-06-17 Thread Matthias Brugger
ationship in this patch. > > If there is no this larb-id remapping in some SoCs, use the linear > mapping array instead. > > This also is a preparing patch for mt8183. > > Signed-off-by: Yong Wu > Reviewed-by: Nicolas Boichat > Reviewed-by: Evan Green Reviewed

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

2019-06-15 Thread Matthias Brugger
a preparing patch for mt8183. > > Signed-off-by: Yong Wu > Reviewed-by: Evan Green Reviewed-by: Matthias Brugger > --- > drivers/iommu/mtk_iommu.c | 10 +++--- > drivers/iommu/mtk_iommu.h | 3 +++ > 2 files changed, 10 insertions(+), 3 deletions(-) > > diff --git

Re: [PATCH v2 0/2] iommu/arm-smmu-v3: make sure the kdump kernel can work well when smmu is enabled

2019-04-24 Thread Matthias Brugger
! Resetting...\n"); > + WARN_ON(is_kdump_kernel() && !disable_bypass); > + arm_smmu_update_gbpa(smmu, GBPA_ABORT, 0); > } > > ret = arm_smmu_device_disable(smmu); > @@ -2553,6 +2549,8 @@ static int arm_smmu_device_reset(struct arm_smmu_device > *smmu,

Re: [PATCH] iommu/mediatek: fix leaked of_node references

2019-04-17 Thread Matthias Brugger
rivers/iommu/mtk_iommu.c:644:3-9: ERROR: missing of_node_put; acquired a > node pointer with refcount incremented on line 631, but without a > corresponding object release within this function. > > Signed-off-by: Wen Yang > Cc: Joerg Roedel > Cc: Matthias Brugger > Cc

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

2019-03-12 Thread Matthias Brugger
On 05/03/2019 20:03, Evan Green wrote: > On Wed, Feb 27, 2019 at 6:33 AM Yong Wu wrote: >> >> 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

Re: [PATCH v4 10/18] iommu/mediatek: Add mt8183 IOMMU support

2018-12-21 Thread Matthias Brugger
On 08/12/2018 09:39, 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 same. > > Here list main differences between mt8183 and mt8173/mt2712: > 1) mt8183 has only one M4U HW like

Re: [PATCH v4 04/18] memory: mtk-smi: Use a struct for the platform data for smi-common

2018-12-21 Thread Matthias Brugger
on_plat" before it is referred. > > This is a preparing patch for mt8183. > > Signed-off-by: Yong Wu Reviewed-by: Matthias Brugger > --- > drivers/memory/mtk-smi.c | 35 --- > 1 file changed, 24 insertions(+), 11 deletions(-) > > di

Re: [PATCH v4 03/18] memory: mtk-smi: Use a general config_port interface

2018-12-21 Thread Matthias Brugger
I'm not really happy with the name larb_special_mask but I can't think of anything else. The comment is not needed as it just rewords the name of the variable. Other then that (or even without changing anything): Reviewed-by: Matthias Brugger > }; > > struct mtk_smi { > @@ -176,17

Re: [PATCH v4 02/18] iommu/mediatek: Use a struct as the platform data

2018-12-21 Thread Matthias Brugger
On 08/12/2018 09:39, Yong Wu wrote: > 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 > drivers/iomm

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

2018-12-02 Thread Matthias Brugger
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 of the HW registers > are the same. > > Here list main changes in mt8183: > 1) mt8183 has only one M4U HW like mt8173. That's a change? >

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

2018-12-02 Thread Matthias Brugger
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 is fit for all the current mt2701, mt2712, mt7623, mt8173 > and mt8183. I'm trying to understand why we

Re: [PATCH 0/4] Add MT7623 dts bindings documentation

2018-10-05 Thread Matthias Brugger
On 03/10/2018 11:09, Matthias Brugger wrote: > Mediateks MT7623 SoC shares most of its component with MT2701. > This series adds devicetree documentation for all the devices. > > It applies cleanly against linux next, so I don't expect any merge > conflicts if this is taken

[PATCH 4/4] dt-bindings: mediatek: Add bindig for MT7623 IOMMU and SMI

2018-10-03 Thread Matthias Brugger
This patch add the binding documentation for the iommu and smi devices on the MT7623 SoC. Signed-off-by: Matthias Brugger --- .../bindings/memory-controllers/mediatek,smi-common.txt| 1 + .../bindings/memory-controllers/mediatek,smi-larb.txt | 3 ++- 2 files changed, 3

[PATCH 2/4] dt-bindings: iommu: mediatek: Add binding for MT7623

2018-10-03 Thread Matthias Brugger
This patch adds binding documentation for MT7623 SoC. Signed-off-by: Matthias Brugger --- Documentation/devicetree/bindings/iommu/mediatek,iommu.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/iommu/mediatek,iommu.txt b/Documentation

[PATCH 3/4] [media] dt-bindings: mediatek: Add JPEG Decoder binding for MT7623

2018-10-03 Thread Matthias Brugger
This patch adds a binding documentation for the JPEG Decoder of the MT7623 SoC. Signed-off-by: Matthias Brugger --- .../devicetree/bindings/media/mediatek-jpeg-decoder.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/media/mediatek-jpeg

[PATCH 0/4] Add MT7623 dts bindings documentation

2018-10-03 Thread Matthias Brugger
Mediateks MT7623 SoC shares most of its component with MT2701. This series adds devicetree documentation for all the devices. It applies cleanly against linux next, so I don't expect any merge conflicts if this is taken by Arnd through the arm-soc tree for v4.20

[PATCH 1/4] dt-bindings: clock: mediatek: add support for MT7623

2018-10-03 Thread Matthias Brugger
This patch adds bindings for apmixedsys, audsys, bpsys, ethsys, hifsys, imgsys, infracfg, mmsys, pericfg, topckgen and vdecsys for MT6723. Signed-off-by: Matthias Brugger --- .../devicetree/bindings/arm/mediatek/mediatek,apmixedsys.txt | 1 + .../devicetree/bindings/arm/mediatek/mediatek

Re: [PATCH v4] dt-bindings: mediatek: Add binding for mt2712 IOMMU and SMI

2018-07-18 Thread Matthias Brugger
On 18/07/18 15:54, Joerg Roedel wrote: > On Mon, Jul 16, 2018 at 03:28:14PM +0200, Matthias Brugger wrote: >>>> .../devicetree/bindings/iommu/mediatek,iommu.txt | 6 +- >>>> .../memory-controllers/mediatek,smi-common.txt | 6 +- >>>> .../m

Re: [PATCH v4] dt-bindings: mediatek: Add binding for mt2712 IOMMU and SMI

2018-07-16 Thread Matthias Brugger
On 21/06/18 08:27, Yong Wu wrote: > Hi Matthias, > > A gentle ping on this. > > On Thu, 2018-05-24 at 20:35 +0800, Yong Wu wrote: >> This patch adds decriptions for mt2712 IOMMU and SMI. >> >> In order to balance the bandwidth, mt2712 has two M4Us, two >> smi-commons, 10 smi-larbs. and

[PATCH] iommu/mediatek: Fix driver name

2017-10-30 Thread Matthias Brugger
for first generation to "mtk-iommu-v1". Fixes: b17336c55d89 ("iommu/mediatek: add support for mtk iommu generation one HW") Signed-off-by: Matthias Brugger <matthias@gmail.com> --- drivers/iommu/mtk_iommu_v1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --

Re: [PATCH] iommu/mediatek: Fix a build fail of m4u_type

2017-08-26 Thread Matthias Brugger
On 08/26/2017 09:33 PM, Matthias Brugger wrote: On 08/24/2017 08:24 AM, Yong Wu wrote: The commit ("iommu/mediatek: Enlarge the validate PA range for 4GB mode") introduce the following build error: drivers/iommu/mtk_iommu.c: In function 'mtk_iommu_hw_init': drivers/iommu/m

Re: [PATCH] iommu/mediatek: Fix a build fail of m4u_type

2017-08-26 Thread Matthias Brugger
On 08/24/2017 08:24 AM, Yong Wu wrote: The commit ("iommu/mediatek: Enlarge the validate PA range for 4GB mode") introduce the following build error: drivers/iommu/mtk_iommu.c: In function 'mtk_iommu_hw_init': drivers/iommu/mtk_iommu.c:536:30: error: 'const struct mtk_iommu_data' has

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

2017-08-04 Thread Matthias Brugger
On 08/04/2017 12:06 PM, Joerg Roedel wrote: On Fri, Aug 04, 2017 at 09:32:24AM +0800, honghui.zh...@mediatek.com wrote: Honghui Zhang (4): memory: mtk-smi: Use of_device_get_match_data helper memory: mtk-smi: add larbid handle routine dt-bindings: mediatek: add descriptions for

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

2017-07-31 Thread Matthias Brugger
information to get the register offset which controls whether enable iommu for this larb. This patch add the initialize routine for larbid. Signed-off-by: Honghui Zhang <honghui.zh...@mediatek.com> Reviewed-by: Matthias Brugger <matthias@gmail.com> --- drivers/memory/mtk-s

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

2017-07-27 Thread Matthias Brugger
On 07/27/2017 04:01 AM, honghui.zh...@mediatek.com wrote: 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

[PATCH] iommu/rockchip: Enable Rockchip IOMMU on ARM64

2017-05-03 Thread Matthias Brugger
ips.com> Signed-off-by: Tomasz Figa <tf...@chromium.org> Reviewed-by: Matthias Brugger <mbrug...@suse.com> --- drivers/iommu/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index 6ee3a25ae731..99c6366a2551 1006

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

2017-01-13 Thread Matthias Brugger
On 04/07/16 10:00, Matthias Brugger wrote: On 04/07/16 03:32, Honghui Zhang wrote: On Sun, 2016-07-03 at 21:12 +0200, Matthias Brugger wrote: On 07/03/2016 08:24 AM, Matthias Brugger wrote: On 06/08/2016 11:51 AM, honghui.zh...@mediatek.com wrote: From: Honghui Zhang <honghui

Re: [PATCH v7 2/4] soc: mediatek: Init MT8173 scpsys driver earlier

2016-10-26 Thread Matthias Brugger
Hi Yong, On 07/12/2016 11:01 AM, Yong Wu wrote: Hi Matthias, On Fri, 2016-07-08 at 14:47 +0200, Matthias Brugger wrote: On 06/07/16 07:22, James Liao wrote: On Sat, 2016-07-02 at 18:35 +0200, Matthias Brugger wrote: On 05/16/2016 11:28 AM, James Liao wrote: Some power domain comsumers

Re: [PATCH 1/3] memory: mediatek: Add a new interface mtk_smi_larb_is_ready

2016-07-25 Thread Matthias Brugger
On 20/07/16 05:01, Yong Wu wrote: Currently the iommu consumer always call iommu_present to get whether the iommu is ready. But in MTK IOMMU, this function can't indicate this. The IOMMU call bus_set_iommu->mtk_iommu_add_device-> mtk_iommu_attach_device to parse the iommu data, then it's able

Re: iommu/rockchip: Fix bugs and enable on ARM64

2016-07-15 Thread Matthias Brugger
On 08/07/16 03:01, Mark yao wrote: On 2016年06月27日 20:57, Joerg Roedel wrote: On Fri, Jun 24, 2016 at 10:13:25AM +0800, Shunqian Zheng wrote: drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 100 +++-- drivers/gpu/drm/rockchip/rockchip_drm_drv.h | 3 +

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

2016-07-04 Thread Matthias Brugger
On 04/07/16 03:32, Honghui Zhang wrote: On Sun, 2016-07-03 at 21:12 +0200, Matthias Brugger wrote: On 07/03/2016 08:24 AM, Matthias Brugger wrote: On 06/08/2016 11:51 AM, honghui.zh...@mediatek.com wrote: From: Honghui Zhang <honghui.zh...@mediatek.com> Add the dtsi node of

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

2016-07-03 Thread Matthias Brugger
On 07/03/2016 08:24 AM, Matthias Brugger wrote: On 06/08/2016 11:51 AM, honghui.zh...@mediatek.com wrote: From: Honghui Zhang <honghui.zh...@mediatek.com> Add the dtsi node of iommu and smi for mt2701. Signed-off-by: Honghui Zhang <honghui.zh...@mediatek.com> --- arch/arm/boo

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

2016-07-03 Thread Matthias Brugger
On 06/08/2016 11:51 AM, honghui.zh...@mediatek.com wrote: 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

Re: [PATCH v2 3/3] iommu: convert DT component matching to component_match_add_release()

2016-06-03 Thread Matthias Brugger
On 03/06/16 16:21, Russell King wrote: Convert DT component matching to use component_match_add_release(). Signed-off-by: Russell King <rmk+ker...@armlinux.org.uk> Reviewed-by: Matthias Brugger <matthias@gmail.com> --- drivers/iommu/mtk_iommu.c | 14 ++ 1

Re: [PATCH] iommu: convert DT component matching to component_match_add_release()

2016-06-03 Thread Matthias Brugger
On 03/06/16 09:58, Russell King wrote: Convert DT component matching to use component_match_add_release(). Signed-off-by: Russell King <rmk+ker...@armlinux.org.uk> --- Reviewed-by: Matthias Brugger <matthias@gmail.com> drivers/iommu/mtk_iommu.c | 13 ++--- 1

Re: [PATCH v10 0/5] MT8173 IOMMU SUPPORT

2016-03-02 Thread Matthias Brugger
Hi Arnd and Olof, On 26/02/16 12:06, Joerg Roedel wrote: Hi Philipp, On Fri, Feb 26, 2016 at 09:55:55AM +0100, Philipp Zabel wrote: Do you have a stable branch that I could base the mediatek-drm patches on and that I may include in a pull request to be merged via drm-next? You can base it

Re: [PATCH v8 3/5] memory: mediatek: Add SMI driver

2016-01-31 Thread Matthias Brugger
<p.za...@pengutronix.de> --- Signed-off-by: Matthias Brugger <matthias@gmail.com> Joerg would you mind to take this through your branch? Thanks, Matthias ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH v7 3/5] memory: mediatek: Add SMI driver

2016-01-18 Thread Matthias Brugger
On 18/12/15 09:09, Yong Wu wrote: This patch add SMI(Smart Multimedia Interface) driver. This driver is responsible to enable/disable iommu and control the power domain and clocks of each local arbiter. Signed-off-by: Yong Wu --- drivers/memory/Kconfig | 8 ++

Re: [PATCH v6 3/5] memory: mediatek: Add SMI driver

2015-12-14 Thread Matthias Brugger
On Tuesday 08 Dec 2015 17:49:11 Yong Wu wrote: > This patch add SMI(Smart Multimedia Interface) driver. This driver > is responsible to enable/disable iommu and control the power domain > and clocks of each local arbiter. > > Signed-off-by: Yong Wu > --- > Currently SMI

Re: [PATCH v6 4/5] iommu/mediatek: Add mt8173 IOMMU driver

2015-12-14 Thread Matthias Brugger
On 08/12/15 10:49, Yong Wu wrote: This patch adds support for mediatek m4u (MultiMedia Memory Management Unit). Signed-off-by: Yong Wu --- drivers/iommu/Kconfig | 15 + drivers/iommu/Makefile| 1 + drivers/iommu/mtk_iommu.c | 752

Re: [PATCH v2 4/6] soc: mediatek: Add SMI driver

2015-05-21 Thread Matthias Brugger
2015-05-21 8:16 GMT+02:00 Yong Wu yong...@mediatek.com: Hi Matthias, Thanks very much for your suggestion. Abort the smi clock name, Could you help check below. The others I will improve in next time. On Tue, 2015-05-19 at 13:14 +0200, Matthias Brugger wrote: 2015-05-15 11:43

Re: [PATCH v2 4/6] soc: mediatek: Add SMI driver

2015-05-21 Thread Matthias Brugger
2015-05-21 16:49 GMT+02:00 Yong Wu yong...@mediatek.com: On Thu, 2015-05-21 at 22:33 +0800, Daniel Kurtz wrote: On Thu, May 21, 2015 at 3:30 PM, Matthias Brugger matthias@gmail.com wrote: 2015-05-21 8:16 GMT+02:00 Yong Wu yong...@mediatek.com: Hi Matthias, Thanks very much

Re: [PATCH v2 4/6] soc: mediatek: Add SMI driver

2015-05-19 Thread Matthias Brugger
2015-05-15 11:43 GMT+02:00 Yong Wu yong...@mediatek.com: This patch add SMI(Smart Multimedia Interface) driver. This driver is responsible to enable/disable iommu and control the clocks of each local arbiter. Signed-off-by: Yong Wu yong...@mediatek.com --- drivers/soc/mediatek/Kconfig

Re: [RFC v2 PATCH 0/6] MT8173 IOMMU SUPPORT

2015-05-18 Thread Matthias Brugger
Hi Yong, 2015-05-15 11:43 GMT+02:00 Yong Wu yong...@mediatek.com: This patch adds support for m4u(Multimedia Memory Management Unit), Currently it only support the m4u with 2 levels of page table on mt8173. It is based on Robin Murphy's arm64: IOMMU-backed DMA mapping[1]. Please check

Re: [RFC PATCH] iommu: add ARM short descriptor page table allocator.

2015-05-12 Thread Matthias Brugger
2015-04-28 9:41 GMT+02:00 Yong Wu yong...@mediatek.com: This patch is for ARM Short Descriptor Format.It has 2-levels pagetable and the allocator supports 4K/64K/1M/16M. Signed-off-by: Yong Wu yong...@mediatek.com --- drivers/iommu/Kconfig| 7 + drivers/iommu/Makefile