linux/drivers/staging/mt7621-dts
Sergio Paracuellos fab6710e4c staging: mt7621-pci: fix PCIe interrupt mapping
MT7621 has three assigned interrupts for the pcie. This
interrupts should properly being mapped taking into account
which devices are finally connected in which bus according
to link status. So the irq mappings should be as follows
according to link status (three bits indicating which devices
are link up):

* For PCIe Bus 1 slot 0:
  - status = 0x2 || status = 0x6 => IRQ = pcie1_irq (24).
  - status = 0x4 => IRQ = pcie2_irq (25).
  - default => IRQ = pcie0_irq (23).
* For PCIe Bus 2 slot 0:
  - status = 0x5 || status = 0x6 => IRQ = pcie2_irq (25).
  - default => IRQ = pcie1_irq (24).
* For PCIe Bus 2 slot 1:
  - status = 0x5 || status = 0x6 => IRQ = pcie2_irq (25).
  - default => IRQ = pcie1_irq (24).
* For PCIe Bus 3 any slot:
  - default => IRQ = pcie2_irq (25).

Because of this, the function 'of_irq_parse_and_map_pci' cannot
be used and we need to change device tree information from using
the 'interrupt-map' and 'interrupt-map-mask' properties into an
'interrupts' property to be able to get irq information from the
ports using the 'platform_get_irq' and storing an 'irq-map' into
the pcie driver data node to properly map correct irq using a
new 'mt7621_map_irq' function where this map will be read and the
correct irq returned.

Fixes: 46d093124d ("staging: mt7621-pci: improve interrupt mapping")
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Link: https://lore.kernel.org/r/20200413055942.2714-1-sergio.paracuellos@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 14:49:18 +02:00
..
gbpc1.dts staging: mt7621-dts: gpio 8 and 9 are vendor specific 2020-03-21 10:31:54 +01:00
gbpc2.dts staging: mt7621-dts: add support for second network interface 2019-07-03 18:28:29 +02:00
Kconfig staging: mt7621-dts: add support for second network interface 2019-07-03 18:28:29 +02:00
Makefile staging: mt7621-dts: add support for second network interface 2019-07-03 18:28:29 +02:00
mt7621.dtsi staging: mt7621-pci: fix PCIe interrupt mapping 2020-04-13 14:49:18 +02:00
TODO staging: Add missing newline at end of file 2019-06-18 08:59:40 +02:00