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