All of lore.kernel.org
 help / color / mirror / Atom feed
* R: Re: PCI device not working
@ 2012-10-04 12:24 Davide Viti
  2012-10-04 13:14 ` Kumar Gala
  0 siblings, 1 reply; 17+ messages in thread
From: Davide Viti @ 2012-10-04 12:24 UTC (permalink / raw)
  To: galak; +Cc: linuxppc-dev

Hi,
it turns out that if define CONFIG_PCI_NOSCAN in u-boot (as per [1]), the=
=20
devide behind the second controller is detected by the  Linux kernel.

Would=20
you suggest any particular patch I should apply to fix this (I'm using kern=
el=20
2.6.34)

thanx alot in advance
Davide

[1] http://permalink.gmane.org/gmane.
linux.ports.ppc.embedded/20140

>----Messaggio originale----
>Da:=20
zinosat@tiscali.it
>Data: 28/09/2012 16.48
>A: <galak@kernel.crashing.org>
>Cc:=20
<linuxppc-dev@lists.ozlabs.org>
>Ogg: R: Re: PCI device not working
>
>Hi=20
Kumar,
>
>>
>>It was, can you figure out in u-boot what exact config read on=20

>the bus would return the correct thing.
>>
>>The fact that when we probe the=20

>device at 0001:03 we should get back something like cfg_data=3D0xabba1b65
>>
>

>here=20
>follow some details about what is going on inside u-boot; verbosity=20
increases=20
>from [1] to [3]
>
> [1] PCI printouts when the board come up
> [2]=20
output of "pci=20
>[0-3] long" u-boot command
> [3] same as [1] but with debug=20
print inside=20
>indirect_read_config_##size() [drivers/pci/pci_indirect.c]
>
>if=20
you were curious=20
>about our u-boot board settings, please refer to:
>http:
//www.mail-archive.
>com/linuxppc-dev@lists.ozlabs.org/msg62007.html
>
>thanx=20
alot,
>Davide
>
>
>
>*************
>*    [1]    *
>*************
>    PCIE1=20
used as Root Complex (base=20
>addr ffe09000)
>               Scanning PCI bus 01

>        01  00  1b65  abba =20
>0280  00
>        cfg_addr:ffe09000  cfg_data:
ffe09004  indirect_type:0
>   =20
>PCIE1 on bus 00 - 01
>
>
>    PCIE2 used as=20
Root Complex (base addr ffe0a000)
>
>               Scanning PCI bus 03

>        03  00  1b65  abba  0280  00
>       =20
>cfg_addr:ffe0a000  cfg_data:
ffe0a004  indirect_type:0
>    PCIE2 on bus 02 - 03
>
>
>*************
>*   =20
[2]    *
>*************
>
>=3D> pci 0 long
>Scanning PCI devices=20
>on bus 0
>

>Found PCI device 00.00.00:
>  vendor ID =3D                   0x1957
> =20
>device=20
ID =3D                   0x0100
>  command register =3D            0x0006
> =20

>status register =3D             0x0010
>  revision ID =3D                 0x11
> =20

>class code =3D                  0x0b (Processor)
>  sub class code=20
=3D             =20
>0x20
>  programming interface =3D       0x00
>  cache line=20
=3D                  0x08
>
>  latency time =3D                0x00
>  header type=20
=3D                 0x01
> =20
>BIST =3D                        0x00
>  base address=20
0 =3D              0xfff00000
> =20
>base address 1 =3D              0x00000000
> =20
primary bus number =3D          0x00
> =20
>secondary bus number =3D        0x01
> =20
subordinate bus number =3D      0x01
> =20
>secondary latency timer =3D     0x00
> =20
IO base =3D                     0x00
>  IO=20
>limit =3D                    0x00
> =20
secondary status =3D            0x0000
>  memory=20
>base =3D                 0xa000

>  memory limit =3D                0xa000
>  prefetch=20
>memory base =3D       =20
0x1001
>  prefetch memory limit =3D       0x0001
>  prefetch=20
>memory base upper=20
=3D  0x00000000
>  prefetch memory limit upper =3D 0x00000000
>  IO=20
>base upper 16=20
bits =3D       0x0000
>  IO limit upper 16 bits =3D      0x0000
> =20
>expansion ROM=20
base address =3D  0x00000000
>  interrupt line =3D              0x00
> =20
>interrupt=20
pin =3D               0x00
>  bridge control =3D              0x0000
>
>=3D>=20
>pci 1=20
long
>Scanning PCI devices on bus 1
>
>Found PCI device 01.00.00:kk
>  vendor=20

>ID =3D                   0x1b65
>  device ID =3D                   0xabba
> =20
command=20
>register =3D            0x0006
>  status register =3D             0x0010

>  revision=20
>ID =3D                 0x01
>  class code =3D                  0x02=20
(Network=20
>controller)
>  sub class code =3D              0x80
>  programming=20
interface=20
>=3D       0x00
>  cache line =3D                  0x08
>  latency time=20

>=3D                0x00
>  header type =3D                 0x00
>  BIST=20

>=3D                        0x00
>  base address 0 =3D              0xa0000000
> =20
base=20
>address 1 =3D              0xa0010000
>  base address 2 =3D             =20
0x00000000
>
>  base address 3 =3D              0x00000000
>  base address 4=20
=3D             =20
>0x00000000
>  base address 5 =3D              0x00000000
> =20
cardBus CIS pointer=20
>=3D         0x00000000
>  sub system vendor ID =3D       =20
0x0000
>  sub system ID=20
>=3D               0x0000
>  expansion ROM base address=20
=3D  0x00000000
>  interrupt=20
>line =3D              0x00
>  interrupt pin=20
=3D               0x01
>  min Grant=20
>=3D                   0x00
>  max Latency=20
=3D                 0x00
>
>=3D> pci 2 long
>
>Scanning PCI devices on bus 2
>

>Found PCI device 02.00.00:
>  vendor ID=20
>=3D                   0x1957
>  device=20
ID =3D                   0x0100
>  command=20
>register =3D            0x0006
> =20
status register =3D             0x0010
>  revision=20
>ID =3D                 0x11
> =20
class code =3D                  0x0b (Processor)
> =20
>sub class code=20
=3D              0x20
>  programming interface =3D       0x00
>  cache=20
>line=20
=3D                  0x08
>  latency time =3D                0x00
>  header type=20

>=3D                 0x01
>  BIST =3D                        0x00
>  base address=20
0=20
>=3D              0xfff00000
>  base address 1 =3D              0x00000000
> =20
primary=20
>bus number =3D          0x00
>  secondary bus number =3D        0x01
> =20
subordinate=20
>bus number =3D      0x01
>  secondary latency timer =3D     0x00
> =20
IO base=20
>=3D                     0x00
>  IO limit =3D                    0x00
> =20
secondary=20
>status =3D            0x0000
>  memory base =3D                 0xb000

>  memory=20
>limit =3D                0xb000
>  prefetch memory base =3D       =20
0x1001
>  prefetch=20
>memory limit =3D       0x0001
>  prefetch memory base upper=20
=3D  0x00000000
> =20
>prefetch memory limit upper =3D 0x00000000
>  IO base upper 16=20
bits =3D       0x0000
>
>  IO limit upper 16 bits =3D      0x0000
>  expansion ROM=20
base address =3D =20
>0x00000000
>  interrupt line =3D              0x00
>  interrupt=20
pin =3D              =20
>0x00
>  bridge control =3D              0x0000
>
>=3D> pci 3=20
long
>Scanning PCI devices=20
>on bus 3
>
>Found PCI device 03.00.00:
>  vendor=20
ID =3D                   0x1b65
> =20
>device ID =3D                   0xabba
> =20
command register =3D            0x0006
> =20
>status register =3D             0x0010

>  revision ID =3D                 0x01
> =20
>class code =3D                  0x02=20
(Network controller)
>  sub class code=20
>=3D              0x80
>  programming=20
interface =3D       0x00
>  cache line=20
>=3D                  0x08
>  latency time=20
=3D                0x00
>  header type=20
>=3D                 0x00
>  BIST=20
=3D                        0x00
>  base address 0=20
>=3D              0xb0000000
> =20
base address 1 =3D              0xb0010000
>  base=20
>address 2 =3D             =20
0x00000000
>  base address 3 =3D              0x00000000
>
>  base address 4=20
=3D              0x00000000
>  base address 5 =3D             =20
>0x00000000
> =20
cardBus CIS pointer =3D         0x00000000
>  sub system vendor ID=20
>=3D       =20
0x0000
>  sub system ID =3D               0x0000
>  expansion ROM base=20
>address=20
=3D  0x00000000
>  interrupt line =3D              0x00
>  interrupt pin=20

>=3D               0x01
>  min Grant =3D                   0x00
>  max Latency=20

>=3D                 0x00
>
>
>*************
>*    [3]    *
>*************
>
>   =20
PCIE1=20
>used as Root Complex (base addr ffe09000)
>b=3D0 d=3D0 f=3D0 (fbusno=3D0=20
itype=3D0=20
>cfg_adr=3Dffe09000 cfg_data=3Dffe09004) ofs=3D10 mask=3D0
>...

>               Scanning=20
>PCI bus 01
>b=3D1 d=3D0 f=3D0 (fbusno=3D0 itype=3D0=20
cfg_adr=3Dffe09000 cfg_data=3Dffe09004)=20
>ofs=3De mask=3D3
>...
>b=3D1 d=3D0 f=3D0 (fbusno=3D0=20
itype=3D0 cfg_adr=3Dffe09000=20
>cfg_data=3Dffe09004) ofs=3D3c mask=3D3
>        01  00 =20
1b65  abba  0280  00
>b=3D1 d=3D1=20
>f=3D0 (fbusno=3D0 itype=3D0 cfg_adr=3Dffe09000=20
cfg_data=3Dffe09004) ofs=3De mask=3D3
>b=3D1 d=3D1=20
>f=3D0 (fbusno=3D0 itype=3D0=20
cfg_adr=3Dffe09000 cfg_data=3Dffe09004) ofs=3D0 mask=3D2
>...
>b=3D0=20
>d=3D0 f=3D0 (fbusno=3D0=20
itype=3D0 cfg_adr=3Dffe09000 cfg_data=3Dffe09004) ofs=3D9 mask=3D3
>   =20
>PCIE1 on bus 00=20
- 01
>
>    PCIE2 used as Root Complex (base addr ffe0a000)
>b=3D0=20
>d=3D0 f=3D0=20
(fbusno=3D2 itype=3D0 cfg_adr=3Dffe0a000 cfg_data=3Dffe0a004) ofs=3D10 mask=
=3D0
>b=3D0=20
>d=3D0=20
f=3D0 (fbusno=3D2 itype=3D0 cfg_adr=3Dffe0a000 cfg_data=3Dffe0a004) ofs=3D1=
0 mask=3D0
>...
>

>b=3D0 d=3D0 f=3D0 (fbusno=3D2 itype=3D0 cfg_adr=3Dffe0a000 cfg_data=3Dffe0=
a004) ofs=3D9 mask=3D3

>
>               Scanning PCI bus 03
>b=3D1 d=3D0 f=3D0 (fbusno=3D2 itype=3D0=20

>cfg_adr=3Dffe0a000 cfg_data=3Dffe0a004) ofs=3De mask=3D3
>b=3D1 d=3D0 f=3D0 (fbusno=3D2=20
itype=3D0=20
>cfg_adr=3Dffe0a000 cfg_data=3Dffe0a004) ofs=3D0 mask=3D2
>...
>b=3D1 d=3D0 f=3D0=20
(fbusno=3D2=20
>itype=3D0 cfg_adr=3Dffe0a000 cfg_data=3Dffe0a004) ofs=3D3c mask=3D3
>       =20
03  00  1b65 =20
>abba  0280  00
>        cfg_addr:ffe0a000  cfg_data:ffe0a004 =20
indirect_type:0
>
>b=3D1 d=3D1 f=3D0 (fbusno=3D2 itype=3D0 cfg_adr=3Dffe0a000=20
cfg_data=3Dffe0a004) ofs=3De mask=3D3
>
>...
>b=3D0 d=3D0 f=3D0 (fbusno=3D2 itype=3D0=20
cfg_adr=3Dffe0a000 cfg_data=3Dffe0a004) ofs=3D9=20
>mask=3D3
>    PCIE2 on bus 02 - 03
>

>
>
>Invita i tuoi amici e Tiscali ti premia! Il consiglio di un amico vale pi=
=C3=B9=20
di uno spot in TV. Per ogni nuovo abbonato 30 =E2=82=AC di premio per te e =
per lui! Un=20
amico al mese e parli e navighi sempre gratis: http://freelosophy.tiscali.i=
t/



Invita i tuoi amici e Tiscali ti premia! Il consiglio di un amico vale pi=
=C3=B9 di uno spot in TV. Per ogni nuovo abbonato 30 =E2=82=AC di premio pe=
r te e per lui! Un amico al mese e parli e navighi sempre gratis: http://fr=
eelosophy.tiscali.it/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: PCI device not working
  2012-10-04 12:24 R: Re: PCI device not working Davide Viti
@ 2012-10-04 13:14 ` Kumar Gala
       [not found]   ` <CAKpAL0m3YnsbbGxL+ejfyE4zfGE5LD9Qxb7oobHVaAZGE1_Jnw@mail.gmail.com>
  0 siblings, 1 reply; 17+ messages in thread
From: Kumar Gala @ 2012-10-04 13:14 UTC (permalink / raw)
  To: Davide Viti; +Cc: linuxppc-dev


On Oct 4, 2012, at 7:24 AM, Davide Viti wrote:

> Hi,
> it turns out that if define CONFIG_PCI_NOSCAN in u-boot (as per [1]), =
the=20
> devide behind the second controller is detected by the  Linux kernel.
>=20
> Would=20
> you suggest any particular patch I should apply to fix this (I'm using =
kernel=20
> 2.6.34)
>=20
> thanx alot in advance
> Davide
>=20
> [1] http://permalink.gmane.org/gmane.
> linux.ports.ppc.embedded/20140

My suggestion would be to try and dump all the controller registers =
between the case that works and doesn't and compare.  There's some minor =
setting difference that I'm guessing is causing issues.

- k

>=20
>> ----Messaggio originale----
>> Da:=20
> zinosat@tiscali.it
>> Data: 28/09/2012 16.48
>> A: <galak@kernel.crashing.org>
>> Cc:=20
> <linuxppc-dev@lists.ozlabs.org>
>> Ogg: R: Re: PCI device not working
>>=20
>> Hi=20
> Kumar,
>>=20
>>>=20
>>> It was, can you figure out in u-boot what exact config read on=20
>=20
>> the bus would return the correct thing.
>>>=20
>>> The fact that when we probe the=20
>=20
>> device at 0001:03 we should get back something like =
cfg_data=3D0xabba1b65
>>>=20
>>=20
>=20
>> here=20
>> follow some details about what is going on inside u-boot; verbosity=20=

> increases=20
>> from [1] to [3]
>>=20
>> [1] PCI printouts when the board come up
>> [2]=20
> output of "pci=20
>> [0-3] long" u-boot command
>> [3] same as [1] but with debug=20
> print inside=20
>> indirect_read_config_##size() [drivers/pci/pci_indirect.c]
>>=20
>> if=20
> you were curious=20
>> about our u-boot board settings, please refer to:
>> http:
> //www.mail-archive.
>> com/linuxppc-dev@lists.ozlabs.org/msg62007.html
>>=20
>> thanx=20
> alot,
>> Davide
>>=20
>>=20
>>=20
>> *************
>> *    [1]    *
>> *************
>>   PCIE1=20
> used as Root Complex (base=20
>> addr ffe09000)
>>              Scanning PCI bus 01
>=20
>>       01  00  1b65  abba =20
>> 0280  00
>>       cfg_addr:ffe09000  cfg_data:
> ffe09004  indirect_type:0
>>=20
>> PCIE1 on bus 00 - 01
>>=20
>>=20
>>   PCIE2 used as=20
> Root Complex (base addr ffe0a000)
>>=20
>>              Scanning PCI bus 03
>=20
>>       03  00  1b65  abba  0280  00
>>=20
>> cfg_addr:ffe0a000  cfg_data:
> ffe0a004  indirect_type:0
>>   PCIE2 on bus 02 - 03
>>=20
>>=20
>> *************
>> *   =20
> [2]    *
>> *************
>>=20
>> =3D> pci 0 long
>> Scanning PCI devices=20
>> on bus 0
>>=20
>=20
>> Found PCI device 00.00.00:
>> vendor ID =3D                   0x1957
>>=20
>> device=20
> ID =3D                   0x0100
>> command register =3D            0x0006
>>=20
>=20
>> status register =3D             0x0010
>> revision ID =3D                 0x11
>>=20
>=20
>> class code =3D                  0x0b (Processor)
>> sub class code=20
> =3D             =20
>> 0x20
>> programming interface =3D       0x00
>> cache line=20
> =3D                  0x08
>>=20
>> latency time =3D                0x00
>> header type=20
> =3D                 0x01
>>=20
>> BIST =3D                        0x00
>> base address=20
> 0 =3D              0xfff00000
>>=20
>> base address 1 =3D              0x00000000
>>=20
> primary bus number =3D          0x00
>>=20
>> secondary bus number =3D        0x01
>>=20
> subordinate bus number =3D      0x01
>>=20
>> secondary latency timer =3D     0x00
>>=20
> IO base =3D                     0x00
>> IO=20
>> limit =3D                    0x00
>>=20
> secondary status =3D            0x0000
>> memory=20
>> base =3D                 0xa000
>=20
>> memory limit =3D                0xa000
>> prefetch=20
>> memory base =3D       =20
> 0x1001
>> prefetch memory limit =3D       0x0001
>> prefetch=20
>> memory base upper=20
> =3D  0x00000000
>> prefetch memory limit upper =3D 0x00000000
>> IO=20
>> base upper 16=20
> bits =3D       0x0000
>> IO limit upper 16 bits =3D      0x0000
>>=20
>> expansion ROM=20
> base address =3D  0x00000000
>> interrupt line =3D              0x00
>>=20
>> interrupt=20
> pin =3D               0x00
>> bridge control =3D              0x0000
>>=20
>> =3D>=20
>> pci 1=20
> long
>> Scanning PCI devices on bus 1
>>=20
>> Found PCI device 01.00.00:kk
>> vendor=20
>=20
>> ID =3D                   0x1b65
>> device ID =3D                   0xabba
>>=20
> command=20
>> register =3D            0x0006
>> status register =3D             0x0010
>=20
>> revision=20
>> ID =3D                 0x01
>> class code =3D                  0x02=20
> (Network=20
>> controller)
>> sub class code =3D              0x80
>> programming=20
> interface=20
>> =3D       0x00
>> cache line =3D                  0x08
>> latency time=20
>=20
>> =3D                0x00
>> header type =3D                 0x00
>> BIST=20
>=20
>> =3D                        0x00
>> base address 0 =3D              0xa0000000
>>=20
> base=20
>> address 1 =3D              0xa0010000
>> base address 2 =3D             =20
> 0x00000000
>>=20
>> base address 3 =3D              0x00000000
>> base address 4=20
> =3D             =20
>> 0x00000000
>> base address 5 =3D              0x00000000
>>=20
> cardBus CIS pointer=20
>> =3D         0x00000000
>> sub system vendor ID =3D       =20
> 0x0000
>> sub system ID=20
>> =3D               0x0000
>> expansion ROM base address=20
> =3D  0x00000000
>> interrupt=20
>> line =3D              0x00
>> interrupt pin=20
> =3D               0x01
>> min Grant=20
>> =3D                   0x00
>> max Latency=20
> =3D                 0x00
>>=20
>> =3D> pci 2 long
>>=20
>> Scanning PCI devices on bus 2
>>=20
>=20
>> Found PCI device 02.00.00:
>> vendor ID=20
>> =3D                   0x1957
>> device=20
> ID =3D                   0x0100
>> command=20
>> register =3D            0x0006
>>=20
> status register =3D             0x0010
>> revision=20
>> ID =3D                 0x11
>>=20
> class code =3D                  0x0b (Processor)
>>=20
>> sub class code=20
> =3D              0x20
>> programming interface =3D       0x00
>> cache=20
>> line=20
> =3D                  0x08
>> latency time =3D                0x00
>> header type=20
>=20
>> =3D                 0x01
>> BIST =3D                        0x00
>> base address=20
> 0=20
>> =3D              0xfff00000
>> base address 1 =3D              0x00000000
>>=20
> primary=20
>> bus number =3D          0x00
>> secondary bus number =3D        0x01
>>=20
> subordinate=20
>> bus number =3D      0x01
>> secondary latency timer =3D     0x00
>>=20
> IO base=20
>> =3D                     0x00
>> IO limit =3D                    0x00
>>=20
> secondary=20
>> status =3D            0x0000
>> memory base =3D                 0xb000
>=20
>> memory=20
>> limit =3D                0xb000
>> prefetch memory base =3D       =20
> 0x1001
>> prefetch=20
>> memory limit =3D       0x0001
>> prefetch memory base upper=20
> =3D  0x00000000
>>=20
>> prefetch memory limit upper =3D 0x00000000
>> IO base upper 16=20
> bits =3D       0x0000
>>=20
>> IO limit upper 16 bits =3D      0x0000
>> expansion ROM=20
> base address =3D =20
>> 0x00000000
>> interrupt line =3D              0x00
>> interrupt=20
> pin =3D              =20
>> 0x00
>> bridge control =3D              0x0000
>>=20
>> =3D> pci 3=20
> long
>> Scanning PCI devices=20
>> on bus 3
>>=20
>> Found PCI device 03.00.00:
>> vendor=20
> ID =3D                   0x1b65
>>=20
>> device ID =3D                   0xabba
>>=20
> command register =3D            0x0006
>>=20
>> status register =3D             0x0010
>=20
>> revision ID =3D                 0x01
>>=20
>> class code =3D                  0x02=20
> (Network controller)
>> sub class code=20
>> =3D              0x80
>> programming=20
> interface =3D       0x00
>> cache line=20
>> =3D                  0x08
>> latency time=20
> =3D                0x00
>> header type=20
>> =3D                 0x00
>> BIST=20
> =3D                        0x00
>> base address 0=20
>> =3D              0xb0000000
>>=20
> base address 1 =3D              0xb0010000
>> base=20
>> address 2 =3D             =20
> 0x00000000
>> base address 3 =3D              0x00000000
>>=20
>> base address 4=20
> =3D              0x00000000
>> base address 5 =3D             =20
>> 0x00000000
>>=20
> cardBus CIS pointer =3D         0x00000000
>> sub system vendor ID=20
>> =3D       =20
> 0x0000
>> sub system ID =3D               0x0000
>> expansion ROM base=20
>> address=20
> =3D  0x00000000
>> interrupt line =3D              0x00
>> interrupt pin=20
>=20
>> =3D               0x01
>> min Grant =3D                   0x00
>> max Latency=20
>=20
>> =3D                 0x00
>>=20
>>=20
>> *************
>> *    [3]    *
>> *************
>>=20
>>=20
> PCIE1=20
>> used as Root Complex (base addr ffe09000)
>> b=3D0 d=3D0 f=3D0 (fbusno=3D0=20
> itype=3D0=20
>> cfg_adr=3Dffe09000 cfg_data=3Dffe09004) ofs=3D10 mask=3D0
>> ...
>=20
>>              Scanning=20
>> PCI bus 01
>> b=3D1 d=3D0 f=3D0 (fbusno=3D0 itype=3D0=20
> cfg_adr=3Dffe09000 cfg_data=3Dffe09004)=20
>> ofs=3De mask=3D3
>> ...
>> b=3D1 d=3D0 f=3D0 (fbusno=3D0=20
> itype=3D0 cfg_adr=3Dffe09000=20
>> cfg_data=3Dffe09004) ofs=3D3c mask=3D3
>>       01  00 =20
> 1b65  abba  0280  00
>> b=3D1 d=3D1=20
>> f=3D0 (fbusno=3D0 itype=3D0 cfg_adr=3Dffe09000=20
> cfg_data=3Dffe09004) ofs=3De mask=3D3
>> b=3D1 d=3D1=20
>> f=3D0 (fbusno=3D0 itype=3D0=20
> cfg_adr=3Dffe09000 cfg_data=3Dffe09004) ofs=3D0 mask=3D2
>> ...
>> b=3D0=20
>> d=3D0 f=3D0 (fbusno=3D0=20
> itype=3D0 cfg_adr=3Dffe09000 cfg_data=3Dffe09004) ofs=3D9 mask=3D3
>>=20
>> PCIE1 on bus 00=20
> - 01
>>=20
>>   PCIE2 used as Root Complex (base addr ffe0a000)
>> b=3D0=20
>> d=3D0 f=3D0=20
> (fbusno=3D2 itype=3D0 cfg_adr=3Dffe0a000 cfg_data=3Dffe0a004) ofs=3D10 =
mask=3D0
>> b=3D0=20
>> d=3D0=20
> f=3D0 (fbusno=3D2 itype=3D0 cfg_adr=3Dffe0a000 cfg_data=3Dffe0a004) =
ofs=3D10 mask=3D0
>> ...
>>=20
>=20
>> b=3D0 d=3D0 f=3D0 (fbusno=3D2 itype=3D0 cfg_adr=3Dffe0a000 =
cfg_data=3Dffe0a004) ofs=3D9 mask=3D3
>=20
>>=20
>>              Scanning PCI bus 03
>> b=3D1 d=3D0 f=3D0 (fbusno=3D2 itype=3D0=20
>=20
>> cfg_adr=3Dffe0a000 cfg_data=3Dffe0a004) ofs=3De mask=3D3
>> b=3D1 d=3D0 f=3D0 (fbusno=3D2=20
> itype=3D0=20
>> cfg_adr=3Dffe0a000 cfg_data=3Dffe0a004) ofs=3D0 mask=3D2
>> ...
>> b=3D1 d=3D0 f=3D0=20
> (fbusno=3D2=20
>> itype=3D0 cfg_adr=3Dffe0a000 cfg_data=3Dffe0a004) ofs=3D3c mask=3D3
>>=20
> 03  00  1b65 =20
>> abba  0280  00
>>       cfg_addr:ffe0a000  cfg_data:ffe0a004 =20
> indirect_type:0
>>=20
>> b=3D1 d=3D1 f=3D0 (fbusno=3D2 itype=3D0 cfg_adr=3Dffe0a000=20
> cfg_data=3Dffe0a004) ofs=3De mask=3D3
>>=20
>> ...
>> b=3D0 d=3D0 f=3D0 (fbusno=3D2 itype=3D0=20
> cfg_adr=3Dffe0a000 cfg_data=3Dffe0a004) ofs=3D9=20
>> mask=3D3
>>   PCIE2 on bus 02 - 03
>>=20
>=20
>>=20
>>=20
>> Invita i tuoi amici e Tiscali ti premia! Il consiglio di un amico =
vale pi=F9=20
> di uno spot in TV. Per ogni nuovo abbonato 30 =80 di premio per te e =
per lui! Un=20
> amico al mese e parli e navighi sempre gratis: =
http://freelosophy.tiscali.it/
>=20
>=20
>=20
> Invita i tuoi amici e Tiscali ti premia! Il consiglio di un amico vale =
pi=F9 di uno spot in TV. Per ogni nuovo abbonato 30 =80 di premio per te =
e per lui! Un amico al mese e parli e navighi sempre gratis: =
http://freelosophy.tiscali.it/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Fwd: PCI device not working
       [not found]   ` <CAKpAL0m3YnsbbGxL+ejfyE4zfGE5LD9Qxb7oobHVaAZGE1_Jnw@mail.gmail.com>
