summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiro Sugawara <hsugawara@nvidia.com>2011-09-13 17:20:35 -0700
committerRohan Somvanshi <rsomvanshi@nvidia.com>2011-09-16 06:48:03 -0700
commit4d6ebb3d0f87311e3e6243bf11f646f6a8b56f7e (patch)
tree76cdb86d1c5a7d2192a53679438f47ba27c0c845
parente796581d9baee3317b65771637ec59b76191391f (diff)
arm: tegra: smmu: Remove IORESOURCE use from SMMU IOVA range
SMMU simply needs to know its assigned IOVA range, but does not need address space resources. Bug 874438 Change-Id: I96a8718e692bbb96b5fce6ec7ebc90f6930f358c Reviewed-on: http://git-master/r/52670 Tested-by: Hiro Sugawara <hsugawara@nvidia.com> Reviewed-by: Krishna Reddy <vdumpa@nvidia.com> Reviewed-by: Scott Williams <scwilliams@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/common.c12
-rw-r--r--arch/arm/mach-tegra/devices.c26
-rw-r--r--arch/arm/mach-tegra/iovmm-smmu.c7
-rw-r--r--arch/arm/mach-tegra/tegra_smmu.h22
4 files changed, 52 insertions, 15 deletions
diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c
index 1e911a3c80b8..694d598d8b36 100644
--- a/arch/arm/mach-tegra/common.c
+++ b/arch/arm/mach-tegra/common.c
@@ -45,6 +45,9 @@
#include "fuse.h"
#include "power.h"
#include "reset.h"
+#ifdef CONFIG_TEGRA_IOVMM_SMMU
+#include "tegra_smmu.h"
+#endif
#define MC_SECURITY_CFG2 0x7c
@@ -690,11 +693,8 @@ void __init tegra_reserve(unsigned long carveout_size, unsigned long fb_size,
unsigned long fb2_size)
{
#ifdef SUPPORT_TEGRA_3_IOVMM_SMMU_A01
- extern struct platform_device tegra_smmu_device;
int smmu_reserved = 0;
- struct resource *smmu_window =
- platform_get_resource_byname(&tegra_smmu_device,
- IORESOURCE_MEM, "smmu");
+ struct tegra_smmu_window *smmu_window = tegra_smmu_window(0);
#endif
if (carveout_size) {
@@ -744,7 +744,7 @@ void __init tegra_reserve(unsigned long carveout_size, unsigned long fb_size,
#ifdef SUPPORT_TEGRA_3_IOVMM_SMMU_A01
if (!smmu_window) {
- pr_err("No SMMU resources\n");
+ pr_err("No SMMU resource\n");
} else {
size_t smmu_window_size;
@@ -819,7 +819,7 @@ void __init tegra_reserve(unsigned long carveout_size, unsigned long fb_size,
#ifdef SUPPORT_TEGRA_3_IOVMM_SMMU_A01
if (smmu_reserved)
- pr_info("SMMU: %08x - %08x\n",
+ pr_info("SMMU: %08lx - %08lx\n",
smmu_window->start, smmu_window->end);
#endif
}
diff --git a/arch/arm/mach-tegra/devices.c b/arch/arm/mach-tegra/devices.c
index d3865628e610..2c8f07ef9bec 100644
--- a/arch/arm/mach-tegra/devices.c
+++ b/arch/arm/mach-tegra/devices.c
@@ -836,12 +836,6 @@ static struct resource tegra_smmu_resources[] = {
.end = TEGRA_MC_BASE + TEGRA_MC_SIZE - 1,
},
[1] = {
- .name = "smmu",
- .flags = IORESOURCE_MEM,
- .start = TEGRA_SMMU_BASE,
- .end = TEGRA_SMMU_BASE + TEGRA_SMMU_SIZE - 1,
- },
- [2] = {
.name = "ahbarb",
.flags = IORESOURCE_MEM,
.start = TEGRA_AHB_ARB_BASE,
@@ -855,6 +849,26 @@ struct platform_device tegra_smmu_device = {
.num_resources = ARRAY_SIZE(tegra_smmu_resources),
.resource = tegra_smmu_resources
};
+
+
+#include "tegra_smmu.h"
+
+static struct tegra_smmu_window tegra_smmu[] = {
+ [0] = {
+ .start = TEGRA_SMMU_BASE,
+ .end = TEGRA_SMMU_BASE + TEGRA_SMMU_SIZE - 1,
+ },
+};
+
+struct tegra_smmu_window *tegra_smmu_window(int wnum)
+{
+ return &tegra_smmu[wnum];
+}
+
+int tegra_smmu_window_count(void)
+{
+ return ARRAY_SIZE(tegra_smmu);
+}
#endif
static struct resource pmu_resources[] = {
diff --git a/arch/arm/mach-tegra/iovmm-smmu.c b/arch/arm/mach-tegra/iovmm-smmu.c
index f5053b04315d..97a61f0fed34 100644
--- a/arch/arm/mach-tegra/iovmm-smmu.c
+++ b/arch/arm/mach-tegra/iovmm-smmu.c
@@ -34,7 +34,7 @@
#include <asm/cacheflush.h>
#include <asm/page.h>
#include <asm/cacheflush.h>
-
+#include "tegra_smmu.h"
#include <mach/iovmm.h>
#include <mach/iomap.h>
@@ -923,7 +923,8 @@ static struct tegra_iovmm_device_ops tegra_iovmm_smmu_ops = {
static int smmu_probe(struct platform_device *pdev)
{
struct smmu_device *smmu = NULL;
- struct resource *regs = NULL, *window = NULL, *regs2 = NULL;
+ struct resource *regs = NULL, *regs2 = NULL;
+ struct tegra_smmu_window *window = NULL;
int e, asid;
if (!pdev) {
@@ -944,7 +945,7 @@ static int smmu_probe(struct platform_device *pdev)
regs = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mc");
regs2 = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ahbarb");
- window = platform_get_resource_byname(pdev, IORESOURCE_MEM, "smmu");
+ window = tegra_smmu_window(0);
if (!regs || !regs2 || !window) {
pr_err(DRIVER_NAME ": No SMMU resources\n");
diff --git a/arch/arm/mach-tegra/tegra_smmu.h b/arch/arm/mach-tegra/tegra_smmu.h
new file mode 100644
index 000000000000..aba140e0f2d0
--- /dev/null
+++ b/arch/arm/mach-tegra/tegra_smmu.h
@@ -0,0 +1,22 @@
+/*
+ * arch/arm/mach-tegra/tegra_smmu.h
+ *
+ * Copyright (C) 2011 NVIDIA Corporation.
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+struct tegra_smmu_window {
+ unsigned long start;
+ unsigned long end;
+};
+
+extern struct tegra_smmu_window *tegra_smmu_window(int wnum);
+extern int tegra_smmu_window_count(void);