Modify

Opened 2 years ago

Last modified 15 months ago

#20997 new defect

PCI support is broken for Danube Lantiq

Reported by: pgid69 Owned by: developers
Priority: high Milestone:
Component: kernel Version: Chaos Calmer 15.05
Keywords: Cc:

Description

Hello

I have a problem running OpenWrt 15.05 on modem ARV4510PW.
The modem has a PCI bus with Wifi device and a Via VT6212L USB controler connected to it.
When loading uhci_hcd kernel module reports errors

Here is the parts of the bootlog showing the problem

...
[    0.056000] pinctrl core: initialized pinctrl subsystem
[    0.064000] NET: Registered protocol family 16
[    0.076000] pinctrl-xway 1e100b10.pinmux: Init done
[    0.080000] dma-xway 1e104100.dma: Init done - hw rev: 3, ports: 5, channels: 20
[    0.088000] PCI host bridge /fpi@10000000/pci@E105400 ranges:
[    0.092000]  MEM 0x0000000018000000..0x0000000019ffffff
[    0.096000]   IO 0x000000001ae00000..0x000000001affffff
[    0.108000] gpio-stp-xway 1e100bb0.stp: Init done
[    0.112000] usbcore: registered new interface driver usbfs
[    0.116000] usbcore: registered new interface driver hub
[    0.120000] usbcore: registered new device driver usb
[    0.124000] PCI host bridge to bus 0000:00
[    0.128000] pci_bus 0000:00: root bus resource [mem 0x18000000-0x19ffffff]
[    0.132000] pci_bus 0000:00: root bus resource [io  0xffffffff]
[    0.136000] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.140000] pci 0000:00:0e.0: BAR 0: assigned [mem 0x18000000-0x1800ffff]
[    0.144000] pci 0000:00:0f.2: BAR 0: assigned [mem 0x18010000-0x180100ff]
[    0.148000] pci 0000:00:0f.0: BAR 4: no space for [io  size 0x0020]
[    0.152000] pci 0000:00:0f.0: BAR 4: failed to assign [io  size 0x0020]
[    0.156000] pci 0000:00:0f.1: BAR 4: no space for [io  size 0x0020]
[    0.160000] pci 0000:00:0f.1: BAR 4: failed to assign [io  size 0x0020]
[    0.164000] pci 0000:00:0e.0: of_irq_parse_pci() failed with rc=-22
...
...
[    7.160000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    7.168000] ehci-platform: EHCI generic platform driver
[    7.176000] ehci-pci: EHCI PCI platform driver
[    7.176000] ehci-pci 0000:00:0f.2: EHCI Host Controller
[    7.184000] ehci-pci 0000:00:0f.2: new USB bus registered, assigned bus number 1
[    7.192000] ehci-pci 0000:00:0f.2: irq 66, io mem 0x18010000
[    7.208000] ehci-pci 0000:00:0f.2: USB 2.0 started, EHCI 1.00
[    7.212000] hub 1-0:1.0: USB hub found
[    7.216000] hub 1-0:1.0: 4 ports detected
[    7.224000] uhci_hcd: USB Universal Host Controller Interface driver
[    7.228000] uhci_hcd 0000:00:0f.0: init 0000:00:0f.0 fail, -16
[    7.232000] uhci_hcd: probe of 0000:00:0f.0 failed with error -16
[    7.240000] uhci_hcd 0000:00:0f.1: init 0000:00:0f.1 fail, -16
[    7.244000] uhci_hcd: probe of 0000:00:0f.1 failed with error -16

After browsing the source i think the problem comes from the value of IO_SPACE_LIMIT that is equal to 0xFFFF (arch/mips/include/asm/io.h) where as
in danube.dtsi, io mem range assigned to PCI has a size of 0x200000 (at offset 0x1AE00000).
So function pci_address_to_pio() in file drivers/of/address.c fails.
The function is called by of_pci_range_to_resource() (file drivers/of/address.c), called by pci_load_of_ranges() (file arch/mips/pci/pci.c), called by ltq_pci_probe() (file arch/mips/pci/pci-lantiq.c).

Attachments (1)

0400-fix-IO_SPACE_LIMIT-constant.patch (301 bytes) - added by pgid69 2 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 2 years ago by tkn...

There are some other tickets which may be related to Lantiq Danube PCI
problems causing USB or Wifi problems:
#18369 new defect
CC r43224 / ARV752DPW22 / 2 of 3 USB ports doesn't work
#19856
Lantiq ARV752DPW wifi broken

On my Easybox 802/ARV752DPW with CC the bootlog showed (and wifi does not work thereafter):

[    0.127974] PCI host bridge /fpi@10000000/pci@E105400 ranges:                                                                                               
[    0.133672]  MEM 0x0000000018000000..0x0000000019ffffff                                                                                                     
[    0.138939]   IO 0x000000001ae00000..0x000000001affffff                                                                                                     
[    0.144209] pci-xway: end probe                                                                                                                             
[    0.147354] pci-xway: Registered platform driver![    0.196887] usbcore: registered new interface driver usbfs                                              
[    0.202498] usbcore: registered new interface driver hub                                                                                                    
[    0.207947] usbcore: registered new device driver usb                                                                                                       
[    0.213519] PCI host bridge to bus 0000:00                                                                                                                  
[    0.217562] pci_bus 0000:00: root bus resource [mem 0x18000000-0x19ffffff]                                                                                  
[    0.224486] pci_bus 0000:00: root bus resource [io  0xffffffff]                                                                                             
[    0.230499] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]                                                                                   
[    0.237329] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]                                                                      

