public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Johan Borkhuis <j.borkhuis@dutchspace•nl>
To: linuxppc-embedded@ozlabs•org
Subject: Problem initialising PCI device
Date: Tue, 13 Mar 2007 16:28:01 +0100	[thread overview]
Message-ID: <45F6C301.6080502@dutchspace.nl> (raw)

I am working with a MEN A14C board (PPC 8540), and I am trying to get a 
Reflective Memory card (VMIC 5565) working in one of the PMC slots 
using  Linux (ELinOS).

When I load the driver I am able to access the registers of the card 
using the pci access routines (pci_read_config_word, etc.), but when I 
try to access the registers or the memory on the card using memory 
mapped access this does not work.

The PMC bus is separated from the main PCI bus by a PCI-PCI bridge (Hint 
Corp HB2 PCI-PCI Bridge (rev 04), vendor 0x3388, device 0x0026). For 
some other devices (that are connected directly to the PCI bus) I don't 
have any problems accessing the memory directly.

Am I forgetting something, or is there something else wrong here?

Below is the code I use to access the reflective memory card (this code 
is cut from the _init_one function):

 pci_enable_device(dev);

 err = pci_request_regions(dev, "RFM");
 if (err != 0) {
   os_print(OS_ERR "Cannot obtain PCI resources\n");
   return( -ENOMEM );
 }

 /* Get the physical address of the local and runtime registers */
 unit->physAddrOr = pci_resource_start(dev, 0);
 data->orRegs = ioremap_nocache(unit->physAddrOr, 0x40);

 /* Get the physical address of the control and status registers */
 unit->physAddrCs = pci_resource_start(dev, 2);
 data->csRegs = ioremap_nocache(unit->physAddrCs, 0x40);

   printk(KERN_ERR "OR: %8.8x, CS: %8.8x\n", unit->physAddrOr, 
unit->physAddrCs);
   printk(KERN_ERR "OR: %8.8x, CS: %8.8x\n", data->orRegs, data->csRegs);
   for(i = 0; i < 4; i++)
   {
       printk( KERN_ERR"%2.2x: %8.8x\n", i, os_readl(data->csRegs + i*4));
   }

The code above generates the following output:

OR: dffffe00, CS: dffffdc0
OR: e106ae00, CS: e106cdc0
00: 86000300
01: 86000300
02: 86000300
03: 86000300

I would expect the data from the card, as reported by lspci. So instead 
of "00: 86000300" I would expect something like "00:5565114a", which is 
the ident of the card.

Thank you for your time and (hopefully) your answer.

Kind regard,
    Johan Borkhuis

                 reply	other threads:[~2007-03-13 15:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45F6C301.6080502@dutchspace.nl \
    --to=j.borkhuis@dutchspace$(echo .)nl \
    --cc=linuxppc-embedded@ozlabs$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox