soc: mediatek: mtk-svs: Add SVS-Thermal coefficient to SoC platform data

In preparation for commonizing the efuse parsing function, add the
SVS-Thermal coefficients for all SoCs for which said function can be
commonized (MT8186, MT8188, MT8192, MT8195) and assign those to their
platform data structure.
That will be used to calculate the MTS parameter with the equation
                     MTS = (ts_coeff * 2) / 1000

This commit brings no functional changes.

Link: https://lore.kernel.org/r/20231121125044.78642-9-angelogioacchino.delregno@collabora.comSigned-off-by: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
parent 7d23d487
...@@ -118,6 +118,10 @@ ...@@ -118,6 +118,10 @@
#define SVSB_VOPS_FLD_VOP2_6 GENMASK(23, 16) #define SVSB_VOPS_FLD_VOP2_6 GENMASK(23, 16)
#define SVSB_VOPS_FLD_VOP3_7 GENMASK(31, 24) #define SVSB_VOPS_FLD_VOP3_7 GENMASK(31, 24)
/* SVS Thermal Coefficients */
#define SVSB_TS_COEFF_MT8195 250460
#define SVSB_TS_COEFF_MT8186 204650
/* svs bank related setting */ /* svs bank related setting */
#define BITS8 8 #define BITS8 8
#define MAX_OPP_ENTRIES 16 #define MAX_OPP_ENTRIES 16
...@@ -374,6 +378,7 @@ struct svs_fusemap { ...@@ -374,6 +378,7 @@ struct svs_fusemap {
* @bank_max: total number of svs banks * @bank_max: total number of svs banks
* @efuse: svs efuse data received from NVMEM framework * @efuse: svs efuse data received from NVMEM framework
* @tefuse: thermal efuse data received from NVMEM framework * @tefuse: thermal efuse data received from NVMEM framework
* @ts_coeff: thermal sensors coefficient
*/ */
struct svs_platform { struct svs_platform {
void __iomem *base; void __iomem *base;
...@@ -388,6 +393,7 @@ struct svs_platform { ...@@ -388,6 +393,7 @@ struct svs_platform {
u32 bank_max; u32 bank_max;
u32 *efuse; u32 *efuse;
u32 *tefuse; u32 *tefuse;
u32 ts_coeff;
}; };
struct svs_platform_data { struct svs_platform_data {
...@@ -398,6 +404,7 @@ struct svs_platform_data { ...@@ -398,6 +404,7 @@ struct svs_platform_data {
const struct svs_fusemap *glb_fuse_map; const struct svs_fusemap *glb_fuse_map;
const u32 *regs; const u32 *regs;
u32 bank_max; u32 bank_max;
u32 ts_coeff;
}; };
/** /**
...@@ -2926,6 +2933,7 @@ static const struct svs_platform_data svs_mt8195_platform_data = { ...@@ -2926,6 +2933,7 @@ static const struct svs_platform_data svs_mt8195_platform_data = {
.probe = svs_mt8192_platform_probe, .probe = svs_mt8192_platform_probe,
.regs = svs_regs_v2, .regs = svs_regs_v2,
.bank_max = ARRAY_SIZE(svs_mt8195_banks), .bank_max = ARRAY_SIZE(svs_mt8195_banks),
.ts_coeff = SVSB_TS_COEFF_MT8195,
.glb_fuse_map = (const struct svs_fusemap[GLB_MAX]) { .glb_fuse_map = (const struct svs_fusemap[GLB_MAX]) {
{ 0, 0 }, { 19, 4 } { 0, 0 }, { 19, 4 }
} }
...@@ -2938,6 +2946,7 @@ static const struct svs_platform_data svs_mt8192_platform_data = { ...@@ -2938,6 +2946,7 @@ static const struct svs_platform_data svs_mt8192_platform_data = {
.probe = svs_mt8192_platform_probe, .probe = svs_mt8192_platform_probe,
.regs = svs_regs_v2, .regs = svs_regs_v2,
.bank_max = ARRAY_SIZE(svs_mt8192_banks), .bank_max = ARRAY_SIZE(svs_mt8192_banks),
.ts_coeff = SVSB_TS_COEFF_MT8195,
.glb_fuse_map = (const struct svs_fusemap[GLB_MAX]) { .glb_fuse_map = (const struct svs_fusemap[GLB_MAX]) {
/* FT_PGM not present */ /* FT_PGM not present */
{ -1, 0 }, { 19, 4 } { -1, 0 }, { 19, 4 }
...@@ -2951,6 +2960,7 @@ static const struct svs_platform_data svs_mt8188_platform_data = { ...@@ -2951,6 +2960,7 @@ static const struct svs_platform_data svs_mt8188_platform_data = {
.probe = svs_mt8192_platform_probe, .probe = svs_mt8192_platform_probe,
.regs = svs_regs_v2, .regs = svs_regs_v2,
.bank_max = ARRAY_SIZE(svs_mt8188_banks), .bank_max = ARRAY_SIZE(svs_mt8188_banks),
.ts_coeff = SVSB_TS_COEFF_MT8195,
.glb_fuse_map = (const struct svs_fusemap[GLB_MAX]) { .glb_fuse_map = (const struct svs_fusemap[GLB_MAX]) {
/* FT_PGM and VMIN not present */ /* FT_PGM and VMIN not present */
{ -1, 0 }, { -1, 0 } { -1, 0 }, { -1, 0 }
...@@ -2964,6 +2974,7 @@ static const struct svs_platform_data svs_mt8186_platform_data = { ...@@ -2964,6 +2974,7 @@ static const struct svs_platform_data svs_mt8186_platform_data = {
.probe = svs_mt8186_platform_probe, .probe = svs_mt8186_platform_probe,
.regs = svs_regs_v2, .regs = svs_regs_v2,
.bank_max = ARRAY_SIZE(svs_mt8186_banks), .bank_max = ARRAY_SIZE(svs_mt8186_banks),
.ts_coeff = SVSB_TS_COEFF_MT8186,
.glb_fuse_map = (const struct svs_fusemap[GLB_MAX]) { .glb_fuse_map = (const struct svs_fusemap[GLB_MAX]) {
/* FT_PGM and VMIN not present */ /* FT_PGM and VMIN not present */
{ -1, 0 }, { -1, 0 } { -1, 0 }, { -1, 0 }
...@@ -3021,6 +3032,7 @@ static int svs_probe(struct platform_device *pdev) ...@@ -3021,6 +3032,7 @@ static int svs_probe(struct platform_device *pdev)
svsp->banks = svsp_data->banks; svsp->banks = svsp_data->banks;
svsp->regs = svsp_data->regs; svsp->regs = svsp_data->regs;
svsp->bank_max = svsp_data->bank_max; svsp->bank_max = svsp_data->bank_max;
svsp->ts_coeff = svsp_data->ts_coeff;
ret = svsp_data->probe(svsp); ret = svsp_data->probe(svsp);
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment