diff options
author | Scott Williams <scwilliams@nvidia.com> | 2012-01-25 12:45:20 -0800 |
---|---|---|
committer | Bo Yan <byan@nvidia.com> | 2012-06-26 18:06:06 -0700 |
commit | 54ec3041915cf0d81e2857c8c4792e41a52955ca (patch) | |
tree | 7e9f328c1bc3e1b31de0e4f17bae22eb5e89f3c9 /arch/arm/mach-tegra/tegra11_emc.c | |
parent | 2033e5227b0163a7ffc02eff329990769c48e43c (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>
(cherry picked from commit 5d71e7db52cb3592b3263fa2930ce81dc2135a25)
Reviewed-on: http://git-master/r/110690
Reviewed-by: Bo Yan <byan@nvidia.com>
Tested-by: Bo Yan <byan@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/tegra11_emc.c')
-rw-r--r-- | arch/arm/mach-tegra/tegra11_emc.c | 99 |
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; +} |