162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * OMAP SoC specific OPP Data helpers 462306a36Sopenharmony_ci * 562306a36Sopenharmony_ci * Copyright (C) 2009-2010 Texas Instruments Incorporated - https://www.ti.com/ 662306a36Sopenharmony_ci * Nishanth Menon 762306a36Sopenharmony_ci * Kevin Hilman 862306a36Sopenharmony_ci * Copyright (C) 2010 Nokia Corporation. 962306a36Sopenharmony_ci * Eduardo Valentin 1062306a36Sopenharmony_ci */ 1162306a36Sopenharmony_ci#ifndef __ARCH_ARM_MACH_OMAP2_OMAP_OPP_DATA_H 1262306a36Sopenharmony_ci#define __ARCH_ARM_MACH_OMAP2_OMAP_OPP_DATA_H 1362306a36Sopenharmony_ci 1462306a36Sopenharmony_ci#include "omap_hwmod.h" 1562306a36Sopenharmony_ci 1662306a36Sopenharmony_ci#include "voltage.h" 1762306a36Sopenharmony_ci 1862306a36Sopenharmony_ci/* 1962306a36Sopenharmony_ci * *BIG FAT WARNING*: 2062306a36Sopenharmony_ci * USE the following ONLY in opp data initialization common to an SoC. 2162306a36Sopenharmony_ci * DO NOT USE these in board files/pm core etc. 2262306a36Sopenharmony_ci */ 2362306a36Sopenharmony_ci 2462306a36Sopenharmony_ci/** 2562306a36Sopenharmony_ci * struct omap_opp_def - OMAP OPP Definition 2662306a36Sopenharmony_ci * @hwmod_name: Name of the hwmod for this domain 2762306a36Sopenharmony_ci * @freq: Frequency in hertz corresponding to this OPP 2862306a36Sopenharmony_ci * @u_volt: Nominal voltage in microvolts corresponding to this OPP 2962306a36Sopenharmony_ci * @default_available: True/false - is this OPP available by default 3062306a36Sopenharmony_ci * 3162306a36Sopenharmony_ci * OMAP SOCs have a standard set of tuples consisting of frequency and voltage 3262306a36Sopenharmony_ci * pairs that the device will support per voltage domain. This is called 3362306a36Sopenharmony_ci * Operating Points or OPP. The actual definitions of OMAP Operating Points 3462306a36Sopenharmony_ci * varies over silicon within the same family of devices. For a specific 3562306a36Sopenharmony_ci * domain, you can have a set of {frequency, voltage} pairs and this is denoted 3662306a36Sopenharmony_ci * by an array of omap_opp_def. As the kernel boots and more information is 3762306a36Sopenharmony_ci * available, a set of these are activated based on the precise nature of 3862306a36Sopenharmony_ci * device the kernel boots up on. It is interesting to remember that each IP 3962306a36Sopenharmony_ci * which belongs to a voltage domain may define their own set of OPPs on top 4062306a36Sopenharmony_ci * of this - but this is handled by the appropriate driver. 4162306a36Sopenharmony_ci */ 4262306a36Sopenharmony_cistruct omap_opp_def { 4362306a36Sopenharmony_ci char *hwmod_name; 4462306a36Sopenharmony_ci 4562306a36Sopenharmony_ci unsigned long freq; 4662306a36Sopenharmony_ci unsigned long u_volt; 4762306a36Sopenharmony_ci 4862306a36Sopenharmony_ci bool default_available; 4962306a36Sopenharmony_ci}; 5062306a36Sopenharmony_ci 5162306a36Sopenharmony_ci/* 5262306a36Sopenharmony_ci * Initialization wrapper used to define an OPP for OMAP variants. 5362306a36Sopenharmony_ci */ 5462306a36Sopenharmony_ci#define OPP_INITIALIZER(_hwmod_name, _enabled, _freq, _uv) \ 5562306a36Sopenharmony_ci{ \ 5662306a36Sopenharmony_ci .hwmod_name = _hwmod_name, \ 5762306a36Sopenharmony_ci .default_available = _enabled, \ 5862306a36Sopenharmony_ci .freq = _freq, \ 5962306a36Sopenharmony_ci .u_volt = _uv, \ 6062306a36Sopenharmony_ci} 6162306a36Sopenharmony_ci 6262306a36Sopenharmony_ci/* 6362306a36Sopenharmony_ci * Initialization wrapper used to define SmartReflex process data 6462306a36Sopenharmony_ci * XXX Is this needed? Just use C99 initializers in data files? 6562306a36Sopenharmony_ci */ 6662306a36Sopenharmony_ci#define VOLT_DATA_DEFINE(_v_nom, _efuse_offs, _errminlimit, _errgain) \ 6762306a36Sopenharmony_ci{ \ 6862306a36Sopenharmony_ci .volt_nominal = _v_nom, \ 6962306a36Sopenharmony_ci .sr_efuse_offs = _efuse_offs, \ 7062306a36Sopenharmony_ci .sr_errminlimit = _errminlimit, \ 7162306a36Sopenharmony_ci .vp_errgain = _errgain \ 7262306a36Sopenharmony_ci} 7362306a36Sopenharmony_ci 7462306a36Sopenharmony_ciextern struct omap_volt_data omap34xx_vddmpu_volt_data[]; 7562306a36Sopenharmony_ciextern struct omap_volt_data omap34xx_vddcore_volt_data[]; 7662306a36Sopenharmony_ciextern struct omap_volt_data omap36xx_vddmpu_volt_data[]; 7762306a36Sopenharmony_ciextern struct omap_volt_data omap36xx_vddcore_volt_data[]; 7862306a36Sopenharmony_ci 7962306a36Sopenharmony_ciextern struct omap_volt_data omap443x_vdd_mpu_volt_data[]; 8062306a36Sopenharmony_ciextern struct omap_volt_data omap443x_vdd_iva_volt_data[]; 8162306a36Sopenharmony_ciextern struct omap_volt_data omap443x_vdd_core_volt_data[]; 8262306a36Sopenharmony_ciextern struct omap_volt_data omap446x_vdd_mpu_volt_data[]; 8362306a36Sopenharmony_ciextern struct omap_volt_data omap446x_vdd_iva_volt_data[]; 8462306a36Sopenharmony_ciextern struct omap_volt_data omap446x_vdd_core_volt_data[]; 8562306a36Sopenharmony_ci 8662306a36Sopenharmony_ci#endif /* __ARCH_ARM_MACH_OMAP2_OMAP_OPP_DATA_H */ 87