Skip to content

Commit ae66934

Browse files
YongWu-HFjoergroedel
authored andcommitted
iommu/mediatek: Improve comment for the current region/bank
No functional change. Just add more comment about the current region/bank in the code. Signed-off-by: Yong Wu <yong.wu@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20230411093144.2690-4-yong.wu@mediatek.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent 559549b commit ae66934

1 file changed

Lines changed: 26 additions & 5 deletions

File tree

drivers/iommu/mtk_iommu.c

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,33 @@ struct mtk_iommu_plat_data {
197197

198198
char *pericfg_comp_str;
199199
struct list_head *hw_list;
200-
unsigned int iova_region_nr;
201-
const struct mtk_iommu_iova_region *iova_region;
202200

203-
u8 banks_num;
204-
bool banks_enable[MTK_IOMMU_BANK_MAX];
205-
unsigned int banks_portmsk[MTK_IOMMU_BANK_MAX];
201+
/*
202+
* The IOMMU HW may support 16GB iova. In order to balance the IOVA ranges,
203+
* different masters will be put in different iova ranges, for example vcodec
204+
* is in 4G-8G and cam is in 8G-12G. Meanwhile, some masters may have the
205+
* special IOVA range requirement, like CCU can only support the address
206+
* 0x40000000-0x44000000.
207+
* Here list the iova ranges this SoC supports and which larbs/ports are in
208+
* which region.
209+
*
210+
* 16GB iova all use one pgtable, but each a region is a iommu group.
211+
*/
212+
struct {
213+
unsigned int iova_region_nr;
214+
const struct mtk_iommu_iova_region *iova_region;
215+
};
216+
217+
/*
218+
* The IOMMU HW may have 5 banks. Each bank has a independent pgtable.
219+
* Here list how many banks this SoC supports/enables and which ports are in which bank.
220+
*/
221+
struct {
222+
u8 banks_num;
223+
bool banks_enable[MTK_IOMMU_BANK_MAX];
224+
unsigned int banks_portmsk[MTK_IOMMU_BANK_MAX];
225+
};
226+
206227
unsigned char larbid_remap[MTK_LARB_COM_MAX][MTK_LARB_SUBCOM_MAX];
207228
};
208229

0 commit comments

Comments
 (0)