18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * OMAP SoC specific OPP Data helpers
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * Copyright (C) 2009-2010 Texas Instruments Incorporated - https://www.ti.com/
58c2ecf20Sopenharmony_ci *	Nishanth Menon
68c2ecf20Sopenharmony_ci *	Kevin Hilman
78c2ecf20Sopenharmony_ci * Copyright (C) 2010 Nokia Corporation.
88c2ecf20Sopenharmony_ci *      Eduardo Valentin
98c2ecf20Sopenharmony_ci *
108c2ecf20Sopenharmony_ci * This program is free software; you can redistribute it and/or modify
118c2ecf20Sopenharmony_ci * it under the terms of the GNU General Public License version 2 as
128c2ecf20Sopenharmony_ci * published by the Free Software Foundation.
138c2ecf20Sopenharmony_ci *
148c2ecf20Sopenharmony_ci * This program is distributed "as is" WITHOUT ANY WARRANTY of any
158c2ecf20Sopenharmony_ci * kind, whether express or implied; without even the implied warranty
168c2ecf20Sopenharmony_ci * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
178c2ecf20Sopenharmony_ci * GNU General Public License for more details.
188c2ecf20Sopenharmony_ci */
198c2ecf20Sopenharmony_ci#ifndef __ARCH_ARM_MACH_OMAP2_OMAP_OPP_DATA_H
208c2ecf20Sopenharmony_ci#define __ARCH_ARM_MACH_OMAP2_OMAP_OPP_DATA_H
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci#include "omap_hwmod.h"
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ci#include "voltage.h"
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci/*
278c2ecf20Sopenharmony_ci * *BIG FAT WARNING*:
288c2ecf20Sopenharmony_ci * USE the following ONLY in opp data initialization common to an SoC.
298c2ecf20Sopenharmony_ci * DO NOT USE these in board files/pm core etc.
308c2ecf20Sopenharmony_ci */
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci/**
338c2ecf20Sopenharmony_ci * struct omap_opp_def - OMAP OPP Definition
348c2ecf20Sopenharmony_ci * @hwmod_name:	Name of the hwmod for this domain
358c2ecf20Sopenharmony_ci * @freq:	Frequency in hertz corresponding to this OPP
368c2ecf20Sopenharmony_ci * @u_volt:	Nominal voltage in microvolts corresponding to this OPP
378c2ecf20Sopenharmony_ci * @default_available:	True/false - is this OPP available by default
388c2ecf20Sopenharmony_ci *
398c2ecf20Sopenharmony_ci * OMAP SOCs have a standard set of tuples consisting of frequency and voltage
408c2ecf20Sopenharmony_ci * pairs that the device will support per voltage domain. This is called
418c2ecf20Sopenharmony_ci * Operating Points or OPP. The actual definitions of OMAP Operating Points
428c2ecf20Sopenharmony_ci * varies over silicon within the same family of devices. For a specific
438c2ecf20Sopenharmony_ci * domain, you can have a set of {frequency, voltage} pairs and this is denoted
448c2ecf20Sopenharmony_ci * by an array of omap_opp_def. As the kernel boots and more information is
458c2ecf20Sopenharmony_ci * available, a set of these are activated based on the precise nature of
468c2ecf20Sopenharmony_ci * device the kernel boots up on. It is interesting to remember that each IP
478c2ecf20Sopenharmony_ci * which belongs to a voltage domain may define their own set of OPPs on top
488c2ecf20Sopenharmony_ci * of this - but this is handled by the appropriate driver.
498c2ecf20Sopenharmony_ci */
508c2ecf20Sopenharmony_cistruct omap_opp_def {
518c2ecf20Sopenharmony_ci	char *hwmod_name;
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci	unsigned long freq;
548c2ecf20Sopenharmony_ci	unsigned long u_volt;
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ci	bool default_available;
578c2ecf20Sopenharmony_ci};
588c2ecf20Sopenharmony_ci
598c2ecf20Sopenharmony_ci/*
608c2ecf20Sopenharmony_ci * Initialization wrapper used to define an OPP for OMAP variants.
618c2ecf20Sopenharmony_ci */
628c2ecf20Sopenharmony_ci#define OPP_INITIALIZER(_hwmod_name, _enabled, _freq, _uv)	\
638c2ecf20Sopenharmony_ci{								\
648c2ecf20Sopenharmony_ci	.hwmod_name	= _hwmod_name,				\
658c2ecf20Sopenharmony_ci	.default_available	= _enabled,			\
668c2ecf20Sopenharmony_ci	.freq		= _freq,				\
678c2ecf20Sopenharmony_ci	.u_volt		= _uv,					\
688c2ecf20Sopenharmony_ci}
698c2ecf20Sopenharmony_ci
708c2ecf20Sopenharmony_ci/*
718c2ecf20Sopenharmony_ci * Initialization wrapper used to define SmartReflex process data
728c2ecf20Sopenharmony_ci * XXX Is this needed?  Just use C99 initializers in data files?
738c2ecf20Sopenharmony_ci */
748c2ecf20Sopenharmony_ci#define VOLT_DATA_DEFINE(_v_nom, _efuse_offs, _errminlimit, _errgain)  \
758c2ecf20Sopenharmony_ci{								       \
768c2ecf20Sopenharmony_ci	.volt_nominal	= _v_nom,				       \
778c2ecf20Sopenharmony_ci	.sr_efuse_offs	= _efuse_offs,				       \
788c2ecf20Sopenharmony_ci	.sr_errminlimit = _errminlimit,				       \
798c2ecf20Sopenharmony_ci	.vp_errgain	= _errgain				       \
808c2ecf20Sopenharmony_ci}
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_ci/* Use this to initialize the default table */
838c2ecf20Sopenharmony_ciextern int __init omap_init_opp_table(struct omap_opp_def *opp_def,
848c2ecf20Sopenharmony_ci		u32 opp_def_size);
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_ci
878c2ecf20Sopenharmony_ciextern struct omap_volt_data omap34xx_vddmpu_volt_data[];
888c2ecf20Sopenharmony_ciextern struct omap_volt_data omap34xx_vddcore_volt_data[];
898c2ecf20Sopenharmony_ciextern struct omap_volt_data omap36xx_vddmpu_volt_data[];
908c2ecf20Sopenharmony_ciextern struct omap_volt_data omap36xx_vddcore_volt_data[];
918c2ecf20Sopenharmony_ci
928c2ecf20Sopenharmony_ciextern struct omap_volt_data omap443x_vdd_mpu_volt_data[];
938c2ecf20Sopenharmony_ciextern struct omap_volt_data omap443x_vdd_iva_volt_data[];
948c2ecf20Sopenharmony_ciextern struct omap_volt_data omap443x_vdd_core_volt_data[];
958c2ecf20Sopenharmony_ciextern struct omap_volt_data omap446x_vdd_mpu_volt_data[];
968c2ecf20Sopenharmony_ciextern struct omap_volt_data omap446x_vdd_iva_volt_data[];
978c2ecf20Sopenharmony_ciextern struct omap_volt_data omap446x_vdd_core_volt_data[];
988c2ecf20Sopenharmony_ci
998c2ecf20Sopenharmony_ci#endif		/* __ARCH_ARM_MACH_OMAP2_OMAP_OPP_DATA_H */
100