summaryrefslogtreecommitdiff
path: root/arch/arm/plat-s3c64xx/s3c6400-clock.c
AgeCommit message (Collapse)Author
2010-02-20ARM: S3C64XX: Merge s3c6400-clock.c and clock.c into mach-s3c64xxBen Dooks
Merge plat-s3c64xx/s3c6400-clock.c mach-s3c64xx/clock.c placing all the clock code into one place. Note, no effort is made in this patch to squash the init functions together. Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2010-02-20ARM: S3C64XX: Move headers into machine include directoryBen Dooks
Move the register and GPIO definition files from plat-s3c64xx into the machine include direcotry as they are unlikely to be reused outside mach-s3c64xx. This move includes removing the empty <mach/regs-clock.h> and replacing it with the <plat/regs-clock.h> implementation. Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2010-01-15ARM: S3C64XX: Avoid announcing clksrc clocks twiceBen Dooks
The new code calls the clock setup code on registration which can be before the clock system has been fully initialised. The following code re-does this setup at the end of the clock registration and thus we get two printings. Update the calls to only print on the last pass or when doing the necessary resume work. Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2010-01-15ARM: S3C64XX: Fixup .reg_src and .reg_div with named initialisersBen Dooks
Change these two fields to have named initialisers as per the review comments from Kyungmin Park. sed used: s@\.reg_src\(.*\)=\(.*\){\(.*\),\(.*\),\(.*\)}@.reg_src\1=\2{ .reg =\3, .shift =\4, .size =\5 }@g s@\.reg_div\(.*\)=\(.*\){\(.*\),\(.*\),\(.*\)}@.reg_div\1=\2{ .reg =\3, .shift =\4, .size =\5 }@g Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2010-01-15ARM: SAMSUNG: Reduce size of struct clk.Ben Dooks
Reduce the size of struct clk by 12 bytes and make defining clocks with common implementation functions easier by moving the set_rate, get_rate, round_rate and set_parent calls into a new structure called 'struct clk_ops' and using that instead. This change does make a few clocks larger as they need their own clk_ops, but this is outweighed by the number of clocks with either no ops or having a common set of ops. Update all the users of this. Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2010-01-15ARM: S3C64XX: Use new clock-clksrc.c code for clocks.Ben Dooks
Move the s3c6400-clock.c implementation over to use the new common plat-samsung based clock-clksrc.c. Note, this does not delete the clocks definitions that are now unused in the regs-clock.h to reduce the quantity of change in this commit. Based on original patches by Harald Welte. Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2010-01-15ARM: S3C64XX: Compress s3c6400-clock.c codeBen Dooks
The individually named clocks are all static to the code and thus can be compressed into a single array and then the array can be referenced. This removes the need for a seperate array of pointers to clocks. Fix a minor problem of re-initialising the pointers in s3c6400_set_clksrc() as this is also called by the cpufreq code. Move these initialisations to the code that does the registration. Based on Harald Welte's original clock changes patch. Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2010-01-15ARM: S3C64XX: Cleanup common init code in s3c6400-clock.cBen Dooks
Remove the four fields from clksrc_clk.clk which are always the same and init them when the clock is registered. This helps remove the amount of repeated code. This is a re-work of Harald Welte's clock changes for the latest kernel. Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2010-01-07ARM: S3C64XX: Fix possible clock look in EPLL and MPLL clock chainsBen Dooks
There is a possibility of a loop happening in the PLL output clock chain on the S3C64XX series. clk_mpll's parent was set to be clk_mout_mpll, but this is fed from clk_fout_epll (which is also clk_mpll). clk_mpll is meant to be the output from the MPLL, and clk_mout_mpll is a seperate clock derived from the mux of clk_mpll and clk_fin_mpll and thus should be considered a seperate clock. Anything using clk_mpll directly really should not be relying on this being the clock that is eventually routed to a peripheral, so remove the loop and ensure that the clocks accurately represent the clock chain in the device. The clk_mpll is not being used outside of the s3c6400-clock.c code, so this change should not break anything else. Do the same for the EPLL. Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-10-26ARM: S3C64XX: Set rate of crystal muxMark Brown
The current code assumes that the external clock mux will be set to the crystal. Set this up explicitly within the clock API. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-09-16ARM: S3C64XX: Fix divider value calculation in s3c64xx_roundrate_clksrcThomas Abraham
In s3c64xx_roundrate_clksrc function, the calculation is wrong. This patch fixes this calculation. Signed-off-by: Thomas Abraham <thomas.ab@samsung.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-09-16ARM: S3C6410: update clk->parent when setting clock sourceThomas Abraham
This ensures the clock hierarchy data structures are updated when we change the clock source in the actual hardware registers. Signed-off-by: Thomas Abraham <thomas.ab@samsung.com> [ben-linux@fluff.org: Minor re-indentation of subject] Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-09-16ARM: S3C6410: use correct divider_shift in setrate_clksrc()Thomas Abraham
In s3c64xx_setrate_clksrc() we used sclk->shift, but actually need to use sclk->divider_shift to correctly calculate the value for the divider register. Signed-off-by: Thomas Abraham <thomas.ab@samsung.com> [ben-linux@fluff.org: Minor re-indentation of description] Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-07-29S3C64XX: Fix ARMCLK configurationMark Brown
The value of armclk_mask needs to be inverted for use as a mask on the register value when updating ARM_RATIO. This is critical for cpufreq support, without it attempts to scale the frequency of the core trash pretty much the entire clock tree. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-07-29S3C64XX: Fix get_rate() for ARMCLKMark Brown
If the requested clock is faster than the parent clock then the parent clock is the closest we can get to the request so we need to return that instead of the requested clock. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-05-07[ARM] S3C64XX: Add ARM clockBen Dooks
Add ARM clock to provide 'arm' from the APLL to the ARM core. Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-05-07[ARM] S3C64XX: Add HCLKx2Werner Almesberger
Add doubled HCLK to S3C64xx. Signed-off-by: Werner Almesberger <werner@openmoko.org> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-05-07[ARM] S3C6410: Add CAMIF clockWerner Almesberger
Add camera interface clock to S3C6410. Signed-off-by: Werner Almesberger <werner@openmoko.org> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-02-27[ARM] S3C64XX: Fix s3c64xx_setrate_clksrcWerner Almesberger
Some of the rate selection logic in s3c64xx_setrate_clksrc uses what appears to be parent clock selection logic. This patch corrects it. I also added a check for overly large dividers to prevent them from changing unrelated clocks. Signed-off-by: Werner Almesberger <werner@openmoko.org> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-02-27[ARM] S3C64XX: sparse warnings in arch/arm/plat-s3c64xx/s3c6400-clock.cBen Dooks
Fix the following sparse warnings in s3c6400-clock.c: 39:12: warning: symbol 'clk_ext_xtal_mux' was not declared. Should it be static? 66:12: warning: symbol 'clk_fout_apll' was not declared. Should it be static? 81:19: warning: symbol 'clk_mout_apll' was not declared. Should it be static? 91:12: warning: symbol 'clk_fout_epll' was not declared. Should it be static? 106:19: warning: symbol 'clk_mout_epll' was not declared. Should it be static? 126:19: warning: symbol 'clk_mout_mpll' was not declared. Should it be static? 148:12: warning: symbol 'clk_dout_mpll' was not declared. Should it be static? Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-02-26[ARM] S3C64XX: Fix USB host clock mux listBen Dooks
The clock list for the USB host bus clock was in the wrong order, move clk_48m to position 0. Signed-off-by: Ben Dooks <ben@simtec.co.uk> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2009-02-26[ARM] S3C64XX: Fix name of USB host clock.Ben Dooks
The usb-host-bus clock should be named usb-bus-host. Signed-off-by: Ben Dooks <ben@simtec.co.uk> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2008-12-15[ARM] S3C6400: Register clk_fout_epllBen Dooks
The clk_fout_epll clock wasn't registered as part of the initial clock work, which can cause problems if it is used by one of the hardware blocks. Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2008-12-15[ARM] S3C64XX: Reduce some output from INFO to DEBUGBen Dooks
Some of the startup output can be reduced to KERN_DEBUG from KERN_INFO as it is only really useful when trying to debug kernel initialisation problems. Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2008-12-15[ARM] S3C64XX: Clock support for S3C6400/S3C6410Ben Dooks
Add the PLL clock initialisation and clock registration and include the clocks sourced via CLKDIVx for most of the on-chip peripherals. Signed-off-by: Ben Dooks <ben-linux@fluff.org>