iommu/mediatek: Initialise/Remove for multi bank dev
authorYong Wu <yong.wu@mediatek.com>
Tue, 3 May 2022 07:14:24 +0000 (15:14 +0800)
committerJoerg Roedel <jroedel@suse.de>
Wed, 4 May 2022 08:39:40 +0000 (10:39 +0200)
commit42d57fc58aebc5801804424082028f43bad1b73c
tree0a56f5b440358950f838a2685dd4aa187611df19
parent57fb481f9008997563a8de96aa49726fd51d6e3e
iommu/mediatek: Initialise/Remove for multi bank dev

The registers for each bank of the IOMMU base are in order, delta is
0x1000. Initialise the base for each bank.

For all the previous SoC, we only have bank0. thus use "do {} while()"
to allow bank0 always go.

When removing the device, Not always all the banks are initialised, it
depend on if there is masters for that bank.

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-34-yong.wu@mediatek.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/mtk_iommu.c