ectool/pchg: Make update command check device event and status
ectool/pchg: Make update command check device event and status

When ectool pchg update command runs, it first resets a charger chip to
download mode. This makes the EC report a device event to the host.

With this patch, the command waits for a device event and checks the
status is equal to DOWNLOAD when opening an update session.

BUG=b:210796767, b:207479211
BRANCH=None
TEST=On Redrix
     $ ectool pchg 0 update 0x1041 0x201200 user_ee.bin 0x207000
       WLC_Host_UserApp_CRC.bin

Change-Id: I6459d9793816b30687c7a3682949df6ec067e6ab
Signed-off-by: Daisuke Nojiri <fd5f93af191bf7e8f73ea71cc3c0f66b41b1dd49@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3476280
Reviewed-by: caveh jalali <08e24a66aefda7a55ca7d73f8903e0fb16eec763@chromium.org>

coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec