Re: [PATCH v1 02/16] dt-bindings: memory: mediatek: Update condition for mt8195 smi node

2022-07-07 Thread Matthias Brugger
On 06/07/2022 16:38, Krzysztof Kozlowski wrote: On 06/07/2022 15:48, Matthias Brugger wrote: On 04/07/2022 14:36, Krzysztof Kozlowski wrote: On 04/07/2022 12:00, Tinghan Shen wrote: The max clock items for the dts node with compatible 'mediatek,mt8195-smi-sub-common' should be 3

Re: [PATCH v1 02/16] dt-bindings: memory: mediatek: Update condition for mt8195 smi node

2022-07-06 Thread Matthias Brugger
On 04/07/2022 14:36, Krzysztof Kozlowski wrote: On 04/07/2022 12:00, Tinghan Shen wrote: The max clock items for the dts node with compatible 'mediatek,mt8195-smi-sub-common' should be 3. However, the dtbs_check of such node will get following message,

Re: [PATCH v1 08/16] arm64: dts: mt8195: Add power domains controller

2022-07-06 Thread Matthias Brugger
On 04/07/2022 14:38, Krzysztof Kozlowski wrote: On 04/07/2022 12:00, Tinghan Shen wrote: Add power domains controller node for mt8195. Signed-off-by: Weiyi Lu Signed-off-by: Tinghan Shen --- arch/arm64/boot/dts/mediatek/mt8195.dtsi | 327 +++ 1 file changed, 327

Re: [PATCH v4 0/5] mtk_iommu: Specify phandles to infracfg and pericfg

2022-06-22 Thread Matthias Brugger
Hi Joerg, On 22/06/2022 15:44, Joerg Roedel wrote: On Thu, Jun 16, 2022 at 01:08:25PM +0200, AngeloGioacchino Del Regno wrote: AngeloGioacchino Del Regno (5): dt-bindings: iommu: mediatek: Add mediatek,infracfg phandle iommu/mediatek: Lookup phandle to retrieve syscon to infracfg

Re: [PATCH v4 0/5] mtk_iommu: Specify phandles to infracfg and pericfg

2022-06-22 Thread Matthias Brugger
Hi Joerg, On 22/06/2022 15:44, Joerg Roedel wrote: On Thu, Jun 16, 2022 at 01:08:25PM +0200, AngeloGioacchino Del Regno wrote: AngeloGioacchino Del Regno (5): dt-bindings: iommu: mediatek: Add mediatek,infracfg phandle iommu/mediatek: Lookup phandle to retrieve syscon to infracfg

Re: [PATCH v3 6/6] iommu: mtk_iommu: Lookup phandle to retrieve syscon to pericfg

2022-06-17 Thread Matthias Brugger
On 15/06/2022 14:28, AngeloGioacchino Del Regno wrote: Il 15/06/22 14:09, Matthias Brugger ha scritto: On 09/06/2022 12:08, AngeloGioacchino Del Regno wrote: On some SoCs (of which only MT8195 is supported at the time of writing), the "R" and "W" (I/O) enable

Re: [PATCH v2 5/5] iommu/mediatek: Remove a unused "mapping" which is only for v1

2022-06-16 Thread Matthias Brugger
On 16/06/2022 07:42, Yong Wu wrote: Just remove a unused variable that only is for mtk_iommu_v1. Fixes: 9485a04a5bb9 ("iommu/mediatek: Separate mtk_iommu_data for v1 and v2") It does not fix a bug, so no fixes tag here needed. With that: Reviewed-by: Matthias Brugger

Re: [PATCH v2 2/5] iommu/mediatek: Add error path for loop of mm_dts_parse

2022-06-16 Thread Matthias Brugger
On 16/06/2022 07:42, Yong Wu wrote: The mtk_iommu_mm_dts_parse will parse the smi larbs nodes. if the i+1 larb is parsed fail(return -EINVAL), we should of_node_put for the 0..i larbs. In the fail path, one of_node_put matches with of_parse_phandle in it. Fixes: d2e9a1102cfc

Re: [PATCH v2 1/5] iommu/mediatek: Use dev_err_probe to mute probe_defer err log

2022-06-16 Thread Matthias Brugger
Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Guenter Roeck Reviewed-by: Matthias Brugger --- drivers/iommu/mtk_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index bb9dd92c9898..3b

Re: [PATCH v4 5/5] iommu/mediatek: Cleanup pericfg lookup flow

2022-06-16 Thread Matthias Brugger
ove code readability. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger --- drivers/iommu/mtk_iommu.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 90685946fcbe..b2ae84046

Re: [PATCH v4 1/5] dt-bindings: iommu: mediatek: Add mediatek,infracfg phandle

2022-06-16 Thread Matthias Brugger
and MT8173. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger --- .../bindings/iommu/mediatek,iommu.yaml | 17 + 1 file changed, 17 insertions(+) diff --git a/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml b/Documentation/devicetre

