diff --git a/patch/kernel/sun8i-default/0009-sunxi-cpufreq-Add-1296-MHz-operating-point.patch b/patch/kernel/sun8i-default/0009-sunxi-cpufreq-Add-1296-MHz-operating-point.patch.disabled similarity index 100% rename from patch/kernel/sun8i-default/0009-sunxi-cpufreq-Add-1296-MHz-operating-point.patch rename to patch/kernel/sun8i-default/0009-sunxi-cpufreq-Add-1296-MHz-operating-point.patch.disabled diff --git a/patch/kernel/sun8i-default/cpufreq-add-more-frequencies.patch b/patch/kernel/sun8i-default/cpufreq-add-more-frequencies.patch new file mode 100644 index 000000000..f9ab35e3e --- /dev/null +++ b/patch/kernel/sun8i-default/cpufreq-add-more-frequencies.patch @@ -0,0 +1,59 @@ +diff --git a/drivers/cpufreq/sunxi-cpufreq.c b/drivers/cpufreq/sunxi-cpufreq.c +index 13948c7..525befa 100755 +--- a/drivers/cpufreq/sunxi-cpufreq.c ++++ b/drivers/cpufreq/sunxi-cpufreq.c +@@ -72,27 +72,33 @@ int table_length_syscfg = 0; + struct cpufreq_dvfs dvfs_table_syscfg[16]; + + struct cpufreq_frequency_table sunxi_freq_tbl[] = { +- { .frequency = 60000 , .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, +- { .frequency = 120000 , .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, +- { .frequency = 240000 , .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, +- { .frequency = 312000 , .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, +- { .frequency = 408000 , .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, +- { .frequency = 480000 , .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, +- { .frequency = 504000 , .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, +- { .frequency = 600000 , .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, +- { .frequency = 648000 , .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, +- { .frequency = 720000 , .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, +- { .frequency = 816000 , .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, +- { .frequency = 912000 , .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, +- { .frequency = 1008000, .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, +- { .frequency = 1104000, .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, +- { .frequency = 1200000, .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, +- { .frequency = 1344000, .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, +- { .frequency = 1440000, .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, +- { .frequency = 1536000, .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, +- +- /* table end */ +- { .frequency = CPUFREQ_TABLE_END, .index = 0, }, ++ { .frequency = 60000 , .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, ++ { .frequency = 120000 , .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, ++ { .frequency = 240000 , .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, ++ { .frequency = 312000 , .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, ++ { .frequency = 408000 , .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, ++ { .frequency = 480000 , .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, ++ { .frequency = 504000 , .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, ++ { .frequency = 600000 , .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, ++ { .frequency = 648000 , .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, ++ { .frequency = 720000 , .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, ++ { .frequency = 816000 , .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, ++ { .frequency = 864000 , .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, ++ { .frequency = 912000 , .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, ++ { .frequency = 960000 , .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, ++ { .frequency = 1008000, .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, ++ { .frequency = 1056000, .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, ++ { .frequency = 1104000, .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, ++ { .frequency = 1152000, .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, ++ { .frequency = 1200000, .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, ++ { .frequency = 1248000, .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, ++ { .frequency = 1296000, .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, ++ { .frequency = 1344000, .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, ++ { .frequency = 1440000, .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, ++ { .frequency = 1536000, .index = SUNXI_CLK_DIV(0, 0, 0, 0), }, ++ ++ /* table end */ ++ { .frequency = CPUFREQ_TABLE_END, .index = 0, }, + }; + + /* diff --git a/patch/kernel/sun8i-default/sun8i-simple-cpu-corekeeper.patch.disabled b/patch/kernel/sun8i-default/sun8i-simple-cpu-corekeeper.patch.disabled new file mode 100644 index 000000000..2c0e4fbd0 --- /dev/null +++ b/patch/kernel/sun8i-default/sun8i-simple-cpu-corekeeper.patch.disabled @@ -0,0 +1,80 @@ +diff --git a/drivers/thermal/cpu_budget_cooling.c b/drivers/thermal/cpu_budget_cooling.c +index 2a2aad7..45b6bfa 100755 +--- a/drivers/thermal/cpu_budget_cooling.c ++++ b/drivers/thermal/cpu_budget_cooling.c +@@ -124,6 +124,21 @@ static int get_any_online_cpu(const cpumask_t *mask) + } + return lastcpu; + } ++static int get_any_offline_cpu(const cpumask_t *mask) ++{ ++ int cpu,lastcpu=0xffff; ++ ++ for_each_cpu(cpu, mask) { ++ if (cpu_is_offline(cpu)) ++ { ++ if(lastcpu == 0xffff) ++ lastcpu = cpu; ++ else if(cpu >lastcpu) ++ lastcpu = cpu; ++ } ++ } ++ return lastcpu; ++} + static int get_online_cpu(const cpumask_t *mask) + { + int cpu,num =0; +@@ -160,6 +175,7 @@ int cpu_budget_update_state(struct cpu_budget_cooling_device *cpu_budget_device) + unsigned int c0_online=0,c1_online=0; + unsigned int c0_takedown=0,c1_takedown=0; + unsigned int c0_max,c1_max,c0_min,c1_min; ++ unsigned int c0_bringup=0,c1_bringup=0; + #endif + struct cpumask *cluster0_cpus = &cpu_budget_device->cluster0_cpus; + struct cpumask *cluster1_cpus = &cpu_budget_device->cluster1_cpus; +@@ -185,6 +201,14 @@ int cpu_budget_update_state(struct cpu_budget_cooling_device *cpu_budget_device) + c0_max:cpu_budget_device->cluster0_num_floor; + c0_takedown = (c0_online > c0_max)?(c0_online - c0_max):0; + c1_takedown = (c1_online > c1_max)?(c1_online - c1_max):0; ++ /* Depends on /drivers/thermal/sunxi-cpu-budget-cooling.c m_default_budgets_table */ ++#ifdef CONFIG_ARCH_SUN8IW7 ++ if (cpu_budget_device->cpu_budget_state < 2 && (c0_takedown + c1_takedown) == 0) ++ { ++ c0_bringup = (c0_online < c0_max)?(c0_max - c0_online):0; ++ c1_bringup = (c1_online < c1_max)?(c1_max - c1_online):0; ++ } ++#endif + while(c1_takedown) + { + cpuid = get_any_online_cpu(&cpu_budget_device->cluster1_cpus); +@@ -209,6 +233,30 @@ int cpu_budget_update_state(struct cpu_budget_cooling_device *cpu_budget_device) + } + c0_takedown--; + } ++ while(c0_bringup) ++ { ++ cpuid = get_any_offline_cpu(&cpu_budget_device->cluster0_cpus); ++ if (cpuid < nr_cpu_ids) ++ { ++ pr_info("CPU Budget:Try to up cpu %d, cluster0 online %d, limit %d\n",cpuid,c0_online,cpu_budget_device->cluster0_num_limit); ++ ret = work_on_cpu(BOOT_CPU, ++ (long(*)(void *))cpu_up, ++ (void *)cpuid); ++ } ++ c0_bringup--; ++ } ++ while(c1_bringup) ++ { ++ cpuid = get_any_offline_cpu(&cpu_budget_device->cluster1_cpus); ++ if (cpuid < nr_cpu_ids) ++ { ++ pr_info("CPU Budget:Try to up cpu %d, cluster1 online %d, limit %d\n",cpuid,c1_online,cpu_budget_device->cluster1_num_limit); ++ ret = work_on_cpu(BOOT_CPU, ++ (long(*)(void *))cpu_up, ++ (void *)cpuid); ++ } ++ c1_bringup--; ++ } + #endif + #ifdef CONFIG_CPU_FREQ_GOV_AUTO_HOTPLUG_ROOMAGE + autohotplug_update_room(c0_min,c1_min,c0_max,c1_max);