Add ectool support for framework laptop
Without this patch:
EmbeddedController $ make utils
VERSION ec_version.h
HOSTCC util/ectool
HOSTCC util/lbplay
HOSTCC util/stm32mon
HOSTCC util/ec_sb_firmware_update
HOSTCC util/lbcc
HOSTCC util/ec_parse_panicinfo
HOSTCC util/cbi-util
HOSTCC util/uartupdatetool
EmbeddedController $ sudo ./build/bds/util/ectool led power red
Missing Chromium EC memory map.
Cannot find I2C adapter
Unable to establish host communication
Couldn't find EC
With this patch:
EmbeddedController $ make utils
VERSION ec_version.h
HOSTCC util/ectool
HOSTCC util/lbplay
HOSTCC util/stm32mon
HOSTCC util/ec_sb_firmware_update
HOSTCC util/lbcc
HOSTCC util/ec_parse_panicinfo
HOSTCC util/cbi-util
HOSTCC util/uartupdatetool
EmbeddedController $ sudo ./build/bds/util/ectool led power red
EmbeddedController $
And the light changes.
This also fixes an issue where if you run ectool without sudo permission, it errors, leaving behind the lockfile; I had to add the release_gec_lock() in 2 places, so maybe there's a better way to do this.
The ectool support is all taken from https://github.com/DHowett/fw-ectool, which was published before this repository. I opened an issue with the lock file there: https://github.com/DHowett/fw-ectool/issues/1.
I have no idea if y'all are interested in this or if I'm going about it the right way :)
I opened this before seeing https://github.com/FrameworkComputer/EmbeddedController/pull/5 ! Both of these PRs make the ectool work with the framework laptop.
@Razzius FYI the code in fw-ectool is a bit outdated compared to #5 :smile:
I should merge it back, of course, but I've been a bit busy with life things.
(Thanks!)
FYI: I've replaced the original (fairly hacky :P) code in fw-ectool with the version I was trying to upstream in #5. It no longer requires --comm=fwk, as it's now another personality for the lpc driver.