lscpi -vvv reads:

00:0e.0 Network controller: Ralink corp. RT2800 802.11n PCI
	Subsystem: Ralink corp. Device 2860
	Control: I/O- Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz+ UDF- FastB2B- ParErr- DEVSEL=slow >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Interrupt: pin A routed to IRQ 135
	Region 0: Memory at 18000000 (32-bit, non-prefetchable) [size=64K]
	Region 1: Memory at <unassigned> (32-bit, non-prefetchable) [size=2]
	Region 2: Memory at <unassigned> (32-bit, non-prefetchable) [size=2]
	Region 3: Memory at <unassigned> (32-bit, non-prefetchable) [size=2]
	Region 4: Memory at <unassigned> (32-bit, non-prefetchable) [size=2]
	Region 5: Memory at <unassigned> (32-bit, non-prefetchable) [size=2]
	Expansion ROM at <unassigned> [disabled] [size=2]
	Capabilities: [40] Power Management version 3
		Flags: PMEClk+ DSI- D1- D2- AuxCurrent=375mA PME(D0+,D1-,D2-,D3hot+,D3cold+)
		Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-

Would be great for the others, if this could be fixed in trunk.
I can not test it, because the Easybox is in active use now with BB (PCI works there for me).

May be some code now checks IO_SPACE_LIMIT. The "#define "IO_SPACE_LIMIT 0xffff" is the same in BB, kernel version 3.10.49.

comment:2 Changed 2 years ago by pgid69

Changing constant IO_SPACE_LIMIT in file arch/mips/include/asm/io.h to value 0xFFFFFFFF, resolves the problem : uhci_hcd initializes correctly.

Changed 2 years ago by pgid69

comment:3 Changed 2 years ago by Python1320

Thank you, this worked for https://wiki.openwrt.org/toh/arcadyan/arv7510pw at least in some level, but still having trouble.

[    0.133306] PCI host bridge /fpi@10000000/pci@E105400 ranges:
[    0.139005]  MEM 0x0000000018000000..0x0000000019ffffff
[    0.144272]   IO 0x000000001ae00000..0x000000001affffff
[    0.192377] gpio-stp-xway 1e100bb0.stp: Init done
[    0.198657] usbcore: registered new interface driver usbfs
[    0.204302] usbcore: registered new interface driver hub
[    0.209746] usbcore: registered new device driver usb
[    0.215402] PCI host bridge to bus 0000:00
[    0.219448] pci_bus 0000:00: root bus resource [mem 0x18000000-0x19ffffff]
[    0.226366] pci_bus 0000:00: root bus resource [io  0x1ae00000-0x1affffff]
[    0.233309] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    0.240161] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]

On a healthy old version the line with "???" is missing, but offsets are the same on the other lines.

Does the patch remove the "???" line for your router?

comment:4 Changed 2 years ago by pgid69

No, i don't have this line with '???'

Here is my bootlog

...
[    0.088000] PCI host bridge /fpi@10000000/pci@E105400 ranges:
[    0.092000]  MEM 0x0000000018000000..0x0000000019ffffff
[    0.096000]   IO 0x000000001ae00000..0x000000001affffff
[    0.108000] gpio-stp-xway 1e100bb0.stp: Init done
[    0.112000] usbcore: registered new interface driver usbfs
[    0.116000] usbcore: registered new interface driver hub
[    0.120000] usbcore: registered new device driver usb
[    0.124000] PCI host bridge to bus 0000:00
[    0.128000] pci_bus 0000:00: root bus resource [mem 0x18000000-0x19ffffff]
[    0.132000] pci_bus 0000:00: root bus resource [io  0x1ae00000-0x1affffff]
[    0.136000] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.140000] pci 0000:00:0e.0: BAR 0: assigned [mem 0x18000000-0x1800ffff]
[    0.144000] pci 0000:00:0f.2: BAR 0: assigned [mem 0x18010000-0x180100ff]
[    0.148000] pci 0000:00:0f.0: BAR 4: assigned [io  0x1ae00000-0x1ae0001f]
[    0.152000] pci 0000:00:0f.1: BAR 4: assigned [io  0x1ae00020-0x1ae0003f]
[    0.156000] Switched to clocksource MIPS
[    0.160000] NET: Registered protocol family 2
...

I should mention that my device is the Vodafone version of ARV4510PW (the model where the wifi chip is soldered directly on the main board). It has a few differences from arv4510pw : ethernet switch is different (rtl8306 instead of adm6996) and wifi device correspond to pci 0000:00:0e. On arv7510pw wifi device is pci 0000:00:0c.

Please also note that i opened another ticket /ticket/21318.html. You should also apply the patch that i attached. It's related to irq generated by PCI devices. I think that without this patch you will not receive irq 66 (USB controller) nor irq 135 (Wifi device).

comment:6 Changed 15 months ago by Python1320

Last edited 15 months ago by Python1320 (previous) (diff)

Add Comment

Modify Ticket

Action
as new .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.