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

Touchpad erase not performed correctly! #22

Open
hughsie opened this issue Nov 4, 2020 · 0 comments
Open

Touchpad erase not performed correctly! #22

hughsie opened this issue Nov 4, 2020 · 0 comments

Comments

@hughsie
Copy link

hughsie commented Nov 4, 2020

I'm reading the source code of the touchpad firmware, and noticed in write_tp_fw:

rc = try_touchpad_verify(ICERASE, ICERASE_PASS, 0);
if (rc < 0) {
    printf(">>> Touchpad erase failed\n");
    goto finish;
}

Looking at the definition on try_touchpad_verify, i see:

int try_touchpad_verify(int type, int pass, int sendcmd)

so sendcmd=0... This is passed to touchpad_verify() which only does the SetReport when sendcmd is nonzero -- at the moment the code is just reading back the status 100 times and I guess by luck one of those times getting the expected ICERASE_PASS=0xE2 value.

This seems to explain quite a few people having TP flash failures, with the 2nd step failing on Touchpad erase failed. If this analysis is correct, it should be a simple case of:

-rc = try_touchpad_verify(ICERASE, ICERASE_PASS, 0);
+rc = try_touchpad_verify(ICERASE, ICERASE_PASS, 1);

...and I'd be happy to do a PR if that sounds acceptable. Not tested on actual hardware, as my PBP is waiting in customs.

Other people hitting this problem:

Richard.

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

No branches or pull requests

1 participant