All of lore.kernel.org
 help / color / mirror / Atom feed
* rtk8168 driver help needed
@ 2016-05-06 22:02 Murali Karicheri
  2016-05-06 22:03 ` Murali Karicheri
  2016-05-07  8:35 ` Francois Romieu
  0 siblings, 2 replies; 9+ messages in thread
From: Murali Karicheri @ 2016-05-06 22:02 UTC (permalink / raw)
  To: open list:TI NETCP ETHERNET DRIVER

Hi,

I am trying to integrate the rtl8168 PCIe card to have Ethernet functional on my
Keystone EVM. I purchased the rtl8111c Gib card from Amazon. The Card is detected
by the RC and I can see it is enumerated and show up when doing lspci command.
However I can't get the Ethernet port functional. Does this need MSI interrupt?
I can't see it has requested any.

root@k2g-evm:~# cat /proc/interrupts 
           CPU0       
 18:     152104       GIC  27 Edge      arch_timer
 22:       3326       GIC 196 Edge      serial
 24:          0       GIC 120 Edge      2530000.i2c
 25:          0       GIC 121 Edge      2530400.i2c
 26:         14       GIC  98 Edge      21805800.spi
 27:          0       GIC 160 Edge      2680000.keystone-dwc3, xhci-hcd:usb1
 30:          0       GIC 228 Edge      gpmc
 31:          0       GIC 229 Edge      21c8000.elm
 32:        159       GIC 356 Level     2a00000.msgmgr rx_005_002
 49:          0       GIC 232 Edge      2700000.edma_ccint
 51:          0       GIC 249 Edge      2700000.edma_ccerrint
 52:       1840       GIC 240 Edge      2728000.edma_ccint
 54:          2       GIC 252 Edge      2728000.edma_ccerrint
 57:       5424       GIC 128 Edge      mmc0
 58:        461       GIC 129 Edge      mmc1
285:          0  Keystone-PCIe-MSI-IRQ   0 Edge      PCIe PME, aerdrv
IPI0:          0  CPU wakeup interrupts
IPI1:          0  Timer broadcast interrupts
IPI2:          0  Rescheduling interrupts
IPI3:          0  Function call interrupts
IPI4:          0  Single function call interrupts
IPI5:          0  CPU stop interrupts
IPI6:          0  IRQ work interrupts
IPI7:          0  completion interrupts


root@k2g-evm:~# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:00:00:00:00:00  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

gre0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-50-00-00-00-00-00-00-00-00  
          NOARP  MTU:1476  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

gretap0   Link encap:Ethernet  HWaddr 00:00:00:00:00:00  
          BROADCAST MULTICAST  MTU:1462  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:14 errors:0 dropped:0 overruns:0 frame:0
          TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:968 (968.0 B)  TX bytes:968 (968.0 B)

tunl0     Link encap:UNSPEC  HWaddr 00-00-00-00-31-00-00-50-00-00-00-00-00-00-00-00  
          NOARP  MTU:1480  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

root@k2g-evm:~# ifup eth0
ifconfig: SIOCSIFFLAGS: Cannot assign requested address


[    2.303965] PCI host bridge /soc/pcie@21800000 ranges:
[    2.309108]   No bus range found for /soc/pcie@21800000, using [bus 00-ff]
[    2.316269]    IO 0x23250000..0x23253fff -> 0x00000000
[    2.321499]   MEM 0x50000000..0x5fffffff -> 0x50000000
[    2.331666] keystone-pcie 21801000.pcie: PCI host bridge to bus 0000:00
[    2.338283] pci_bus 0000:00: root bus resource [bus 00-ff]
[    2.343937] pci_bus 0000:00: root bus resource [io  0x0000-0x3fff]
[    2.350114] pci_bus 0000:00: root bus resource [mem 0x50000000-0x5fffffff]
[    2.357095] pci 0000:00:00.0: [104c:b00b] type 01 class 0x060400
[    2.357665] PCI: bus0: Fast back to back transfers disabled
[    2.363717] pci 0000:01:00.0: [10ec:8168] type 00 class 0x020000
[    2.363809] pci 0000:01:00.0: reg 0x10: [io  0x0000-0x00ff]
[    2.363867] pci 0000:01:00.0: reg 0x18: [mem 0x00000000-0x00000fff 64bit]
[    2.363909] pci 0000:01:00.0: reg 0x20: [mem 0x00000000-0x0000ffff 64bit pref]
[    2.363939] pci 0000:01:00.0: reg 0x30: [mem 0x00000000-0x0001ffff pref]
[    2.364099] pci 0000:01:00.0: supports D1 D2
[    2.364116] pci 0000:01:00.0: PME# supported from D0 D1 D2 D3hot D3cold
[    2.381251] PCI: bus1: Fast back to back transfers disabled
[    2.386989] pci 0000:00:00.0: BAR 8: assigned [mem 0x50000000-0x500fffff]
[    2.393937] pci 0000:00:00.0: BAR 9: assigned [mem 0x50100000-0x501fffff pref]
[    2.401221] pci 0000:00:00.0: BAR 7: assigned [io  0x1000-0x1fff]
[    2.407320] pci 0000:01:00.0: BAR 6: assigned [mem 0x50100000-0x5011ffff pref]
[    2.414597] pci 0000:01:00.0: BAR 4: assigned [mem 0x50120000-0x5012ffff 64bit pref]
[    2.422380] pci 0000:01:00.0: BAR 2: assigned [mem 0x50000000-0x50000fff 64bit]
[    2.429702] pci 0000:01:00.0: BAR 0: assigned [io  0x1000-0x10ff]
[    2.435821] pci 0000:00:00.0: PCI bridge to [bus 01]
[    2.440783] pci 0000:00:00.0:   bridge window [io  0x1000-0x1fff]
[    2.446896] pci 0000:00:00.0:   bridge window [mem 0x50000000-0x500fffff]
[    2.453699] pci 0000:00:00.0:   bridge window [mem 0x50100000-0x501fffff pref]
[    2.461453] pcieport 0000:00:00.0: Signaling PME through PCIe PME interrupt
[    2.468411] pci 0000:01:00.0: Signaling PME through PCIe PME interrupt
[    2.475075] pcie_pme 0000:00:00.0:pcie01: service driver pcie_pme loaded
[    2.475392] aer 0000:00:00.0:pcie02: service driver aer loaded
[    2.475652] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
[    2.481419] r8169 0000:01:00.0: enabling device (0140 -> 0143)
[    2.488865] r8169 0000:01:00.0 eth0: RTL8169 at 0xf0d6a000, 00:00:00:00:00:00, XID 00000000 IRQ 286
[    2.498259] r8169 0000:01:00.0 eth0: jumbo features [frames: 7152 bytes, tx checksumming: ok]


Complete log at http://pastebin.ubuntu.com/16268925/

Can someone help me figure out what is missing?
-- 
Murali Karicheri
Linux Kernel, Keystone

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

* Re: rtk8168 driver help needed
  2016-05-06 22:02 rtk8168 driver help needed Murali Karicheri
@ 2016-05-06 22:03 ` Murali Karicheri
  2016-05-07  8:35 ` Francois Romieu
  1 sibling, 0 replies; 9+ messages in thread
From: Murali Karicheri @ 2016-05-06 22:03 UTC (permalink / raw)
  To: open list:TI NETCP ETHERNET DRIVER

On 05/06/2016 06:02 PM, Murali Karicheri wrote:
> Hi,
> 
> I am trying to integrate the rtl8168 PCIe card to have Ethernet functional on my
> Keystone EVM. I purchased the rtl8111c Gib card from Amazon. The Card is detected
> by the RC and I can see it is enumerated and show up when doing lspci command.
> However I can't get the Ethernet port functional. Does this need MSI interrupt?
> I can't see it has requested any.
> 
> root@k2g-evm:~# cat /proc/interrupts 
>            CPU0       
>  18:     152104       GIC  27 Edge      arch_timer
>  22:       3326       GIC 196 Edge      serial
>  24:          0       GIC 120 Edge      2530000.i2c
>  25:          0       GIC 121 Edge      2530400.i2c
>  26:         14       GIC  98 Edge      21805800.spi
>  27:          0       GIC 160 Edge      2680000.keystone-dwc3, xhci-hcd:usb1
>  30:          0       GIC 228 Edge      gpmc
>  31:          0       GIC 229 Edge      21c8000.elm
>  32:        159       GIC 356 Level     2a00000.msgmgr rx_005_002
>  49:          0       GIC 232 Edge      2700000.edma_ccint
>  51:          0       GIC 249 Edge      2700000.edma_ccerrint
>  52:       1840       GIC 240 Edge      2728000.edma_ccint
>  54:          2       GIC 252 Edge      2728000.edma_ccerrint
>  57:       5424       GIC 128 Edge      mmc0
>  58:        461       GIC 129 Edge      mmc1
> 285:          0  Keystone-PCIe-MSI-IRQ   0 Edge      PCIe PME, aerdrv
> IPI0:          0  CPU wakeup interrupts
> IPI1:          0  Timer broadcast interrupts
> IPI2:          0  Rescheduling interrupts
> IPI3:          0  Function call interrupts
> IPI4:          0  Single function call interrupts
> IPI5:          0  CPU stop interrupts
> IPI6:          0  IRQ work interrupts
> IPI7:          0  completion interrupts
> 
> 
> root@k2g-evm:~# ifconfig -a
> eth0      Link encap:Ethernet  HWaddr 00:00:00:00:00:00  
>           BROADCAST MULTICAST  MTU:1500  Metric:1
>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000 
>           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Also why MAC address is showing all zeros? Any settings needed?

