Hi there,

I recently started developing a system on a Sitara am5728 by TI.
This cpu has 2 arm7 A15 cores.

I aim to run Linux on the root cell and RTOS on the inmate cell.

At the moment I'm using an evaluation board from TI.
This board has 1 PCIe slot, on which a realtek ethernet adapter is installed.

When I startup Linux without jailhouse I'm able to modprobe the r8169 driver 
and use the ethernet adapter without any problem.
In my system RTOS has no need to use the PCIe.

The problem:

After I modprobe jailhouse.ko and create the root cell, I attempt to modprobe 
r8169 and I get this:

root@am57xx-evm:~# modprobe jailhouse
root@am57xx-evm:~# jailhouse enable 
/usr/share/jailhouse/examples/am57xx-evm.cell

Initializing Jailhouse hypervisor v0.7 (220-g2ad429b) on CPU 0
Code location: 0xf0000040
Page pool usage after early setup: mem 30/4072, remap 32/131072
Initializing processors:
 CPU 0... OK
 CPU 1... OK
Page pool usage after late setup: mem 40/4072, remap 38/131072
Activating hypervisor
[   55.866355] The Jailhouse is opening.
root@am57xx-evm:~#
root@am57xx-evm:~#
root@am57xx-evm:~# modprobe r8169
Unhandled data read at 0x2000103d(1)
FATAL: unhandled trap (exception class 0x24)
pc=0xc05554b8 cpsr=0x60010093 hsr=0x93010005
r0=0xe108f03d r1=0x00000001 r2=0xd29bfc4c r3=0x00000000
r4=0xd393e628 r5=0xe108f000 r6=0x01000000 r7=0x0000003d
r8=0x00000001 r9=0xd393e610 r10=0x00000000 r11=0xd29bfbec
r12=0xd29bfbf0 r13=0xd29bfbe0 r14=0xc0556254
Parking CPU 0 (Cell: "AM57XX-EVM")

So if I understand correctly, jailhouse forbids Linux from reading address 
0x2000103d and stops core 0.

/proc/iomem and /proc/ioports show that PCI address space is indeed mapped to 
the 0x20000000 region.


root@am57xx-evm:~# dmesg | grep -i pci
...
[    0.762245] OF: PCI: host bridge /ocp/axi@0/pcie@51000000 ranges:
[    0.762280] OF: PCI:    IO 0x20003000..0x20012fff -> 0x00000000
[    0.762306] OF: PCI:   MEM 0x20013000..0x2fffffff -> 0x20013000
...

By looking at am57xx-evm.c I don't see where this address space is handled. I 
tried adding it to .mem_regions but I got a similar result:

root@am57xx-evm:~# modprobe r8169
FATAL: Invalid MMIO read, address: 2000103d, size: 1
FATAL: forbidden access (exception class 0x24)
pc=0xc05554b8 cpsr=0x60010093 hsr=0x93010005
r0=0xe108f03d r1=0x00000001 r2=0xd2a1dc4c r3=0x00000000
r4=0xd393e628 r5=0xe108f000 r6=0x01000000 r7=0x0000003d
r8=0x00000001 r9=0xd393e610 r10=0x00000000 r11=0xd2a1dbec
r12=0xd2a1dbf0 r13=0xd2a1dbe0 r14=0xc0556254
Parking CPU 0 (Cell: "AM57XX-EVM")

This time it says "Invalid MMIO read"

I also tried adding a pci_device but I'm not sure if I've done so correctly.
Anyway, the result was the same.

I'm attaching dmesg, iomem, ioports and the root cell configuration.
Hopefully you can help me configure my system correctly and allow jailhouse and 
PCI play nicely together.

Thanks a lot, 

Nir.

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.
/*
 * Jailhouse, a Linux-based partitioning hypervisor
 *
 * Copyright (c) Texas Insturments. Inc, 2016
 *
 * Authors:
 *  Vitaly Andrianov <[email protected]>
 *
 * This work is licensed under the terms of the GNU GPL, version 2.  See
 * the COPYING file in the top-level directory.
 */

