convert OMAP to use clkdev
Subsystems (2)
All,
In a bid to clean up the clk API implementations, and more importantly ensure that implementations are using the clk API correctly, I've converted OMAP over to the generic clock lookup (clkdev) implementation.
In doing so, I've shaken out a number of OMAP quirks and OMAP1 specific clock code from the drivers.
The set of patches (minus two[*]) are available in my 'omap-clks2' branch. This is built on top of the omap-clks1 branch, which some people here already know about.
I do need to make some points:
1. the omap-clks1 branch has been updated with various silly fixes I've found along the way, so this won't be the same as the omap-clks1 branch from a month ago.
2. omap-clks2 branch follows on from the omap-clks1 branch - in other words, arm:omap-clks2.diff is a superset of omap-clks1.diff.
3. clkdev's current matching algorithm leads to false positives on OMAP, so you need the clkdev fix which is in the master branch as well.
With this, I've been able to boot my LDP board (with the HS MMC driver) through to a shell prompt, and kernel messages look good. I've also a bodgerated QEMU H2-based-on-OMAP310 environment which I've been checking OMAP1 on, and that looks reasonable. Obviously, it's no subsitute for real hardware.
Reviews and comments obviously welcome, testing more preferred. Probably the easiest way to apply these changes for testing is to download the diffs from the FTP site: arm.diff and arm:omap-clks2.diff, and apply them in that order to a fresh mainline tree.
There's still a bit of work to be done here - I've left the original 'name' and 'id' members in the struct clk solely for the debugfs code. Obviously this is wasteful if you don't have debugfs enabled.
Finally, the diffstat for the clkdev conversion for OMAP (omap-clks1 to omap-clks2) shows a saving of 500 lines of code - definitely something not to be sniffed at:
arch/arm/mach-omap1/clock.c | 152 ++++++++-- arch/arm/mach-omap1/clock.h | 171 ++-------- arch/arm/mach-omap1/mcbsp.c | 133 ++------ arch/arm/mach-omap2/clock24xx.c | 197 +++++++++++- arch/arm/mach-omap2/clock24xx.h | 353 ++------------------- arch/arm/mach-omap2/clock34xx.c | 268 ++++++++++++++-- arch/arm/mach-omap2/clock34xx.h | 513 +++++------------------------- arch/arm/mach-omap2/devices.c | 1 + arch/arm/mach-omap2/mcbsp.c | 121 ------- arch/arm/plat-omap/Kconfig | 3 + arch/arm/plat-omap/clock.c | 48 +--- arch/arm/plat-omap/include/mach/clkdev.h | 13 + arch/arm/plat-omap/include/mach/clock.h | 11 +- arch/arm/plat-omap/include/mach/mcbsp.h | 4 +- arch/arm/plat-omap/mcbsp.c | 66 +++-- drivers/i2c/busses/i2c-omap.c | 47 ++-- drivers/mmc/host/omap.c | 24 +- drivers/spi/omap2_mcspi.c | 4 +- drivers/spi/omap_uwire.c | 9 +- drivers/w1/masters/omap_hdq.c | 4 +- drivers/watchdog/omap_wdt.c | 94 ++----- 21 files changed, 868 insertions(+), 1368 deletions(-)
[*] - these are for the RNG and OHCI drivers, and have been left out for the time being because they conflict with my master branch, and would make the omap-clks2 patch unnecessarily difficult for people to try.
Note: please don't think about polluting mach/clkdev.h, thanks.
Quoted 8 lines
From: [email protected] [mailto:linux-omap- [email protected]] On Behalf Of Russell King - ARM Linux
Reviews and comments obviously welcome, testing more preferred. Probably the easiest way to apply these changes for testing is to download the diffs from the FTP site: arm.diff and arm:omap-clks2.diff, and apply them in that order to a fresh mainline tree.
Which/where on ftp site?
ftp://ftp.arm.linux.org.uk/
Regards,
Richard W.
Quoted 10 lines · Richard
Quoted 8 lines
From: [email protected] [mailto:linux-omap- [email protected]] On Behalf Of Russell King - ARM Linux
Reviews and comments obviously welcome, testing more preferred. Probably the easiest way to apply these changes for testing is to download the diffs from the FTP site: arm.diff and arm:omap-clks2.diff, and apply them in that order to a fresh mainline tree.
Which/where on ftp site?
Unfortunately, I can never remember the URL. There's a link off of
http://www.arm.linux.org.uk/developer/ which takes you directly to where I keep kernel patches.
Quoted 8 lines · Russell King - ARM Linux
All,
In a bid to clean up the clk API implementations, and more importantly ensure that implementations are using the clk API correctly, I've converted OMAP over to the generic clock lookup (clkdev) implementation.
In doing so, I've shaken out a number of OMAP quirks and OMAP1 specific clock code from the drivers.
To summarize, these patches solve the problem of matching clocks with the driver where omap1 usually has one clock, and omap2 & 3 devices have two clocks.
Quoted 3 lines
The set of patches (minus two[*]) are available in my 'omap-clks2' branch. This is built on top of the omap-clks1 branch, which some people here already know about.
Russell, can you please post your omap-clks[12] patches here too for review so people can look at them? It's ok to post a large series of patches to this list.
Quoted 9 lines
I do need to make some points:
1. the omap-clks1 branch has been updated with various silly fixes I've found along the way, so this won't be the same as the omap-clks1 branch from a month ago.
2. omap-clks2 branch follows on from the omap-clks1 branch - in other words, arm:omap-clks2.diff is a superset of omap-clks1.diff.
Quoted 8 lines
3. clkdev's current matching algorithm leads to false positives on OMAP, so you need the clkdev fix which is in the master branch as well.
With this, I've been able to boot my LDP board (with the HS MMC driver) through to a shell prompt, and kernel messages look good. I've also a bodgerated QEMU H2-based-on-OMAP310 environment which I've been checking OMAP1 on, and that looks reasonable. Obviously, it's no subsitute for real hardware.
Seems to boot on overo after applying the attached hsmmc init fix.
Quoted 4 lines
Reviews and comments obviously welcome, testing more preferred. Probably the easiest way to apply these changes for testing is to download the diffs from the FTP site: arm.diff and arm:omap-clks2.diff, and apply them in that order to a fresh mainline tree.
Or even easier for the omap folks is to use the new clks-testing branch I've just added to the linux-omap tree on kernel.org.
That's v2.6.26-rc2 + rmk/master + rmk/omap-clks1 + rmk/omap-clks2 + one fix for hsmmc init (attached also).
Quoted 3 lines
There's still a bit of work to be done here - I've left the original 'name' and 'id' members in the struct clk solely for the debugfs code. Obviously this is wasteful if you don't have debugfs enabled.
Is this series missing a patch to just clk_get ick and fck for omap_hsmmc.c?
Quoted 18 lines
Finally, the diffstat for the clkdev conversion for OMAP (omap-clks1 to omap-clks2) shows a saving of 500 lines of code - definitely something not to be sniffed at:
arch/arm/mach-omap1/clock.c | 152 ++++++++-- arch/arm/mach-omap1/clock.h | 171 ++-------- arch/arm/mach-omap1/mcbsp.c | 133 ++------ arch/arm/mach-omap2/clock24xx.c | 197 +++++++++++- arch/arm/mach-omap2/clock24xx.h | 353 ++------------------- arch/arm/mach-omap2/clock34xx.c | 268 ++++++++++++++-- arch/arm/mach-omap2/clock34xx.h | 513 +++++------------------------- arch/arm/mach-omap2/devices.c | 1 + arch/arm/mach-omap2/mcbsp.c | 121 ------- arch/arm/plat-omap/Kconfig | 3 + arch/arm/plat-omap/clock.c | 48 +--- arch/arm/plat-omap/include/mach/clkdev.h | 13 + arch/arm/plat-omap/include/mach/clock.h | 11 +- arch/arm/plat-omap/include/mach/mcbsp.h | 4 +-
Quoted 8 lines
arch/arm/plat-omap/mcbsp.c | 66 +++-- drivers/i2c/busses/i2c-omap.c | 47 ++-- drivers/mmc/host/omap.c | 24 +- drivers/spi/omap2_mcspi.c | 4 +- drivers/spi/omap_uwire.c | 9 +- drivers/w1/masters/omap_hdq.c | 4 +- drivers/watchdog/omap_wdt.c | 94 ++----- 21 files changed, 868 insertions(+), 1368 deletions(-)
Shrinking the clock*-h is a good thing.
However my main concern is that this series is going to cause a massive manual merge pain for us to get in sync with the linux-omap tree.
Regards,
Tony
Quoted 6 lines
[*] - these are for the RNG and OHCI drivers, and have been left out for the time being because they conflict with my master branch, and would make the omap-clks2 patch unnecessarily difficult for people to try.
Note: please don't think about polluting
mach/clkdev.h, thanks.
Huh?
commit 418c92c9fa4e7e56cacd14f0ed24cf7cfdc3f477
Author: Tony Lindgren <[email protected]> Date: Sat Jan 24 08:34:37 2009 -0800
Fix hsmmc init
It accidentally broke while changing the name for the driver to not to conflict with the other mmc driver.
arch/arm/plat-omap/devices.c +7 -1
@@ -205,9 +205,15 @@ int __init omap_mmc_add(int id, unsigned long base, unsigned long size, {struct platform_device *pdev;struct resource res[OMAP_MMC_NR_RES ]; +char *name;int ret; - pdev =platform_device_alloc ("mmci-omap" , id); +if (cpu_class_is_omap1 () ||cpu_is_omap242x ()) + name ="mmci-omap" ; +else + name ="mmci-omap-hs" ; + + pdev =platform_device_alloc (name, id);if (!pdev)return -ENOMEM ;
Quoted 3 lines · Tony Lindgren
Russell, can you please post your omap-clks[12] patches here too for review so people can look at them? It's ok to post a large series of patches to this list.
TBH, I haven't worked out how to get git to sanely do that yet, and I suspect that git-send-email will overload my mail server at this end due to lack of grace periods between messages. However, I'll try to sort something out over the next week or so.
Quoted 6 lines
Quoted 3 lines
There's still a bit of work to be done here - I've left the original 'name' and 'id' members in the struct clk solely for the debugfs code. Obviously this is wasteful if you don't have debugfs enabled.
Is this series missing a patch to just
clk_getick and fck foromap_hsmmc.c?
Yes and no - I can't do that until we sort out where/when omap_hsmmc is going to get merged.
Quoted 4 lines
Shrinking the clock*-h is a good thing.
However my main concern is that this series is going to cause a massive manual merge pain for us to get in sync with the linux-omap tree.
That's something I can't help.
I requested that the clock changes be merged upstream ASAP several months ago so I could work on the OMAP clock API without causing major merge pain. Unfortunately, this hasn't been forthcoming, and after waiting a reasonable amount of time, I've given up waiting.
I had given up all hope of ever seeing the omap-clks1 branch in mainline. Really. Until I saw a comment from you about apparantly wanting to see it upstream. However, I still have a very big question whether any of this work will ever reach mainline, especially since my experimental omap-clks1 branch seems to have been broken up with random bits applied to your tree with zero discussion with me.
Quoted 8 lines
Quoted 6 lines
[*] - these are for the RNG and OHCI drivers, and have been left out for the time being because they conflict with my master branch, and would make the omap-clks2 patch unnecessarily difficult for people to try.
Note: please don't think about polluting
mach/clkdev.h, thanks.Huh?
Don't put anything else in mach/clkdev.h - it's full.
Quoted 9 lines · Russell King - ARM Linux
Quoted 3 lines · Tony Lindgren
Russell, can you please post your omap-clks[12] patches here too for review so people can look at them? It's ok to post a large series of patches to this list.
TBH, I haven't worked out how to get git to sanely do that yet, and I suspect that git-send-email will overload my mail server at this end due to lack of grace periods between messages. However, I'll try to sort something out over the next week or so.
I've found that stg-mail works pretty good. At least I like it more than git-send-email. And it has the --sleep option between mails.
You can also output the messages into a mbox first, then formail to send them. I have not tried that, but been meaning to.
Quoted 9 lines
Quoted 6 lines
Quoted 3 lines
There's still a bit of work to be done here - I've left the original 'name' and 'id' members in the struct clk solely for the debugfs code. Obviously this is wasteful if you don't have debugfs enabled.
Is this series missing a patch to just
clk_getick and fck foromap_hsmmc.c?Yes and no - I can't do that until we sort out where/when
omap_hsmmcis going to get merged.
OK. Still seems to work with old clock names too.
Also, your patches boot fine on osk5912.
Quoted 11 lines
Quoted 4 lines
Shrinking the clock*-h is a good thing.
However my main concern is that this series is going to cause a massive manual merge pain for us to get in sync with the linux-omap tree.
That's something I can't help.
I requested that the clock changes be merged upstream ASAP several months ago so I could work on the OMAP clock API without causing major merge pain. Unfortunately, this hasn't been forthcoming, and after waiting a reasonable amount of time, I've given up waiting.
Hmm, didn't Paul offer several times to send you clock update patches?
Quoted 6 lines
I had given up all hope of ever seeing the omap-clks1 branch in mainline. Really. Until I saw a comment from you about apparantly wanting to see it upstream. However, I still have a very big question whether any of this work will ever reach mainline, especially since my experimental omap-clks1 branch seems to have been broken up with random bits applied to your tree with zero discussion with me.
Paul has spent some time to merge some of your earlier omap-clks1 stuff into linux-omap tree. Manually merging them, there's really no other way to merge these changes. And Paul posted some of your earlier omap-clks1 patches to this list along with some other patches before they got merged.
Anyways, too late to bitch. Merging this stuff is going to be a pain. And in the long run we need both Russell's and Paul's patches. So let's just figure out a way how we can get it all merged and into the mainline tree.
Tony
Quoted 10 lines
Quoted 8 lines
Quoted 6 lines
[*] - these are for the RNG and OHCI drivers, and have been left out for the time being because they conflict with my master branch, and would make the omap-clks2 patch unnecessarily difficult for people to try.
Note: please don't think about polluting
mach/clkdev.h, thanks.Huh?
Don't put anything else in
mach/clkdev.h- it's full.
Quoted 14 lines · Tony Lindgren
Quoted 6 lines · Russell King - ARM Linux
I had given up all hope of ever seeing the omap-clks1 branch in mainline. Really. Until I saw a comment from you about apparantly wanting to see it upstream. However, I still have a very big question whether any of this work will ever reach mainline, especially since my experimental omap-clks1 branch seems to have been broken up with random bits applied to your tree with zero discussion with me.
Paul has spent some time to merge some of your earlier omap-clks1 stuff into linux-omap tree. Manually merging them, there's really no other way to merge these changes. And Paul posted some of your earlier omap-clks1 patches to this list along with some other patches before they got merged.
Quoted 4 lines
Anyways, too late to bitch. Merging this stuff is going to be a pain. And in the long run we need both Russell's and Paul's patches. So let's just figure out a way how we can get it all merged and into the mainline tree.
If Paul sends me his changes, I'm entirely willing to do the dovetailing work to get them merged with my changes. I already do that - what you see as the changes between clks1 and clks2 were resorted this morning before sending that email out. There's interdependencies between each commit which make such operations non-trivial with traditional git usage. I have my own scripts which make it possible to move, delete, and merge a set of commits and patches together.
Therefore, it probably makes sense for me to do it.
Quoted 28 lines · Russell King - ARM Linux
Quoted 14 lines · Tony Lindgren
Quoted 6 lines · Russell King - ARM Linux
I had given up all hope of ever seeing the omap-clks1 branch in mainline. Really. Until I saw a comment from you about apparantly wanting to see it upstream. However, I still have a very big question whether any of this work will ever reach mainline, especially since my experimental omap-clks1 branch seems to have been broken up with random bits applied to your tree with zero discussion with me.
Paul has spent some time to merge some of your earlier omap-clks1 stuff into linux-omap tree. Manually merging them, there's really no other way to merge these changes. And Paul posted some of your earlier omap-clks1 patches to this list along with some other patches before they got merged.
Quoted 4 lines
Anyways, too late to bitch. Merging this stuff is going to be a pain. And in the long run we need both Russell's and Paul's patches. So let's just figure out a way how we can get it all merged and into the mainline tree.
If Paul sends me his changes, I'm entirely willing to do the dovetailing work to get them merged with my changes. I already do that - what you see as the changes between clks1 and clks2 were resorted this morning before sending that email out. There's interdependencies between each commit which make such operations non-trivial with traditional git usage. I have my own scripts which make it possible to move, delete, and merge a set of commits and patches together.
Quoted 1 line
Therefore, it probably makes sense for me to do it.
Wow, that's the best thing I've ever seen during all the merge hells!
I'll keep the clks-testing branch updated so we all can test it easily, and then we'll just flip linux-omap to use that branch for the clocks once everything is merged.
Let me know if I can help with anything else!
Tony
Quoted 3 lines · Tony Lindgren
I'll keep the clks-testing branch updated so we all can test it easily, and then we'll just flip linux-omap to use that branch for the clocks once everything is merged.
Note that I'm going to rebase the two omap-clks branches to be on top of Linus' tree now that my 'master' was merged.
I would also like to have Paul's patches by the weekend - I'm not asking for them to already be manipulated to apply on top of my patches, so it shouldn't take very much time to sort out which patches need to be sent to me.
Quoted 7 lines · Russell King - ARM Linux
Quoted 3 lines · Tony Lindgren
I'll keep the clks-testing branch updated so we all can test it easily, and then we'll just flip linux-omap to use that branch for the clocks once everything is merged.
Note that I'm going to rebase the two omap-clks branches to be on top of Linus' tree now that my 'master' was merged.
OK, I'll refresh the clks-testing branch in linux-omap tree so people can test it easily.
Quoted 4 lines
I would also like to have Paul's patches by the weekend - I'm not asking for them to already be manipulated to apply on top of my patches, so it shouldn't take very much time to sort out which patches need to be sent to me.
Sounds doable, I believe Paul is pretty close to posting his series.
Regards,
Tony
Quoted 11 lines · Tony Lindgren
Quoted 7 lines · Russell King - ARM Linux
Quoted 3 lines · Tony Lindgren
I'll keep the clks-testing branch updated so we all can test it easily, and then we'll just flip linux-omap to use that branch for the clocks once everything is merged.
Note that I'm going to rebase the two omap-clks branches to be on top of Linus' tree now that my 'master' was merged.
OK, I'll refresh the clks-testing branch in linux-omap tree so people can test it easily.
Note that you only need my omap-clks2 branch. As I said in the original message, omap-clks2 is a superset of omap-clks1 - so merging omap-clks2 gets you everything already in omap-clks1.
Quoted 10 lines · Russell King - ARM Linux
Quoted 9 lines · Tony Lindgren
Quoted 7 lines · Russell King - ARM Linux
Quoted 3 lines · Tony Lindgren
I'll keep the clks-testing branch updated so we all can test it easily, and then we'll just flip linux-omap to use that branch for the clocks once everything is merged.
Note that I'm going to rebase the two omap-clks branches to be on top of Linus' tree now that my 'master' was merged.
Quoted 6 lines
Quoted 2 lines
OK, I'll refresh the clks-testing branch in linux-omap tree so people can test it easily.
Note that you only need my omap-clks2 branch. As I said in the original message, omap-clks2 is a superset of omap-clks1 - so merging omap-clks2 gets you everything already in omap-clks1.
OK, the clks-testing in linux-omap tree is updated now. Everybody, please note that this is a temporary branch that will get rebased often.
So if pulling it fails the next time, just do a hard reset on your local clks-testing branch with git-reset --hard origin/clks-testing after doing a git-fetch.
Tony
Quoted 2 lines · Russell King - ARM Linux
If Paul sends me his changes, I'm entirely willing to do the dovetailing work to get them merged with my changes.
That's great. I'll send a series to the lists ASAP.
- Paul
Quoted 3 lines · Russell King - ARM Linux
In a bid to clean up the clk API implementations, and more importantly ensure that implementations are using the clk API correctly, I've converted OMAP over to the generic clock lookup (clkdev) implementation.
I have some comments on this proposal; I will post them after the clock update series have been sent to the lists.
- Paul