Re: [PATCH v3 6/6] iommu: mtk_iommu: Lookup phandle to retrieve syscon to pericfg

2022-06-15 Thread Matthias Brugger
On 09/06/2022 12:08, AngeloGioacchino Del Regno wrote: On some SoCs (of which only MT8195 is supported at the time of writing), the "R" and "W" (I/O) enable bits for the IOMMUs are in the pericfg_ao register space and not in the IOMMU space: as it happened already with infracfg, it is

Re: [PATCH v3 5/6] dt-bindings: iommu: mediatek: Add mediatek, pericfg phandle

2022-06-14 Thread Matthias Brugger
nfra IOMMU. Signed-off-by: AngeloGioacchino Del Regno Reviewd-by: Matthias Brugger --- .../devicetree/bindings/iommu/mediatek,iommu.yaml | 14 ++ 1 file changed, 14 insertions(+) diff --git a/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml b/Documentation/devicetre

Re: [PATCH v3 2/6] iommu: mtk_iommu: Lookup phandle to retrieve syscon to infracfg

2022-06-14 Thread Matthias Brugger
to infracfg's regmap through a new "mediatek,infracfg" phandle. In order to keep retrocompatibility with older devicetrees, the old way is kept in place. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger --- drivers/iommu/mtk_io

Re: [PATCH v2 1/7] dt-bindings: iommu: mediatek: Add phandles for mediatek infra/pericfg

2022-05-18 Thread Matthias Brugger
On 18/05/2022 12:04, AngeloGioacchino Del Regno wrote: Add properties "mediatek,infracfg" and "mediatek,pericfg" to let the mtk_iommu driver retrieve phandles to the infracfg and pericfg syscon(s) instead of performing a per-soc compatible lookup. Signed-off-by: AngeloGioacchino Del Regno

Re: [PATCH 4/8] iommu: mtk_iommu: Lookup phandle to retrieve syscon to pericfg

2022-05-18 Thread Matthias Brugger
ser will take action. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Matthias Brugger --- drivers/iommu/mtk_iommu.c | 26 -- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index cfaaa9

Re: [PATCH 1/8] dt-bindings: iommu: mediatek: Add mediatek,infracfg phandle

2022-05-18 Thread Matthias Brugger
On 17/05/2022 15:21, AngeloGioacchino Del Regno wrote: Add property "mediatek,infracfg" to let the mtk_iommu driver retrieve a phandle to the infracfg syscon instead of performing a per-soc compatible lookup. Signed-off-by: AngeloGioacchino Del Regno ---

Re: [PATCH 2/2] iommu: mtk_iommu: Add support for MT6795 Helio X10 M4Us

2022-05-17 Thread Matthias Brugger
On 17/05/2022 11:26, AngeloGioacchino Del Regno wrote: Il 17/05/22 11:08, Yong Wu ha scritto: On Fri, 2022-05-13 at 17:14 +0200, AngeloGioacchino Del Regno wrote: Add support for the M4Us found in the MT6795 Helio X10 SoC. Signed-off-by: AngeloGioacchino Del Regno <

Re: [PATCH v7 00/36] MT8195 and MT8186 IOMMU SUPPORT

2022-05-03 Thread Matthias Brugger
be helpful for maintainer to apply. For the whole series: Reviewed-by: Matthias Brugger v6: https://lore.kernel.org/linux-iommu/20220407075726.17771-1-yong...@mediatek.com/ Rebase on v5.18-rc1. v5: https://lore.kernel.org/linux-iommu/20220217113453.13658-1-yong...@mediatek.com 1

Re: [PATCH v6 11/34] iommu/mediatek: Add a flag NON_STD_AXI

2022-04-28 Thread Matthias Brugger
On 07/04/2022 09:57, Yong Wu wrote: Add a new flag NON_STD_AXI, All the previous SoC support this flag. Prepare for adding infra and apu iommu which don't support this. Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno --- drivers/iommu/mtk_iommu.c | 16 ++-- 1

Re: [PATCH v6 15/34] iommu/mediatek: Add IOMMU_TYPE flag

2022-04-28 Thread Matthias Brugger
On 07/04/2022 09:57, Yong Wu wrote: Add IOMMU_TYPE definition. In the mt8195, we have another IOMMU_TYPE: infra iommu, also there will be another APU_IOMMU, thus, use 2bits for the IOMMU_TYPE. Signed-off-by: Yong Wu Reviewed-by: AngeloGioacchino Del Regno --- drivers/iommu/mtk_iommu.c |

Re: [PATCH v6 31/34] iommu/mediatek: Get the proper bankid for multi banks

2022-04-28 Thread Matthias Brugger
On 07/04/2022 09:57, Yong Wu wrote: We preassign some ports in a special bank via the new defined banks_portmsk. Put it in the plat_data means it is not expected to be adjusted dynamically. If the iommu id in the iommu consumer's dtsi node is inside this banks_portmsk, then we switch it to

