Skip to contentSkip to conversation

PCI problem on MPC8250 target

DISCUSSION Conor McLoughlin 1 participant 3 messages Aug 19, 2004 – Aug 25, 2004

lore
Share & tools
lore
#0 lore raw

I am trying to debug a problem I have with a custom MPC8250 target board. This board uses the 8250 host-pci bridge. Off the pci bus there is a three-port pci-pci bridge. Hanging off one port of this bridge are a number of DSP chips.

I am using kernel 2.6.8.1. I had been debugging this on 2.4.24 from ELDK, but 2.6 appears to have resolved some of the problems I had identified.

The pci bios appears to see both functions of the bridge and three devices on bus 1. The problem is in allocating resources for the devices. I hope that someone here can save me some time and indicate where I should be looking for the problem.

The hardware is first prototype and therefore no guarantees as to how it is behaving.
A possible issue is that the bios only sees three out of four DSPs. The first DSP (device number zero) is not seen. I have been ignoring this problem for the moment, assuming that this is some simple issue like device zero being special. We can easily change the hardware to move this device number if that is the case.

PCI: Probing PCI hardware
PCI: bridge rsrc 0..ffffff (100), parent c0185008
PCI: bridge rsrc 80000000..9fffffff (1200), parent c0185024
PCI: bridge rsrc a0000000..afffffff (200), parent c0185024
PCI: bridge rsrc 0..fff (101), parent c01e6038
PCI: bridge rsrc 0..fffff (200), parent c01e6070
PCI: Cannot allocate resource region 1 of PCI bridge 1
PCI: bridge 1 resource 1 moved to aff00000..afffffff
PCI: bridge rsrc 0..fffff (1201), parent c01e6054
PCI: Cannot allocate resource region 2 of PCI bridge 1
PCI: bridge 1 resource 2 moved to 9ff00000..9fffffff
PCI: bridge rsrc 0..fff (101), parent c01e6038
PCI: reparented PCI Bus #01 [0..fff] under PCI Bus #02
PCI: bridge rsrc 0..fffff (200), parent c01e6070
PCI: Cannot allocate resource region 1 of PCI bridge 2
PCI: bridge 2 resource 1 moved to afe00000..afefffff
PCI: bridge rsrc 0..fffff (1201), parent c01e6054
PCI: Cannot allocate resource region 2 of PCI bridge 2
PCI: bridge 2 resource 2 moved to 9fe00000..9fefffff PCI:0000:00:00.0: Resource 0: 00000000-0001ffff (f=200)
PCI: Cannot allocate resource region 0 of device 0000:00:00.0
PCI: parent is c01e6070: a0000000-afffffff (f=200) PCI:0000:00:00.0: Resource 1: 00000000-01ffffff (f=1208)
PCI: Cannot allocate resource region 1 of device 0000:00:00.0
PCI: parent is c01e6054: 80000000-9fffffff (f=1200) PCI:0000:01:01.0: Resource 0: 00000000-003fffff (f=1208)
PCI: Cannot allocate resource region 0 of device 0000:01:01.0
PCI: parent is c1fd2604: 9ff00000-9fffffff (f=1201) PCI:0000:01:01.0: Resource 1: 00000000-007fffff (f=200)
PCI: Cannot allocate resource region 1 of device 0000:01:01.0
PCI: parent is c1fd25e8: aff00000-afffffff (f=200) PCI:0000:01:01.0: Resource 2: 00000000-0000000f (f=101) PCI:0000:01:02.0: Resource 0: 00000000-003fffff (f=1208)
PCI: Cannot allocate resource region 0 of device 0000:01:02.0
PCI: parent is c1fd2604: 9ff00000-9fffffff (f=1201) PCI:0000:01:02.0: Resource 1: 00000000-007fffff (f=200)
PCI: Cannot allocate resource region 1 of device 0000:01:02.0
PCI: parent is c1fd25e8: aff00000-afffffff (f=200) PCI:0000:01:02.0: Resource 2: 00000000-0000000f (f=101)
PCI: Cannot allocate resource region 2 of device 0000:01:02.0
PCI: parent is c1fd25cc: 00000000-00000fff (f=101) PCI:0000:01:03.0: Resource 0: 00000000-003fffff (f=1208)
PCI: Cannot allocate resource region 0 of device 0000:01:03.0
PCI: parent is c1fd2604: 9ff00000-9fffffff (f=1201) PCI:0000:01:03.0: Resource 1: 00000000-007fffff (f=200)
PCI: Cannot allocate resource region 1 of device 0000:01:03.0
PCI: parent is c1fd25e8: aff00000-afffffff (f=200) PCI:0000:01:03.0: Resource 2: 00000000-0000000f (f=101)
PCI: Cannot allocate resource region 2 of device 0000:01:03.0
PCI: parent is c1fd25cc: 00000000-00000fff (f=101)
PCI: Failed to allocate mem resource #0:400000@a0000000 for 0000:01:01.0
PCI: Failed to allocate mem resource #1:800000@b0000000 for 0000:01:01.0
PCI: Failed to allocate mem resource #0:400000@a0000000 for 0000:01:02.0
PCI: Failed to allocate mem resource #1:800000@b0000000 for 0000:01:02.0
PCI: Failed to allocate I/O resource #2:10@1000 for 0000:01:02.0
PCI: Failed to allocate mem resource #0:400000@a0000000 for 0000:01:03.0
PCI: Failed to allocate mem resource #1:800000@b0000000 for 0000:01:03.0
PCI: Failed to allocate I/O resource #2:10@1000 for 0000:01:03.0

