Author Topic: any expert of PCI with PowerPC ?  (Read 3038 times)

0 Members and 1 Guest are viewing this topic.

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
any expert of PCI with PowerPC ?
« on: May 28, 2017, 10:11:02 am »
Code: [Select]
PCI: Probing PCI hardware
PCI host bridge to bus 0008:00
pci_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.0
pci 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=-22
pci 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 nuts  :palm: :palm: :palm:
anyone is working on it? On PowerPC4xx cores?

can you give me any clue, tips, tricks?

thanks in advance  :-+
 

Offline kc8apf

  • Regular Contributor
  • *
  • Posts: 103
  • Country: us
Re: any expert of PCI with PowerPC ?
« Reply #1 on: May 30, 2017, 04:28:57 am »
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.
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: any expert of PCI with PowerPC ?
« Reply #2 on: May 30, 2017, 11:43:49 am »
What are you expecting to happen?

BAR enabled and working with PCI_IO

What is happening that doesn't match that expectation? 

It doesn't. PROMISE PDC20265 (pATA chip) fails the PCI_probe

Code: [Select]
pata_pdc202xx_old 0008:00:04.0: can't enable device: BAR 0 [io  size
0x0008] not assigned
pata_pdc202xx_old: probe of 0008:00:04.0 failed with error -22
(kernel 4.11)


I see a lot of things to investigate

Firmware Bug?
invalid BAR (can't size)?
IDE quirk?

Linux is not clear at all

a) 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 PDC20265

Code: [Select]
PCI: Probing PCI hardware
PCI: Cannot allocate resource region 4 of device 0000:00:04.0

Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
PDC20265: IDE controller at PCI slot 0000:00:04.0
PDC20265: chipset revision 2
PDC20265: not 100% native mode: will probe irqs later
PDC20265: (U)DMA Burst Bit DISABLED Primary PCI Mode Secondary PCI Mode.
    ide0: BM-DMA at 0x1000-0x1007, BIOS settings: hda:DMA, hdb:pio
    ide1: BM-DMA at 0x1008-0x100f, BIOS settings: hdc:pio, hdd:pio
(kernel 2.6.22)

lspci
Code: [Select]
00:04.0 Class 0101: Device 105a:0d30 (rev 02) (prog-if 8a [Master SecP PriP])
        Subsystem: Device 105a:4d33
        Flags: bus master, medium devsel, latency 128, IRQ 31
        I/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> [disabled]
        Capabilities: [58] Power Management version 1
        Kernel driver in use: Promise_Old_IDE
(kernel 2.6.22)
 

Offline Cerebus

  • Super Contributor
  • ***
  • Posts: 10576
  • Country: gb
Re: any expert of PCI with PowerPC ?
« Reply #3 on: May 30, 2017, 02:48:33 pm »

Linux is not clear at all

a) 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?


I'd suggest that your next step is to search for that error message in the documentation kernel 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.
Anybody got a syringe I can use to squeeze the magic smoke back into this?
 

Offline kc8apf

  • Regular Contributor
  • *
  • Posts: 103
  • Country: us
Re: any expert of PCI with PowerPC ?
« Reply #4 on: May 30, 2017, 03:23:08 pm »
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

 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: any expert of PCI with PowerPC ?
« Reply #5 on: May 30, 2017, 03:32:56 pm »
kernel 2.6.22 is light years far from kernel 4.11

check it out

2.6.22 is Old-Style PCI Probing
4.11 is New-Style PCI Probing (completely different approach)

2.6.22 is pre-device tree, it doesn't require it
4.11 is device-tree driven, it's a must, you must provide it


btw, "quirks" makes me to think it's a "legacy" problem.
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: any expert of PCI with PowerPC ?
« Reply #6 on: May 30, 2017, 03:45:25 pm »
Code: [Select]
PCI host bridge /plb/pci@ec000000 (primary) ranges:
 MEM 0x0000000080000000..0x000000009fffffff -> 0x0000000080000000
  IO 0x00000000000010f0..0x00000000000020ef -> 0x00000000000010f0
__ioremap(): phys addr 0x1000 is RAM lr c0334370
4xx PCI DMA offset set to 0x00000000
PCI: Probing PCI hardware
PCI: Hiding 4xx host bridge resources 0000:00:00.0
pci 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 part
Code: [Select]
PCI host bridge /plb/pci@ec000000 (primary) ranges:
 MEM 0x0000000080000000..0x000000009fffffff -> 0x0000000080000000
  IO 0x00000000000010f0..0x00000000000020ef -> 0x00000000000010f0
depends 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 together  :palm: :palm: :palm:

On 2.6.39 and 4.11 everything is under arch/PowerPC
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf