summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2018-11-01 19:25:52 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2018-11-02 07:34:27 +0100
commit98af19307b073fcdca1f1c1874a1d3abc7e63b1d (patch)
treeac1a95fa431bad3ed480a53cefc565d6621ef61c /arch
parente6d0ba8f6c3db368cf5294e17a0f539c76034b95 (diff)
downloadbarebox-98af19307b073fcdca1f1c1874a1d3abc7e63b1d.tar.gz
barebox-98af19307b073fcdca1f1c1874a1d3abc7e63b1d.tar.xz
ARM: rdu2: config PMIC SW1AB and SW1C rails to 1.375
This is the default out-of-reset voltage, but if only the i.MX6 SoC got reset, the PMIC might still be stuck at the lower voltage for the slow operating point. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/boards/zii-imx6q-rdu2/board.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/arm/boards/zii-imx6q-rdu2/board.c b/arch/arm/boards/zii-imx6q-rdu2/board.c
index c99f993f02..49cc234c02 100644
--- a/arch/arm/boards/zii-imx6q-rdu2/board.c
+++ b/arch/arm/boards/zii-imx6q-rdu2/board.c
@@ -16,6 +16,7 @@
#include <common.h>
#include <envfs.h>
#include <gpio.h>
+#include <i2c/i2c.h>
#include <init.h>
#include <mach/bbu.h>
#include <mach/imx6.h>
@@ -137,10 +138,27 @@ late_initcall(rdu2_enable_front_panel_usb);
static int rdu2_devices_init(void)
{
+ struct i2c_client client;
+
if (!of_machine_is_compatible("zii,imx6q-zii-rdu2") &&
!of_machine_is_compatible("zii,imx6qp-zii-rdu2"))
return 0;
+ client.adapter = i2c_get_adapter(1);
+ if (client.adapter) {
+ u8 reg;
+
+ /*
+ * Reset PMIC SW1AB and SW1C rails to 1.375V. If an event
+ * caused only the i.MX6 SoC reset, the PMIC might still be
+ * stuck on the low voltage for the slow operating point.
+ */
+ client.addr = 0x08; /* PMIC i2c address */
+ reg = 0x2b; /* 1.375V, valid for both rails */
+ i2c_write_reg(&client, 0x20, &reg, 1);
+ i2c_write_reg(&client, 0x2e, &reg, 1);
+ }
+
barebox_set_hostname("rdu2");
imx6_bbu_internal_spi_i2c_register_handler("SPI", "/dev/m25p0.barebox",