提交 c5383ad9 编写于 作者: Z Zheng Zengkai

arm64: keep the original function for non-RPi

raspberrypi inclusion
category: feature
bugzilla: 50432

------------------------------

This patch adjusts following arch arm64 related patches for
raspberry pi on non-Raspberry Pi platforms, using specific
config CONFIG_OPENEULER_RASPBERRYPI to distinguish them:

154e93c8 ARM64: Force hardware emulation of deprecated instructions
40cdf60c arch/arm64: Add Revision, Serial, Model to cpuinfo
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 a1598762
...@@ -182,15 +182,15 @@ static void __init register_insn_emulation(struct insn_emulation_ops *ops) ...@@ -182,15 +182,15 @@ static void __init register_insn_emulation(struct insn_emulation_ops *ops)
switch (ops->status) { switch (ops->status) {
case INSN_DEPRECATED: case INSN_DEPRECATED:
#if 0 #ifndef CONFIG_OPENEULER_RASPBERRYPI
insn->current_mode = INSN_EMULATE; insn->current_mode = INSN_EMULATE;
/* Disable the HW mode if it was turned on at early boot time */ /* Disable the HW mode if it was turned on at early boot time */
run_all_cpu_set_hw_mode(insn, false); run_all_cpu_set_hw_mode(insn, false);
#else #else
insn->current_mode = INSN_HW; insn->current_mode = INSN_HW;
run_all_cpu_set_hw_mode(insn, true); run_all_cpu_set_hw_mode(insn, true);
insn->max = INSN_HW;
#endif #endif
insn->max = INSN_HW;
break; break;
case INSN_OBSOLETE: case INSN_OBSOLETE:
insn->current_mode = INSN_UNDEF; insn->current_mode = INSN_UNDEF;
......
...@@ -17,7 +17,9 @@ ...@@ -17,7 +17,9 @@
#include <linux/elf.h> #include <linux/elf.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#ifdef CONFIG_OPENEULER_RASPBERRYPI
#include <linux/of_platform.h> #include <linux/of_platform.h>
#endif
#include <linux/personality.h> #include <linux/personality.h>
#include <linux/preempt.h> #include <linux/preempt.h>
#include <linux/printk.h> #include <linux/printk.h>
...@@ -138,10 +140,12 @@ static int c_show(struct seq_file *m, void *v) ...@@ -138,10 +140,12 @@ static int c_show(struct seq_file *m, void *v)
{ {
int i, j; int i, j;
bool aarch32 = personality(current->personality) == PER_LINUX32; bool aarch32 = personality(current->personality) == PER_LINUX32;
#ifdef CONFIG_OPENEULER_RASPBERRYPI
struct device_node *np; struct device_node *np;
const char *model; const char *model;
const char *serial; const char *serial;
u32 revision; u32 revision;
#endif
for_each_online_cpu(i) { for_each_online_cpu(i) {
struct cpuinfo_arm64 *cpuinfo = &per_cpu(cpu_data, i); struct cpuinfo_arm64 *cpuinfo = &per_cpu(cpu_data, i);
...@@ -202,6 +206,7 @@ static int c_show(struct seq_file *m, void *v) ...@@ -202,6 +206,7 @@ static int c_show(struct seq_file *m, void *v)
seq_printf(m, "CPU revision\t: %d\n\n", MIDR_REVISION(midr)); seq_printf(m, "CPU revision\t: %d\n\n", MIDR_REVISION(midr));
} }
#ifdef CONFIG_OPENEULER_RASPBERRYPI
seq_printf(m, "Hardware\t: BCM2835\n"); seq_printf(m, "Hardware\t: BCM2835\n");
np = of_find_node_by_path("/system"); np = of_find_node_by_path("/system");
...@@ -221,6 +226,7 @@ static int c_show(struct seq_file *m, void *v) ...@@ -221,6 +226,7 @@ static int c_show(struct seq_file *m, void *v)
seq_printf(m, "Model\t\t: %s\n", model); seq_printf(m, "Model\t\t: %s\n", model);
of_node_put(np); of_node_put(np);
} }
#endif
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册