Devicetree
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
To: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
Cc: Sergei Poselenov
	<sposelenov-qv+LCo8X3VpBDgjK7y7TUQ@public.gmane.org>,
	devicetree-discuss-mnsaURCQ41sdnm+yROfE0A@public.gmane.org,
	Ilya Yanok <yanok-qv+LCo8X3VpBDgjK7y7TUQ@public.gmane.org>,
	Dmitry Rakhchev <rda-qv+LCo8X3VpBDgjK7y7TUQ@public.gmane.org>,
	Yuri Tikhonov <yur-qv+LCo8X3VpBDgjK7y7TUQ@public.gmane.org>,
	linuxppc-dev-mnsaURCQ41sdnm+yROfE0A@public.gmane.org,
	Anatolij Gustschin <agust-ynQEQJNshbs@public.gmane.org>
Subject: Re: [PATCH 3/8] powerpc/85xx: Add support for the "socrates" board (MPC8544).
Date: Tue, 31 Mar 2009 09:57:41 -0600	[thread overview]
Message-ID: <fa686aa40903310857w57b9d020i71d56f33ede4e875@mail.gmail.com> (raw)
In-Reply-To: <20090331124035.594457231-ynQEQJNshbs@public.gmane.org>

On Tue, Mar 31, 2009 at 6:37 AM, Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org> wrote:
> Supported are Ethernet, serial console, I2C, I2C-based RTC and
> temperature sensors, NOR and NAND flash, PCI, USB, CAN and Lime
> display controller.
>
> The multiplexing of FPGA interrupts onto PowerPC interrupt lines is
> supported through our own fpga_pic interrupt controller driver.
>
> For example the SJA1000 controller is level low sensitive connected to
> fpga_pic line 2 and is routed to the second (of three) irq lines to
> the CPU:
>
>    can@3,100 {
>            compatible = "philips,sja1000";
>            reg = <3 0x100 0x80>;
>            interrupts = <2 2>;
>            interrupts = <2 8 1>;   // number, type, routing
>            interrupt-parent = <&fpga_pic>;
>    };
>
> Signed-off-by: Sergei Poselenov <sposelenov-qv+LCo8X3VpBDgjK7y7TUQ@public.gmane.org>
> Signed-off-by: Yuri Tikhonov <yur-qv+LCo8X3VpBDgjK7y7TUQ@public.gmane.org>
> Signed-off-by: Ilya Yanok <yanok-qv+LCo8X3VpBDgjK7y7TUQ@public.gmane.org>
> Signed-off-by: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
> Signed-off-by: Anatolij Gustschin <agust-ynQEQJNshbs@public.gmane.org>
> Signed-off-by: Dmitry Rakhchev <rda-qv+LCo8X3VpBDgjK7y7TUQ@public.gmane.org>
> ---
>  arch/powerpc/boot/dts/socrates.dts              |  338 +++++
>  arch/powerpc/configs/85xx/socrates_defconfig    | 1410 ++++++++++++++++++++++++

I always ask this question: Do you really need a board specific
defconfig file?  We are multiplatform now.

>  arch/powerpc/platforms/85xx/Kconfig             |    6
>  arch/powerpc/platforms/85xx/Makefile            |    1
>  arch/powerpc/platforms/85xx/socrates.c          |  133 ++
>  arch/powerpc/platforms/85xx/socrates_fpga_pic.c |  327 +++++
>  arch/powerpc/platforms/85xx/socrates_fpga_pic.h |   16

socrates_fpga_pic is only ever going to be used by socrates.c.  I'd
roll the two socrates.c files into one and eliminate the header file.

> Index: linux-2.6/arch/powerpc/platforms/85xx/socrates_fpga_pic.c
> ===================================================================
> --- /dev/null
> +++ linux-2.6/arch/powerpc/platforms/85xx/socrates_fpga_pic.c
[...]
> +struct socrates_fpga_irq_info {
> +       unsigned int irq_line;
> +       int type;
> +};
> +
> +/*
> + * Interrupt routing and type table
> + *
> + * IRQ_TYPE_NONE means the interrupt type is configurable,
> + * otherwise it's fixed to the specified value.
> + */
> +static struct socrates_fpga_irq_info fpga_irqs[SOCRATES_FPGA_NUM_IRQS] = {
> +       [0] = {0, IRQ_TYPE_NONE},
> +       [1] = {0, IRQ_TYPE_LEVEL_HIGH},
> +       [2] = {0, IRQ_TYPE_LEVEL_LOW},
> +       [3] = {0, IRQ_TYPE_NONE},
> +       [4] = {0, IRQ_TYPE_NONE},
> +       [5] = {0, IRQ_TYPE_NONE},
> +       [6] = {0, IRQ_TYPE_NONE},
> +       [7] = {0, IRQ_TYPE_NONE},
> +       [8] = {0, IRQ_TYPE_LEVEL_HIGH},
> +};

