(PowerPC) PCI driver writeb() and readb() failures with 'machine check error'.


Yusuf <yusufalti1997@...>
 

Hello freescale,

I am having an important trouble while communicating with my PCI Endpoint devices MMIO. I am using T1042D4RDB-64B. PowerPC e5500 processor. 

I have a FPGA memory controller card which is programmed to light GPIO leds when it's memory is filled with data on PCI. I wrote a driver and tested it with x86 based Ubuntu and it's working as expected.

I used same driver with T1042D4RDB-64B. Kernel is giving UNRECOVERABLE MACHINE CHECK error when I try to read the same area I wrote before. Leds are also not lighting so that this means write operation is not working too. Seems like ATMU is not transferring the transactions to PCI endpoint device.

I tried same code piece with another endpoint device ( This is a GPU ) and I had same problem again.

Detailed thread is here:

Driver code piece
pci_request_regions(dev, "IO-pci");
pci_enable_device_mem(dev);
printk(KERN_INFO "Physical address start: %lX",pci_resource_start(dev,BAR_IO));
          printk(KERN_INFO "Physical address end: %lX",pci_resource_end(dev,BAR_IO));
          iomapped_addr_start = ioremap(pci_resource_start(dev,BAR_IO),pci_resource_len(dev,BAR_IO));
          printk(KERN_INFO "Virtual address start: %lX",iomapped_addr_start);

if(iomapped_addr_start != NULL || iomapped_addr_start != 0)
 {
   for(i=0;i<pci_resource_len(dev,BAR_IO);i++)
   {
       printk(KERN_INFO "Before Write %lX \n",iomapped_addr_start+i);
       writeb(5,iomapped_addr_start+i);
       printk(KERN_INFO "Writed 5 \n");
       printk(KERN_INFO "Readed %d",readb(iomapped_addr_start+i));
   }
 }

Output:
Physical address start: 0x21000000
Physical address end: 0x210007ff
Virtual address start: 80000800888C0000
Before Write 80000800888C0000                                                  
Writed 5                                                                        
ntDlaibslaibnlgi nlgo clko cdke bduegbguginggi ngdu de ueto t ko erkenernl eltat
  x                                                                            
80000001 cecar 0x020c0000 cecar2 0x00001010                                    
CaCuasuesde db yb y( f(rformom M MCSCSR=R=a0a00000):): L Looad Error Report    
KeKrenrenle lp apannici c -- n onott s ysynncicningg: Unrecoverable Machine chek