linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: kaloz@openwrt.org (Imre Kaloz)
To: linux-arm-kernel@lists.infradead.org
Subject: IXP4xx: unneeded #include platform-specific include files?
Date: Wed, 18 Nov 2009 00:05:21 +0100	[thread overview]
Message-ID: <op.u3kae7qg2s3iss@richese> (raw)
In-Reply-To: <m3ocn04vma.fsf@intrepid.localdomain>

On 2009.11.17. 23:47:09 Krzysztof Halasa <khc@pm.waw.pl> wrote:

> "Imre Kaloz" <kaloz@openwrt.org> writes:
>
>> Yeah, you get rid of the external .h files for dropping all that bloat
>> into the setup
>> files. Honestly, do however you please, but this hardly makes sense
>> IMHO when you have
>> the chance to get rid of all this mess.
>
> What I'm thinking about is (cut & paste):
>
> --- a/arch/arm/mach-ixp4xx/avila-pci.c
> +++ b/arch/arm/mach-ixp4xx/avila-pci.c
> @@ -27,49 +27,40 @@
>  #include <mach/hardware.h>
>  #include <asm/mach-types.h>
>-#define AVILA_PCI_MAX_DEV      4
> -#define LOFT_PCI_MAX_DEV       6
> -#define AVILA_PCI_IRQ_LINES    4
> +#define AVILA_MAX_DEV  4
> +#define LOFT_MAX_DEV   6
> +#define IRQ_LINES      4
> /* PCI controller GPIO to IRQ pin mappings */
> -#define AVILA_PCI_INTA_PIN     11
> -#define AVILA_PCI_INTB_PIN     10
> -#define AVILA_PCI_INTC_PIN     9
> -#define AVILA_PCI_INTD_PIN     8
> -
> -#define IRQ_AVILA_PCI_INTA     IRQ_IXP4XX_GPIO11
> -#define IRQ_AVILA_PCI_INTB     IRQ_IXP4XX_GPIO10
> -#define IRQ_AVILA_PCI_INTC     IRQ_IXP4XX_GPIO9
> -#define IRQ_AVILA_PCI_INTD     IRQ_IXP4XX_GPIO8
> +#define INTA           11
> +#define INTB           10
> +#define INTC           9
> +#define INTD           8
>
> You can see the duplicate definitions removed.
> BTW: I don't like it much, but using ordinary GPIOx certainly
> isn't better.
>
> (Yep, I see at least one bug which the patches should fix, will do).
>
>  void __init avila_pci_preinit(void)
>  {
> -       set_irq_type(IRQ_AVILA_PCI_INTA, IRQ_TYPE_LEVEL_LOW);
> -       set_irq_type(IRQ_AVILA_PCI_INTB, IRQ_TYPE_LEVEL_LOW);
> -       set_irq_type(IRQ_AVILA_PCI_INTC, IRQ_TYPE_LEVEL_LOW);
> -       set_irq_type(IRQ_AVILA_PCI_INTD, IRQ_TYPE_LEVEL_LOW);
> -
> +       set_irq_type(IXP4XX_GPIO_IRQ(INTA), IRQ_TYPE_LEVEL_LOW);
> +       set_irq_type(IXP4XX_GPIO_IRQ(INTB), IRQ_TYPE_LEVEL_LOW);
> +       set_irq_type(IXP4XX_GPIO_IRQ(INTC), IRQ_TYPE_LEVEL_LOW);
> +       set_irq_type(IXP4XX_GPIO_IRQ(INTD), IRQ_TYPE_LEVEL_LOW);
>         ixp4xx_pci_preinit();
>  }


This is far more tolerable, but SLOT1-3 would be better. Also, the
_MAX thingie should be dropped, for example the LOFT is nothing more
then an avila with an USB2 controller on the same IRQ as slot 3, where
the USB1.1 subdevices will show up as well. Those subdevices won't show
up on a board without the USB controller, but all this will blow up when
someone plugs a miniPCI USB controller into one of the slots, not to
mention if he/she plugs in more ;)

Now the best question: do those PCI subdevices need an IRQ? If there is only
one IRQ connected to a PCI slot (probably), does it make sense to assign
IRQs/GPIOs without any effect?


Imre

  reply	other threads:[~2009-11-17 23:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-15 17:16 IXP4xx: unneeded #include platform-specific include files? Krzysztof Halasa
2009-11-15 18:27 ` Mikael Pettersson
2009-11-15 20:18   ` Imre Kaloz
2009-11-15 21:14     ` Krzysztof Halasa
2009-11-17 21:37       ` Imre Kaloz
2009-11-17 21:53         ` Krzysztof Halasa
2009-11-17 22:11           ` Imre Kaloz
2009-11-17 22:22             ` Krzysztof Halasa
2009-11-17 22:34               ` Imre Kaloz
2009-11-17 22:47                 ` Krzysztof Halasa
2009-11-17 23:05                   ` Imre Kaloz [this message]
2009-11-18  0:10                     ` Krzysztof Halasa
2009-11-15 18:41 ` Mike Westerhof

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=op.u3kae7qg2s3iss@richese \
    --to=kaloz@openwrt.org \
    --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).