@ 2012-10-05  8:54     ` Davide Viti
  2012-10-05 12:47       ` Kumar Gala
  0 siblings, 1 reply; 17+ messages in thread
From: Davide Viti @ 2012-10-05  8:54 UTC (permalink / raw)
  To: linuxppc-dev

(just realized I did not send this to the mailing list: sorry for the noise)

Hi Kumar,

2012/10/4 Kumar Gala <galak@kernel.crashing.org>:
>
> On Oct 4, 2012, at 7:24 AM, Davide Viti wrote:
>
>> Hi,
>> it turns out that if define CONFIG_PCI_NOSCAN in u-boot (as per [1]), the
>> device behind the second controller is detected by the  Linux kernel.
>>
>> Would
>> you suggest any particular patch I should apply to fix this (I'm using kernel
>> 2.6.34)
>>
>> thanx alot in advance
>> Davide
>>
>> [1] http://permalink.gmane.org/gmane.linux.ports.ppc.embedded/20140
>
> My suggestion would be to try and dump all the controller registers between the case that works and doesn't and compare.  There's some minor setting difference that I'm guessing is causing issues.
>
> - k

Here's a diff for the configurations for the controller, obtained via

hexdump -C /sys/bus/pci/devices/0001\:02\:00.0/config

--- cfg0_2_NOK.txt      2012-10-05 09:37:44.854607000 +0200
+++ cfg0_2_OK.txt       2012-10-05 09:36:58.337399000 +0200

 00000400  00 00 00 00 16 00 00 00  e2 04 00 00 00 00 00 00  |................|
 00000410  04 00 00 00 01 00 00 00  00 00 00 00 40 40 00 00  |............@@..|
 00000420  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
