* Re: PCIE: Program pcie device private registers [not found] <CAHH3p5JzL-9T-Hn=fp1S9=URzycpKTy6toaA0AjQfJYt7mQXsA@mail.gmail.com> @ 2014-02-27 22:57 ` Yinghai Lu 2014-03-04 3:59 ` Pratyush Anand 1 sibling, 0 replies; 5+ messages in thread From: Yinghai Lu @ 2014-02-27 22:57 UTC (permalink / raw) To: shiv prakash Agarwal Cc: linux-pci@vger.kernel.org, Pratyush Anand, Bjorn Helgaas On Thu, Feb 27, 2014 at 1:12 AM, shiv prakash Agarwal <chhotu.shiv@gmail.com> wrote: > Hi All, > > We can program config space registers of a pcie device using setpci but how > can we program private registers of a pcie device? What do you mean private registers? Are those registers in MMIO range that is set through pci BAR? Thanks Yinghai ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: PCIE: Program pcie device private registers [not found] <CAHH3p5JzL-9T-Hn=fp1S9=URzycpKTy6toaA0AjQfJYt7mQXsA@mail.gmail.com> 2014-02-27 22:57 ` PCIE: Program pcie device private registers Yinghai Lu @ 2014-03-04 3:59 ` Pratyush Anand 2014-03-04 17:45 ` Bjorn Helgaas 1 sibling, 1 reply; 5+ messages in thread From: Pratyush Anand @ 2014-03-04 3:59 UTC (permalink / raw) To: shiv prakash Agarwal; +Cc: linux-pci@vger.kernel.org, Bjorn Helgaas, Yinghai Lu On Thu, Feb 27, 2014 at 05:12:38PM +0800, shiv prakash Agarwal wrote: > Hi All, > > > > One query: > > > > We can program config space registers of a pcie device using setpci but > how can we program private registers of a pcie device? You mean application specific registers? These registers will not be accessible through any generic user space program. If you want to access them for debug purposes then you can provide support in your driver. Regards Pratyush > > Can it be done through PCIE interface or something else? > > > > With best, > > Jay ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: PCIE: Program pcie device private registers 2014-03-04 3:59 ` Pratyush Anand @ 2014-03-04 17:45 ` Bjorn Helgaas 2014-03-04 18:10 ` Alex Williamson 0 siblings, 1 reply; 5+ messages in thread From: Bjorn Helgaas @ 2014-03-04 17:45 UTC (permalink / raw) To: Pratyush Anand Cc: shiv prakash Agarwal, linux-pci@vger.kernel.org, Yinghai Lu On Mon, Mar 3, 2014 at 8:59 PM, Pratyush Anand <pratyush.anand@st.com> wrote: > On Thu, Feb 27, 2014 at 05:12:38PM +0800, shiv prakash Agarwal wrote: >> Hi All, >> >> >> >> One query: >> >> >> >> We can program config space registers of a pcie device using setpci but >> how can we program private registers of a pcie device? > > You mean application specific registers? > These registers will not be accessible through any generic user space program. > > If you want to access them for debug purposes then you can provide > support in your driver. If the registers are in config space, you can use setpci, even if they are non-architected registers specific to the device. If they are in MMIO space, you can use lspci to learn where the BARs are mapped, and then use something like rdwrmem (http://cmp.felk.cvut.cz/~pisa/linux/rdwrmem.c) to access the registers. If they are in I/O port space, you can again use lspci to learn where they are mapped, and then use ioperm()/iopl()/inb()/outb()/etc. Bjorn ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: PCIE: Program pcie device private registers 2014-03-04 17:45 ` Bjorn Helgaas @ 2014-03-04 18:10 ` Alex Williamson 0 siblings, 0 replies; 5+ messages in thread From: Alex Williamson @ 2014-03-04 18:10 UTC (permalink / raw) To: Bjorn Helgaas Cc: Pratyush Anand, shiv prakash Agarwal, linux-pci@vger.kernel.org, Yinghai Lu On Tue, 2014-03-04 at 10:45 -0700, Bjorn Helgaas wrote: > On Mon, Mar 3, 2014 at 8:59 PM, Pratyush Anand <pratyush.anand@st.com> wrote: > > On Thu, Feb 27, 2014 at 05:12:38PM +0800, shiv prakash Agarwal wrote: > >> Hi All, > >> > >> > >> > >> One query: > >> > >> > >> > >> We can program config space registers of a pcie device using setpci but > >> how can we program private registers of a pcie device? > > > > You mean application specific registers? > > These registers will not be accessible through any generic user space program. > > > > If you want to access them for debug purposes then you can provide > > support in your driver. > > If the registers are in config space, you can use setpci, even if they > are non-architected registers specific to the device. > > If they are in MMIO space, you can use lspci to learn where the BARs > are mapped, and then use something like rdwrmem > (http://cmp.felk.cvut.cz/~pisa/linux/rdwrmem.c) to access the > registers. > > If they are in I/O port space, you can again use lspci to learn where > they are mapped, and then use ioperm()/iopl()/inb()/outb()/etc. The pci-sysfs resource# files are probably an easier alternative. MMIO regions can be mmap'd and I/O port regions support direct read/write. Thanks, Alex ^ permalink raw reply [flat|nested] 5+ messages in thread
* PCIE: Program pcie device private registers @ 2014-02-27 9:13 shiv prakash Agarwal 0 siblings, 0 replies; 5+ messages in thread From: shiv prakash Agarwal @ 2014-02-27 9:13 UTC (permalink / raw) To: linux-pci@vger.kernel.org Hi All, One query: We can program config space registers of a pcie device using setpci but how can we program private registers of a pcie device? Can it be done through PCIE interface or something else? ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-03-04 18:10 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CAHH3p5JzL-9T-Hn=fp1S9=URzycpKTy6toaA0AjQfJYt7mQXsA@mail.gmail.com>
2014-02-27 22:57 ` PCIE: Program pcie device private registers Yinghai Lu
2014-03-04 3:59 ` Pratyush Anand
2014-03-04 17:45 ` Bjorn Helgaas
2014-03-04 18:10 ` Alex Williamson
2014-02-27 9:13 shiv prakash Agarwal
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).