Conor

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#1 lore raw

Anyone with MPC82xx PCI on kernel 2.6?

I am trying to bring up a custom board which contains an MPC8250, a three-port PCI-PCI bridge and a few pci devices. I am using kernel 2.6.8.1. I am having a number of problems.

Currently I have just four devices hanging off one secondary bus of the pci-pci bridge. Apart from the bridge, I have no other devices hanging off bus 0. I have nothing yet hanging off bus 2.

                | bus 0
                |
    ------------------
    |                |
  ============      ============
  |bridge     |     | bridge    |
  |device 0x10|     |device 0x10|
  |function 0 |     |function 1 |
  ============      ============
      |bus 1             |bus 2
      |                  |
  ---------------------
  |         |         |
 device 1   device 2 device 3

Initially, the bios initialization would not assign resources to my devices on bus 1. The reason appeared to be that in pci_read_bridge_bases it reads the memory base and limit registers from the bridge. As these are initially zero, it sets a limit of 1MB for the resources assigned to bus 1.
My devices (DSP processors) look for a lot more memory space that that. I modified the function to assign sufficient resources for my needs and it now appears to assign memory resources to the devices correctly.

First question: Should the memory limit register be set in the bridge becore pci_read_bridge_bases? Is it perhaps assumed that the bios (boot code) sets this up?

I still have an issue with I/O resources that I am ignoring for now. My primary concern right now is verifying the hardware.

Now I try to access the devices on bus 1. I can read the configuration space no problem, but get bus error if I read the pci memory space. Checking everything obvious, I see that the the command register of the pci-pci bridge does not have the memory or I/O space bits set. Setting these bits eliminates the bus error.

Second question: What function should set the command register for the pci-pci bridge to enable access to the secondary bus for memory and I/O cycles?

Now I am at the stage where I don't get a bus error, but I read all FFs no matter where I read from bus 1. It doesn't appear to matter if a device is configured at the address or not.

Next question: What should I look at now? How do I tell if the device responded to the pci access?

Any help would be much appreciated.
Conor

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#2 lore raw

Re: Anyone with MPC82xx PCI on kernel 2.6?

Quoted 5 lines · Conor McLoughlin

Now I try to access the devices on bus 1. I can read the configuration space no problem, but get bus error if I read the pci memory space. Checking everything obvious, I see that the the command register of the pci-pci bridge does not have the memory or I/O space bits set. Setting these bits eliminates the bus error.

I have now discovered that the same bits were not set for the devices on bus 1. I am now reading reasonable values from the device :-)

I still need to know where these bits should be setup.

Conor

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/