Hi,
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)?
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 -.-
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...
If so (?), how does that relate to ec_set_bit(0x3a, 6)? It all still totally unclear to me, but I might get it all wrong :)
thanks a lot,
martin
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
Am 14.03.2019 11:46 schrieb Nico Huber:
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.
Ok. Patrick, do you have any more details on the interface here, and what is or isn't implemented in coreboot?
thanks
martin
The interface is proprietary and only a few know bits are implemented. Have a look at the thinkpad_acpi kernel module or vendor ACPI code for additional bits.
Some basic fan and power management functionality is implemented. Without a datasheet (by Lenovo) for every EC generation it's impossible to tell what needs to be implemented.
Regards, Patrick
Martin Kepplinger martink@posteo.de schrieb am Do., 14. März 2019, 14:23:
Am 14.03.2019 11:46 schrieb Nico Huber:
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.
Ok. Patrick, do you have any more details on the interface here, and what is or isn't implemented in coreboot?
thanks
martin