My YYHD18 (aml8726-m3 SoC identified as a Cortex A9-r2 rev 4 CPU)
hangs randomly during boot if WFI is used by the kernel.
My ATV102 (aml8726-m6 SoC identified as a Cortex A9-r3 rev 0 CPU)
has no problems booting / running FreeBSD using the same kernel
with or without WFI.
WFI is used by the armv7 cpu_sleep function. cpufunc.c contains:
/* 1 == use cpu_sleep(), 0 == don't */ int cpu_do_powersave;
however, it doesn't appear that the value is actually tested anywhere.
This patch adds a test for cpu_do_powersave to the cpu_sleep macro and
updates the Amlogic startup code so that cpu_do_powersave is cleared
when an aml8726-m3 is encountered.