iommu/mediatek: Add infra iommu support
authorYong Wu <yong.wu@mediatek.com>
Tue, 3 May 2022 07:14:12 +0000 (15:14 +0800)
committerJoerg Roedel <jroedel@suse.de>
Wed, 4 May 2022 08:39:39 +0000 (10:39 +0200)
commitf9b8c9b2194327c26eecfc82dde9541e80c24c80
treef64de675fb353bc8e866a31ddd1fdb7c26547787
parent6077c7e5d22f2e0ffdb1dd97bf37cba66f317627
iommu/mediatek: Add infra iommu support

The infra iommu enable bits in mt8195 is in the pericfg register segment,
use regmap to update it.

If infra iommu master translation fault, It doesn't have the larbid/portid,
thus print out the whole register value.

Since regmap_update_bits may fail, add return value for mtk_iommu_config.

Signed-off-by: Yong Wu <yong.wu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Link: https://lore.kernel.org/r/20220503071427.2285-22-yong.wu@mediatek.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/mtk_iommu.c
drivers/iommu/mtk_iommu.h