summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattis fjallstrom <mattis@acm.org>2015-07-06 16:38:48 -0700
committermattis fjallstrom <mattis@acm.org>2015-07-06 16:38:48 -0700
commite71bec1d7ee5764ae0173d7a4273f3b6d5246d3f (patch)
treed52c0238dc4174b9bc8e7cb732ebb7ec02268bab
parent4442ba9ed7f2ee547d514f1f8840a51580fa8e54 (diff)
downloadolio-uboot-2014.01-e71bec1d7ee5764ae0173d7a4273f3b6d5246d3f.tar.xz
olio-uboot-2014.01-e71bec1d7ee5764ae0173d7a4273f3b6d5246d3f.zip
Enabling all regulators through the tps65910 driver. The remaining outputs are initialized through hardware, so nothing for us to do there.master
Change-Id: Ied6ff6bf32a6e8fbc4c3b8a84b3ff73d3fecd960
-rw-r--r--board/olio/h1/h1.c62
1 files changed, 52 insertions, 10 deletions
diff --git a/board/olio/h1/h1.c b/board/olio/h1/h1.c
index 1a3fe6a30..3c039a65b 100644
--- a/board/olio/h1/h1.c
+++ b/board/olio/h1/h1.c
@@ -25,6 +25,7 @@
#include "h1.h"
#include <command.h>
#include <power/tps65910.h>
+#include <i2c.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -69,22 +70,61 @@ void get_board_mem_timings(struct board_sdrc_timings *timings)
}
#endif
+/*
+ * Routine: tps65910_voltages_init
+ * Description: initialize voltages supplied by PMIC
+ * On the board we have BOOT0 = 1, BOOT = 0, this defines
+ * the voltages supplied by PMIC when power is applied to its
+ * input.
+ * We only need to set up only VDIG1, VAUX2, VMMC
+ */
+#define TPS65910_VDIG1_REG 0x30
+#define TPS65910_VAUX2_REG 0x33
#define TPS65910_VMMC_REG 0x35
-static int disp_regulator_init(void)
+struct vsel_map_t {
+ uchar reg_addr;
+ uchar vsel;
+};
+
+static struct vsel_map_t tps65910_volt[] = {
+ {
+ .reg_addr = TPS65910_VDIG1_REG,
+ /* SEL[1:0] = 10 (1.8 V), ST[1:0] = On high power (ACTIVE) */
+ .vsel = 0x9,
+ },
+ {
+ .reg_addr = TPS65910_VAUX2_REG,
+ /* SEL[1:0] = 11 (3.3 V), ST[1:0] = On high power (ACTIVE) */
+ .vsel = 0xd,
+ },
+ {
+ .reg_addr = TPS65910_VMMC_REG,
+ /* SEL[1:0] = 11 (3.3 V), ST[1:0] = On high power (ACTIVE) */
+ .vsel = 0xd,
+ },
+};
+
+static int tps65910_voltages_init(void)
{
- uchar buf;
+ struct vsel_map_t *p = tps65910_volt;
+ int i, ret;
if (i2c_probe(TPS65910_CTRL_I2C_ADDR))
return -1;
/* Tell the TPS65910 to use i2c */
- tps65910_set_i2c_control();
+ ret = tps65910_set_i2c_control();
+ if (ret)
+ return ret;
- /* SEL[1:0] = 3.3 V, ST[1:0] = On high power (ACTIVE) */
- buf = 0x0d;
+ for (i = 0; i < ARRAY_SIZE(tps65910_volt); i++) {
+ ret = i2c_write(TPS65910_CTRL_I2C_ADDR, p->reg_addr, 1, &p->vsel, 1);
+ if (ret)
+ return ret;
+ p++;
+ }
- /* set VMMC_REG to supply 3.3 V */
- return i2c_write(TPS65910_CTRL_I2C_ADDR, TPS65910_VMMC_REG, 1, &buf, 1);
+ return 0;
}
#define TPS65910_VDIG1_REG 0x30
@@ -115,10 +155,12 @@ int misc_init_r(void)
struct gpio *gpio6_base = (struct gpio *)OMAP34XX_GPIO6_BASE;
struct control_prog_io *prog_io_base = (struct control_prog_io *)OMAP34XX_CTRL_BASE;
- if (disp_regulator_init())
- puts("failed to set VMMC regulator for tps65910\n");
if (accel_regulator_init())
- puts("failed to set VMMC regulator for tps65910\n");
+ puts("failed to set VMMC regulator for tps65910\n");
+ if (tps65910_voltages_init())
+ puts("failed to initialise tps65910 voltages\n");
+
+
//MUX_BEAGLE_XM();
dieid_num_r();