-00000430  00 00 00 00 00 00 00 00  21 81 9e 00 1a 90 01 00  |........!.......|
+00000430  00 00 00 00 00 00 00 00  21 81 9e 00 83 20 08 00  |........!.... ..|
 00000440  10 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 00000450  ce d7 14 00 20 1e fc 01  00 00 00 00 5c 0c 00 00  |.... .......\...|
 00000460  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 00000470  57 19 00 01 11 00 20 0b  00 00 00 00 01 00 00 00  |W..... .........|
 00000480  44 3d 00 00 00 00 00 00  f0 07 00 00 00 00 00 00  |D=..............|
 00000490  c0 07 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
-000004a0  00 00 00 00 00 00 00 00  00 00 00 00 3c 01 00 00  |............<...|
+000004a0  00 00 00 00 00 00 00 00  00 00 00 00 7e 01 00 00  |............~...|
 000004b0  00 00 00 00 00 00 00 00  28 04 01 80 85 20 00 00  |........(.... ..|
 000004c0  ff 00 00 00 00 00 00 00  00 00 00 00 11 00 00 00  |................|
 000004d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 000004e0  00 00 00 00 01 01 00 00  01 01 00 00 00 00 00 00  |................|
-000004f0  0a 00 00 00 01 00 20 04  00 00 00 00 79 47 0e eb  |...... .....yG..|
+000004f0  4a 00 00 01 03 00 00 04  00 00 00 00 01 00 01 00  |J...............|
 00000500  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
 00000510  00 00 00 00 00 00 00 00  21 01 00 00 00 00 00 00  |........!.......|
 00000520  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

Hope this mail client will not screw up the text...
Just in case,
I've pasted the entire register dumps to [1].

thank you so much for your time,
D.

[1] http://pastebin.com/zzAtzCeS

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: PCI device not working
  2012-10-05  8:54     ` Fwd: " Davide Viti
@ 2012-10-05 12:47       ` Kumar Gala
  2012-10-25  8:21         ` Davide
  2012-10-31  8:52         ` Davide
  0 siblings, 2 replies; 17+ messages in thread
From: Kumar Gala @ 2012-10-05 12:47 UTC (permalink / raw)
  To: Davide Viti; +Cc: linuxppc-dev


On Oct 5, 2012, at 3:54 AM, Davide Viti wrote:

> (just realized I did not send this to the mailing list: sorry for the =
noise)
>=20
> Hi Kumar,
>=20
> 2012/10/4 Kumar Gala <galak@kernel.crashing.org>:
>>=20
>> On Oct 4, 2012, at 7:24 AM, Davide Viti wrote:
>>=20
>>> Hi,
>>> it turns out that if define CONFIG_PCI_NOSCAN in u-boot (as per =
[1]), the
>>> device behind the second controller is detected by the  Linux =
kernel.
>>>=20
>>> Would
>>> you suggest any particular patch I should apply to fix this (I'm =
using kernel
>>> 2.6.34)
>>>=20
>>> thanx alot in advance
>>> Davide
>>>=20
>>> [1] http://permalink.gmane.org/gmane.linux.ports.ppc.embedded/20140
>>=20
>> My suggestion would be to try and dump all the controller registers =
between the case that works and doesn't and compare.  There's some minor =
setting difference that I'm guessing is causing issues.
>>=20
>> - k

When I said controller registers, I meant the FSL PCI controller and the =
CCSR registers not the PCI cfg register space

- k=

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: PCI device not working
  2012-10-05 12:47       ` Kumar Gala
@ 2012-10-25  8:21         ` Davide
  2012-10-31  8:52         ` Davide
  1 sibling, 0 replies; 17+ messages in thread
From: Davide @ 2012-10-25  8:21 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev

Hi Kumar,

On Fri, Oct 05, 2012 at 07:47:24AM -0500, Kumar Gala wrote:
> 
> On Oct 5, 2012, at 3:54 AM, Davide Viti wrote:
> 
> >> On Oct 4, 2012, at 7:24 AM, Davide Viti wrote:
> >> 
> >>> Hi,
> >>> it turns out that if define CONFIG_PCI_NOSCAN in u-boot (as per [1]), the
> >>> device behind the second controller is detected by the  Linux kernel.
> >>> 
> >>> Would
> >>> you suggest any particular patch I should apply to fix this (I'm using kernel
> >>> 2.6.34)
> >>> 
> >>> thanx alot in advance
> >>> Davide
> >>> 
> >>> [1] http://permalink.gmane.org/gmane.linux.ports.ppc.embedded/20140
> >> 
> >> My suggestion would be to try and dump all the controller registers between the case that works and doesn't and compare.  There's some minor setting difference that I'm guessing is causing issues.
> >> 
> >> - k
> 
> When I said controller registers, I meant the FSL PCI controller and the CCSR registers not the PCI cfg register space
> 

I've collected a complete dump of the registers in the working and not working cases

0x9000: 0x80000048 (not working) -> 0x8003007c (ok)
0x9004: 0x00000000 (not working) -> 0x08000000 (ok)

According to the p1020 manual, the register fall in the PCI Express controller 2 area,
in particular:

0x9000 PEX_CONFIG_ADDR—PCI Express configuration address register
0x9004 PEX_CONFIG_DATA—PCI Express configuration data register

does that ring any bell?

thank you in advance
Davide

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: PCI device not working
  2012-10-05 12:47       ` Kumar Gala
  2012-10-25  8:21         ` Davide
@ 2012-10-31  8:52         ` Davide
  1 sibling, 0 replies; 17+ messages in thread
From: Davide @ 2012-10-31  8:52 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev

Hi Kumar,
I try to summarize the problem in the hope to fix it for good:
Linux Kernel (2.6.34-6) did not detect one of the two pci devices
that instead u-boot could "see".
This was worakounded by defining CONFIG_PCI_NOSCAN in u-boot as per [1]

To find out the root cause of the problem, you've suggested to dump all 
the controller registers between the case that works and doesn't and 
see what changes.

Te following registers have different values in the faulty situation (u-boot 
compiled without CONFIG_PCI_NOSCAN definition) vs the working case (u-boot
compiled with CONFIG_PCI_NOSCAN defined):

0x9000: 0x80000048 (not working) -> 0x8003007c (ok)
0x9004: 0x00000000 (not working) -> 0x08000000 (ok)

The register values were obtained with the devmem utility.

Thanx very much for your help,
Davide

[1] http://permalink.gmane.org/gmane.linux.ports.ppc.embedded/20140

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: PCI device not working
  2012-09-27 13:14 R: " Davide Viti
@ 2012-09-27 16:06 ` Kumar Gala
  0 siblings, 0 replies; 17+ messages in thread
From: Kumar Gala @ 2012-09-27 16:06 UTC (permalink / raw)
  To: Davide Viti; +Cc: linuxppc-dev


On Sep 27, 2012, at 8:14 AM, Davide Viti wrote:

> Hi Kumar,
>=20
>> ----Messaggio originale----
>> Da: galak@kernel.crashing.org
>> Data:=20
> 27/09/2012 14.27
>> A: "Davide Viti"<zinosat@tiscali.it>
>> Cc: <linuxppc-dev@lists.
> ozlabs.org>
>> Ogg: Re: PCI device not working
>>=20
> ...
>> Can you see what bus_no=20
> actually gets set to in the case we scan 0001:03 ?
>>=20
>> If its set to 03, can you=20
> try hack it to 1.
>=20
> is this what you mean?

It was, can you figure out in u-boot what exact config read on the bus =
would return the correct thing.

The fact that when we probe the device at 0001:03 we should get back =
something like cfg_data=3D0xabba1b65

- k

>=20
> ---=20
> a/arch/powerpc/sysdev/indirect_pci.c
> +++ b/arch/powerpc/sysdev/indirect_pci.c
>=20
>=20
>        bus_no =3D (bus->number =3D=3D hose->first_busno) ?
>=20
> hose->self_busno : bus->number;
>=20
> +       if (bus_no =3D=3D 3) {
> +         printk
> ("*** force bus_no 3 -> 1 ***\n");
> +         bus_no =3D 1;
> +       }
> +
>=20
>=20
> I've=20
> tested a kernel with the above patch and this is what is printed on =
the log:
>=20
>=20
> pci_bus 0001:03: scanning bus
> -> ind_r_config - [/pcie@ffe0a000] devfn=3D0x0=20
> offset=3D0x0 len=3D0x4 hose->indirect_type=3D0x16 =
hose->first_busno=3D0x2 bus-
>> number=3D0x3
> *** force bus_no 3 -> 1 ***
> -> ind_r_config [/pcie@ffe0a000] -=20
> (bus_no=3D0x1 reg=3D0x0 cfg_data=3D0xff7eb004 len=3D0x4 =
hose->cfg_addr=3D0xff7eb000)=20
> val=3D0xffffffff PCIBIOS_SUCCESSFUL
>=20
> the entire log (132Kb) is available in [1]=20
> and [2]
>=20
> thanx for your help,
> Davide
>=20
> [1] http://pastebin.com/3mcbDzwY
> [2] http:
> //paste2.org/p/2274032
>=20
>=20
>=20
> Invita i tuoi amici e Tiscali ti premia! Il consiglio di un amico vale =
pi=F9 di uno spot in TV. Per ogni nuovo abbonato 30 =80 di premio per te =
e per lui! Un amico al mese e parli e navighi sempre gratis: =
http://freelosophy.tiscali.it/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: PCI device not working
  2012-09-27 11:43 R: " Davide Viti
@ 2012-09-27 12:27 ` Kumar Gala
  0 siblings, 0 replies; 17+ messages in thread
From: Kumar Gala @ 2012-09-27 12:27 UTC (permalink / raw)
  To: Davide Viti; +Cc: linuxppc-dev


On Sep 27, 2012, at 6:43 AM, Davide Viti wrote:

> Hi,
>=20
>> So its odd that scanning of the second bus didn't report any devices. =
 Do=20
> you have code that implements ppc_md.pci_exclude_device ?
>=20
> not that I'm aware=20
> of
>=20
>> You might also want to put some code in the indirect PCI ops =
(indirect.c)=20
> to see what actual values you are getting from various =
indirect_read_config()=20
> calls.
>=20
> To make sure that  ppc_md.pci_exclude_device is not implemented, I've=20=

> put some printouts inside  indirect_read_config(): I print various =
parameters=20
> when the function is called, and when it returns and note that:
>=20
> 1.=20
> indirect_read_config() is called 422 times:=20
>     174 times for=20
> [/pcie@ffe0a000] (controller where the device is not detected)
>     248 times=20
> for [/pcie@ffe09000]=20
> 2. ppc_md.pci_exclude_device is always NULL
> 3. the=20
> function always returns with PCIBIOS_SUCCESSFUL
> 4. the only call to =20
> indirect_read_config() inside which  bus_no=3D0x3, returns with the =
following=20
> log:
>=20
> pci_bus 0001:03: scanning bus
> -> ind_r_config - [/pcie@ffe0a000]=20
> devfn=3D0x0 len=3D0x4 hose->indirect_type=3D0x16 hose->first_busno=3D0x2=
 bus-
>> number=3D0x3
> -> ind_r_config [/pcie@ffe0a000] - (bus_no=3D0x3 reg=3D0x0=20
> cfg_data=3D0xffffffff len=3D0xff7eb004) val=3D0x4 PCIBIOS_SUCCESSFUL =20=


Can you see what bus_no actually gets set to in the case we scan 0001:03 =
?

If its set to 03, can you try hack it to 1.

- k

>=20
> the entire=20
> log is about 116Kb and is available in [1] or [2] (didn't feel like =
pasting so=20
> much data on the ML)
> thanx alot,
>=20
> Davide
>=20
> [1] http://pastebin.com/JaPGmmfs
> [2]=20
> http://paste2.org/p/2273728
>=20
>=20
> Invita i tuoi amici e Tiscali ti premia! Il consiglio di un amico vale =
pi=F9 di uno spot in TV. Per ogni nuovo abbonato 30 =80 di premio per te =
e per lui! Un amico al mese e parli e navighi sempre gratis: =
http://freelosophy.tiscali.it/

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: PCI device not working
  2012-09-26 15:25           ` Davide Viti
@ 2012-09-27  2:30             ` Kumar Gala
  0 siblings, 0 replies; 17+ messages in thread
From: Kumar Gala @ 2012-09-27  2:30 UTC (permalink / raw)
  To: Davide Viti; +Cc: linuxppc-dev


On Sep 26, 2012, at 10:25 AM, Davide Viti wrote:

> Hi,
> as you've suggested, I've added a printout inside =
fsl_pcie_check_link() which is called twice and returns 0 both times.
> Here follows the PCI-related part of dmesg with some extra printouts =
enabled.
>=20
> thank you,
> Davide

So its odd that scanning of the second bus didn't report any devices.  =
Do you have code that implements ppc_md.pci_exclude_device ?

If so, what does it do?

You might also want to put some code in the indirect PCI ops =
(indirect.c) to see what actual values you are getting from various =
indirect_read_config() calls.

- k

>=20
> ...
> Adding PCI host bridge /pcie@ffe09000
> *** [/pcie@ffe09000] fsl_pcie_check_link() val=3D0x16 =3D> return 0
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Found FSL PCI host bridge at 0x00000000ffe09000. Firmware bus number: =
0->255
>  ->Hose at 0xc05a2000, cfg_addr=3D0xff7fd000,cfg_data=3D0xff7fd004
> PCI host bridge /pcie@ffe09000  ranges:
>  MEM 0x00000000a0000000..0x00000000afffffff -> 0x00000000a0000000=20
>   IO 0x00000000ffc10000..0x00000000ffc1ffff -> 0x0000000000000000
> PCI memory map start 0x00000000ffe09000, size 0x0000000000001000
> PCI MEM resource start 0x00000000a0000000, size 0x0000000010000000.
> PCI IO resource start 0x0000000000000000, size 0x0000000000010000, phy =
base 0x00000000ffc10000.
> /pcie@ffe09000: PCICSRBAR @ 0xfff00000
>=20
> Adding PCI host bridge /pcie@ffe0a000
> *** [/pcie@ffe0a000] fsl_pcie_check_link() val=3D0x16 =3D> return 0
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Found FSL PCI host bridge at 0x00000000ffe0a000. Firmware bus number: =
0->255
>  ->Hose at 0xc05a20e0, cfg_addr=3D0xff7eb000,cfg_data=3D0xff7eb004
> PCI host bridge /pcie@ffe0a000  ranges:
>  MEM 0x00000000b0000000..0x00000000bfffffff -> 0x00000000b0000000=20
>   IO 0x00000000ffc00000..0x00000000ffc0ffff -> 0x0000000000000000
> PCI memory map start 0x00000000ffe0a000, size 0x0000000000001000
> PCI MEM resource start 0x00000000b0000000, size 0x0000000010000000.
> PCI IO resource start 0x0000000000000000, size 0x0000000000010000, phy =
base 0x00000000ffc00000.
> /pcie@ffe0a000: PCICSRBAR @ 0xfff00000
>=20
> ...
>=20
> PCI: Probing PCI hardware
> PCI: Scanning PHB /pcie@ffe09000
> PCI: PHB IO resource    =3D 00000000ff7ed000-00000000ff7fcfff [100]
> PCI: PHB MEM resource 0 =3D 00000000a0000000-00000000afffffff [200]
> PCI: PHB MEM offset     =3D 0000000000000000
> PCI: PHB IO  offset     =3D ff7ed000
>     probe mode: 0
> pci_bus 0000:00: scanning bus
> pci 0000:00:00.0: found [1957:0100] class 000b20 header type 01
> pci 0000:00:00.0: ignoring class b20 (doesn't match header type 01)
> pci 0000:00:00.0: calling fixup_hide_host_resource_fsl+0x0/0x54
> pci 0000:00:00.0: calling pcibios_fixup_resources+0x0/0x19c
> pci 0000:00:00.0: calling quirk_fsl_pcie_header+0x0/0x50
> pci 0000:00:00.0: calling quirk_resource_alignment+0x0/0x1a8
> pci 0000:00:00.0: supports D1 D2
> pci 0000:00:00.0: PME# supported from D0 D1 D2 D3hot D3cold
> pci 0000:00:00.0: PME# disabled
> pci_bus 0000:00: fixups for bus
> PCI: Fixup bus devices 0 (PHB)
> pci_busdev_to_OF_node(0,0x0)
>  parent is /pcie@ffe09000
> *** scan_OF_for_pci_dev() reg[0]: 0x0  psize:0x14 devfn:0x0
>  result is /pcie@ffe09000/pcie@0
> PCI: Try to map irq for 0000:00:00.0...
> pci_busdev_to_OF_node(0,0x0)
>  parent is /pcie@ffe09000
> *** scan_OF_for_pci_dev() reg[0]: 0x0  psize:0x14 devfn:0x0
>  result is /pcie@ffe09000/pcie@0
> pci 0000:00:00.0: scanning [bus 01-01] behind bridge, pass 0
> pci 0000:00:00.0: scanning [bus 00-00] behind bridge, pass 1
> pci_bus 0000:01: scanning bus
> pci 0000:01:00.0: found [1b65:abba] class 000280 header type 00
> pci 0000:01:00.0: reg 10: [mem 0xa0000000-0xa00003ff]
> pci 0000:01:00.0: reg 14: [mem 0xa0010000-0xa001ffff]
> pci 0000:01:00.0: calling pcibios_fixup_resources+0x0/0x19c
> PCI:0000:01:00.0 Resource 0 00000000a0000000-00000000a00003ff [40200] =
fixup...
> PCI:0000:01:00.0            00000000a0000000-00000000a00003ff
> PCI:0000:01:00.0 Resource 1 00000000a0010000-00000000a001ffff [40200] =
fixup...
> PCI:0000:01:00.0            00000000a0010000-00000000a001ffff
> pci 0000:01:00.0: calling quirk_resource_alignment+0x0/0x1a8
> pci_bus 0000:01: fixups for bus
> pci 0000:00:00.0: PCI bridge to [bus 01-ff]
> pci 0000:00:00.0:   bridge window [io  0x0000-0x0000] (disabled)
> pci 0000:00:00.0:   bridge window [mem 0xa0000000-0xa00fffff]
> pci 0000:00:00.0:   bridge window [mem 0x10000000-0x000fffff pref] =
(disabled)
> PCI:0000:00:00.0 Bus rsrc 1 00000000a0000000-00000000a00fffff [200] =
fixup...
> PCI:0000:00:00.0            00000000a0000000-00000000a00fffff
> PCI: Fixup bus devices 1 (0000:00:00.0)
> pci_busdev_to_OF_node(1,0x0)
> *** scan_OF_for_pci_dev() reg[0]: 0x0  psize:0x14 devfn:0x0
>  parent is /pcie@ffe09000/pcie@0
>  result is <NULL>
> PCI: Try to map irq for 0000:01:00.0...
> pci_busdev_to_OF_node(1,0x0)
> *** scan_OF_for_pci_dev() reg[0]: 0x0  psize:0x14 devfn:0x0
>  parent is /pcie@ffe09000/pcie@0
>  result is <NULL>
> pci_busdev_to_OF_node(0,0x0)
>  parent is /pcie@ffe09000
> *** scan_OF_for_pci_dev() reg[0]: 0x0  psize:0x14 devfn:0x0
>  result is /pcie@ffe09000/pcie@0
>  Got one, spec 1 cells (0x00000001 0xffffffff...) on =
/soc@ffe00000/pic@40000
>   alloc irq_desc for 16 on node 0
>   alloc kstat_irqs on node 0
> irq: irq 1 on host /soc@ffe00000/pic@40000 mapped to virtual irq 16
>  Mapped to linux irq 16
> pci_bus 0000:01: bus scan returning with max=3D01
> pci_bus 0000:00: bus scan returning with max=3D01
> PCI: Scanning PHB /pcie@ffe0a000
> PCI: PHB IO resource    =3D 00000000ff7db000-00000000ff7eafff [100]
> PCI: PHB MEM resource 0 =3D 00000000b0000000-00000000bfffffff [200]
> PCI: PHB MEM offset     =3D 0000000000000000
> PCI: PHB IO  offset     =3D ff7db000
>     probe mode: 0
> pci_bus 0001:02: scanning bus
> pci 0001:02:00.0: found [1957:0100] class 000b20 header type 01
> pci 0001:02:00.0: ignoring class b20 (doesn't match header type 01)
> pci 0001:02:00.0: calling fixup_hide_host_resource_fsl+0x0/0x54
> pci 0001:02:00.0: calling pcibios_fixup_resources+0x0/0x19c
> pci 0001:02:00.0: calling quirk_fsl_pcie_header+0x0/0x50
> pci 0001:02:00.0: calling quirk_resource_alignment+0x0/0x1a8
> pci 0001:02:00.0: supports D1 D2
> pci 0001:02:00.0: PME# supported from D0 D1 D2 D3hot D3cold
> pci 0001:02:00.0: PME# disabled
> pci_bus 0001:02: fixups for bus
> PCI: Fixup bus devices 2 (PHB)
> pci_busdev_to_OF_node(2,0x0)
>  parent is /pcie@ffe0a000
> *** scan_OF_for_pci_dev() reg[0]: 0x0  psize:0x14 devfn:0x0
>  result is /pcie@ffe0a000/pcie@0
> PCI: Try to map irq for 0001:02:00.0...
> pci_busdev_to_OF_node(2,0x0)
>  parent is /pcie@ffe0a000
> *** scan_OF_for_pci_dev() reg[0]: 0x0  psize:0x14 devfn:0x0
>  result is /pcie@ffe0a000/pcie@0
> pci 0001:02:00.0: scanning [bus 01-01] behind bridge, pass 0
> pci 0001:02:00.0: bus configuration invalid, reconfiguring
> pci 0001:02:00.0: scanning [bus 00-00] behind bridge, pass 1
> pci_bus 0001:03: scanning bus
> pci_bus 0001:03: fixups for bus
> pci 0001:02:00.0: PCI bridge to [bus 03-ff]
> pci 0001:02:00.0:   bridge window [io  0x0000-0x0000] (disabled)
> pci 0001:02:00.0:   bridge window [mem 0xb0000000-0xb00fffff]
> pci 0001:02:00.0:   bridge window [mem 0x10000000-0x000fffff pref] =
(disabled)
> PCI:0001:02:00.0 Bus rsrc 1 00000000b0000000-00000000b00fffff [200] =
fixup...
> PCI:0001:02:00.0            00000000b0000000-00000000b00fffff
> PCI: Fixup bus devices 3 (0001:02:00.0)
> pci_bus 0001:03: bus scan returning with max=3D03
> pci_bus 0001:02: bus scan returning with max=3D03
> PCI->OF bus map (pci_bus_count=3D4):
> 0 -> 0
> 2 -> 0
> PCI: Allocating bus resources for 0000:00...
> PCI: PHB (bus 0) bridge rsrc 0: 00000000ff7ed000-00000000ff7fcfff =
[0x100], parent c04cd81c (PCI IO)
> PCI: PHB (bus 0) bridge rsrc 1: 00000000a0000000-00000000afffffff =
[0x200], parent c04cd800 (PCI mem)
> PCI: Allocating bus resources for 0000:01...
> PCI: 0000:00:00.0 (bus 1) bridge rsrc 0: =
00000000ff7ed000-00000000ff7fcfff [0x100], parent c05a204c =
(/pcie@ffe09000)
> PCI: 0000:00:00.0 (bus 1) bridge rsrc 1: =
00000000a0000000-00000000afffffff [0x200], parent c05a2068 =
(/pcie@ffe09000)
> PCI: Allocating bus resources for 0001:02...
> PCI: PHB (bus 2) bridge rsrc 0: 00000000ff7db000-00000000ff7eafff =
[0x100], parent c04cd81c (PCI IO)
> PCI: PHB (bus 2) bridge rsrc 1: 00000000b0000000-00000000bfffffff =
[0x200], parent c04cd800 (PCI mem)
> PCI: Allocating bus resources for 0001:03...
> PCI: 0001:02:00.0 (bus 3) bridge rsrc 0: =
00000000ff7db000-00000000ff7eafff [0x100], parent c05a212c =
(/pcie@ffe0a000)
> PCI: 0001:02:00.0 (bus 3) bridge rsrc 1: =
00000000b0000000-00000000bfffffff [0x200], parent c05a2148 =
(/pcie@ffe0a000)
> PCI: Allocating 0000:01:00.0: Resource 0: =
00000000a0000000..00000000a00003ff [40200]
> PCI: Allocating 0000:01:00.0: Resource 1: =
00000000a0010000..00000000a001ffff [40200]
> Reserving legacy ranges for domain 0000
> Candidate legacy IO: [io  0xff7ed000-0xff7edfff]
> PCI 0000:00 Cannot reserve Legacy IO [io  0xff7ed000-0xff7edfff]
> hose mem offset: 0000000000000000
> hose mem res: [mem 0xa0000000-0xafffffff]
> Reserving legacy ranges for domain 0001
> Candidate legacy IO: [io  0xff7db000-0xff7dbfff]
> PCI 0001:02 Cannot reserve Legacy IO [io  0xff7db000-0xff7dbfff]
> hose mem offset: 0000000000000000
> hose mem res: [mem 0xb0000000-0xbfffffff]
> PCI: Assigning unassigned resources...
> pci 0000:00:00.0: PCI bridge to [bus 01-01]
> pci 0000:00:00.0:   bridge window [io  0xff7ed000-0xff7fcfff]
> pci 0000:00:00.0:   bridge window [mem 0xa0000000-0xafffffff]
> pci 0000:00:00.0:   bridge window [mem pref disabled]
> pci 0000:00:00.0: enabling device (0106 -> 0107)
> pci 0001:02:00.0: PCI bridge to [bus 03-03]
> pci 0001:02:00.0:   bridge window [io  0xff7db000-0xff7eafff]
> pci 0001:02:00.0:   bridge window [mem 0xb0000000-0xbfffffff]
> pci 0001:02:00.0:   bridge window [mem pref disabled]
> pci 0001:02:00.0: enabling device (0106 -> 0107)
> pci_bus 0000:00: resource 0 [io  0xff7ed000-0xff7fcfff]
> pci_bus 0000:00: resource 1 [mem 0xa0000000-0xafffffff]
> pci_bus 0000:01: resource 0 [io  0xff7ed000-0xff7fcfff]
> pci_bus 0000:01: resource 1 [mem 0xa0000000-0xafffffff]
> pci_bus 0001:02: resource 0 [io  0xff7db000-0xff7eafff]
> pci_bus 0001:02: resource 1 [mem 0xb0000000-0xbfffffff]
> pci_bus 0001:03: resource 0 [io  0xff7db000-0xff7eafff]
> pci_bus 0001:03: resource 1 [mem 0xb0000000-0xbfffffff]
> bio: create slab <bio-0> at 0
> vgaarb: loaded
> SCSI subsystem initialized
> libata version 3.00 loaded.
> Freescale Elo / Elo Plus DMA driver
> Switching to clocksource timebase
> NET: Registered protocol family 2
>=20
> pci 0000:00:00.0: calling quirk_cardbus_legacy+0x0/0x50
> pci 0000:00:00.0: calling quirk_usb_early_handoff+0x0/0x6ac
> pci 0000:01:00.0: calling quirk_cardbus_legacy+0x0/0x50
> pci 0000:01:00.0: calling quirk_usb_early_handoff+0x0/0x6ac
> pci 0001:02:00.0: calling quirk_cardbus_legacy+0x0/0x50
> pci 0001:02:00.0: calling quirk_usb_early_handoff+0x0/0x6ac
>=20
>=20
> 2012/9/26 Kumar Gala <galak@kernel.crashing.org>
>=20
> > 2012/9/24 Davide Viti <zinosat@tiscali.it>
> > Hi,
> > does the output I've included show anything wrong or should I post =
something else to help identifying the cause of the problem?
> >
> > thank you in advance,
> > Davide
> >
> > 2012/9/21 Davide Viti <zinosat@tiscali.it>
> > I mean there are two controllers and both of them have a device =
"subtended" (both 0x1b65:0xabba).
> > u-boot can see both devices, linux detects only the device attached =
to the first controller.
> >
> > Here's the output of lspci and /proc/iomem :
> >
> > root@(none):/# lspci -v
> >
> > 0000:00:00.0 Class 0604: Device 1957:0100 (rev 11)
> >
> >         Flags: bus master, fast devsel, latency 0
> >
> >         Memory at <ignored> (32-bit, non-prefetchable)
> >
> >         Bus: primary=3D00, secondary=3D01, subordinate=3D01, =
sec-latency=3D0
> >
> >         I/O behind bridge: 00000000-00000fff
> >
> >         Memory behind bridge: a0000000-afffffff
> >
> >         Capabilities: [44] Power Management version 2
> >
> >         Capabilities: [4c] Express Root Port (Slot-), MSI 00
> >
> >         Capabilities: [100] Advanced Error Reporting
> >
> >
> > 0000:01:00.0 Class 0280: Device 1b65:abba (rev 01)
> >
> >         Flags: bus master, fast devsel, latency 0, IRQ 16
> >
> >         Memory at a0000000 (32-bit, non-prefetchable) [size=3D1K]
> >
> >         Memory at a0010000 (32-bit, non-prefetchable) [size=3D64K]
> >
> >         Capabilities: [50] MSI: Enable- Count=3D1/1 Maskable- 64bit+
> >
> >         Capabilities: [78] Power Management version 3
> >
> >         Capabilities: [80] Express Endpoint, MSI 00
> >
> >         Capabilities: [100] Virtual Channel <?>
> >
> >         Capabilities: [800] Advanced Error Reporting
> >
> >
> > 0001:02:00.0 Class 0604: Device 1957:0100 (rev 11)
> >
> >         Flags: bus master, fast devsel, latency 0
> >
> >         Memory at <ignored> (32-bit, non-prefetchable)
> >
> >         Bus: primary=3D00, secondary=3D03, subordinate=3D03, =
sec-latency=3D0
> >
> >         I/O behind bridge: 00000000-00000fff
> >
> >         Memory behind bridge: b0000000-bfffffff
> >
> >         Capabilities: [44] Power Management version 2
> >
> >         Capabilities: [4c] Express Root Port (Slot-), MSI 00
> >
> >         Capabilities: [100] Advanced Error Reporting
>=20
> Its possible that in linux the 2nd controller does not believe it has =
link status.  Can you see if there is a function like =
fsl_pcie_check_link() in your kernel.  If so maybe add a printk debug =
message there and see what gets return.
>=20
> Also helpful to post a full boot log.
>=20
> >
> >
> >
> >
> > root@(none):/# cat /proc/iomem
> >
> > a0000000-afffffff : /pcie@ffe09000
> >
> >   a0000000-afffffff : PCI Bus 0000:01
> >
> >     a0000000-a00003ff : 0000:01:00.0
> >
> >     a0010000-a001ffff : 0000:01:00.0
> >
> > b0000000-bfffffff : /pcie@ffe0a000
> >
> >   b0000000-bfffffff : PCI Bus 0001:03
> >
> > ef000000-efffffff : ef000000.nor
> >
> > ffe04500-ffe04507 : serial
> >
> > ffe04600-ffe04607 : serial
> >
> >
> >
> > thanx for your help,
> >
> > Davide
> >
> >
> >
> >
> > I mean that the kernel detects the first controller and the device =
attached to it, plus the second controller: the device on the second =
controller is not detected (same device as the one detected on the first =
controller)
> >
> > 2012/9/21 Kumar Gala <galak@kernel.crashing.org>
> >
> > On Sep 21, 2012, at 6:33 AM, Davide Viti wrote:
> >
> > > Hi,
> > > I'm working on a custom board based on P1020 with two (identical) =
PCI devices attached;
> > > The work is derived from another board with a single instance of =
that device.
> > > The system is based on u-boot-2009.11 and Linux 2.6.34.6
> > >
> > > The "pci" command on u-boot, shows me both the PCI controllers and
> > > the attached devices:
> > >
> > > Scanning PCI devices on bus 0
> > > BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
> > > _____________________________________________________________
> > > 00.00.00   0x1957     0x0100     Processor               0x20
> > >
> > > Scanning PCI devices on bus 1
> > > BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
> > > _____________________________________________________________
> > > 01.00.00   0x1b65     0xabba     Network controller      0x80
> > >
> > > Scanning PCI devices on bus 2
> > > BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
> > > _____________________________________________________________
> > > 02.00.00   0x1957     0x0100     Processor               0x20
> > >
> > > Scanning PCI devices on bus 3
> > > BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
> > > _____________________________________________________________
> > > 03.00.00   0x1b65     0xabba     Network controller      0x80
> > >
> > > The kernel detects only the first instance of the device.
> >
> > What do you mean by first instance of the device ?
> >
> > > Didn't get very far while looking at dts file and kernel logs, so =
I'm
> > > asking for some help on narrowing down the problem.
> > >
> > > I'm wondering if I can assume that the problem is restricted to
> > > kernel/dts and avoid concentrating on uboot.
> > > I can provide any log (didn't want to post tons of details on the =
first
> > > message)
> >
> > Probably a dts issue.
> >
> > What does lspci in linux say?
> >
> > - k
> >
> >
> >
> >
> > _______________________________________________
> > Linuxppc-dev mailing list
> > Linuxppc-dev@lists.ozlabs.org
> > https://lists.ozlabs.org/listinfo/linuxppc-dev
>=20
>=20

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: PCI device not working
  2012-09-26 13:44         ` Kumar Gala
@ 2012-09-26 15:25           ` Davide Viti
  2012-09-27  2:30             ` Kumar Gala
  0 siblings, 1 reply; 17+ messages in thread
From: Davide Viti @ 2012-09-26 15:25 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev

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

Hi,
as you've suggested, I've added a printout inside fsl_pcie_check_link()
which is called twice and returns 0 both times.
Here follows the PCI-related part of dmesg with some extra printouts
enabled.

thank you,
Davide

...
Adding PCI host bridge /pcie@ffe09000
*** [/pcie@ffe09000] fsl_pcie_check_link() val=0x16 => return 0
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Found FSL PCI host bridge at 0x00000000ffe09000. Firmware bus number: 0->255
 ->Hose at 0xc05a2000, cfg_addr=0xff7fd000,cfg_data=0xff7fd004
PCI host bridge /pcie@ffe09000  ranges:
 MEM 0x00000000a0000000..0x00000000afffffff -> 0x00000000a0000000
  IO 0x00000000ffc10000..0x00000000ffc1ffff -> 0x0000000000000000
PCI memory map start 0x00000000ffe09000, size 0x0000000000001000
PCI MEM resource start 0x00000000a0000000, size 0x0000000010000000.
PCI IO resource start 0x0000000000000000, size 0x0000000000010000, phy base
0x00000000ffc10000.
/pcie@ffe09000: PCICSRBAR @ 0xfff00000

Adding PCI host bridge /pcie@ffe0a000
*** [/pcie@ffe0a000] fsl_pcie_check_link() val=0x16 => return 0
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Found FSL PCI host bridge at 0x00000000ffe0a000. Firmware bus number: 0->255
 ->Hose at 0xc05a20e0, cfg_addr=0xff7eb000,cfg_data=0xff7eb004
PCI host bridge /pcie@ffe0a000  ranges:
 MEM 0x00000000b0000000..0x00000000bfffffff -> 0x00000000b0000000
  IO 0x00000000ffc00000..0x00000000ffc0ffff -> 0x0000000000000000
PCI memory map start 0x00000000ffe0a000, size 0x0000000000001000
PCI MEM resource start 0x00000000b0000000, size 0x0000000010000000.
PCI IO resource start 0x0000000000000000, size 0x0000000000010000, phy base
0x00000000ffc00000.
/pcie@ffe0a000: PCICSRBAR @ 0xfff00000

...

PCI: Probing PCI hardware
PCI: Scanning PHB /pcie@ffe09000
PCI: PHB IO resource    = 00000000ff7ed000-00000000ff7fcfff [100]
PCI: PHB MEM resource 0 = 00000000a0000000-00000000afffffff [200]
PCI: PHB MEM offset     = 0000000000000000
PCI: PHB IO  offset     = ff7ed000
    probe mode: 0
pci_bus 0000:00: scanning bus
pci 0000:00:00.0: found [1957:0100] class 000b20 header type 01
pci 0000:00:00.0: ignoring class b20 (doesn't match header type 01)
pci 0000:00:00.0: calling fixup_hide_host_resource_fsl+0x0/0x54
pci 0000:00:00.0: calling pcibios_fixup_resources+0x0/0x19c
pci 0000:00:00.0: calling quirk_fsl_pcie_header+0x0/0x50
pci 0000:00:00.0: calling quirk_resource_alignment+0x0/0x1a8
pci 0000:00:00.0: supports D1 D2
pci 0000:00:00.0: PME# supported from D0 D1 D2 D3hot D3cold
pci 0000:00:00.0: PME# disabled
pci_bus 0000:00: fixups for bus
PCI: Fixup bus devices 0 (PHB)
pci_busdev_to_OF_node(0,0x0)
 parent is /pcie@ffe09000
*** scan_OF_for_pci_dev() reg[0]: 0x0  psize:0x14 devfn:0x0
 result is /pcie@ffe09000/pcie@0
PCI: Try to map irq for 0000:00:00.0...
pci_busdev_to_OF_node(0,0x0)
 parent is /pcie@ffe09000
*** scan_OF_for_pci_dev() reg[0]: 0x0  psize:0x14 devfn:0x0
 result is /pcie@ffe09000/pcie@0
pci 0000:00:00.0: scanning [bus 01-01] behind bridge, pass 0
pci 0000:00:00.0: scanning [bus 00-00] behind bridge, pass 1
pci_bus 0000:01: scanning bus
pci 0000:01:00.0: found [1b65:abba] class 000280 header type 00
pci 0000:01:00.0: reg 10: [mem 0xa0000000-0xa00003ff]
pci 0000:01:00.0: reg 14: [mem 0xa0010000-0xa001ffff]
pci 0000:01:00.0: calling pcibios_fixup_resources+0x0/0x19c
PCI:0000:01:00.0 Resource 0 00000000a0000000-00000000a00003ff [40200]
fixup...
PCI:0000:01:00.0            00000000a0000000-00000000a00003ff
PCI:0000:01:00.0 Resource 1 00000000a0010000-00000000a001ffff [40200]
fixup...
PCI:0000:01:00.0            00000000a0010000-00000000a001ffff
pci 0000:01:00.0: calling quirk_resource_alignment+0x0/0x1a8
pci_bus 0000:01: fixups for bus
pci 0000:00:00.0: PCI bridge to [bus 01-ff]
pci 0000:00:00.0:   bridge window [io  0x0000-0x0000] (disabled)
pci 0000:00:00.0:   bridge window [mem 0xa0000000-0xa00fffff]
pci 0000:00:00.0:   bridge window [mem 0x10000000-0x000fffff pref]
(disabled)
PCI:0000:00:00.0 Bus rsrc 1 00000000a0000000-00000000a00fffff [200] fixup...
PCI:0000:00:00.0            00000000a0000000-00000000a00fffff
PCI: Fixup bus devices 1 (0000:00:00.0)
pci_busdev_to_OF_node(1,0x0)
*** scan_OF_for_pci_dev() reg[0]: 0x0  psize:0x14 devfn:0x0
 parent is /pcie@ffe09000/pcie@0
 result is <NULL>
PCI: Try to map irq for 0000:01:00.0...
pci_busdev_to_OF_node(1,0x0)
*** scan_OF_for_pci_dev() reg[0]: 0x0  psize:0x14 devfn:0x0
 parent is /pcie@ffe09000/pcie@0
 result is <NULL>
pci_busdev_to_OF_node(0,0x0)
 parent is /pcie@ffe09000
*** scan_OF_for_pci_dev() reg[0]: 0x0  psize:0x14 devfn:0x0
 result is /pcie@ffe09000/pcie@0
 Got one, spec 1 cells (0x00000001 0xffffffff...) on /soc@ffe00000/pic@40000
  alloc irq_desc for 16 on node 0
  alloc kstat_irqs on node 0
irq: irq 1 on host /soc@ffe00000/pic@40000 mapped to virtual irq 16
 Mapped to linux irq 16
pci_bus 0000:01: bus scan returning with max=01
pci_bus 0000:00: bus scan returning with max=01
PCI: Scanning PHB /pcie@ffe0a000
PCI: PHB IO resource    = 00000000ff7db000-00000000ff7eafff [100]
PCI: PHB MEM resource 0 = 00000000b0000000-00000000bfffffff [200]
PCI: PHB MEM offset     = 0000000000000000
PCI: PHB IO  offset     = ff7db000
    probe mode: 0
pci_bus 0001:02: scanning bus
pci 0001:02:00.0: found [1957:0100] class 000b20 header type 01
pci 0001:02:00.0: ignoring class b20 (doesn't match header type 01)
pci 0001:02:00.0: calling fixup_hide_host_resource_fsl+0x0/0x54
pci 0001:02:00.0: calling pcibios_fixup_resources+0x0/0x19c
pci 0001:02:00.0: calling quirk_fsl_pcie_header+0x0/0x50
pci 0001:02:00.0: calling quirk_resource_alignment+0x0/0x1a8
pci 0001:02:00.0: supports D1 D2
pci 0001:02:00.0: PME# supported from D0 D1 D2 D3hot D3cold
pci 0001:02:00.0: PME# disabled
pci_bus 0001:02: fixups for bus
PCI: Fixup bus devices 2 (PHB)
pci_busdev_to_OF_node(2,0x0)
 parent is /pcie@ffe0a000
*** scan_OF_for_pci_dev() reg[0]: 0x0  psize:0x14 devfn:0x0
 result is /pcie@ffe0a000/pcie@0
PCI: Try to map irq for 0001:02:00.0...
pci_busdev_to_OF_node(2,0x0)
 parent is /pcie@ffe0a000
*** scan_OF_for_pci_dev() reg[0]: 0x0  psize:0x14 devfn:0x0
 result is /pcie@ffe0a000/pcie@0
pci 0001:02:00.0: scanning [bus 01-01] behind bridge, pass 0
pci 0001:02:00.0: bus configuration invalid, reconfiguring
pci 0001:02:00.0: scanning [bus 00-00] behind bridge, pass 1
pci_bus 0001:03: scanning bus
pci_bus 0001:03: fixups for bus
pci 0001:02:00.0: PCI bridge to [bus 03-ff]
pci 0001:02:00.0:   bridge window [io  0x0000-0x0000] (disabled)
pci 0001:02:00.0:   bridge window [mem 0xb0000000-0xb00fffff]
pci 0001:02:00.0:   bridge window [mem 0x10000000-0x000fffff pref]
(disabled)
PCI:0001:02:00.0 Bus rsrc 1 00000000b0000000-00000000b00fffff [200] fixup...
PCI:0001:02:00.0            00000000b0000000-00000000b00fffff
PCI: Fixup bus devices 3 (0001:02:00.0)
pci_bus 0001:03: bus scan returning with max=03
pci_bus 0001:02: bus scan returning with max=03
PCI->OF bus map (pci_bus_count=4):
0 -> 0
2 -> 0
PCI: Allocating bus resources for 0000:00...
PCI: PHB (bus 0) bridge rsrc 0: 00000000ff7ed000-00000000ff7fcfff [0x100],
parent c04cd81c (PCI IO)
PCI: PHB (bus 0) bridge rsrc 1: 00000000a0000000-00000000afffffff [0x200],
parent c04cd800 (PCI mem)
PCI: Allocating bus resources for 0000:01...
PCI: 0000:00:00.0 (bus 1) bridge rsrc 0: 00000000ff7ed000-00000000ff7fcfff
[0x100], parent c05a204c (/pcie@ffe09000)
PCI: 0000:00:00.0 (bus 1) bridge rsrc 1: 00000000a0000000-00000000afffffff
[0x200], parent c05a2068 (/pcie@ffe09000)
PCI: Allocating bus resources for 0001:02...
PCI: PHB (bus 2) bridge rsrc 0: 00000000ff7db000-00000000ff7eafff [0x100],
parent c04cd81c (PCI IO)
PCI: PHB (bus 2) bridge rsrc 1: 00000000b0000000-00000000bfffffff [0x200],
parent c04cd800 (PCI mem)
PCI: Allocating bus resources for 0001:03...
PCI: 0001:02:00.0 (bus 3) bridge rsrc 0: 00000000ff7db000-00000000ff7eafff
[0x100], parent c05a212c (/pcie@ffe0a000)
PCI: 0001:02:00.0 (bus 3) bridge rsrc 1: 00000000b0000000-00000000bfffffff
[0x200], parent c05a2148 (/pcie@ffe0a000)
PCI: Allocating 0000:01:00.0: Resource 0:
00000000a0000000..00000000a00003ff [40200]
PCI: Allocating 0000:01:00.0: Resource 1:
00000000a0010000..00000000a001ffff [40200]
Reserving legacy ranges for domain 0000
Candidate legacy IO: [io  0xff7ed000-0xff7edfff]
PCI 0000:00 Cannot reserve Legacy IO [io  0xff7ed000-0xff7edfff]
hose mem offset: 0000000000000000
hose mem res: [mem 0xa0000000-0xafffffff]
Reserving legacy ranges for domain 0001
Candidate legacy IO: [io  0xff7db000-0xff7dbfff]
PCI 0001:02 Cannot reserve Legacy IO [io  0xff7db000-0xff7dbfff]
hose mem offset: 0000000000000000
hose mem res: [mem 0xb0000000-0xbfffffff]
PCI: Assigning unassigned resources...
pci 0000:00:00.0: PCI bridge to [bus 01-01]
pci 0000:00:00.0:   bridge window [io  0xff7ed000-0xff7fcfff]
pci 0000:00:00.0:   bridge window [mem 0xa0000000-0xafffffff]
pci 0000:00:00.0:   bridge window [mem pref disabled]
pci 0000:00:00.0: enabling device (0106 -> 0107)
pci 0001:02:00.0: PCI bridge to [bus 03-03]
pci 0001:02:00.0:   bridge window [io  0xff7db000-0xff7eafff]
pci 0001:02:00.0:   bridge window [mem 0xb0000000-0xbfffffff]
pci 0001:02:00.0:   bridge window [mem pref disabled]
pci 0001:02:00.0: enabling device (0106 -> 0107)
pci_bus 0000:00: resource 0 [io  0xff7ed000-0xff7fcfff]
pci_bus 0000:00: resource 1 [mem 0xa0000000-0xafffffff]
pci_bus 0000:01: resource 0 [io  0xff7ed000-0xff7fcfff]
pci_bus 0000:01: resource 1 [mem 0xa0000000-0xafffffff]
pci_bus 0001:02: resource 0 [io  0xff7db000-0xff7eafff]
pci_bus 0001:02: resource 1 [mem 0xb0000000-0xbfffffff]
pci_bus 0001:03: resource 0 [io  0xff7db000-0xff7eafff]
pci_bus 0001:03: resource 1 [mem 0xb0000000-0xbfffffff]
bio: create slab <bio-0> at 0
vgaarb: loaded
SCSI subsystem initialized
libata version 3.00 loaded.
Freescale Elo / Elo Plus DMA driver
Switching to clocksource timebase
NET: Registered protocol family 2

pci 0000:00:00.0: calling quirk_cardbus_legacy+0x0/0x50
pci 0000:00:00.0: calling quirk_usb_early_handoff+0x0/0x6ac
pci 0000:01:00.0: calling quirk_cardbus_legacy+0x0/0x50
pci 0000:01:00.0: calling quirk_usb_early_handoff+0x0/0x6ac
pci 0001:02:00.0: calling quirk_cardbus_legacy+0x0/0x50
pci 0001:02:00.0: calling quirk_usb_early_handoff+0x0/0x6ac


2012/9/26 Kumar Gala <galak@kernel.crashing.org>

>
> > 2012/9/24 Davide Viti <zinosat@tiscali.it>
> > Hi,
> > does the output I've included show anything wrong or should I post
> something else to help identifying the cause of the problem?
> >
> > thank you in advance,
> > Davide
> >
> > 2012/9/21 Davide Viti <zinosat@tiscali.it>
> > I mean there are two controllers and both of them have a device
> "subtended" (both 0x1b65:0xabba).
> > u-boot can see both devices, linux detects only the device attached to
> the first controller.
> >
> > Here's the output of lspci and /proc/iomem :
> >
> > root@(none):/# lspci -v
> >
> > 0000:00:00.0 Class 0604: Device 1957:0100 (rev 11)
> >
> >         Flags: bus master, fast devsel, latency 0
> >
> >         Memory at <ignored> (32-bit, non-prefetchable)
> >
> >         Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
> >
> >         I/O behind bridge: 00000000-00000fff
> >
> >         Memory behind bridge: a0000000-afffffff
> >
> >         Capabilities: [44] Power Management version 2
> >
> >         Capabilities: [4c] Express Root Port (Slot-), MSI 00
> >
> >         Capabilities: [100] Advanced Error Reporting
> >
> >
> > 0000:01:00.0 Class 0280: Device 1b65:abba (rev 01)
> >
> >         Flags: bus master, fast devsel, latency 0, IRQ 16
> >
> >         Memory at a0000000 (32-bit, non-prefetchable) [size=1K]
> >
> >         Memory at a0010000 (32-bit, non-prefetchable) [size=64K]
> >
> >         Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
> >
> >         Capabilities: [78] Power Management version 3
> >
> >         Capabilities: [80] Express Endpoint, MSI 00
> >
> >         Capabilities: [100] Virtual Channel <?>
> >
> >         Capabilities: [800] Advanced Error Reporting
> >
> >
> > 0001:02:00.0 Class 0604: Device 1957:0100 (rev 11)
> >
> >         Flags: bus master, fast devsel, latency 0
> >
> >         Memory at <ignored> (32-bit, non-prefetchable)
> >
> >         Bus: primary=00, secondary=03, subordinate=03, sec-latency=0
> >
> >         I/O behind bridge: 00000000-00000fff
> >
> >         Memory behind bridge: b0000000-bfffffff
> >
> >         Capabilities: [44] Power Management version 2
> >
> >         Capabilities: [4c] Express Root Port (Slot-), MSI 00
> >
> >         Capabilities: [100] Advanced Error Reporting
>
> Its possible that in linux the 2nd controller does not believe it has link
> status.  Can you see if there is a function like fsl_pcie_check_link() in
> your kernel.  If so maybe add a printk debug message there and see what
> gets return.
>
> Also helpful to post a full boot log.
>
> >
> >
> >
> >
> > root@(none):/# cat /proc/iomem
> >
> > a0000000-afffffff : /pcie@ffe09000
> >
> >   a0000000-afffffff : PCI Bus 0000:01
> >
> >     a0000000-a00003ff : 0000:01:00.0
> >
> >     a0010000-a001ffff : 0000:01:00.0
> >
> > b0000000-bfffffff : /pcie@ffe0a000
> >
> >   b0000000-bfffffff : PCI Bus 0001:03
> >
> > ef000000-efffffff : ef000000.nor
> >
> > ffe04500-ffe04507 : serial
> >
> > ffe04600-ffe04607 : serial
> >
> >
> >
> > thanx for your help,
> >
> > Davide
> >
> >
> >
> >
> > I mean that the kernel detects the first controller and the device
> attached to it, plus the second controller: the device on the second
> controller is not detected (same device as the one detected on the first
> controller)
> >
> > 2012/9/21 Kumar Gala <galak@kernel.crashing.org>
> >
> > On Sep 21, 2012, at 6:33 AM, Davide Viti wrote:
> >
> > > Hi,
> > > I'm working on a custom board based on P1020 with two (identical) PCI
> devices attached;
> > > The work is derived from another board with a single instance of that
> device.
> > > The system is based on u-boot-2009.11 and Linux 2.6.34.6
> > >
> > > The "pci" command on u-boot, shows me both the PCI controllers and
> > > the attached devices:
> > >
> > > Scanning PCI devices on bus 0
> > > BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
> > > _____________________________________________________________
> > > 00.00.00   0x1957     0x0100     Processor               0x20
> > >
> > > Scanning PCI devices on bus 1
> > > BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
> > > _____________________________________________________________
> > > 01.00.00   0x1b65     0xabba     Network controller      0x80
> > >
> > > Scanning PCI devices on bus 2
> > > BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
> > > _____________________________________________________________
> > > 02.00.00   0x1957     0x0100     Processor               0x20
> > >
> > > Scanning PCI devices on bus 3
> > > BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
> > > _____________________________________________________________
> > > 03.00.00   0x1b65     0xabba     Network controller      0x80
> > >
> > > The kernel detects only the first instance of the device.
> >
> > What do you mean by first instance of the device ?
> >
> > > Didn't get very far while looking at dts file and kernel logs, so I'm
> > > asking for some help on narrowing down the problem.
> > >
> > > I'm wondering if I can assume that the problem is restricted to
> > > kernel/dts and avoid concentrating on uboot.
> > > I can provide any log (didn't want to post tons of details on the first
> > > message)
> >
> > Probably a dts issue.
> >
> > What does lspci in linux say?
> >
> > - k
> >
> >
> >
> >
> > _______________________________________________
> > Linuxppc-dev mailing list
> > Linuxppc-dev@lists.ozlabs.org
> > https://lists.ozlabs.org/listinfo/linuxppc-dev
>
>

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

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: PCI device not working
  2012-09-24 20:59       ` Davide Viti
@ 2012-09-26 13:44         ` Kumar Gala
  2012-09-26 15:25           ` Davide Viti
  0 siblings, 1 reply; 17+ messages in thread
From: Kumar Gala @ 2012-09-26 13:44 UTC (permalink / raw)
  To: Davide Viti; +Cc: linuxppc-dev


> 2012/9/24 Davide Viti <zinosat@tiscali.it>
> Hi,
> does the output I've included show anything wrong or should I post =
something else to help identifying the cause of the problem?
>=20
> thank you in advance,
> Davide
>=20
> 2012/9/21 Davide Viti <zinosat@tiscali.it>
> I mean there are two controllers and both of them have a device =
"subtended" (both 0x1b65:0xabba).
> u-boot can see both devices, linux detects only the device attached to =
the first controller.
>=20
> Here's the output of lspci and /proc/iomem :
>=20
> root@(none):/# lspci -v
>=20
> 0000:00:00.0 Class 0604: Device 1957:0100 (rev 11)
>=20
>         Flags: bus master, fast devsel, latency 0
>=20
>         Memory at <ignored> (32-bit, non-prefetchable)
>=20
>         Bus: primary=3D00, secondary=3D01, subordinate=3D01, =
sec-latency=3D0
>=20
>         I/O behind bridge: 00000000-00000fff
>=20
>         Memory behind bridge: a0000000-afffffff
>=20
>         Capabilities: [44] Power Management version 2
>=20
>         Capabilities: [4c] Express Root Port (Slot-), MSI 00
>=20
>         Capabilities: [100] Advanced Error Reporting
>=20
> =20
> 0000:01:00.0 Class 0280: Device 1b65:abba (rev 01)
>=20
>         Flags: bus master, fast devsel, latency 0, IRQ 16
>=20
>         Memory at a0000000 (32-bit, non-prefetchable) [size=3D1K]
>=20
>         Memory at a0010000 (32-bit, non-prefetchable) [size=3D64K]
>=20
>         Capabilities: [50] MSI: Enable- Count=3D1/1 Maskable- 64bit+
>=20
>         Capabilities: [78] Power Management version 3
>=20
>         Capabilities: [80] Express Endpoint, MSI 00
>=20
>         Capabilities: [100] Virtual Channel <?>
>=20
>         Capabilities: [800] Advanced Error Reporting
>=20
> =20
> 0001:02:00.0 Class 0604: Device 1957:0100 (rev 11)
>=20
>         Flags: bus master, fast devsel, latency 0
>=20
>         Memory at <ignored> (32-bit, non-prefetchable)
>=20
>         Bus: primary=3D00, secondary=3D03, subordinate=3D03, =
sec-latency=3D0
>=20
>         I/O behind bridge: 00000000-00000fff
>=20
>         Memory behind bridge: b0000000-bfffffff
>=20
>         Capabilities: [44] Power Management version 2
>=20
>         Capabilities: [4c] Express Root Port (Slot-), MSI 00
>=20
>         Capabilities: [100] Advanced Error Reporting

Its possible that in linux the 2nd controller does not believe it has =
link status.  Can you see if there is a function like =
fsl_pcie_check_link() in your kernel.  If so maybe add a printk debug =
message there and see what gets return.

Also helpful to post a full boot log.

>=20
>=20
>=20
>=20
> root@(none):/# cat /proc/iomem
>=20
> a0000000-afffffff : /pcie@ffe09000
>=20
>   a0000000-afffffff : PCI Bus 0000:01
>=20
>     a0000000-a00003ff : 0000:01:00.0
>=20
>     a0010000-a001ffff : 0000:01:00.0
>=20
> b0000000-bfffffff : /pcie@ffe0a000
>=20
>   b0000000-bfffffff : PCI Bus 0001:03
>=20
> ef000000-efffffff : ef000000.nor
>=20
> ffe04500-ffe04507 : serial
>=20
> ffe04600-ffe04607 : serial
>=20
>=20
>=20
> thanx for your help,
>=20
> Davide
>=20
>=20
>=20
>=20
> I mean that the kernel detects the first controller and the device =
attached to it, plus the second controller: the device on the second =
controller is not detected (same device as the one detected on the first =
controller)
>=20
> 2012/9/21 Kumar Gala <galak@kernel.crashing.org>
>=20
> On Sep 21, 2012, at 6:33 AM, Davide Viti wrote:
>=20
> > Hi,
> > I'm working on a custom board based on P1020 with two (identical) =
PCI devices attached;
> > The work is derived from another board with a single instance of =
that device.
> > The system is based on u-boot-2009.11 and Linux 2.6.34.6
> >
> > The "pci" command on u-boot, shows me both the PCI controllers and
> > the attached devices:
> >
> > Scanning PCI devices on bus 0
> > BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
> > _____________________________________________________________
> > 00.00.00   0x1957     0x0100     Processor               0x20
> >
> > Scanning PCI devices on bus 1
> > BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
> > _____________________________________________________________
> > 01.00.00   0x1b65     0xabba     Network controller      0x80
> >
> > Scanning PCI devices on bus 2
> > BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
> > _____________________________________________________________
> > 02.00.00   0x1957     0x0100     Processor               0x20
> >
> > Scanning PCI devices on bus 3
> > BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
> > _____________________________________________________________
> > 03.00.00   0x1b65     0xabba     Network controller      0x80
> >
> > The kernel detects only the first instance of the device.
>=20
> What do you mean by first instance of the device ?
>=20
> > Didn't get very far while looking at dts file and kernel logs, so =
I'm
> > asking for some help on narrowing down the problem.
> >
> > I'm wondering if I can assume that the problem is restricted to
> > kernel/dts and avoid concentrating on uboot.
> > I can provide any log (didn't want to post tons of details on the =
first
> > message)
>=20
> Probably a dts issue.
>=20
> What does lspci in linux say?
>=20
> - k
>=20
>=20
>=20
>=20
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: PCI device not working
  2012-09-24 13:27     ` Davide Viti
@ 2012-09-24 20:59       ` Davide Viti
  2012-09-26 13:44         ` Kumar Gala
  0 siblings, 1 reply; 17+ messages in thread
From: Davide Viti @ 2012-09-24 20:59 UTC (permalink / raw)
  To: linuxppc-dev

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

Here are the settings for PCI we currently have in uboot:

#define CONFIG_PCI                              1    /* Enable PCI/PCIE */
#define CONFIG_PCIE1                          1    /* PCIE controler 1
(slot 1) */
#define CONFIG_PCIE2                          1    /* PCIE controler 2
(slot 2) */
#define CONFIG_FSL_PCI_INIT               1    /* Use common FSL init code
*/
#define CONFIG_FSL_PCIE_RESET       1    /* need PCIe reset errata */
#define CONFIG_FSL_LAW                    1    /* Use common FSL init code
*/

#define CONFIG_SYS_PCIE1_ADDR        (CONFIG_SYS_CCSRBAR+0x9000)
#define CONFIG_SYS_PCIE2_ADDR        (CONFIG_SYS_CCSRBAR+0xa000)

/*
 * General PCI
 */

#define CONFIG_SYS_PCIE1_MEM_VIRT           0xA0000000
#define CONFIG_SYS_PCIE1_MEM_BUS           0xA0000000
#define CONFIG_SYS_PCIE1_MEM_PHYS         0xA0000000
#define CONFIG_SYS_PCIE1_MEM_SIZE           0x10000000
#define CONFIG_SYS_PCIE1_IO_VIRT               0xFFC10000
#define CONFIG_SYS_PCIE1_IO_BUS                0x00000000
#define CONFIG_SYS_PCIE1_IO_PHYS             0xFFC10000
#define CONFIG_SYS_PCIE1_IO_SIZE               0x00010000        /* 64k */

#define CONFIG_SYS_PCIE2_MEM_VIRT           0xB0000000
#define CONFIG_SYS_PCIE2_MEM_BUS           0xB0000000
#define CONFIG_SYS_PCIE2_MEM_PHYS         0xB0000000
#define CONFIG_SYS_PCIE2_MEM_SIZE           0x10000000
#define CONFIG_SYS_PCIE2_IO_VIRT               0xFFC00000
#define CONFIG_SYS_PCIE2_IO_BUS                0x00000000
#define CONFIG_SYS_PCIE2_IO_PHYS             0xFFC00000
#define CONFIG_SYS_PCIE2_IO_SIZE               0x00010000        /* 64k */

I'd really appreciate I you could take a look at it
Thanx alot in advance

Davide

2012/9/24 Davide Viti <zinosat@tiscali.it>

> Hi,
> does the output I've included show anything wrong or should I post
> something else to help identifying the cause of the problem?
>
> thank you in advance,
> Davide
>
> 2012/9/21 Davide Viti <zinosat@tiscali.it>
>
>> I mean there are two controllers and both of them have a device
>> "subtended" (both 0x1b65:0xabba).
>> u-boot can see both devices, linux detects only the device attached to
>> the first controller.
>>
>> Here's the output of lspci and /proc/iomem :
>>
>> root@(none):/# lspci -v
>>
>> 0000:00:00.0 Class 0604: Device 1957:0100 (rev 11)
>>
>>         Flags: bus master, fast devsel, latency 0
>>
>>         Memory at <ignored> (32-bit, non-prefetchable)
>>
>>         Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
>>
>>         I/O behind bridge: 00000000-00000fff
>>
>>         Memory behind bridge: a0000000-afffffff
>>
>>         Capabilities: [44] Power Management version 2
>>
>>         Capabilities: [4c] Express Root Port (Slot-), MSI 00
>>
>>         Capabilities: [100] Advanced Error Reporting
>>
>>
>>
>> 0000:01:00.0 Class 0280: Device 1b65:abba (rev 01)
>>
>>         Flags: bus master, fast devsel, latency 0, IRQ 16
>>
>>         Memory at a0000000 (32-bit, non-prefetchable) [size=1K]
>>
>>         Memory at a0010000 (32-bit, non-prefetchable) [size=64K]
>>
>>         Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
>>
>>         Capabilities: [78] Power Management version 3
>>
>>         Capabilities: [80] Express Endpoint, MSI 00
>>
>>         Capabilities: [100] Virtual Channel <?>
>>
>>         Capabilities: [800] Advanced Error Reporting
>>
>>
>>
>> 0001:02:00.0 Class 0604: Device 1957:0100 (rev 11)
>>
>>         Flags: bus master, fast devsel, latency 0
>>
>>         Memory at <ignored> (32-bit, non-prefetchable)
>>
>>         Bus: primary=00, secondary=03, subordinate=03, sec-latency=0
>>
>>         I/O behind bridge: 00000000-00000fff
>>
>>         Memory behind bridge: b0000000-bfffffff
>>
>>         Capabilities: [44] Power Management version 2
>>
>>         Capabilities: [4c] Express Root Port (Slot-), MSI 00
>>
>>         Capabilities: [100] Advanced Error Reporting
>>
>>
>> root@(none):/# cat /proc/iomem
>>
>> a0000000-afffffff : /pcie@ffe09000
>>
>>   a0000000-afffffff : PCI Bus 0000:01
>>
>>     a0000000-a00003ff : 0000:01:00.0
>>
>>     a0010000-a001ffff : 0000:01:00.0
>>
>> b0000000-bfffffff : /pcie@ffe0a000
>>
>>   b0000000-bfffffff : PCI Bus 0001:03
>>
>> ef000000-efffffff : ef000000.nor
>>
>> ffe04500-ffe04507 : serial
>>
>> ffe04600-ffe04607 : serial
>>
>>
>> thanx for your help,
>>
>> Davide
>>
>>
>> I mean that the kernel detects the first controller and the device
>> attached to it, plus the second controller: the device on the second
>> controller is not detected (same device as the one detected on the first
>> controller)
>>
>> 2012/9/21 Kumar Gala <galak@kernel.crashing.org>
>>
>>>
>>> On Sep 21, 2012, at 6:33 AM, Davide Viti wrote:
>>>
>>> > Hi,
>>> > I'm working on a custom board based on P1020 with two (identical) PCI
>>> devices attached;
>>> > The work is derived from another board with a single instance of that
>>> device.
>>> > The system is based on u-boot-2009.11 and Linux 2.6.34.6
>>> >
>>> > The "pci" command on u-boot, shows me both the PCI controllers and
>>> > the attached devices:
>>> >
>>> > Scanning PCI devices on bus 0
>>> > BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
>>> > _____________________________________________________________
>>> > 00.00.00   0x1957     0x0100     Processor               0x20
>>> >
>>> > Scanning PCI devices on bus 1
>>> > BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
>>> > _____________________________________________________________
>>> > 01.00.00   0x1b65     0xabba     Network controller      0x80
>>> >
>>> > Scanning PCI devices on bus 2
>>> > BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
>>> > _____________________________________________________________
>>> > 02.00.00   0x1957     0x0100     Processor               0x20
>>> >
>>> > Scanning PCI devices on bus 3
>>> > BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
>>> > _____________________________________________________________
>>> > 03.00.00   0x1b65     0xabba     Network controller      0x80
>>> >
>>> > The kernel detects only the first instance of the device.
>>>
>>> What do you mean by first instance of the device ?
>>>
>>> > Didn't get very far while looking at dts file and kernel logs, so I'm
>>> > asking for some help on narrowing down the problem.
>>> >
>>> > I'm wondering if I can assume that the problem is restricted to
>>> > kernel/dts and avoid concentrating on uboot.
>>> > I can provide any log (didn't want to post tons of details on the first
>>> > message)
>>>
>>> Probably a dts issue.
>>>
>>> What does lspci in linux say?
>>>
>>> - k
>>>
>>>
>>
>

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

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: PCI device not working
  2012-09-21 14:06   ` Davide Viti
  2012-09-24 13:25     ` Davide Viti
@ 2012-09-24 13:27     ` Davide Viti
  2012-09-24 20:59       ` Davide Viti
  1 sibling, 1 reply; 17+ messages in thread
From: Davide Viti @ 2012-09-24 13:27 UTC (permalink / raw)
  To: linuxppc-dev

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

Hi,
does the output I've included show anything wrong or should I post
something else to help identifying the cause of the problem?

thank you in advance,
Davide

2012/9/21 Davide Viti <zinosat@tiscali.it>

> I mean there are two controllers and both of them have a device
> "subtended" (both 0x1b65:0xabba).
> u-boot can see both devices, linux detects only the device attached to the
> first controller.
>
> Here's the output of lspci and /proc/iomem :
>
> root@(none):/# lspci -v
>
> 0000:00:00.0 Class 0604: Device 1957:0100 (rev 11)
>
>         Flags: bus master, fast devsel, latency 0
>
>         Memory at <ignored> (32-bit, non-prefetchable)
>
>         Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
>
>         I/O behind bridge: 00000000-00000fff
>
>         Memory behind bridge: a0000000-afffffff
>
>         Capabilities: [44] Power Management version 2
>
>         Capabilities: [4c] Express Root Port (Slot-), MSI 00
>
>         Capabilities: [100] Advanced Error Reporting
>
>
>
> 0000:01:00.0 Class 0280: Device 1b65:abba (rev 01)
>
>         Flags: bus master, fast devsel, latency 0, IRQ 16
>
>         Memory at a0000000 (32-bit, non-prefetchable) [size=1K]
>
>         Memory at a0010000 (32-bit, non-prefetchable) [size=64K]
>
>         Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
>
>         Capabilities: [78] Power Management version 3
>
>         Capabilities: [80] Express Endpoint, MSI 00
>
>         Capabilities: [100] Virtual Channel <?>
>
>         Capabilities: [800] Advanced Error Reporting
>
>
>
> 0001:02:00.0 Class 0604: Device 1957:0100 (rev 11)
>
>         Flags: bus master, fast devsel, latency 0
>
>         Memory at <ignored> (32-bit, non-prefetchable)
>
>         Bus: primary=00, secondary=03, subordinate=03, sec-latency=0
>
>         I/O behind bridge: 00000000-00000fff
>
>         Memory behind bridge: b0000000-bfffffff
>
>         Capabilities: [44] Power Management version 2
>
>         Capabilities: [4c] Express Root Port (Slot-), MSI 00
>
>         Capabilities: [100] Advanced Error Reporting
>
>
> root@(none):/# cat /proc/iomem
>
> a0000000-afffffff : /pcie@ffe09000
>
>   a0000000-afffffff : PCI Bus 0000:01
>
>     a0000000-a00003ff : 0000:01:00.0
>
>     a0010000-a001ffff : 0000:01:00.0
>
> b0000000-bfffffff : /pcie@ffe0a000
>
>   b0000000-bfffffff : PCI Bus 0001:03
>
> ef000000-efffffff : ef000000.nor
>
> ffe04500-ffe04507 : serial
>
> ffe04600-ffe04607 : serial
>
>
> thanx for your help,
>
> Davide
>
>
> I mean that the kernel detects the first controller and the device
> attached to it, plus the second controller: the device on the second
> controller is not detected (same device as the one detected on the first
> controller)
>
> 2012/9/21 Kumar Gala <galak@kernel.crashing.org>
>
>>
>> On Sep 21, 2012, at 6:33 AM, Davide Viti wrote:
>>
>> > Hi,
>> > I'm working on a custom board based on P1020 with two (identical) PCI
>> devices attached;
>> > The work is derived from another board with a single instance of that
>> device.
>> > The system is based on u-boot-2009.11 and Linux 2.6.34.6
>> >
>> > The "pci" command on u-boot, shows me both the PCI controllers and
>> > the attached devices:
>> >
>> > Scanning PCI devices on bus 0
>> > BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
>> > _____________________________________________________________
>> > 00.00.00   0x1957     0x0100     Processor               0x20
>> >
>> > Scanning PCI devices on bus 1
>> > BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
>> > _____________________________________________________________
>> > 01.00.00   0x1b65     0xabba     Network controller      0x80
>> >
>> > Scanning PCI devices on bus 2
>> > BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
>> > _____________________________________________________________
>> > 02.00.00   0x1957     0x0100     Processor               0x20
>> >
>> > Scanning PCI devices on bus 3
>> > BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
>> > _____________________________________________________________
>> > 03.00.00   0x1b65     0xabba     Network controller      0x80
>> >
>> > The kernel detects only the first instance of the device.
>>
>> What do you mean by first instance of the device ?
>>
>> > Didn't get very far while looking at dts file and kernel logs, so I'm
>> > asking for some help on narrowing down the problem.
>> >
>> > I'm wondering if I can assume that the problem is restricted to
>> > kernel/dts and avoid concentrating on uboot.
>> > I can provide any log (didn't want to post tons of details on the first
>> > message)
>>
>> Probably a dts issue.
>>
>> What does lspci in linux say?
>>
>> - k
>>
>>
>

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

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: PCI device not working
  2012-09-21 14:06   ` Davide Viti
@ 2012-09-24 13:25     ` Davide Viti
  2012-09-24 13:27     ` Davide Viti
  1 sibling, 0 replies; 17+ messages in thread
From: Davide Viti @ 2012-09-24 13:25 UTC (permalink / raw)
  To: linuxppc-dev

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

2012/9/21 Davide Viti <zinosat@tiscali.it>

> I mean there are two controllers and both of them have a device
> "subtended" (both 0x1b65:0xabba).
> u-boot can see both devices, linux detects only the device attached to the
> first controller.
>
> Here's the output of lspci and /proc/iomem :
>
> root@(none):/# lspci -v
>
> 0000:00:00.0 Class 0604: Device 1957:0100 (rev 11)
>
>         Flags: bus master, fast devsel, latency 0
>
>         Memory at <ignored> (32-bit, non-prefetchable)
>
>         Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
>
>         I/O behind bridge: 00000000-00000fff
>
>         Memory behind bridge: a0000000-afffffff
>
>         Capabilities: [44] Power Management version 2
>
>         Capabilities: [4c] Express Root Port (Slot-), MSI 00
>
>         Capabilities: [100] Advanced Error Reporting
>
>
>
> 0000:01:00.0 Class 0280: Device 1b65:abba (rev 01)
>
>         Flags: bus master, fast devsel, latency 0, IRQ 16
>
>         Memory at a0000000 (32-bit, non-prefetchable) [size=1K]
>
>         Memory at a0010000 (32-bit, non-prefetchable) [size=64K]
>
>         Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
>
>         Capabilities: [78] Power Management version 3
>
>         Capabilities: [80] Express Endpoint, MSI 00
>
>         Capabilities: [100] Virtual Channel <?>
>
>         Capabilities: [800] Advanced Error Reporting
>
>
>
> 0001:02:00.0 Class 0604: Device 1957:0100 (rev 11)
>
>         Flags: bus master, fast devsel, latency 0
>
>         Memory at <ignored> (32-bit, non-prefetchable)
>
>         Bus: primary=00, secondary=03, subordinate=03, sec-latency=0
>
>         I/O behind bridge: 00000000-00000fff
>
>         Memory behind bridge: b0000000-bfffffff
>
>         Capabilities: [44] Power Management version 2
>
>         Capabilities: [4c] Express Root Port (Slot-), MSI 00
>
>         Capabilities: [100] Advanced Error Reporting
>
>
> root@(none):/# cat /proc/iomem
>
> a0000000-afffffff : /pcie@ffe09000
>
>   a0000000-afffffff : PCI Bus 0000:01
>
>     a0000000-a00003ff : 0000:01:00.0
>
>     a0010000-a001ffff : 0000:01:00.0
>
> b0000000-bfffffff : /pcie@ffe0a000
>
>   b0000000-bfffffff : PCI Bus 0001:03
>
> ef000000-efffffff : ef000000.nor
>
> ffe04500-ffe04507 : serial
>
> ffe04600-ffe04607 : serial
>
>
> thanx for your help,
>
> Davide
>
>
> I mean that the kernel detects the first controller and the device
> attached to it, plus the second controller: the device on the second
> controller is not detected (same device as the one detected on the first
> controller)
>
> 2012/9/21 Kumar Gala <galak@kernel.crashing.org>
>
>>
>> On Sep 21, 2012, at 6:33 AM, Davide Viti wrote:
>>
>> > Hi,
>> > I'm working on a custom board based on P1020 with two (identical) PCI
>> devices attached;
>> > The work is derived from another board with a single instance of that
>> device.
>> > The system is based on u-boot-2009.11 and Linux 2.6.34.6
>> >
>> > The "pci" command on u-boot, shows me both the PCI controllers and
>> > the attached devices:
>> >
>> > Scanning PCI devices on bus 0
>> > BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
>> > _____________________________________________________________
>> > 00.00.00   0x1957     0x0100     Processor               0x20
>> >
>> > Scanning PCI devices on bus 1
>> > BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
>> > _____________________________________________________________
>> > 01.00.00   0x1b65     0xabba     Network controller      0x80
>> >
>> > Scanning PCI devices on bus 2
>> > BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
>> > _____________________________________________________________
>> > 02.00.00   0x1957     0x0100     Processor               0x20
>> >
>> > Scanning PCI devices on bus 3
>> > BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
>> > _____________________________________________________________
>> > 03.00.00   0x1b65     0xabba     Network controller      0x80
>> >
>> > The kernel detects only the first instance of the device.
>>
>> What do you mean by first instance of the device ?
>>
>> > Didn't get very far while looking at dts file and kernel logs, so I'm
>> > asking for some help on narrowing down the problem.
>> >
>> > I'm wondering if I can assume that the problem is restricted to
>> > kernel/dts and avoid concentrating on uboot.
>> > I can provide any log (didn't want to post tons of details on the first
>> > message)
>>
>> Probably a dts issue.
>>
>> What does lspci in linux say?
>>
>> - k
>>
>>
>

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

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: PCI device not working
  2012-09-21 13:17 ` Kumar Gala
@ 2012-09-21 14:06   ` Davide Viti
  2012-09-24 13:25     ` Davide Viti
  2012-09-24 13:27     ` Davide Viti
  0 siblings, 2 replies; 17+ messages in thread
From: Davide Viti @ 2012-09-21 14:06 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev

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

I mean there are two controllers and both of them have a device "subtended"
(both 0x1b65:0xabba).
u-boot can see both devices, linux detects only the device attached to the
first controller.

Here's the output of lspci and /proc/iomem :

root@(none):/# lspci -v

0000:00:00.0 Class 0604: Device 1957:0100 (rev 11)

        Flags: bus master, fast devsel, latency 0

        Memory at <ignored> (32-bit, non-prefetchable)

        Bus: primary=00, secondary=01, subordinate=01, sec-latency=0

        I/O behind bridge: 00000000-00000fff

        Memory behind bridge: a0000000-afffffff

        Capabilities: [44] Power Management version 2

        Capabilities: [4c] Express Root Port (Slot-), MSI 00

        Capabilities: [100] Advanced Error Reporting



0000:01:00.0 Class 0280: Device 1b65:abba (rev 01)

        Flags: bus master, fast devsel, latency 0, IRQ 16

        Memory at a0000000 (32-bit, non-prefetchable) [size=1K]

        Memory at a0010000 (32-bit, non-prefetchable) [size=64K]

        Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+

        Capabilities: [78] Power Management version 3

        Capabilities: [80] Express Endpoint, MSI 00

        Capabilities: [100] Virtual Channel <?>

        Capabilities: [800] Advanced Error Reporting



0001:02:00.0 Class 0604: Device 1957:0100 (rev 11)

        Flags: bus master, fast devsel, latency 0

        Memory at <ignored> (32-bit, non-prefetchable)

        Bus: primary=00, secondary=03, subordinate=03, sec-latency=0

        I/O behind bridge: 00000000-00000fff

        Memory behind bridge: b0000000-bfffffff

        Capabilities: [44] Power Management version 2

        Capabilities: [4c] Express Root Port (Slot-), MSI 00

        Capabilities: [100] Advanced Error Reporting


root@(none):/# cat /proc/iomem

a0000000-afffffff : /pcie@ffe09000

  a0000000-afffffff : PCI Bus 0000:01

    a0000000-a00003ff : 0000:01:00.0

    a0010000-a001ffff : 0000:01:00.0

b0000000-bfffffff : /pcie@ffe0a000

  b0000000-bfffffff : PCI Bus 0001:03

ef000000-efffffff : ef000000.nor

ffe04500-ffe04507 : serial

ffe04600-ffe04607 : serial


thanx for your help,

Davide


I mean that the kernel detects the first controller and the device attached
to it, plus the second controller: the device on the second controller is
not detected (same device as the one detected on the first controller)
2012/9/21 Kumar Gala <galak@kernel.crashing.org>

>
> On Sep 21, 2012, at 6:33 AM, Davide Viti wrote:
>
> > Hi,
> > I'm working on a custom board based on P1020 with two (identical) PCI
> devices attached;
> > The work is derived from another board with a single instance of that
> device.
> > The system is based on u-boot-2009.11 and Linux 2.6.34.6
> >
> > The "pci" command on u-boot, shows me both the PCI controllers and
> > the attached devices:
> >
> > Scanning PCI devices on bus 0
> > BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
> > _____________________________________________________________
> > 00.00.00   0x1957     0x0100     Processor               0x20
> >
> > Scanning PCI devices on bus 1
> > BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
> > _____________________________________________________________
> > 01.00.00   0x1b65     0xabba     Network controller      0x80
> >
> > Scanning PCI devices on bus 2
> > BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
> > _____________________________________________________________
> > 02.00.00   0x1957     0x0100     Processor               0x20
> >
> > Scanning PCI devices on bus 3
> > BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
> > _____________________________________________________________
> > 03.00.00   0x1b65     0xabba     Network controller      0x80
> >
> > The kernel detects only the first instance of the device.
>
> What do you mean by first instance of the device ?
>
> > Didn't get very far while looking at dts file and kernel logs, so I'm
> > asking for some help on narrowing down the problem.
> >
> > I'm wondering if I can assume that the problem is restricted to
> > kernel/dts and avoid concentrating on uboot.
> > I can provide any log (didn't want to post tons of details on the first
> > message)
>
> Probably a dts issue.
>
> What does lspci in linux say?
>
> - k
>
>

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

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: PCI device not working
  2012-09-21 11:33 Davide Viti
@ 2012-09-21 13:17 ` Kumar Gala
  2012-09-21 14:06   ` Davide Viti
  0 siblings, 1 reply; 17+ messages in thread
From: Kumar Gala @ 2012-09-21 13:17 UTC (permalink / raw)
  To: Davide Viti; +Cc: linuxppc-dev


On Sep 21, 2012, at 6:33 AM, Davide Viti wrote:

> Hi,
> I'm working on a custom board based on P1020 with two (identical) PCI =
devices attached;
> The work is derived from another board with a single instance of that =
device.
> The system is based on u-boot-2009.11 and Linux 2.6.34.6
>=20
> The "pci" command on u-boot, shows me both the PCI controllers and
> the attached devices:
>=20
> Scanning PCI devices on bus 0
> BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
> _____________________________________________________________
> 00.00.00   0x1957     0x0100     Processor               0x20
>=20
> Scanning PCI devices on bus 1
> BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
> _____________________________________________________________
> 01.00.00   0x1b65     0xabba     Network controller      0x80
>=20
> Scanning PCI devices on bus 2
> BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
> _____________________________________________________________
> 02.00.00   0x1957     0x0100     Processor               0x20
>=20
> Scanning PCI devices on bus 3
> BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
> _____________________________________________________________
> 03.00.00   0x1b65     0xabba     Network controller      0x80
>=20
> The kernel detects only the first instance of the device.

What do you mean by first instance of the device ?

> Didn't get very far while looking at dts file and kernel logs, so I'm
> asking for some help on narrowing down the problem.
>=20
> I'm wondering if I can assume that the problem is restricted to
> kernel/dts and avoid concentrating on uboot.=20
> I can provide any log (didn't want to post tons of details on the =
first=20
> message)

Probably a dts issue.

What does lspci in linux say?

- k

^ permalink raw reply	[flat|nested] 17+ messages in thread

* PCI device not working
@ 2012-09-21 11:33 Davide Viti
  2012-09-21 13:17 ` Kumar Gala
  0 siblings, 1 reply; 17+ messages in thread
From: Davide Viti @ 2012-09-21 11:33 UTC (permalink / raw)
  To: linuxppc-dev

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

Hi,
I'm working on a custom board based on P1020 with two (identical) PCI
devices attached;
The work is derived from another board with a single instance of that
device.
The system is based on u-boot-2009.11 and Linux 2.6.34.6

The "pci" command on u-boot, shows me both the PCI controllers and
the attached devices:

Scanning PCI devices on bus 0
BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
_____________________________________________________________
00.00.00   0x1957     0x0100     Processor               0x20

Scanning PCI devices on bus 1
BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
_____________________________________________________________
01.00.00   0x1b65     0xabba     Network controller      0x80

Scanning PCI devices on bus 2
BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
_____________________________________________________________
02.00.00   0x1957     0x0100     Processor               0x20

Scanning PCI devices on bus 3
BusDevFun  VendorId   DeviceId   Device Class       Sub-Class
_____________________________________________________________
03.00.00   0x1b65     0xabba     Network controller      0x80

The kernel detects only the first instance of the device.

Didn't get very far while looking at dts file and kernel logs, so I'm
asking for some help on narrowing down the problem.

I'm wondering if I can assume that the problem is restricted to
kernel/dts and avoid concentrating on uboot.
I can provide any log (didn't want to post tons of details on the first
message)

Thanx in advance for your help,
regards

Davide

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

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2012-10-31  8:53 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-04 12:24 R: Re: PCI device not working Davide Viti
2012-10-04 13:14 ` Kumar Gala
     [not found]   ` <CAKpAL0m3YnsbbGxL+ejfyE4zfGE5LD9Qxb7oobHVaAZGE1_Jnw@mail.gmail.com>
2012-10-05  8:54     ` Fwd: " Davide Viti
2012-10-05 12:47       ` Kumar Gala
2012-10-25  8:21         ` Davide
2012-10-31  8:52         ` Davide
  -- strict thread matches above, loose matches on Subject: below --
2012-09-27 13:14 R: " Davide Viti
2012-09-27 16:06 ` Kumar Gala
2012-09-27 11:43 R: " Davide Viti
2012-09-27 12:27 ` Kumar Gala
2012-09-21 11:33 Davide Viti
2012-09-21 13:17 ` Kumar Gala
2012-09-21 14:06   ` Davide Viti
2012-09-24 13:25     ` Davide Viti
2012-09-24 13:27     ` Davide Viti
2012-09-24 20:59       ` Davide Viti
2012-09-26 13:44         ` Kumar Gala
2012-09-26 15:25           ` Davide Viti
2012-09-27  2:30             ` Kumar Gala

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.