summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTerry Lv <r65388@freescale.com>2012-02-16 01:38:47 +0800
committerTerry Lv <r65388@freescale.com>2012-02-16 02:24:04 +0800
commitc1ce2e692f4c9ac475504b4976b82de241e36b45 (patch)
treebf0f0969bac3c6f840128ed4cd557f47c823e843 /include
parent69665152823a798b3560d42e6456ce3cc041ffec (diff)
ENGR00139213: Add read and change voltage support for mx6
dd read and change voltage support for mx6. For help, pls type "help regul" Detail command info: regul list - List all regulators' name regul show all - Display all regulators' voltage regul show core - Show core voltage in mV regul show periph - Show peripheral voltage in mV regul show <regulator name> - Show regulator's voltage in mV regul set core <voltage value> - Set core voltage in mV regul set periph <voltage value> - Set periph voltage in mV regul set <regulator name> <voltage value> - Set regulator's voltage in mV Example: MX6Q ARM2 U-Boot > regul list Name Voltage vddpu vddcore vddsoc vdd2p5 vdd1p1 vdd3p0 MX6Q ARM2 U-Boot > regul show all Name Voltage vddpu 1100000 vddcore 1100000 vddsoc 1200000 vdd2p5 2400000 vdd1p1 1100000 vdd3p0 3000000 MX6Q ARM2 U-Boot > regul show periph Name Voltage periph: 1100000 MX6Q ARM2 U-Boot > regul show core Name Voltage core: 1100000 MX6Q ARM2 U-Boot > regul set core 1100000 Set voltage succeed! Name Voltage core: 1100000 Signed-off-by: Terry Lv <r65388@freescale.com>
Diffstat (limited to 'include')
-rw-r--r--include/asm-arm/regulator.h49
-rw-r--r--include/configs/mx6q_arm2.h8
-rw-r--r--include/configs/mx6q_arm2_lpddr2.h8
-rwxr-xr-xinclude/configs/mx6q_arm2_lpddr2pop.h8
-rw-r--r--include/configs/mx6q_sabreauto.h8
-rw-r--r--include/configs/mx6q_sabrelite.h8
-rw-r--r--include/configs/mx6q_sabresd.h8
7 files changed, 97 insertions, 0 deletions
diff --git a/include/asm-arm/regulator.h b/include/asm-arm/regulator.h
new file mode 100644
index 00000000000..d3f0802cb2f
--- /dev/null
+++ b/include/asm-arm/regulator.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2012 Freescale Semiconductor, Inc. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+
+ * 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.
+ */
+
+struct anatop_regulator_data {
+ char name[80];
+ char *parent_name;
+ int (*reg_register)(struct anatop_regulator_data *sreg);
+ int (*set_voltage)(struct anatop_regulator_data *sreg, int uv);
+ int (*get_voltage)(struct anatop_regulator_data *sreg);
+ int (*set_current)(struct anatop_regulator_data *sreg, int uA);
+ int (*get_current)(struct anatop_regulator_data *sreg);
+ int (*enable)(struct anatop_regulator_data *sreg);
+ int (*disable)(struct anatop_regulator_data *sreg);
+ int (*is_enabled)(struct anatop_regulator_data *sreg);
+ int (*set_mode)(struct anatop_regulator_data *sreg, int mode);
+ int (*get_mode)(struct anatop_regulator_data *sreg);
+ int (*get_optimum_mode)(struct anatop_regulator_data *sreg,
+ int input_uV, int output_uV, int load_uA);
+ int control_reg;
+ int vol_bit_shift;
+ int vol_bit_mask;
+ int min_bit_val;
+ int min_voltage;
+ int max_voltage;
+ int max_current;
+};
+
+int regul_list(int show_val);
+int regul_set(char *vdd_name, int uv);
+int regul_get(char *vdd_name);
+int regul_set_core(int uv);
+int regul_get_core(void);
+int regul_set_periph(int uv);
+int regul_get_periph(void);
diff --git a/include/configs/mx6q_arm2.h b/include/configs/mx6q_arm2.h
index fb25a8957c6..f7d8759909b 100644
--- a/include/configs/mx6q_arm2.h
+++ b/include/configs/mx6q_arm2.h
@@ -96,6 +96,7 @@
#define CONFIG_CMD_SF
#define CONFIG_CMD_MMC
#define CONFIG_CMD_ENV
+#define CONFIG_CMD_REGUL
#define CONFIG_CMD_CLOCK
#define CONFIG_REF_CLK_FREQ CONFIG_MX6_HCLK_FREQ
@@ -204,6 +205,13 @@
#define MAX_SPI_BYTES (64 * 4)
#endif
+/* Regulator Configs */
+#ifdef CONFIG_CMD_REGUL
+ #define CONFIG_ANATOP_REGULATOR
+ #define CONFIG_CORE_REGULATOR_NAME "vdd1p1"
+ #define CONFIG_PERIPH_REGULATOR_NAME "vdd1p1"
+#endif
+
/*
* MMC Configs
*/
diff --git a/include/configs/mx6q_arm2_lpddr2.h b/include/configs/mx6q_arm2_lpddr2.h
index 59c5a1601a4..9e37e4869a5 100644
--- a/include/configs/mx6q_arm2_lpddr2.h
+++ b/include/configs/mx6q_arm2_lpddr2.h
@@ -95,6 +95,7 @@
#define CONFIG_CMD_MMC
#define CONFIG_CMD_ENV
+#define CONFIG_CMD_REGUL
#define CONFIG_CMD_CLOCK
#define CONFIG_REF_CLK_FREQ CONFIG_MX6_HCLK_FREQ
@@ -179,6 +180,13 @@
#define CONFIG_SYS_I2C_SLAVE 0x1f
#endif
+/* Regulator Configs */
+#ifdef CONFIG_CMD_REGUL
+ #define CONFIG_ANATOP_REGULATOR
+ #define CONFIG_CORE_REGULATOR_NAME "vdd1p1"
+ #define CONFIG_PERIPH_REGULATOR_NAME "vdd1p1"
+#endif
+
/*
* MMC Configs
*/
diff --git a/include/configs/mx6q_arm2_lpddr2pop.h b/include/configs/mx6q_arm2_lpddr2pop.h
index 45aea16ca5c..bb5ce463b1d 100755
--- a/include/configs/mx6q_arm2_lpddr2pop.h
+++ b/include/configs/mx6q_arm2_lpddr2pop.h
@@ -98,6 +98,7 @@
#define CONFIG_CMD_SF
#define CONFIG_CMD_MMC
#define CONFIG_CMD_ENV
+#define CONFIG_CMD_REGUL
#define CONFIG_CMD_CLOCK
#define CONFIG_REF_CLK_FREQ CONFIG_MX6_HCLK_FREQ
@@ -206,6 +207,13 @@
#define MAX_SPI_BYTES (64 * 4)
#endif
+/* Regulator Configs */
+#ifdef CONFIG_CMD_REGUL
+ #define CONFIG_ANATOP_REGULATOR
+ #define CONFIG_CORE_REGULATOR_NAME "vdd1p1"
+ #define CONFIG_PERIPH_REGULATOR_NAME "vdd1p1"
+#endif
+
/*
* MMC Configs
*/
diff --git a/include/configs/mx6q_sabreauto.h b/include/configs/mx6q_sabreauto.h
index 7b497a7286f..1c0590e278f 100644
--- a/include/configs/mx6q_sabreauto.h
+++ b/include/configs/mx6q_sabreauto.h
@@ -96,6 +96,7 @@
#define CONFIG_CMD_SF
#define CONFIG_CMD_MMC
#define CONFIG_CMD_ENV
+#define CONFIG_CMD_REGUL
#define CONFIG_CMD_CLOCK
#define CONFIG_REF_CLK_FREQ CONFIG_MX6_HCLK_FREQ
@@ -205,6 +206,13 @@
#define MAX_SPI_BYTES (64 * 4)
#endif
+/* Regulator Configs */
+#ifdef CONFIG_CMD_REGUL
+ #define CONFIG_ANATOP_REGULATOR
+ #define CONFIG_CORE_REGULATOR_NAME "vdd1p1"
+ #define CONFIG_PERIPH_REGULATOR_NAME "vdd1p1"
+#endif
+
/*
* MMC Configs
*/
diff --git a/include/configs/mx6q_sabrelite.h b/include/configs/mx6q_sabrelite.h
index 1e8587d2614..362d1fe85a6 100644
--- a/include/configs/mx6q_sabrelite.h
+++ b/include/configs/mx6q_sabrelite.h
@@ -97,6 +97,7 @@
#define CONFIG_CMD_MMC
#define CONFIG_CMD_SF
#define CONFIG_CMD_ENV
+#define CONFIG_CMD_REGUL
#define CONFIG_CMD_CLOCK
#define CONFIG_REF_CLK_FREQ CONFIG_MX6_HCLK_FREQ
@@ -221,6 +222,13 @@
#define MAX_SPI_BYTES (64 * 4)
#endif
+/* Regulator Configs */
+#ifdef CONFIG_CMD_REGUL
+ #define CONFIG_ANATOP_REGULATOR
+ #define CONFIG_CORE_REGULATOR_NAME "vdd1p1"
+ #define CONFIG_PERIPH_REGULATOR_NAME "vdd1p1"
+#endif
+
/*
* MMC Configs
*/
diff --git a/include/configs/mx6q_sabresd.h b/include/configs/mx6q_sabresd.h
index c5c02e647ab..5ef28840510 100644
--- a/include/configs/mx6q_sabresd.h
+++ b/include/configs/mx6q_sabresd.h
@@ -96,6 +96,7 @@
#define CONFIG_CMD_SF
#define CONFIG_CMD_MMC
#define CONFIG_CMD_ENV
+#define CONFIG_CMD_REGUL
#define CONFIG_CMD_CLOCK
#define CONFIG_REF_CLK_FREQ CONFIG_MX6_HCLK_FREQ
@@ -204,6 +205,13 @@
#define MAX_SPI_BYTES (64 * 4)
#endif
+/* Regulator Configs */
+#ifdef CONFIG_CMD_REGUL
+ #define CONFIG_ANATOP_REGULATOR
+ #define CONFIG_CORE_REGULATOR_NAME "vdd1p1"
+ #define CONFIG_PERIPH_REGULATOR_NAME "vdd1p1"
+#endif
+
/*
* MMC Configs
*/