IMSProg icon indicating copy to clipboard operation
IMSProg copied to clipboard

ITE i2c smbus read and write for IT8xxx ec

Open ndarjo opened this issue 11 months ago • 22 comments

Description

hi, i watch somewhere in another github project (zephyrproject) + yt video + aliexpress. there are way to read or write EC of ITE ec IT8xxx series. there are source code / linux program written in C. the folder name is IT81202 Linux Flash Tool. you can found it in here https://www.ite.com.tw/en/product/cate2/IT81202 . the read and write use something like download board with IT8390 ec in the board. there are company which sell that (XZZ) using same programmer as the link i attach above. i am too dumb to learn the source code, but i guess, the IT8390 is only used for USB to i2c, uart, serial/parallel port. the bus speed is 400kbps i guess. i dont have donor board to test it(board with ITE ec), and change the VID and PID of the source code and change it with ch341a vid and pid and run the test.

Usage tips

  • Please use the 👍 reaction to show that you are interested into this.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this.
  • Subscribe to receive notifications on status change and new comments, you can do also without add comment.

ndarjo avatar Jan 27 '25 11:01 ndarjo

Image

this is the ITE download board,

ndarjo avatar Jan 27 '25 11:01 ndarjo

https://github.com/c0d3z3r0/i2ite this project use FT232H which supported in USBASp-flash, written in python

ndarjo avatar Jan 27 '25 15:01 ndarjo

there also iteflash.cc in here https://chromium.googlesource.com/chromiumos/platform/ec/+/HEAD/util

ndarjo avatar Jan 27 '25 19:01 ndarjo

How ITE EC reflashing works An ITE EC is reflashed using a Servo by:

  1. Sending special non-I2C waveforms over its I2C clock and data lines, to enable a debug mode / direct firmware update (DFU) mode.
  2. Communicating with it using I2C, including transferring the actual EC image over I2C. The ITE EC will only respond over I2C after receiving the special waveforms.

the special waveform is available in i2ite py file

ndarjo avatar Jan 27 '25 20:01 ndarjo

https://chromium.googlesource.com/chromiumos/platform/ec/+/refs/heads/main/docs/ite-ec-reflashing.md this is how it work

ndarjo avatar Jan 27 '25 20:01 ndarjo

first thing how it work; the pc send a bit bangs waveform to the board with ITE ec to enable Direct Firmware Upgrade via SDA and SCL. i attach the what definition of that waveform. if the ch341a can send that bitbangs waveform, i guess ch341 can program the ITE ec,

Image

ndarjo avatar Jan 27 '25 23:01 ndarjo

@ndarjo It's all good. What I can't figure out is, what do you want from me?

If you are interested in how the CH341A handles I2C - setarcos has the shortest code.

Also you can be see CH341aTool written by Tomek-o or my SFP-master

bigbigmdm avatar Jan 28 '25 04:01 bigbigmdm

what i want from you is, can you integrate it into the imsprog?

ndarjo avatar Jan 28 '25 05:01 ndarjo

I don't think the general public would be interested in a very specific microcontroller. Besides, I don't have such a chip in stock. And without verification it is ineffective to write anything.

bigbigmdm avatar Jan 28 '25 05:01 bigbigmdm

i mean help me to prove, can the sda and scl in the ch341a make a that spesific waveform. actually, the ITE EC chip is used by many laptop like asus/lenovo. but if you didnt have that chip, it will be hard to write

ndarjo avatar Jan 28 '25 05:01 ndarjo

I don't think the standard I2C interface will allow you to do this, but I think you can do it in GPIO mode - change level values of pins independently, as it is done in IMSProg and SNANDer to work with 93C46/93C56/93C66 chips... (MicroWire). In this case you will have to write your own I2C exchange... But the speed of operation will be very slow.

bigbigmdm avatar Jan 28 '25 05:01 bigbigmdm

yeah. sure. that what the official programmer of ITE chip done. it send non i2c signal in sda and scl to make the ITE ec chip get into direct firmware upgrade then accept the firmware we send via i2c protocol after we send the non i2c signal. the non i2c signal in scl is 100khz and in sda is 200khz. do you think it is possible to make the sda and scl pin in ch341a act as gpio and run at that frequency?

ndarjo avatar Jan 28 '25 05:01 ndarjo

Image

this is that non i2c waveform

ndarjo avatar Jan 28 '25 05:01 ndarjo

Not as it works now in IMSProg. The communication speed is much slower.

bigbigmdm avatar Jan 28 '25 05:01 bigbigmdm

ah okay, actually the signal is only one way(the destination didnt need to respond back). from the pc with ch341 will send that waveform to the other mainboard with IT EC via i2c interface. so based on your experience, it is not possible to make that wavefrom in that frequency using ch341a? if it true, then i ican try to get one ft232h and try improve the code available.

ndarjo avatar Jan 28 '25 05:01 ndarjo

I think the ft232h has a lot more features than the CH341a. But it is more expensive and less popular....

bigbigmdm avatar Jan 28 '25 05:01 bigbigmdm

true. thats also my problem, couldnt buy ft232h in my country. thank you so much for answering. i will try to figure it out

ndarjo avatar Jan 28 '25 05:01 ndarjo

I would be interested in this as well. Currently supported IT programmers starts from about 600AUD

Also more and more laptops we receive for a repair comes with blown SuperIO ic. Similiar to BIOS flash we need to reprogram them once replaced. Having an ability to program via one interface and one tool would be absolutely awesome. 💯

@ndarjo have you had any luck?

GunayAnach avatar May 05 '25 07:05 GunayAnach

No, I haven't done that yet...

bigbigmdm avatar May 05 '25 07:05 bigbigmdm

@bigbigmdm Happy to test on my end if you have spare time.

GunayAnach avatar May 05 '25 08:05 GunayAnach

https://github.com/c0d3z3r0/i2ite/issues/3 there are working code for ft232h in here. modify by codezero

ndarjo avatar May 05 '25 11:05 ndarjo

Hola , estoy trabajando en lo mismo , por ejemplo su uso un RT809H, realizo una lectura , y sin desconectar nada coloco un esp32 , escaneo y aparecen mas direcciones i2c , como son las 0x79 la cual al leer esta el firmware del ITE y puede ser leido , pero sin usar el RT809h antes es imposible , el problema es emular con un esp32 el bitbaring necesario para poder poner el ITE en modo KING , mediante la secuencia que muestran las diferentes liberias , pero aun no lo he logrado.

stany-project avatar May 09 '25 17:05 stany-project