Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ITE i2c smbus read and write for IT8xxx ec #123

Open
ndarjo opened this issue Jan 27, 2025 · 17 comments
Open

ITE i2c smbus read and write for IT8xxx ec #123

ndarjo opened this issue Jan 27, 2025 · 17 comments
Labels
enhancement New feature or request

Comments

@ndarjo
Copy link

ndarjo commented Jan 27, 2025

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 ndarjo added the enhancement New feature or request label Jan 27, 2025
@ndarjo
Copy link
Author

ndarjo commented Jan 27, 2025

Image

this is the ITE download board,

@ndarjo
Copy link
Author

ndarjo commented Jan 27, 2025

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

@ndarjo
Copy link
Author

ndarjo commented Jan 27, 2025

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

@ndarjo
Copy link
Author

ndarjo commented Jan 27, 2025

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
Copy link
Author

ndarjo commented Jan 27, 2025

@ndarjo
Copy link
Author

ndarjo commented Jan 27, 2025

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

@bigbigmdm
Copy link
Owner

bigbigmdm commented Jan 28, 2025

@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

@ndarjo
Copy link
Author

ndarjo commented Jan 28, 2025

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

@bigbigmdm
Copy link
Owner

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.

@ndarjo
Copy link
Author

ndarjo commented Jan 28, 2025

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

@bigbigmdm
Copy link
Owner

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.

@ndarjo
Copy link
Author

ndarjo commented Jan 28, 2025

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
Copy link
Author

ndarjo commented Jan 28, 2025

Image

this is that non i2c waveform

@bigbigmdm
Copy link
Owner

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

@ndarjo
Copy link
Author

ndarjo commented Jan 28, 2025

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.

@bigbigmdm
Copy link
Owner

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

@ndarjo
Copy link
Author

ndarjo commented Jan 28, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants