Skip to content

Commit

Permalink
Adding Silvermont/Bay Trail C-States table
Browse files Browse the repository at this point in the history
  • Loading branch information
cyring committed Dec 6, 2020
1 parent fa87dc1 commit 9966db7
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 5 deletions.
6 changes: 4 additions & 2 deletions corefreqk.c
Original file line number Diff line number Diff line change
Expand Up @@ -15107,7 +15107,7 @@ static enum RUN_LEVEL RunLevel = Alloc_Features_Level;

static void CoreFreqK_ShutDown(void)
{
void (*LevelFunc[])(void) = {
void (*LevelFunc[Running_Level])(void) = {
COREFREQ_RUN(Alloc_Features_Level, Down),
COREFREQ_RUN(Query_Features_Level, Down),
COREFREQ_RUN(Alloc_Device_Level, Down),
Expand All @@ -15133,7 +15133,7 @@ static void CoreFreqK_ShutDown(void)

static int CoreFreqK_StartUp(void)
{
int (*LevelFunc[])(INIT_ARG *pArg) = {
int (*LevelFunc[Running_Level])(INIT_ARG *pArg) = {
COREFREQ_RUN(Alloc_Features_Level, Up),
COREFREQ_RUN(Query_Features_Level, Up),
COREFREQ_RUN(Alloc_Device_Level, Up),
Expand Down Expand Up @@ -15173,6 +15173,8 @@ static int CoreFreqK_StartUp(void)
return (rc);
}

#undef COREFREQ_RUN

static int __init CoreFreqK_Init(void)
{
int rc = CoreFreqK_StartUp();
Expand Down
54 changes: 53 additions & 1 deletion corefreqk.h
Original file line number Diff line number Diff line change
Expand Up @@ -4480,6 +4480,58 @@ static SYSTEM_DRIVER CORE2_Driver = {
.SetTarget = Policy_Core2_SetTarget
};

static IDLE_STATE SLM_IdleState[] = {
{
.Name = "C1",
.Desc = "SLM-C1",
.flags = 0x00 << 24,
.Latency = 1,
.Residency = 1
},
{
.Name = "C2",
.Desc = "SLM-C2",
.flags = 0x01 << 24,
.Latency = 10,
.Residency = 20
},
{
.Name = "C6N",
.Desc = "SLM-C6N",
.flags = (0x10 << 24) | 0x10000,
.Latency = 300,
.Residency = 275
},
{
.Name = "C6S",
.Desc = "SLM-C6S",
.flags = (0x20 << 24) | 0x10000,
.Latency = 500,
.Residency = 560
},
{
.Name = "C7",
.Desc = "SLM-C7",
.flags = (0x20 << 24) | 0x10000,
.Latency = 1200,
.Residency = 4000
},
{
.Name = "C7S",
.Desc = "SLM-C7S",
.flags = (0x20 << 24) | 0x10000,
.Latency = 10000,
.Residency = 20000
},
{NULL}
};

static SYSTEM_DRIVER SLM_Driver = {
.IdleState = SLM_IdleState,
.GetFreq = Policy_GetFreq,
.SetTarget = Policy_Core2_SetTarget
};

/* Source: /drivers/idle/intel_idle.c */
static IDLE_STATE NHM_IdleState[] = {
{
Expand Down Expand Up @@ -5404,7 +5456,7 @@ static ARCH Arch[ARCHITECTURES] = {
.ClockMod = NULL
},
.Specific = Silvermont_Bay_Trail_Specific,
.SystemDriver = &CORE2_Driver,
.SystemDriver = &SLM_Driver,
.Architecture = Arch_Silvermont_Bay_Trail
},
[Atom_Avoton] = { /* 22*/
Expand Down
3 changes: 1 addition & 2 deletions coretypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -1374,8 +1374,7 @@ typedef struct { /* 0: Disable; 1: Enable; 2: Full-control */
CPUfreq : 4-2,
Governor: 6-4,
CS : 8-6,
Route : 10-8,
unused : 16-10;
unused : 16-8;
} KERNEL_DRIVER;

typedef struct {
Expand Down

0 comments on commit 9966db7

Please sign in to comment.