Using the generic host PCIe driver

Mason slash.tmp at free.fr
Fri Mar 3 08:53:58 PST 2017


On 03/03/2017 17:41, Marc Zyngier wrote:
> On Fri, Mar 03 2017 at 11:26:27 am GMT, Mason <slash.tmp at free.fr> wrote:
>> On 01/03/2017 17:36, Marc Zyngier wrote:
>>
>>> Mason: while the kernel has generic support for dealing with MSI, there
>>> is not standardization at the interrupt controller level, so you do have
>>> to write your own driver, and wire it in the rest of the framework.
>>>
>>> I suggest you look at things like drivers/pci/host/pcie-altera-msi.c,
>>> which has an extremely simple implementation. You can use this as a
>>> starting point for your own driver.
>>
>> Thanks Marc,
>>
>> I'll have a close look at the Altera driver.
>>
>> I'm having a hard time understanding 3 different kinds of interrupts:
>>
>>   1. MSI (message-signalled interrupts)
>>   2. legacy interrupts
>>   3. custom interrupts
> 
> [...]
> 
>> I suppose the interrupt controller I'm supposed to write needs
>> to handle all 3 types of interrupts?
> 
> That's entirely up to you. INTx is the bare minimum.

That's going to be a problem. Rev 1 of the PCIe controller does not
support legacy interrupts at all.

> MSI is what people
> actually need. The rest has more to do with configuring your host
> controller, but only you know about it (and I'm not really interested in
> the gory details of how this particular HW works).

I was under the impression that some of the error interrupts might be
required for proper PCIe functionality.

> I mentioned the Altera driver because it is a very simple example of an
> MSI controller driver that uses the generic MSI domains. It doesn't care
> about INTx, nor host controller management interrupts (that's handled
> separately).

OK, MSI support is all I need to start with, so I'll try my best to
decipher the cryptic intc API, without melting my remaining neuron.

Regards.



More information about the linux-arm-kernel mailing list