Subject: Re: need support for PCI driver

From: David Hawkins <[email-masked]>
Date: Fri, 08 Jun 2012 08:41:15 -0700

> Using PMC -PCI Adapter card ,i have interfaced my *PowerPC MPC8280*
> (which is configured as *PCI bridge*) as agent to personal computer.
> when this setup having MPC8280 card with *powered ON* and connected to
> *PC* .*PC* is getting hanged while system is booting up. I am finding
> problem when this card is powered ON state before system is boot up. But
> if this MPC8280(PCI Bridge) card with powered ON is connected to PMC
> carrier adapter after PC has booted up, it is getting identified by
> system and able to watch my device details (configuration space) using
> "*PCI Explorer Software"*. But using this software, it is showing this
> single PCI device as *31* different devices. *Why this is showing as 31
> PCI devices? Also why PC is not getting Booted, after this PCI Bridge in
> power ON state is connected to PMC –PCI Adapter card that already in PCI
> slot of my PC?* I am unable to solve this problem.

Have you looked at the PCI bus activity when this is failing?

If your MPC8280 does not configure the PCI bridge correctly, or
before the host PC BIOS performs configuration space access to
configure the PCI bridge, then that may explain your issue.

> I am finding the same issue even I am using this set up on Linux based
> host .

Because its a BIOS issue, not an OS issue.

> I approached Freescale support for this issue by sending my *PCI card
> schematics*. They analyzed and came up with small changes, but still we
> could not able to solve this problem. So we wanted to start tracing the
> problem from software side. That’s why I wanted to install my PCI card
> into Linux based host. To do this whether I need to write /include any
> driver code into my Linux host .If I need to write driver code how to
> start & where exactly needs changes/inclusions of code stuff in linux code.
>
> Already I am studying kernel documentation and drivers code under source
> code. Referring Linux device Driver 3^rd edition O’reilly s book.
>
> I am new to linux.

You do not need to write a driver while trying to debug your PCI
BAR regions issues. You only need a driver when working with
interrupts.

Under Linux, you can use the lspci command to look at the PCI
configuration space exposed by the PCI interface on your board.
Once you are happy that the BAR layout corresponds to what you
expect, i.e., what you PCI bootloader configures the card as,
you can move onto accessing the board via those BAR regions.

You can then use simple command line tools (run as root) to
access the BAR regions.

Here's a simple command-line tool I wrote for read/write access:

http://www.ovro.caltech.edu/~dwh/pci_debug.zip

I believe the tool devmem (part of busybox) can also be used.

Cheers,
Dave