It is good practice to use named elements in initializers: {.type =
IRQ_TYPE_LEVEL_HIGH},

Static variables are initialized to zero.  Everything that is 0 can be
dropped from this initializer (lines 0 and 3-7, and the irq_line
field).

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

  parent reply	other threads:[~2009-03-31 15:57 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-31 12:37 [PATCH 0/8] powerpc: i2c-mpc: make I2C bus speed configurable Wolfgang Grandegger
2009-03-31 12:37 ` [PATCH 1/8] [PATCH 3/4] powerpc/85xx: Move gianfar mdio nodes under the Wolfgang Grandegger
2009-03-31 12:37 ` [PATCH 2/8] [PATCH 01/28] RTC: Add support for RX8025 chip Wolfgang Grandegger
2009-03-31 12:37 ` [PATCH 3/8] powerpc/85xx: Add support for the "socrates" board (MPC8544) Wolfgang Grandegger
     [not found]   ` <20090331124035.594457231-ynQEQJNshbs@public.gmane.org>
2009-03-31 15:57     ` Grant Likely [this message]
2009-03-31 19:20       ` Wolfgang Grandegger
2009-03-31 12:37 ` [PATCH 4/8] powerpc: i2c-mpc: preserve I2C clocking Wolfgang Grandegger
2009-03-31 12:37 ` [PATCH 5/8] powerpc: i2c-mpc: make I2C bus speed configurable Wolfgang Grandegger
2009-03-31 15:41   ` Grant Likely
2009-04-01  7:51     ` Wolfgang Grandegger
2009-04-01 13:30       ` Grant Likely
     [not found]         ` <fa686aa40904010630l798528efh465a7543a15f50e5-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-04-01 13:41           ` Wolfgang Grandegger
2009-04-01 13:55             ` Wolfgang Grandegger
     [not found]             ` <49D36F1F.2050107-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2009-04-01 13:55               ` Grant Likely
     [not found]                 ` <fa686aa40904010655i73819214m795939e784889267-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-04-02  6:55                   ` Wolfgang Grandegger
2009-03-31 12:37 ` [PATCH 6/8] --- arch/powerpc/boot/dts/socrates.dts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) Wolfgang Grandegger
2009-03-31 23:04   ` David Gibson
2009-04-01  7:31     ` Wolfgang Grandegger
     [not found]       ` <49D31856.9060808-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2009-04-01 11:09         ` David Gibson
2009-04-01 11:59           ` Wolfgang Grandegger
2009-04-01 23:57             ` David Gibson
2009-04-01 12:30           ` Anton Vorontsov
2009-04-01 23:58             ` David Gibson
2009-03-31 12:37 ` [PATCH 7/8] Re: [PATCH 1/2] NAND: Add support for oob size 128 Wolfgang Grandegger
2009-03-31 12:37 ` [PATCH 8/8] NAND: Add support for NAND on the Socrates board Wolfgang Grandegger
2009-03-31 12:49 ` [PATCH 0/8] powerpc: i2c-mpc: make I2C bus speed configurable Wolfgang Grandegger
2009-03-31 16:23   ` Grant Likely

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=fa686aa40903310857w57b9d020i71d56f33ede4e875@mail.gmail.com \
    --to=grant.likely-s3s/wqlpoipyb63q8fvjnq@public.gmane.org \
    --cc=agust-ynQEQJNshbs@public.gmane.org \
    --cc=devicetree-discuss-mnsaURCQ41sdnm+yROfE0A@public.gmane.org \
    --cc=linuxppc-dev-mnsaURCQ41sdnm+yROfE0A@public.gmane.org \
    --cc=rda-qv+LCo8X3VpBDgjK7y7TUQ@public.gmane.org \
    --cc=sposelenov-qv+LCo8X3VpBDgjK7y7TUQ@public.gmane.org \
    --cc=wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org \
    --cc=yanok-qv+LCo8X3VpBDgjK7y7TUQ@public.gmane.org \
    --cc=yur-qv+LCo8X3VpBDgjK7y7TUQ@public.gmane.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