temp revert rk change
[firefly-linux-kernel-4.4.55.git] / arch / arm / mach-tegra / tegra2_emc.h
1 /*
2  * Copyright (C) 2010 Google, Inc.
3  *
4  * Author:
5  *      Colin Cross <ccross@google.com>
6  *
7  * This software is licensed under the terms of the GNU General Public
8  * License version 2, as published by the Free Software Foundation, and
9  * may be copied, distributed, and modified under those terms.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  */
17
18 #define TEGRA_EMC_NUM_REGS 46
19
20 struct tegra_emc_table {
21         unsigned long rate;
22         u32 regs[TEGRA_EMC_NUM_REGS];
23 };
24
25 struct tegra_emc_chip {
26         const char *description;
27         int mem_manufacturer_id; /* LPDDR2 MR5 or -1 to ignore */
28         int mem_revision_id1;    /* LPDDR2 MR6 or -1 to ignore */
29         int mem_revision_id2;    /* LPDDR2 MR7 or -1 to ignore */
30         int mem_pid;             /* LPDDR2 MR8 or -1 to ignore */
31
32         const struct tegra_emc_table *table;
33         int table_size;
34 };
35
36 int tegra_emc_set_rate(unsigned long rate);
37 long tegra_emc_round_rate(unsigned long rate);
38 void tegra_init_emc(const struct tegra_emc_chip *chips, int chips_size);