Hello, I have physical address of GPIO port, I want to map that physical address to domU and make domU to access those ports. These GPIO ports can be accessed through I/O port as well. What is the best way to achieve this other than shared driver model. Since these GPIO ports are on-chip I can''t even make them as pass through. So what is the possible solution? What I tried was that ioremap on physical port in dom0 and tried to share it using grant table entry, where as *virt_to_mfn* is returning * INVALID_P2M_ENTRY*, hence mapping on domU is faling. Let me know suggestions and solutions. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Hello, I have physical address of GPIO port, I want to map that physical address to domU and make domU to access those ports. These GPIO ports can be accessed through I/O port as well. What is the best way to achieve this other than shared driver model. Since these GPIO ports are on-chip I can''t even make them as pass through. So what is the possible solution? What I tried was that ioremap on physical port in dom0 and tried to share it using grant table entry, where as *virt_to_mfn* is returning * INVALID_P2M_ENTRY*, hence mapping on domU is faling. Let me know suggestions and solutions. _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
On Tue, 2013-04-23 at 12:30 +0100, Srinivas Ch wrote:> Hello, > > > I have physical address of GPIO port, I want to map that > physical address to domU and make domU to access those ports. These > GPIO ports can be accessed through I/O port as well. What is the best > way to achieve this other than shared driver model. Since these GPIO > ports are on-chip I can''t even make them as pass through. So what is > the possible solution?It''s not clear to me if you are talking about MMIO registers or X86 I/O address space ports. With xl you can use "ioports = [...]" and "iomem = [...]" in your domain configuration. IIRC xend only supported ioports. iomem only works at the page granularity though, so if you use that you will be exposing the entire page containing the ports, which may be a problem depending on what shares that page. If you can use the I/O address space to access these registers that would probably be preferable for that reason. Ian.
Hi Ian, Thank you. Yeah I am talking about MMIO registers & x86 I/O ports. I am new to xen, can you tell me bit clearly or if there is any document link which explain more about iomem and ioport configurations. Basically MMIO GPIO port is accessible at physical address 0xfed80000. I want to map this address directly to domU, I am okay even page exposes other registers as of now. Thanks in advance. On Tue, Apr 23, 2013 at 5:25 PM, Ian Campbell <Ian.Campbell@citrix.com>wrote:> On Tue, 2013-04-23 at 12:30 +0100, Srinivas Ch wrote: > > Hello, > > > > > > I have physical address of GPIO port, I want to map that > > physical address to domU and make domU to access those ports. These > > GPIO ports can be accessed through I/O port as well. What is the best > > way to achieve this other than shared driver model. Since these GPIO > > ports are on-chip I can''t even make them as pass through. So what is > > the possible solution? > > It''s not clear to me if you are talking about MMIO registers or X86 I/O > address space ports. > > With xl you can use "ioports = [...]" and "iomem = [...]" in your domain > configuration. IIRC xend only supported ioports. > > iomem only works at the page granularity though, so if you use that you > will be exposing the entire page containing the ports, which may be a > problem depending on what shares that page. If you can use the I/O > address space to access these registers that would probably be > preferable for that reason. > > > Ian. > >_______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
On Tue, 2013-04-23 at 15:03 +0100, Srinivas Ch wrote:> Hi Ian, > > > Thank you. Yeah I am talking about MMIO registers & x86 I/O > ports.MMIO registers & x86 I/O ports are two separate things. It sounds like you are doing MMIO.> I am new to xen, can you tell me bit clearly or if there is any > document link which explain more about iomem and ioport > configurations.xl comes with manpages which describe these options and you can find them either in tree or linked from the wiki.> Basically MMIO GPIO port is accessible at physical address > 0xfed80000. I want to map this address directly to domU, I am okay > even page exposes other registers as of now.Then I think the iomem option should do what you need. Ian.
Hi Ian, Thank you very much. The GPIO ports I am referring they belong to dual address space; one is IO address and the other is memory address space. That is why I am asking for both options. I will try both options whichever works first for me will use that approach. On Tue, Apr 23, 2013 at 8:41 PM, Ian Campbell <Ian.Campbell@citrix.com>wrote:> On Tue, 2013-04-23 at 15:03 +0100, Srinivas Ch wrote: > > Hi Ian, > > > > > > Thank you. Yeah I am talking about MMIO registers & x86 I/O > > ports. > > MMIO registers & x86 I/O ports are two separate things. It sounds like > you are doing MMIO. > > > I am new to xen, can you tell me bit clearly or if there is any > > document link which explain more about iomem and ioport > > configurations. > > xl comes with manpages which describe these options and you can find > them either in tree or linked from the wiki. > > > Basically MMIO GPIO port is accessible at physical address > > 0xfed80000. I want to map this address directly to domU, I am okay > > even page exposes other registers as of now. > > Then I think the iomem option should do what you need. > > Ian. > > > >_______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
Hi Ian, I tried the approach you suggested but I was not able to read the correct values in guest, here is the configuration used *name = "elf"* *uuid = "67a7ee66-3de2-aaf4-08f9-4e2e1c9ef934"* *maxmem = 512* *memory = 512* *ioports**= ["cd6-cd7"]* *vcpus = 1* *builder = "hvm"* *boot = "c"* *pae = 1* *acpi = 1* *apic = 1* *hap = 0* *viridian = 0* *localtime = 0* *hpet = 0* *on_poweroff = "destroy"* *on_reboot = "restart"* *on_crash = "restart"* *sdl = 0* *vnclisten="0.0.0.0:5900"* *vnc = 1* *vncunused = 1* *keymap = "en-us"* *disk = [ "file:/home/lab/workspace/xen_demo/src/demo_threadx/img/elf.img,hda,w" ]* *parallel = "none"* *serial = "pty"* *soundhw = "es1370"* * * Is this the correct way to create guest to have host ioports on guest? When I run *inb *on *0xcd6 *in guest I see value *0xff, *which is invalid, on guest I am able to read it as 0x2d*. * Let me know if I have to make any changes on host side. Thanks in advance. On Wed, Apr 24, 2013 at 11:07 AM, Srinivas Ch <jobseeker.naukri@gmail.com>wrote:> Hi Ian, > > Thank you very much. The GPIO ports I am referring they belong to > dual address space; one is IO address and the other is memory address > space. That is why I am asking for both options. I will try both options > whichever works first for me will use that approach. > > > On Tue, Apr 23, 2013 at 8:41 PM, Ian Campbell <Ian.Campbell@citrix.com>wrote: > >> On Tue, 2013-04-23 at 15:03 +0100, Srinivas Ch wrote: >> > Hi Ian, >> > >> > >> > Thank you. Yeah I am talking about MMIO registers & x86 I/O >> > ports. >> >> MMIO registers & x86 I/O ports are two separate things. It sounds like >> you are doing MMIO. >> >> > I am new to xen, can you tell me bit clearly or if there is any >> > document link which explain more about iomem and ioport >> > configurations. >> >> xl comes with manpages which describe these options and you can find >> them either in tree or linked from the wiki. >> >> > Basically MMIO GPIO port is accessible at physical address >> > 0xfed80000. I want to map this address directly to domU, I am okay >> > even page exposes other registers as of now. >> >> Then I think the iomem option should do what you need. >> >> Ian. >> >> >> >> >_______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users