18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * opp2430_data.c - old-style "OPP" table for OMAP2430
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (C) 2005-2009 Texas Instruments, Inc.
68c2ecf20Sopenharmony_ci * Copyright (C) 2004-2009 Nokia Corporation
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci * Richard Woodruff <r-woodruff2@ti.com>
98c2ecf20Sopenharmony_ci *
108c2ecf20Sopenharmony_ci * The OMAP2 processor can be run at several discrete 'PRCM configurations'.
118c2ecf20Sopenharmony_ci * These configurations are characterized by voltage and speed for clocks.
128c2ecf20Sopenharmony_ci * The device is only validated for certain combinations. One way to express
138c2ecf20Sopenharmony_ci * these combinations is via the 'ratios' which the clocks operate with
148c2ecf20Sopenharmony_ci * respect to each other. These ratio sets are for a given voltage/DPLL
158c2ecf20Sopenharmony_ci * setting. All configurations can be described by a DPLL setting and a ratio.
168c2ecf20Sopenharmony_ci *
178c2ecf20Sopenharmony_ci * 2430 differs from 2420 in that there are no more phase synchronizers used.
188c2ecf20Sopenharmony_ci * They both have a slightly different clock domain setup. 2420(iva1,dsp) vs
198c2ecf20Sopenharmony_ci * 2430 (iva2.1, NOdsp, mdm)
208c2ecf20Sopenharmony_ci *
218c2ecf20Sopenharmony_ci * XXX Missing voltage data.
228c2ecf20Sopenharmony_ci * XXX Missing 19.2MHz sys_clk rate sets.
238c2ecf20Sopenharmony_ci *
248c2ecf20Sopenharmony_ci * THe format described in this file is deprecated.  Once a reasonable
258c2ecf20Sopenharmony_ci * OPP API exists, the data in this file should be converted to use it.
268c2ecf20Sopenharmony_ci *
278c2ecf20Sopenharmony_ci * This is technically part of the OMAP2xxx clock code.
288c2ecf20Sopenharmony_ci */
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci#include <linux/kernel.h>
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci#include "opp2xxx.h"
338c2ecf20Sopenharmony_ci#include "sdrc.h"
348c2ecf20Sopenharmony_ci#include "clock.h"
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci/*
378c2ecf20Sopenharmony_ci * Key dividers which make up a PRCM set. Ratios for a PRCM are mandated.
388c2ecf20Sopenharmony_ci * xtal_speed, dpll_speed, mpu_speed, CM_CLKSEL_MPU,
398c2ecf20Sopenharmony_ci * CM_CLKSEL_DSP, CM_CLKSEL_GFX, CM_CLKSEL1_CORE, CM_CLKSEL1_PLL,
408c2ecf20Sopenharmony_ci * CM_CLKSEL2_PLL, CM_CLKSEL_MDM
418c2ecf20Sopenharmony_ci *
428c2ecf20Sopenharmony_ci * Filling in table based on 2430-SDPs variants available.  There are
438c2ecf20Sopenharmony_ci * quite a few more rate combinations which could be defined.
448c2ecf20Sopenharmony_ci *
458c2ecf20Sopenharmony_ci * When multiple values are defined the start up will try and choose
468c2ecf20Sopenharmony_ci * the fastest one. If a 'fast' value is defined, then automatically,
478c2ecf20Sopenharmony_ci * the /2 one should be included as it can be used.  Generally having
488c2ecf20Sopenharmony_ci * more than one fast set does not make sense, as static timings need
498c2ecf20Sopenharmony_ci * to be changed to change the set.  The exception is the bypass
508c2ecf20Sopenharmony_ci * setting which is available for low power bypass.
518c2ecf20Sopenharmony_ci *
528c2ecf20Sopenharmony_ci * Note: This table needs to be sorted, fastest to slowest.
538c2ecf20Sopenharmony_ci */
548c2ecf20Sopenharmony_ciconst struct prcm_config omap2430_rate_table[] = {
558c2ecf20Sopenharmony_ci	/* PRCM #4 - ratio2 (ES2.1) - FAST */
568c2ecf20Sopenharmony_ci	{S13M, S798M, S399M, R2_CM_CLKSEL_MPU_VAL,		/* 399MHz ARM */
578c2ecf20Sopenharmony_ci		R2_CM_CLKSEL_DSP_VAL, R2_CM_CLKSEL_GFX_VAL,
588c2ecf20Sopenharmony_ci		R2_CM_CLKSEL1_CORE_VAL, M4_CM_CLKSEL1_PLL_13_VAL,
598c2ecf20Sopenharmony_ci		MX_CLKSEL2_PLL_2x_VAL, R2_CM_CLKSEL_MDM_VAL,
608c2ecf20Sopenharmony_ci		SDRC_RFR_CTRL_133MHz,
618c2ecf20Sopenharmony_ci		RATE_IN_243X},
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_ci	/* PRCM #2 - ratio1 (ES2) - FAST */
648c2ecf20Sopenharmony_ci	{S13M, S658M, S329M, R1_CM_CLKSEL_MPU_VAL,		/* 330MHz ARM */
658c2ecf20Sopenharmony_ci		R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
668c2ecf20Sopenharmony_ci		R1_CM_CLKSEL1_CORE_VAL, M2_CM_CLKSEL1_PLL_13_VAL,
678c2ecf20Sopenharmony_ci		MX_CLKSEL2_PLL_2x_VAL, R1_CM_CLKSEL_MDM_VAL,
688c2ecf20Sopenharmony_ci		SDRC_RFR_CTRL_165MHz,
698c2ecf20Sopenharmony_ci		RATE_IN_243X},
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ci	/* PRCM #5a - ratio1 - FAST */
728c2ecf20Sopenharmony_ci	{S13M, S532M, S266M, R1_CM_CLKSEL_MPU_VAL,		/* 266MHz ARM */
738c2ecf20Sopenharmony_ci		R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
748c2ecf20Sopenharmony_ci		R1_CM_CLKSEL1_CORE_VAL, M5A_CM_CLKSEL1_PLL_13_VAL,
758c2ecf20Sopenharmony_ci		MX_CLKSEL2_PLL_2x_VAL, R1_CM_CLKSEL_MDM_VAL,
768c2ecf20Sopenharmony_ci		SDRC_RFR_CTRL_133MHz,
778c2ecf20Sopenharmony_ci		RATE_IN_243X},
788c2ecf20Sopenharmony_ci
798c2ecf20Sopenharmony_ci	/* PRCM #5b - ratio1 - FAST */
808c2ecf20Sopenharmony_ci	{S13M, S400M, S200M, R1_CM_CLKSEL_MPU_VAL,		/* 200MHz ARM */
818c2ecf20Sopenharmony_ci		R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
828c2ecf20Sopenharmony_ci		R1_CM_CLKSEL1_CORE_VAL, M5B_CM_CLKSEL1_PLL_13_VAL,
838c2ecf20Sopenharmony_ci		MX_CLKSEL2_PLL_2x_VAL, R1_CM_CLKSEL_MDM_VAL,
848c2ecf20Sopenharmony_ci		SDRC_RFR_CTRL_100MHz,
858c2ecf20Sopenharmony_ci		RATE_IN_243X},
868c2ecf20Sopenharmony_ci
878c2ecf20Sopenharmony_ci	/* PRCM #4 - ratio1 (ES2.1) - SLOW */
888c2ecf20Sopenharmony_ci	{S13M, S399M, S199M, R2_CM_CLKSEL_MPU_VAL,		/* 200MHz ARM */
898c2ecf20Sopenharmony_ci		R2_CM_CLKSEL_DSP_VAL, R2_CM_CLKSEL_GFX_VAL,
908c2ecf20Sopenharmony_ci		R2_CM_CLKSEL1_CORE_VAL, M4_CM_CLKSEL1_PLL_13_VAL,
918c2ecf20Sopenharmony_ci		MX_CLKSEL2_PLL_1x_VAL, R2_CM_CLKSEL_MDM_VAL,
928c2ecf20Sopenharmony_ci		SDRC_RFR_CTRL_133MHz,
938c2ecf20Sopenharmony_ci		RATE_IN_243X},
948c2ecf20Sopenharmony_ci
958c2ecf20Sopenharmony_ci	/* PRCM #2 - ratio1 (ES2) - SLOW */
968c2ecf20Sopenharmony_ci	{S13M, S329M, S164M, R1_CM_CLKSEL_MPU_VAL,		/* 165MHz ARM */
978c2ecf20Sopenharmony_ci		R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
988c2ecf20Sopenharmony_ci		R1_CM_CLKSEL1_CORE_VAL, M2_CM_CLKSEL1_PLL_13_VAL,
998c2ecf20Sopenharmony_ci		MX_CLKSEL2_PLL_1x_VAL, R1_CM_CLKSEL_MDM_VAL,
1008c2ecf20Sopenharmony_ci		SDRC_RFR_CTRL_165MHz,
1018c2ecf20Sopenharmony_ci		RATE_IN_243X},
1028c2ecf20Sopenharmony_ci
1038c2ecf20Sopenharmony_ci	/* PRCM #5a - ratio1 - SLOW */
1048c2ecf20Sopenharmony_ci	{S13M, S266M, S133M, R1_CM_CLKSEL_MPU_VAL,		/* 133MHz ARM */
1058c2ecf20Sopenharmony_ci		R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
1068c2ecf20Sopenharmony_ci		R1_CM_CLKSEL1_CORE_VAL, M5A_CM_CLKSEL1_PLL_13_VAL,
1078c2ecf20Sopenharmony_ci		MX_CLKSEL2_PLL_1x_VAL, R1_CM_CLKSEL_MDM_VAL,
1088c2ecf20Sopenharmony_ci		SDRC_RFR_CTRL_133MHz,
1098c2ecf20Sopenharmony_ci		RATE_IN_243X},
1108c2ecf20Sopenharmony_ci
1118c2ecf20Sopenharmony_ci	/* PRCM #5b - ratio1 - SLOW*/
1128c2ecf20Sopenharmony_ci	{S13M, S200M, S100M, R1_CM_CLKSEL_MPU_VAL,		/* 100MHz ARM */
1138c2ecf20Sopenharmony_ci		R1_CM_CLKSEL_DSP_VAL, R1_CM_CLKSEL_GFX_VAL,
1148c2ecf20Sopenharmony_ci		R1_CM_CLKSEL1_CORE_VAL, M5B_CM_CLKSEL1_PLL_13_VAL,
1158c2ecf20Sopenharmony_ci		MX_CLKSEL2_PLL_1x_VAL, R1_CM_CLKSEL_MDM_VAL,
1168c2ecf20Sopenharmony_ci		SDRC_RFR_CTRL_100MHz,
1178c2ecf20Sopenharmony_ci		RATE_IN_243X},
1188c2ecf20Sopenharmony_ci
1198c2ecf20Sopenharmony_ci	/* PRCM-boot/bypass */
1208c2ecf20Sopenharmony_ci	{S13M, S13M, S13M, RB_CM_CLKSEL_MPU_VAL,		/* 13MHz */
1218c2ecf20Sopenharmony_ci		RB_CM_CLKSEL_DSP_VAL, RB_CM_CLKSEL_GFX_VAL,
1228c2ecf20Sopenharmony_ci		RB_CM_CLKSEL1_CORE_VAL, MB_CM_CLKSEL1_PLL_13_VAL,
1238c2ecf20Sopenharmony_ci		MX_CLKSEL2_PLL_2x_VAL, RB_CM_CLKSEL_MDM_VAL,
1248c2ecf20Sopenharmony_ci		SDRC_RFR_CTRL_BYPASS,
1258c2ecf20Sopenharmony_ci		RATE_IN_243X},
1268c2ecf20Sopenharmony_ci
1278c2ecf20Sopenharmony_ci	/* PRCM-boot/bypass */
1288c2ecf20Sopenharmony_ci	{S12M, S12M, S12M, RB_CM_CLKSEL_MPU_VAL,		/* 12MHz */
1298c2ecf20Sopenharmony_ci		RB_CM_CLKSEL_DSP_VAL, RB_CM_CLKSEL_GFX_VAL,
1308c2ecf20Sopenharmony_ci		RB_CM_CLKSEL1_CORE_VAL, MB_CM_CLKSEL1_PLL_12_VAL,
1318c2ecf20Sopenharmony_ci		MX_CLKSEL2_PLL_2x_VAL, RB_CM_CLKSEL_MDM_VAL,
1328c2ecf20Sopenharmony_ci		SDRC_RFR_CTRL_BYPASS,
1338c2ecf20Sopenharmony_ci		RATE_IN_243X},
1348c2ecf20Sopenharmony_ci
1358c2ecf20Sopenharmony_ci	{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
1368c2ecf20Sopenharmony_ci};
137