aboutsummaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut+renesas@gmail.com>2018-02-17 02:16:48 +0100
committerMarek Vasut <marex@denx.de>2018-02-17 22:00:25 +0100
commit25f6dc8955bdf97bfb16ef19de7ce4abe76aaee4 (patch)
tree5b466b914ccb2eb740bdc1740986c6c9c91ec892 /board
parenta6e50da0d5a42f84f39edad57cb24a85e8524e6d (diff)
downloadu-boot-25f6dc8955bdf97bfb16ef19de7ce4abe76aaee4.zip
u-boot-25f6dc8955bdf97bfb16ef19de7ce4abe76aaee4.tar.gz
u-boot-25f6dc8955bdf97bfb16ef19de7ce4abe76aaee4.tar.bz2
ARM: rmobile: Fix broken reset code on Porter
The 'reset' command did not work on Porter because the reset code was accessing the wrong PMIC address over broken I2C bus driver. Replace the code with DM-aware code and fix up the PMIC address. This makes the 'reset' command work again. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Diffstat (limited to 'board')
-rw-r--r--board/renesas/porter/porter.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/board/renesas/porter/porter.c b/board/renesas/porter/porter.c
index dfefd7f..320841f 100644
--- a/board/renesas/porter/porter.c
+++ b/board/renesas/porter/porter.c
@@ -116,12 +116,25 @@ const struct rmobile_sysinfo sysinfo = {
void reset_cpu(ulong addr)
{
- u8 val;
+ struct udevice *dev;
+ const u8 pmic_bus = 6;
+ const u8 pmic_addr = 0x5a;
+ u8 data;
+ int ret;
- i2c_set_bus_num(2); /* PowerIC connected to ch2 */
- i2c_read(CONFIG_SYS_I2C_POWERIC_ADDR, 0x13, 1, &val, 1);
- val |= 0x02;
- i2c_write(CONFIG_SYS_I2C_POWERIC_ADDR, 0x13, 1, &val, 1);
+ ret = i2c_get_chip_for_busnum(pmic_bus, pmic_addr, 1, &dev);
+ if (ret)
+ hang();
+
+ ret = dm_i2c_read(dev, 0x13, &data, 1);
+ if (ret)
+ hang();
+
+ data |= BIT(1);
+
+ ret = dm_i2c_write(dev, 0x13, &data, 1);
+ if (ret)
+ hang();
}
#ifdef CONFIG_SPL_BUILD