> 
> gre0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-50-00-00-00-00-00-00-00-00  
>           NOARP  MTU:1476  Metric:1
>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1 
>           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
> 
> gretap0   Link encap:Ethernet  HWaddr 00:00:00:00:00:00  
>           BROADCAST MULTICAST  MTU:1462  Metric:1
>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000 
>           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
> 
> lo        Link encap:Local Loopback  
>           inet addr:127.0.0.1  Mask:255.0.0.0
>           inet6 addr: ::1/128 Scope:Host
>           UP LOOPBACK RUNNING  MTU:65536  Metric:1
>           RX packets:14 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1 
>           RX bytes:968 (968.0 B)  TX bytes:968 (968.0 B)
> 
> tunl0     Link encap:UNSPEC  HWaddr 00-00-00-00-31-00-00-50-00-00-00-00-00-00-00-00  
>           NOARP  MTU:1480  Metric:1
>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1 
>           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
> 
> root@k2g-evm:~# ifup eth0
> ifconfig: SIOCSIFFLAGS: Cannot assign requested address
> 
> 
> [    2.303965] PCI host bridge /soc/pcie@21800000 ranges:
> [    2.309108]   No bus range found for /soc/pcie@21800000, using [bus 00-ff]
> [    2.316269]    IO 0x23250000..0x23253fff -> 0x00000000
> [    2.321499]   MEM 0x50000000..0x5fffffff -> 0x50000000
> [    2.331666] keystone-pcie 21801000.pcie: PCI host bridge to bus 0000:00
> [    2.338283] pci_bus 0000:00: root bus resource [bus 00-ff]
> [    2.343937] pci_bus 0000:00: root bus resource [io  0x0000-0x3fff]
> [    2.350114] pci_bus 0000:00: root bus resource [mem 0x50000000-0x5fffffff]
> [    2.357095] pci 0000:00:00.0: [104c:b00b] type 01 class 0x060400
> [    2.357665] PCI: bus0: Fast back to back transfers disabled
> [    2.363717] pci 0000:01:00.0: [10ec:8168] type 00 class 0x020000
> [    2.363809] pci 0000:01:00.0: reg 0x10: [io  0x0000-0x00ff]
> [    2.363867] pci 0000:01:00.0: reg 0x18: [mem 0x00000000-0x00000fff 64bit]
> [    2.363909] pci 0000:01:00.0: reg 0x20: [mem 0x00000000-0x0000ffff 64bit pref]
> [    2.363939] pci 0000:01:00.0: reg 0x30: [mem 0x00000000-0x0001ffff pref]
> [    2.364099] pci 0000:01:00.0: supports D1 D2
> [    2.364116] pci 0000:01:00.0: PME# supported from D0 D1 D2 D3hot D3cold
> [    2.381251] PCI: bus1: Fast back to back transfers disabled
> [    2.386989] pci 0000:00:00.0: BAR 8: assigned [mem 0x50000000-0x500fffff]
> [    2.393937] pci 0000:00:00.0: BAR 9: assigned [mem 0x50100000-0x501fffff pref]
> [    2.401221] pci 0000:00:00.0: BAR 7: assigned [io  0x1000-0x1fff]
> [    2.407320] pci 0000:01:00.0: BAR 6: assigned [mem 0x50100000-0x5011ffff pref]
> [    2.414597] pci 0000:01:00.0: BAR 4: assigned [mem 0x50120000-0x5012ffff 64bit pref]
> [    2.422380] pci 0000:01:00.0: BAR 2: assigned [mem 0x50000000-0x50000fff 64bit]
> [    2.429702] pci 0000:01:00.0: BAR 0: assigned [io  0x1000-0x10ff]
> [    2.435821] pci 0000:00:00.0: PCI bridge to [bus 01]
> [    2.440783] pci 0000:00:00.0:   bridge window [io  0x1000-0x1fff]
> [    2.446896] pci 0000:00:00.0:   bridge window [mem 0x50000000-0x500fffff]
> [    2.453699] pci 0000:00:00.0:   bridge window [mem 0x50100000-0x501fffff pref]
> [    2.461453] pcieport 0000:00:00.0: Signaling PME through PCIe PME interrupt
> [    2.468411] pci 0000:01:00.0: Signaling PME through PCIe PME interrupt
> [    2.475075] pcie_pme 0000:00:00.0:pcie01: service driver pcie_pme loaded
> [    2.475392] aer 0000:00:00.0:pcie02: service driver aer loaded
> [    2.475652] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
> [    2.481419] r8169 0000:01:00.0: enabling device (0140 -> 0143)
> [    2.488865] r8169 0000:01:00.0 eth0: RTL8169 at 0xf0d6a000, 00:00:00:00:00:00, XID 00000000 IRQ 286
> [    2.498259] r8169 0000:01:00.0 eth0: jumbo features [frames: 7152 bytes, tx checksumming: ok]
> 
> 
> Complete log at http://pastebin.ubuntu.com/16268925/
> 
> Can someone help me figure out what is missing?
> 


-- 
Murali Karicheri
Linux Kernel, Keystone

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

* Re: rtk8168 driver help needed
  2016-05-06 22:02 rtk8168 driver help needed Murali Karicheri
  2016-05-06 22:03 ` Murali Karicheri
@ 2016-05-07  8:35 ` Francois Romieu
  2016-05-09 14:54   ` Murali Karicheri
  2016-05-19 21:38   ` Murali Karicheri
  1 sibling, 2 replies; 9+ messages in thread
From: Francois Romieu @ 2016-05-07  8:35 UTC (permalink / raw)
  To: Murali Karicheri; +Cc: open list:TI NETCP ETHERNET DRIVER

Murali Karicheri <m-karicheri2@ti.com> :
[...]
> I am trying to integrate the rtl8168 PCIe card to have Ethernet functional
> on my Keystone EVM.

Which (EVM) one ?

> I purchased the rtl8111c Gib card from Amazon. The Card is detected
> by the RC and I can see it is enumerated and show up when doing lspci command.

What does "the RC" mean ? A different PC ?

> However I can't get the Ethernet port functional.

> Does this need MSI interrupt ?

No.

> I can't see it has requested any.

Yes, something went really, really wrong. See below.

[...]
> [    2.303965] PCI host bridge /soc/pcie@21800000 ranges:
> [    2.309108]   No bus range found for /soc/pcie@21800000, using [bus 00-ff]
> [    2.316269]    IO 0x23250000..0x23253fff -> 0x00000000
> [    2.321499]   MEM 0x50000000..0x5fffffff -> 0x50000000
> [    2.331666] keystone-pcie 21801000.pcie: PCI host bridge to bus 0000:00
> [    2.338283] pci_bus 0000:00: root bus resource [bus 00-ff]
> [    2.343937] pci_bus 0000:00: root bus resource [io  0x0000-0x3fff]
> [    2.350114] pci_bus 0000:00: root bus resource [mem 0x50000000-0x5fffffff]
> [    2.357095] pci 0000:00:00.0: [104c:b00b] type 01 class 0x060400
> [    2.357665] PCI: bus0: Fast back to back transfers disabled
> [    2.363717] pci 0000:01:00.0: [10ec:8168] type 00 class 0x020000
> [    2.363809] pci 0000:01:00.0: reg 0x10: [io  0x0000-0x00ff]
> [    2.363867] pci 0000:01:00.0: reg 0x18: [mem 0x00000000-0x00000fff 64bit]
> [    2.363909] pci 0000:01:00.0: reg 0x20: [mem 0x00000000-0x0000ffff 64bit pref]
> [    2.363939] pci 0000:01:00.0: reg 0x30: [mem 0x00000000-0x0001ffff pref]
> [    2.364099] pci 0000:01:00.0: supports D1 D2
> [    2.364116] pci 0000:01:00.0: PME# supported from D0 D1 D2 D3hot D3cold
> [    2.381251] PCI: bus1: Fast back to back transfers disabled
> [    2.386989] pci 0000:00:00.0: BAR 8: assigned [mem 0x50000000-0x500fffff]
> [    2.393937] pci 0000:00:00.0: BAR 9: assigned [mem 0x50100000-0x501fffff pref]
> [    2.401221] pci 0000:00:00.0: BAR 7: assigned [io  0x1000-0x1fff]
> [    2.407320] pci 0000:01:00.0: BAR 6: assigned [mem 0x50100000-0x5011ffff pref]
> [    2.414597] pci 0000:01:00.0: BAR 4: assigned [mem 0x50120000-0x5012ffff 64bit pref]
> [    2.422380] pci 0000:01:00.0: BAR 2: assigned [mem 0x50000000-0x50000fff 64bit]
> [    2.429702] pci 0000:01:00.0: BAR 0: assigned [io  0x1000-0x10ff]
> [    2.435821] pci 0000:00:00.0: PCI bridge to [bus 01]
> [    2.440783] pci 0000:00:00.0:   bridge window [io  0x1000-0x1fff]
> [    2.446896] pci 0000:00:00.0:   bridge window [mem 0x50000000-0x500fffff]
> [    2.453699] pci 0000:00:00.0:   bridge window [mem 0x50100000-0x501fffff pref]
> [    2.461453] pcieport 0000:00:00.0: Signaling PME through PCIe PME interrupt
> [    2.468411] pci 0000:01:00.0: Signaling PME through PCIe PME interrupt
> [    2.475075] pcie_pme 0000:00:00.0:pcie01: service driver pcie_pme loaded
> [    2.475392] aer 0000:00:00.0:pcie02: service driver aer loaded
> [    2.475652] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
> [    2.481419] r8169 0000:01:00.0: enabling device (0140 -> 0143)
> [    2.488865] r8169 0000:01:00.0 eth0: RTL8169 at 0xf0d6a000, 00:00:00:00:00:00, XID 00000000 IRQ 286

