-
Notifications
You must be signed in to change notification settings - Fork 14
Add MSM8974 #35
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
Add MSM8974 #35
Conversation
6317837 to
786c9b8
Compare
|
I think the properties should be correct now. Output below in the Details block. Generally the values look sane, but there's some where Linux's clk_rate from debugfs differs from the value printed here. For example:
But for a completely different SoC (sm6350) I have fixed the rate that Linux thought before, and given the age of the msm8974 driver I'd believe more that the Linux driver might be wrong there. |
|
So according to an arcane 2012 PDF, the bus (PNoC, CNoC, SNoC, BIMC & MMSSNoC_AHB) clocks should have never been touched by Linux, as RPM is supposed to take care of them (i.e. we don't want to be stepping on one another's toes).. We won't be able to retrieve the rates of certain clocks at all because of that, but as you said above, it they may not always be useful or correct. Now I can't find a frequency plan for 8974, but taking conclusions from the rather similar 8994, the debugcc-reported rates you mentioned above are not totally impossible (although not 100% matching either..) Please also make sure (if you haven't already) that your debugcc clock map is the latest version (i.e. for 8974v2/ac depending on your hw) so we're not poking in the dark |
The kernel sources I've based this on are definitely good for MSM8974AB-AB and MSM8974AB-AA (a.k.a MSM8974PRO-AB and MSM8974PRO-AA). The device I was trying it on should be one of the AB ones. So unless there's a newer version somewhere (OnePlus One is -AC fwiw), it's definitely not one of the old MSM8974 non-pro variants (a.k.a Snapdragon 800). |
|
I have the APQ8074 dragonboard, so next week I should be able to cross-check it on that board |
|
@lumag Did you have a chance to try this? |
|
@lumag ping? |
|
If you enable CONFIG_DEVMEM=y on the downstream kernel and run debugcc there, are the outputs majorly different? |
|
Unfortunately, not really. When I tried it last time, I was totally piled under necessary kernel fixes. Let me try cheking this over the weekend. |
|
This is me running it on downstream (LineageOS 18.1), with screen on. Binary build, since it was a bit annoying to build... Mostly for my reference debugcc-armv7-static-msm8974.zip (with |
|
@z3ntu the values look rather sane, so I'd like to merge this. |
msm8974.c
Outdated
|
|
||
| .div_reg = 0x1880, | ||
| .div_mask = 0xf000, | ||
| .div_val = 1, // FIXME should be 1? |
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.
conclusion?
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.
You wrote
div_val i don't know, you'll figure it out at runtime
I guess if the values are sane (for the most part), it should be okay?
What's curious to me now is if actually the downstream in-kernel debugcc also is reporting the same rates as this debugcc...
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.
I guess if the values are sane (for the most part), it should be okay?
yeah
What's curious to me now is if actually the downstream in-kernel debugcc also is reporting the same rates as this debugcc...
I'm interested as well - if you're able to, please give it a spin
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.
So should be fine I think.
I've removed the FIXME now and removed duplicate ocmemcx_ocmemnoc_clk entry (that's also duplicate in downstream btw)
debugcc-msm8974-android-2-prepared.txt debugcc-msm8974-android-2-measure-prepared.txt Both files have some post-processing like sorting, can be viewed relatively well with The rates generally seem to match, some are a bit off, probably just because the clock is not running at the same rate all the time. |
APCS clocks are ignored because the logic is a bit too conditional in the downstream clock-8974.c code to be nicely integrated. Signed-off-by: Luca Weiss <[email protected]>
|
The diff looks very reasonable - I'm merging this as-is. Thank you @z3ntu |
Need some help figuring out the remaining values marked with FIXME. I think I understand too little about debugcc and these old clock drivers :)
Downstream: https://github.com/FairphoneMirrors/android_kernel_fairphone_msm8974/blob/int/10/fp2/arch/arm/mach-msm/clock-8974.c#L4431