xref: /openbmc/linux/arch/arm/mach-omap2/opp2420_data.c (revision ca6eccb31ef63722b35ea695f75089adeec319d7)
1d8a94458SPaul Walmsley /*
2d8a94458SPaul Walmsley  * opp2420_data.c - old-style "OPP" table for OMAP2420
3d8a94458SPaul Walmsley  *
4d8a94458SPaul Walmsley  * Copyright (C) 2005-2009 Texas Instruments, Inc.
5d8a94458SPaul Walmsley  * Copyright (C) 2004-2009 Nokia Corporation
6d8a94458SPaul Walmsley  *
7d8a94458SPaul Walmsley  * Richard Woodruff <r-woodruff2@ti.com>
8d8a94458SPaul Walmsley  *
9d8a94458SPaul Walmsley  * The OMAP2 processor can be run at several discrete 'PRCM configurations'.
10d8a94458SPaul Walmsley  * These configurations are characterized by voltage and speed for clocks.
11d8a94458SPaul Walmsley  * The device is only validated for certain combinations. One way to express
12*ca6eccb3SPaul Walmsley  * these combinations is via the 'ratios' which the clocks operate with
13d8a94458SPaul Walmsley  * respect to each other. These ratio sets are for a given voltage/DPLL
14*ca6eccb3SPaul Walmsley  * setting. All configurations can be described by a DPLL setting and a ratio.
15d8a94458SPaul Walmsley  *
16d8a94458SPaul Walmsley  * XXX Missing voltage data.
17*ca6eccb3SPaul Walmsley  * XXX Missing 19.2MHz sys_clk rate sets (needed for N800/N810)
18d8a94458SPaul Walmsley  *
19d8a94458SPaul Walmsley  * THe format described in this file is deprecated.  Once a reasonable
20d8a94458SPaul Walmsley  * OPP API exists, the data in this file should be converted to use it.
21d8a94458SPaul Walmsley  *
22d8a94458SPaul Walmsley  * This is technically part of the OMAP2xxx clock code.
23*ca6eccb3SPaul Walmsley  *
24*ca6eccb3SPaul Walmsley  * Considerable work is still needed to fully support dynamic frequency
25*ca6eccb3SPaul Walmsley  * changes on OMAP2xxx-series chips.  Readers interested in such a
26*ca6eccb3SPaul Walmsley  * project are encouraged to review the Maemo Diablo RX-34 and RX-44
27*ca6eccb3SPaul Walmsley  * kernel source at:
28*ca6eccb3SPaul Walmsley  *     http://repository.maemo.org/pool/diablo/free/k/kernel-source-diablo/
29d8a94458SPaul Walmsley  */
30d8a94458SPaul Walmsley 
31d8a94458SPaul Walmsley #include "opp2xxx.h"
32d8a94458SPaul Walmsley #include "sdrc.h"
33d8a94458SPaul Walmsley #include "clock.h"
34d8a94458SPaul Walmsley 
35*ca6eccb3SPaul Walmsley /*
36*ca6eccb3SPaul Walmsley  * Key dividers which make up a PRCM set. Ratios for a PRCM are mandated.
37d8a94458SPaul Walmsley  * xtal_speed, dpll_speed, mpu_speed, CM_CLKSEL_MPU,
38d8a94458SPaul Walmsley  * CM_CLKSEL_DSP, CM_CLKSEL_GFX, CM_CLKSEL1_CORE, CM_CLKSEL1_PLL,
39d8a94458SPaul Walmsley  * CM_CLKSEL2_PLL, CM_CLKSEL_MDM
40d8a94458SPaul Walmsley  *
41*ca6eccb3SPaul Walmsley  * Filling in table based on H4 boards available.  There are quite a
42*ca6eccb3SPaul Walmsley  * few more rate combinations which could be defined.
43d8a94458SPaul Walmsley  *
44*ca6eccb3SPaul Walmsley  * When multiple values are defined the start up will try and choose
45*ca6eccb3SPaul Walmsley  * the fastest one. If a 'fast' value is defined, then automatically,
46*ca6eccb3SPaul Walmsley  * the /2 one should be included as it can be used.  Generally having
47*ca6eccb3SPaul Walmsley  * more than one fast set does not make sense, as static timings need
48*ca6eccb3SPaul Walmsley  * to be changed to change the set.  The exception is the bypass
49*ca6eccb3SPaul Walmsley  * setting which is available for low power bypass.
50d8a94458SPaul Walmsley  *
51d8a94458SPaul Walmsley  * Note: This table needs to be sorted, fastest to slowest.
52*ca6eccb3SPaul Walmsley  **/
53d8a94458SPaul Walmsley const struct prcm_config omap2420_rate_table[] = {
54d8a94458SPaul Walmsley 	/* PRCM I - FAST */
55d8a94458SPaul Walmsley 	{S12M, S660M, S330M, RI_CM_CLKSEL_MPU_VAL,		/* 330MHz ARM */
56d8a94458SPaul Walmsley 		RI_CM_CLKSEL_DSP_VAL, RI_CM_CLKSEL_GFX_VAL,
57d8a94458SPaul Walmsley 		RI_CM_CLKSEL1_CORE_VAL, MI_CM_CLKSEL1_PLL_12_VAL,
58d8a94458SPaul Walmsley 		MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_165MHz,
59d8a94458SPaul Walmsley 		RATE_IN_242X},
60d8a94458SPaul Walmsley 
61d8a94458SPaul Walmsley 	/* PRCM II - FAST */
62d8a94458SPaul Walmsley 	{S12M, S600M, S300M, RII_CM_CLKSEL_MPU_VAL,		/* 300MHz ARM */
63d8a94458SPaul Walmsley 		RII_CM_CLKSEL_DSP_VAL, RII_CM_CLKSEL_GFX_VAL,
64d8a94458SPaul Walmsley 		RII_CM_CLKSEL1_CORE_VAL, MII_CM_CLKSEL1_PLL_12_VAL,
65d8a94458SPaul Walmsley 		MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_100MHz,
66d8a94458SPaul Walmsley 		RATE_IN_242X},
67d8a94458SPaul Walmsley 
68d8a94458SPaul Walmsley 	{S13M, S600M, S300M, RII_CM_CLKSEL_MPU_VAL,		/* 300MHz ARM */
69d8a94458SPaul Walmsley 		RII_CM_CLKSEL_DSP_VAL, RII_CM_CLKSEL_GFX_VAL,
70d8a94458SPaul Walmsley 		RII_CM_CLKSEL1_CORE_VAL, MII_CM_CLKSEL1_PLL_13_VAL,
71d8a94458SPaul Walmsley 		MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_100MHz,
72d8a94458SPaul Walmsley 		RATE_IN_242X},
73d8a94458SPaul Walmsley 
74d8a94458SPaul Walmsley 	/* PRCM III - FAST */
75d8a94458SPaul Walmsley 	{S12M, S532M, S266M, RIII_CM_CLKSEL_MPU_VAL,		/* 266MHz ARM */
76d8a94458SPaul Walmsley 		RIII_CM_CLKSEL_DSP_VAL, RIII_CM_CLKSEL_GFX_VAL,
77d8a94458SPaul Walmsley 		RIII_CM_CLKSEL1_CORE_VAL, MIII_CM_CLKSEL1_PLL_12_VAL,
78d8a94458SPaul Walmsley 		MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_133MHz,
79d8a94458SPaul Walmsley 		RATE_IN_242X},
80d8a94458SPaul Walmsley 
81d8a94458SPaul Walmsley 	{S13M, S532M, S266M, RIII_CM_CLKSEL_MPU_VAL,		/* 266MHz ARM */
82d8a94458SPaul Walmsley 		RIII_CM_CLKSEL_DSP_VAL, RIII_CM_CLKSEL_GFX_VAL,
83d8a94458SPaul Walmsley 		RIII_CM_CLKSEL1_CORE_VAL, MIII_CM_CLKSEL1_PLL_13_VAL,
84d8a94458SPaul Walmsley 		MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_133MHz,
85d8a94458SPaul Walmsley 		RATE_IN_242X},
86d8a94458SPaul Walmsley 
87d8a94458SPaul Walmsley 	/* PRCM II - SLOW */
88d8a94458SPaul Walmsley 	{S12M, S300M, S150M, RII_CM_CLKSEL_MPU_VAL,		/* 150MHz ARM */
89d8a94458SPaul Walmsley 		RII_CM_CLKSEL_DSP_VAL, RII_CM_CLKSEL_GFX_VAL,
90d8a94458SPaul Walmsley 		RII_CM_CLKSEL1_CORE_VAL, MII_CM_CLKSEL1_PLL_12_VAL,
91d8a94458SPaul Walmsley 		MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_100MHz,
92d8a94458SPaul Walmsley 		RATE_IN_242X},
93d8a94458SPaul Walmsley 
94d8a94458SPaul Walmsley 	{S13M, S300M, S150M, RII_CM_CLKSEL_MPU_VAL,		/* 150MHz ARM */
95d8a94458SPaul Walmsley 		RII_CM_CLKSEL_DSP_VAL, RII_CM_CLKSEL_GFX_VAL,
96d8a94458SPaul Walmsley 		RII_CM_CLKSEL1_CORE_VAL, MII_CM_CLKSEL1_PLL_13_VAL,
97d8a94458SPaul Walmsley 		MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_100MHz,
98d8a94458SPaul Walmsley 		RATE_IN_242X},
99d8a94458SPaul Walmsley 
100d8a94458SPaul Walmsley 	/* PRCM III - SLOW */
101d8a94458SPaul Walmsley 	{S12M, S266M, S133M, RIII_CM_CLKSEL_MPU_VAL,		/* 133MHz ARM */
102d8a94458SPaul Walmsley 		RIII_CM_CLKSEL_DSP_VAL, RIII_CM_CLKSEL_GFX_VAL,
103d8a94458SPaul Walmsley 		RIII_CM_CLKSEL1_CORE_VAL, MIII_CM_CLKSEL1_PLL_12_VAL,
104d8a94458SPaul Walmsley 		MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_133MHz,
105d8a94458SPaul Walmsley 		RATE_IN_242X},
106d8a94458SPaul Walmsley 
107d8a94458SPaul Walmsley 	{S13M, S266M, S133M, RIII_CM_CLKSEL_MPU_VAL,		/* 133MHz ARM */
108d8a94458SPaul Walmsley 		RIII_CM_CLKSEL_DSP_VAL, RIII_CM_CLKSEL_GFX_VAL,
109d8a94458SPaul Walmsley 		RIII_CM_CLKSEL1_CORE_VAL, MIII_CM_CLKSEL1_PLL_13_VAL,
110d8a94458SPaul Walmsley 		MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_133MHz,
111d8a94458SPaul Walmsley 		RATE_IN_242X},
112d8a94458SPaul Walmsley 
113d8a94458SPaul Walmsley 	/* PRCM-VII (boot-bypass) */
114d8a94458SPaul Walmsley 	{S12M, S12M, S12M, RVII_CM_CLKSEL_MPU_VAL,		/* 12MHz ARM*/
115d8a94458SPaul Walmsley 		RVII_CM_CLKSEL_DSP_VAL, RVII_CM_CLKSEL_GFX_VAL,
116d8a94458SPaul Walmsley 		RVII_CM_CLKSEL1_CORE_VAL, MVII_CM_CLKSEL1_PLL_12_VAL,
117d8a94458SPaul Walmsley 		MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_BYPASS,
118d8a94458SPaul Walmsley 		RATE_IN_242X},
119d8a94458SPaul Walmsley 
120d8a94458SPaul Walmsley 	/* PRCM-VII (boot-bypass) */
121d8a94458SPaul Walmsley 	{S13M, S13M, S13M, RVII_CM_CLKSEL_MPU_VAL,		/* 13MHz ARM */
122d8a94458SPaul Walmsley 		RVII_CM_CLKSEL_DSP_VAL, RVII_CM_CLKSEL_GFX_VAL,
123d8a94458SPaul Walmsley 		RVII_CM_CLKSEL1_CORE_VAL, MVII_CM_CLKSEL1_PLL_13_VAL,
124d8a94458SPaul Walmsley 		MX_CLKSEL2_PLL_2x_VAL, 0, SDRC_RFR_CTRL_BYPASS,
125d8a94458SPaul Walmsley 		RATE_IN_242X},
126d8a94458SPaul Walmsley 
127d8a94458SPaul Walmsley 	{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
128d8a94458SPaul Walmsley };
129