* Re: Fix for fsl_upm
From: Kumar Gala @ 2011-10-27 18:28 UTC (permalink / raw)
To: Rusev; +Cc: Shaohui.Xie, linux-kernel, Shengzhou.Liu, paulus, linuxppc-dev
In-Reply-To: <4EA9683D.8030100@dev.rtsoft.ru>
On Oct 27, 2011, at 9:18 AM, Rusev wrote:
> patch is vs. 2.6.39, yet it applied to 3.1
>=20
>=20
>=20
> Fix of UPM driver for Freescale PowerPC processors
>=20
> If Freescale LBC driver fails to initialise itself from device tree,
> then internal structure is freed only but not NULL-fied.
> As result functions fsl_lbc_find() after checking the structure is not =
NULL are
> trying to access device registers.
>=20
> Signed-off-by: Alexandre Rusev <arusev@dev.rtsoft.ru>=20
> --- linux-2.6.39.old/arch/powerpc/sysdev/fsl_lbc.c 2011-10-27 =
03:17:28.000000000 +0400
> +++ linux-2.6.39/arch/powerpc/sysdev/fsl_lbc.c 2011-10-27 =
05:06:44.000000000 +0400
> @@ -322,6 +322,7 @@ static int __devinit fsl_lbc_ctrl_probe(
> err:
> iounmap(fsl_lbc_ctrl_dev->regs);
> kfree(fsl_lbc_ctrl_dev);
> + fsl_lbc_ctrl_dev =3D NULL;
> return ret;
> }
>=20
Can you send this as a proper patch.
- k
^ permalink raw reply
* Re: [PATCH 2/3] [44x] Enable CONFIG_RELOCATABLE for PPC44x
From: Scott Wood @ 2011-10-27 15:41 UTC (permalink / raw)
To: Suzuki Poulose
Cc: Michal Simek, tmarri, Mahesh Jagannath Salgaonkar, Dave Hansen,
David Laight, Paul Mackerras, linux ppc dev, Vivek Goyal
In-Reply-To: <4EA919AE.4020508@in.ibm.com>
On 10/27/2011 03:43 AM, Suzuki Poulose wrote:
> On 10/27/11 00:46, Scott Wood wrote:
>> On 10/26/2011 02:12 PM, Suzuki Poulose wrote:
>>> I have renamed the new type of relocation to RELOCATABLE_PPC32_PIE. The
>>> patches
>>> were posted yesterday. Please let me know your thoughts.
>>
>> I think it would make more sense to rename the existing behavior (maybe
>> something like DYNAMIC_MEMSTART -- if there's even enough overhead to
>> make it worth being configurable at all), since it's not fully
>> relocatable and since 64-bit already uses RELOCATABLE to mean PIE.
>
> I think leaving the current behaviour as it is, and adding the PIE as an
> additional configuration option would be safe and wouldn't disturb the
> existing dependencies.
That's how things grow to be an unmaintainable mess. AFAICT, what
you're doing is the same as what 64-bit does for RELOCATABLE. If
they're doing the same thing, they should be called the same thing.
Whereas 64-bit and e500 are currently doing different things for
RELOCATABLE -- so they should be called different things.
> ( CRASH_DUMP etc. depend on RELOCATABLE for archs which work fine ).
A simple grep should be able to sort out such dependencies on the name.
-Scott
^ permalink raw reply
* RE: [PATCH 3/5][v2] fsl-rio: Add two ports and rapidio message units support
From: Bounine, Alexandre @ 2011-10-27 15:26 UTC (permalink / raw)
To: Liu Gang-B34182, Kumar Gala, linuxppc-dev, Zang Roy-R61911
Cc: Andrew Morton, linux-kernel
In-Reply-To: <9A1C2A9ACC704641BC472A1588CE164713112C@039-SN1MPN1-005.039d.mgd.msft.net>
On Tue, Oct 25, 2011 at 6:40 AM, Liu Gang-B34182 <B34182@freescale.com>
wrote:
> > ... skip ...
> > > +
> > > + DBELL_TID(dmsg),
> > > + DBELL_INF(dmsg));
> > > + break;
> > > + }
> > > }
> > > }
> >
> > Do we need to check for matching DBELL_TID and mport destID here and
> > scan only doorbell list attached to the right port? Otherwise this
> may
> > call service routine associated with doorbell on a wrong port.
> > [Liu Gang-B34182] Do you mean to match DBELL_TID and mport DevID?
>=20
> Yes.
>=20
> > Usually this is a reliable method, but for the rapidio module of
> > powerpc, will encounter some problem. We set the port's DevID by the
> > register "Base Device ID CSR" defined in Rapidio Specification.
> The
> > rapidio module of powerpc can support two ports but have only one
the
> > Base Device ID CSR. So these two ports will have the same DevID.
> > Although there are two registers "Alternate Device ID CSR" to
> separate
> > deviceIDs for each port, they are specific registers of the
freescale
> > rapidio and can't be accessed by getting the extended
> feature
> > space block offset. For this doobell issue, in order to call a right
> > service routine, perhaps we should ensure that different ports in
> > different "res->start and res->end" configurations.
>=20
> This gives us an issue that has to be solved at some point.
> Splitting doorbell resources may be a way in this case but should be
> considered in context of RIO network with different endpoints and
> therefore it will be some device-specific quirk.
>=20
> Probably the best approach in this case is to keep doorbell handler as
> it is now (for purpose of this patchset) and address doorbell resource
> assignment during enumeration/discovery. At least this has to be well
> commented.
> [Liu Gang-B34182] I think this is a very complex issue, and could be
> very difficult to be resolved if we can't separate DevIDs for each
> port.
> Based on the current architecture of the RIO driver, the doorbell
> resource will be assigned by the application. For example, RIONET will
> assign the doorbell resource like this:
> if ((rc =3D rio_request_inb_dbell(rnet->mport,
> (void *)ndev,
> RIONET_DOORBELL_JOIN,
> RIONET_DOORBELL_LEAVE,
> rionet_dbell_event)) < 0)
> goto out;
> The res->start and res->end were defined by RIONET to
> RIONET_DOORBELL_JOIN (0x1000) and RIONET_DOORBELL_LEAVE (0x1001). And
> RIONET will send a doorbell
> package like this:
> rio_send_doorbell(peer->rdev, RIONET_DOORBELL_JOIN);
> When the destination port of this doorbell package has been assigned
> the same res->start and res->end, it can work well. But when we try to
> address doorbell resource assignment during enumeration/discovery, and
> give the different doorbell resource to different port, how an
endpoint
> to get the destination port resource it wants to send to a doorbell
> package?
>=20
> In fact, I also encountered some other issues due to the two ports
> sharing one CSR. For example the "Host base device ID lock command and
> status register" and "Port General control command and status
> register", these caused some issues when enumeration/discovery, and
> very difficult to be resolved
> based on current RIO architecture.
We need to adjust enumeration/discovery to deal with multi-port
endpoints.
As per RIO spec multi-port device has only one Base Device ID CSR but at
least offers a way to properly identify such capability.
Unfortunately p4080 controller follows older RIO 1.2 spec and does not
implement the multiport bit and CSR 0x14. This will force us to have a
quirk for devices with specific Device Identity CAR values.
One of possible ways for discovery may be ignoring value in reg.0x60 and
use destID set in the routing table of the attached switch (assuming
that
endpoint is capable to accept packets with destIDs other than one
in reg.0x60). But this alone does not guarantee that destIDs assigned to
two different ports will not match. This may force us to consider
additional measures of identification (which may be easier to implement
if 16-bit destIDs are used).
Anyway, we are not in position to resolve this immediately and probably
the best what we can do now is to keep multi-port endpoint specifics
in mind for future extensions.=20
I am slowly addressing multiple port support issues in
enumeration/discovery prompted by introduction of tsi721 PCIe-to-SRIO
bridge
and will keep multi-port endpoints in mind (this is different from
multiple
tsi721's on single board).=20
Regards,
=20
Alex.
^ permalink raw reply
* Fix for fsl_upm
From: Rusev @ 2011-10-27 14:18 UTC (permalink / raw)
To: benh, paulus, galak, Shengzhou.Liu, Shaohui.Xie, linuxppc-dev,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 46 bytes --]
patch is vs. 2.6.39, yet it applied to 3.1
[-- Attachment #2: fsl_lbc.c.patch --]
[-- Type: text/x-patch, Size: 694 bytes --]
Fix of UPM driver for Freescale PowerPC processors
If Freescale LBC driver fails to initialise itself from device tree,
then internal structure is freed only but not NULL-fied.
As result functions fsl_lbc_find() after checking the structure is not NULL are
trying to access device registers.
Signed-off-by: Alexandre Rusev <arusev@dev.rtsoft.ru>
--- linux-2.6.39.old/arch/powerpc/sysdev/fsl_lbc.c 2011-10-27 03:17:28.000000000 +0400
+++ linux-2.6.39/arch/powerpc/sysdev/fsl_lbc.c 2011-10-27 05:06:44.000000000 +0400
@@ -322,6 +322,7 @@ static int __devinit fsl_lbc_ctrl_probe(
err:
iounmap(fsl_lbc_ctrl_dev->regs);
kfree(fsl_lbc_ctrl_dev);
+ fsl_lbc_ctrl_dev = NULL;
return ret;
}
^ permalink raw reply
* Re: [PATCH] asm-generic/gpio.h: merge basic gpiolib wrappers
From: Russell King - ARM Linux @ 2011-10-27 13:53 UTC (permalink / raw)
To: Mike Frysinger
Cc: linux-mips, linux-ia64, linux-sh, linux, Paul Mackerras,
H. Peter Anvin, sparclinux, Guan Xuetao, Hans-Christian Egtvedt,
Jonas Bonn, x86, Ingo Molnar, linux-arch, Matt Turner,
Haavard Skinnemoen, Fenghua Yu, microblaze-uclinux, linux-m68k,
Ivan Kokshaysky, Thomas Gleixner, linux-arm-kernel,
Richard Henderson, Chris Zankel, Michal Simek, Tony Luck,
Mark Brown, linux-kernel, Ralf Baechle, Paul Mundt, linux-alpha,
uclinux-dist-devel, linuxppc-dev, David S. Miller
In-Reply-To: <1319720503-3183-1-git-send-email-vapier@gentoo.org>
On Thu, Oct 27, 2011 at 09:01:43AM -0400, Mike Frysinger wrote:
> diff --git a/arch/arm/include/asm/gpio.h b/arch/arm/include/asm/gpio.h
> index 11ad0bf..741efb2 100644
> --- a/arch/arm/include/asm/gpio.h
> +++ b/arch/arm/include/asm/gpio.h
> @@ -5,14 +5,15 @@
> #include <mach/gpio.h>
>
> #ifndef __ARM_GPIOLIB_COMPLEX
> +/* assume the mach has defined this */
> +#ifndef irq_to_gpio
> +#define irq_to_gpio irq_to_gpio
> +#endif
Oh, this isn't a valid assumption either - it's far from valid. Those
sub-architectures which don't define __ARM_GPIOLIB_COMPLEX probably don't
define any kind of irq_to_gpio function by any means. Some of our
mach/gpio.h header files for sub-architectures using entirely gpiolib
are entirely empty - and we want them to stay that way.
^ permalink raw reply
* Re: [PATCH] asm-generic/gpio.h: merge basic gpiolib wrappers
From: Russell King - ARM Linux @ 2011-10-27 13:43 UTC (permalink / raw)
To: Mike Frysinger
Cc: linux-mips, linux-ia64, linux-sh, linux, Paul Mackerras,
H. Peter Anvin, sparclinux, Guan Xuetao, Hans-Christian Egtvedt,
Jonas Bonn, x86, Ingo Molnar, linux-arch, Matt Turner,
Haavard Skinnemoen, Fenghua Yu, microblaze-uclinux, linux-m68k,
Ivan Kokshaysky, Thomas Gleixner, linux-arm-kernel,
Richard Henderson, Chris Zankel, Michal Simek, Tony Luck,
Mark Brown, linux-kernel, Ralf Baechle, Paul Mundt, linux-alpha,
uclinux-dist-devel, linuxppc-dev, David S. Miller
In-Reply-To: <CAJaTeTp_jv-b1GUEswfFzn=joj=jkMHE91zK1wnDksH60GT6Dg@mail.gmail.com>
On Thu, Oct 27, 2011 at 03:29:40PM +0200, Mike Frysinger wrote:
> On Thu, Oct 27, 2011 at 15:11, Russell King - ARM Linux wrote:
> > On Thu, Oct 27, 2011 at 09:01:43AM -0400, Mike Frysinger wrote:
> >> diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
> >> index d494001..622851c 100644
> >> --- a/include/asm-generic/gpio.h
> >> +++ b/include/asm-generic/gpio.h
> >> @@ -170,6 +170,29 @@ extern int __gpio_cansleep(unsigned gpio);
> >>
> >> extern int __gpio_to_irq(unsigned gpio);
> >>
> >> +#ifndef gpio_get_value
> >> +#define gpio_get_value(gpio) __gpio_get_value(gpio)
> >> +#endif
> >> +
> >> +#ifndef gpio_set_value
> >> +#define gpio_set_value(gpio, value) __gpio_set_value(gpio, value)
> >> +#endif
> >> +
> >> +#ifndef gpio_cansleep
> >> +#define gpio_cansleep(gpio) __gpio_cansleep(gpio)
> >> +#endif
> >> +
> >> +#ifndef gpio_to_irq
> >> +#define gpio_to_irq(gpio) __gpio_to_irq(gpio)
> >> +#endif
> >> +
> >> +#ifndef irq_to_gpio
> >> +static inline int irq_to_gpio(unsigned int irq)
> >> +{
> >> + return -EINVAL;
> >> +}
> >> +#endif
> >> +
> >
> > This is extremely dangerous. Consider for example this code
> > (see ARM mach-davinci's gpio.h):
> > ...
> > This is why I didn't solve this using the preprocessor method in ARM, but
> > instead used __ARM_GPIOLIB_COMPLEX to control whether these definitions
> > are required.
>
> i thought the arm mach were defining things already, but i guess i
> missed some in my review
>
> easy enough to glue the arm-specific world to the asm-generic world
> ... a bit ugly, but should work i think:
> #ifndef __ARM_GPIOLIB_COMPLEX
> /* assume the mach has defined this */
> #ifndef gpio_get_value
> #define gpio_get_value gpio_get_value
> #endif
> #ifndef gpio_set_value
> #define gpio_set_value gpio_set_value
> #endif
> #ifndef gpio_cansleep
> #define gpio_cansleep gpio_cansleep
> #endif
> #ifndef gpio_to_irq
> #define gpio_to_irq gpio_to_irq
> #endif
> #ifndef irq_to_gpio
> #define irq_to_gpio irq_to_gpio
> #endif
> ...
>
> the next step might be to drill down into the arm mach's and sprinkle
> the defines into the parts that need it ...
You don't illustrate how it would work with what's there in current
kernels, so I'm having to guess.
With the above coming before the asm-generic/gpio.h include, and this
following the include:
/* The trivial gpiolib dispatchers */
#define gpio_get_value __gpio_get_value
#define gpio_set_value __gpio_set_value
#define gpio_cansleep __gpio_cansleep
this is asking for multiple definition warnings from the preprocessor -
and wrapping these with yet more ifdefs doesn't solve the problem.
Also bear in mind that we're trying to reduce the amount of code in the
mach/gpio.h header files at the moment, so I'd want to avoid adding stuff
to them.
^ permalink raw reply
* Re: [PATCH] asm-generic/gpio.h: merge basic gpiolib wrappers
From: Russell King - ARM Linux @ 2011-10-27 13:11 UTC (permalink / raw)
To: Mike Frysinger
Cc: linux-mips, linux-ia64, linux-sh, linux, Paul Mackerras,
H. Peter Anvin, sparclinux, Guan Xuetao, Hans-Christian Egtvedt,
Jonas Bonn, x86, Ingo Molnar, linux-arch, Matt Turner,
Haavard Skinnemoen, Fenghua Yu, microblaze-uclinux, linux-m68k,
Ivan Kokshaysky, Thomas Gleixner, linux-arm-kernel,
Richard Henderson, Chris Zankel, Michal Simek, Tony Luck,
Mark Brown, linux-kernel, Ralf Baechle, Paul Mundt, linux-alpha,
uclinux-dist-devel, linuxppc-dev, David S. Miller
In-Reply-To: <1319720503-3183-1-git-send-email-vapier@gentoo.org>
On Thu, Oct 27, 2011 at 09:01:43AM -0400, Mike Frysinger wrote:
> diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
> index d494001..622851c 100644
> --- a/include/asm-generic/gpio.h
> +++ b/include/asm-generic/gpio.h
> @@ -170,6 +170,29 @@ extern int __gpio_cansleep(unsigned gpio);
>
> extern int __gpio_to_irq(unsigned gpio);
>
> +#ifndef gpio_get_value
> +#define gpio_get_value(gpio) __gpio_get_value(gpio)
> +#endif
> +
> +#ifndef gpio_set_value
> +#define gpio_set_value(gpio, value) __gpio_set_value(gpio, value)
> +#endif
> +
> +#ifndef gpio_cansleep
> +#define gpio_cansleep(gpio) __gpio_cansleep(gpio)
> +#endif
> +
> +#ifndef gpio_to_irq
> +#define gpio_to_irq(gpio) __gpio_to_irq(gpio)
> +#endif
> +
> +#ifndef irq_to_gpio
> +static inline int irq_to_gpio(unsigned int irq)
> +{
> + return -EINVAL;
> +}
> +#endif
> +
This is extremely dangerous. Consider for example this code
(see ARM mach-davinci's gpio.h):
#include <asm-generic/gpio.h>
static inline int gpio_get_value(unsigned gpio)
{
struct davinci_gpio_controller *ctlr;
if (!__builtin_constant_p(gpio) || gpio >= davinci_soc_info.gpio_num)
return __gpio_get_value(gpio);
ctlr = __gpio_to_controller(gpio);
return __gpio_mask(gpio) & __raw_readl(ctlr->in_data);
}
The result with your changes above will be:
static inline int __gpio_get_value(unsigned gpio)
{
struct davinci_gpio_controller *ctlr;
if (!__builtin_constant_p(gpio) || gpio >= davinci_soc_info.gpio_num)
return __gpio_get_value(gpio);
ctlr = __gpio_to_controller(gpio);
return __gpio_mask(gpio) & __raw_readl(ctlr->in_data);
}
and notice the recursive call there.
This is why I didn't solve this using the preprocessor method in ARM, but
instead used __ARM_GPIOLIB_COMPLEX to control whether these definitions
are required.
^ permalink raw reply
* Re: [PATCH] asm-generic/gpio.h: merge basic gpiolib wrappers
From: Mike Frysinger @ 2011-10-27 13:29 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: linux-mips, linux-ia64, linux-sh, linux, Paul Mackerras,
H. Peter Anvin, sparclinux, Guan Xuetao, Hans-Christian Egtvedt,
Jonas Bonn, x86, Ingo Molnar, linux-arch, Matt Turner,
Haavard Skinnemoen, Fenghua Yu, microblaze-uclinux, linux-m68k,
Ivan Kokshaysky, Thomas Gleixner, linux-arm-kernel,
Richard Henderson, Chris Zankel, Michal Simek, Tony Luck,
Mark Brown, linux-kernel, Ralf Baechle, Paul Mundt, linux-alpha,
uclinux-dist-devel, linuxppc-dev, David S. Miller
In-Reply-To: <20111027131124.GK19187@n2100.arm.linux.org.uk>
On Thu, Oct 27, 2011 at 15:11, Russell King - ARM Linux wrote:
> On Thu, Oct 27, 2011 at 09:01:43AM -0400, Mike Frysinger wrote:
>> diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
>> index d494001..622851c 100644
>> --- a/include/asm-generic/gpio.h
>> +++ b/include/asm-generic/gpio.h
>> @@ -170,6 +170,29 @@ extern int __gpio_cansleep(unsigned gpio);
>>
>> =A0extern int __gpio_to_irq(unsigned gpio);
>>
>> +#ifndef gpio_get_value
>> +#define gpio_get_value(gpio) __gpio_get_value(gpio)
>> +#endif
>> +
>> +#ifndef gpio_set_value
>> +#define gpio_set_value(gpio, value) __gpio_set_value(gpio, value)
>> +#endif
>> +
>> +#ifndef gpio_cansleep
>> +#define gpio_cansleep(gpio) __gpio_cansleep(gpio)
>> +#endif
>> +
>> +#ifndef gpio_to_irq
>> +#define gpio_to_irq(gpio) __gpio_to_irq(gpio)
>> +#endif
>> +
>> +#ifndef irq_to_gpio
>> +static inline int irq_to_gpio(unsigned int irq)
>> +{
>> + =A0 =A0 return -EINVAL;
>> +}
>> +#endif
>> +
>
> This is extremely dangerous. =A0Consider for example this code
> (see ARM mach-davinci's gpio.h):
> ...
> This is why I didn't solve this using the preprocessor method in ARM, but
> instead used __ARM_GPIOLIB_COMPLEX to control whether these definitions
> are required.
i thought the arm mach were defining things already, but i guess i
missed some in my review
easy enough to glue the arm-specific world to the asm-generic world
... a bit ugly, but should work i think:
#ifndef __ARM_GPIOLIB_COMPLEX
/* assume the mach has defined this */
#ifndef gpio_get_value
#define gpio_get_value gpio_get_value
#endif
#ifndef gpio_set_value
#define gpio_set_value gpio_set_value
#endif
#ifndef gpio_cansleep
#define gpio_cansleep gpio_cansleep
#endif
#ifndef gpio_to_irq
#define gpio_to_irq gpio_to_irq
#endif
#ifndef irq_to_gpio
#define irq_to_gpio irq_to_gpio
#endif
...
the next step might be to drill down into the arm mach's and sprinkle
the defines into the parts that need it ...
-mike
^ permalink raw reply
* [PATCH] asm-generic/gpio.h: merge basic gpiolib wrappers
From: Mike Frysinger @ 2011-10-27 13:01 UTC (permalink / raw)
To: Grant Likely, Richard Henderson, Ivan Kokshaysky, Matt Turner,
Haavard Skinnemoen, Hans-Christian Egtvedt, Tony Luck, Fenghua Yu,
Michal Simek, Ralf Baechle, Paul Mundt, Jonas Bonn,
Paul Mackerras, Benjamin Herrenschmidt, David S. Miller,
Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Chris Zankel,
Russell King, Guan Xuetao, Mark Brown
Cc: linux-arch, linux-mips, x86, linux-ia64, linux-sh,
microblaze-uclinux, linux, linux-kernel, linux-m68k,
Mike Frysinger, linux-alpha, sparclinux, uclinux-dist-devel,
linuxppc-dev, linux-arm-kernel
In-Reply-To: <1319528012-19006-1-git-send-email-broonie@opensource.wolfsonmicro.com>
Rather than requiring architectures that use gpiolib but don't have
any need to define anything custom to copy an asm/gpio.h, merge this
code into the asm-generic/gpio.h. We add ifdef checks so that arches
can still override things while using the asm-generic/gpio.h, but on
a more fine grained per-func approach.
I've compile tested these guys (with & without GPIOLIB), but don't
have the hardware to boot:
- alpha defconfig
- arm defconfig
- blackfin defconfig
- ia64 defconfig
- mips: ar7 & ath79 & bcm47xx & bcm63xx & ip22 defconfig
- powerpc: mpc85xx & ppc64 defconfig
- sh: kfr2r09 defconfig
- sparc defconfig
- x86_64 defconfig
I don't have any toolchains for avr32, microblaze, openrisc, unicore32,
or xtensa. So they lose :x.
I don't see m68k supporting gpoilib, so I've just ignored it.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
arch/alpha/include/asm/Kbuild | 2 +
arch/alpha/include/asm/gpio.h | 55 -------------------
arch/arm/include/asm/gpio.h | 13 +++--
arch/avr32/mach-at32ap/include/mach/gpio.h | 19 +------
arch/blackfin/include/asm/gpio.h | 16 ++----
arch/ia64/include/asm/Kbuild | 2 +
arch/ia64/include/asm/gpio.h | 55 -------------------
arch/microblaze/include/asm/Kbuild | 2 +
arch/microblaze/include/asm/gpio.h | 53 ------------------
arch/mips/include/asm/mach-ar7/gpio.h | 5 --
arch/mips/include/asm/mach-ath79/gpio.h | 8 ++-
arch/mips/include/asm/mach-bcm47xx/gpio.h | 3 +
arch/mips/include/asm/mach-bcm63xx/gpio.h | 5 --
arch/mips/include/asm/mach-generic/gpio.h | 8 +--
arch/mips/include/asm/mach-loongson/gpio.h | 7 +--
arch/mips/include/asm/mach-rc32434/gpio.h | 10 +---
arch/mips/include/asm/pmc-sierra/msp71xx/gpio.h | 12 +---
arch/openrisc/include/asm/Kbuild | 1 +
arch/openrisc/include/asm/gpio.h | 65 -----------------------
arch/powerpc/include/asm/Kbuild | 2 +
arch/powerpc/include/asm/gpio.h | 53 ------------------
arch/sh/include/asm/gpio.h | 32 +-----------
arch/sparc/include/asm/Kbuild | 1 +
arch/sparc/include/asm/gpio.h | 36 -------------
arch/unicore32/include/asm/gpio.h | 8 ++-
arch/x86/include/asm/Kbuild | 2 +
arch/x86/include/asm/gpio.h | 53 ------------------
arch/xtensa/include/asm/Kbuild | 2 +
arch/xtensa/include/asm/gpio.h | 56 -------------------
include/asm-generic/gpio.h | 23 ++++++++
30 files changed, 81 insertions(+), 528 deletions(-)
delete mode 100644 arch/alpha/include/asm/gpio.h
delete mode 100644 arch/ia64/include/asm/gpio.h
delete mode 100644 arch/microblaze/include/asm/gpio.h
delete mode 100644 arch/openrisc/include/asm/gpio.h
delete mode 100644 arch/powerpc/include/asm/gpio.h
delete mode 100644 arch/sparc/include/asm/gpio.h
delete mode 100644 arch/x86/include/asm/gpio.h
delete mode 100644 arch/xtensa/include/asm/gpio.h
diff --git a/arch/alpha/include/asm/Kbuild b/arch/alpha/include/asm/Kbuild
index e423def..0bcff1a 100644
--- a/arch/alpha/include/asm/Kbuild
+++ b/arch/alpha/include/asm/Kbuild
@@ -1,5 +1,7 @@
include include/asm-generic/Kbuild.asm
+generic-y += gpio.h
+
header-y += compiler.h
header-y += console.h
header-y += fpu.h
diff --git a/arch/alpha/include/asm/gpio.h b/arch/alpha/include/asm/gpio.h
deleted file mode 100644
index 7dc6a63..0000000
--- a/arch/alpha/include/asm/gpio.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Generic GPIO API implementation for Alpha.
- *
- * A stright copy of that for PowerPC which was:
- *
- * Copyright (c) 2007-2008 MontaVista Software, Inc.
- *
- * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#ifndef _ASM_ALPHA_GPIO_H
-#define _ASM_ALPHA_GPIO_H
-
-#include <linux/errno.h>
-#include <asm-generic/gpio.h>
-
-#ifdef CONFIG_GPIOLIB
-
-/*
- * We don't (yet) implement inlined/rapid versions for on-chip gpios.
- * Just call gpiolib.
- */
-static inline int gpio_get_value(unsigned int gpio)
-{
- return __gpio_get_value(gpio);
-}
-
-static inline void gpio_set_value(unsigned int gpio, int value)
-{
- __gpio_set_value(gpio, value);
-}
-
-static inline int gpio_cansleep(unsigned int gpio)
-{
- return __gpio_cansleep(gpio);
-}
-
-static inline int gpio_to_irq(unsigned int gpio)
-{
- return __gpio_to_irq(gpio);
-}
-
-static inline int irq_to_gpio(unsigned int irq)
-{
- return -EINVAL;
-}
-
-#endif /* CONFIG_GPIOLIB */
-
-#endif /* _ASM_ALPHA_GPIO_H */
diff --git a/arch/arm/include/asm/gpio.h b/arch/arm/include/asm/gpio.h
index 11ad0bf..741efb2 100644
--- a/arch/arm/include/asm/gpio.h
+++ b/arch/arm/include/asm/gpio.h
@@ -5,14 +5,15 @@
#include <mach/gpio.h>
#ifndef __ARM_GPIOLIB_COMPLEX
+/* assume the mach has defined this */
+#ifndef irq_to_gpio
+#define irq_to_gpio irq_to_gpio
+#endif
+
/* Note: this may rely upon the value of ARCH_NR_GPIOS set in mach/gpio.h */
#include <asm-generic/gpio.h>
-/* The trivial gpiolib dispatchers */
-#define gpio_get_value __gpio_get_value
-#define gpio_set_value __gpio_set_value
-#define gpio_cansleep __gpio_cansleep
-#endif
+#else
/*
* Provide a default gpio_to_irq() which should satisfy every case.
@@ -23,4 +24,6 @@
#define gpio_to_irq __gpio_to_irq
#endif
+#endif
+
#endif /* _ARCH_ARM_GPIO_H */
diff --git a/arch/avr32/mach-at32ap/include/mach/gpio.h b/arch/avr32/mach-at32ap/include/mach/gpio.h
index 0180f58..f2ff962 100644
--- a/arch/avr32/mach-at32ap/include/mach/gpio.h
+++ b/arch/avr32/mach-at32ap/include/mach/gpio.h
@@ -10,26 +10,13 @@
*/
#define ARCH_NR_GPIOS (NR_GPIO_IRQS + 2 * 32)
+/* We implement a few ourself */
+#define gpio_to_irq gpio_to_irq
+#define irq_to_gpio irq_to_gpio
/* Arch-neutral GPIO API, supporting both "native" and external GPIOs. */
#include <asm-generic/gpio.h>
-static inline int gpio_get_value(unsigned int gpio)
-{
- return __gpio_get_value(gpio);
-}
-
-static inline void gpio_set_value(unsigned int gpio, int value)
-{
- __gpio_set_value(gpio, value);
-}
-
-static inline int gpio_cansleep(unsigned int gpio)
-{
- return __gpio_cansleep(gpio);
-}
-
-
static inline int gpio_to_irq(unsigned int gpio)
{
if (gpio < NR_GPIO_IRQS)
diff --git a/arch/blackfin/include/asm/gpio.h b/arch/blackfin/include/asm/gpio.h
index 5a25856..6e25dcc 100644
--- a/arch/blackfin/include/asm/gpio.h
+++ b/arch/blackfin/include/asm/gpio.h
@@ -189,6 +189,12 @@ void bfin_gpio_set_value(unsigned gpio, int value);
#include <asm/errno.h>
#ifdef CONFIG_GPIOLIB
+
+/* We implement a few ourself */
+#define gpio_get_value gpio_get_value
+#define gpio_set_value gpio_set_value
+#define irq_to_gpio irq_to_gpio
+
#include <asm-generic/gpio.h> /* cansleep wrappers */
static inline int gpio_get_value(unsigned int gpio)
@@ -207,16 +213,6 @@ static inline void gpio_set_value(unsigned int gpio, int value)
__gpio_set_value(gpio, value);
}
-static inline int gpio_cansleep(unsigned int gpio)
-{
- return __gpio_cansleep(gpio);
-}
-
-static inline int gpio_to_irq(unsigned gpio)
-{
- return __gpio_to_irq(gpio);
-}
-
#else /* !CONFIG_GPIOLIB */
static inline int gpio_request(unsigned gpio, const char *label)
diff --git a/arch/ia64/include/asm/Kbuild b/arch/ia64/include/asm/Kbuild
index 241d1c5..d0fdd2d 100644
--- a/arch/ia64/include/asm/Kbuild
+++ b/arch/ia64/include/asm/Kbuild
@@ -1,5 +1,7 @@
include include/asm-generic/Kbuild.asm
+generic-y += gpio.h
+
header-y += break.h
header-y += fpu.h
header-y += gcc_intrin.h
diff --git a/arch/ia64/include/asm/gpio.h b/arch/ia64/include/asm/gpio.h
deleted file mode 100644
index 590a20d..0000000
--- a/arch/ia64/include/asm/gpio.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Generic GPIO API implementation for IA-64.
- *
- * A stright copy of that for PowerPC which was:
- *
- * Copyright (c) 2007-2008 MontaVista Software, Inc.
- *
- * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#ifndef _ASM_IA64_GPIO_H
-#define _ASM_IA64_GPIO_H
-
-#include <linux/errno.h>
-#include <asm-generic/gpio.h>
-
-#ifdef CONFIG_GPIOLIB
-
-/*
- * We don't (yet) implement inlined/rapid versions for on-chip gpios.
- * Just call gpiolib.
- */
-static inline int gpio_get_value(unsigned int gpio)
-{
- return __gpio_get_value(gpio);
-}
-
-static inline void gpio_set_value(unsigned int gpio, int value)
-{
- __gpio_set_value(gpio, value);
-}
-
-static inline int gpio_cansleep(unsigned int gpio)
-{
- return __gpio_cansleep(gpio);
-}
-
-static inline int gpio_to_irq(unsigned int gpio)
-{
- return __gpio_to_irq(gpio);
-}
-
-static inline int irq_to_gpio(unsigned int irq)
-{
- return -EINVAL;
-}
-
-#endif /* CONFIG_GPIOLIB */
-
-#endif /* _ASM_IA64_GPIO_H */
diff --git a/arch/microblaze/include/asm/Kbuild b/arch/microblaze/include/asm/Kbuild
index db5294c..5bf1ca7 100644
--- a/arch/microblaze/include/asm/Kbuild
+++ b/arch/microblaze/include/asm/Kbuild
@@ -1,3 +1,5 @@
include include/asm-generic/Kbuild.asm
+generic-y += gpio.h
+
header-y += elf.h
diff --git a/arch/microblaze/include/asm/gpio.h b/arch/microblaze/include/asm/gpio.h
deleted file mode 100644
index 2b2c18b..0000000
--- a/arch/microblaze/include/asm/gpio.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Generic GPIO API implementation for PowerPC.
- *
- * Copyright (c) 2007-2008 MontaVista Software, Inc.
- *
- * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#ifndef _ASM_MICROBLAZE_GPIO_H
-#define _ASM_MICROBLAZE_GPIO_H
-
-#include <linux/errno.h>
-#include <asm-generic/gpio.h>
-
-#ifdef CONFIG_GPIOLIB
-
-/*
- * We don't (yet) implement inlined/rapid versions for on-chip gpios.
- * Just call gpiolib.
- */
-static inline int gpio_get_value(unsigned int gpio)
-{
- return __gpio_get_value(gpio);
-}
-
-static inline void gpio_set_value(unsigned int gpio, int value)
-{
- __gpio_set_value(gpio, value);
-}
-
-static inline int gpio_cansleep(unsigned int gpio)
-{
- return __gpio_cansleep(gpio);
-}
-
-static inline int gpio_to_irq(unsigned int gpio)
-{
- return __gpio_to_irq(gpio);
-}
-
-static inline int irq_to_gpio(unsigned int irq)
-{
- return -EINVAL;
-}
-
-#endif /* CONFIG_GPIOLIB */
-
-#endif /* _ASM_MICROBLAZE_GPIO_H */
diff --git a/arch/mips/include/asm/mach-ar7/gpio.h b/arch/mips/include/asm/mach-ar7/gpio.h
index c177cd1..78f40c2 100644
--- a/arch/mips/include/asm/mach-ar7/gpio.h
+++ b/arch/mips/include/asm/mach-ar7/gpio.h
@@ -27,11 +27,6 @@
#define gpio_to_irq(gpio) -1
-#define gpio_get_value __gpio_get_value
-#define gpio_set_value __gpio_set_value
-
-#define gpio_cansleep __gpio_cansleep
-
/* Board specific GPIO functions */
int ar7_gpio_enable(unsigned gpio);
int ar7_gpio_disable(unsigned gpio);
diff --git a/arch/mips/include/asm/mach-ath79/gpio.h b/arch/mips/include/asm/mach-ath79/gpio.h
index 60dcb62..2c570a0 100644
--- a/arch/mips/include/asm/mach-ath79/gpio.h
+++ b/arch/mips/include/asm/mach-ath79/gpio.h
@@ -13,6 +13,12 @@
#ifndef __ASM_MACH_ATH79_GPIO_H
#define __ASM_MACH_ATH79_GPIO_H
+/* We implement a few ourself */
+#define gpio_get_value gpio_get_value
+#define gpio_set_value gpio_set_value
+#define gpio_to_irq gpio_to_irq
+#define irq_to_gpio irq_to_gpio
+
#define ARCH_NR_GPIOS 64
#include <asm-generic/gpio.h>
@@ -21,6 +27,4 @@ int irq_to_gpio(unsigned irq);
int gpio_get_value(unsigned gpio);
void gpio_set_value(unsigned gpio, int value);
-#define gpio_cansleep __gpio_cansleep
-
#endif /* __ASM_MACH_ATH79_GPIO_H */
diff --git a/arch/mips/include/asm/mach-bcm47xx/gpio.h b/arch/mips/include/asm/mach-bcm47xx/gpio.h
index 76961ca..d678316 100644
--- a/arch/mips/include/asm/mach-bcm47xx/gpio.h
+++ b/arch/mips/include/asm/mach-bcm47xx/gpio.h
@@ -19,6 +19,7 @@
extern int gpio_request(unsigned gpio, const char *label);
extern void gpio_free(unsigned gpio);
extern int gpio_to_irq(unsigned gpio);
+#define gpio_to_irq gpio_to_irq
static inline int gpio_get_value(unsigned gpio)
{
@@ -35,6 +36,7 @@ static inline int gpio_get_value(unsigned gpio)
}
return -EINVAL;
}
+#define gpio_get_value gpio_get_value
static inline void gpio_set_value(unsigned gpio, int value)
{
@@ -53,6 +55,7 @@ static inline void gpio_set_value(unsigned gpio, int value)
#endif
}
}
+#define gpio_set_value gpio_set_value
static inline int gpio_direction_input(unsigned gpio)
{
diff --git a/arch/mips/include/asm/mach-bcm63xx/gpio.h b/arch/mips/include/asm/mach-bcm63xx/gpio.h
index 1eb534d..c71bf66 100644
--- a/arch/mips/include/asm/mach-bcm63xx/gpio.h
+++ b/arch/mips/include/asm/mach-bcm63xx/gpio.h
@@ -5,11 +5,6 @@
#define gpio_to_irq(gpio) -1
-#define gpio_get_value __gpio_get_value
-#define gpio_set_value __gpio_set_value
-
-#define gpio_cansleep __gpio_cansleep
-
#include <asm-generic/gpio.h>
#endif /* __ASM_MIPS_MACH_BCM63XX_GPIO_H */
diff --git a/arch/mips/include/asm/mach-generic/gpio.h b/arch/mips/include/asm/mach-generic/gpio.h
index b4e7020..e8a89c5 100644
--- a/arch/mips/include/asm/mach-generic/gpio.h
+++ b/arch/mips/include/asm/mach-generic/gpio.h
@@ -1,11 +1,7 @@
#ifndef __ASM_MACH_GENERIC_GPIO_H
#define __ASM_MACH_GENERIC_GPIO_H
-#ifdef CONFIG_GPIOLIB
-#define gpio_get_value __gpio_get_value
-#define gpio_set_value __gpio_set_value
-#define gpio_cansleep __gpio_cansleep
-#else
+#ifndef CONFIG_GPIOLIB
int gpio_request(unsigned gpio, const char *label);
void gpio_free(unsigned gpio);
int gpio_direction_input(unsigned gpio);
@@ -14,7 +10,9 @@ int gpio_get_value(unsigned gpio);
void gpio_set_value(unsigned gpio, int value);
#endif
int gpio_to_irq(unsigned gpio);
+#define gpio_to_irq gpio_to_irq
int irq_to_gpio(unsigned irq);
+#define irq_to_gpio irq_to_gpio
#include <asm-generic/gpio.h> /* cansleep wrappers */
diff --git a/arch/mips/include/asm/mach-loongson/gpio.h b/arch/mips/include/asm/mach-loongson/gpio.h
index e30e73d..df6efc0 100644
--- a/arch/mips/include/asm/mach-loongson/gpio.h
+++ b/arch/mips/include/asm/mach-loongson/gpio.h
@@ -13,6 +13,8 @@
#ifndef __STLS2F_GPIO_H
#define __STLS2F_GPIO_H
+#define gpio_to_irq gpio_to_irq
+
#include <asm-generic/gpio.h>
extern void gpio_set_value(unsigned gpio, int value);
@@ -27,9 +29,4 @@ static inline int gpio_to_irq(int gpio)
return -EINVAL;
}
-static inline int irq_to_gpio(int gpio)
-{
- return -EINVAL;
-}
-
#endif /* __STLS2F_GPIO_H */
diff --git a/arch/mips/include/asm/mach-rc32434/gpio.h b/arch/mips/include/asm/mach-rc32434/gpio.h
index 12ee8d5..8b0815b 100644
--- a/arch/mips/include/asm/mach-rc32434/gpio.h
+++ b/arch/mips/include/asm/mach-rc32434/gpio.h
@@ -13,18 +13,14 @@
#ifndef _RC32434_GPIO_H_
#define _RC32434_GPIO_H_
+#define gpio_to_irq(gpio) (8 + 4 * 32 + gpio)
+#define irq_to_gpio(irq) (irq - (8 + 4 * 32))
+
#include <linux/types.h>
#include <asm-generic/gpio.h>
#define NR_BUILTIN_GPIO 32
-#define gpio_get_value __gpio_get_value
-#define gpio_set_value __gpio_set_value
-#define gpio_cansleep __gpio_cansleep
-
-#define gpio_to_irq(gpio) (8 + 4 * 32 + gpio)
-#define irq_to_gpio(irq) (irq - (8 + 4 * 32))
-
struct rb532_gpio_reg {
u32 gpiofunc; /* GPIO Function Register
* gpiofunc[x]==0 bit = gpio
diff --git a/arch/mips/include/asm/pmc-sierra/msp71xx/gpio.h b/arch/mips/include/asm/pmc-sierra/msp71xx/gpio.h
index ebdbab9..8356a8e 100644
--- a/arch/mips/include/asm/pmc-sierra/msp71xx/gpio.h
+++ b/arch/mips/include/asm/pmc-sierra/msp71xx/gpio.h
@@ -11,16 +11,15 @@
#ifndef __PMC_MSP71XX_GPIO_H
#define __PMC_MSP71XX_GPIO_H
+/* We implement a few ourself */
+#define gpio_to_irq gpio_to_irq
+
/* Max number of gpio's is 28 on chip plus 3 banks of I2C IO Expanders */
#define ARCH_NR_GPIOS (28 + (3 * 8))
/* new generic GPIO API - see Documentation/gpio.txt */
#include <asm-generic/gpio.h>
-#define gpio_get_value __gpio_get_value
-#define gpio_set_value __gpio_set_value
-#define gpio_cansleep __gpio_cansleep
-
/* Setup calls for the gpio and gpio extended */
extern void msp71xx_init_gpio(void);
extern void msp71xx_init_gpio_extended(void);
@@ -38,9 +37,4 @@ static inline int gpio_to_irq(unsigned gpio)
return -EINVAL;
}
-static inline int irq_to_gpio(unsigned irq)
-{
- return -EINVAL;
-}
-
#endif /* __PMC_MSP71XX_GPIO_H */
diff --git a/arch/openrisc/include/asm/Kbuild b/arch/openrisc/include/asm/Kbuild
index 11162e6..03f0823 100644
--- a/arch/openrisc/include/asm/Kbuild
+++ b/arch/openrisc/include/asm/Kbuild
@@ -23,6 +23,7 @@ generic-y += fb.h
generic-y += fcntl.h
generic-y += ftrace.h
generic-y += futex.h
+generic-y += gpio.h
generic-y += hardirq.h
generic-y += hw_irq.h
generic-y += ioctl.h
diff --git a/arch/openrisc/include/asm/gpio.h b/arch/openrisc/include/asm/gpio.h
deleted file mode 100644
index 0b0d174..0000000
--- a/arch/openrisc/include/asm/gpio.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * OpenRISC Linux
- *
- * Linux architectural port borrowing liberally from similar works of
- * others. All original copyrights apply as per the original source
- * declaration.
- *
- * OpenRISC implementation:
- * Copyright (C) 2003 Matjaz Breskvar <phoenix@bsemi.com>
- * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
- * et al.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#ifndef __ASM_OPENRISC_GPIO_H
-#define __ASM_OPENRISC_GPIO_H
-
-#include <linux/errno.h>
-#include <asm-generic/gpio.h>
-
-#ifdef CONFIG_GPIOLIB
-
-/*
- * OpenRISC (or1k) does not have on-chip GPIO's so there is not really
- * any standardized implementation that makes sense here. If passing
- * through gpiolib becomes a bottleneck then it may make sense, on a
- * case-by-case basis, to implement these inlined/rapid versions.
- *
- * Just call gpiolib.
- */
-static inline int gpio_get_value(unsigned int gpio)
-{
- return __gpio_get_value(gpio);
-}
-
-static inline void gpio_set_value(unsigned int gpio, int value)
-{
- __gpio_set_value(gpio, value);
-}
-
-static inline int gpio_cansleep(unsigned int gpio)
-{
- return __gpio_cansleep(gpio);
-}
-
-/*
- * Not implemented, yet.
- */
-static inline int gpio_to_irq(unsigned int gpio)
-{
- return -ENOSYS;
-}
-
-static inline int irq_to_gpio(unsigned int irq)
-{
- return -EINVAL;
-}
-
-#endif /* CONFIG_GPIOLIB */
-
-#endif /* __ASM_OPENRISC_GPIO_H */
diff --git a/arch/powerpc/include/asm/Kbuild b/arch/powerpc/include/asm/Kbuild
index d51df17..9cf0632 100644
--- a/arch/powerpc/include/asm/Kbuild
+++ b/arch/powerpc/include/asm/Kbuild
@@ -1,5 +1,7 @@
include include/asm-generic/Kbuild.asm
+generic-y += gpio.h
+
header-y += auxvec.h
header-y += bootx.h
header-y += byteorder.h
diff --git a/arch/powerpc/include/asm/gpio.h b/arch/powerpc/include/asm/gpio.h
deleted file mode 100644
index 38762ed..0000000
--- a/arch/powerpc/include/asm/gpio.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Generic GPIO API implementation for PowerPC.
- *
- * Copyright (c) 2007-2008 MontaVista Software, Inc.
- *
- * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#ifndef __ASM_POWERPC_GPIO_H
-#define __ASM_POWERPC_GPIO_H
-
-#include <linux/errno.h>
-#include <asm-generic/gpio.h>
-
-#ifdef CONFIG_GPIOLIB
-
-/*
- * We don't (yet) implement inlined/rapid versions for on-chip gpios.
- * Just call gpiolib.
- */
-static inline int gpio_get_value(unsigned int gpio)
-{
- return __gpio_get_value(gpio);
-}
-
-static inline void gpio_set_value(unsigned int gpio, int value)
-{
- __gpio_set_value(gpio, value);
-}
-
-static inline int gpio_cansleep(unsigned int gpio)
-{
- return __gpio_cansleep(gpio);
-}
-
-static inline int gpio_to_irq(unsigned int gpio)
-{
- return __gpio_to_irq(gpio);
-}
-
-static inline int irq_to_gpio(unsigned int irq)
-{
- return -EINVAL;
-}
-
-#endif /* CONFIG_GPIOLIB */
-
-#endif /* __ASM_POWERPC_GPIO_H */
diff --git a/arch/sh/include/asm/gpio.h b/arch/sh/include/asm/gpio.h
index 04f53d3..44fee05 100644
--- a/arch/sh/include/asm/gpio.h
+++ b/arch/sh/include/asm/gpio.h
@@ -12,9 +12,6 @@
#ifndef __ASM_SH_GPIO_H
#define __ASM_SH_GPIO_H
-#include <linux/kernel.h>
-#include <linux/errno.h>
-
#if defined(CONFIG_CPU_SH3)
#include <cpu/gpio.h>
#endif
@@ -22,33 +19,6 @@
#define ARCH_NR_GPIOS 512
#include <linux/sh_pfc.h>
-#ifdef CONFIG_GPIOLIB
-
-static inline int gpio_get_value(unsigned gpio)
-{
- return __gpio_get_value(gpio);
-}
-
-static inline void gpio_set_value(unsigned gpio, int value)
-{
- __gpio_set_value(gpio, value);
-}
-
-static inline int gpio_cansleep(unsigned gpio)
-{
- return __gpio_cansleep(gpio);
-}
-
-static inline int gpio_to_irq(unsigned gpio)
-{
- return __gpio_to_irq(gpio);
-}
-
-static inline int irq_to_gpio(unsigned int irq)
-{
- return -ENOSYS;
-}
-
-#endif /* CONFIG_GPIOLIB */
+#include <asm-generic/gpio.h>
#endif /* __ASM_SH_GPIO_H */
diff --git a/arch/sparc/include/asm/Kbuild b/arch/sparc/include/asm/Kbuild
index 2c2e388..6d27595 100644
--- a/arch/sparc/include/asm/Kbuild
+++ b/arch/sparc/include/asm/Kbuild
@@ -18,6 +18,7 @@ header-y += utrap.h
header-y += watchdog.h
generic-y += div64.h
+generic-y += gpio.h
generic-y += local64.h
generic-y += irq_regs.h
generic-y += local.h
diff --git a/arch/sparc/include/asm/gpio.h b/arch/sparc/include/asm/gpio.h
deleted file mode 100644
index a0e3ac0..0000000
--- a/arch/sparc/include/asm/gpio.h
+++ /dev/null
@@ -1,36 +0,0 @@
-#ifndef __ASM_SPARC_GPIO_H
-#define __ASM_SPARC_GPIO_H
-
-#include <linux/errno.h>
-#include <asm-generic/gpio.h>
-
-#ifdef CONFIG_GPIOLIB
-
-static inline int gpio_get_value(unsigned int gpio)
-{
- return __gpio_get_value(gpio);
-}
-
-static inline void gpio_set_value(unsigned int gpio, int value)
-{
- __gpio_set_value(gpio, value);
-}
-
-static inline int gpio_cansleep(unsigned int gpio)
-{
- return __gpio_cansleep(gpio);
-}
-
-static inline int gpio_to_irq(unsigned int gpio)
-{
- return -ENOSYS;
-}
-
-static inline int irq_to_gpio(unsigned int irq)
-{
- return -EINVAL;
-}
-
-#endif /* CONFIG_GPIOLIB */
-
-#endif /* __ASM_SPARC_GPIO_H */
diff --git a/arch/unicore32/include/asm/gpio.h b/arch/unicore32/include/asm/gpio.h
index 2716f14..437f4e8 100644
--- a/arch/unicore32/include/asm/gpio.h
+++ b/arch/unicore32/include/asm/gpio.h
@@ -13,6 +13,12 @@
#ifndef __UNICORE_GPIO_H__
#define __UNICORE_GPIO_H__
+/* We implement a few ourself */
+#define gpio_get_value gpio_get_value
+#define gpio_set_value gpio_set_value
+#define gpio_to_irq gpio_to_irq
+#define irq_to_gpio irq_to_gpio
+
#include <linux/io.h>
#include <asm/irq.h>
#include <mach/hardware.h>
@@ -83,8 +89,6 @@ static inline void gpio_set_value(unsigned gpio, int value)
__gpio_set_value(gpio, value);
}
-#define gpio_cansleep __gpio_cansleep
-
static inline unsigned gpio_to_irq(unsigned gpio)
{
if ((gpio < IRQ_GPIOHIGH) && (FIELD(1, 1, gpio) & readl(GPIO_GPIR)))
diff --git a/arch/x86/include/asm/Kbuild b/arch/x86/include/asm/Kbuild
index 6fa90a8..99d44ce 100644
--- a/arch/x86/include/asm/Kbuild
+++ b/arch/x86/include/asm/Kbuild
@@ -1,5 +1,7 @@
include include/asm-generic/Kbuild.asm
+generic-y += gpio.h
+
header-y += boot.h
header-y += bootparam.h
header-y += debugreg.h
diff --git a/arch/x86/include/asm/gpio.h b/arch/x86/include/asm/gpio.h
deleted file mode 100644
index 91d915a..0000000
--- a/arch/x86/include/asm/gpio.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Generic GPIO API implementation for x86.
- *
- * Derived from the generic GPIO API for powerpc:
- *
- * Copyright (c) 2007-2008 MontaVista Software, Inc.
- *
- * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#ifndef _ASM_X86_GPIO_H
-#define _ASM_X86_GPIO_H
-
-#include <asm-generic/gpio.h>
-
-#ifdef CONFIG_GPIOLIB
-
-/*
- * Just call gpiolib.
- */
-static inline int gpio_get_value(unsigned int gpio)
-{
- return __gpio_get_value(gpio);
-}
-
-static inline void gpio_set_value(unsigned int gpio, int value)
-{
- __gpio_set_value(gpio, value);
-}
-
-static inline int gpio_cansleep(unsigned int gpio)
-{
- return __gpio_cansleep(gpio);
-}
-
-static inline int gpio_to_irq(unsigned int gpio)
-{
- return __gpio_to_irq(gpio);
-}
-
-static inline int irq_to_gpio(unsigned int irq)
-{
- return -EINVAL;
-}
-
-#endif /* CONFIG_GPIOLIB */
-
-#endif /* _ASM_X86_GPIO_H */
diff --git a/arch/xtensa/include/asm/Kbuild b/arch/xtensa/include/asm/Kbuild
index c68e168..7d52c50 100644
--- a/arch/xtensa/include/asm/Kbuild
+++ b/arch/xtensa/include/asm/Kbuild
@@ -1 +1,3 @@
include include/asm-generic/Kbuild.asm
+
+generic-y += gpio.h
diff --git a/arch/xtensa/include/asm/gpio.h b/arch/xtensa/include/asm/gpio.h
deleted file mode 100644
index a8c9fc4..0000000
--- a/arch/xtensa/include/asm/gpio.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Generic GPIO API implementation for xtensa.
- *
- * Stolen from x86, which is derived from the generic GPIO API for powerpc:
- *
- * Copyright (c) 2007-2008 MontaVista Software, Inc.
- *
- * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#ifndef _ASM_XTENSA_GPIO_H
-#define _ASM_XTENSA_GPIO_H
-
-#include <asm-generic/gpio.h>
-
-#ifdef CONFIG_GPIOLIB
-
-/*
- * Just call gpiolib.
- */
-static inline int gpio_get_value(unsigned int gpio)
-{
- return __gpio_get_value(gpio);
-}
-
-static inline void gpio_set_value(unsigned int gpio, int value)
-{
- __gpio_set_value(gpio, value);
-}
-
-static inline int gpio_cansleep(unsigned int gpio)
-{
- return __gpio_cansleep(gpio);
-}
-
-static inline int gpio_to_irq(unsigned int gpio)
-{
- return __gpio_to_irq(gpio);
-}
-
-/*
- * Not implemented, yet.
- */
-static inline int irq_to_gpio(unsigned int irq)
-{
- return -EINVAL;
-}
-
-#endif /* CONFIG_GPIOLIB */
-
-#endif /* _ASM_XTENSA_GPIO_H */
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index d494001..622851c 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -170,6 +170,29 @@ extern int __gpio_cansleep(unsigned gpio);
extern int __gpio_to_irq(unsigned gpio);
+#ifndef gpio_get_value
+#define gpio_get_value(gpio) __gpio_get_value(gpio)
+#endif
+
+#ifndef gpio_set_value
+#define gpio_set_value(gpio, value) __gpio_set_value(gpio, value)
+#endif
+
+#ifndef gpio_cansleep
+#define gpio_cansleep(gpio) __gpio_cansleep(gpio)
+#endif
+
+#ifndef gpio_to_irq
+#define gpio_to_irq(gpio) __gpio_to_irq(gpio)
+#endif
+
+#ifndef irq_to_gpio
+static inline int irq_to_gpio(unsigned int irq)
+{
+ return -EINVAL;
+}
+#endif
+
/**
* struct gpio - a structure describing a GPIO with configuration
* @gpio: the GPIO number
--
1.7.6.1
^ permalink raw reply related
* [PATCH] powerpc: add pgprot_cached_noncoherent()
From: Geoff Thorpe @ 2011-10-27 12:58 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Geoff Thorpe
This adds a pgprot combination required by some cache-enabled IO device
mappings, such as Freescale datapath (QMan and BMan) portals.
Signed-off-by: Geoff Thorpe <geoff@geoffthorpe.net>
---
arch/powerpc/include/asm/pgtable.h | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/include/asm/pgtable.h b/arch/powerpc/include/asm/pgtable.h
index 88b0bd9..2e0e411 100644
--- a/arch/powerpc/include/asm/pgtable.h
+++ b/arch/powerpc/include/asm/pgtable.h
@@ -170,6 +170,9 @@ extern int ptep_set_access_flags(struct vm_area_struct *vma, unsigned long addre
#define pgprot_cached_wthru(prot) (__pgprot((pgprot_val(prot) & ~_PAGE_CACHE_CTL) | \
_PAGE_COHERENT | _PAGE_WRITETHRU))
+#define pgprot_cached_noncoherent(prot) \
+ (__pgprot(pgprot_val(prot) & ~_PAGE_CACHE_CTL))
+
#define pgprot_writecombine pgprot_noncached_wc
struct file;
--
1.7.3.4
^ permalink raw reply related
* Re: [PATCH 2/3] [44x] Enable CONFIG_RELOCATABLE for PPC44x
From: Suzuki Poulose @ 2011-10-27 8:43 UTC (permalink / raw)
To: Scott Wood
Cc: Michal Simek, tmarri, Mahesh Jagannath Salgaonkar, Dave Hansen,
David Laight, Paul Mackerras, linux ppc dev, Vivek Goyal
In-Reply-To: <4EA85C85.7090404@freescale.com>
On 10/27/11 00:46, Scott Wood wrote:
> On 10/26/2011 02:12 PM, Suzuki Poulose wrote:
>> On 10/25/11 21:04, Scott Wood wrote:
>>> On 10/12/2011 09:15 AM, Dave Hansen wrote:
>>>> This is not the place to enforce that kind of thing. If
>>>> CONFIG_RELOCATABLE is only supported on one platform, then do:
>>>>
>>>> config RELOCATABLE
>>>> depends on 44x
>>>>
>>>> and take the 44x reference out of the #ifdef.
>>>
>>> ...but please first rename the existing, different CONFIG_RELOCATABLE
>>> behavior that is currently supported on e500.
>>
>> Scott,
>>
>> I have renamed the new type of relocation to RELOCATABLE_PPC32_PIE. The
>> patches
>> were posted yesterday. Please let me know your thoughts.
>
> I think it would make more sense to rename the existing behavior (maybe
> something like DYNAMIC_MEMSTART -- if there's even enough overhead to
> make it worth being configurable at all), since it's not fully
> relocatable and since 64-bit already uses RELOCATABLE to mean PIE.
I think leaving the current behaviour as it is, and adding the PIE as an
additional configuration option would be safe and wouldn't disturb the
existing dependencies. ( CRASH_DUMP etc. depend on RELOCATABLE for archs
which work fine ).
For architectures with smaller TLB sizes, can afford to do the page aligned
old style mapping and not worry about PIE at all.
Thats just my view.
Disclaimer : I am not an expert in the BookE land. :-)
Thanks
Suzuki
^ permalink raw reply
* Re: Kdump/kexec for mpc85xx
From: McClintock Matthew-B29882 @ 2011-10-27 5:21 UTC (permalink / raw)
To: radha krishna; +Cc: linuxppc-dev@lists.ozlabs.org
In-Reply-To: <CAJ4m0g6vDoT6wy3owmRpJowQrJqMyB0F80y=BBTcBZtzHJUd2A@mail.gmail.com>
On Wed, Oct 26, 2011 at 11:57 PM, radha krishna <ramamru@gmail.com> wrote:
> Hi ,
>
> The subject is changed to "Kdump/kexec for mpc85xx", as i am going to use=
it
> on P2010 and MPC8567 processors as will. So that it will not confuse othe=
rs
> and to continue as a separate topic. In fact, i have selected P2041 which=
is
> e500mc core, for my next project.
> Please provide more details on "how to Kdump/kexec for 85xx?". I mean ope=
n
> source versions of kexec-tools, linux versions, etc....
> At preset, i have been using linux-2.6.32 on P2010 based board and ELDK42=
as
> tool chain.
You will need a newer kernel, I'm not precise of the exact release.
But kexec-tools project contains a HOWTO in the project under
'docs/mpc85xx.txt'. Please read that over and give it a shot. It
should work for the P2010 or the P2041 cores.
-M=
^ permalink raw reply
* Re: [PATCH v15 00/10] Add-Synopsys-DesignWare-HS-USB-OTG-driver
From: Pratyush Anand @ 2011-10-27 5:07 UTC (permalink / raw)
To: Olof Johansson; +Cc: tmarri, greg, linux-usb, linuxppc-dev
In-Reply-To: <CAOesGMg_Q6M5fsN3BsROu3XpGZGiC1Wi+GD7ksOYFMNfn_wW0Q@mail.gmail.com>
On Sun, Oct 23, 2011 at 2:00 AM, Olof Johansson <olof@lixom.net> wrote:
>
> Hi,
>
> On Fri, Oct 21, 2011 at 10:33 AM, Olof Johansson <olof@lixom.net> wrote:
> > On Fri, Oct 14, 2011 at 03:08:34PM -0700, tmarri@apm.com wrote:
> >> From: Tirumala Marri <tmarri@apm.com>
> >
> > Overall this driver seems to be based on the IP vendor driver? It
> > looks like a completely flexible driver that implements all possible
> > combinations of everything.
>
> After looking a little closer at the patch set, it seems that number
> one thing you need to do is simplify the driver. A lot.
>
> I suggest starting from scratch with a clean implementation, only
> bringing in the pieces you need. Over time, if other vendors are using
Writing from scratch might take lot of time. I have used this driver
on a ARM based platform,
and found it stable after just a bit modification , which I have
suggested in my earlier mails.
I have run all the test cases of standard testusb (except for
iscochronous), and have found
them working after the suggested modifications. So, I think that
driver is stable in a sense, and
can be included into mainline.
Regards
Pratyush
> other aspects of the same IP, they get to add those parts of the
> driver when they need it. =A0Look at the dwc3 driver for comparison on
> cleanliness, it's much cleaner than what you've posted.
>
>
> -Olof
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at =A0http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH v15 00/10] Add-Synopsys-DesignWare-HS-USB-OTG-driver
From: Greg KH @ 2011-10-27 4:51 UTC (permalink / raw)
To: Tirumala Marri; +Cc: linux-usb, linuxppc-dev
In-Reply-To: <0a2f495d6415e9cad48ae2c75c582e0d@mail.gmail.com>
On Wed, Oct 26, 2011 at 10:17:19AM -0700, Tirumala Marri wrote:
> Greg,
>
> <
> <No, just start over from scratch. Just leave the crap driver behind,
> <use it for reference but write the new one.
What email client are you using, I have never seen this type of
formatting, and it makes it impossible to read your replies. Please
resolve this.
> <It's obvious given that you are already at iteration v15 and it's
> <still looking this bad that this is not realistic to get reviewed and
> <accepted as-is. I don't think staging is a good target either -- what
> <the driver really needs is _functional_ cut-down to only cover the use
> <cases that your product uses, and staging cleanups are mostly around
> <style and refactoring, not changing, fixing or removing functionality.
> <
> <> <Compare this to the dwc3 driver, which is much much cleaner.
> <> <
> Could you please comment on this. This has been reviewed so many times
> And we did the major changes. I think it is un-acceptable to say to
> re-write
> The driver now after 15 reviews? This should have happened in first 5
> reviews.
Sometimes people miss things on previous reviews, this is not a perfict
system, only the best that we currently know how to do, don't you agree?
If this driver contains lots of things that are not necessary for it to
work at this point in time, why wouldn't that be removed now?
Anyway, I think it would probably be best to get this into staging for
now, which will help you get a way to clean it up in an easier manner,
and still have users have access to it. Is that acceptable?
thanks,
greg k-h
^ permalink raw reply
* Re: Kdump/kexec for mpc85xx
From: radha krishna @ 2011-10-27 4:57 UTC (permalink / raw)
To: McClintock Matthew-B29882; +Cc: linuxppc-dev@lists.ozlabs.org
[-- Attachment #1: Type: text/plain, Size: 962 bytes --]
Hi ,
The subject is changed to "Kdump/kexec for mpc85xx", as i am going to use it
on P2010 and MPC8567 processors as will. So that it will not confuse others
and to continue as a separate topic. In fact, i have selected P2041 which is
e500mc core, for my next project.
Please provide more details on "how to Kdump/kexec for 85xx?". I mean open
source versions of kexec-tools, linux versions, etc....
At preset, i have been using linux-2.6.32 on P2010 based board and ELDK42 as
tool chain.
On Wed, Oct 26, 2011 at 6:27 AM, McClintock Matthew-B29882 <
B29882@freescale.com> wrote:
> On Mon, Oct 24, 2011 at 7:35 AM, radha krishna <ramamru@gmail.com> wrote:
> > Hi Team,
> >
> > I am using Linux-3.0 on mpc8379 RDB. I have downloaded kexec-tools-2.0.2
> > package from open source and cross compiled for ppc_6xx.
> > But, the kexec is not booting with kernel loaded with "kexec -l".
>
> I'm not sure who has tested on 83xx stuff, I've only done 85xx.
>
> -M
>
[-- Attachment #2: Type: text/html, Size: 1422 bytes --]
^ permalink raw reply
* ps3-linux tree back at k.org
From: Geoff Levand @ 2011-10-27 4:02 UTC (permalink / raw)
To: Linuxppc-dev; +Cc: cbe-oss-dev
Hi All,
Just for anyone interested, my ps3-linux kernel git repo is back
at kernel.org:
http://git.kernel.org/?p=linux/kernel/git/geoff/ps3-linux.git
I haven't merged in mainline for a while because there is a bug
in the scheduler IPI code I want to get fix before I merge.
-Geoff
^ permalink raw reply
* RE: [PATCH v15 00/10] Add-Synopsys-DesignWare-HS-USB-OTG-driver
From: Geoff Levand @ 2011-10-27 3:52 UTC (permalink / raw)
To: Tirumala Marri; +Cc: Olof Johansson, greg, linux-usb, linuxppc-dev
In-Reply-To: <d4b201db8e7510eeeca77dc26dab02c1@mail.gmail.com>
Hi Marri,
On Wed, 2011-10-26 at 09:06 -0700, Tirumala Marri wrote:
> <
> <No, just start over from scratch. Just leave the crap driver behind,
> <use it for reference but write the new one.
> <
> <It's obvious given that you are already at iteration v15 and it's
> <still looking this bad that this is not realistic to get reviewed and
> <accepted as-is. I don't think staging is a good target either -- what
> <the driver really needs is _functional_ cut-down to only cover the use
> <cases that your product uses, and staging cleanups are mostly around
> <style and refactoring, not changing, fixing or removing functionality.
> <
> [Tirumala Marri] I like to hear What maintainer GregKH thinks. We already
> spent lot
> Of time on it and passed multiple hands.
I don't think the amount of time spent should be given much
consideration. What matters is whether or not the code is acceptable.
Maybe you can do some coding on a whiteboard to get it right -- hahaha.
-Geoff
^ permalink raw reply
* [PATCH] powerpc/iommu: remove default window before creating larger window
From: Nishanth Aravamudan @ 2011-10-26 22:43 UTC (permalink / raw)
To: benh; +Cc: miltonm, paulus, linuxppc-dev
The DDW feature relies on there being sufficient TCE space to allocate
for the requested DMA window size. The default window uses up some of
that space, though, and it is recommended to first remove the default
window and then allocate the larger window advertised by firmware. Do
this by abstracting out parts of remove_ddw into a function that does
not assume an existing larger window has been created.
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
---
arch/powerpc/platforms/pseries/iommu.c | 35 +++++++++++++++++++++++--------
1 files changed, 26 insertions(+), 9 deletions(-)
Is there a better way to get the default window's LIOBN than to call
of_parse_dma_window?
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index 01faab9..afcc04c 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -655,6 +655,21 @@ static int __init disable_ddw_setup(char *str)
early_param("disable_ddw", disable_ddw_setup);
+static void __remove_ddw(struct device_node *np, const u32 *ddw_avail, u64 liobn)
+{
+ int ret;
+
+ ret = rtas_call(ddw_avail[2], 1, 1, NULL, liobn);
+ if (ret)
+ pr_warning("%s: failed to remove direct window: rtas returned "
+ "%d to ibm,remove-pe-dma-window(%x) %llx\n",
+ np->full_name, ret, ddw_avail[2], liobn);
+ else
+ pr_debug("%s: successfully removed direct window: rtas returned "
+ "%d to ibm,remove-pe-dma-window(%x) %llx\n",
+ np->full_name, ret, ddw_avail[2], liobn);
+}
+
static void remove_ddw(struct device_node *np)
{
struct dynamic_dma_window_prop *dwp;
@@ -684,15 +699,7 @@ static void remove_ddw(struct device_node *np)
pr_debug("%s successfully cleared tces in window.\n",
np->full_name);
- ret = rtas_call(ddw_avail[2], 1, 1, NULL, liobn);
- if (ret)
- pr_warning("%s: failed to remove direct window: rtas returned "
- "%d to ibm,remove-pe-dma-window(%x) %llx\n",
- np->full_name, ret, ddw_avail[2], liobn);
- else
- pr_debug("%s: successfully removed direct window: rtas returned "
- "%d to ibm,remove-pe-dma-window(%x) %llx\n",
- np->full_name, ret, ddw_avail[2], liobn);
+ __remove_ddw(np, ddw_avail, liobn);
delprop:
ret = prom_remove_property(np, win64);
@@ -843,6 +850,8 @@ static u64 enable_ddw(struct pci_dev *dev, struct device_node *pdn)
struct direct_window *window;
struct property *win64;
struct dynamic_dma_window_prop *ddwprop;
+ const void *dma_window = NULL;
+ unsigned long liobn, offset, size;
mutex_lock(&direct_window_init_mutex);
@@ -918,6 +927,14 @@ static u64 enable_ddw(struct pci_dev *dev, struct device_node *pdn)
goto out_free_prop;
}
+ /*
+ * To maximize the resources available to the create RTAS call,
+ * delete the existing DMA window
+ */
+ dma_window = of_get_property(pdn, "ibm,dma-window", NULL);
+ of_parse_dma_window(pdn, dma_window, &liobn, &offset, &size);
+ __remove_ddw(pdn, ddw_avail, liobn);
+
ret = create_ddw(dev, ddw_avail, &create, page_shift, len);
if (ret != 0)
goto out_free_prop;
--
1.7.5.4
--
Nishanth Aravamudan <nacc@us.ibm.com>
IBM Linux Technology Center
^ permalink raw reply related
* [PATCH] [v2] powerpc/fsl_msi: add support for the fsl, msi property in PCI nodes
From: Timur Tabi @ 2011-10-26 22:30 UTC (permalink / raw)
To: kumar.gala, scottwood, miltonm, tglx, benh, linuxppc-dev
On Freescale parts with multiple MSI controllers, the controllers are
combined into one "pool" of interrupts. Whenever a device requests an MSI
interrupt, the next available interrupt from the pool is selected,
regardless of which MSI controller the interrupt is from. This works
because each PCI bus has an ATMU to all of CCSR, so any PCI device can
access any MSI interrupt register.
The fsl,msi property is used to specify that a given PCI bus should only
use a specific MSI device. This is necessary, for example, with the
Freescale hypervisor, because the MSI devices are assigned to specific
partitions.
Ideally, we'd like to be able to assign MSI devices to PCI busses within
the MSI or PCI layers. However, there does not appear to be a mechanism
to do that. Whenever the MSI layer wants to allocate an MSI interrupt to
a PCI device, it just calls arch_setup_msi_irqs(). It would be nice if we
could register an MSI device with a specific PCI bus.
So instead we remember the phandles of each MSI device, and we use that to
limit our search for an available interrupt. Whenever we are asked to
allocate a new interrupt for a PCI device, we check the fsl,msi property
of the PCI bus for that device. If it exists, then as we are looping over
all MSI devices, we skip the ones that don't have a matching phandle.
Signed-off-by: Timur Tabi <timur@freescale.com>
---
arch/powerpc/sysdev/fsl_msi.c | 33 +++++++++++++++++++++++++++++++++
arch/powerpc/sysdev/fsl_msi.h | 3 +++
2 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c
index e5c344d..155ccb2 100644
--- a/arch/powerpc/sysdev/fsl_msi.c
+++ b/arch/powerpc/sysdev/fsl_msi.c
@@ -148,14 +148,41 @@ static void fsl_compose_msi_msg(struct pci_dev *pdev, int hwirq,
static int fsl_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
{
+ struct pci_controller *hose = pci_bus_to_host(pdev->bus);
+ struct device_node *np;
+ phandle phandle = 0;
int rc, hwirq = -ENOMEM;
unsigned int virq;
struct msi_desc *entry;
struct msi_msg msg;
struct fsl_msi *msi_data;
+ /*
+ * If the PCI node has an fsl,msi property, then we need to use it
+ * to find the specific MSI.
+ */
+ np = of_parse_phandle(hose->dn, "fsl,msi", 0);
+ if (np)
+ phandle = np->phandle;
+
list_for_each_entry(entry, &pdev->msi_list, list) {
+ /*
+ * Loop over all the available MSI devices until we find one
+ * that has an available interrupt.
+ */
list_for_each_entry(msi_data, &msi_head, list) {
+ /*
+ * If the PCI node has an fsl,msi property, then we
+ * need to restrict our search to the corresponding
+ * MSI node. The simplest way is to skip over MSI
+ * nodes with the wrong phandle. Under the Freescale
+ * hypervisor, this has the additional benefit of
+ * skipping over MSI nodes that are not mapped in the
+ * PAMU.
+ */
+ if (phandle && (phandle != msi_data->phandle))
+ continue;
+
hwirq = msi_bitmap_alloc_hwirqs(&msi_data->bitmap, 1);
if (hwirq >= 0)
break;
@@ -370,6 +397,12 @@ static int __devinit fsl_of_msi_probe(struct platform_device *dev)
msi->msiir_offset = features->msiir_offset + (res.start & 0xfffff);
+ /*
+ * Remember the phandle, so that we can match with any PCI nodes
+ * that have an "fsl,msi" property.
+ */
+ msi->phandle = dev->dev.of_node->phandle;
+
rc = fsl_msi_init_allocator(msi);
if (rc) {
dev_err(&dev->dev, "Error allocating MSI bitmap\n");
diff --git a/arch/powerpc/sysdev/fsl_msi.h b/arch/powerpc/sysdev/fsl_msi.h
index 1313abb..b5d25ba 100644
--- a/arch/powerpc/sysdev/fsl_msi.h
+++ b/arch/powerpc/sysdev/fsl_msi.h
@@ -13,6 +13,7 @@
#ifndef _POWERPC_SYSDEV_FSL_MSI_H
#define _POWERPC_SYSDEV_FSL_MSI_H
+#include <linux/of.h>
#include <asm/msi_bitmap.h>
#define NR_MSI_REG 8
@@ -36,6 +37,8 @@ struct fsl_msi {
struct msi_bitmap bitmap;
struct list_head list; /* support multiple MSI banks */
+
+ phandle phandle;
};
#endif /* _POWERPC_SYSDEV_FSL_MSI_H */
--
1.7.3.4
^ permalink raw reply related
* [PATCH] powerpc/fsl_msi: add support for the fsl, msi property in PCI nodes
From: Timur Tabi @ 2011-10-26 21:22 UTC (permalink / raw)
To: kumar.gala, scottwood, miltonm, tglx, benh, linuxppc-dev
On Freescale parts with multiple MSI controllers, the controllers are
combined into one "pool" of interrupts. Whenever a device requests an MSI
interrupt, the next available interrupt from the pool is selected,
regardless of which MSI controller the interrupt is from. This works
because each PCI bus has an ATMU to all of CCSR, so any PCI device can
access any MSI interrupt register.
The fsl,msi property is used to specify that a given PCI bus should only
use a specific MSI device. This is necessary, for example, with the
Freescale hypervisor, because the MSI devices are assigned to specific
partitions.
Ideally, we'd like to be able to assign MSI devices to PCI busses within
the MSI or PCI layers. However, there does not appear to be a mechanism
to do that. Whenever the MSI layer wants to allocate an MSI interrupt to
a PCI device, it just calls arch_setup_msi_irqs(). It would be nice if we
could register an MSI device with a specific PCI bus.
So instead we remember the phandles of each MSI device, and we use that to
limit our search for an available interrupt. Whenever we are asked to
allocate a new interrupt for a PCI device, we check the fsl,msi property
of the PCI bus for that device. If it exists, then as we are looping over
all MSI devices, we skip the ones that don't have a matching phandle.
Signed-off-by: Timur Tabi <timur@freescale.com>
---
arch/powerpc/sysdev/fsl_msi.c | 33 +++++++++++++++++++++++++++++++++
1 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c
index e5c344d..ef08b1b 100644
--- a/arch/powerpc/sysdev/fsl_msi.c
+++ b/arch/powerpc/sysdev/fsl_msi.c
@@ -148,14 +148,41 @@ static void fsl_compose_msi_msg(struct pci_dev *pdev, int hwirq,
static int fsl_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
{
+ struct pci_controller *hose = pci_bus_to_host(pdev->bus);
+ struct device_node *np = hose->dn;
+ phandle phandle = 0;
int rc, hwirq = -ENOMEM;
unsigned int virq;
struct msi_desc *entry;
struct msi_msg msg;
struct fsl_msi *msi_data;
+ /*
+ * If the PCI node has an fsl,msi property, then we need to use it
+ * to find the specific MSI.
+ */
+ np = of_parse_phandle(hose->dn, "fsl,msi", 0);
+ if (np)
+ phandle = np->phandle;
+
list_for_each_entry(entry, &pdev->msi_list, list) {
+ /*
+ * Loop over all the available MSI devices until we find one
+ * that has an available interrupt.
+ */
list_for_each_entry(msi_data, &msi_head, list) {
+ /*
+ * If the PCI node has an fsl,msi property, then we
+ * need to restrict our search to the corresponding
+ * MSI node. The simplest way is to skip over MSI
+ * nodes with the wrong phandle. Under the Freescale
+ * hypervisor, this has the additional benefit of
+ * skipping over MSI nodes that are not mapped in the
+ * PAMU.
+ */
+ if (phandle && (phandle != msi_data->phandle))
+ continue;
+
hwirq = msi_bitmap_alloc_hwirqs(&msi_data->bitmap, 1);
if (hwirq >= 0)
break;
@@ -370,6 +397,12 @@ static int __devinit fsl_of_msi_probe(struct platform_device *dev)
msi->msiir_offset = features->msiir_offset + (res.start & 0xfffff);
+ /*
+ * Remember the phandle, so that we can match with any PCI nodes
+ * that have an "fsl,msi" property.
+ */
+ msi->phandle = dev->dev.of_node->phandle;
+
rc = fsl_msi_init_allocator(msi);
if (rc) {
dev_err(&dev->dev, "Error allocating MSI bitmap\n");
--
1.7.3.4
^ permalink raw reply related
* Re: [PATCH 2/3] [44x] Enable CONFIG_RELOCATABLE for PPC44x
From: Scott Wood @ 2011-10-26 19:16 UTC (permalink / raw)
To: Suzuki Poulose
Cc: Michal Simek, tmarri, Mahesh Jagannath Salgaonkar, Dave Hansen,
David Laight, Paul Mackerras, linux ppc dev, Vivek Goyal
In-Reply-To: <4EA85B95.9030802@in.ibm.com>
On 10/26/2011 02:12 PM, Suzuki Poulose wrote:
> On 10/25/11 21:04, Scott Wood wrote:
>> On 10/12/2011 09:15 AM, Dave Hansen wrote:
>>> This is not the place to enforce that kind of thing. If
>>> CONFIG_RELOCATABLE is only supported on one platform, then do:
>>>
>>> config RELOCATABLE
>>> depends on 44x
>>>
>>> and take the 44x reference out of the #ifdef.
>>
>> ...but please first rename the existing, different CONFIG_RELOCATABLE
>> behavior that is currently supported on e500.
>
> Scott,
>
> I have renamed the new type of relocation to RELOCATABLE_PPC32_PIE. The
> patches
> were posted yesterday. Please let me know your thoughts.
I think it would make more sense to rename the existing behavior (maybe
something like DYNAMIC_MEMSTART -- if there's even enough overhead to
make it worth being configurable at all), since it's not fully
relocatable and since 64-bit already uses RELOCATABLE to mean PIE.
-Scott
^ permalink raw reply
* Re: [PATCH 2/3] [44x] Enable CONFIG_RELOCATABLE for PPC44x
From: Suzuki Poulose @ 2011-10-26 19:12 UTC (permalink / raw)
To: Scott Wood
Cc: Michal Simek, tmarri, Mahesh Jagannath Salgaonkar, Dave Hansen,
David Laight, Paul Mackerras, linux ppc dev, Vivek Goyal
In-Reply-To: <4EA6D701.3030603@freescale.com>
On 10/25/11 21:04, Scott Wood wrote:
> On 10/12/2011 09:15 AM, Dave Hansen wrote:
>> On Tue, 2011-10-11 at 18:24 +0530, Suzuki Poulose wrote:
>>> On 10/10/11 23:30, Scott Wood wrote:
>>>> On 10/10/2011 04:56 AM, Suzuki K. Poulose wrote:
>>>>> #if defined(CONFIG_RELOCATABLE)&& defined(CONFIG_44x)
>>>>> #define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) - PHYSICAL_START + (KERNELBASE + RELOC_OFFSET)))
>>>>> #define __pa(x) ((unsigned long)(x) + PHYSICAL_START - (KERNELBASE + RELOC_OFFSET))
>>>>> #endif
>>>>
>>>> Why is this 44x-specific?
>>>
>>> As of now, we compile with relocations only for the 44x. We could make this
>>> generic once the approach is accepted by everyone and implemented on the other
>>> platforms.
>>
>> This is not the place to enforce that kind of thing. If
>> CONFIG_RELOCATABLE is only supported on one platform, then do:
>>
>> config RELOCATABLE
>> depends on 44x
>>
>> and take the 44x reference out of the #ifdef.
>
> ...but please first rename the existing, different CONFIG_RELOCATABLE
> behavior that is currently supported on e500.
Scott,
I have renamed the new type of relocation to RELOCATABLE_PPC32_PIE. The patches
were posted yesterday. Please let me know your thoughts.
Thanks
Suzuki
^ permalink raw reply
* [PATCH v4 1/5] powerpc/85xx: issue 15 EOI after core reset for FSL CoreNet devices
From: Matthew McClintock @ 2011-10-26 18:46 UTC (permalink / raw)
To: linuxppc-dev, kumar.gala
In-Reply-To: <1319654028-30478-1-git-send-email-msm@freescale.com>
This is listed as a requirement for Freescale CoreNet based devices (e.g
p4080ds with MPIC v4.x) after issuing a core reset to properly clear pending
interrupts.
Signed-off-by: Matthew McClintock <msm@freescale.com>
---
v2: Updated commit message
v3: Added detail in code comment as well
v4: Check for MPIC_FSL in mpic->flags to determine if we need 15 EOIs
arch/powerpc/sysdev/mpic.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 9678081..0842c6f 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -1748,6 +1748,7 @@ void mpic_reset_core(int cpu)
struct mpic *mpic = mpic_primary;
u32 pir;
int cpuid = get_hard_smp_processor_id(cpu);
+ int i;
/* Set target bit for core reset */
pir = mpic_read(mpic->gregs, MPIC_INFO(GREG_PROCESSOR_INIT));
@@ -1759,6 +1760,15 @@ void mpic_reset_core(int cpu)
pir &= ~(1 << cpuid);
mpic_write(mpic->gregs, MPIC_INFO(GREG_PROCESSOR_INIT), pir);
mpic_read(mpic->gregs, MPIC_INFO(GREG_PROCESSOR_INIT));
+
+ /* Perform 15 EOI on each reset core to clear pending interrupts.
+ * This is required for FSL CoreNet based devices */
+ if (mpic->flags & MPIC_FSL) {
+ for (i = 0; i < 15; i++) {
+ _mpic_write(mpic->reg_type, &mpic->cpuregs[cpuid],
+ MPIC_CPU_EOI, 0);
+ }
+ }
}
#endif /* CONFIG_SMP */
--
1.7.6.1
^ permalink raw reply related
* [PATCH v3 1/5] powerpc/85xx: issue 15 EOI after core reset for FSL CoreNet devices
From: Matthew McClintock @ 2011-10-26 18:33 UTC (permalink / raw)
To: linuxppc-dev, kumar.gala
In-Reply-To: <08F58B37-0825-4C07-91B3-1040A7E70528@freescale.com>
This is listed as a requirement for Freescale CoreNet based devices (e.g
p4080ds with MPIC v4.x) after issuing a core reset to properly clear pending
interrupts.
Signed-off-by: Matthew McClintock <msm@freescale.com>
---
v2: Updated commit message
v3: Added detail in code comment as well
arch/powerpc/sysdev/mpic.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 9678081..d641481 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -1748,6 +1748,7 @@ void mpic_reset_core(int cpu)
struct mpic *mpic = mpic_primary;
u32 pir;
int cpuid = get_hard_smp_processor_id(cpu);
+ int i;
/* Set target bit for core reset */
pir = mpic_read(mpic->gregs, MPIC_INFO(GREG_PROCESSOR_INIT));
@@ -1759,6 +1760,13 @@ void mpic_reset_core(int cpu)
pir &= ~(1 << cpuid);
mpic_write(mpic->gregs, MPIC_INFO(GREG_PROCESSOR_INIT), pir);
mpic_read(mpic->gregs, MPIC_INFO(GREG_PROCESSOR_INIT));
+
+ /* Perform 15 EOI on each reset core to clear pending interrupts.
+ * This is required for FSL CoreNet based devices */
+ for (i = 0; i < 15; i++) {
+ _mpic_write(mpic->reg_type, &mpic->cpuregs[cpuid],
+ MPIC_CPU_EOI, 0);
+ }
}
#endif /* CONFIG_SMP */
--
1.7.6.1
^ permalink raw reply related
* Re: [PATCH 1/5] powerpc/85xx: issue 15 EOI after core reset for FSL CoreNet devices
From: Segher Boessenkool @ 2011-10-26 18:30 UTC (permalink / raw)
To: Matthew McClintock; +Cc: kumar.gala, linuxppc-dev
In-Reply-To: <1319652797-28017-1-git-send-email-msm@freescale.com>
> @@ -1759,6 +1760,12 @@ void mpic_reset_core(int cpu)
> pir &= ~(1 << cpuid);
> mpic_write(mpic->gregs, MPIC_INFO(GREG_PROCESSOR_INIT), pir);
> mpic_read(mpic->gregs, MPIC_INFO(GREG_PROCESSOR_INIT));
> +
> + /* Perform 15 EOI on each reset core to clear pending interrupts */
> + for (i = 0; i < 15; i++) {
> + _mpic_write(mpic->reg_type, &mpic->cpuregs[cpuid],
> + MPIC_CPU_EOI, 0);
> + }
This is generic code, right? Please add info to the comment about
which devices need this quirk, then.
Segher
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox