any expert of PCI with PowerPC ? - Page 1
Forum section: electronics / general

author: legacy
author_rank: Super Contributor
timestamp: May 28, 2017, 10:11:02 am
content: Code:PCI: Probing PCI hardwarePCI host bridge to bus 0008:00pci_bus 0008:00: root bus resource [io 0x0000-0xffffff]pci_bus 0008:00: root bus resource [mem 0x80000000-0x9fffffff]pci_bus 0008:00: root bus resource [bus 00-ff]PCI: Hiding 4xx host bridge resources 0008:00:00.0pci 0008:00:04.0: [Firmware Bug]: reg 0x10: invalid BAR (can't size)pci 0008:00:04.0: [Firmware Bug]: reg 0x14: invalid BAR (can't size)pci 0008:00:04.0: [Firmware Bug]: reg 0x18: invalid BAR (can't size)pci 0008:00:04.0: [Firmware Bug]: reg 0x1c: invalid BAR (can't size)pci 0008:00:04.0: legacy IDE quirk: reg 0x10: [io 0x01f0-0x01f7]pci 0008:00:04.0: legacy IDE quirk: reg 0x14: [io 0x03f6]pci 0008:00:04.0: legacy IDE quirk: reg 0x18: [io 0x0170-0x0177]pci 0008:00:04.0: legacy IDE quirk: reg 0x1c: [io 0x0376]pci 0008:00:00.0: of_irq_parse_pci: failed with rc=-22pci 0008:00:03.0: BAR 1: assigned [mem 0x80000000-0x807fffff pref]pci 0008:00:04.0: BAR 5: assigned [mem 0x80800000-0x8081ffff]pci 0008:00:03.0: BAR 6: assigned [mem 0x80820000-0x8082ffff pref]pci 0008:00:03.0: BAR 0: assigned [mem 0x80830000-0x80833fff]pci 0008:00:04.0: BAR 6: assigned [mem 0x80834000-0x80837fff pref]pci 0008:00:02.0: BAR 0: assigned [mem 0x80838000-0x80838fff]pci 0008:00:02.1: BAR 0: assigned [mem 0x80839000-0x808390ff]pci 0008:00:04.0: BAR 4: assigned [io 0x1000-0x103f]So, the PCI on (damn linux) kernel 4.11 makes me go nutsanyone is working on it? On PowerPC4xx cores?can you give me any clue, tips, tricks?thanks in advance

author: kc8apf
author_rank: Regular Contributor
timestamp: May 30, 2017, 04:28:57 am
content: What are you expecting to happen? What is happening that doesn't match that expectation? I see a lot of things to investigate but, without knowing what problem you are experiencing, it's hard to suggest anything.

author: legacy
author_rank: Super Contributor
timestamp: May 30, 2017, 11:43:49 am
content: Quote from: kc8apf on May 30, 2017, 04:28:57 amBAR enabled and working with PCI_IOQuote from: kc8apf on May 30, 2017, 04:28:57 amIt doesn't. PROMISE PDC20265 (pATA chip) fails the PCI_probeCode:pata_pdc202xx_old 0008:00:04.0: can't enable device: BAR 0 [io size0x0008] not assignedpata_pdc202xx_old: probe of 0008:00:04.0 failed with error -22(kernel 4.11)Quote from: kc8apf on May 30, 2017, 04:28:57 amFirmware Bug?invalid BAR (can't size)?IDE quirk?Linux is not clear at alla) Is it a problem with the firmware which doesn't initialize the PCI in the proper way?b) Is it a problem with the DeviceTree which doesn't pass the correct description (e.g. PCI-range)?c) Is it a problem with the linux kernel which doesn't support the old PCI_legay stuff?about c) I can say linux 2.6.22 works on the same board with the same PROMISE PDC20265Code:PCI: Probing PCI hardwarePCI: Cannot allocate resource region 4 of device 0000:00:04.0Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xxPDC20265: IDE controller at PCI slot 0000:00:04.0PDC20265: chipset revision 2PDC20265: not 100% native mode: will probe irqs laterPDC20265: (U)DMA Burst Bit DISABLED Primary PCI Mode Secondary PCI Mode.ide0: BM-DMA at 0x1000-0x1007, BIOS settings: hda:DMA, hdb:pioide1: BM-DMA at 0x1008-0x100f, BIOS settings: hdc:pio, hdd:pio(kernel 2.6.22)lspciCode:00:04.0 Class 0101: Device 105a:0d30 (rev 02) (prog-if 8a [Master SecP PriP])Subsystem: Device 105a:4d33Flags: bus master, medium devsel, latency 128, IRQ 31I/O ports at 121f0 [size=8]I/O ports at 123f4 [size=1]I/O ports at 12170 [size=8]I/O ports at 12374 [size=1]I/O ports at 13000 [size=64]Memory at 81000000 (32-bit, non-prefetchable) [size=128K]Expansion ROM at <ignored> Capabilities:  Power Management version 1Kernel driver in use: Promise_Old_IDE(kernel 2.6.22)

author: Cerebus
author_rank: Super Contributor
timestamp: May 30, 2017, 02:48:33 pm
content: Quote from: legacy on May 30, 2017, 11:43:49 amI'd suggest that your next step is to search for that error message in thedocumentationkernel source code. When you understand what Linux is trying to actually do at that point you'll be 90% of the way to a solution. Try comparing with the same section of code (and nearby) in the older kernel that works.My guess is that you'll end up either patching it (if you're up to that) or reporting a bug (if you're not). Either way, a clear understanding of where in the code it's doing this is useful for either and probably the fastest route towards a solution.

author: kc8apf
author_rank: Regular Contributor
timestamp: May 30, 2017, 03:23:08 pm
content: The "Firmware Bug" lines reference BAR0-3 on the device you're having trouble with. It seems those BARs have invalid sizes. The next few lines say that a quirk is applied that provides those sizes. Then there is a failed call to of_irq_parse_pci.Note that BAR4-5 on this device are setup correctly. I suspect something is going wrong when the quirk is applied.Sent from my Nexus 5X using Tapatalk

author: legacy
author_rank: Super Contributor
timestamp: May 30, 2017, 03:32:56 pm
content: kernel 2.6.22 is light years far from kernel 4.11check it out2.6.22 is Old-Style PCI Probing4.11 is New-Style PCI Probing (completely different approach)2.6.22 is pre-device tree, it doesn't require it4.11 is device-tree driven, it's a must, you must provide itbtw, "quirks" makes me to think it's a "legacy" problem.

author: legacy
author_rank: Super Contributor
timestamp: May 30, 2017, 03:45:25 pm
content: Code:PCI host bridge /plb/pci@ec000000 (primary) ranges:MEM 0x0000000080000000..0x000000009fffffff -> 0x0000000080000000IO 0x00000000000010f0..0x00000000000020ef -> 0x00000000000010f0__ioremap(): phys addr 0x1000 is RAM lr c03343704xx PCI DMA offset set to 0x00000000PCI: Probing PCI hardwarePCI: Hiding 4xx host bridge resources 0000:00:00.0pci 0000:00:03.0: BAR 1: assigned [mem 0x80000000-0x807fffff pref]pci 0000:00:03.0: BAR 1: set to [mem 0x80000000-0x807fffff pref] (PCI address [0x80000000-0x807fffff])pci 0000:00:02.0: BAR 6: assigned [mem 0x80800000-0x8087ffff pref]pci 0000:00:04.0: BAR 5: assigned [mem 0x80880000-0x8089ffff]pci 0000:00:04.0: BAR 5: set to [mem 0x80880000-0x8089ffff] (PCI address [0x80880000-0x8089ffff])pci 0000:00:03.0: BAR 6: assigned [mem 0x808a0000-0x808affff pref]pci 0000:00:03.0: BAR 0: assigned [mem 0x808b0000-0x808b3fff]pci 0000:00:03.0: BAR 0: set to [mem 0x808b0000-0x808b3fff] (PCI address [0x808b0000-0x808b3fff])pci 0000:00:04.0: BAR 6: assigned [mem 0x808b4000-0x808b7fff pref]pci 0000:00:02.0: BAR 5: assigned [mem 0x808b8000-0x808b83ff]pci 0000:00:02.0: BAR 5: set to [mem 0x808b8000-0x808b83ff] (PCI address [0x808b8000-0x808b83ff])pci 0000:00:04.0: BAR 4: assigned [io 0x1400-0x143f]pci 0000:00:04.0: BAR 4: set to [io 0x1400-0x143f] (PCI address [0x1400-0x143f])pci 0000:00:02.0: BAR 4: assigned [io 0x10f0-0x10ff]pci 0000:00:02.0: BAR 4: set to [io 0x10f0-0x10ff] (PCI address [0x10f0-0x10ff])pci 0000:00:02.0: BAR 0: assigned [io 0x1440-0x1447]pci 0000:00:02.0: BAR 0: set to [io 0x1440-0x1447] (PCI address [0x1440-0x1447])pci 0000:00:02.0: BAR 2: assigned [io 0x1448-0x144f]pci 0000:00:02.0: BAR 2: set to [io 0x1448-0x144f] (PCI address [0x1448-0x144f])pci 0000:00:02.0: BAR 1: assigned [io 0x1450-0x1453]pci 0000:00:02.0: BAR 1: set to [io 0x1450-0x1453] (PCI address [0x1450-0x1453])pci 0000:00:02.0: BAR 3: assigned [io 0x1454-0x1457]pci 0000:00:02.0: BAR 3: set to [io 0x1454-0x1457] (PCI address [0x1454-0x1457])(kernel-2.6.39)this partCode:PCI host bridge /plb/pci@ec000000 (primary) ranges:MEM 0x0000000080000000..0x000000009fffffff -> 0x0000000080000000IO 0x00000000000010f0..0x00000000000020ef -> 0x00000000000010f0depends on the device-tree configuration, which might be wrong.I can't extract the configuration used by 2.6.22, because it's not clear to me.Also in kernel 2.6.22 there are two branches: { arch/PPC, arch/PowerPC}, with code mixed togetherOn 2.6.39 and 4.11 everything is under arch/PowerPC