crashes while enabling a minimum cell config on arm cubietruck

43 views
Skip to first unread message

Thorsten Johannvorderbrueggen

unread,
Feb 27, 2015, 11:27:00 AM2/27/15
to jailho...@googlegroups.com
Hi@all,

i try to get jailhouse running on a cubietruck (http://linux-sunxi.org/Cubietech_Cubietruck) ... it's a similiar device like bananapi but with 2g instead of 1g ram ...

As distri i use debian-jessie with a mainline 3.19 kernel ...
I also use latest mainline uboot
-> U-Boot 2015.04-rc2-00067-g38dac81 (Feb 24 2015 - 19:30:59) Allwinner Technology)

and also the latest jailhouse
{
commit 0de30494b8967f8e24d012150ff0afa8fdede7c6
Author: Jan Kiszka <jan.k...@siemens.com>
Date: Sun Feb 22 10:26:06 2015 +0100
}

My bood.cmd is
{
fatload mmc 0 0x46000000 uImage
fatload mmc 0 0x49000000 sun7i-a20-cubietruck.dtb
setenv bootargs console=ttyS0,115200 <earlyprintk> root=/dev/mmcblk0p2 mem=1984M vmalloc=512M rootwait panic=10
bootm 0x46000000 - 0x49000000
}

So far so good :-) ... it builds without problems (native on the device and via cross-gcc) ... and i can load jailhouse without any problems ...

cubietruck:/usr/src/jailhouse# lsmod
Module Size Used by
bnep 11573 2
bluetooth 364663 5 bnep
rfkill 21891 2 bluetooth
jailhouse 11527 0
uio_pdrv_genirq 3582 0
uio 10453 1 uio_pdrv_genirq

But if i enable the cell (cubietruck:/usr/src/jailhouse/configs# jailhouse enable cubietruck.cell) it completely crashes ... no more output ... but on the serial console i get the following output:

nitializing Jailhouse hypervisor v0.1 (328-g0de3049) on CPU 1
Code location: 0xf0000020
Page pool usage after early setup: mem 16/16368, remap 32/32768
Initializing processors:
CPU 1... OK
CPU 0... OK
Page pool usage after late setup: mem 21/16368, remap 32/32768
Unhandled data read at 0x1c6003c(4)
FATAL: unhandled trap (exception class 0x24)
pc=0xc052301c cpsr=0x60000193 esr=0x93800007
r0=0x0000002a r1=0x0000002a r2=0xc09b4780 r3=0xdf850000
r4=0xfc463282 r5=0x0000005c r6=0xe0acf029 r7=0x00000000
r8=0xc09b4780 r9=0xc09a2558 r10=0xc099be40 r11=0xc099bcec
r12=0xc099bcf0 r13=0xc099bcf0 r14=0xc099bcf0
Parking CPU 0 (Cell: "Cubietruck")


I have no idea where the problem is ... i reduced the config to an absolute minimum and checked the values ... but still no idea ...

Here my "calculations":
2048M - 64M = 1984M -> mem=1984M
0x80000000 - 0x4000000 = 0x7c000000 -> hypervisor_memory
The Cubietruck is also a A20 like bananapi so i have taken the same phys_start ... but i'm not shure if it's correct ... when i look at the a20 datasheet i read "DDR-II/DDR-III 0x4000 0000---0xBFFF FFFF 2G" ... but i also assume that the bananapi cell is correct and working ... so i took the them ...


Here's my cubietruck.c:

#include <linux/types.h>
#include <jailhouse/cell-config.h>

#define ARRAY_SIZE(a) sizeof(a) / sizeof(a[0])

struct {
struct jailhouse_system header;
__u64 cpus[1];
struct jailhouse_memory mem_regions[2];
struct jailhouse_irqchip irqchips[1];
} __attribute__((packed)) config = {
.header = {
.hypervisor_memory = {
.phys_start = 0x7c000000,
.size = 0x4000000,
},
.debug_uart = {
.phys_start = 0x01c28000,
.size = 0x1000,
.flags = JAILHOUSE_MEM_IO,
},
.root_cell = {
.name = "Cubietruck",
.cpu_set_size = sizeof(config.cpus),
.num_memory_regions = ARRAY_SIZE(config.mem_regions),
.num_irqchips = 1,
},
},

.cpus = {
0x3,
},

.mem_regions = {
/* RAM */ {
.phys_start = 0x40000000,
.virt_start = 0x40000000,
.size = 0x80000000,
.flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
JAILHOUSE_MEM_EXECUTE,
},
},
.irqchips = {
/* GIC */ {
.address = 0x2f000000,
.pin_bitmap = 0xffffffffffffffff,
},
},
};


Cheers
Thorsten

Jan Kiszka

unread,
Feb 27, 2015, 1:45:15 PM2/27/15
to Thorsten Johannvorderbrueggen, jailho...@googlegroups.com
On 2015-02-27 17:27, Thorsten Johannvorderbrueggen wrote:
> Hi@all,
>
> i try to get jailhouse running on a cubietruck (http://linux-sunxi.org/Cubietech_Cubietruck) ... it's a similiar device like bananapi but with 2g instead of 1g ram ...

Nice!
OK, so here Jailhouse complains that the guest (root cell / Linux in
this case) did an access to the above address, but no memory region
covers it. When we look at your config...
...well, no surprise. You lack a lot of devices that the A20 provides
via MMIO and that Linux likes to use while under Jailhouse control. In
your case, it's the HSTIMER. You can simply copy the corresponding
region from configs/bananapi.c over and adjust the array size. And as
you are at it, I would take the rest as well for now as the SoC is the
same as on the Banana Pi.

If more errors are reported afterwards, you may now have a rough idea
how to open the access to the resources.

Jan

> .irqchips = {
> /* GIC */ {
> .address = 0x2f000000,
> .pin_bitmap = 0xffffffffffffffff,
> },
> },
> };
>
>
> Cheers
> Thorsten
>

--
Siemens AG, Corporate Technology, CT RTC ITP SES-DE
Corporate Competence Center Embedded Linux

Thorsten Johannvorderbrueggen

unread,
Feb 28, 2015, 10:34:00 AM2/28/15
to jailho...@googlegroups.com, myha...@googlemail.com
Hi@Jan,

many thanks for your hint ... i added one after another to the root-cell config ... no i can enable it :-) ... next step is to add some bare-metal examples for gpio, pwm, adc, spi, can (mcp2515) and i2c ... if an gpio example with the leds work, i will prepare a patch for it ... and step by step for the other examples ...

Cheers
Thorsten
Reply all
Reply to author
Forward
0 new messages