summaryrefslogtreecommitdiffstats
path: root/drivers/iommu/exynos-iommu.c
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2015-05-19 09:20:31 -0400
committerJoerg Roedel <jroedel@suse.de>2015-05-29 04:49:39 -0400
commit2860af3c8f7ac9e2569378653c3948c422bd30c2 (patch)
treec9d4cc68834f054e1e3e8f95c84ff39f39df8db3 /drivers/iommu/exynos-iommu.c
parent312900c605a7fc108e9d290745a5da6212062bce (diff)
iommu/exynos: Document internal structures
Add a few words of comment to all internal structures used by the driver. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Tested-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/exynos-iommu.c')
-rw-r--r--drivers/iommu/exynos-iommu.c53
1 files changed, 35 insertions, 18 deletions
diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
index 9d9fea2156cb..f6ed59cad90b 100644
--- a/drivers/iommu/exynos-iommu.c
+++ b/drivers/iommu/exynos-iommu.c
@@ -180,32 +180,49 @@ static char *sysmmu_fault_name[SYSMMU_FAULTS_NUM] = {
180 "UNKNOWN FAULT" 180 "UNKNOWN FAULT"
181}; 181};
182 182
183/* attached to dev.archdata.iommu of the master device */ 183/*
184 * This structure is attached to dev.archdata.iommu of the master device
185 * on device add, contains a list of SYSMMU controllers defined by device tree,
186 * which are bound to given master device. It is usually referenced by 'owner'
187 * pointer.
188*/
184struct exynos_iommu_owner { 189struct exynos_iommu_owner {
185 struct device *sysmmu; 190 struct device *sysmmu; /* sysmmu controller for given master */
186}; 191};
187 192
193/*
194 * This structure exynos specific generalization of struct iommu_domain.
195 * It contains list of SYSMMU controllers from all master devices, which has
196 * been attached to this domain and page tables of IO address space defined by
197 * it. It is usually referenced by 'domain' pointer.
198 */
188struct exynos_iommu_domain { 199struct exynos_iommu_domain {
189 struct list_head clients; /* list of sysmmu_drvdata.node */ 200 struct list_head clients; /* list of sysmmu_drvdata.domain_node */
190 sysmmu_pte_t *pgtable; /* lv1 page table, 16KB */ 201 sysmmu_pte_t *pgtable; /* lv1 page table, 16KB */
191 short *lv2entcnt; /* free lv2 entry counter for each section */ 202 short *lv2entcnt; /* free lv2 entry counter for each section */
192 spinlock_t lock; /* lock for this structure */ 203 spinlock_t lock; /* lock for modyfying list of clients */
193 spinlock_t pgtablelock; /* lock for modifying page table @ pgtable */ 204 spinlock_t pgtablelock; /* lock for modifying page table @ pgtable */
194 struct iommu_domain domain; /* generic domain data structure */ 205 struct iommu_domain domain; /* generic domain data structure */
195}; 206};
196 207
208/*
209 * This structure hold all data of a single SYSMMU controller, this includes
210 * hw resources like registers and clocks, pointers and list nodes to connect
211 * it to all other structures, internal state and parameters read from device
212 * tree. It is usually referenced by 'data' pointer.
213 */
197struct sysmmu_drvdata { 214struct sysmmu_drvdata {
198 struct device *sysmmu; /* System MMU's device descriptor */ 215 struct device *sysmmu; /* SYSMMU controller device */
199 struct device *master; /* Owner of system MMU */ 216 struct device *master; /* master device (owner) */
200 void __iomem *sfrbase; 217 void __iomem *sfrbase; /* our registers */
201 struct clk *clk; 218 struct clk *clk; /* SYSMMU's clock */
202 struct clk *clk_master; 219 struct clk *clk_master; /* master's device clock */
203 int activations; 220 int activations; /* number of calls to sysmmu_enable */
204 spinlock_t lock; 221 spinlock_t lock; /* lock for modyfying state */
205 struct exynos_iommu_domain *domain; 222 struct exynos_iommu_domain *domain; /* domain we belong to */
206 struct list_head domain_node; 223 struct list_head domain_node; /* node for domain clients list */
207 phys_addr_t pgtable; 224 phys_addr_t pgtable; /* assigned page table structure */
208 unsigned int version; 225 unsigned int version; /* our version */
209}; 226};
210 227
211static struct exynos_iommu_domain *to_exynos_domain(struct iommu_domain *dom) 228static struct exynos_iommu_domain *to_exynos_domain(struct iommu_domain *dom)