-
Notifications
You must be signed in to change notification settings - Fork 173
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
Remove overriding bus timing defaults #473
Conversation
Thanks for this, it's indeed a welcome change. BTW, I plan to support per-platform defaults in the near future, as the current defaults are Haswell era ( Regarding FIFO size, I don't know. Could legacy hardware (Haswell) used hardocded values in the past? |
@ben9923 Thank you very much for the reply. Per-platform defaults will certainly be a great improvement.
I'm not sure if there are cases where the buffer returned from FMCN/SSCN is incomplete/invalid. If we don't care about it (I don't think linux does either), then it's fine to remove the assignments. I haven't looked at the git history regarding the FIFO size, will probably do so tomorrow. BTW, the DesignWare Driver has a way to calculate/approximate the missing |
Looking at the
It appears to originate from the very first Lynx Point dw commit: torvalds/linux@b61b141 I have no idea if any intel PCH has a FIFO size that's higher than 32, but it's simple enough to add for the chance it'll optimize some platforms. I'll try looking those values up on 400 series, etc.
Yeah, that's what I was referring to. I can do both :) |
@williambj1 Accidentally messed up the remote while trying to rebase :/ Sorry! |
Some devices only provide the set of timing values for their operating bus frequency. Remove overriding bus timing defaults when `getBusConfig` fails.
@ben9923 Done :) GitHub doesn't allow me to reopen the PR, please let me know if a new PR should be created. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Specific to this issue, maybe it's better to check the return of |
@zhen-zen I believe we should treat it as an error until proper default bus config exists for SKL+, as currently default aren't good. Once per-platform defaults feature is merged - You're right, it should not be treated as an error. |
Hi devs!
This PR allows accepting a single set of bus
*CNT
values (hcnt
,lcnt
, andsda hold
) for a certain bus frequency (Standard Mode and Fast Mode) and leaves the missing sets as default. Which will actually reflect the log that says "using defaults where necessary".VoodooI2C/VoodooI2C/VoodooI2C/VoodooI2CController/VoodooI2CControllerDriver.cpp
Line 468 in 9ddc72a
Previously if one set of the
*CNT
values for a certain frequency is missing, all of the values will be set back to default. This is problematic on platforms where the OEM only provides a set of customized values for the desired frequency and leaves others unset.Here is an example from an ASUS laptop (Zephyrus S GX531GS):
Original DSDT for reference:
DSDT.aml.zip
BTW, I realized that the controller code is ported from the Linux DesignWare I2C driver and there is a way to read the tx and rx fifo depth. Currently the tx and rx fifo depth is hardcoded, is there any particular reason for that?
https://github.com/torvalds/linux/blob/bf9f243f23e6623f310ba03fbb14e10ec3a61290/drivers/i2c/busses/i2c-designware-common.c#L572-L598
Thanks and have a nice day.