No need to go further, there is a serious problem here.

Most of the XID bits are read from a mapped register. They're definitely not
expected to be null as the driver requires it to identify a proper chipset
(the common PCI configuration registers only tell that you aren't dealing
with a coffee machine).

Any read returning zeroes would not surprize me.

[...]
> Can someone help me figure out what is missing ?

Hardly at this point. I can only suggest to switch power off, plug
the 8168 device in a x86 (32 or 64 bits) system and check how it behaves.

-- 
Ueimor

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

* Re: rtk8168 driver help needed
  2016-05-07  8:35 ` Francois Romieu
@ 2016-05-09 14:54   ` Murali Karicheri
  2016-05-09 17:25     ` Murali Karicheri
  2016-05-19 21:38   ` Murali Karicheri
  1 sibling, 1 reply; 9+ messages in thread
From: Murali Karicheri @ 2016-05-09 14:54 UTC (permalink / raw)
  To: Francois Romieu; +Cc: open list:TI NETCP ETHERNET DRIVER

Francois,

Thanks for responding.

On 05/07/2016 04:35 AM, Francois Romieu wrote:
> Murali Karicheri <m-karicheri2@ti.com> :
> [...]
>> I am trying to integrate the rtl8168 PCIe card to have Ethernet functional
>> on my Keystone EVM.
> 
> Which (EVM) one ?
K2G EVM. This is a new EVM for which work has been started to add it to upstream
kernel. But it not there yet. The PCIe h/w in the K2G SoC is a re-use from
existing SoC such as K2E. The PCIe controller (Root complex a.k.a RC) driver
based on this PCIe h/w works fine on K2E EVM with a Marvel SATA controller
connected to the PCIe port. On K2G EVM, I have a PCIe slot to which I have
plugged the rtl8168 PCIe card and power on with the log I had sent you. The
serdes driver is responsible for link setup seems to work fine, link is up and
could detect the rtl8168 below.
> 
>> I purchased the rtl8111c Gib card from Amazon. The Card is detected
>> by the RC and I can see it is enumerated and show up when doing lspci command.
> 
> What does "the RC" mean ? A different PC ?

RC - Root Complex (PCIe controller - drivers/pci/host/pci-keystone.c, a designware
based PCIe controller driver)

The the PCIe controller driver bindings...

                pcie0_phy: phy@2320000 {
                        #phy-cells = <0>;
                        compatible = "ti,keystone-serdes-pcie";
                        reg = <0x02320000 0x4000>;
                        link-rate-kbps = <5000000>;
                        num-lanes = <1>;
                        status = "disabled";
                };

                pcie0: pcie@21800000 {
                        compatible = "ti,keystone-pcie", "snps,dw-pcie";
                        power-domains = <&k2g_pds K2G_DEV_PCIE0>;
                        clocks = <&k2g_clks K2G_DEV_PCIE0 K2G_DEV_PCIE_VBUS_CLK>;
                        clock-names = "pcie";
                        #address-cells = <3>;
                        #size-cells = <2>;
                        reg =  <0x21801000 0x2000>, <0x21800000 0x1000>, <0x02620128 4>;
                        ranges = <0x81000000 0 0 0x23250000 0 0x4000
                                0x82000000 0 0x50000000 0x50000000 0 0x10000000>;

                        status = "disabled";
                        device_type = "pci";
                        num-lanes = <1>;
                        phys = <&pcie0_phy>;

                        #interrupt-cells = <1>;
                        interrupt-map-mask = <0 0 0 7>;
                        interrupt-map = <0 0 0 1 &pcie_intc0 0>, /* INT A */
                                        <0 0 0 2 &pcie_intc0 1>, /* INT B */
                                        <0 0 0 3 &pcie_intc0 2>, /* INT C */
                                        <0 0 0 4 &pcie_intc0 3>; /* INT D */
                        pcie_msi_intc0: msi-interrupt-controller {
                                interrupt-controller;
                                #interrupt-cells = <1>;
                                interrupt-parent = <&gic>;
                                interrupts = <GIC_SPI 30 IRQ_TYPE_EDGE_RISING>,
                                        <GIC_SPI 31 IRQ_TYPE_EDGE_RISING>,
                                        <GIC_SPI 32 IRQ_TYPE_EDGE_RISING>,
                                        <GIC_SPI 33 IRQ_TYPE_EDGE_RISING>,
                                        <GIC_SPI 34 IRQ_TYPE_EDGE_RISING>,
                                        <GIC_SPI 35 IRQ_TYPE_EDGE_RISING>,
                                        <GIC_SPI 36 IRQ_TYPE_EDGE_RISING>,
                                        <GIC_SPI 37 IRQ_TYPE_EDGE_RISING>;
                        };

                        pcie_intc0: legacy-interrupt-controller {
                                interrupt-controller;
                                #interrupt-cells = <1>;
                                interrupt-parent = <&gic>;
                                interrupts = <GIC_SPI 26 IRQ_TYPE_EDGE_RISING>,
                                        <GIC_SPI 27 IRQ_TYPE_EDGE_RISING>,
                                        <GIC_SPI 28 IRQ_TYPE_EDGE_RISING>,
                                        <GIC_SPI 29 IRQ_TYPE_EDGE_RISING>;
                        };
                };


> 
>> However I can't get the Ethernet port functional.
> 
>> Does this need MSI interrupt ?
> 
> No.

Does it also work with MSI?? Is there anything to be set in the driver
to request MSI interrupt?

> 
>> I can't see it has requested any.
> 
> Yes, something went really, really wrong. See below.
> 
> [...]
>> [    2.303965] PCI host bridge /soc/pcie@21800000 ranges:
>> [    2.309108]   No bus range found for /soc/pcie@21800000, using [bus 00-ff]
>> [    2.316269]    IO 0x23250000..0x23253fff -> 0x00000000
>> [    2.321499]   MEM 0x50000000..0x5fffffff -> 0x50000000
>> [    2.331666] keystone-pcie 21801000.pcie: PCI host bridge to bus 0000:00
>> [    2.338283] pci_bus 0000:00: root bus resource [bus 00-ff]
>> [    2.343937] pci_bus 0000:00: root bus resource [io  0x0000-0x3fff]
>> [    2.350114] pci_bus 0000:00: root bus resource [mem 0x50000000-0x5fffffff]
>> [    2.357095] pci 0000:00:00.0: [104c:b00b] type 01 class 0x060400
>> [    2.357665] PCI: bus0: Fast back to back transfers disabled
>> [    2.363717] pci 0000:01:00.0: [10ec:8168] type 00 class 0x020000
>> [    2.363809] pci 0000:01:00.0: reg 0x10: [io  0x0000-0x00ff]
>> [    2.363867] pci 0000:01:00.0: reg 0x18: [mem 0x00000000-0x00000fff 64bit]
>> [    2.363909] pci 0000:01:00.0: reg 0x20: [mem 0x00000000-0x0000ffff 64bit pref]
>> [    2.363939] pci 0000:01:00.0: reg 0x30: [mem 0x00000000-0x0001ffff pref]
>> [    2.364099] pci 0000:01:00.0: supports D1 D2
>> [    2.364116] pci 0000:01:00.0: PME# supported from D0 D1 D2 D3hot D3cold
>> [    2.381251] PCI: bus1: Fast back to back transfers disabled
>> [    2.386989] pci 0000:00:00.0: BAR 8: assigned [mem 0x50000000-0x500fffff]
>> [    2.393937] pci 0000:00:00.0: BAR 9: assigned [mem 0x50100000-0x501fffff pref]
>> [    2.401221] pci 0000:00:00.0: BAR 7: assigned [io  0x1000-0x1fff]
>> [    2.407320] pci 0000:01:00.0: BAR 6: assigned [mem 0x50100000-0x5011ffff pref]
>> [    2.414597] pci 0000:01:00.0: BAR 4: assigned [mem 0x50120000-0x5012ffff 64bit pref]
>> [    2.422380] pci 0000:01:00.0: BAR 2: assigned [mem 0x50000000-0x50000fff 64bit]
>> [    2.429702] pci 0000:01:00.0: BAR 0: assigned [io  0x1000-0x10ff]
>> [    2.435821] pci 0000:00:00.0: PCI bridge to [bus 01]
>> [    2.440783] pci 0000:00:00.0:   bridge window [io  0x1000-0x1fff]
>> [    2.446896] pci 0000:00:00.0:   bridge window [mem 0x50000000-0x500fffff]
>> [    2.453699] pci 0000:00:00.0:   bridge window [mem 0x50100000-0x501fffff pref]
>> [    2.461453] pcieport 0000:00:00.0: Signaling PME through PCIe PME interrupt
>> [    2.468411] pci 0000:01:00.0: Signaling PME through PCIe PME interrupt
>> [    2.475075] pcie_pme 0000:00:00.0:pcie01: service driver pcie_pme loaded
>> [    2.475392] aer 0000:00:00.0:pcie02: service driver aer loaded
>> [    2.475652] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
>> [    2.481419] r8169 0000:01:00.0: enabling device (0140 -> 0143)
>> [    2.488865] r8169 0000:01:00.0 eth0: RTL8169 at 0xf0d6a000, 00:00:00:00:00:00, XID 00000000 IRQ 286
> 
> No need to go further, there is a serious problem here.
> 
> Most of the XID bits are read from a mapped register. They're definitely not
> expected to be null as the driver requires it to identify a proper chipset
> (the common PCI configuration registers only tell that you aren't dealing
> with a coffee machine).

