From patchwork Mon May 4 08:16:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 6324261 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DEA069F1C2 for ; Mon, 4 May 2015 08:30:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EF147202B8 for ; Mon, 4 May 2015 08:30:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 063CA201B9 for ; Mon, 4 May 2015 08:30:54 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YpBjc-0005GZ-2F; Mon, 04 May 2015 08:28:16 +0000 Received: from mailout2.w1.samsung.com ([210.118.77.12]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YpBZP-0002z3-Kd for linux-arm-kernel@lists.infradead.org; Mon, 04 May 2015 08:17:49 +0000 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NNT004V6GCS1550@mailout2.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 04 May 2015 09:17:16 +0100 (BST) X-AuditID: cbfec7f4-f79c56d0000012ee-76-55472b0b2b54 Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 29.D6.04846.B0B27455; Mon, 4 May 2015 09:17:16 +0100 (BST) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NNT008X3GC52F50@eusync1.samsung.com>; Mon, 04 May 2015 09:17:15 +0100 (BST) From: Marek Szyprowski To: iommu@lists.linux-foundation.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v6 15/25] iommu: exynos: document internal structures Date: Mon, 04 May 2015 10:16:10 +0200 Message-id: <1430727380-10912-16-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1430727380-10912-1-git-send-email-m.szyprowski@samsung.com> References: <1430727380-10912-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuplkeLIzCtJLcpLzFFi42I5/e/4ZV0ebfdQg6OXGC3+TjrGbjFx5WRm i0n3J7BYLNhvbXHt9ww2i87ZG9gtXty7yGLR//g1s8XZpjfsFp0Tl7BbfLnykMli0+NrrBYz zu9jslh75C67xanrn9ks/vUeZLT4v2cHu8WRh7vZLWZMfslmsWrXH0aL27/5LF5+PMHiIObx 5OA8Jo8189Ywevz+NYnR4+/sVmaPnbPusnvM7pjJ6rF5hZbHplWdbB6bl9R73P73mNlj8o3l jB5XTjSxevQ2v2Pz6NuyitHj8ya5AP4oLpuU1JzMstQifbsErowJnxczFyySqli9tZWtgfGA aBcjJ4eEgIlE69ZVjBC2mMSFe+vZuhi5OIQEljJK/LnSxA7hNDFJPL53hwmkik3AUKLrbRcb iC0ikC/xYu9fFhCbWeA9q8SUb4EgtrCAq0TDj+9g9SwCqhKXWlvA6nkFPCU2HnvLDrFNTuL/ yxVgNZxA8Xft21lBbCEBD4kzrZtZJzDyLmBkWMUomlqaXFCclJ5rqFecmFtcmpeul5yfu4kR EklfdjAuPmZ1iFGAg1GJh3eBrHuoEGtiWXFl7iFGCQ5mJRHeJx/dQoV4UxIrq1KL8uOLSnNS iw8xSnOwKInzzt31PkRIID2xJDU7NbUgtQgmy8TBKdXAOOP81G0LbTTrF4pmTWYWDOkt7uxv lmrOY73auShowh8Jjy2ta41lCiueT5v5zHXyWevJJ4Nrz1VPqjZp/eD5N3Pzq+eT9a0XT2XW mZ67jLPd336n1MGf76OOF25r+lDTft59VXR8QEeYwafLSw6u2sbw9fyXx76H/MwsAmZq3T8T suf73hY5MSWW4oxEQy3mouJEAIy+RGygAgAA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150504_011743_885911_C02382F7 X-CRM114-Status: GOOD ( 13.39 ) X-Spam-Score: -5.0 (-----) Cc: Rob Herring , Thierry Reding , Shaik Ameer Basha , Joonyoung Shim , Arnd Bergmann , Inki Dae , Seung-Woo Kim , Joerg Roedel , Will Deacon , Tomasz Figa , linaro-mm-sig@lists.linaro.org, Kyungmin Park , Kukjin Kim , Laurent Pinchart , Olof Johansson , Javier Martinez Canillas , Cho KyongHo , David Wodhouse , Marek Szyprowski X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a few words of comment to all internal structures used by the driver. Signed-off-by: Marek Szyprowski --- drivers/iommu/exynos-iommu.c | 49 +++++++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index 67e0633b8080..6a0199570b00 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -184,33 +184,50 @@ static char *sysmmu_fault_name[SYSMMU_FAULTS_NUM] = { "UNKNOWN FAULT" }; -/* attached to dev.archdata.iommu of the master device */ +/* + * This structure is attached to dev.archdata.iommu of the master device + * on device add, contains a list of SYSMMU controllers defined by device tree, + * which are bound to given master device. It is usually referenced by 'owner' + * pointer. +*/ struct exynos_iommu_owner { - struct list_head clients; + struct list_head clients; /* list of sysmmu_drvdata.owner_node */ }; +/* + * This structure exynos specific generalization of struct iommu_domain. + * It contains list of SYSMMU controllers from all master devices, which has + * been attached to this domain and page tables of IO address space defined by + * it. It is usually referenced by 'domain' pointer. + */ struct exynos_iommu_domain { - struct list_head clients; /* list of sysmmu_drvdata.node */ + struct list_head clients; /* list of sysmmu_drvdata.domain_node */ sysmmu_pte_t *pgtable; /* lv1 page table, 16KB */ short *lv2entcnt; /* free lv2 entry counter for each section */ - spinlock_t lock; /* lock for this structure */ + spinlock_t lock; /* lock for modyfying list of clients */ spinlock_t pgtablelock; /* lock for modifying page table @ pgtable */ struct iommu_domain domain; /* generic domain data structure */ }; +/* + * This structure hold all data of a single SYSMMU controller, this includes + * hw resources like registers and clocks, pointers and list nodes to connect + * it to all other structures, internal state and parameters read from device + * tree. It is usually referenced by 'data' pointer. + */ struct sysmmu_drvdata { - struct device *sysmmu; /* System MMU's device descriptor */ - struct device *master; /* Owner of system MMU */ - void __iomem *sfrbase; - struct clk *clk; - struct clk *clk_master; - int activations; - spinlock_t lock; - struct exynos_iommu_domain *domain; - struct list_head domain_node; - struct list_head owner_node; - phys_addr_t pgtable; - int version; + struct device *sysmmu; /* SYSMMU controller device */ + struct device *master; /* master device (owner of given SYSMMU) */ + void __iomem *sfrbase; /* our registers */ + struct clk *clk; /* SYSMMU's clock */ + struct clk *clk_master; /* master's device clock */ + int activations; /* number of calls to sysmmu_enable */ + spinlock_t lock; /* lock for modyfying enable/disable state */ + struct exynos_iommu_domain *domain; /* domain we belong to */ + struct list_head domain_node; /* node for domain clients list */ + struct list_head owner_node; /* node for owner clients list */ + phys_addr_t pgtable; /* assigned page table structure */ + int version; /* our version */ }; static struct exynos_iommu_domain *to_exynos_domain(struct iommu_domain *dom)