#include <jailhouse/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[17];
	struct jailhouse_irqchip irqchips[2];
} __attribute__((packed)) config = {
	.header = {
		.signature = JAILHOUSE_SYSTEM_SIGNATURE,
		.revision = JAILHOUSE_CONFIG_REVISION,
		.hypervisor_memory = {
			.phys_start = 0xef000000,
			.size = 0x1000000,
		},
		.debug_console = {
			.address = 0x48020000,
			.size = 0x1000,
			/* .divider = 26, */
			.flags = JAILHOUSE_CON1_TYPE_8250 |
				JAILHOUSE_CON1_ACCESS_MMIO |
				JAILHOUSE_CON1_REGDIST_4 |
				JAILHOUSE_CON2_TYPE_ROOTPAGE,
		},
		.platform_info.arm = {
			.gic_version = 2,
			.gicd_base = 0x48211000,
			.gicc_base = 0x48212000,
			.gich_base = 0x48214000,
			.gicv_base = 0x48216000,
			.maintenance_irq = 25,
		},
		.root_cell = {
			.name = "AM57XX-EVM",
			.cpu_set_size = sizeof(config.cpus),
			.num_memory_regions = ARRAY_SIZE(config.mem_regions),
			.num_irqchips = ARRAY_SIZE(config.irqchips),
		},
	},

	.cpus = {
		0x3,
	},

	.mem_regions = {
		/* OCMCRAM */ {
			.phys_start = 0x40300000,
			.virt_start = 0x40300000,
			.size = 0x80000,
			.flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
				JAILHOUSE_MEM_IO,
		},
		/* 0x40380000 - 0x48020000 */ {
			.phys_start = 0x40380000,
			.virt_start = 0x40380000,
			.size = 0x7ca0000,
			.flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
				JAILHOUSE_MEM_IO,
		},
		/* UART... */ {
			.phys_start = 0x48020000,
			.virt_start = 0x48020000,
			.size = 0xe0000,//0x00001000,
			.flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
				JAILHOUSE_MEM_IO,
		},
		/* 0x48100000 - 0x48281000 */ {
			.phys_start = 0x48100000,
			.virt_start = 0x48100000,
			.size = 0x110000,
			.flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
				JAILHOUSE_MEM_IO,
		},
		/*
		 * Leave gap for GIC controller 0x48210000 - 0x41220000
		 */
		/* 0x48220000 - 0x48281000 */ {
			.phys_start = 0x48220000,
			.virt_start = 0x48220000,
			.size = 0x610000,
			.flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
				JAILHOUSE_MEM_IO,
		},
		/* OMAP WakeupGen */ {
			.phys_start = 0x48281000,
			.virt_start = 0x48281000,
			.size = 0x1000,
			.flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
				JAILHOUSE_MEM_IO,
		},
		/* PRCM MPU */ {
			.phys_start = 0x48243000,
			.virt_start = 0x48243000,
			.size = 0x1000,
			.flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
				JAILHOUSE_MEM_IO,
		},
		/* 0x48400000 - 0x48424000 */ {
			.phys_start = 0x48400000,
			.virt_start = 0x48400000,
			.size = 0x24000,
			.flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
				JAILHOUSE_MEM_IO,
		},
		/* UART... */ {
			.phys_start = 0x48424000,
			.virt_start = 0x48424000,
			.size = 0x2000,//0x00001000,
			.flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
				JAILHOUSE_MEM_IO,
		},

		/* 0x48426000 - 0x48826000 */ {
			.phys_start = 0x48426000,
			.virt_start = 0x48426000,
			.size = 0x400000,
			.flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
				JAILHOUSE_MEM_IO,
		},
		/* 0x48826000 - 0x48828000 */ {
			.phys_start = 0x48826000,
			.virt_start = 0x48826000,
			.size = 0x2000,
			.flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
				JAILHOUSE_MEM_IO,
		},
		/* 0x48828000 - 0x4B300000 */ {
			.phys_start = 0x48828000,
			.virt_start = 0x48828000,
			.size = 0x2ad8000,
			.flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
				JAILHOUSE_MEM_IO,
		},

		/* 0x4B500000 - 0x58000000 */ {
			.phys_start = 0x4B500000,
			.virt_start = 0x4B500000,
			.size = 0xCB00000,
			.flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
				JAILHOUSE_MEM_IO,
		},
		/* Display Subsystem & ...*/ {
			.phys_start = 0x58000000,
			.virt_start = 0x58000000,
			.size = 0x8000000,
			.flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
				JAILHOUSE_MEM_IO,
		},
		/* RAM */ {
			.phys_start = 0x80000000,
			.virt_start = 0x80000000,
			.size = 0x6EF00000,
			.flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
				JAILHOUSE_MEM_EXECUTE,
		},
		/* communication region */ {
			.phys_start = 0xEEF00000,
			.virt_start = 0xEEF00000,
			.size = 0x00100000,
			.flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
				JAILHOUSE_MEM_IO,
		},
		/* Leave hole for hypervisor */

		/* RAM */ {
			.phys_start = 0xF0000000,
			.virt_start = 0xF0000000,
			.size = 0x10000000,
			.flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
				JAILHOUSE_MEM_EXECUTE,
		},
	},
	.irqchips = {
		/* GIC */ {
			.address = 0x48211000,
			.pin_base = 32,
			.pin_bitmap = {
				0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff
			},
		},
		/* GIC */ {
			.address = 0x48211000,
			.pin_base = 160,
			.pin_bitmap = {
				0xffffffff, 0, 0, 0
			},
		},
	},

};

