Re: rtk8168 driver help needed

2016-05-24 Thread Murali Karicheri
On 05/19/2016 08:31 PM, Francois Romieu wrote:
> Murali Karicheri  :
> [...]
>> 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


Re: rtk8168 driver help needed

2016-05-19 Thread Francois Romieu
Murali Karicheri  :
[...]
> 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


Re: rtk8168 driver help needed

2016-05-19 Thread Murali Karicheri
On 05/07/2016 04:35 AM, Francois Romieu wrote:
> Murali Karicheri  :
> [...]
>> 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 :00: root bus resource [bus 00-ff]
[2.378362] pci_bus :00: root bus resource [io  0x-0x3fff]
[2.384609] pci_bus :00: root bus resource [mem 0x7000-0x7fff]
[2.392155] PCI: bus0: Fast back to back transfers disabled
[2.411222] PCI: bus1: Fast back to back transfers disabled
[2.416964] pci :00:00.0: BAR 8: assigned [mem 0x7000-0x700f]
[2.423927] pci :00:00.0: BAR 9: assigned [mem 0x7010-0x701f
pref]
[2.431217] pci :00:00.0: BAR 7: assigned [io  0x1000-0x1fff]
[2.437315] pci :01:00.0: BAR 6: assigned [mem 0x7010-0x7011
pref]
[2.444597] pci :01:00.0: BAR 4: assigned [mem 0x7012-0x7012
64bit pref]
[2.452383] pci :01:00.0: BAR 2: assigned [mem 0x7000-0x7fff
64bit]
[2.459705] pci :01:00.0: BAR 0: assigned [io  0x1000-0x10ff]
[2.465825] pci :00:00.0: PCI bridge to [bus 01]
[2.470788] pci :00:00.0:   bridge window [io  0x1000-0x1fff]
[2.476905] pci :00:00.0:   bridge window [mem 0x7000-0x700f]
[2.483711] pci :00:00.0:   bridge window [mem 0x7010-0x701f
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  (32-bit, non-prefetchable)
Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
I/O behind bridge: 1000-1fff
Memory behind bridge: 7000-700f
Prefetchable memory behind bridge: 7010-701f
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 7000 (64-bit, non-prefetchable) [disabled] [size=4K]
Memory at 7012 (64-bit, prefetchable) [disabled] [size=64K]
[virtual] Expansion ROM at 7010 [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 :01:00.0: enabling device (0140 -> 0143)
[   43.993132] r8169 :01:00.0: limiting MRRS to 256
[   44.004152] r8169 :01:00.0 eth1: RTL8168c/8111c at 0xf0f56000,
00:e0:4c:21:16:2c, XID 1c4000c0 IRQ 288
[   44.024167] r8169 :01:00.0 eth1: jumbo features [frames: 6128 bytes, tx
checksumming: ko]
root@k2g-evm:/# ifup eth1
[   51.782650] r8169 :01:00.0 eth1: link down
[   51.787121] r8169 :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 :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 

Re: rtk8168 driver help needed

2016-05-09 Thread Murali Karicheri
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  :
>>> [...]
 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@232 {
>> #phy-cells = <0>;
>> compatible = "ti,keystone-serdes-pcie";
>> reg = <0x0232 0x4000>;
>> link-rate-kbps = <500>;
>> num-lanes = <1>;
>> status = "disabled";
>> };
>>
>> pcie0: pcie@2180 {
>> compatible = "ti,keystone-pcie", "snps,dw-pcie";
>> power-domains = <_pds K2G_DEV_PCIE0>;
>> clocks = <_clks K2G_DEV_PCIE0 
>> K2G_DEV_PCIE_VBUS_CLK>;
>> clock-names = "pcie";
>> #address-cells = <3>;
>> #size-cells = <2>;
>> reg =  <0x21801000 0x2000>, <0x2180 0x1000>, 
>> <0x02620128 4>;
>> ranges = <0x8100 0 0 0x2325 0 0x4000
>> 0x8200 0 0x5000 0x5000 0 
>> 0x1000>;
>>
>> status = "disabled";
>> device_type = "pci";
>> num-lanes = <1>;
>> phys = <_phy>;
>>
>> #interrupt-cells = <1>;
>> interrupt-map-mask = <0 0 0 7>;
>> interrupt-map = <0 0 0 1 _intc0 0>, /* INT A */
>> <0 0 0 2 _intc0 1>, /* INT B */
>> <0 0 0 3 _intc0 2>, /* INT C */
>> <0 0 0 4 _intc0 3>; /* INT D */
>> pcie_msi_intc0: msi-interrupt-controller {
>> interrupt-controller;
>> #interrupt-cells = <1>;
>> interrupt-parent = <>;
>> interrupts = > IRQ_TYPE_EDGE_RISING>,
>> ,
>> ,
>> ,
>> ,
>> ,
>> ,
>> ;
>> };
>>
>> pcie_intc0: legacy-interrupt-controller {
>> interrupt-controller;
>> #interrupt-cells = <1>;
>> interrupt-parent = <>;
>> interrupts = > 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@2180 ranges:
 [2.309108]   No bus range found for /soc/pcie@2180, using [bus 
 00-ff]
 [2.316269]IO 0x2325..0x23253fff -> 0x
 [2.321499]   MEM 0x5000..0x5fff -> 0x5000
 [2.331666] keystone-pcie 21801000.pcie: PCI host bridge to bus :00
 [2.338283] pci_bus :00: root bus resource [bus 00-ff]
 [2.343937] pci_bus 

Re: rtk8168 driver help needed

2016-05-09 Thread Murali Karicheri
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  :
>> [...]
>>> 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@232 {
> #phy-cells = <0>;
> compatible = "ti,keystone-serdes-pcie";
> reg = <0x0232 0x4000>;
> link-rate-kbps = <500>;
> num-lanes = <1>;
> status = "disabled";
> };
> 
> pcie0: pcie@2180 {
> compatible = "ti,keystone-pcie", "snps,dw-pcie";
> power-domains = <_pds K2G_DEV_PCIE0>;
> clocks = <_clks K2G_DEV_PCIE0 
> K2G_DEV_PCIE_VBUS_CLK>;
> clock-names = "pcie";
> #address-cells = <3>;
> #size-cells = <2>;
> reg =  <0x21801000 0x2000>, <0x2180 0x1000>, 
> <0x02620128 4>;
> ranges = <0x8100 0 0 0x2325 0 0x4000
> 0x8200 0 0x5000 0x5000 0 
> 0x1000>;
> 
> status = "disabled";
> device_type = "pci";
> num-lanes = <1>;
> phys = <_phy>;
> 
> #interrupt-cells = <1>;
> interrupt-map-mask = <0 0 0 7>;
> interrupt-map = <0 0 0 1 _intc0 0>, /* INT A */
> <0 0 0 2 _intc0 1>, /* INT B */
> <0 0 0 3 _intc0 2>, /* INT C */
> <0 0 0 4 _intc0 3>; /* INT D */
> pcie_msi_intc0: msi-interrupt-controller {
> interrupt-controller;
> #interrupt-cells = <1>;
> interrupt-parent = <>;
> interrupts =  IRQ_TYPE_EDGE_RISING>,
> ,
> ,
> ,
> ,
> ,
> ,
> ;
> };
> 
> pcie_intc0: legacy-interrupt-controller {
> interrupt-controller;
> #interrupt-cells = <1>;
> interrupt-parent = <>;
> interrupts =  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@2180 ranges:
>>> [2.309108]   No bus range found for /soc/pcie@2180, using [bus 
>>> 00-ff]
>>> [2.316269]IO 0x2325..0x23253fff -> 0x
>>> [2.321499]   MEM 0x5000..0x5fff -> 0x5000
>>> [2.331666] keystone-pcie 21801000.pcie: PCI host bridge to bus :00
>>> [2.338283] pci_bus :00: root bus resource [bus 00-ff]
>>> [2.343937] pci_bus :00: root bus resource [io  0x-0x3fff]
>>> [2.350114] pci_bus :00: root bus resource [mem 
>>> 0x5000-0x5fff]
>>> [2.357095] pci 

Re: rtk8168 driver help needed

2016-05-09 Thread Murali Karicheri
Francois,

Thanks for responding.

On 05/07/2016 04:35 AM, Francois Romieu wrote:
> Murali Karicheri  :
> [...]
>> 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@232 {
#phy-cells = <0>;
compatible = "ti,keystone-serdes-pcie";
reg = <0x0232 0x4000>;
link-rate-kbps = <500>;
num-lanes = <1>;
status = "disabled";
};

pcie0: pcie@2180 {
compatible = "ti,keystone-pcie", "snps,dw-pcie";
power-domains = <_pds K2G_DEV_PCIE0>;
clocks = <_clks K2G_DEV_PCIE0 
K2G_DEV_PCIE_VBUS_CLK>;
clock-names = "pcie";
#address-cells = <3>;
#size-cells = <2>;
reg =  <0x21801000 0x2000>, <0x2180 0x1000>, 
<0x02620128 4>;
ranges = <0x8100 0 0 0x2325 0 0x4000
0x8200 0 0x5000 0x5000 0 
0x1000>;

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

#interrupt-cells = <1>;
interrupt-map-mask = <0 0 0 7>;
interrupt-map = <0 0 0 1 _intc0 0>, /* INT A */
<0 0 0 2 _intc0 1>, /* INT B */
<0 0 0 3 _intc0 2>, /* INT C */
<0 0 0 4 _intc0 3>; /* INT D */
pcie_msi_intc0: msi-interrupt-controller {
interrupt-controller;
#interrupt-cells = <1>;
interrupt-parent = <>;
interrupts = ,
,
,
,
,
,
,
;
};

pcie_intc0: legacy-interrupt-controller {
interrupt-controller;
#interrupt-cells = <1>;
interrupt-parent = <>;
interrupts = ,
,
,
;
};
};


> 
>> 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@2180 ranges:
>> [2.309108]   No bus range found for /soc/pcie@2180, using [bus 00-ff]
>> [2.316269]IO 0x2325..0x23253fff -> 0x
>> [2.321499]   MEM 0x5000..0x5fff -> 0x5000
>> [2.331666] keystone-pcie 21801000.pcie: PCI host bridge to bus :00
>> [2.338283] pci_bus :00: root bus resource [bus 00-ff]
>> [2.343937] pci_bus :00: root bus resource [io  0x-0x3fff]
>> [2.350114] pci_bus :00: root bus resource [mem 0x5000-0x5fff]
>> [2.357095] pci :00:00.0: [104c:b00b] type 01 class 0x060400
>> [2.357665] PCI: bus0: Fast back to back transfers disabled
>> [2.363717] pci :01:00.0: [10ec:8168] type 00 class 0x02
>> [2.363809] pci :01:00.0: reg 0x10: [io  0x-0x00ff]
>> [2.363867] pci :01:00.0: reg 0x18: [mem 

Re: rtk8168 driver help needed

2016-05-07 Thread Francois Romieu
Murali Karicheri  :
[...]
> 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@2180 ranges:
> [2.309108]   No bus range found for /soc/pcie@2180, using [bus 00-ff]
> [2.316269]IO 0x2325..0x23253fff -> 0x
> [2.321499]   MEM 0x5000..0x5fff -> 0x5000
> [2.331666] keystone-pcie 21801000.pcie: PCI host bridge to bus :00
> [2.338283] pci_bus :00: root bus resource [bus 00-ff]
> [2.343937] pci_bus :00: root bus resource [io  0x-0x3fff]
> [2.350114] pci_bus :00: root bus resource [mem 0x5000-0x5fff]
> [2.357095] pci :00:00.0: [104c:b00b] type 01 class 0x060400
> [2.357665] PCI: bus0: Fast back to back transfers disabled
> [2.363717] pci :01:00.0: [10ec:8168] type 00 class 0x02
> [2.363809] pci :01:00.0: reg 0x10: [io  0x-0x00ff]
> [2.363867] pci :01:00.0: reg 0x18: [mem 0x-0x0fff 64bit]
> [2.363909] pci :01:00.0: reg 0x20: [mem 0x-0x 64bit 
> pref]
> [2.363939] pci :01:00.0: reg 0x30: [mem 0x-0x0001 pref]
> [2.364099] pci :01:00.0: supports D1 D2
> [2.364116] pci :01:00.0: PME# supported from D0 D1 D2 D3hot D3cold
> [2.381251] PCI: bus1: Fast back to back transfers disabled
> [2.386989] pci :00:00.0: BAR 8: assigned [mem 0x5000-0x500f]
> [2.393937] pci :00:00.0: BAR 9: assigned [mem 0x5010-0x501f 
> pref]
> [2.401221] pci :00:00.0: BAR 7: assigned [io  0x1000-0x1fff]
> [2.407320] pci :01:00.0: BAR 6: assigned [mem 0x5010-0x5011 
> pref]
> [2.414597] pci :01:00.0: BAR 4: assigned [mem 0x5012-0x5012 
> 64bit pref]
> [2.422380] pci :01:00.0: BAR 2: assigned [mem 0x5000-0x5fff 
> 64bit]
> [2.429702] pci :01:00.0: BAR 0: assigned [io  0x1000-0x10ff]
> [2.435821] pci :00:00.0: PCI bridge to [bus 01]
> [2.440783] pci :00:00.0:   bridge window [io  0x1000-0x1fff]
> [2.446896] pci :00:00.0:   bridge window [mem 0x5000-0x500f]
> [2.453699] pci :00:00.0:   bridge window [mem 0x5010-0x501f 
> pref]
> [2.461453] pcieport :00:00.0: Signaling PME through PCIe PME interrupt
> [2.468411] pci :01:00.0: Signaling PME through PCIe PME interrupt
> [2.475075] pcie_pme :00:00.0:pcie01: service driver pcie_pme loaded
> [2.475392] aer :00:00.0:pcie02: service driver aer loaded
> [2.475652] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
> [2.481419] r8169 :01:00.0: enabling device (0140 -> 0143)
> [2.488865] r8169 :01:00.0 eth0: RTL8169 at 0xf0d6a000, 
> 00:00:00:00:00:00, XID  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


Re: rtk8168 driver help needed

2016-05-06 Thread Murali Karicheri
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  253.i2c
>  25:  0   GIC 121 Edge  2530400.i2c
>  26: 14   GIC  98 Edge  21805800.spi
>  27:  0   GIC 160 Edge  268.keystone-dwc3, xhci-hcd:usb1
>  30:  0   GIC 228 Edge  gpmc
>  31:  0   GIC 229 Edge  21c8000.elm
>  32:159   GIC 356 Level 2a0.msgmgr rx_005_002
>  49:  0   GIC 232 Edge  270.edma_ccint
>  51:  0   GIC 249 Edge  270.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)
> 
> loLink 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@2180 ranges:
> [2.309108]   No bus range found for /soc/pcie@2180, using [bus 00-ff]
> [2.316269]IO 0x2325..0x23253fff -> 0x
> [2.321499]   MEM 0x5000..0x5fff -> 0x5000
> [2.331666] keystone-pcie 21801000.pcie: PCI host bridge to bus :00
> [2.338283] pci_bus :00: root bus resource [bus 00-ff]
> [2.343937] pci_bus :00: root bus resource [io  0x-0x3fff]
> [2.350114] pci_bus :00: root bus resource [mem 0x5000-0x5fff]
> [2.357095] pci :00:00.0: [104c:b00b] type 01 class 0x060400
> [2.357665] PCI: bus0: Fast back to back transfers disabled
> [2.363717] pci :01:00.0: [10ec:8168] type 00 class 0x02
> [2.363809] pci :01:00.0: reg 0x10: [io  0x-0x00ff]
> [2.363867] pci :01:00.0: reg 0x18: [mem 0x-0x0fff 64bit]
> [2.363909] pci :01:00.0: reg 0x20: [mem 0x-0x 64bit 
> pref]
> [2.363939] pci :01:00.0: reg 0x30: [mem 0x-0x0001 pref]
> [2.364099] pci :01:00.0: supports D1 D2
> [2.364116] pci :01:00.0: PME# supported from D0 D1 D2 D3hot D3cold
> [2.381251] PCI: bus1: Fast back to 

rtk8168 driver help needed

2016-05-06 Thread Murali Karicheri
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  253.i2c
 25:  0   GIC 121 Edge  2530400.i2c
 26: 14   GIC  98 Edge  21805800.spi
 27:  0   GIC 160 Edge  268.keystone-dwc3, xhci-hcd:usb1
 30:  0   GIC 228 Edge  gpmc
 31:  0   GIC 229 Edge  21c8000.elm
 32:159   GIC 356 Level 2a0.msgmgr rx_005_002
 49:  0   GIC 232 Edge  270.edma_ccint
 51:  0   GIC 249 Edge  270.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)

loLink 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@2180 ranges:
[2.309108]   No bus range found for /soc/pcie@2180, using [bus 00-ff]
[2.316269]IO 0x2325..0x23253fff -> 0x
[2.321499]   MEM 0x5000..0x5fff -> 0x5000
[2.331666] keystone-pcie 21801000.pcie: PCI host bridge to bus :00
[2.338283] pci_bus :00: root bus resource [bus 00-ff]
[2.343937] pci_bus :00: root bus resource [io  0x-0x3fff]
[2.350114] pci_bus :00: root bus resource [mem 0x5000-0x5fff]
[2.357095] pci :00:00.0: [104c:b00b] type 01 class 0x060400
[2.357665] PCI: bus0: Fast back to back transfers disabled
[2.363717] pci :01:00.0: [10ec:8168] type 00 class 0x02
[2.363809] pci :01:00.0: reg 0x10: [io  0x-0x00ff]
[2.363867] pci :01:00.0: reg 0x18: [mem 0x-0x0fff 64bit]
[2.363909] pci :01:00.0: reg 0x20: [mem 0x-0x 64bit 
pref]
[2.363939] pci :01:00.0: reg 0x30: [mem 0x-0x0001 pref]
[2.364099] pci :01:00.0: supports D1 D2
[2.364116] pci :01:00.0: PME# supported from D0 D1 D2 D3hot D3cold
[2.381251] PCI: bus1: Fast back to back transfers disabled
[2.386989] pci :00:00.0: BAR 8: assigned [mem 0x5000-0x500f]
[2.393937] pci :00:00.0: BAR 9: assigned [mem 0x5010-0x501f 
pref]
[2.401221] pci :00:00.0: BAR 7: assigned [io  0x1000-0x1fff]
[2.407320] pci :01:00.0: BAR 6: assigned [mem