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

Workaround new USB using SPMI instead of I2C #365

Merged
merged 1 commit into from
Dec 3, 2023

Conversation

dberlin
Copy link
Contributor

@dberlin dberlin commented Dec 1, 2023

This patch is a workaround for the lack of SPMI support in usb.c

Newer machines use SPMI and a different type C power controller.

This patch still lets us make the USB ports work by skipping power-on and just enabling the phys

M3+ have a new USB power controller and it works over SPMI.
However, the USB ports work (at least within m1n1) if we ignore
this and just init the phys directly.

This detects the case where we are not on an I2C based USB machine,
and initializes the phys directly.

Eventually we should support SPMI properly.

Signed-off-By: Daniel Berlin <[email protected]>
@marcan
Copy link
Member

marcan commented Dec 3, 2023

Ugh. Well that's going to be fun.

@marcan marcan merged commit 9065c70 into AsahiLinux:main Dec 3, 2023
3 checks passed
@dberlin
Copy link
Contributor Author

dberlin commented Dec 3, 2023 via email

mildsunrise added a commit to mildsunrise/m1n1 that referenced this pull request Nov 9, 2024
generalizes the HPM driver over different transports,
implements the SPMI transport, and takes care of
waking up the device upon initialization so that
commands can be sent to it.

then, reverts AsahiLinux#365 and makes the necessary
changes to the usb driver to use the appropriate
transport as necessary.

the SPMI transport is pretty much a C translation of the
hpm_spmi experiment, but has more retry loops for robustness,
since in my experience the device sometimes doesn't actually
perform the read / write to the logical register even if
it ACKs the SPMI transactions.
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

Successfully merging this pull request may close these issues.

2 participants