Message ID | 1ba63b520905290356l5d519e64w3bd852d8fc4032be@mail.gmail.com (mailing list archive) |
---|---|
State | Rejected, archived |
Headers | show |
On Fri, May 29, 2009 at 12:56:13PM +0200, Frank Svendsbøe wrote: > FYI. The same applies to mpc8xx targets: No default host interrupt controller. > The following patch was needed for our target: > --- > diff --git a/arch/powerpc/sysdev/mpc8xx_pic.c b/arch/powerpc/sysdev/mpc8xx_pic.c > index 5d2d552..92b2b66 100644 > --- a/arch/powerpc/sysdev/mpc8xx_pic.c > +++ b/arch/powerpc/sysdev/mpc8xx_pic.c > @@ -186,6 +186,7 @@ int mpc8xx_pic_init(void) > ret = -ENOMEM; > goto out; > } > + irq_set_default_host(mpc8xx_pic_host); > return 0; This patch is whitespace mangled. > > out: > --- > Maybe setting a default host ought to be mandatory? Or is doing the > mapping manually > (without device tree descriptions) considered being a hack? I consider it a hack -- not so much doing it manually (though the device tree is better), but relying on a default interrupt controller when doing so. IRQ numbers only make sense in the context of a specific controller. It's especially misleading on 8xx, which has separate regular and CPM PICs. -Scott
On Fri, May 29, 2009 at 7:18 PM, Scott Wood <scottwood@freescale.com> wrote: > On Fri, May 29, 2009 at 12:56:13PM +0200, Frank Svendsbře wrote: >> FYI. The same applies to mpc8xx targets: No default host interrupt controller. >> The following patch was needed for our target: >> --- >> diff --git a/arch/powerpc/sysdev/mpc8xx_pic.c b/arch/powerpc/sysdev/mpc8xx_pic.c >> index 5d2d552..92b2b66 100644 >> --- a/arch/powerpc/sysdev/mpc8xx_pic.c >> +++ b/arch/powerpc/sysdev/mpc8xx_pic.c >> @@ -186,6 +186,7 @@ int mpc8xx_pic_init(void) >> ret = -ENOMEM; >> goto out; >> } >> + irq_set_default_host(mpc8xx_pic_host); >> return 0; > > This patch is whitespace mangled. > >> >> out: >> --- >> Maybe setting a default host ought to be mandatory? Or is doing the >> mapping manually >> (without device tree descriptions) considered being a hack? > > I consider it a hack -- not so much doing it manually (though the device > tree is better), but relying on a default interrupt controller when doing > so. IRQ numbers only make sense in the context of a specific > controller. It's especially misleading on 8xx, which has separate > regular and CPM PICs. > > -Scott > I agree, and was the reason I mentioned "hack". The patch wasn't meant for commit, just for reference (sorry for whitemangling ;-) Regarding doing manual mapping: Is there another way to retrieve the host controller from a driver module without modifying kernel source? In case not, do you think exporting the mpc8xx_pic_host symbol is a better solution? Anyway, now that I'm beginning to understand dts I guess I might as well just do it properly. - Frank
On Sat, 2009-05-30 at 22:22 +0200, Frank Svendsbøe wrote: > Regarding doing manual mapping: Is there another way to retrieve the > host controller > from a driver module without modifying kernel source? In case not, do > you think > exporting the mpc8xx_pic_host symbol is a better solution? > > Anyway, now that I'm beginning to understand dts I guess I might as > well just do it properly. Well, precisely :-) The DTS allows to contain the linkage to the PIC and let the kernel resolve it all nicely for you. Cheers, Ben.
diff --git a/arch/powerpc/sysdev/mpc8xx_pic.c b/arch/powerpc/sysdev/mpc8xx_pic.c index 5d2d552..92b2b66 100644 --- a/arch/powerpc/sysdev/mpc8xx_pic.c +++ b/arch/powerpc/sysdev/mpc8xx_pic.c @@ -186,6 +186,7 @@ int mpc8xx_pic_init(void) ret = -ENOMEM; goto out; } + irq_set_default_host(mpc8xx_pic_host); return 0; out: