public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Sylvain Munaut <tnt@246tNt•com>
To: Nicolas DET <nd@bplan-gmbh•de>
Cc: akpm@osdl•org, sl@bplan-gmbh•de, linuxppc-dev@ozlabs•org,
	linuxppc-embedded@ozlabs•org, sha@pengutronix•de
Subject: Re: [PATCH] General CHRP/MPC5K2 platform support patch
Date: Sat, 28 Oct 2006 00:05:09 +0200	[thread overview]
Message-ID: <45428295.7090608@246tNt.com> (raw)
In-Reply-To: <45421C97.80501@bplan-gmbh.de>

Hi Nicolas,

Here is a few comments. I'm not very familiar with the new irq stuff so
others
might have more insights.


Sylvain

> --- a/arch/powerpc/sysdev/mpc52xx_pic.c	1970-01-01 01:00:00.000000000 +0100
> +++ b/arch/powerpc/sysdev/mpc52xx_pic.c	2006-10-27 15:58:29.000000000 +0200
> @@ -0,0 +1,414 @@
> +/*
> + * arch/powerpc/sysdev/mpc52xx_pic.c
>   
Looks like jdl is right, we apparently don't do that any more ... So
let's not ;)
> + * Based on (well, mostly copied from) the code from the 2.4 kernel by
> + * Dale Farnsworth <dfarnsworth@mvista•com> and Kent Borg.
>   
That can be removed ... We can't blame Dale anymore if it doesn't work ;)

> +
> +static void mpc52xx_ic_mask_and_ack(unsigned int irq)
> +{
> +	mpc52xx_ic_mask(irq);
> +	mpc52xx_ic_ack(irq);
> +}
>   
>From kernel/irq/chip.c that's done automatically if mask_and_ack is NULL.

> +
> +static struct irq_chip mpc52xx_irqchip = {
> +	.typename = " MPC52xx  ",
> +	.mask = mpc52xx_ic_mask,
> +	.unmask = mpc52xx_ic_unmask,
> +	.mask_ack = mpc52xx_ic_mask_and_ack,
> +};
Is it useful to implement set_type for IRQ[0-3] ? (Just asking ...)

> +	for (i = 0; i < NR_IRQS; i++) {
> +		irq_desc[i].chip = &mpc52xx_irqchip;
> +		irq_desc[i].status = IRQ_LEVEL;
> +
> +	}
>   
All LEVEL ?

> +
> +	/*
> +	 * As last step, add an irq host to translate the real
> +	 * hw irq information provided by the ofw to linux virq
> +	 */
> +
> +	mpc52xx_irqhost =
> +	    irq_alloc_host(IRQ_HOST_MAP_LINEAR, NR_IRQS, &mpc52xx_irqhost_ops,
> +			   -1);
> +}
>   
NR_IRQS ? Might be time to do something better.



> diff -uprN a/include/asm-powerpc/mpc52xx.h b/include/asm-powerpc/mpc52xx.h
> --- a/include/asm-powerpc/mpc52xx.h	1970-01-01 01:00:00.000000000 +0100
> +++ b/include/asm-powerpc/mpc52xx.h	2006-10-27 15:51:55.000000000 +0200
> @@ -0,0 +1,414 @@
> +/*
> + * include/asm-ppc/mpc52xx.h
> + * 
> + * Prototypes, etc. for the Freescale MPC52xx embedded cpu chips
> + * May need to be cleaned as the port goes on ...
> + *
> + *
> + * Maintainer : Sylvain Munaut <tnt@246tNt•com>
> + *
> + * Originally written by Dale Farnsworth <dfarnsworth@mvista•com> 
> + * for the 2.4 kernel.
>   
Again, remove all that (just leave the first line of the description)

> +
> +/* ======================================================================== */
> +/* IRQ mapping                                                              */
> +/* ======================================================================== */
> +
> +#define MPC52xx_IRQ_L1_CRIT	0
> +#define MPC52xx_IRQ_L1_MAIN	1
> +#define MPC52xx_IRQ_L1_PERP	2
> +#define MPC52xx_IRQ_L1_SDMA	3
> +
> +#define MPC52xx_IRQ_L1_OFFSET  (6)
> +#define MPC52xx_IRQ_L1_MASK    (0xc0)
> +
> +#define MPC52xx_IRQ_L2_OFFSET  (0)
> +#define MPC52xx_IRQ_L2_MASK    (0x3f)
>   
As benh suggested on IRC, a L1 offset of 8 might be better for
readability of the
hw irq numbers.

  parent reply	other threads:[~2006-10-27 22:05 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-25 19:05 [PATCH] General CHRP/MPC5K2 platform support patch Nicolas DET
2006-10-25 21:59 ` Paul Mackerras
2006-10-25 22:41   ` Grant Likely
2006-10-25 22:59     ` Benjamin Herrenschmidt
2006-10-26 11:09       ` Nicolas DET
2006-10-26 11:17     ` Nicolas DET
2006-10-25 22:53 ` Benjamin Herrenschmidt
2006-10-26 11:09   ` Nicolas DET
2006-10-26 12:49     ` Benjamin Herrenschmidt
2006-10-26 12:59       ` Nicolas DET
2006-10-26 16:02         ` Grant Likely
2006-10-26 16:09           ` Grant Likely
2006-10-26 17:06             ` Nicolas DET
2006-10-26 17:54               ` Sylvain Munaut
2006-10-27  3:08                 ` Benjamin Herrenschmidt
2006-10-26 19:14               ` Grant Likely
2006-10-26 19:21                 ` Nicolas DET
2006-10-26 19:32                   ` Nicolas DET
2006-10-27  2:49               ` Benjamin Herrenschmidt
2006-10-26 16:45           ` Sven Luther
2006-10-26 19:50           ` Nicolas DET
2006-10-26 20:00             ` Grant Likely
2006-10-26 20:51               ` Sylvain Munaut
2006-10-27  3:28               ` Benjamin Herrenschmidt
2006-10-27 14:52                 ` Nicolas DET
2006-10-27 15:04                   ` Nicolas DET
2006-10-27 17:08                     ` Jon Loeliger
2006-10-28  0:27                       ` Stephen Rothwell
2006-10-27 22:34                     ` Benjamin Herrenschmidt
2006-10-27 22:05                   ` Sylvain Munaut [this message]
2006-10-25 23:01 ` Grant Likely
2006-10-25 23:06   ` Benjamin Herrenschmidt
2006-10-25 23:13     ` Sven Luther
2006-10-26 12:09     ` Nicolas DET
2006-10-26 12:51       ` Benjamin Herrenschmidt
2006-10-26 17:17 ` John Rigby
2006-10-26 17:23   ` Nicolas DET
2006-10-26 17:33   ` Sylvain Munaut
2006-10-27  3:03     ` Benjamin Herrenschmidt
2006-10-27  2:57   ` Benjamin Herrenschmidt

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=45428295.7090608@246tNt.com \
    --to=tnt@246tnt$(echo .)com \
    --cc=akpm@osdl$(echo .)org \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    --cc=linuxppc-embedded@ozlabs$(echo .)org \
    --cc=nd@bplan-gmbh$(echo .)de \
    --cc=sha@pengutronix$(echo .)de \
    --cc=sl@bplan-gmbh$(echo .)de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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