iommu/mediatek: Adjust mtk_iommu_config flow
authorChengci.Xu <chengci.xu@mediatek.com>
Fri, 2 Jun 2023 09:02:23 +0000 (17:02 +0800)
committerJoerg Roedel <jroedel@suse.de>
Mon, 7 Aug 2023 12:15:47 +0000 (14:15 +0200)
commit9a89051084af8ef566f3a2127cf5baa433dea497
tree8ccfbd9bf85ae40826a0e17267a5f9be4cba1eaf
parentcf69ef46dbd980a0b1c956d668e066a73e0acd0f
iommu/mediatek: Adjust mtk_iommu_config flow

If there are many ports in a infra master, current flow will update
the INFRA register many times. This patch saves all ports to portid_msk
in the front of mtk_iommu_config(), then update only once for the IOMMU
configure. After this, we could avoid send too many SMC calls to ATF in
MT8188.

Prepare for MT8188, also reduce the indention without functional change.

Signed-off-by: Chengci.Xu <chengci.xu@mediatek.com>
Signed-off-by: Yong Wu <yong.wu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://lore.kernel.org/r/20230602090227.7264-4-yong.wu@mediatek.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/mtk_iommu.c