Currently FreeBSD supports only single PIC controller. Some systems
that have more than one (like ThunderX dual-socket) fails to boot.
Disable other PICes until proper handling is implemented in the
generic interrupt code.
Reviewed by: imp
Obtained from: Semihalf
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3682
sc = device_get_softc(dev);
+ /*
+ * XXX ARM64TODO: Avoid configuration of more than one ITS
+ * device. To be removed when multi-PIC support is added
+ * to FreeBSD (or at least multi-ITS is implemented). Limit
+ * supported ITS sockets to '0' only.
+ */
+ if (device_get_unit(dev) != 0) {
+ device_printf(dev,
+ "Only single instance of ITS is supported, exitting...\n");
+ return (ENXIO);
+ }
+ sc->its_socket = 0;
+
/*
* Initialize sleep & spin mutex for ITS
*/
sc = its_sc;
} else
return (ENXIO);
+
+ /* Skip if running secondary init on a wrong socket */
+ if (sc->its_socket != CPU_CURRENT_SOCKET)
+ return (ENXIO);
}
/*
struct mtx its_mtx;
struct mtx its_spin_mtx;
+
+ uint32_t its_socket; /* Socket number ITS is attached to */
};
/* Stuff that is specific to the vendor's implementation */
void swi_vm(void *v);
#define CPU_AFFINITY(cpu) __cpu_affinity[(cpu)]
+#define CPU_CURRENT_SOCKET \
+ (CPU_AFF2(CPU_AFFINITY(PCPU_GET(cpuid))))
static __inline uint64_t
get_cyclecount(void)