summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiro Sugawara <hsugawara@nvidia.com>2011-09-13 17:20:35 -0700
committerVarun Colbert <vcolbert@nvidia.com>2011-09-20 17:06:54 -0700
commit32ff4babd2c8cf007cd19b623f01016a4e88e92a (patch)
tree72119164722aaf3855db251b52e62877ce354ff3
parente4862709dd7fb9799072576569fd532e0a597f31 (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 Merged in rel-12 branch with change ID I96a8718e692bbb96b5fce6ec7ebc90f6930f358c Change-Id: Iea4de33a46bd6eed19ccacb38ace9f02127f5137 Signed-off-by: Mursalin Akon <makon@nvidia.com> Reviewed-on: http://git-master/r/52990 Reviewed-by: Hiro Sugawara <hsugawara@nvidia.com> Reviewed-by: Allen Martin <amartin@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 a5f373ec0284..b59648a8ea53 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 6281ec9ce29d..5b45db286e64 100644
--- a/arch/arm/mach-tegra/iovmm-smmu.c
+++ b/arch/arm/mach-tegra/iovmm-smmu.c
@@ -35,7 +35,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>
@@ -942,7 +942,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) {
@@ -963,7 +964,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);