Re: [PATCH v2 2/2] iommu/mediatek: Add mt8186 iommu support

2022-02-28 Thread Matthias Brugger
On 23/02/2022 08:24, Yong Wu wrote: Add mt8186 iommu supports. Signed-off-by: Anan Sun Signed-off-by: Yong Wu Reviewed-by: Matthias Brugger --- drivers/iommu/mtk_iommu.c | 17 + 1 file changed, 17 insertions(+) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu

Re: [PATCH v2 1/2] dt-bindings: mediatek: mt8186: Add binding for MM iommu

2022-02-28 Thread Matthias Brugger
On 23/02/2022 08:24, Yong Wu wrote: Add mt8186 iommu binding. "-mm" means the iommu is for Multimedia. Signed-off-by: Yong Wu Acked-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Reviewed-by: Matthias Brugger --- .../bindings/iommu/mediatek,iommu.yaml| 4

Re: [PATCH v10 02/13] iommu/mediatek-v1: Free the existed fwspec if the master dev already has

2022-01-31 Thread Matthias Brugger
On 28/01/2022 13:45, Mauro Carvalho Chehab wrote: Em Fri, 28 Jan 2022 13:40:55 +0100 Mauro Carvalho Chehab escreveu: Hi Matthias/Yong, Are you ok if this patch gets merged via the media tree together with the remaining series, or do you prefer to apply it via SoC tree instead? Same

Re: [PATCH v10 00/13] Clean up "mediatek,larb"

2022-01-17 Thread Matthias Brugger
On 17/01/2022 11:27, AngeloGioacchino Del Regno wrote: Il 17/01/22 08:04, Yong Wu ha scritto: MediaTek IOMMU block diagram always like below: M4U   | smi-common   |    -    | |  ...    | | larb1 larb2    | | vdec  

Re: [PATCH v9 12/15] media: mtk-vcodec: enc: Remove mtk_vcodec_release_enc_pm

2022-01-13 Thread Matthias Brugger
Hi Hans, On 13/01/2022 11:15, Hans Verkuil wrote: On 13/01/2022 11:11, AngeloGioacchino Del Regno wrote: Il 11/01/22 11:57, AngeloGioacchino Del Regno ha scritto: Il 12/11/21 11:55, Yong Wu ha scritto: After this patchset, mtk_vcodec_release_enc_pm has only one line. then remove that

Re: [PATCH v5 13/16] media: mtk-vcodec: Get rid of mtk_smi_larb_get/put

2021-06-11 Thread Matthias Brugger
On 10/06/2021 14:02, Yong Wu wrote: > On Thu, 2021-06-10 at 09:53 +0200, Matthias Brugger wrote: >> Hi Yong, >> >> On 12/05/2021 14:29, Yong Wu wrote: >>> On Wed, 2021-05-12 at 17:20 +0800, Hsin-Yi Wang wrote: >>>> On Sat, Apr 10, 2021 at 5:14 PM Yong

Re: [PATCH v5 13/16] media: mtk-vcodec: Get rid of mtk_smi_larb_get/put

2021-06-10 Thread Matthias Brugger
Hi Yong, On 12/05/2021 14:29, Yong Wu wrote: > On Wed, 2021-05-12 at 17:20 +0800, Hsin-Yi Wang wrote: >> On Sat, Apr 10, 2021 at 5:14 PM Yong Wu wrote: >>> >>> MediaTek IOMMU has already added the device_link between the consumer >>> and smi-larb device. If the vcodec device call the

Re: [PATCH v5 14/16] memory: mtk-smi: Get rid of mtk_smi_larb_get/put

2021-06-09 Thread Matthias Brugger
On 10/04/2021 11:11, Yong Wu wrote: > 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: Y

Re: [PATCH v5 09/16] drm/mediatek: Use pm_runtime_resume_and_get for PM get_sync

2021-06-09 Thread Matthias Brugger
On 10/04/2021 11:11, Yong Wu wrote: > pm_runtime_get_sync will increment pm usage counter even it failed. > This patch use pm_runtime_resume_and_get instead of pm_runtime_get > to keep usage counter balanced. > > Signed-off-by: Yong Wu Reviewed-by: Matthias Brugger > ---

Re: [PATCH v5 05/16] media: mtk-jpeg: Use pm_runtime_resume_and_get for PM get_sync

2021-06-09 Thread Matthias Brugger
On 10/04/2021 11:11, Yong Wu wrote: > pm_runtime_get_sync will increment pm usage counter even it failed. > This patch use pm_runtime_resume_and_get instead of pm_runtime_get > to keep usage counter balanced. > > CC: Xia Jiang > Signed-off-by: Yong Wu Reviewed-by

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

  1   2   >