Re: PCI interrupt question

2009-12-03 Thread Jeff Hane
On Thu, 2009-12-03 at 09:11 -0800, David Hawkins wrote:
 Hi Jeff,
 
   I'm trying to get interrupts working for my PCI device on a 460ex and
  am having problem.  My ISR never triggers.
  
  I'm new to PCI(and ppc) and LDD said that I could read the config reg
  INTURRUPT_LINE to get the interrupt assigned to my PCI device.  Well,
  this always reads zero. 
  
  After reading through the code it appears that the interrupt is being
  assigned after reading some information out of the device tree and then
  filling in the irg in the pci_dev structure.  
  
  I'm just looking for confirmation that I should be calling request_irq
  with the irq that I found in the pci_dev struct.
 
 Can you clarify:
 
 1. 460EX is your PCI host CPU?

yes.  We are using a canyonlands board with 460ex.

 
 2. You have some PCI device - what? Have you tested it works in a
 standard PCI bus? Eg. ran lspci from an x86 host.

It is a FPGA board that we are using to develop a video codec/SOC.  We
have not connected it an x86; however, we know the the PCI interface is
working because we can talk to the FPGA board.

 
 3. When your host processor boots, it assigns the PCI resources.
 On an x86, its the BIOS that assigns the PCI addresses and IRQs
 on the PCI devices. For your 460EX, it could be your bootloader,
 or it could be your host OS (Linux).

We are using the vanilla versions of u-boot and linux for the
canyonlands boards and have made few changes and definitely not to the
PCI setup.

 
 4. If you boot Linux on your 460EX and run lspci, and the device
 configuration space register for the IRQ line is 0, then your
 host has not setup the PCI interface on your device correctly.

 5. Once you have the PCI IRQ assigned to the device correctly,
 you need to know which IRQ line on the host this corresponds to.
 I'm pretty sure that needs to be described in the DTS as
 commented by Stefan.
 

 So are you saying linux should be writing the irq number to the
INTERRUPT_LINE config reg?  This is what I expected but I do not see
it.  
 I believe the DTS is being parsed properly and the connection is made
to the correct interrupt line on the device.  But somebody still needs
to assign and IRQ number, right?  This is the part that is not clear,
there is an irq field in pci_dev structure which is filled in after
looking at the DTS and I just want to be sure this is the irq number to
be used when calling request_irq.

thanks,
jeff



 These comments might not be 100% correct, but the list of things
 to check should be close enough for you to track down your
 problem.
 
 Cheers,
 Dave
 

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


PCI interrupt question

2009-12-02 Thread Jeff Hane
Hello, 

 I'm trying to get interrupts working for my PCI device on a 460ex and
am having problem.  My ISR never triggers.

I'm new to PCI(and ppc) and LDD said that I could read the config reg
INTURRUPT_LINE to get the interrupt assigned to my PCI device.  Well,
this always reads zero. 

After reading through the code it appears that the interrupt is being
assigned after reading some information out of the device tree and then
filling in the irg in the pci_dev structure.  

I'm just looking for confirmation that I should be calling request_irq
with the irq that I found in the pci_dev struct.

thanks,
jeff


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


GPIOs 49-63 on 460EX

2009-08-31 Thread Jeff Hane

Hello,

 We are having a problem trying to use gpio 49-63 on our amcc
canyonlands board.  I'm aware these pins are shared with the trace port,
so wrote 0x7ff to SDR0_PFC0 register to make sure they were all in gpio
mode. 

 I set the gpio to output and then try to drive a 1 out but I can never
see it.  I doubled checked the pin with the value reported by the SW and
it never toggles.  If I set the value to 1, I can see a 1 in the gpio OR
register, but the IR stays 0(IR is what is read by get_value)
 
 I can change the direction and value the first 16 gpios in gpio
controller 1 but not the upper 16 bits.  So this means that gpio 48
doesn't work either; thus 16 of the gpio don't work(for out, I haven't
tried in)

 I am running 2.6.30.  Has anybody seen this?  Am I missing a register
somewhere?

thanks,
jeff


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev