i'm trying to port an old version of XEN hypervisor to the ZedBoard. I'm able to start a DOM0 and the basic services later, but only with one core. I have serious issues starting the second core. Note that at the beggining XEN runs bare metal.
When i'm trying to start the second core, the board either reacts strange either it crashes.
Here what i'm doing:
t// Unlock SLCR with its unlock magic number
tmmio_writel(SLCR_UNLOCK_MAGIC, SLCR_BASE + SLCR_UNLOCK_OFFS);
tdsb();tisb(); // Barriers
t// Snoop protocol - Not necessary i think.
treg = mmio_readl((ZEDBOARD_SCU_BASE) );
treg |= 1;
t// Stop second CPU
treg = mmio_readl(SLCR_BASE + A9_CPU_RST_CTRL);
tmmio_writel(reg | A9_CLKSTOP(1) | A9_RST(1), SLCR_BASE + A9_CPU_RST_CTRL);
// Wrinte at 0xfffffff0 with the entry point 2nd Core.
t// Start the clock for the second core
tmmio_writel(reg & ~A9_CLKSTOP(1) & ~A9_RST(1), SLCR_BASE + A9_CPU_RST_CTRL);
t// Lock SLCR Again
tmmio_writel(SLCR_LOCK_MAGIC, SLCR_BASE + SLCR_LOCK_OFFS);
Latest Xilinx kernel uses almost the same approach, but it uses a trampoline to make the jump. With my approach, core 2 does not executes anything and it crashes after some instruction. If i read the 0xfffffff0 address after writting the new address, XEN will crash almost immediately.
Any thoughts or ideas ?