aboutsummaryrefslogtreecommitdiff
path: root/product/rdn1e1/scp_ramfw/config_dvfs.c
blob: b3bccff8a20cb0c1f0c6cc4fdd488b67e7cb9854 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
 * Arm SCP/MCP Software
 * Copyright (c) 2017-2020, Arm Limited and Contributors. All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#include <fwk_element.h>
#include <fwk_macros.h>
#include <fwk_module.h>
#include <fwk_module_idx.h>
#include <mod_dvfs.h>
#include <config_clock.h>

static struct mod_dvfs_opp opps[] = {
        {
            .frequency = 1313 * FWK_MHZ,
            .voltage = 100,
        },
        {
            .frequency = 1531 * FWK_MHZ,
            .voltage = 200,
        },
        {
            .frequency = 1750 * FWK_MHZ,
            .voltage = 300,
        },
        {
            .frequency = 2100 * FWK_MHZ,
            .voltage = 400,
        },
        {
            .frequency = 2600 * FWK_MHZ,
            .voltage = 500,
        },
        { 0 }
};

static const struct mod_dvfs_domain_config cpu_group0 = {
    .psu_id = FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_PSU, 0),
    .clock_id = FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_CLOCK, CLOCK_IDX_CPU_GROUP0),
    .latency = 1200,
    .sustained_idx = 2,
    .opps = opps,
};

static const struct mod_dvfs_domain_config cpu_group1 = {
    .psu_id = FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_PSU, 1),
    .clock_id = FWK_ID_ELEMENT_INIT(FWK_MODULE_IDX_CLOCK, CLOCK_IDX_CPU_GROUP1),
    .latency = 1200,
    .sustained_idx = 2,
    .opps = opps,
};

static const struct fwk_element element_table[] = {
    [0] = {
        .name = "GROUP0",
        .data = &cpu_group0,
    },
    [1] = {
        .name = "GROUP1",
        .data = &cpu_group1,
    },
    { 0 }
};

static const struct fwk_element *dvfs_get_element_table(fwk_id_t module_id)
{
    return element_table;
}

const struct fwk_module_config config_dvfs = {
    .get_element_table = dvfs_get_element_table,
};