omap2 clock: create clock24xx.[ch] in preparation for 3430 clock code
Paul Walmsley
maintainercover omap2 clock: create clock24xx.[ch] in preparation for 3430 clock code
Hello,
this short patch series separates OMAP24xx clock definitions and code from common clock code and headers. It's in preparation for OMAP3430 clock definitions and code.
All this happens in patches 2 and 3 of this series. The remaining patch 1 moves some SDRC-related defines from clock.h into sdrc.h where they belong.
The diffstat looks big, but the patches are mostly just cut and paste, with a few minor changes to expose common functions to the linker, and to satisfy checkpatch (at least somewhat).
Review and comments are appreciated, as always.
- Paul
diffstat:
arch/arm/mach-omap2/clock.c | 548 ----- arch/arm/mach-omap2/clock.h | 2661 ----------------------------- linux-omap/arch/arm/mach-omap2/Makefile | 3 linux-omap/arch/arm/mach-omap2/clock.c | 2 linux-omap/arch/arm/mach-omap2/clock.h | 62 linux-omap/arch/arm/mach-omap2/clock24xx.c | 521 +++++ linux-omap/arch/arm/mach-omap2/clock24xx.h | 2653 ++++++++++++++++++++++++++++ linux-omap/arch/arm/mach-omap2/sdrc.h | 31 8 files changed, 3290 insertions(+), 3191 deletions(-)
size:
text data bss dec hex filename
2853812 149804 85992 3089608 2f24c8 vmlinux.orig 2854244 149804 85992 3090040 2f2678 vmlinux
Paul Walmsley
maintainerPATCH 1/3 omap2 clock: move SDRC autorefresh counter defines into sdrc.h
Move the SDRC autorefresh counter defines from clock.h into sdrc.h, a more logical place for them. Expand the comments to add more explanation as to how those values are derived.
--- arch/arm/mach-omap2/clock.c | 2 - arch/arm/mach-omap2/clock.h | 62 ++++++++++++++------------------------------ arch/arm/mach-omap2/sdrc.h | 31 ++++++++++++++++++++++ 3 files changed, 52 insertions(+), 43 deletions(-)
arch/arm/mach-omap2/sdrc.h +31 -0
@@ -46,4 +46,35 @@ return __raw_readl(OMAP_SDRC_REGADDR(reg)); } +/* +* These values represent the number of memory clock cycles between +* autorefresh initiation. They assume 1 refresh per 64 ms (JEDEC), 8192 +* rows per device, and include a subtraction of a 50 cycle window in the +* event that the autorefresh command is delayed due to other SDRC activity. +* The '| 1' sets the ARE field to send one autorefresh when the autorefresh +* counter reaches 0. +* +* These represent optimal values for common parts, it won't work for all. +* As long as you scale down, most parameters are still work, they just +* become sub-optimal. The RFR value goes in the opposite direction. If you +* don't adjust it down as your clock period increases the refresh interval +* will not be met. Setting all parameters for complete worst case may work, +* but may cut memory performance by 2x. Due to errata the DLLs need to be +* unlocked and their value needs run time calibration. A dynamic call is +* need for that as no single right value exists acorss production samples. +* +* Only the FULL speed values are given. Current code is such that rate +* changes must be made at DPLLoutx2. The actual value adjustment for low +* frequency operation will be handled by omap_set_performance() +* +* By having the boot loader boot up in the fastest L4 speed available likely +* will result in something which you can switch between. +*/ +#define SDRC_RFR_CTRL_165MHz (0x00044c00 | 1) +#define SDRC_RFR_CTRL_133MHz (0x0003de00 | 1) +#define SDRC_RFR_CTRL_100MHz (0x0002da01 | 1) +#define SDRC_RFR_CTRL_110MHz (0x0002da01 | 1)/* Need to calc */ +#define SDRC_RFR_CTRL_BYPASS (0x00005000 | 1)/* Need to calc */ + +#endif
arch/arm/mach-omap2/clock.c +1 -1
@@ -623,7 +623,7 @@ tmpset.cm_clksel1_pll |= (mult <<mask_to_shift (dd->div1_mask));/* Worst case */ - tmpset.base_sdrc_rfr =V24XX_SDRC_RFR_CTRL_BYPASS ; + tmpset.base_sdrc_rfr =SDRC_RFR_CTRL_BYPASS ;if (rate == curr_prcm_set->xtal_speed)/* If asking for 1-1 */ bypass =1 ;
arch/arm/mach-omap2/clock.h +20 -42
184 lines not on this page · raw message
Paul Walmsley
maintainerPATCH 2/3 omap2 clock: move 24xx clock definitions from clock.h into clock24xx.h
In reply to Paul WalmsleyIn preparation for OMAP34xx clock definitions, move OMAP24xx-specific struct clks and prcm_config into a new file, 'clock24xx.h'. Also correct several style infelicities that checkpatch complains about.
--- arch/arm/mach-omap2/clock.c | 1 arch/arm/mach-omap2/clock.h | 2613 --------------------------------------- arch/arm/mach-omap2/clock24xx.h | 2640 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 2641 insertions(+), 2613 deletions(-)
arch/arm/mach-omap2/clock.c +1 -0
@@ -35,6 +35,7 @@#include "memory.h" #include "clock.h" +#include "clock24xx.h" #include "prm.h" #include "prm_regbits_24xx.h" #include "cm.h"
arch/arm/mach-omap2/clock.h +0 -2613
2,623 lines not on this page · raw message
arch/arm/mach-omap2/clock24xx.h new file +2640 -0
370 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
Paul Walmsley
maintainerPATCH 3/3 omap2 clock: move 24xx-specific clock code from clock.c into clock24xx.c
In reply to Paul WalmsleyIn preparation for OMAP34xx clock code, move OMAP24xx-specific clock code into a new file, 'clock24xx.c'. The remaining clock.c functions are no longer static. Also fix some style problems with the old code identified by checkpatch.
--- arch/arm/mach-omap2/Makefile | 3 arch/arm/mach-omap2/clock.c | 547 ++-------------------------------------- arch/arm/mach-omap2/clock.h | 48 +-- arch/arm/mach-omap2/clock24xx.c | 521 ++++++++++++++++++++++++++++++++++++++ arch/arm/mach-omap2/clock24xx.h | 13 5 files changed, 598 insertions(+), 534 deletions(-)
arch/arm/mach-omap2/Makefile +3 -0
@@ -11,6 +11,9 @@ # Power Management obj-$(CONFIG_PM) += pm.o sleep.o +# Clock framework +obj-$(CONFIG_ARCH_OMAP2) += clock24xx.o + # DSP obj-$(CONFIG_OMAP_MMU_FWK) += mmu_mach.o obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox_mach.o
arch/arm/mach-omap2/clock.c +34 -513
722 lines not on this page · raw message
arch/arm/mach-omap2/clock24xx.c new file +521 -0
521 lines not on this page · raw message
arch/arm/mach-omap2/clock.h +27 -21
53 lines not on this page · raw message
arch/arm/mach-omap2/clock24xx.h +13 -0
@@ -29,6 +29,19 @@#include "cm_regbits_24xx.h" #include "sdrc.h" +static void omap2_table_mpu_recalc (struct clk *clk); +static int omap2_select_table_rate (struct clk *clk,unsigned long rate); +static long omap2_round_to_table_rate (struct clk *clk,unsigned long rate); +static void omap2_sys_clk_recalc (struct clk *clk); +static void omap2_osc_clk_recalc (struct clk *clk); +static void omap2_sys_clk_recalc (struct clk *clk); +static void omap2_dpll_recalc (struct clk *clk); +static int omap2_clk_fixed_enable (struct clk *clk); +static void omap2_clk_fixed_disable (struct clk *clk); +static int omap2_enable_osc_ck (struct clk *clk); +static void omap2_disable_osc_ck (struct clk *clk); +static int omap2_reprogram_dpll (struct clk *clk,unsigned long rate); +/* Key dividers which make up a PRCM set. Ratio's for a PRCM are mandated. * xtal_speed, dpll_speed, mpu_speed, CM_CLKSEL_MPU,CM_CLKSEL_DSP * CM_CLKSEL_GFX, CM_CLKSEL1_CORE, CM_CLKSEL1_PLL CM_CLKSEL2_PLL, CM_CLKSEL_MDM
Tony Lindgren
maintainerQuoted 10 lines · Paul Walmsley
Hello,
this short patch series separates OMAP24xx clock definitions and code from common clock code and headers. It's in preparation for OMAP3430 clock definitions and code.
All this happens in patches 2 and 3 of this series. The remaining patch 1 moves some SDRC-related defines from
clock.hintosdrc.hwhere they belong.
Quoted 5 lines
The diffstat looks big, but the patches are mostly just cut and paste, with a few minor changes to expose common functions to the linker, and to satisfy checkpatch (at least somewhat).
Review and comments are appreciated, as always.
Pushing this series today.
Tony