From 4666521d19df4421be1b3c1042ac7ecfb351f884 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sat, 21 Mar 2020 16:57:58 +0100 Subject: [PATCH] ARM: rmobile: Implement PMIC reset on V2H Blanche Add code to reset the board through PMIC, by writing the required PMIC registers in the CPU reset handler. Signed-off-by: Marek Vasut Cc: Nobuhiro Iwamatsu --- board/renesas/blanche/blanche.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/board/renesas/blanche/blanche.c b/board/renesas/blanche/blanche.c index 7232370d6f..471d80fc72 100644 --- a/board/renesas/blanche/blanche.c +++ b/board/renesas/blanche/blanche.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -355,4 +356,23 @@ int dram_init_banksize(void) void reset_cpu(ulong addr) { + struct udevice *dev; + const u8 pmic_bus = 6; + const u8 pmic_addr = 0x58; + u8 data; + int ret; + + 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(); } -- 2.25.1