Fedora Linux Support Community & Resources Center
  #1  
Old 8th February 2011, 06:24 PM
yhuyhu Offline
Registered User
 
Join Date: Feb 2011
Posts: 2
windows_xp_2003chrome
Fail to access pcie user space (e.g. bar 2)

I am unable to access a standard memory pcie card bar registers through my driver on the pcie interface for Zotec H55 ITX motherboard (it includes a built in NVideo engine). This is the following setup:
1. Fedora 14 32 bit pcie scan does see the board (lspci -n show card on pcie bus #2)
2. Configuration register read is good. (pci_read_config_byte())
3. The following driver commands did correctly return bar information: pci_rsource_start(), pci_resource_end(),pci_resource_len()
4. The commands iowrite32() or memcopy_toio() results in no pcie transfers (determined through pcie core probing)
5. The same driver code fully functioned on the Intel DH57JG mini-ITX. (using lspci -n, pcie located on pcie bus #1)
6. Note, it seems that the pcie connector for Zotec is on bus#2, where as Intel MB pcie connector is on bus#1. Note also that the Zotec has a built in NVidia graphics engine.

The following driver code was used. Again, it worked on DH57JG:
pcid.pciaddr_phy_str_bar0 = pci_resource_start(pcid.pcidev,0);
if(pcid.pciaddr_phy_str_bar0 == 0) {
printk(KERN_INFO "fail to get pci start address for Bar0.\n");
return -ENODEV; }
pcid.pciaddr_phy_len_bar0 = pci_resource_len(pcid.pcidev,0);
if(pcid.pciaddr_phy_len_bar0 == 0) {
printk(KERN_INFO "fail to get pci end address for Bar0.\n");
return -ENODEV; }
pcid.pciaddr_phy_str_bar2 = pci_resource_start(pcid.pcidev,2);
if(pcid.pciaddr_phy_str_bar2 == 0) {
printk(KERN_INFO "fail to get pci start address for Bar2.\n");
return -ENODEV; }
pcid.pciaddr_phy_len_bar2 = pci_resource_len(pcid.pcidev,2);
if(pcid.pciaddr_phy_len_bar2 == 0) {
printk(KERN_INFO "fail to get pci end address for Bar2.\n");
return -ENODEV; }


printk(KERN_INFO "pci captured: pcidev=%#lx pciaddr_phy_str_bar(0,1)=(%#lx,%#lx)\n",
pci_resource_start(pcid.pcidev,0), pci_resource_start(pcid.pcidev,1));
if(PRINTK_DB)
{
printk(KERN_INFO "pci captured: pcidev=%#lx pciaddr_phy_str_bar(0,2)=(%#lx,%#lx)\n",
pcid.pcidev, (long unsigned int)pcid.pciaddr_phy_str_bar0,(long unsigned int)pcid.pciaddr_phy_str_bar2);
printk(KERN_INFO " pciaddr_phy_len_bar(0,2)=(%#lx,%#lx)\n",
pcid.pciaddr_phy_len_bar0,pcid.pciaddr_phy_len_bar 2);
}
if(!request_mem_region(pcid.pciaddr_phy_str_bar0, pcid.pciaddr_phy_len_bar0, "pci_bar0"))
printk(KERN_INFO "request_mem_region fail: bar0\n");
if(!request_mem_region(pcid.pciaddr_phy_str_bar2, pcid.pciaddr_phy_len_bar2,"pci_bar2"))
printk(KERN_INFO "request_mem_region fail: bar2\n");


pcid.pciaddr_base_bar0 = (unsigned long) ioremap(pcid.pciaddr_phy_str_bar0, pcid.pciaddr_phy_len_bar0);
pcid.pciaddr_base_bar2 = (unsigned long) ioremap(pcid.pciaddr_phy_str_bar2, pcid.pciaddr_phy_len_bar2);
if(PRINTK_DB)
{
printk(KERN_INFO "pci bar0 io remap addr = %#lx\n",
(long unsigned int)(pcid.pciaddr_base_bar0));
printk(KERN_INFO "pci bar2 io remap addr = %#lx\n",
(long unsigned int)(pcid.pciaddr_base_bar2));
}

// testing

for(i=0;i<100;i++)
for(j=0;j<4;j++){
iowrite32(0x13572348,(void *)(pcid.pciaddr_base_bar2+(long unsigned int)(4*j)));
iowrite32(0x12344321,(void *)(pcid.pciaddr_base_bar0));}
i = ioread32((void *)(pcid.pciaddr_base_bar2));
printk(KERN_INFO "pci bar2 reg0=%x\n",i); <<<<< FAIL

for(i=0;i<100;i++) {
pci_read_config_byte(pcid.pcidev,i,&j);
pci_write_config_byte(pcid.pcidev,i+70,&j);
printk(KERN_INFO "pci cfg %d=%x\n",i,j); } <<<<GOD
Reply With Quote
  #2  
Old 21st February 2011, 12:44 AM
yhuyhu Offline
Registered User
 
Join Date: Feb 2011
Posts: 2
windows_xp_2003chrome
Re: Fail to access pcie user space (e.g. bar 2)

(Solved) This turns out to be a Xilinx evaluation PCIe core on the ML505 board that works on Intel motherboards, but not on the Zotek boards. The Xilinx PCIe core on the SP605 works on both motherboards. The root cause is still unknown.
Reply With Quote
Reply

Tags
pcie

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Firefox after Autoten fail - no internet access GoinEasy9 Using Fedora 9 13th March 2011 08:22 AM
Disable Internet access to a user and enable remote access to the machine for the use santhoshsd Security and Privacy 0 11th October 2008 04:08 PM
File access from Kernel space? tsaud Programming & Packaging 2 29th August 2007 04:20 PM
Fail to boot hanging on "Enableing swap space...." satimis Using Fedora 11 19th May 2005 11:14 AM


Current GMT-time: 17:07 (Thursday, 23-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat