linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: l.stach@pengutronix.de (Lucas Stach)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 0/3] PCI: imx6: fixup for add-in card IRQ mismapping
Date: Fri, 28 Feb 2014 17:55:43 +0100	[thread overview]
Message-ID: <1393606543.5225.15.camel@weser.hi.pengutronix.de> (raw)
In-Reply-To: <CAJ+vNU0oLGQ1oGnN3jxKJwKMiA3693hVkqbVhShYY0+SMXoH6Q@mail.gmail.com>

Am Freitag, den 28.02.2014, 08:52 -0800 schrieb Tim Harvey:
> On Thu, Feb 27, 2014 at 10:22 PM, Jingoo Han <jg1.han@samsung.com> wrote:
> > On Friday, February 28, 2014 1:16 PM, Tim Harvey wrote:
> >> On Thu, Feb 27, 2014 at 5:50 PM, Jingoo Han <jg1.han@samsung.com> wrote:
> >> >
> >> > On Friday, February 28, 2014 10:20 AM, Tim Harvey wrote:
> >> > >
> >> > > An add-in card used on the Ventana IMX6 SoC based family of boards has a
> >> > > TI XIO2001 PCIe-to-PCI bridge where the INTA/B/C/D mappings between the
> >> > > bridge and the four mini-PCI slots are swapped (INTD/C/B/A).
> >> >
> >> > (+cc Marek Vasut, Pratyush Anand, Kishon Vijay Abraham I, Mohit KUMAR DCG)
> >> >
> >> > This problem happens from the 'Board', not a 'SoC'.
> >> > 'TI XIO2001 PCIe-to-PCI bridge' is not a 'SoC'.
> >> > 'pci-imx6.c' is the driver for 'IMX6 PCI IP', not for 'IMX6 SoC based
> >> > board'. Isn't it?
> >>
> >> Jingoo,
> >>
> >> Correct, this is an issue in the way the XIO2001 was hooked up to the
> >> PCI slots, so it should be viewed as a board issue.
> >
> > (+CC Arnd Bergmann)
> >
> > Then, this board fixup code should NOT be placed in './drivers/pci/host/'
> > side.
> >
> >>
> >> >
> >> > Then, the workaround code for board problem should NOT be
> >> > included to './drivers/pci/host/' side.
> >>
> >> I would agree, but to overcome this sort of interrupt mapping issue
> >> one would need to either implement a custom swizzle or perhaps a
> >> custom map_irq and both of those are hooked into the pcie driver core.
> >>  Do you have any suggestions on where/how I would better hook into
> >> those?
> >
> > Anyway, 'TI XIO2001 PCIe-to-PCI bridge' chip on the board is the
> > culprit. So, the board specific side is a good place.
> > For instance, ./arch/arm/mach-imx/
> >
> > I don't know how to handle this problem.
> > But, there is no reason that 'pcie-designware.c' should take a care
> > of the board specific issue.
> >
> > Arnd Bergmann,
> > Would you give your opinions?
> 
> I agree with what your saying, but I don't see a way to put a custom
> map_irq or swizzle in arch/arm/mach-imx when the imx6 pcie driver is
> in drivers/pci/host.   Many machines sitll have their pcie host
> controller drivers in arch/arm/mach-* but the imx6 was placed in
> drivers/host/pci because it shares the designware core with other
> boards (exynos if not more).
> 
> If you look at the PATCH 3/3, I did take care to work around this in
> pci-imx6.c 'not' pcie-designware.c (I had to add support for assigning
> a custom swizzle - see PATH 2/3).
> 
> I'm looking for suggestions as to if/how to get it into someplace more
> 'board-specific' (arch/arm/mach-imx) or 'device-specific' (ie pci
> fixup for xio2001).  As far as I can tell this has to be resolved with
> either a custom swizzle or map_irq which are function pointers in
> struct hw_pci which is passed in to pci_common_init from pci host
> controller drivers.
> 
> Perhaps there is a way to re-assign the swizzle function after
> pcie-designware.c has called pci_common_init?  I see that
> pcibios_init_hw assignes the map_irq/swizzle passed in from the struct
> hw_pci to a struct pci_sys_data yet I'm not sure if I can get to this
> structure within a pci fixup.
> 

I'll send a series to fix the IRQ mapping in the host driver in a few
minutes. After this you should be able to trivially represent you
swizzled IRQ lines by adding your PCIe-to-PCI bridge in the devicetree
of your board and set the correct IRQ mapping table.

Regards,
Lucas
-- 
Pengutronix e.K.                           | Lucas Stach                 |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-5076 |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

      reply	other threads:[~2014-02-28 16:55 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-28  1:19 [RFC PATCH 0/3] PCI: imx6: fixup for add-in card IRQ mismapping Tim Harvey
2014-02-28  1:19 ` [PATCH 1/3] PCI: designware: add legacy PCI interrupt mapping Tim Harvey
2014-02-28  2:00   ` Jingoo Han
2014-02-28  4:24     ` Tim Harvey
2014-02-28  7:01       ` Jingoo Han
2014-02-28 10:12         ` Marek Vasut
2014-02-28 11:27         ` Lucas Stach
2014-02-28 11:37           ` Arnd Bergmann
2014-02-28 12:09             ` Lucas Stach
2014-02-28 12:27               ` Arnd Bergmann
2014-02-28 13:53                 ` Lucas Stach
2014-02-28  2:10   ` Shawn Guo
2014-02-28  1:19 ` [PATCH 2/3] PCI: designware: add ability for custom swizzle Tim Harvey
2014-02-28  1:19 ` [PATCH 3/3] PCI: imx6: ventana: fixup for IRQ mismapping Tim Harvey
2014-02-28  2:10   ` Jingoo Han
2014-02-28  9:27   ` Arnd Bergmann
2014-02-28 17:39     ` Jason Gunthorpe
2014-03-01  0:52       ` Tim Harvey
2014-03-01  1:22         ` Jason Gunthorpe
2014-03-03 19:59           ` Tim Harvey
2014-03-03 23:37             ` Jason Gunthorpe
2014-03-04  0:38               ` Tim Harvey
2014-03-04  1:01                 ` Jason Gunthorpe
2014-02-28  1:50 ` [RFC PATCH 0/3] PCI: imx6: fixup for add-in card " Jingoo Han
2014-02-28  4:16   ` Tim Harvey
2014-02-28  6:22     ` Jingoo Han
2014-02-28 10:15       ` Marek Vasut
2014-02-28 16:52       ` Tim Harvey
2014-02-28 16:55         ` Lucas Stach [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1393606543.5225.15.camel@weser.hi.pengutronix.de \
    --to=l.stach@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).