Looks like during enumeration, the PCIe controller has correctly read the
Device ID a and Vendor ID over the PCIe bus. So the bus access is happening
at least to read the common PCI configuration space. But then what you are
confirming is the mapped XID register is not accessed correctly and is reading
zeors. Right? I will try to debug this first before proceeding any further.

Thanks.

Murali
 
> Any read returning zeroes would not surprize me.
> 
> [...]
>> Can someone help me figure out what is missing ?
> 
> Hardly at this point. I can only suggest to switch power off, plug
> the 8168 device in a x86 (32 or 64 bits) system and check how it behaves.
> 
I need to continue work with my EVM as I have to make it functional.


-- 
Murali Karicheri
Linux Kernel, Keystone

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

* Re: rtk8168 driver help needed
  2016-05-09 14:54   ` Murali Karicheri
@ 2016-05-09 17:25     ` Murali Karicheri
  2016-05-09 18:13       ` Murali Karicheri
  0 siblings, 1 reply; 9+ messages in thread
From: Murali Karicheri @ 2016-05-09 17:25 UTC (permalink / raw)
  To: Francois Romieu; +Cc: open list:TI NETCP ETHERNET DRIVER

On 05/09/2016 10:54 AM, Murali Karicheri wrote:
> Francois,
> 
> Thanks for responding.
> 
> On 05/07/2016 04:35 AM, Francois Romieu wrote:
>> Murali Karicheri <m-karicheri2@ti.com> :
>> [...]
>>> I am trying to integrate the rtl8168 PCIe card to have Ethernet functional
>>> on my Keystone EVM.
>>
>> Which (EVM) one ?
> K2G EVM. This is a new EVM for which work has been started to add it to upstream
> kernel. But it not there yet. The PCIe h/w in the K2G SoC is a re-use from
> existing SoC such as K2E. The PCIe controller (Root complex a.k.a RC) driver
> based on this PCIe h/w works fine on K2E EVM with a Marvel SATA controller
> connected to the PCIe port. On K2G EVM, I have a PCIe slot to which I have
> plugged the rtl8168 PCIe card and power on with the log I had sent you. The
> serdes driver is responsible for link setup seems to work fine, link is up and
> could detect the rtl8168 below.
>>
>>> I purchased the rtl8111c Gib card from Amazon. The Card is detected
>>> by the RC and I can see it is enumerated and show up when doing lspci command.
>>
>> What does "the RC" mean ? A different PC ?
> 
> RC - Root Complex (PCIe controller - drivers/pci/host/pci-keystone.c, a designware
> based PCIe controller driver)
> 
> The the PCIe controller driver bindings...
> 
>                 pcie0_phy: phy@2320000 {
>                         #phy-cells = <0>;
>                         compatible = "ti,keystone-serdes-pcie";
>                         reg = <0x02320000 0x4000>;
>                         link-rate-kbps = <5000000>;
>                         num-lanes = <1>;
>                         status = "disabled";
>                 };
> 
>                 pcie0: pcie@21800000 {
>                         compatible = "ti,keystone-pcie", "snps,dw-pcie";
>                         power-domains = <&k2g_pds K2G_DEV_PCIE0>;
>                         clocks = <&k2g_clks K2G_DEV_PCIE0 K2G_DEV_PCIE_VBUS_CLK>;
>                         clock-names = "pcie";
>                         #address-cells = <3>;
>                         #size-cells = <2>;
>                         reg =  <0x21801000 0x2000>, <0x21800000 0x1000>, <0x02620128 4>;
>                         ranges = <0x81000000 0 0 0x23250000 0 0x4000
>                                 0x82000000 0 0x50000000 0x50000000 0 0x10000000>;
> 
>                         status = "disabled";
>                         device_type = "pci";
>                         num-lanes = <1>;
>                         phys = <&pcie0_phy>;
> 
>                         #interrupt-cells = <1>;
>                         interrupt-map-mask = <0 0 0 7>;
>                         interrupt-map = <0 0 0 1 &pcie_intc0 0>, /* INT A */
>                                         <0 0 0 2 &pcie_intc0 1>, /* INT B */
>                                         <0 0 0 3 &pcie_intc0 2>, /* INT C */
>                                         <0 0 0 4 &pcie_intc0 3>; /* INT D */
>                         pcie_msi_intc0: msi-interrupt-controller {
>                                 interrupt-controller;
>                                 #interrupt-cells = <1>;
>                                 interrupt-parent = <&gic>;
>                                 interrupts = <GIC_SPI 30 IRQ_TYPE_EDGE_RISING>,
>                                         <GIC_SPI 31 IRQ_TYPE_EDGE_RISING>,
>                                         <GIC_SPI 32 IRQ_TYPE_EDGE_RISING>,
>                                         <GIC_SPI 33 IRQ_TYPE_EDGE_RISING>,
>                                         <GIC_SPI 34 IRQ_TYPE_EDGE_RISING>,
>                                         <GIC_SPI 35 IRQ_TYPE_EDGE_RISING>,
>                                         <GIC_SPI 36 IRQ_TYPE_EDGE_RISING>,
>                                         <GIC_SPI 37 IRQ_TYPE_EDGE_RISING>;
>                         };
> 
>                         pcie_intc0: legacy-interrupt-controller {
>                                 interrupt-controller;
>                                 #interrupt-cells = <1>;
>                                 interrupt-parent = <&gic>;
>                                 interrupts = <GIC_SPI 26 IRQ_TYPE_EDGE_RISING>,
>                                         <GIC_SPI 27 IRQ_TYPE_EDGE_RISING>,
>                                         <GIC_SPI 28 IRQ_TYPE_EDGE_RISING>,
>                                         <GIC_SPI 29 IRQ_TYPE_EDGE_RISING>;
>                         };
>                 };
> 
> 
>>
>>> However I can't get the Ethernet port functional.
>>
>>> Does this need MSI interrupt ?
>>
>> No.
> 
> Does it also work with MSI?? Is there anything to be set in the driver
> to request MSI interrupt?
> 
>>
>>> I can't see it has requested any.
>>
>> Yes, something went really, really wrong. See below.
>>
>> [...]
>>> [    2.303965] PCI host bridge /soc/pcie@21800000 ranges:
>>> [    2.309108]   No bus range found for /soc/pcie@21800000, using [bus 00-ff]
>>> [    2.316269]    IO 0x23250000..0x23253fff -> 0x00000000
>>> [    2.321499]   MEM 0x50000000..0x5fffffff -> 0x50000000
>>> [    2.331666] keystone-pcie 21801000.pcie: PCI host bridge to bus 0000:00
>>> [    2.338283] pci_bus 0000:00: root bus resource [bus 00-ff]
>>> [    2.343937] pci_bus 0000:00: root bus resource [io  0x0000-0x3fff]
>>> [    2.350114] pci_bus 0000:00: root bus resource [mem 0x50000000-0x5fffffff]
>>> [    2.357095] pci 0000:00:00.0: [104c:b00b] type 01 class 0x060400
>>> [    2.357665] PCI: bus0: Fast back to back transfers disabled
>>> [    2.363717] pci 0000:01:00.0: [10ec:8168] type 00 class 0x020000
>>> [    2.363809] pci 0000:01:00.0: reg 0x10: [io  0x0000-0x00ff]
>>> [    2.363867] pci 0000:01:00.0: reg 0x18: [mem 0x00000000-0x00000fff 64bit]
>>> [    2.363909] pci 0000:01:00.0: reg 0x20: [mem 0x00000000-0x0000ffff 64bit pref]
>>> [    2.363939] pci 0000:01:00.0: reg 0x30: [mem 0x00000000-0x0001ffff pref]
>>> [    2.364099] pci 0000:01:00.0: supports D1 D2
>>> [    2.364116] pci 0000:01:00.0: PME# supported from D0 D1 D2 D3hot D3cold
>>> [    2.381251] PCI: bus1: Fast back to back transfers disabled
>>> [    2.386989] pci 0000:00:00.0: BAR 8: assigned [mem 0x50000000-0x500fffff]
>>> [    2.393937] pci 0000:00:00.0: BAR 9: assigned [mem 0x50100000-0x501fffff pref]
>>> [    2.401221] pci 0000:00:00.0: BAR 7: assigned [io  0x1000-0x1fff]
>>> [    2.407320] pci 0000:01:00.0: BAR 6: assigned [mem 0x50100000-0x5011ffff pref]
>>> [    2.414597] pci 0000:01:00.0: BAR 4: assigned [mem 0x50120000-0x5012ffff 64bit pref]
>>> [    2.422380] pci 0000:01:00.0: BAR 2: assigned [mem 0x50000000-0x50000fff 64bit]
>>> [    2.429702] pci 0000:01:00.0: BAR 0: assigned [io  0x1000-0x10ff]
>>> [    2.435821] pci 0000:00:00.0: PCI bridge to [bus 01]
>>> [    2.440783] pci 0000:00:00.0:   bridge window [io  0x1000-0x1fff]
>>> [    2.446896] pci 0000:00:00.0:   bridge window [mem 0x50000000-0x500fffff]
>>> [    2.453699] pci 0000:00:00.0:   bridge window [mem 0x50100000-0x501fffff pref]
>>> [    2.461453] pcieport 0000:00:00.0: Signaling PME through PCIe PME interrupt
>>> [    2.468411] pci 0000:01:00.0: Signaling PME through PCIe PME interrupt
>>> [    2.475075] pcie_pme 0000:00:00.0:pcie01: service driver pcie_pme loaded
>>> [    2.475392] aer 0000:00:00.0:pcie02: service driver aer loaded
>>> [    2.475652] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
>>> [    2.481419] r8169 0000:01:00.0: enabling device (0140 -> 0143)
>>> [    2.488865] r8169 0000:01:00.0 eth0: RTL8169 at 0xf0d6a000, 00:00:00:00:00:00, XID 00000000 IRQ 286
>>
>> No need to go further, there is a serious problem here.
>>
>> Most of the XID bits are read from a mapped register. They're definitely not
>> expected to be null as the driver requires it to identify a proper chipset
>> (the common PCI configuration registers only tell that you aren't dealing
>> with a coffee machine).
> 
> Looks like during enumeration, the PCIe controller has correctly read the
> Device ID a and Vendor ID over the PCIe bus. So the bus access is happening
> at least to read the common PCI configuration space. But then what you are
> confirming is the mapped XID register is not accessed correctly and is reading
> zeors. Right? I will try to debug this first before proceeding any further.
> 

One difference between the BAR logs w.r.t Marvel controller on K2E EVM is that
the BARs are showing up as 64bit instead of 32bit.

Marvell controller
==================
[    0.236353] pci 0000:00:00.0: BAR 8: assigned [mem 0x60000000-0x600fffff]
[    0.236364] pci 0000:00:00.0: BAR 9: assigned [mem 0x60100000-0x601fffff pref]
[    0.236373] pci 0000:00:00.0: BAR 7: assigned [io  0x1000-0x1fff]
[    0.236385] pci 0000:01:00.0: BAR 6: assigned [mem 0x60100000-0x6010ffff pref]
[    0.236394] pci 0000:01:00.0: BAR 5: assigned [mem 0x60000000-0x600001ff]
[    0.236406] pci 0000:01:00.0: BAR 4: assigned [io  0x1000-0x100f]
[    0.236418] pci 0000:01:00.0: BAR 0: assigned [io  0x1010-0x1017]
[    0.236429] pci 0000:01:00.0: BAR 2: assigned [io  0x1018-0x101f]
[    0.236441] pci 0000:01:00.0: BAR 1: assigned [io  0x1020-0x1023]
[    0.236452] pci 0000:01:00.0: BAR 3: assigned [io  0x1024-0x1027]
[    0.236464] pci 0000:00:00.0: PCI bridge to [bus 01]
[    0.236472] pci 0000:00:00.0:   bridge window [io  0x1000-0x1fff]
[    0.236481] pci 0000:00:00.0:   bridge window [mem 0x60000000-0x600fffff]
[    0.236490] pci 0000:00:00.0:   bridge window [mem 0x60100000-0x601fffff pref]

Realtek
=========
[    2.311572] keystone-pcie 21801000.pcie: PCI host bridge to bus 0000:00
[    2.318188] pci_bus 0000:00: root bus resource [bus 00-ff]
[    2.323844] pci_bus 0000:00: root bus resource [io  0x0000-0x3fff]
[    2.330023] pci_bus 0000:00: root bus resource [mem 0x50000000-0x5fffffff]
[    2.337567] PCI: bus0: Fast back to back transfers disabled
[    2.361159] PCI: bus1: Fast back to back transfers disabled
[    2.366889] pci 0000:00:00.0: BAR 8: assigned [mem 0x50000000-0x500fffff]
[    2.373841] pci 0000:00:00.0: BAR 9: assigned [mem 0x50100000-0x501fffff pref]
[    2.381061] pci 0000:00:00.0: BAR 7: assigned [io  0x1000-0x1fff]
[    2.387225] pci 0000:01:00.0: BAR 6: assigned [mem 0x50100000-0x5011ffff pref]
[    2.394505] pci 0000:01:00.0: BAR 4: assigned [mem 0x50120000-0x5012ffff 64bit pref]
[    2.402288] pci 0000:01:00.0: BAR 2: assigned [mem 0x50000000-0x50000fff 64bit]
[    2.409610] pci 0000:01:00.0: BAR 0: assigned [io  0x1000-0x10ff]
[    2.415729] pci 0000:00:00.0: PCI bridge to [bus 01]
[    2.420693] pci 0000:00:00.0:   bridge window [io  0x1000-0x1fff]
[    2.426806] pci 0000:00:00.0:   bridge window [mem 0x50000000-0x500fffff]
[    2.433610] pci 0000:00:00.0:   bridge window [mem 0x50100000-0x501fffff pref]

Probably access to config space is happening in 64bit and it just get zeros?
Trying to see how does PCI core determine if the access is 64bit. If you have a
clue please let me know.

Murali
> Thanks.
> 
> Murali
>  
>> Any read returning zeroes would not surprize me.
>>
>> [...]
>>> Can someone help me figure out what is missing ?
>>
>> Hardly at this point. I can only suggest to switch power off, plug
>> the 8168 device in a x86 (32 or 64 bits) system and check how it behaves.
>>
> I need to continue work with my EVM as I have to make it functional.
> 
> 


-- 
Murali Karicheri
Linux Kernel, Keystone

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

* Re: rtk8168 driver help needed
  2016-05-09 17:25     ` Murali Karicheri
