Running l4android on cubieboard2

cem akpolat akpolatcem at gmail.com
Mon Jan 12 14:03:07 CET 2015


I digged a bit the l4 code in order to comprehend from where this message
could come. In l4/pkg/bootsrap/server/src/startup.cc the following piece of
the code is written

===============
static void
setup_and_check_kernel_config(Platform_base *plat, l4_kernel_info_t *kip)
{
  const char *s = l4_kip_version_string(kip);
  if (!s)
    return;

  bool is_hyp_kernel = false;
  l4util_kip_for_each_feature(s)
    if (!strcmp(s, "arm:hyp"))
      {
        if (!running_in_hyp_mode())
          {
            printf("  Detected HYP kernel, switching to HYP mode\n");
            plat->arm_switch_to_hyp();
            if (!running_in_hyp_mode())
              panic("\nFailed to switch to HYP as required by
Fiasco.OC.\n");
          }
        is_hyp_kernel = true;
      }

  if (!is_hyp_kernel && running_in_hyp_mode())
    {
      printf("  Non-HYP kernel detected but running in HYP mode, switching
back.\n");
      asm volatile("mcr p15, 0, sp, c13, c0, 2    \n"
                   "msr spsr, %0                  \n"
                   "adr r0, 1f                    \n"
                   ".inst 0xe12ef300              \n"  // msr elr_hyp, r0
                   ".inst 0xe160006e              \n"  // eret
                   "1: mrc p15, 0, sp, c13, c0, 2 \n"
                   : : "r" (0x1d3) : "r0", "memory");
    }
}
========

The arm board that I use (Cortex-A7) should support actually the hyp mode,
since KVM could run on top of that. The system outputs comes to that point,
than the messages stop, in otherwords it suspended here.

Sincerely,
Cem


Cem Akpolat

On Mon, Jan 12, 2015 at 12:12 PM, cem akpolat <akpolatcem at gmail.com> wrote:

> Dear all,
>
> Couple of months ago, I was trying to run l4 on the samsung nexus s, but
> then I decided to switch to Cubieboard2 due to the simple configurations
> and costs stemming from the JTAG/UART interfaces which are quite
> expensive(around 1000 Euro).
> What I did:
>  + the fiasco is compiled for All-sunxi and cubieboard
>  + l4re is compiled for cubieboard2.
>  + the uImage is generated through the following command
>         make uimage -C ~/l4android/src/l4/  E=L4LinuxARM
> O=~l4android/src/build/l4/
>  + boot.scr file for uboot is created in which the compiled kernel image
> is given as kernel as belowe
>
> ------------
> setenv kernel_addr_r 0x46000000 # 8M
> setenv fdt_addr 0x49000000 # 2M
> setenv fdt_high 0xffffffff # Load fdt in place instead of relocating
>
> fatload mmc 0 0x43000000 /script.bin
>
> fatload mmc 0 ${kernel_addr_r} /uImage
> setenv bootargs "console=ttyS0,115200 hdmi.audio=EDID:0
> disp.screen0_output_mode=EDID:1280x1024p60 rw root=/dev/mmcblk0p2 rootwait"
>
> fatload mmc 0 ${fdt_addr} /sun7i-a20-cubieboard2.dtb
>
> bootm ${kernel_addr_r} - ${fdt_addr}
> ---------------------
>
> #End of the setup
>
> # What I am seeing on the console outputs
>
> -------------------
>
> ## Booting kernel from Legacy Image at 46000000 ...
>    Image Name:   L4 Image #32
>    Created:      2015-01-12  10:46:51 UTC
>    Image Type:   ARM Linux Kernel Image (uncompressed)
>    Data Size:    10268672 Bytes = 9.8 MiB
>    Load Address: 41000000
>    Entry Point:  41000000
>    Verifying Checksum ... OK
> ## Flattened Device Tree blob at 49000000
>    Booting using the fdt blob at 0x49000000
>    Loading Kernel Image ... OK
>    Using Device Tree in place at 49000000, end 4900873e
> Using machid 0x10bb from environment
>
> Starting kernel ...
>
>
> L4 Bootstrapper
>   Build: #32 Mo 12. Jan 11:46:50 CET 2015, 4.7.3
>   Scanning up to 1024 MB RAM, starting at offset 32MB
>   Memory size is 1024MB (40000000 - 7fffffff)
>   RAM: 0000000040000000 - 000000007fffffff: 1048576kB
>   Total RAM: 1024MB
>   Scanning fiasco
>   Scanning sigma0
>   Scanning moe
>   Moving up to 14 modules behind 41100000
>   moving module 02 { 41999000-419ca623 } -> { 41a89000-41aba623 } [202276]
>   moving module 01 { 4198f000-4199833b } -> { 41a7f000-41a8833b } [37692]
>   moving module 00 { 4193c000-4198e42b } -> { 41a2c000-41a7e42b } [336940]
>   moving module 13 { 4163c000-4193bfff } -> { 4172c000-41a2bfff } [3145728]
>   moving module 12 { 4128a000-4163b477 } -> { 4137a000-4172b477 } [3871864]
>   moving module 11 { 41289000-412890e4 } -> { 41379000-413790e4 } [229]
>   moving module 10 { 411f1000-41288c43 } -> { 412e1000-41378c43 } [621636]
>   moving module 09 { 411cf000-411f0623 } -> { 412bf000-412e0623 } [136740]
>   moving module 08 { 41080000-411ce453 } -> { 41170000-412be453 } [1369172]
>   moving module 07 { 4107f000-4107f588 } -> { 4116f000-4116f588 } [1417]
>   moving module 06 { 4107e000-4107e03b } -> { 4116e000-4116e03b } [60]
>   moving module 05 { 4107d000-4107d425 } -> { 4116d000-4116d425 } [1062]
>   moving module 04 { 4102a000-4107cc03 } -> { 4111a000-4116cc03 } [338948]
>   moving module 03 { 41010000-41029457 } -> { 41100000-41119457 } [103512]
>   Loading fiasco
>   Loading sigma0
>   Loading moe
>   find kernel info page...
>   found kernel info page at 0x40002000
> Regions of list 'regions'
>     [ 40000000,  400001cf] {      1d0} Root   mbi_rt
>     [ 40001000,  40001bbf] {      bc0} Kern   fiasco
>     [ 40002000,  4005efff] {    5d000} Kern   fiasco
>     [ 40090000,  400968fb] {     68fc} Sigma0 sigma0
>     [ 40098000,  4009e177] {     6178} Sigma0 sigma0
>     [ 40140000,  4016e6a3] {    2e6a4} Root   moe
>     [ 40170000,  40186f13] {    16f14} Root   moe
>     [ 41000000,  4100f5ff] {     f600} Boot   bootstrap
>     [ 41100000,  41a2bfff] {   92c000} Root   Module
>   API Version: (87) experimental
>   Sigma0 config    ip:40090100 sp:00000000
>   Roottask config  ip:40140260 sp:00000000
>   Starting kernel fiasco at 40001388
>   Non-HYP kernel detected but running in HYP mode, switching back.
> ------------------------
>
> What exactly Fiasco tries to tell me with this message "Non-HYP kernel
> detected but running in HYP mode, switching back.".
>
>
> Thanks,
>
> Cem Akpolat
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://os.inf.tu-dresden.de/pipermail/l4-hackers/attachments/20150112/78f1209a/attachment-0001.html>


More information about the l4-hackers mailing list