linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Paul Mackerras <paulus@cs.anu.edu.au>
To: ad@MPIfR-Bonn.MPG.de
Cc: linuxppc-dev@lists.linuxppc.org, linuxppc-user@lists.linuxppc.org
Subject: Re: Help: Porting PCI driver from Linux/Intel -> PPC
Date: Fri, 25 Jun 1999 12:11:11 +1000	[thread overview]
Message-ID: <199906250211.MAA04916@tango.anu.edu.au> (raw)
In-Reply-To: <3771D987.C59A9374@mpifr-bonn.mpg.de> (message from Albrecht Dreß on Thu, 24 Jun 1999 09:08:55 +0200)


Albrecht =?iso-8859-1?Q?Dre=DF?= <ad@MPIfR-Bonn.MPG.de> wrote:

> 	I wrote a driver for a pci dsp card, which works fine on several Intel/
> Linux boxes both with 2.0.x and 2.2.x.  This encouraged to make a test with my
> PMac 7300/166, running R5 with the stock 2.2.6 kernel.  I compiled and inserted
> the driver --- and got a kernel panic :-(

A machine check?  That will happen if you try to access an I/O port
which doesn't respond.

> Maybe I missed some setup which is needed with LinuxPPC but not with Intel?  Or

PCI cards don't automatically their memory and I/O accesses enabled on
powermacs.  Arguably the generic PCI stuff in the kernel should turn
on memory and I/O accesses, and it should probably also check that the
addresses assigned by Open Firmware are sane.

> Now I try to insmod my driver, which reads the configuration space (using calls
> to pci_read_config_dword) and dumps it, reads irq and board revision, reads the
> base adresses of the five io regions, and reads one io address via inl().  The

Ideally you should use pci_find_device and then use the base_address
and irq fields from the pci_dev structure it returns.  And for
powermacs, you will need to set the bit in the config-space control
register to enable I/O accesses.

> * lspci reports irq #25, but the value in the config space is 1

Use pci_dev->irq instead, it should be correct.

> * the regions 0 to 3 are 256 bytes each, so they would overlap if the values
>   reported would be correct.

Possibly OF's fault.  I assume that if you write 0xffffffff into those
base address registers, you get back 0xffffff01, indicating 256 bytes
of I/O space?

Paul.

[[ This message was sent via the linuxppc-dev mailing list.  Replies are ]]
[[ not  forced  back  to the list, so be sure to Cc linuxppc-dev if your ]]
[[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting.   ]]

      parent reply	other threads:[~1999-06-25  2:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-06-24  7:08 Help: Porting PCI driver from Linux/Intel -> PPC Albrecht Dreß
1999-06-24 19:41 ` Ryan Nielsen
1999-06-25  2:03 ` Daniel Jacobowitz
1999-06-25 16:36   ` David A. Gatwood
1999-06-25  2:11 ` Paul Mackerras [this message]

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=199906250211.MAA04916@tango.anu.edu.au \
    --to=paulus@cs.anu.edu.au \
    --cc=Paul.Mackerras@cs.anu.edu.au \
    --cc=ad@MPIfR-Bonn.MPG.de \
    --cc=linuxppc-dev@lists.linuxppc.org \
    --cc=linuxppc-user@lists.linuxppc.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).