[U-Boot] RFD: ARM: enable HYP mode on OMAP5

Hi folks,
My colleague Clemens Fischer, and I were able to bring up the OMAP5 CPU in HYP mode with the following patch to u-boot.
Obviously the patch is not production grade yet, but we feel that it would be of use to discuss how best to integrate the code into u-boot.
The code wakes up CPU1 before putting CPU0 into HYP mode, and CPU1 goes back to sleep once it has entered HYP mode itself.
With this patch, a near-unmodified mainline linux kernel (patched for ARM KVM only) will boot up with HYP mode enabled.
Many thanks to Marc and Christoffer for their help getting KVM up and running!
Comments are welcome.
-Ian

Make it work on PandaBoard 5 with 5432 ES2 and Linux.
Signed-off-by: Vincent Stehlé v-stehle@ti.com ---
Hi,
Here are some necessary adaptations for OMAP5 ES2, as magic value has changed. In the mean time, we make the secondary cpu routine a bit closer to what romcode does.
Best regards,
V.
arch/arm/lib/bootm.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c index 02852d6..dd8f42e 100644 --- a/arch/arm/lib/bootm.c +++ b/arch/arm/lib/bootm.c @@ -56,16 +56,21 @@ asm ( "ldr r12, =0x102\n" "mov r0, pc\n" "smc 0x1\n" - "ldr r1, =0x48281804\n" // AUX_CORE_BOOT_1 + "ldr r1, =0x48281800\n" /* AUX_CORE_BOOT_0 */ "mov r2, #0\n" - "str r2, [r1]\n" + "str r2, [r1]\n" /* AUX_CORE_BOOT_0 */ + "str r2, [r1, #4]\n" /* AUX_CORE_BOOT_1 */ "isb\n" "dsb\n" + "mov r3, #0xf0\n" "1: wfe\n" - "ldr r2, [r1]\n" - "cmp r2, #0\n" - "movne pc, r2\n" - "b 1b\n" + "ldr r2, [r1]\n" /* AUX_CORE_BOOT_0 */ + "ands r2, r2, r3\n" + "beq 1b\n" + "ldr r2, [r1, #4]\n" /* AUX_CORE_BOOT_1 */ + "cmp r2, #0\n" + "beq 1b\n" + "bx r2\n" ".popsection\n" );
@@ -378,7 +383,7 @@ void hyp_enable(void) { "ldr r1, =0x48281800\n" // AUX_CORE_BOOT_1 "ldr r2, =__hyp_init_sec\n" "str r2, [r1, #4]\n" - "mov r2, #0x200\n" + "mov r2, #0x20\n" "str r2, [r1]\n" // AUX_CORE_BOOT_0 "isb\n" "dmb\n"
participants (2)
-
Ian Molton
-
Vincent Stehlé