intel_adsp: Initialize threadptr register
Initialize threadptr with 0 during the boot before it possibly be used
since the architectural reset state is undefined.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
diff --git a/soc/xtensa/intel_adsp/common/include/cpu_init.h b/soc/xtensa/intel_adsp/common/include/cpu_init.h
index 277f804..571ae29 100644
--- a/soc/xtensa/intel_adsp/common/include/cpu_init.h
+++ b/soc/xtensa/intel_adsp/common/include/cpu_init.h
@@ -58,6 +58,11 @@
__asm__ volatile("rsync");
#endif
+#if XCHAL_HAVE_THREADPTR
+ reg = 0;
+ XTENSA_WUR("THREADPTR", reg);
+#endif
+
/* Likewise enable prefetching. Sadly these values are not
* architecturally defined by Xtensa (they're just documented
* as priority hints), so this constant is just copied from