summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/tegra11_emc.c
diff options
context:
space:
mode:
authorScott Williams <scwilliams@nvidia.com>2012-01-25 12:45:20 -0800
committerDan Willemsen <dwillemsen@nvidia.com>2013-09-14 01:00:27 -0700
commit1e48b3a20e8d678711fa7fe48866f6425fb69666 (patch)
tree2464a1822b485db96efafab4da6cb7594b7b2c15 /arch/arm/mach-tegra/tegra11_emc.c
parent14667393d8b0185056409830b1e3b8c7ab6c2d0a (diff)
ARM: tegra: Add Tegra11x EMC clock stubs
Change-Id: Iaea0422462354312c4a5640efe133161e3270793 Signed-off-by: Scott Williams <scwilliams@nvidia.com> Reviewed-on: http://git-master/r/77174 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Mark Stadler <mastadler@nvidia.com> Reviewed-by: Jeff Smith <jsmith@nvidia.com> Tested-by: Mark Stadler <mastadler@nvidia.com> Rebase-Id: R08e7a4b3183c7edc6001462270075da0a34e4279
Diffstat (limited to 'arch/arm/mach-tegra/tegra11_emc.c')
-rw-r--r--arch/arm/mach-tegra/tegra11_emc.c99
1 files changed, 99 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/tegra11_emc.c b/arch/arm/mach-tegra/tegra11_emc.c
new file mode 100644
index 000000000000..f63cffa28363
--- /dev/null
+++ b/arch/arm/mach-tegra/tegra11_emc.c
@@ -0,0 +1,99 @@
+/*
+ * arch/arm/mach-tegra/tegra11_emc.c
+ *
+ * Copyright (C) 2011-2012 NVIDIA Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/clk.h>
+#include <linux/err.h>
+#include <linux/io.h>
+
+#include <mach/iomap.h>
+
+#include "clock.h"
+#include "tegra11_emc.h"
+
+static u32 dram_type = -1;
+
+static struct clk *emc;
+
+struct tegra_emc_table;
+
+static void __iomem *emc_base = IO_ADDRESS(TEGRA_EMC_BASE);
+static void __iomem *mc_base = IO_ADDRESS(TEGRA_MC_BASE);
+
+static inline void emc_writel(u32 val, unsigned long addr)
+{
+ writel(val, (u32)emc_base + addr);
+ barrier();
+}
+static inline u32 emc_readl(unsigned long addr)
+{
+ return readl((u32)emc_base + addr);
+}
+static inline void mc_writel(u32 val, unsigned long addr)
+{
+ writel(val, (u32)mc_base + addr);
+ barrier();
+}
+static inline u32 mc_readl(unsigned long addr)
+{
+ return readl((u32)mc_base + addr);
+}
+
+
+int tegra_emc_set_rate(unsigned long rate)
+{
+ /* FIXME: This is just a stub */
+ return 0;
+}
+
+long tegra_emc_round_rate(unsigned long rate)
+{
+ /* FIXME: This is just a stub */
+ return -EINVAL;
+}
+
+struct clk *tegra_emc_predict_parent(unsigned long rate, u32 *div_value)
+{
+ /* FIXME: This is just a stub */
+ return NULL;
+}
+
+void tegra_init_emc(const struct tegra_emc_table *table, int table_size)
+{
+ /* FIXME: This is just a stub */
+}
+
+void tegra_emc_timing_invalidate(void)
+{
+ /* FIXME: This is just a stub */
+}
+
+void tegra_emc_dram_type_init(struct clk *c)
+{
+ emc = c;
+
+ dram_type = (emc_readl(EMC_FBIO_CFG5) &
+ EMC_CFG5_TYPE_MASK) >> EMC_CFG5_TYPE_SHIFT;
+}
+
+int tegra_emc_get_dram_type(void)
+{
+ return dram_type;
+}