@ 2016-05-09 18:13       ` Murali Karicheri
  0 siblings, 0 replies; 9+ messages in thread
From: Murali Karicheri @ 2016-05-09 18:13 UTC (permalink / raw)
  To: Francois Romieu; +Cc: open list:TI NETCP ETHERNET DRIVER

On 05/09/2016 01:25 PM, Murali Karicheri wrote:
> On 05/09/2016 10:54 AM, Murali Karicheri wrote:
>> Francois,
>>
>> Thanks for responding.
>>
>> On 05/07/2016 04:35 AM, Francois Romieu wrote:
>>> Murali Karicheri <m-karicheri2@ti.com> :
>>> [...]
>>>> I am trying to integrate the rtl8168 PCIe card to have Ethernet functional
>>>> on my Keystone EVM.
>>>
>>> Which (EVM) one ?
>> K2G EVM. This is a new EVM for which work has been started to add it to upstream
>> kernel. But it not there yet. The PCIe h/w in the K2G SoC is a re-use from
>> existing SoC such as K2E. The PCIe controller (Root complex a.k.a RC) driver
>> based on this PCIe h/w works fine on K2E EVM with a Marvel SATA controller
>> connected to the PCIe port. On K2G EVM, I have a PCIe slot to which I have
>> plugged the rtl8168 PCIe card and power on with the log I had sent you. The
>> serdes driver is responsible for link setup seems to work fine, link is up and
>> could detect the rtl8168 below.
>>>
>>>> I purchased the rtl8111c Gib card from Amazon. The Card is detected
>>>> by the RC and I can see it is enumerated and show up when doing lspci command.
>>>
>>> What does "the RC" mean ? A different PC ?
>>
>> RC - Root Complex (PCIe controller - drivers/pci/host/pci-keystone.c, a designware
>> based PCIe controller driver)
>>
>> The the PCIe controller driver bindings...
>>
>>                 pcie0_phy: phy@2320000 {
>>                         #phy-cells = <0>;
>>                         compatible = "ti,keystone-serdes-pcie";
>>                         reg = <0x02320000 0x4000>;
>>                         link-rate-kbps = <5000000>;
>>                         num-lanes = <1>;
>>                         status = "disabled";
>>                 };
>>
>>                 pcie0: pcie@21800000 {
>>                         compatible = "ti,keystone-pcie", "snps,dw-pcie";
>>                         power-domains = <&k2g_pds K2G_DEV_PCIE0>;
>>                         clocks = <&k2g_clks K2G_DEV_PCIE0 K2G_DEV_PCIE_VBUS_CLK>;
>>                         clock-names = "pcie";
>>                         #address-cells = <3>;
>>                         #size-cells = <2>;
>>                         reg =  <0x21801000 0x2000>, <0x21800000 0x1000>, <0x02620128 4>;
>>                         ranges = <0x81000000 0 0 0x23250000 0 0x4000
>>                                 0x82000000 0 0x50000000 0x50000000 0 0x10000000>;
>>
>>                         status = "disabled";
>>                         device_type = "pci";
>>                         num-lanes = <1>;
>>                         phys = <&pcie0_phy>;
>>
>>                         #interrupt-cells = <1>;
>>                         interrupt-map-mask = <0 0 0 7>;
>>                         interrupt-map = <0 0 0 1 &pcie_intc0 0>, /* INT A */
>>                                         <0 0 0 2 &pcie_intc0 1>, /* INT B */
>>                                         <0 0 0 3 &pcie_intc0 2>, /* INT C */
>>                                         <0 0 0 4 &pcie_intc0 3>; /* INT D */
>>                         pcie_msi_intc0: msi-interrupt-controller {
>>                                 interrupt-controller;
>>                                 #interrupt-cells = <1>;
>>                                 interrupt-parent = <&gic>;
>>                                 interrupts = <GIC_SPI 30 IRQ_TYPE_EDGE_RISING>,
>>                                         <GIC_SPI 31 IRQ_TYPE_EDGE_RISING>,
>>                                         <GIC_SPI 32 IRQ_TYPE_EDGE_RISING>,
>>                                         <GIC_SPI 33 IRQ_TYPE_EDGE_RISING>,
>>                                         <GIC_SPI 34 IRQ_TYPE_EDGE_RISING>,
>>                                         <GIC_SPI 35 IRQ_TYPE_EDGE_RISING>,
>>                                         <GIC_SPI 36 IRQ_TYPE_EDGE_RISING>,
>>                                         <GIC_SPI 37 IRQ_TYPE_EDGE_RISING>;
>>                         };
>>
>>                         pcie_intc0: legacy-interrupt-controller {
>>                                 interrupt-controller;
>>                                 #interrupt-cells = <1>;
>>                                 interrupt-parent = <&gic>;
>>                                 interrupts = <GIC_SPI 26 IRQ_TYPE_EDGE_RISING>,
>>                                         <GIC_SPI 27 IRQ_TYPE_EDGE_RISING>,
>>                                         <GIC_SPI 28 IRQ_TYPE_EDGE_RISING>,
>>                                         <GIC_SPI 29 IRQ_TYPE_EDGE_RISING>;
>>                         };
>>                 };
>>
>>
>>>
>>>> However I can't get the Ethernet port functional.
>>>
>>>> Does this need MSI interrupt ?
>>>
>>> No.
>>
>> Does it also work with MSI?? Is there anything to be set in the driver
>> to request MSI interrupt?
>>
>>>
>>>> I can't see it has requested any.
>>>
>>> Yes, something went really, really wrong. See below.
>>>
>>> [...]
>>>> [    2.303965] PCI host bridge /soc/pcie@21800000 ranges:
>>>> [    2.309108]   No bus range found for /soc/pcie@21800000, using [bus 00-ff]
>>>> [    2.316269]    IO 0x23250000..0x23253fff -> 0x00000000
>>>> [    2.321499]   MEM 0x50000000..0x5fffffff -> 0x50000000
>>>> [    2.331666] keystone-pcie 21801000.pcie: PCI host bridge to bus 0000:00
>>>> [    2.338283] pci_bus 0000:00: root bus resource [bus 00-ff]
>>>> [    2.343937] pci_bus 0000:00: root bus resource [io  0x0000-0x3fff]
>>>> [    2.350114] pci_bus 0000:00: root bus resource [mem 0x50000000-0x5fffffff]
>>>> [    2.357095] pci 0000:00:00.0: [104c:b00b] type 01 class 0x060400
>>>> [    2.357665] PCI: bus0: Fast back to back transfers disabled
>>>> [    2.363717] pci 0000:01:00.0: [10ec:8168] type 00 class 0x020000
>>>> [    2.363809] pci 0000:01:00.0: reg 0x10: [io  0x0000-0x00ff]
>>>> [    2.363867] pci 0000:01:00.0: reg 0x18: [mem 0x00000000-0x00000fff 64bit]
>>>> [    2.363909] pci 0000:01:00.0: reg 0x20: [mem 0x00000000-0x0000ffff 64bit pref]
>>>> [    2.363939] pci 0000:01:00.0: reg 0x30: [mem 0x00000000-0x0001ffff pref]
>>>> [    2.364099] pci 0000:01:00.0: supports D1 D2
>>>> [    2.364116] pci 0000:01:00.0: PME# supported from D0 D1 D2 D3hot D3cold
>>>> [    2.381251] PCI: bus1: Fast back to back transfers disabled
>>>> [    2.386989] pci 0000:00:00.0: BAR 8: assigned [mem 0x50000000-0x500fffff]
>>>> [    2.393937] pci 0000:00:00.0: BAR 9: assigned [mem 0x50100000-0x501fffff pref]
>>>> [    2.401221] pci 0000:00:00.0: BAR 7: assigned [io  0x1000-0x1fff]
>>>> [    2.407320] pci 0000:01:00.0: BAR 6: assigned [mem 0x50100000-0x5011ffff pref]
>>>> [    2.414597] pci 0000:01:00.0: BAR 4: assigned [mem 0x50120000-0x5012ffff 64bit pref]
>>>> [    2.422380] pci 0000:01:00.0: BAR 2: assigned [mem 0x50000000-0x50000fff 64bit]
>>>> [    2.429702] pci 0000:01:00.0: BAR 0: assigned [io  0x1000-0x10ff]
>>>> [    2.435821] pci 0000:00:00.0: PCI bridge to [bus 01]
>>>> [    2.440783] pci 0000:00:00.0:   bridge window [io  0x1000-0x1fff]
>>>> [    2.446896] pci 0000:00:00.0:   bridge window [mem 0x50000000-0x500fffff]
>>>> [    2.453699] pci 0000:00:00.0:   bridge window [mem 0x50100000-0x501fffff pref]
>>>> [    2.461453] pcieport 0000:00:00.0: Signaling PME through PCIe PME interrupt
>>>> [    2.468411] pci 0000:01:00.0: Signaling PME through PCIe PME interrupt
>>>> [    2.475075] pcie_pme 0000:00:00.0:pcie01: service driver pcie_pme loaded
>>>> [    2.475392] aer 0000:00:00.0:pcie02: service driver aer loaded
>>>> [    2.475652] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
>>>> [    2.481419] r8169 0000:01:00.0: enabling device (0140 -> 0143)
>>>> [    2.488865] r8169 0000:01:00.0 eth0: RTL8169 at 0xf0d6a000, 00:00:00:00:00:00, XID 00000000 IRQ 286
>>>
>>> No need to go further, there is a serious problem here.
>>>
>>> Most of the XID bits are read from a mapped register. They're definitely not
>>> expected to be null as the driver requires it to identify a proper chipset
>>> (the common PCI configuration registers only tell that you aren't dealing
>>> with a coffee machine).
>>
>> Looks like during enumeration, the PCIe controller has correctly read the
>> Device ID a and Vendor ID over the PCIe bus. So the bus access is happening
>> at least to read the common PCI configuration space. But then what you are
>> confirming is the mapped XID register is not accessed correctly and is reading
>> zeors. Right? I will try to debug this first before proceeding any further.
>>
> 
> One difference between the BAR logs w.r.t Marvel controller on K2E EVM is that
> the BARs are showing up as 64bit instead of 32bit.
> 
> Marvell controller
> ==================
> [    0.236353] pci 0000:00:00.0: BAR 8: assigned [mem 0x60000000-0x600fffff]
> [    0.236364] pci 0000:00:00.0: BAR 9: assigned [mem 0x60100000-0x601fffff pref]
> [    0.236373] pci 0000:00:00.0: BAR 7: assigned [io  0x1000-0x1fff]
> [    0.236385] pci 0000:01:00.0: BAR 6: assigned [mem 0x60100000-0x6010ffff pref]
> [    0.236394] pci 0000:01:00.0: BAR 5: assigned [mem 0x60000000-0x600001ff]
> [    0.236406] pci 0000:01:00.0: BAR 4: assigned [io  0x1000-0x100f]
> [    0.236418] pci 0000:01:00.0: BAR 0: assigned [io  0x1010-0x1017]
> [    0.236429] pci 0000:01:00.0: BAR 2: assigned [io  0x1018-0x101f]
> [    0.236441] pci 0000:01:00.0: BAR 1: assigned [io  0x1020-0x1023]
> [    0.236452] pci 0000:01:00.0: BAR 3: assigned [io  0x1024-0x1027]
> [    0.236464] pci 0000:00:00.0: PCI bridge to [bus 01]
> [    0.236472] pci 0000:00:00.0:   bridge window [io  0x1000-0x1fff]
> [    0.236481] pci 0000:00:00.0:   bridge window [mem 0x60000000-0x600fffff]
> [    0.236490] pci 0000:00:00.0:   bridge window [mem 0x60100000-0x601fffff pref]
> 
> Realtek
> =========
> [    2.311572] keystone-pcie 21801000.pcie: PCI host bridge to bus 0000:00
> [    2.318188] pci_bus 0000:00: root bus resource [bus 00-ff]
> [    2.323844] pci_bus 0000:00: root bus resource [io  0x0000-0x3fff]
> [    2.330023] pci_bus 0000:00: root bus resource [mem 0x50000000-0x5fffffff]
> [    2.337567] PCI: bus0: Fast back to back transfers disabled
> [    2.361159] PCI: bus1: Fast back to back transfers disabled
> [    2.366889] pci 0000:00:00.0: BAR 8: assigned [mem 0x50000000-0x500fffff]
> [    2.373841] pci 0000:00:00.0: BAR 9: assigned [mem 0x50100000-0x501fffff pref]
> [    2.381061] pci 0000:00:00.0: BAR 7: assigned [io  0x1000-0x1fff]
> [    2.387225] pci 0000:01:00.0: BAR 6: assigned [mem 0x50100000-0x5011ffff pref]
> [    2.394505] pci 0000:01:00.0: BAR 4: assigned [mem 0x50120000-0x5012ffff 64bit pref]
> [    2.402288] pci 0000:01:00.0: BAR 2: assigned [mem 0x50000000-0x50000fff 64bit]
> [    2.409610] pci 0000:01:00.0: BAR 0: assigned [io  0x1000-0x10ff]
> [    2.415729] pci 0000:00:00.0: PCI bridge to [bus 01]
> [    2.420693] pci 0000:00:00.0:   bridge window [io  0x1000-0x1fff]
> [    2.426806] pci 0000:00:00.0:   bridge window [mem 0x50000000-0x500fffff]
> [    2.433610] pci 0000:00:00.0:   bridge window [mem 0x50100000-0x501fffff pref]
> 
> Probably access to config space is happening in 64bit and it just get zeros?
> Trying to see how does PCI core determine if the access is 64bit. If you have a
> clue please let me know.
Francois,

Keystone PCI can't support 64bit BARs. Is there a Realtek NIC card I can purchase
that uses 32bit? Or Is there a way I can configure the driver to use 32bit BAR?

Murali
> 
> Murali
>> Thanks.
>>
>> Murali
>>  
>>> Any read returning zeroes would not surprize me.
>>>
>>> [...]
>>>> Can someone help me figure out what is missing ?
>>>
>>> Hardly at this point. I can only suggest to switch power off, plug
>>> the 8168 device in a x86 (32 or 64 bits) system and check how it behaves.
>>>
>> I need to continue work with my EVM as I have to make it functional.
>>
>>
> 
> 


-- 
Murali Karicheri
Linux Kernel, Keystone

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

* Re: rtk8168 driver help needed
  2016-05-07  8:35 ` Francois Romieu
  2016-05-09 14:54   ` Murali Karicheri
@ 2016-05-19 21:38   ` Murali Karicheri
  2016-05-20  0:31     ` Francois Romieu
  1 sibling, 1 reply; 9+ messages in thread
From: Murali Karicheri @ 2016-05-19 21:38 UTC (permalink / raw)
  To: Francois Romieu; +Cc: open list:TI NETCP ETHERNET DRIVER

On 05/07/2016 04:35 AM, Francois Romieu wrote:
> Murali Karicheri <m-karicheri2@ti.com> :
> [...]
>> I am trying to integrate the rtl8168 PCIe card to have Ethernet functional
>> on my Keystone EVM.
> 
> Which (EVM) one ?
> 
>> I purchased the rtl8111c Gib card from Amazon. The Card is detected
>> by the RC and I can see it is enumerated and show up when doing lspci command.
> 
> What does "the RC" mean ? A different PC ?
> 
>> However I can't get the Ethernet port functional.
> 
>> Does this need MSI interrupt ?
> 
> No.
> 
>> I can't see it has requested any.
> 
> Yes, something went really, really wrong. See below.
> 
I have figured out why I was getting all zeros over the PCIe bus. The PCIe 
address range used by the CPU to access the PCI space is wrong. Once that
is fixed, I was able to test few PCIe EP devices such as Intel e1000e, Broadcom
tg3, Marvel SATA etc. But the rtk8168 driver still don't work. I have following
log now.

[    2.372877] pci_bus 0000:00: root bus resource [bus 00-ff]
[    2.378362] pci_bus 0000:00: root bus resource [io  0x0000-0x3fff]
[    2.384609] pci_bus 0000:00: root bus resource [mem 0x70000000-0x7fffffff]
[    2.392155] PCI: bus0: Fast back to back transfers disabled
[    2.411222] PCI: bus1: Fast back to back transfers disabled
[    2.416964] pci 0000:00:00.0: BAR 8: assigned [mem 0x70000000-0x700fffff]
[    2.423927] pci 0000:00:00.0: BAR 9: assigned [mem 0x70100000-0x701fffff
pref]
[    2.431217] pci 0000:00:00.0: BAR 7: assigned [io  0x1000-0x1fff]
[    2.437315] pci 0000:01:00.0: BAR 6: assigned [mem 0x70100000-0x7011ffff
pref]
[    2.444597] pci 0000:01:00.0: BAR 4: assigned [mem 0x70120000-0x7012ffff
64bit pref]
[    2.452383] pci 0000:01:00.0: BAR 2: assigned [mem 0x70000000-0x70000fff
64bit]
[    2.459705] pci 0000:01:00.0: BAR 0: assigned [io  0x1000-0x10ff]
[    2.465825] pci 0000:00:00.0: PCI bridge to [bus 01]
[    2.470788] pci 0000:00:00.0:   bridge window [io  0x1000-0x1fff]
[    2.476905] pci 0000:00:00.0:   bridge window [mem 0x70000000-0x700fffff]
[    2.483711] pci 0000:00:00.0:   bridge window [mem 0x70100000-0x701fffff
pref]


And then 

root@k2g-evm:~# lspci -v
00:00.0 PCI bridge: Texas Instruments Device b00b (rev 01) (prog-if 00 [Normal
decode])
        Flags: bus master, fast devsel, latency 0, IRQ 287
        Memory at <ignored> (32-bit, non-prefetchable)
        Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
        I/O behind bridge: 00001000-00001fff
        Memory behind bridge: 70000000-700fffff
        Prefetchable memory behind bridge: 70100000-701fffff
        Capabilities: [40] Power Management version 3
        Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
        Capabilities: [70] Express Root Port (Slot-), MSI 00
        Capabilities: [100] Advanced Error Reporting
        Kernel driver in use: pcieport
lspci: Unable to load libkmod resources: error -12

01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411
PCI Express Gigabit Ethernet Controller (rev 02)
        Subsystem: Realtek Semiconductor Co., Ltd. Device 0123
        Flags: fast devsel, IRQ 319
        I/O ports at 1000 [disabled] [size=256]
        Memory at 70000000 (64-bit, non-prefetchable) [disabled] [size=4K]
        Memory at 70120000 (64-bit, prefetchable) [disabled] [size=64K]
        [virtual] Expansion ROM at 70100000 [disabled] [size=128K]
        Capabilities: [40] Power Management version 0
        Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
        Capabilities: [70] Express Endpoint, MSI 01
        Capabilities: [b0] MSI-X: Enable- Count=2 Masked-
        Capabilities: [d0] Vital Product Data
        Capabilities: [100] Advanced Error Reporting
        Capabilities: [140] Virtual Channel
        Capabilities: [160] Device Serial Number 01-00-00-00-68-4c-e0-00


And then

root@k2g-evm:/# insmod r8169.ko
[   43.980877] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
[   43.986609] r8169 0000:01:00.0: enabling device (0140 -> 0143)
[   43.993132] r8169 0000:01:00.0: limiting MRRS to 256
[   44.004152] r8169 0000:01:00.0 eth1: RTL8168c/8111c at 0xf0f56000,
00:e0:4c:21:16:2c, XID 1c4000c0 IRQ 288
[   44.024167] r8169 0000:01:00.0 eth1: jumbo features [frames: 6128 bytes, tx
checksumming: ko]
root@k2g-evm:/# ifup eth1
[   51.782650] r8169 0000:01:00.0 eth1: link down
[   51.787121] r8169 0000:01:00.0 eth1: link down
[   51.792348] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
udhcpc (v1.23.1) started
Sending discover...
[   54.158011] r8169 0000:01:00.0 eth1: link up
[   54.162344] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
Sending discover...
Sending discover...
No lease, forking to background
root@k2g-evm:/# ifconfig
eth0      Link encap:Ethernet  HWaddr 50:72:24:D6:DE:ED
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

eth1      Link encap:Ethernet  HWaddr 00:E0:4C:21:16:2C
          inet6 addr: fe80::2e0:4cff:fe21:162c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)


Looks like there is nothing transmitted.


For Broadcom tg3, I get

[    2.353188] pci_bus 0000:00: root bus resource [bus 00-ff]
[    2.358673] pci_bus 0000:00: root bus resource [io  0x0000-0x3fff]
[    2.364924] pci_bus 0000:00: root bus resource [mem 0x70000000-0x7fffffff]
[    2.372468] PCI: bus0: Fast back to back transfers disabled
[    2.378612] pci 0000:01:00.0: reg 0x10: can't handle BAR above 4GB (bus
address 0x2400460302000000)
[    2.388393] pci 0000:01:00.0: disabling ASPM on pre-1.1 PCIe device.  You can
enable it with 'pcie_aspm=force'
[    2.398565] PCI: bus1: Fast back to back transfers disabled
[    2.404437] pci 0000:00:00.0: BAR 8: assigned [mem 0x70000000-0x700fffff]
[    2.411322] pci 0000:01:00.0: BAR 0: assigned [mem 0x70000000-0x7000ffff
64bit]
[    2.418648] pci 0000:00:00.0: PCI bridge to [bus 01]
[    2.423682] pci 0000:00:00.0:   bridge window [mem 0x70000000-0x700fffff]
[    2.430978] pcieport 0000:00:00.0: Signaling PME through PCIe PME interrupt
[    2.438106] pci 0000:01:00.0: Signaling PME through PCIe PME interrupt
[    2.445532] keystone-navigator-qmss soc:qmss@4020000: qmgr start queue 0,
number of queues 128
[    2.454489] keystone-navigator-qmss soc:qmss@4020000: added qmgr start queue

And then

root@k2g-evm:~# lspci -v
00:00.0 PCI bridge: Texas Instruments Device b00b (rev 01) (prog-if 00 [Normal
decode])
        Flags: bus master, fast devsel, latency 0, IRQ 287
        Memory at <ignored> (32-bit, non-prefetchable)
        Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
        Memory behind bridge: 70000000-700fffff
        Capabilities: [40] Power Management version 3
        Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
        Capabilities: [70] Express Root Port (Slot-), MSI 00
        Capabilities: [100] Advanced Error Reporting
        Kernel driver in use: pcieport
lspci: Unable to load libkmod resources: error -12

01:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5721 Gigabit
Ethernet PCI Express (rev 21)
        Subsystem: Broadcom Corporation NetXtreme BCM5721 Gigabit Ethernet PCI
Express
        Flags: fast devsel, IRQ 319
        Memory at 70000000 (64-bit, non-prefetchable) [disabled] [size=64K]
        Capabilities: [48] Power Management version 2
        Capabilities: [50] Vital Product Data
        Capabilities: [58] MSI: Enable- Count=1/8 Maskable- 64bit+
        Capabilities: [d0] Express Endpoint, MSI 00
        Capabilities: [100] Advanced Error Reporting
        Capabilities: [13c] Virtual Channel
        Capabilities: [160] Device Serial Number 00-10-18-ff-fe-27-cc-c0
        Capabilities: [16c] Power Budgeting <?>


And then

root@k2g-evm:/# insmod tg3.ko
[   49.615358] tg3.c:v3.137 (May 11, 2014)
[   49.619223] tg3 0000:01:00.0: enabling device (0140 -> 0142)
[   49.625590] tg3 0000:01:00.0: limiting MRRS to 256
[   49.654559] tg3 0000:01:00.0 eth1: Tigon3 [partno(BCM95721A211F) rev 4201]
(PCI Express) MAC address 00:10:18:27:cc:c0
[   49.675314] tg3 0000:01:00.0 eth1: attached PHY is 5750 (10/100/1000Base-T
Ethernet) (WireSpeed[1], EEE[0])
[   49.698863] tg3 0000:01:00.0 eth1: RXcsums[1] LinkChgREG[0] MIirq[0] ASF[0]
TSOcap[1]
[   49.715708] tg3 0000:01:00.0 eth1: dma_rwctrl[76180000] dma_mask[64-bit]
root@k2g-evm:/#
root@k2g-evm:/#
root@k2g-evm:/#
root@k2g-evm:/# ifp eth1
-sh: ifp: command not found
root@k2g-evm:/# ifup eth1
[   59.207581] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
udhcpc (v1.23.1) started
Sending discover...
Sending discover...
[   62.361817] tg3 0000:01:00.0 eth1: Link is up at 1000 Mbps, full duplex
[   62.368436] tg3 0000:01:00.0 eth1: Flow control is on for TX and on for RX
[   62.376029] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
Sending select for 192.168.0.27...
Lease of 192.168.0.27 obtained, lease time 864000
/etc/udhcpc.d/50default: Adding DNS 192.168.0.2
/etc/udhcpc.d/50default: Adding DNS 192.168.0.10
root@k2g-evm:/#
root@k2g-evm:/#
root@k2g-evm:/#
root@k2g-evm:/# ping 192.168.0.21
PING 192.168.0.21 (192.168.0.21): 56 data bytes
64 bytes from 192.168.0.21: seq=0 ttl=64 time=0.752 ms
64 bytes from 192.168.0.21: seq=1 ttl=64 time=0.384 ms
64 bytes from 192.168.0.21: seq=2 ttl=64 time=0.341 ms
64 bytes from 192.168.0.21: seq=3 ttl=64 time=0.277 ms

Do you what could be wrong with rtk8168?

Murali


> [...]
>> [    2.303965] PCI host bridge /soc/pcie@21800000 ranges:
>> [    2.309108]   No bus range found for /soc/pcie@21800000, using [bus 00-ff]
>> [    2.316269]    IO 0x23250000..0x23253fff -> 0x00000000
>> [    2.321499]   MEM 0x50000000..0x5fffffff -> 0x50000000
>> [    2.331666] keystone-pcie 21801000.pcie: PCI host bridge to bus 0000:00
>> [    2.338283] pci_bus 0000:00: root bus resource [bus 00-ff]
>> [    2.343937] pci_bus 0000:00: root bus resource [io  0x0000-0x3fff]
>> [    2.350114] pci_bus 0000:00: root bus resource [mem 0x50000000-0x5fffffff]
>> [    2.357095] pci 0000:00:00.0: [104c:b00b] type 01 class 0x060400
>> [    2.357665] PCI: bus0: Fast back to back transfers disabled
>> [    2.363717] pci 0000:01:00.0: [10ec:8168] type 00 class 0x020000
>> [    2.363809] pci 0000:01:00.0: reg 0x10: [io  0x0000-0x00ff]
>> [    2.363867] pci 0000:01:00.0: reg 0x18: [mem 0x00000000-0x00000fff 64bit]
>> [    2.363909] pci 0000:01:00.0: reg 0x20: [mem 0x00000000-0x0000ffff 64bit pref]
>> [    2.363939] pci 0000:01:00.0: reg 0x30: [mem 0x00000000-0x0001ffff pref]
>> [    2.364099] pci 0000:01:00.0: supports D1 D2
>> [    2.364116] pci 0000:01:00.0: PME# supported from D0 D1 D2 D3hot D3cold
>> [    2.381251] PCI: bus1: Fast back to back transfers disabled
>> [    2.386989] pci 0000:00:00.0: BAR 8: assigned [mem 0x50000000-0x500fffff]
>> [    2.393937] pci 0000:00:00.0: BAR 9: assigned [mem 0x50100000-0x501fffff pref]
>> [    2.401221] pci 0000:00:00.0: BAR 7: assigned [io  0x1000-0x1fff]
>> [    2.407320] pci 0000:01:00.0: BAR 6: assigned [mem 0x50100000-0x5011ffff pref]
>> [    2.414597] pci 0000:01:00.0: BAR 4: assigned [mem 0x50120000-0x5012ffff 64bit pref]
>> [    2.422380] pci 0000:01:00.0: BAR 2: assigned [mem 0x50000000-0x50000fff 64bit]
>> [    2.429702] pci 0000:01:00.0: BAR 0: assigned [io  0x1000-0x10ff]
>> [    2.435821] pci 0000:00:00.0: PCI bridge to [bus 01]
>> [    2.440783] pci 0000:00:00.0:   bridge window [io  0x1000-0x1fff]
>> [    2.446896] pci 0000:00:00.0:   bridge window [mem 0x50000000-0x500fffff]
>> [    2.453699] pci 0000:00:00.0:   bridge window [mem 0x50100000-0x501fffff pref]
>> [    2.461453] pcieport 0000:00:00.0: Signaling PME through PCIe PME interrupt
>> [    2.468411] pci 0000:01:00.0: Signaling PME through PCIe PME interrupt
>> [    2.475075] pcie_pme 0000:00:00.0:pcie01: service driver pcie_pme loaded
>> [    2.475392] aer 0000:00:00.0:pcie02: service driver aer loaded
>> [    2.475652] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
>> [    2.481419] r8169 0000:01:00.0: enabling device (0140 -> 0143)
>> [    2.488865] r8169 0000:01:00.0 eth0: RTL8169 at 0xf0d6a000, 00:00:00:00:00:00, XID 00000000 IRQ 286
> 
> No need to go further, there is a serious problem here.
> 
> Most of the XID bits are read from a mapped register. They're definitely not
> expected to be null as the driver requires it to identify a proper chipset
> (the common PCI configuration registers only tell that you aren't dealing
> with a coffee machine).
> 
> Any read returning zeroes would not surprize me.
> 
> [...]
>> Can someone help me figure out what is missing ?
> 
> Hardly at this point. I can only suggest to switch power off, plug
> the 8168 device in a x86 (32 or 64 bits) system and check how it behaves.
> 


-- 
Murali Karicheri
Linux Kernel, Keystone

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

* Re: rtk8168 driver help needed
  2016-05-19 21:38   ` Murali Karicheri
