Part Number:AM5728
Tool/software: Linux
Hi,
I'm developing over IDK am5728 with PROCESSOR-SDK-LINUX-AM57X version v05.00 and PROCESSOR-SDK-RTOS-AM57X version v05.00.
I'm using the jailhouse hypervisor and I'm able to run linux on core 0 and on core 1 the jailhouse inmate demo processor_sdk_rtos_am57xx_5_00_00_15/demos/jailhouse-inmate/rtos/icss_emac
Now I'm trying to create inter cell communication. I need the cores to be able to send interrupts to one another.
I'm using the uio-ivshmem module from https://github.com/henning-schild-work/ivshmem-guest-code
To simplify things, first I'm trying to send an interrupt from a baremetal inmate to the root-cell Linux. Later I will try with RTOS inmate.
Once I have that working I will need the RTOS inmate to receive an interrupt from the Linux root cell.
In the dts file some GIC inputs are reserved for the inmate:
/ {
ocp {
pruss1_eth {
status = "disabled";
};
pruss2_eth {
status = "disabled";
};
crossbar_mpu: crossbar@4a002a48 {
ti,irqs-skip = <10 44 127 129 133 134 135 136 137 139 140>;
};
};
};
in the root cell I set
.vpci_irq_base = 100 - 32
and in the inmate cell
.vpci_irq_base = 134 - 32,
pci and uio_ivshmem init seem fine
[ 45.928817] OF: PCI: host bridge /vpci@0 ranges:
[ 45.933482] OF: PCI: MEM 0x30100000..0x30101fff -> 0x30100000
[ 45.939690] pci-host-generic 30000000.vpci: ECAM at [mem 0x30000000-0x300fffff] for [bus 00]
[ 45.948567] pci-host-generic 30000000.vpci: PCI host bridge to bus 0001:00
[ 45.956098] pci_bus 0001:00: root bus resource [bus 00]
[ 45.961539] pci_bus 0001:00: root bus resource [mem 0x30100000-0x30101fff]
[ 45.968480] pci 0001:00:00.0: [1af4:1110] type 00 class 0xff0000
[ 45.968517] pci 0001:00:00.0: reg 0x10: [mem 0x00000000-0x000000ff 64bit]
[ 45.968881] PCI: bus0: Fast back to back transfers disabled
[ 45.974591] pci 0001:00:00.0: BAR 0: assigned [mem 0x30100000-0x301000ff 64bit]
[ 45.982475] virtio-pci 0001:00:00.0: enabling device (0000 -> 0002)
[ 45.988997] uio_ivshmem 0001:00:00.0: using jailhouse mode
[ 45.995644] The Jailhouse is opening.
[ 46.603491] Created Jailhouse cell "AM572X-IDK-ICSS"
root@am57xx-evm:~# lspci -v
0000:00:00.0 PCI bridge: Texas Instruments Multicore DSP+ARM KeyStone II SOC (rev 01) (prog-if 00 [Normal decode])
Flags: bus master, fast devsel, latency 0, IRQ 170
Memory at 20100000 (64-bit, non-prefetchable) [size=1M]
Bus: primary=00, secondary=01, subordinate=ff, sec-latency=0
I/O behind bridge: None
Memory behind bridge: None
Prefetchable memory behind bridge: None
Capabilities: [40] Power Management version 3
Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
Capabilities: [70] Express Root Port (Slot-), MSI 00
Capabilities: [100] Advanced Error Reporting
Kernel driver in use: pcieport
0001:00:00.0 Unassigned class [ff00]: Red Hat, Inc Inter-VM shared memory
Subsystem: Red Hat, Inc Inter-VM shared memory
Flags: bus master, fast devsel, latency 0, IRQ 179
Memory at 30100000 (64-bit, non-prefetchable) [size=256]
Kernel driver in use: uio_ivshmem
Still, I can't generate an interrupt from the inmate to the root cell.
cat /proc/interrupts
...
179: 0 GICv2 100 Edge uio_ivshmem
...
If I understand correctly, I need to write the value 1 to the address 0x3010000c. I'm using gic-demo to do so from the interrupt context.
Whenever the inmate writes to this address I get a dump from the kernel
[ 53.306728] ------------[ cut here ]------------
[ 53.311518] WARNING: CPU: 0 PID: 28 at /home/stx-ti/Projects/tisdk/build/arago-tmp-external-linaro-toolchain/work-shared/am57xx-evm/kernel-source/drivers/bus/omap_l3_noc.c:147 l3_interrupt_handler+0x254/0x370
[ 53.330115] 44000000.ocp:L3 Standard Error: MASTER MPU TARGET PCIE2 (Read): At Address: 0x0010000C : Data Access in User mode during Functional access
[ 53.343649] Modules linked in: jailhouse(O) uio_ivshmem(O) uio can_raw can ecatmc r8169 mc_gp_timer ec_master xhci_plat_hcd xhci_hcd usbcore dwc3 udc_core usb_common ti_prueth pru_rproc pruss pruss_intc snd_soc_omap_hdmi_audio omap_aes_driver omap_sham pruss_soc_bus c_can_platform c_can can_dev omap_wdt ahci_platform libahci_platform libahci libata scsi_mod ti_vpe ti_vip ti_sc ti_csc ti_vpdma dwc3_omap rtc_omap extcon_palmas rtc_palmas gpio_pisosr ov2659 omap_des gpio_tpic2810 v4l2_fwnode des_generic crypto_engine omap_crypto omap_remoteproc virtio_rpmsg_bus rpmsg_core remoteproc sch_fq_codel cryptodev(O)
[ 53.397569] CPU: 0 PID: 28 Comm: irq/23-l3-app-i Tainted: G W O 4.14.40-rt29-gd5443cbd3b #8
[ 53.397572] Hardware name: Generic DRA74X (Flattened Device Tree)
[ 53.397574] Backtrace:
[ 53.397590] [<c020b220>] (dump_backtrace) from [<c020b504>] (show_stack+0x18/0x1c)
[ 53.397597] r7:00000009 r6:60000013 r5:00000000 r4:c105773c
[ 53.397606] [<c020b4ec>] (show_stack) from [<c091609c>] (dump_stack+0x90/0xa4)
[ 53.397615] [<c091600c>] (dump_stack) from [<c022a864>] (__warn+0xec/0x104)
[ 53.397620] r7:00000009 r6:c0bc94c8 r5:00000000 r4:d422fe40
[ 53.397628] [<c022a778>] (__warn) from [<c022a8bc>] (warn_slowpath_fmt+0x40/0x48)
[ 53.397634] r9:00000011 r8:d4206850 r7:c0bc9334 r6:00000002 r5:c0bc93e8 r4:c0bc9498
[ 53.397642] [<c022a880>] (warn_slowpath_fmt) from [<c051a5f0>] (l3_interrupt_handler+0x254/0x370)
[ 53.397645] r3:d42066c0 r2:c0bc9498
[ 53.397647] r4:80080001
[ 53.397654] [<c051a39c>] (l3_interrupt_handler) from [<c027fc64>] (irq_forced_thread_fn+0x28/0x7c)
[ 53.397659] r10:c027fc3c r9:d4206bc0 r8:d41df100 r7:00000001 r6:00000000 r5:d41df100
[ 53.397661] r4:d4206bc0
[ 53.397667] [<c027fc3c>] (irq_forced_thread_fn) from [<c027ffc0>] (irq_thread+0x130/0x208)
[ 53.397671] r7:00000001 r6:00000000 r5:ffffe000 r4:d4206be4
[ 53.397678] [<c027fe90>] (irq_thread) from [<c02481e4>] (kthread+0x164/0x16c)
[ 53.397683] r10:d406bb28 r9:c027fe90 r8:d4206bc0 r7:d422e000 r6:00000000 r5:d4206c00
[ 53.397685] r4:d421e040
[ 53.397693] [<c0248080>] (kthread) from [<c02079a0>] (ret_from_fork+0x14/0x34)
[ 53.397698] r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c0248080
[ 53.397700] r4:d4206c00
[ 53.397706] ---[ end trace 0000000000000004 ]---
and a different interrupt is incremented:
cat /proc/interrupts
...
23: 3 WUGEN 10 Level l3-app-irq
...
Is there anything wrong with the cells configuration?
Is writing to 0x3010000c the right way to trigger the uio_ivshmem interrupt in the Linux side?
Can TI supply a working setup for uio-ivshmem comm between a linux root cell and a rtos inmate as a starting point?
Thanks a lot,
Nir.(Please visit the site to view this file)(Please visit the site to view this file)(Please visit the site to view this file)