From: Cho KyongHo <pullip.cho@samsung.com>
To: "'Linux ARM Kernel'" <linux-arm-kernel@lists.infradead.org>,
"'Linux IOMMU'" <iommu@lists.linux-foundation.org>,
"'Linux Kernel'" <linux-kernel@vger.kernel.org>,
"'Linux Samsung SOC'" <linux-samsung-soc@vger.kernel.org>
Cc: "'Dae Inki'" <inki.dae@samsung.com>,
"'Joerg Roedel'" <joro@8bytes.org>,
"'Kukjin Kim'" <kgene.kim@samsung.com>,
"'Prathyush'" <prathyush.k@samsung.com>,
"'Rahun Sharma'" <rahul.sharma@samsung.com>,
"'Sanghyun Lee'" <sanghyun75.lee@samsung.com>,
"'Subash Patel'" <subash.ramaswamy@linaro.org>,
"'SWKim'" <sw0312.kim@samsung.com>
Subject: [PATCH v5 12/14] iommu/exynos: pass version information from DT
Date: Tue, 11 Dec 2012 20:11:25 +0900 [thread overview]
Message-ID: <003c01cdd790$42657420$c7305c60$%cho@samsung.com> (raw)
System MMUs in some implementation of Exynos core does not include
correct version information in the System MMU. If the version
information is not correct, exynos-iommu driver cannot take advantages
of feature of higher versions of System MMu like prefetching page
table entries prior to TLB miss.
This commit allows passing version information from DT to the driver.
If DT does not pass version information, the driver will read the
information from System MMU.
Signed-off-by: KyongHo Cho <pullip.cho@samsung.com>
---
drivers/iommu/exynos-iommu.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
index a558c51..70921e9 100644
--- a/drivers/iommu/exynos-iommu.c
+++ b/drivers/iommu/exynos-iommu.c
@@ -205,6 +205,12 @@ struct sysmmu_prefbuf {
unsigned long config;
};
+struct sysmmu_version {
+ unsigned char major; /* major = 0 means that driver must use MMU_VERSION
+ register instead of this structure */
+ unsigned char minor;
+};
+
struct sysmmu_drvdata {
struct device *sysmmu; /* System MMU's device descriptor */
struct device *master; /* Client device that needs System MMU */
@@ -214,6 +220,7 @@ struct sysmmu_drvdata {
spinlock_t lock;
struct sysmmu_prefbuf pbufs[MAX_NUM_PBUF];
int num_pbufs;
+ struct sysmmu_version ver;
struct iommu_domain *domain;
unsigned long pgtable;
bool runtime_active;
@@ -246,6 +253,20 @@ static unsigned int __sysmmu_version(struct sysmmu_drvdata *drvdata,
major = readl(drvdata->sfrbases[idx] + REG_MMU_VERSION);
+ if ((MMU_MAJ_VER(major) == 0) || (MMU_MAJ_VER(major) > 3)) {
+ /* register MMU_VERSION is used for special purpose */
+ if (drvdata->ver.major == 0) {
+ /* min ver. is not important for System MMU 1 and 2 */
+ major = 1;
+ } else {
+ if (minor)
+ *minor = drvdata->ver.minor;
+ major = drvdata->ver.major;
+ }
+
+ return major;
+ }
+
if (minor)
*minor = MMU_MIN_VER(major);
@@ -933,8 +954,15 @@ static int __init __sysmmu_setup(struct device *sysmmu,
const char *compat;
struct platform_device *pmaster = NULL;
u32 master_inst_no = -1;
+ u32 ver[2];
int ret;
+ if (!of_property_read_u32_array(sysmmu->of_node, "version", ver, 2)) {
+ drvdata->ver.major = (unsigned char)ver[0];
+ drvdata->ver.minor = (unsigned char)ver[1];
+ dev_dbg(sysmmu, "Found version %d.%d\n", ver[0], ver[1]);
+ }
+
drvdata->pbufs[0].base = 0;
drvdata->pbufs[0].size = ~0;
drvdata->num_pbufs = 1;
--
1.8.0
reply other threads:[~2012-12-11 11:11 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='003c01cdd790$42657420$c7305c60$%cho@samsung.com' \
--to=pullip.cho@samsung.com \
--cc=inki.dae@samsung.com \
--cc=iommu@lists.linux-foundation.org \
--cc=joro@8bytes.org \
--cc=kgene.kim@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=prathyush.k@samsung.com \
--cc=rahul.sharma@samsung.com \
--cc=sanghyun75.lee@samsung.com \
--cc=subash.ramaswamy@linaro.org \
--cc=sw0312.kim@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome