Hi,
My lab is using ERIKA3 on a Jetson TX2 with the Jailhouse hypervisor as the controller for one of our robots. We have successfully written SPI and GPIO drivers, as well as implemented a QP solver, and we are impressed with the performance.
Now, I am trying to get shared memory working between Linux and the Erika cell. I was able to get the ivshmem-demo (from the jetson-jailhouse github https://github.com/evidence/linux-jailh ... mem-demo.c) running successfully on Jailhouse, but running the code in Erika only sends interrupts, and cannot receive interrupts.
To attempt to remedy this, I am trying to use the SetISR2Source function from the dynamic API. I am using the dynamic api demo, which runs successfully for an ISR source of "OSEE_GTIMER_IRQ", which seems to be a clock. Replacing this source number with (300+32), the IRQ for the ivshmem demo, does not work. The code compiles and runs fine, but does not receive any interrupts.
I also tried defining the ISR object with SOURCE = "(300+32)" instead of the default "27", and then attaching a handler, but this also does not seem to work.
Do you have any advice for getting the interrupts configured? Or how to get shared memory, particularly in the form of the "ivshmem-demo", working with Linux?
Thanks!
Andrew
Receiving Interrupts on TX2
Moderator: paolo.gai
Re: Receiving Interrupts on TX2
Hello Andrew,
Did you manage to use a shared memory between Linux and the Erika cell ?
I managed to establish a connection between my linux cell and my erika cell but, how can I access to this memory from linux ?
Did you find any example ?
Thank you,
Matthieu
Did you manage to use a shared memory between Linux and the Erika cell ?
I managed to establish a connection between my linux cell and my erika cell but, how can I access to this memory from linux ?
Did you find any example ?
Thank you,
Matthieu
Re: Receiving Interrupts on TX2
Hi all,
ENABLING INTERRUPT
In order to send and receive interrupts through the ivshmem mechanism, both root and inmate cell need a reserved IRQ.
First of all select 2 IRQs (one for root and one for inmate). Then enable them by properly setting .vpci_irq_base's value and enabling .irqchips flag.
Pay attention in IRQ numbering. Often the datasheet refers to number without the 32 base interrupts.
In that case, when setting the ISR in Erika's conf.oil, you must add 32.
ACCESSING MEMORY
You can access shared memory of virtual PCI devices using mmap on /dev/mem or /dev/uio%.
To obtain the latter you should build and "insmod" the driver from
https://github.com/henning-schild-work/ ... /jailhouse.
In order to load this module, the kernel needs to have UIO support enabled.
ENABLING INTERRUPT
In order to send and receive interrupts through the ivshmem mechanism, both root and inmate cell need a reserved IRQ.
First of all select 2 IRQs (one for root and one for inmate). Then enable them by properly setting .vpci_irq_base's value and enabling .irqchips flag.
Pay attention in IRQ numbering. Often the datasheet refers to number without the 32 base interrupts.
In that case, when setting the ISR in Erika's conf.oil, you must add 32.
ACCESSING MEMORY
You can access shared memory of virtual PCI devices using mmap on /dev/mem or /dev/uio%.
To obtain the latter you should build and "insmod" the driver from
https://github.com/henning-schild-work/ ... /jailhouse.
In order to load this module, the kernel needs to have UIO support enabled.
Re: Receiving Interrupts on TX2
Hi l.cuomo,
Thank you for your help,
I couldn't build the uio_ivshmem driver from https://github.com/henning-schild-work/ ... .jailhouse with the current version of my kernel (4.4.38).
which version should I use to be able to build it ?
Thank you,
Matthieu
Thank you for your help,
I couldn't build the uio_ivshmem driver from https://github.com/henning-schild-work/ ... .jailhouse with the current version of my kernel (4.4.38).
which version should I use to be able to build it ?
Thank you,
Matthieu
Re: Receiving Interrupts on TX2
Hi l.cuomo,
Thank you for your help,
I couldn't build the uio_ivshmem driver from https://github.com/henning-schild-work/ ... .jailhouse with the current version of my kernel (4.4.38).
which version should I use to be able to build it ?
Thank you,
Matthieu
Thank you for your help,
I couldn't build the uio_ivshmem driver from https://github.com/henning-schild-work/ ... .jailhouse with the current version of my kernel (4.4.38).
which version should I use to be able to build it ?
Thank you,
Matthieu