Re: [U-Boot] U-boot changes to bringup boot and secondary CPUs in HYP mode

2017-10-27 Thread Lukasz Majewski
Hi Jayadev,

> Hello all,
> 
> I am currently trying to bring up Xen on OMAP5432. When I try to boot
> the board it shows
> 
> 
> 
> 
> 
> 
> 
> 
> *Starting kernel ...- UART enabled -- CPU  booting -- Xen
> must be entered in NS Hyp mode -- Please update the bootloader --
> Boot failed -* After applying the below patch , the boot CPU started
> loading.
> 
> diff --git a/arch/arm/cpu/armv7/omap-common/lowlevel_init.S
> b/arch/arm/cpu/armv7/omap-common/lowlevel_init.S
> index 86c0e42..696da4b 100644
> --- a/arch/arm/cpu/armv7/omap-common/lowlevel_init.S
> +++ b/arch/arm/cpu/armv7/omap-common/lowlevel_init.S
> @@ -19,7 +19,20 @@
>   ENTRY(save_boot_params)
>   ldrr1, =OMAP_SRAM_SCRATCH_BOOT_PARAMS
>   strr0, [r1]
> +/*
> + * Turn on hypervisor mode on CPU#0
> + */
> +#ifdef CONFIG_DRA7XX_HYPERVISOR_ON
> +movr0, lr@ This is a great place to switch into hyp
> mode
> +@ only the r0 was needed from _start and is now
> +@ free; all other general purpose registers were
> +@ already free.
> +ldrr12, =0x102@ Set PL310 control register - value in R0
> +.word0xe1600070@ SMC #0 - hand assembled because
> -march=armv5
> +@ call ROM Code API to set control register
> +#else
>   bxlr
> +#endif /* CONFIG_DRA7XX_HYPERVISOR_ON */
>   ENDPROC(save_boot_params)
>ENTRY(set_pl310_ctrl_reg)
> 
> However now the secondary CPUs fail to load;
> 
> 
> 
> 
> 
> 
> 
> *(XEN) Bringing up CPU1- CPU 0001 booting -- Xen must be entered
> in NS Hyp mode -- Please update the bootloader -- Boot failed -*
> Can someone provide the proper U-boot changes required to load the
> CPUs in HYP mode

Maybe between your patch (at the very beginning of boot up) and the time
XEN wants to re-enable second CPU there is a switch from HYP to SVC mode?

Please keep in mind that u-boot works with single core - and this
single core execution mode is passed to XEN.

> 
> Thanks and Regards
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://lists.denx.de/listinfo/u-boot




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] U-boot changes to bringup boot and secondary CPUs in HYP mode

2017-10-27 Thread Jayadev Kumaran
Hello all,

I am currently trying to bring up Xen on OMAP5432. When I try to boot the
board it shows








*Starting kernel ...- UART enabled -- CPU  booting -- Xen must be
entered in NS Hyp mode -- Please update the bootloader -- Boot failed -*
After applying the below patch , the boot CPU started loading.

diff --git a/arch/arm/cpu/armv7/omap-common/lowlevel_init.S
b/arch/arm/cpu/armv7/omap-common/lowlevel_init.S
index 86c0e42..696da4b 100644
--- a/arch/arm/cpu/armv7/omap-common/lowlevel_init.S
+++ b/arch/arm/cpu/armv7/omap-common/lowlevel_init.S
@@ -19,7 +19,20 @@
  ENTRY(save_boot_params)
  ldrr1, =OMAP_SRAM_SCRATCH_BOOT_PARAMS
  strr0, [r1]
+/*
+ * Turn on hypervisor mode on CPU#0
+ */
+#ifdef CONFIG_DRA7XX_HYPERVISOR_ON
+movr0, lr@ This is a great place to switch into hyp mode
+@ only the r0 was needed from _start and is now
+@ free; all other general purpose registers were
+@ already free.
+ldrr12, =0x102@ Set PL310 control register - value in R0
+.word0xe1600070@ SMC #0 - hand assembled because -march=armv5
+@ call ROM Code API to set control register
+#else
  bxlr
+#endif /* CONFIG_DRA7XX_HYPERVISOR_ON */
  ENDPROC(save_boot_params)
   ENTRY(set_pl310_ctrl_reg)

However now the secondary CPUs fail to load;







*(XEN) Bringing up CPU1- CPU 0001 booting -- Xen must be entered in NS
Hyp mode -- Please update the bootloader -- Boot failed -*
Can someone provide the proper U-boot changes required to load the CPUs in
HYP mode

Thanks and Regards
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot