aboutsummaryrefslogtreecommitdiffstats
path: root/board/gateworks/venice/spl.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/gateworks/venice/spl.c')
-rw-r--r--board/gateworks/venice/spl.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/board/gateworks/venice/spl.c b/board/gateworks/venice/spl.c
index b0a315ba953..e9cdede6214 100644
--- a/board/gateworks/venice/spl.c
+++ b/board/gateworks/venice/spl.c
@@ -3,7 +3,6 @@
* Copyright 2021 Gateworks Corporation
*/
-#include <common.h>
#include <cpu_func.h>
#include <hang.h>
#include <i2c.h>
@@ -119,13 +118,29 @@ static int dm_i2c_clrsetbits(struct udevice *dev, uint reg, uint clr, uint set)
return dm_i2c_write(dev, reg, &val, 1);
}
-static int power_init_board(void)
+static int power_init_board(struct udevice *gsc)
{
const char *model = eeprom_get_model();
struct udevice *bus;
struct udevice *dev;
int ret;
+ /* Enable GSC voltage supervisor for new board models */
+ if ((!strncmp(model, "GW7100", 6) && model[10] > 'D') ||
+ (!strncmp(model, "GW7101", 6) && model[10] > 'D') ||
+ (!strncmp(model, "GW7200", 6) && model[10] > 'E') ||
+ (!strncmp(model, "GW7201", 6) && model[10] > 'E') ||
+ (!strncmp(model, "GW7300", 6) && model[10] > 'E') ||
+ (!strncmp(model, "GW7301", 6) && model[10] > 'E') ||
+ (!strncmp(model, "GW740", 5) && model[7] > 'B')) {
+ u8 ver;
+
+ if (!dm_i2c_read(gsc, 14, &ver, 1) && ver > 62) {
+ printf("GSC : enabling voltage supervisor\n");
+ dm_i2c_clrsetbits(gsc, 25, 0, BIT(1));
+ }
+ }
+
if ((!strncmp(model, "GW71", 4)) ||
(!strncmp(model, "GW72", 4)) ||
(!strncmp(model, "GW73", 4)) ||
@@ -287,6 +302,7 @@ void board_init_f(ulong dummy)
mdelay(10);
}
pinctrl_select_state(bus, "default");
+ mdelay(10);
}
}
/* Wait indefiniately until the GSC probes */
@@ -298,7 +314,7 @@ void board_init_f(ulong dummy)
dram_sz = venice_eeprom_init(0);
/* PMIC */
- power_init_board();
+ power_init_board(dev);
/* DDR initialization */
spl_dram_init(dram_sz);