hw: cortex a9 diagnostic register initialization

We cannot count on the correct initialization of the diagnostic register
of the secondary cores. But the boot core gets initialized by the bootchain,
so we can copy over those values.

Fix #3639
This commit is contained in:
Stefan Kalkowski 2018-11-01 16:05:06 +01:00 committed by Christian Helmuth
parent 2ce0395fd8
commit 202333c881
2 changed files with 9 additions and 1 deletions

View File

@ -109,13 +109,18 @@ unsigned Bootstrap::Platform::enable_mmu()
static Cpu_counter data_cache_invalidated;
static Cpu_counter data_cache_enabled;
static Cpu_counter smp_coherency_enabled;
static unsigned long diag_reg = 0;
bool primary = primary_cpu;
if (primary) primary_cpu = false;
if (primary) {
primary_cpu = false;
diag_reg = Cpu::Diag::read();
}
Cpu::Sctlr::init();
Cpu::Cpsr::init();
Actlr::disable_smp();
Cpu::Diag::write(diag_reg);
/* locally initialize interrupt controller */
::Board::Pic pic { };

View File

@ -249,6 +249,9 @@ struct Hw::Arm_cpu
/* Physical Count register */
ARM_CP15_REGISTER_64BIT(Cntpct, c14, 0);
/* Diagnostic register */
ARM_CP15_REGISTER_32BIT(Diag, c15, c0, 0, 1);
/******************************
** Program status registers **
******************************/