ODROID-N2/N2-PLUS: Default freq setting and cpu max_freq limit setting.

board_is_odroidn2 (): Both N2 and N2plus return 'true'

if (is_meson_g12b_cpu() && is_meson_rev_a()) // ODROID-N2
else                                         // ODROID-N2Plus

N2_A53_DEFAULT		1896000	/* N2 Core A53 */
N2_A73_DEFAULT		1800000	/* N2 Core A73 */

N2PLUS_A53_DEFAULT	1908000	/* N2 Plus Core A53 */
N2PLUS_A73_DEFAULT	2208000	/* N2 Plus Core A73 */

Signed-off-by: femto <ckkim@hardkernel.com>
Change-Id: I32fa6b37f54560e9071cf650c74f972b36fc4af2
This commit is contained in:
femto
2019-12-18 14:16:51 +09:00
committed by Luke Go
parent 0108e49943
commit 7f5ff07577
2 changed files with 27 additions and 6 deletions

View File

@@ -227,7 +227,8 @@ static void __init setup_machine_fdt(phys_addr_t dt_phys)
dump_stack_set_arch_desc("%s (DT)", name);
#ifdef CONFIG_ARCH_MESON64_ODROID_COMMON
if (!strcmp(machine_name, "Hardkernel ODROID-N2")) {
if (!strcmp(machine_name, "Hardkernel ODROID-N2") ||
!strcmp(machine_name, "Hardkernel ODROID-N2Plus")) {
system_rev = 0x0400;
__odroid_model = BOARD_ODROIDN2;
__odroid_amlogic_usb3 = true;

View File

@@ -45,6 +45,19 @@
#ifdef CONFIG_ARCH_MESON64_ODROID_COMMON
#include <linux/platform_data/board_odroid.h>
#include <linux/amlogic/cpu_version.h>
#ifdef CONFIG_ARCH_MESON64_ODROIDN2
#define N2_A53_DEFAULT 1896000 /* N2 Core A53 */
#define N2_A73_DEFAULT 1800000 /* N2 Core A73 */
#define N2PLUS_A53_DEFAULT 1908000 /* N2 Plus Core A53 */
#define N2PLUS_A73_DEFAULT 2208000 /* N2 Plus Core A73 */
#endif
#ifdef CONFIG_ARCH_MESON64_ODROIDN2
#define C4_A55_DEFAULT 1800000 /* C4 Core A55 */
#endif
static unsigned long max_freq[2] = {
0,
@@ -587,6 +600,9 @@ static int meson_cpufreq_init(struct cpufreq_policy *policy)
#ifdef CONFIG_ARCH_MESON64_ODROID_COMMON
if (board_is_odroidn2() || board_is_odroidc4()) {
int i = 0;
max_freq[cur_cluster] = min(max_freq[cur_cluster],
(unsigned long)get_table_max(freq_table[cur_cluster]));
for (i = 0; (freq_table[cur_cluster][i].frequency != CPUFREQ_TABLE_END)
&& max_freq[cur_cluster]; i++) {
if (freq_table[cur_cluster][i].frequency > max_freq[cur_cluster]) {
@@ -817,13 +833,17 @@ static int meson_cpufreq_probe(struct platform_device *pdev)
/* Set the maximum cpufreq when kernel parameter is not given with
'max_freq_<a53|a55|a73>' */
if (board_is_odroidn2()) {
if (!max_freq[0])
max_freq[0] = 1896000; /* defalut freq for A53 is 1.896GHz */
if (!max_freq[1])
max_freq[1] = 1800000; /* defalut freq for A73 is 1.800GHz */
if (!max_freq[0]) {
max_freq[0] = (is_meson_g12b_cpu() && is_meson_rev_a())
? N2_A53_DEFAULT : N2PLUS_A53_DEFAULT;
}
if (!max_freq[1]) {
max_freq[1] = (is_meson_g12b_cpu() && is_meson_rev_a())
? N2_A73_DEFAULT : N2PLUS_A73_DEFAULT;
}
} else if (board_is_odroidc4()) {
if (!max_freq[0])
max_freq[0] = 1800000; /* defalut freq for A55 is 1.800GHz */
max_freq[0] = C4_A55_DEFAULT;
}
#endif