linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Luotao Fu <devtty0@gmail.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: problems with pci bus on a pm520 board
Date: Thu, 01 Mar 2007 10:29:03 +0100	[thread overview]
Message-ID: <45E69CDF.20608@gmail.com> (raw)
In-Reply-To: <eaa8f5754d3e1544ce91df01acf2054d@kernel.crashing.org>

Hi,

Segher Boessenkool wrote:

> You removed the original copyright notice, please don't;
> it might even be illegal to do so, depending on where
> you live/work.  Just add your own, don't remove the original.
> 

OK, thanx for the hint.

>>             interrupt-map = <8000 0 0 1 500 1 1 3 // e100, 10.0
>>                              8000 0 0 2 500 1 1 3
>>                              8000 0 0 3 500 1 1 3
>>                              8000 0 0 4 500 1 1 3
> 
> 8000 is device 16, not 10
> 
>>                              8800 0 0 1 500 1 0 3 // usb 11.0, 11.1, 11.2
>>                              8800 0 0 2 500 1 2 3
>>                              8800 0 0 3 500 1 3 3
>>                              8800 0 0 4 500 0 0 3>;
> 
> and 8800 is device 17
> 

Hmm, this is strange. I put some debug printks in the of parser
prom_parser.c in the function of_irq_map_raw somewhere in the machting
loop, which prints the imap and address being parsed. So that the lines
at about 834 now looks like this:
match = 1;
for (i = 0; i < addrsize && match; ++i) {
<snip>
	printk(" -> imap %x addr %x mask %x\n", imap[i], addr[i], mask);
}
for (; i < (addrsize + intsize) && match; ++i) {
<snip>
	printk(" -> imap %x intspec %x mask %x\n", imap[i],
intspec[i-addrsize], mask);
}
<snip>
printk(" -> match=%d (imaplen=%d), addr %d \n", match, imaplen, addr[i]);

With these printks I got for example for device 10.0 the output

Try to map irq for 0000:00:10.0...
        PCI: pdev bus number: 0, devfn: 128
of_irq_map_raw: par=/soc5200@f0000000/pci@0d00,intspec=[0x00000001
0x00008000...],ointsize=1
of_irq_map_raw: ipar=/soc5200@f0000000/pci@0d00, size=1
 -> imap 8000 addr 8000 mask f800
 -> imap 0 addr 0 mask 0
 -> imap 0 addr 0 mask 0
 -> imap 1 intspec 1 mask 7
 -> match=1 (imaplen=60), addr 1
 -> newintsize=3, newaddrsize=0
 -> imaplen=56
 -> new parent: /soc5200@f0000000/pic@500
 -> got it !
 -> got one, spec 3 cells (0x00000001...) on /soc5200@f0000000/pic@500
 -> virq :65

As I have noticed, the array addr is filled in of_irq_map_pci() by
laddr[0] = (pdev->bus->number << 16) | (pdev->devfn << 8);
Since my pdev->bus->number is 0. I got the address 8000 here. Is the
pdev->bus->number actually supposed to be 10 for device 10? I had some
trouble tracking down how the bus number is initialized. It might be
nice if you or some one could give me a hint on this.


Thanx again
cheers
Luotao Fu

  reply	other threads:[~2007-03-01  9:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-28 20:59 problems with pci bus on a pm520 board Luotao Fu
2007-02-28 22:03 ` Segher Boessenkool
2007-02-28 23:33   ` Luotao Fu
2007-03-01  1:53     ` Segher Boessenkool
2007-03-01  9:29       ` Luotao Fu [this message]
2007-03-01 12:54         ` Segher Boessenkool
2007-03-02 16:13           ` Luotao Fu
2007-03-03  0:16             ` Segher Boessenkool

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=45E69CDF.20608@gmail.com \
    --to=devtty0@gmail.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=segher@kernel.crashing.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).