/*
 * Copyright (C) 2012 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef CPU_PERF_INFO_H
#define CPU_PERF_INFO_H

#define CPU_CLUSTER_CNT 3
#define CPU_CLUSTER0_MASK   0xf  /* Little cluster */
#define CPU_CLUSTER1_MASK   0x30 /* Middle cluster */
#define CPU_CLUSTER2_MASK   0xc0 /* Big cluster */

enum epic_scenario_no {
    CPU_CL0_MIN_LOCK    = 100,
    CPU_CL1_MIN_LOCK    = 102,
    CPU_CL2_MIN_LOCK    = 104,
};

#define EPIC_LIBRARY_PATH "/vendor/lib64/libepic_helper.so"

typedef struct perfMap {
    /* cpuIDs means bit map for CPU affinity settings
     * for example, If you want CPU 6,7 then set the value as 0xc0 */
    uint32_t cpuIDs;
    // min_clock
    uint32_t minClock[CPU_CLUSTER_CNT];
    // M2M Capa
    uint32_t m2mCapa;
} perfMap_t;

/* If you need affinity settings for each refresh rates, Write CPU_CLUSTER[x]_MASK definitions
 * for example,
 * - If it's needed to set affinity to Middle and Big clusters, Write "CPU_CLUSTER1_MASK | CPU_CLUSTER2_MASK"
 * - If it's not needed to set affinity, write all MASKs */
static std::map<uint32_t, perfMap> perfTable = {
    {30, {CPU_CLUSTER0_MASK | CPU_CLUSTER1_MASK | CPU_CLUSTER2_MASK, {0, 0, 0}, 24}},
    {60, {CPU_CLUSTER0_MASK | CPU_CLUSTER1_MASK | CPU_CLUSTER2_MASK, {0, 0, 0}, 8}},
    {120, {CPU_CLUSTER0_MASK | CPU_CLUSTER1_MASK | CPU_CLUSTER2_MASK, {0, 0, 0}, 4}},
};

typedef struct cpuProp {
    int32_t cpuMask;
    int32_t minLockId;
} cpuProp_t;

/* Mapping 'CPU cluster mask' and 'EPIC scenario number' */
static std::map<uint32_t, cpuProp> cpuPropTable = {
    {0, {CPU_CLUSTER0_MASK, CPU_CL0_MIN_LOCK}},
    {1, {CPU_CLUSTER1_MASK, CPU_CL1_MIN_LOCK}},
    {2, {CPU_CLUSTER2_MASK, CPU_CL2_MIN_LOCK}},
};

#endif
