summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/tegra2_emc.h
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2011-02-12 18:22:49 -0800
committerColin Cross <ccross@android.com>2011-02-21 00:16:45 -0800
commitefdf72ad5c42b529286a1991f51badb030043719 (patch)
tree5ca9c1d934b989479ef4c4c5021feca3cb54f98d /arch/arm/mach-tegra/tegra2_emc.h
parent4db4afb4df93425708ca19417921bcc6a6306476 (diff)
ARM: tegra: Add external memory controller driver
The frequency memory bus on Tegra can be adjusted without disabling accesses to memory by updating the memory configuration registers from a per-board table, and then changing the clock frequency. The clock controller and memory controller have an interlock that prevents the new memory registers from taking effect until the clock frequency change. Acked-by: Olof Johansson <olof@lixom.net> Signed-off-by: Colin Cross <ccross@android.com>
Diffstat (limited to 'arch/arm/mach-tegra/tegra2_emc.h')
-rw-r--r--arch/arm/mach-tegra/tegra2_emc.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/tegra2_emc.h b/arch/arm/mach-tegra/tegra2_emc.h
new file mode 100644
index 000000000000..19f08cb31603
--- /dev/null
+++ b/arch/arm/mach-tegra/tegra2_emc.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2011 Google, Inc.
+ *
+ * Author:
+ * Colin Cross <ccross@android.com>
+ *
+ * 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.
+ *
+ */
+
+#define TEGRA_EMC_NUM_REGS 46
+
+struct tegra_emc_table {
+ unsigned long rate;
+ u32 regs[TEGRA_EMC_NUM_REGS];
+};
+
+int tegra_emc_set_rate(unsigned long rate);
+long tegra_emc_round_rate(unsigned long rate);
+void tegra_init_emc(const struct tegra_emc_table *table, int table_size);