From: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
To: lee.nipper@gmail.com
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 3/6] powerpc/85xx: separate MPIC handling code
Date: Thu, 17 Nov 2011 22:43:35 +0400 [thread overview]
Message-ID: <4EC555D7.1080808@gmail.com> (raw)
In-Reply-To: <CALg11mj7DG2KE=pODJ526zQdQZSc4vFuDCtEGGYXNiwxpGAcyA@mail.gmail.com>
On 11/17/2011 10:30 PM, Lee Nipper wrote:
> On Thu, Nov 17, 2011 at 11:56 AM, Dmitry Eremin-Solenikov
> <dbaryshkov@gmail.com> wrote:
>> All mpc85xx boards deal with MPIC initialization in more or less the
>> same way. The only difrerences are some flags (WANTS_RESET,
>> BROKEN_FRR_NIRQS, SINGLE_DEST_CPU), and some bugs like leaking device
>> node counter, etc. To minimize problems, switch all boards to use one
>> single instance of code.
>>
>> Signed-off-by: Dmitry Eremin-Solenikov<dbaryshkov@gmail.com>
>
> <snip>
>
>> diff --git a/arch/powerpc/platforms/85xx/mpc85xx_common.c b/arch/powerpc/platforms/85xx/mpc85xx_common.c
>> index fe40668..7579e24 100644
>> --- a/arch/powerpc/platforms/85xx/mpc85xx_common.c
>> +++ b/arch/powerpc/platforms/85xx/mpc85xx_common.c
>> @@ -7,6 +7,9 @@
>> */
>> #include<linux/of_platform.h>
>>
>> +#include<asm/machdep.h>
>> +#include<asm/mpic.h>
>> +
>> #include<sysdev/cpm2_pic.h>
>>
>> #include "mpc85xx.h"
>> @@ -63,3 +66,43 @@ void __init mpc85xx_cpm2_pic_init(void)
>> irq_set_chained_handler(irq, cpm2_cascade);
>> }
>> #endif
>> +
>> +
>> +void __init mpc85xx_init_mpic(bool reset, bool broken_frr, bool singledest)
>> +{
>> + struct mpic *mpic;
>> + struct resource r;
>> + struct device_node *np = NULL;
>> + unsigned int flags = MPIC_PRIMARY | MPIC_BIG_ENDIAN |
>> + MPIC_BROKEN_FRR_NIRQS | MPIC_SINGLE_DEST_CPU;
>
> since parameters broken_frr and singledest are used later,
> flags should probably be just:
>
> unsigned int flags = MPIC_PRIMARY | MPIC_BIG_ENDIAN;
Yes, forgot about this when cleaning up. Sorry.
>
>> +
>> + np = of_find_node_by_type(np, "open-pic");
>> +
>> + if (np == NULL) {
>> + printk(KERN_ERR "Could not find open-pic node\n");
>> + return;
>> + }
>> +
>> + if (of_address_to_resource(np, 0,&r)) {
>> + printk(KERN_ERR "Failed to map mpic register space\n");
>> + of_node_put(np);
>> + return;
>> + }
>> +
>> + if (reset)
>> + flags |= MPIC_WANTS_RESET;
>> + if (broken_frr)
>> + flags |= MPIC_BROKEN_FRR_NIRQS;
>> + if (singledest)
>> + flags |= MPIC_SINGLE_DEST_CPU;
>> + if (ppc_md.get_irq == mpic_get_coreint_irq)
>> + flags |= MPIC_ENABLE_COREINT;
>> +
>> + mpic = mpic_alloc(np, r.start, flags, 0, 256, " OpenPIC ");
>> + BUG_ON(mpic == NULL);
>> +
>> + /* Return the mpic node */
>> + of_node_put(np);
>> +
>> + mpic_init(mpic);
>> +}
>
> <snip>
>
>> --
>> 1.7.7.1
--
With best wishes
Dmitry
next prev parent reply other threads:[~2011-11-17 18:44 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-17 17:56 [PATCH 1/6] powerpc/85xx: separate cpm2 pic init Dmitry Eremin-Solenikov
2011-11-17 17:56 ` [PATCH 2/6] powerpc/85xx: consolidate of_platform_bus_probe calls Dmitry Eremin-Solenikov
2011-11-24 7:15 ` Kumar Gala
2011-11-28 23:42 ` Tabi Timur-B04825
2011-11-29 15:48 ` Kumar Gala
2011-11-29 16:17 ` Timur Tabi
2011-11-29 16:20 ` Timur Tabi
2011-11-29 16:38 ` Kumar Gala
2011-11-29 18:52 ` Timur Tabi
2011-11-29 19:59 ` Kumar Gala
2011-11-29 22:53 ` Timur Tabi
2011-11-29 19:46 ` Scott Wood
2011-11-17 17:56 ` [PATCH 3/6] powerpc/85xx: separate MPIC handling code Dmitry Eremin-Solenikov
2011-11-17 18:30 ` Lee Nipper
2011-11-17 18:43 ` Dmitry Eremin-Solenikov [this message]
2011-11-17 21:20 ` Stephen Rothwell
2011-11-17 21:33 ` Scott Wood
2011-11-17 17:56 ` [PATCH 4/6] powerpc/85xx: unify common parts of *_setup_arch Dmitry Eremin-Solenikov
2011-11-17 17:56 ` [PATCH 5/6] powerpc/85xx: separate i8259 handling to common function Dmitry Eremin-Solenikov
2011-11-17 17:56 ` [PATCH 6/6] poewrpc/85xx: headers cleanup Dmitry Eremin-Solenikov
2011-11-17 21:22 ` Stephen Rothwell
2011-11-24 7:15 ` [PATCH 1/6] powerpc/85xx: separate cpm2 pic init Kumar Gala
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=4EC555D7.1080808@gmail.com \
--to=dbaryshkov@gmail.com \
--cc=lee.nipper@gmail.com \
--cc=linuxppc-dev@lists.ozlabs.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).