Attachment: dmeg
Description: Binary data


root@am57xx-evm:~# cat /proc/ioports
00000000-0000ffff : I/O
  00001000-00001fff : PCI Bus 0000:01
    00001000-000010ff : 0000:01:00.0
        
        
root@am57xx-evm:~# cat /proc/iomem
20013000-2fffffff : MEM
  20100000-201fffff : 0000:00:00.0
  20200000-202fffff : PCI Bus 0000:01
    20200000-20203fff : 0000:01:00.0
    20204000-20204fff : 0000:01:00.0
40300000-4037ffff : 40300000.ocmcram
40800000-40847fff : l2ram
40d01000-40d010ff : /ocp/mmu@40d01000
40d02000-40d020ff : /ocp/mmu@40d02000
40e00000-40e07fff : l1pram
40f00000-40f07fff : l1dram
41000000-41047fff : l2ram
41501000-415010ff : /ocp/mmu@41501000
41502000-415020ff : /ocp/mmu@41502000
41600000-41607fff : l1pram
41700000-41707fff : l1dram
43300000-433fffff : edma3_cc
44000000-44ffffff : /ocp
45000000-45000fff : /ocp
48020000-4802001f : serial
48034000-4803407f : /ocp/timer@48034000
48036000-4803607f : /ocp/timer@48036000
4803e000-4803e07f : /ocp/timer@4803e000
48051000-480511ff : /ocp/gpio@48051000
48053000-480531ff : /ocp/gpio@48053000
48055000-480551ff : /ocp/gpio@48055000
48057000-480571ff : /ocp/gpio@48057000
48059000-480591ff : /ocp/gpio@48059000
4805d000-4805d1ff : /ocp/gpio@4805d000
48070000-480700ff : /ocp/i2c@48070000
48086000-4808607f : /ocp/timer@48086000
48088000-4808807f : /ocp/timer@48088000
48090000-48091fff : /ocp/rng@48090000
4809c000-4809c3ff : /ocp/mmc@4809c000
480a5000-480a509f : /ocp/des@480a5000
480b4000-480b43ff : /ocp/mmc@480b4000
480b8000-480b81ff : /ocp/spi@480b8000
4844a000-4844ad1b : /ocp/padconf@4844a000
48484000-48484fff : /ocp/ethernet@48484000
48485000-484850ff : /ocp/ethernet@48484000/mdio@48485000
48485200-48487fff : /ocp/ethernet@48484000
48820000-4882007f : /ocp/timer@48820000
48822000-4882207f : /ocp/timer@48822000
48824000-4882407f : /ocp/timer@48824000
48828000-4882807f : /ocp/timer@48828000
4882a000-4882a07f : /ocp/timer@4882a000
4882c000-4882c07f : /ocp/timer@4882c000
4882e000-4882e07f : /ocp/timer@4882e000
48838000-488380ff : /ocp/rtc@48838000
48840000-488401ff : /ocp/mailbox@48840000
48842000-488421ff : /ocp/mailbox@48842000
48880000-4888ffff : /ocp/omap_dwc3_1@48880000
48890000-48897fff : /ocp/omap_dwc3_1@48880000/usb@48890000
  48890000-48897fff : /ocp/omap_dwc3_1@48880000/usb@48890000
