未验证 提交 732e8e41 编写于 作者: A Andreas Schwab 提交者: Palmer Dabbelt

RISC-V: properly determine hardware caps

On the Hifive-U platform, cpu 0 is a masked cpu with less capabilities
than the other cpus.  Ignore it for the purpose of determining the
hardware capabilities of the system.
Signed-off-by: NAndreas Schwab <schwab@suse.de>
Signed-off-by: NPalmer Dabbelt <palmer@sifive.com>
上级 d26c4bbf
...@@ -28,7 +28,7 @@ bool has_fpu __read_mostly; ...@@ -28,7 +28,7 @@ bool has_fpu __read_mostly;
void riscv_fill_hwcap(void) void riscv_fill_hwcap(void)
{ {
struct device_node *node; struct device_node *node = NULL;
const char *isa; const char *isa;
size_t i; size_t i;
static unsigned long isa2hwcap[256] = {0}; static unsigned long isa2hwcap[256] = {0};
...@@ -44,9 +44,11 @@ void riscv_fill_hwcap(void) ...@@ -44,9 +44,11 @@ void riscv_fill_hwcap(void)
/* /*
* We don't support running Linux on hertergenous ISA systems. For * We don't support running Linux on hertergenous ISA systems. For
* now, we just check the ISA of the first processor. * now, we just check the ISA of the first "okay" processor.
*/ */
node = of_find_node_by_type(NULL, "cpu"); while ((node = of_find_node_by_type(node, "cpu")))
if (riscv_of_processor_hartid(node) >= 0)
break;
if (!node) { if (!node) {
pr_warning("Unable to find \"cpu\" devicetree entry"); pr_warning("Unable to find \"cpu\" devicetree entry");
return; return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册