node with the primary cpu.
Prompted by the polarfire icicle where hart 0 is an mmuless e51 core.
ok drahn@ mlarkin@
-/* $OpenBSD: mainbus.c,v 1.2 2021/05/03 21:25:48 kettenis Exp $ */
+/* $OpenBSD: mainbus.c,v 1.3 2021/05/04 06:32:58 jsg Exp $ */
/*
* Copyright (c) 2016 Patrick Wildt <patrick@blueri.se>
* Copyright (c) 2017 Mark Kettenis <kettenis@openbsd.org>
struct fdt_attach_args *fa = aux;
struct cfdata *cf = match;
- if (fa->fa_nreg < 1)
+ if (fa->fa_nreg < 1 || fa->fa_reg[0].addr != boot_hart)
return 0;
return (*cf->cf_attach->ca_match)(parent, match, aux);
int len;
static uint8_t lladdr[6];
+ len = fdt_node_property(node, "boot-hartid", &prop);
+ if (len == sizeof(boot_hart))
+ boot_hart = bemtoh32((uint32_t *)prop);
+
len = fdt_node_property(node, "bootargs", &prop);
if (len > 0)
collect_kernel_args(prop);