4889c100-488a6fff : /ocp/omap_dwc3_1@48880000/usb@48890000
488c0000-488cffff : /ocp/omap_dwc3_2@488c0000
488dc100-488e6fff : /ocp/omap_dwc3_2@488c0000/usb@488d0000
48990000-48990113 : vip
48995500-489955d7 : parser0
48995700-48995717 : csc0
48995800-4899587f : sc0
48995a00-48995ad7 : parser1
48995c00-48995c17 : csc1
48995d00-48995d7f : sc1
489d0700-489d077f : sc
489d5700-489d5717 : csc
4a0021e0-4a0021eb : /ocp/bandgap@4a0021e0
4a00232c-4a002337 : /ocp/bandgap@4a0021e0
4a002380-4a0023ab : /ocp/bandgap@4a0021e0
4a0023c0-4a0023fb : /ocp/bandgap@4a0021e0
4a00246c-4a00246f : ldo-address
4a002470-4a002473 : ldo-address
4a002554-4a002557 : gmii-sel
4a002564-4a00256b : /ocp/bandgap@4a0021e0
4a002574-4a0025c3 : /ocp/bandgap@4a0021e0
4a002b78-4a002c73 : /ocp/l4@4a000000/scm@2000/dma-router@b78
4a002c78-4a002cf3 : /ocp/l4@4a000000/scm@2000/dma-router@c78
4a003400-4a003867 : pinctrl-single
4a056000-4a056fff : omap_dma_system.0
  4a056000-4a056fff : /ocp/dma-controller@4a056000
4a080000-4a08001f : /ocp/ocp2scp@4a080000
4a084000-4a0843ff : /ocp/ocp2scp@4a080000/phy@4a084000
4a084c00-4a084c3f : pll_ctrl
4a085000-4a0853ff : /ocp/ocp2scp@4a080000/phy@4a085000
4a090000-4a09001f : /ocp/ocp2scp@4a090000
4a094000-4a09407f : phy_rx
4a094400-4a094463 : phy_tx
4a096800-4a09683f : pll_ctrl
4a140000-4a1410ff : /ocp/sata@4a141100
4ae07ddc-4ae07ddf : setup-address
4ae07de0-4ae07de3 : control-address
4ae07de4-4ae07de7 : setup-address
4ae07de8-4ae07deb : control-address
4ae07e20-4ae07e23 : control-address
4ae07e24-4ae07e27 : control-address
4ae07e30-4ae07e33 : setup-address
4ae07e34-4ae07e37 : setup-address
4ae0c154-4ae0c157 : ldo-address
4ae0c158-4ae0c15b : ldo-address
4ae10000-4ae101ff : /ocp/gpio@4ae10000
4ae14000-4ae1407f : /ocp/wdt@4ae14000
4ae20000-4ae2007f : /ocp/timer@4ae20000
4ae3c000-4ae3dfff : /ocp/can@481cc000
4b101000-4b1012ff : /ocp/sham@53100000
4b300000-4b3000ff : qspi_base
4b500000-4b50009f : /ocp/aes@4b500000
4b700000-4b70009f : /ocp/aes@4b700000
55020000-5502ffff : l2ram
55082000-550820ff : /ocp/mmu@55082000
58000000-5800007f : dss
58001000-58001fff : /ocp/dss@58000000/dispc@58001000
58004054-58004057 : pll1_clkctrl
58004300-5800431f : pll1
58009054-58009057 : pll2_clkctrl
58009300-5800931f : pll2
58040000-580401ff : wp
58040200-5804027f : pll
58040300-5804037f : phy
58060000-58078fff : core
58820000-5882ffff : l2ram
58882000-588820ff : /ocp/mmu@58882000
80000000-9fffffff : System RAM
  80008000-80dfffff : Kernel code
  81000000-810b1643 : Kernel data
ac000000-dfffffff : System RAM
ef000000-efffffff : Jailhouse hypervisor
f0000000-ffcfffff : System RAM
root@am57xx-evm:~#

Reply via email to