On 2017-04-27 17:31, Henning Schild wrote:
> Am Thu, 27 Apr 2017 07:44:56 -0700
> schrieb jonas <jo...@retotech.se>:
> 
>>>> Hi,
>>>> Thanks for the reply.
>>>> So as you said,
>>>> 1)I've augmented the jetson-tk1-demo.c config with an ivshmem
>>>> device and a shared mem region, using to
>>>> configs/jetson-tk1-linux-demo.c as reference.
>>>>
>>>> 2)I replicated the ivshmem-demo from x86 to inmates/demos/arm and
>>>> hooked it up in the Makefile I tried to cross compile the same
>>>> and I have encountered a few errors. From what I've observed, the
>>>> errors are mainly regarding the pci related functions. How can I
>>>> proceed with this? PFA the error log.  
>>>
>>> As Jan said, you will have to move the pci library into the ARM
>>> inmate as well. You will basically need a version of
>>> inmates/lib/x86/pci.c that uses mmio instead of pio. So you will
>>> have to change the two functions pci_(read|write)_config to use
>>> mmio.
>>>
>>> Henning
>>>   
>>
>> Hi,
>>
>> I'm also experimenting with ivshmem between the root-cell and a bare
>> metal cell. In my case, however, on BananaPi M1.
>>
>> Could you elaborate on modifying the functions
>> pci_(read|write)_config to use mmio instead of pio?
>>
>> I guess it's a matter of accessing the appropriate memory mapped PCI
>> configuration space of the (virtual) PCI devices available to the
>> guest/inmate instead of accessing PCI_REG_ADDR_PORT and
>> PCI_REG_DATA_PORT using functions(out|in)[bwl]?
> 
> Exactly mmio = memory mapped IO, pio = port IO (in|out). The outs and
> ins will not work, instead the whole config space will be in physical
> memory. The location can be found in the root-cell configuration
> .pci_mmconfig_base.

And as this base address is different for each board, and we do not have
a device tree parser in our inmate library yet, I would suggest to make
this value an inmate command line parameter for now.

Jan

> Some more information can be found here.
> http://wiki.osdev.org/PCI
> 
> The method currently implemented is called method #1 on that wiki. Make
> sure to keep your access aligned with the size that is requested.
> 
> Code that is similar to what you will need can be found in the
> hypervisor. hypervisor/pci.c include/jailhouse/mmio.h
> 
> Henning
> 
> 
>> Best regards - Jonas Weståker
>>
> 

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

-- 
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 jailhouse-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to