@ 2016-05-20  0:31     ` Francois Romieu
  2016-05-24 21:57       ` Murali Karicheri
  0 siblings, 1 reply; 9+ messages in thread
From: Francois Romieu @ 2016-05-20  0:31 UTC (permalink / raw)
  To: Murali Karicheri; +Cc: open list:TI NETCP ETHERNET DRIVER

Murali Karicheri <m-karicheri2@ti.com> :
[...]
> Do you what could be wrong with rtk8168?

Hardly.

What do the device registers (ethtool -d) and device stats (ethtool -S)
look like ?

(please trim useless material from previous mail)

-- 
Ueimor

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

* Re: rtk8168 driver help needed
  2016-05-20  0:31     ` Francois Romieu
@ 2016-05-24 21:57       ` Murali Karicheri
  0 siblings, 0 replies; 9+ messages in thread
From: Murali Karicheri @ 2016-05-24 21:57 UTC (permalink / raw)
  To: Francois Romieu; +Cc: open list:TI NETCP ETHERNET DRIVER

On 05/19/2016 08:31 PM, Francois Romieu wrote:
> Murali Karicheri <m-karicheri2@ti.com> :
> [...]
>> Do you what could be wrong with rtk8168?
> 
> Hardly.
> 
> What do the device registers (ethtool -d) and device stats (ethtool -S)
> look like ?
Will dump in the next opportunity and respond
> 
> (please trim useless material from previous mail)
> 
Ok. Will keep in mind next time.

-- 
Murali Karicheri
Linux Kernel, Keystone

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

end of thread, other threads:[~2016-05-24 21:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-06 22:02 rtk8168 driver help needed Murali Karicheri
2016-05-06 22:03 ` Murali Karicheri
2016-05-07  8:35 ` Francois Romieu
2016-05-09 14:54   ` Murali Karicheri
2016-05-09 17:25     ` Murali Karicheri
2016-05-09 18:13       ` Murali Karicheri
2016-05-19 21:38   ` Murali Karicheri
2016-05-20  0:31     ` Francois Romieu
2016-05-24 21:57       ` Murali Karicheri

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.