linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* (PowerPC) PCI driver writeb() and readb() failures with 'machine check error'.
@ 2020-01-16  7:51 Yusuf Altıparmak
  0 siblings, 0 replies; only message in thread
From: Yusuf Altıparmak @ 2020-01-16  7:51 UTC (permalink / raw)
  To: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 2189 bytes --]

Hello,

I am having an important trouble while communicating with my PCI Endpoint
devices MMIO. I am using T1042D4RDB-64B. PowerPC e5500 processor with
kernel version 4.19 and default PCI driver is 'pcieport'. Kernel is built
with Yocto 2.7.

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.

I am seeking some help about this issue.

*Detailed thread is here:*
https://community.nxp.com/thread/522267

*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_resfreescaleource_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

[-- Attachment #2: Type: text/html, Size: 3190 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-01-16  8:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-16  7:51 (PowerPC) PCI driver writeb() and readb() failures with 'machine check error' Yusuf Altıparmak

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).