]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - board/renesas/porter/porter.c
ARM: rmobile: Fix broken reset code on Porter
[people/ms/u-boot.git] / board / renesas / porter / porter.c
index dfefd7fb712d3474a9959449e7d87a974a55718a..320841f27b2be44f90c6774665cb3f129eaa5841 100644 (file)
@@ -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