Hi Martin,
Am 14.03.19 um 10:19 schrieb Martin Kepplinger:
So, I'm looking into h8 EC access.
Where does ec_set_bit(0x3a, 0) for audio-mute or ec_set_bit(0x3a, 6) for wwan-enable come from (let's keep that as an example)?
this uses a software interface that is defined by the program that runs on the EC, aka the EC firmware. The EC firmware exposes an address space (usually up to 256B) for communication with the host firmware (e.g. coreboot). Usually, there is *no* relation to hardware registers.
On the X230, for example wwan-disable should be on GPIO23 (GPIO023 i guess). In the mec1618 (ok different, but hopefully similar enough) datasheet I can't really find the connection to coreboot's implementation here -.-
I don't think the chips are similar. But that doesn't matter as whatever Lenovo puts as firmware onto them, keeps the software interface compa- tible.
So there's the AHB Base Address 0xC400h right? Then for example there's the 4 bytes "GPIO[000:036] Input Register" at base+0x300. According to this "bit indexing example" table, GPIO023 would be Bit 19 of those 4 bytes...
AIUI, AHB is internal to the EC. Only the EC firmware can access it directly.
Hope that helps, Nico