* Re: [PATCH 01/11] powerpc/85xx: Add 'fsl, pq3-gpio' compatiable for GPIO driver
From: Kumar Gala @ 2011-11-03 17:59 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev
In-Reply-To: <1319318452-27036-1-git-send-email-galak@kernel.crashing.org>
On Oct 22, 2011, at 4:20 PM, Kumar Gala wrote:
> Support MPC85xx platforms outside of MPC8572/MPC8536. The
> MPC8572/MPC8536 have an erratum that is worked around based on having
> "fsl,mpc8572-gpio" in the compatiable list. All other MPC85xx SoCs
> don't require this workaround and thus utilize the 'fsl,pq3-gpio'
> compatiable.
>
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
> ---
> drivers/gpio/gpio-mpc8xxx.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
applied
- k
^ permalink raw reply
* Re: [PATCH] powerpc/86xx: Correct Gianfar support for GE boards
From: Kumar Gala @ 2011-11-03 17:59 UTC (permalink / raw)
To: Martyn Welch; +Cc: linuxppc-dev
In-Reply-To: <20111103173726.23924.83647.stgit@ES-BJ21R4J>
On Nov 3, 2011, at 12:37 PM, Martyn Welch wrote:
> The GE DTBs were not updated when the Gianfar driver was converted to =
an
> of_platform_driver in commit b31a1d8b41513b96e9c7ec2f68c5734cef0b26a4. =
Update
> the DTBs, adding the required TBI entries.
>=20
> Signed-off-by: Martyn Welch <martyn.welch@ge.com>
> ---
>=20
> arch/powerpc/boot/dts/gef_ppc9a.dts | 33 =
+++++++++++++++++++++++++++++----
> arch/powerpc/boot/dts/gef_sbc310.dts | 33 =
+++++++++++++++++++++++++++++----
> arch/powerpc/boot/dts/gef_sbc610.dts | 33 =
+++++++++++++++++++++++++++++----
> 3 files changed, 87 insertions(+), 12 deletions(-)
>=20
applied
- k=
^ permalink raw reply
* [PATCH] powerpc/86xx: Correct Gianfar support for GE boards
From: Martyn Welch @ 2011-11-03 17:37 UTC (permalink / raw)
To: linuxppc-dev, galak
The GE DTBs were not updated when the Gianfar driver was converted to an
of_platform_driver in commit b31a1d8b41513b96e9c7ec2f68c5734cef0b26a4. Update
the DTBs, adding the required TBI entries.
Signed-off-by: Martyn Welch <martyn.welch@ge.com>
---
arch/powerpc/boot/dts/gef_ppc9a.dts | 33 +++++++++++++++++++++++++++++----
arch/powerpc/boot/dts/gef_sbc310.dts | 33 +++++++++++++++++++++++++++++----
arch/powerpc/boot/dts/gef_sbc610.dts | 33 +++++++++++++++++++++++++++++----
3 files changed, 87 insertions(+), 12 deletions(-)
diff --git a/arch/powerpc/boot/dts/gef_ppc9a.dts b/arch/powerpc/boot/dts/gef_ppc9a.dts
index 83f4b79..2266bbb 100644
--- a/arch/powerpc/boot/dts/gef_ppc9a.dts
+++ b/arch/powerpc/boot/dts/gef_ppc9a.dts
@@ -269,14 +269,16 @@
enet0: ethernet@24000 {
#address-cells = <1>;
#size-cells = <1>;
+ cell-index = <0>;
device_type = "network";
- model = "eTSEC";
+ model = "TSEC";
compatible = "gianfar";
reg = <0x24000 0x1000>;
ranges = <0x0 0x24000 0x1000>;
local-mac-address = [ 00 00 00 00 00 00 ];
- interrupts = <0x1d 0x2 0x1e 0x2 0x22 0x2>;
+ interrupts = <29 2 30 2 34 2>;
interrupt-parent = <&mpic>;
+ tbi-handle = <&tbi0>;
phy-handle = <&phy0>;
phy-connection-type = "gmii";
@@ -290,25 +292,48 @@
interrupt-parent = <&gef_pic>;
interrupts = <0x9 0x4>;
reg = <1>;
+ device_type = "ethernet-phy";
};
phy2: ethernet-phy@2 {
interrupt-parent = <&gef_pic>;
interrupts = <0x8 0x4>;
reg = <3>;
+ device_type = "ethernet-phy";
+ };
+ tbi0: tbi-phy@11 {
+ reg = <0x11>;
+ device_type = "tbi-phy";
};
};
};
enet1: ethernet@26000 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ cell-index = <2>;
device_type = "network";
- model = "eTSEC";
+ model = "TSEC";
compatible = "gianfar";
reg = <0x26000 0x1000>;
+ ranges = <0x0 0x26000 0x1000>;
local-mac-address = [ 00 00 00 00 00 00 ];
- interrupts = <0x1f 0x2 0x20 0x2 0x21 0x2>;
+ interrupts = <31 2 32 2 33 2>;
interrupt-parent = <&mpic>;
+ tbi-handle = <&tbi2>;
phy-handle = <&phy2>;
phy-connection-type = "gmii";
+
+ mdio@520 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "fsl,gianfar-tbi";
+ reg = <0x520 0x20>;
+
+ tbi2: tbi-phy@11 {
+ reg = <0x11>;
+ device_type = "tbi-phy";
+ };
+ };
};
serial0: serial@4500 {
diff --git a/arch/powerpc/boot/dts/gef_sbc310.dts b/arch/powerpc/boot/dts/gef_sbc310.dts
index fc3a331..429e87d 100644
--- a/arch/powerpc/boot/dts/gef_sbc310.dts
+++ b/arch/powerpc/boot/dts/gef_sbc310.dts
@@ -267,14 +267,16 @@
enet0: ethernet@24000 {
#address-cells = <1>;
#size-cells = <1>;
+ cell-index = <0>;
device_type = "network";
- model = "eTSEC";
+ model = "TSEC";
compatible = "gianfar";
reg = <0x24000 0x1000>;
ranges = <0x0 0x24000 0x1000>;
local-mac-address = [ 00 00 00 00 00 00 ];
- interrupts = <0x1d 0x2 0x1e 0x2 0x22 0x2>;
+ interrupts = <29 2 30 2 34 2>;
interrupt-parent = <&mpic>;
+ tbi-handle = <&tbi0>;
phy-handle = <&phy0>;
phy-connection-type = "gmii";
@@ -288,25 +290,48 @@
interrupt-parent = <&gef_pic>;
interrupts = <0x9 0x4>;
reg = <1>;
+ device_type = "ethernet-phy";
};
phy2: ethernet-phy@2 {
interrupt-parent = <&gef_pic>;
interrupts = <0x8 0x4>;
reg = <3>;
+ device_type = "ethernet-phy";
+ };
+ tbi0: tbi-phy@11 {
+ reg = <0x11>;
+ device_type = "tbi-phy";
};
};
};
enet1: ethernet@26000 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ cell-index = <2>;
device_type = "network";
- model = "eTSEC";
+ model = "TSEC";
compatible = "gianfar";
reg = <0x26000 0x1000>;
+ ranges = <0x0 0x26000 0x1000>;
local-mac-address = [ 00 00 00 00 00 00 ];
- interrupts = <0x1f 0x2 0x20 0x2 0x21 0x2>;
+ interrupts = <31 2 32 2 33 2>;
interrupt-parent = <&mpic>;
+ tbi-handle = <&tbi2>;
phy-handle = <&phy2>;
phy-connection-type = "gmii";
+
+ mdio@520 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "fsl,gianfar-tbi";
+ reg = <0x520 0x20>;
+
+ tbi2: tbi-phy@11 {
+ reg = <0x11>;
+ device_type = "tbi-phy";
+ };
+ };
};
serial0: serial@4500 {
diff --git a/arch/powerpc/boot/dts/gef_sbc610.dts b/arch/powerpc/boot/dts/gef_sbc610.dts
index c0671cc..d81201a 100644
--- a/arch/powerpc/boot/dts/gef_sbc610.dts
+++ b/arch/powerpc/boot/dts/gef_sbc610.dts
@@ -267,14 +267,16 @@
enet0: ethernet@24000 {
#address-cells = <1>;
#size-cells = <1>;
+ cell-index = <0>;
device_type = "network";
- model = "eTSEC";
+ model = "TSEC";
compatible = "gianfar";
reg = <0x24000 0x1000>;
ranges = <0x0 0x24000 0x1000>;
local-mac-address = [ 00 00 00 00 00 00 ];
- interrupts = <0x1d 0x2 0x1e 0x2 0x22 0x2>;
+ interrupts = <29 2 30 2 34 2>;
interrupt-parent = <&mpic>;
+ tbi-handle = <&tbi0>;
phy-handle = <&phy0>;
phy-connection-type = "gmii";
@@ -288,25 +290,48 @@
interrupt-parent = <&gef_pic>;
interrupts = <0x9 0x4>;
reg = <1>;
+ device_type = "ethernet-phy";
};
phy2: ethernet-phy@2 {
interrupt-parent = <&gef_pic>;
interrupts = <0x8 0x4>;
reg = <3>;
+ device_type = "ethernet-phy";
+ };
+ tbi0: tbi-phy@11 {
+ reg = <0x11>;
+ device_type = "tbi-phy";
};
};
};
enet1: ethernet@26000 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ cell-index = <2>;
device_type = "network";
- model = "eTSEC";
+ model = "TSEC";
compatible = "gianfar";
reg = <0x26000 0x1000>;
+ ranges = <0x0 0x26000 0x1000>;
local-mac-address = [ 00 00 00 00 00 00 ];
- interrupts = <0x1f 0x2 0x20 0x2 0x21 0x2>;
+ interrupts = <31 2 32 2 33 2>;
interrupt-parent = <&mpic>;
+ tbi-handle = <&tbi2>;
phy-handle = <&phy2>;
phy-connection-type = "gmii";
+
+ mdio@520 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ compatible = "fsl,gianfar-tbi";
+ reg = <0x520 0x20>;
+
+ tbi2: tbi-phy@11 {
+ reg = <0x11>;
+ device_type = "tbi-phy";
+ };
+ };
};
serial0: serial@4500 {
--
Martyn Welch (Principal Software Engineer) | Registered in England and
GE Intelligent Platforms | Wales (3828642) at 100
T +44(0)127322748 | Barbirolli Square, Manchester,
E martyn.welch@ge.com | M2 3AB VAT:GB 927559189
^ permalink raw reply related
* Re: [PATCH] powerpc/usb: use unsigned long to type cast an address of ioremap
From: Timur Tabi @ 2011-11-03 14:12 UTC (permalink / raw)
To: David Laight
Cc: <linux-usb@vger.kernel.org>,
<linuxppc-dev@lists.ozlabs.org>, Xie Shaohui-B21989
In-Reply-To: <AE90C24D6B3A694183C094C60CF0A2F6D8AEA4@saturn3.aculab.com>
On Nov 3, 2011, at 7:16 AM, David Laight <David.Laight@ACULAB.COM> wrote:
> Arithmetic on 'void *' should not be done. I know some versions of
> gcc allow it (provided some warning level/option is enabled) but
> that doesn't mean it is valid.
> My suspicions are that is was allowed due to the way 'void *'
> was originally bodged into gcc.
Well, I don't know what else to say. Arithmetic on void* is done all over t=
he kernel. You're a little late to the party if you're going to advocate it=
s avoidance. =20
^ permalink raw reply
* Re: [PATCH 2/4] powerpc/time: Use clocksource_register_hz
From: John Stultz @ 2011-11-03 13:14 UTC (permalink / raw)
To: Anton Blanchard; +Cc: paulus, linuxppc-dev
In-Reply-To: <20111103010111.951358660@samba.org>
On Thu, 2011-11-03 at 11:59 +1100, Anton Blanchard wrote:
> plain text document attachment (clock3)
> Use clocksource_register_hz which calculates the shift/mult
> factors for us.
>
> Signed-off-by: Anton Blanchard <anton@samba.org>
> ---
>
> Index: linux-build/arch/powerpc/kernel/time.c
> ===================================================================
> --- linux-build.orig/arch/powerpc/kernel/time.c 2011-11-03 10:19:59.493679032 +1100
> +++ linux-build/arch/powerpc/kernel/time.c 2011-11-03 10:20:00.965704053 +1100
> @@ -86,8 +86,6 @@ static struct clocksource clocksource_rt
> .rating = 400,
> .flags = CLOCK_SOURCE_IS_CONTINUOUS,
> .mask = CLOCKSOURCE_MASK(64),
> - .shift = 22,
> - .mult = 0, /* To be filled in */
> .read = rtc_read,
> };
>
> @@ -97,8 +95,6 @@ static struct clocksource clocksource_ti
> .rating = 400,
> .flags = CLOCK_SOURCE_IS_CONTINUOUS,
> .mask = CLOCKSOURCE_MASK(64),
> - .shift = 22,
> - .mult = 0, /* To be filled in */
> .read = timebase_read,
> };
So I've held off on ppc conversion to clocksource_register_hz due to the
fact that the ppc vdso gettimeofday at least used to make assumptions
that shift was 22.
Is that no longer the case?
thanks
-john
^ permalink raw reply
* RE: Support for multiple MSI interrupts on MPC8377
From: Giffel, Brad @ 2011-11-03 12:19 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <1320292282.3852.33.camel@concordia>
A single MSI interrupt it is then.
Thanks,
- Brad
-----Original Message-----
From: Michael Ellerman [mailto:michael@ellerman.id.au]=20
Sent: Wednesday, November 02, 2011 10:51 PM
To: Giffel, Brad
Cc: linuxppc-dev@lists.ozlabs.org; Matthew Wilcox
Subject: Re: Support for multiple MSI interrupts on MPC8377
On Wed, 2011-11-02 at 16:02 -0500, Giffel, Brad wrote:
> I'm working a project using a Spartan 6 FPGA with a PCIe interface and
> MSI interrupts. I want to use multiple MSI interrupts (MSI-X is not
> supported in the FPGA PCIe core) but the current Linux distribution
> (3.0.8) prevents that (lines 23 to 25 in arch/powerpc/kernel/msi.c).
>=20
> =20
>=20
> What's the story here? Is the code in place but not tested? I tried
> commenting out those lines but a request_irq() called failed for the
> second interrupt requested. Am I wasting my time here? Should I
> re-architect to use a single MSI interrupt?
The short and easy answer is you should use a single MSI interrupt.
There is some code in place to support multiple MSI, but only in the
generic code (drivers/pci/msi.c), and I'm not sure if it's complete.
There is no arch support, for any arch AFAIK, and certainly not for
powerpc.
cheers
^ permalink raw reply
* RE: [PATCH] powerpc/usb: use unsigned long to type cast an address of ioremap
From: David Laight @ 2011-11-03 12:16 UTC (permalink / raw)
To: Tabi Timur-B04825; +Cc: linux-usb, linuxppc-dev, Xie Shaohui-B21989
In-Reply-To: <4EB283F5.6000202@freescale.com>
> >> > usb_sys_regs =3D (void *)dr_regs + USB_DR_SYS_OFFSET;
>=20
> > But that is invalid C.
>=20
> What's invalid about it? I haven't tried compiling this=20
> specific line of code, but I've done stuff like it in the past many
times.
>=20
> Are you talking about adding an integer to a void pointer? =20
> If so, then that's something that gcc supports and that the kernel
uses=20
> all over the place.
Arithmetic on 'void *' should not be done. I know some versions of
gcc allow it (provided some warning level/option is enabled) but
that doesn't mean it is valid.
My suspicions are that is was allowed due to the way 'void *'
was originally bodged into gcc.
> A char* is incorrect because a char could be more=20
> than one byte, in theory.
It is somewhat difficult to untangle the standard, but
sizeof (char) is defined to be one.
Of course, the C language doesn't actually require that
you can converts between pointers to different types in
any well-defined manner. But most of the low level device
access assumes an adequately linear address space.
David
^ permalink raw reply
* Re: [PATCH] powerpc/usb: use unsigned long to type cast an address of ioremap
From: Tabi Timur-B04825 @ 2011-11-03 12:07 UTC (permalink / raw)
To: David Laight
Cc: linux-usb@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
Xie Shaohui-B21989
In-Reply-To: <AE90C24D6B3A694183C094C60CF0A2F6D8AEA3@saturn3.aculab.com>
David Laight wrote:
>> > usb_sys_regs =3D (void *)dr_regs + USB_DR_SYS_OFFSET;
> But that is invalid C.
What's invalid about it? I haven't tried compiling this specific line of=20
code, but I've done stuff like it in the past many times.
Are you talking about adding an integer to a void pointer? If so, then=20
that's something that gcc supports and that the kernel uses all over the=20
place. A char* is incorrect because a char could be more than one byte,=20
in theory.
--=20
Timur Tabi
Linux kernel developer at Freescale=
^ permalink raw reply
* RE: [PATCH] powerpc/usb: use unsigned long to type cast an address of ioremap
From: David Laight @ 2011-11-03 11:38 UTC (permalink / raw)
To: Tabi Timur-B04825, Xie Shaohui-B21989; +Cc: linux-usb, linuxppc-dev
In-Reply-To: <CAOZdJXW16RbPkMfmoNu4t1c5mqCuZsztPMk1=hNc7NaYXOsx7A@mail.gmail.com>
=20
> On Thu, Nov 3, 2011 at 4:58 AM, Shaohui Xie =
<Shaohui.Xie@freescale.com> wrote:
> >
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0usb_sys_regs =3D (struct =
usb_sys_interface *)
> > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
((u32)dr_regs + USB_DR_SYS_OFFSET);
> > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
((unsigned long)dr_regs + USB_DR_SYS_OFFSET);
>=20
> This makes more sense:
>=20
> usb_sys_regs =3D (void *)dr_regs + USB_DR_SYS_OFFSET;
But that is invalid C.
David
^ permalink raw reply
* Re: [PATCH] powerpc/usb: use unsigned long to type cast an address of ioremap
From: Tabi Timur-B04825 @ 2011-11-03 11:38 UTC (permalink / raw)
To: Xie Shaohui-B21989
Cc: linux-usb@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
In-Reply-To: <1320314302-7973-1-git-send-email-Shaohui.Xie@freescale.com>
On Thu, Nov 3, 2011 at 4:58 AM, Shaohui Xie <Shaohui.Xie@freescale.com> wro=
te:
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0usb_sys_regs =3D (struct usb_sys_interface=
*)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ((u32)dr_re=
gs + USB_DR_SYS_OFFSET);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ((unsigned =
long)dr_regs + USB_DR_SYS_OFFSET);
This makes more sense:
usb_sys_regs =3D (void *)dr_regs + USB_DR_SYS_OFFSET;
--=20
Timur Tabi
Linux kernel developer at Freescale=
^ permalink raw reply
* RE: [PATCH] powerpc/usb: use unsigned long to type cast an address of ioremap
From: David Laight @ 2011-11-03 11:14 UTC (permalink / raw)
To: Shaohui Xie, linuxppc-dev; +Cc: linux-usb
In-Reply-To: <1320314302-7973-1-git-send-email-Shaohui.Xie@freescale.com>
=20
> Below are codes for accessing usb sysif_regs in driver:
>=20
> usb_sys_regs =3D (struct usb_sys_interface *)
> ((u32)dr_regs + USB_DR_SYS_OFFSET);
>=20
> these codes work in 32-bit, but in 64-bit, use u32 to type cast the
address
> of ioremap is not right, and accessing members of 'usb_sys_regs' will
cause
> call trace, so use unsigned long for both 32-bit and 64-bit.
Wouldn't a (char *) cast be even better?
David
^ permalink raw reply
* [PATCH] powerpc/usb: use unsigned long to type cast an address of ioremap
From: Shaohui Xie @ 2011-11-03 9:58 UTC (permalink / raw)
To: linuxppc-dev; +Cc: linux-usb, Shaohui Xie
Below are codes for accessing usb sysif_regs in driver:
usb_sys_regs = (struct usb_sys_interface *)
((u32)dr_regs + USB_DR_SYS_OFFSET);
these codes work in 32-bit, but in 64-bit, use u32 to type cast the address
of ioremap is not right, and accessing members of 'usb_sys_regs' will cause
call trace, so use unsigned long for both 32-bit and 64-bit.
Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
---
drivers/usb/gadget/fsl_udc_core.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c
index c81fbad..581b7cc 100644
--- a/drivers/usb/gadget/fsl_udc_core.c
+++ b/drivers/usb/gadget/fsl_udc_core.c
@@ -2498,7 +2498,7 @@ static int __init fsl_udc_probe(struct platform_device *pdev)
#ifndef CONFIG_ARCH_MXC
if (pdata->have_sysif_regs)
usb_sys_regs = (struct usb_sys_interface *)
- ((u32)dr_regs + USB_DR_SYS_OFFSET);
+ ((unsigned long)dr_regs + USB_DR_SYS_OFFSET);
#endif
/* Initialize USB clocks */
--
1.6.4
^ permalink raw reply related
* Re: Support for multiple MSI interrupts on MPC8377
From: Michael Ellerman @ 2011-11-03 3:51 UTC (permalink / raw)
To: Giffel, Brad; +Cc: linuxppc-dev, Matthew Wilcox
In-Reply-To: <FBC631D6B23BAB40AF19415483130F7A6FD458@HBMURBX.hbm.com>
[-- Attachment #1: Type: text/plain, Size: 929 bytes --]
On Wed, 2011-11-02 at 16:02 -0500, Giffel, Brad wrote:
> I’m working a project using a Spartan 6 FPGA with a PCIe interface and
> MSI interrupts. I want to use multiple MSI interrupts (MSI-X is not
> supported in the FPGA PCIe core) but the current Linux distribution
> (3.0.8) prevents that (lines 23 to 25 in arch/powerpc/kernel/msi.c).
>
>
>
> What’s the story here? Is the code in place but not tested? I tried
> commenting out those lines but a request_irq() called failed for the
> second interrupt requested. Am I wasting my time here? Should I
> re-architect to use a single MSI interrupt?
The short and easy answer is you should use a single MSI interrupt.
There is some code in place to support multiple MSI, but only in the
generic code (drivers/pci/msi.c), and I'm not sure if it's complete.
There is no arch support, for any arch AFAIK, and certainly not for
powerpc.
cheers
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply
* [PATCH v3] asm-generic/gpio.h: merge basic gpiolib wrappers
From: Mike Frysinger @ 2011-11-03 3:45 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: <1319720503-3183-1-git-send-email-vapier@gentoo.org>
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: all defconfigs
- blackfin defconfig
- ia64 defconfig
- m68k: multi & m5208evb 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.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
v3
- built on top of Linus' recent gpio fixes
- fixes builds for one or two arm platforms
- all the arm defconfigs have been checked on the disassembly level
arch/alpha/include/asm/Kbuild | 2 +
arch/alpha/include/asm/gpio.h | 55 -------------------
arch/arm/include/asm/gpio.h | 16 ------
arch/arm/include/asm/hardware/iop3xx-gpio.h | 21 ++------
arch/arm/mach-davinci/include/mach/gpio.h | 13 ++---
arch/arm/mach-ixp4xx/include/mach/gpio.h | 8 +--
arch/arm/mach-ks8695/include/mach/gpio.h | 1 +
arch/arm/mach-mmp/include/mach/gpio.h | 2 -
arch/arm/mach-pxa/include/mach/gpio.h | 2 +-
arch/arm/mach-sa1100/include/mach/gpio.h | 13 ++---
arch/arm/mach-shmobile/include/mach/gpio.h | 16 ------
arch/arm/mach-w90x900/include/mach/gpio.h | 1 +
arch/arm/plat-omap/include/plat/gpio.h | 4 +-
arch/arm/plat-pxa/include/plat/gpio.h | 8 ++--
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/m68k/include/asm/gpio.h | 7 +++
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 ++++++++
42 files changed, 107 insertions(+), 601 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..9818329 100644
--- a/arch/arm/include/asm/gpio.h
+++ b/arch/arm/include/asm/gpio.h
@@ -4,23 +4,7 @@
/* not all ARM platforms necessarily support this API ... */
#include <mach/gpio.h>
-#ifndef __ARM_GPIOLIB_COMPLEX
/* 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
-
-/*
- * Provide a default gpio_to_irq() which should satisfy every case.
- * However, some platforms want to do this differently, so allow them
- * to override it.
- */
-#ifndef gpio_to_irq
-#define gpio_to_irq __gpio_to_irq
-#endif
-
#endif /* _ARCH_ARM_GPIO_H */
diff --git a/arch/arm/include/asm/hardware/iop3xx-gpio.h b/arch/arm/include/asm/hardware/iop3xx-gpio.h
index 9eda7dc..4033b81 100644
--- a/arch/arm/include/asm/hardware/iop3xx-gpio.h
+++ b/arch/arm/include/asm/hardware/iop3xx-gpio.h
@@ -25,11 +25,14 @@
#ifndef __ASM_ARM_HARDWARE_IOP3XX_GPIO_H
#define __ASM_ARM_HARDWARE_IOP3XX_GPIO_H
+/* We implement a few ourself */
+#define gpio_get_value gpio_get_value
+#define gpio_set_value gpio_set_value
+#define gpio_cansleep gpio_cansleep
+
#include <mach/hardware.h>
#include <asm-generic/gpio.h>
-#define __ARM_GPIOLIB_COMPLEX
-
#define IOP3XX_N_GPIOS 8
static inline int gpio_get_value(unsigned gpio)
@@ -57,19 +60,5 @@ static inline int gpio_cansleep(unsigned gpio)
return __gpio_cansleep(gpio);
}
-/*
- * The GPIOs are not generating any interrupt
- * Note : manuals are not clear about this
- */
-static inline int gpio_to_irq(int gpio)
-{
- return -EINVAL;
-}
-
-static inline int irq_to_gpio(int gpio)
-{
- return -EINVAL;
-}
-
#endif
diff --git a/arch/arm/mach-davinci/include/mach/gpio.h b/arch/arm/mach-davinci/include/mach/gpio.h
index 960e9de..1604005 100644
--- a/arch/arm/mach-davinci/include/mach/gpio.h
+++ b/arch/arm/mach-davinci/include/mach/gpio.h
@@ -13,9 +13,12 @@
#ifndef __DAVINCI_GPIO_H
#define __DAVINCI_GPIO_H
-#include <asm-generic/gpio.h>
+/* We implement a few ourself */
+#define gpio_set_value gpio_set_value
+#define gpio_get_value gpio_get_value
+#define gpio_cansleep gpio_cansleep
-#define __ARM_GPIOLIB_COMPLEX
+#include <asm-generic/gpio.h>
/* The inline versions use the static inlines in the driver header */
#include "gpio-davinci.h"
@@ -79,10 +82,4 @@ static inline int gpio_cansleep(unsigned gpio)
return __gpio_cansleep(gpio);
}
-static inline int irq_to_gpio(unsigned irq)
-{
- /* don't support the reverse mapping */
- return -ENOSYS;
-}
-
#endif /* __DAVINCI_GPIO_H */
diff --git a/arch/arm/mach-ixp4xx/include/mach/gpio.h b/arch/arm/mach-ixp4xx/include/mach/gpio.h
index 83d6b4e..7835e31 100644
--- a/arch/arm/mach-ixp4xx/include/mach/gpio.h
+++ b/arch/arm/mach-ixp4xx/include/mach/gpio.h
@@ -28,8 +28,6 @@
#include <linux/kernel.h>
#include <mach/hardware.h>
-#define __ARM_GPIOLIB_COMPLEX
-
static inline int gpio_request(unsigned gpio, const char *label)
{
return 0;
@@ -63,17 +61,17 @@ static inline int gpio_get_value(unsigned gpio)
return value;
}
+#define gpio_get_value gpio_get_value
static inline void gpio_set_value(unsigned gpio, int value)
{
gpio_line_set(gpio, value);
}
-
-#include <asm-generic/gpio.h> /* cansleep wrappers */
+#define gpio_set_value gpio_set_value
extern int gpio_to_irq(int gpio);
#define gpio_to_irq gpio_to_irq
extern int irq_to_gpio(unsigned int irq);
+#define irq_to_gpio irq_to_gpio
#endif
-
diff --git a/arch/arm/mach-ks8695/include/mach/gpio.h b/arch/arm/mach-ks8695/include/mach/gpio.h
index f5fda36..d81c6f8 100644
--- a/arch/arm/mach-ks8695/include/mach/gpio.h
+++ b/arch/arm/mach-ks8695/include/mach/gpio.h
@@ -15,5 +15,6 @@
* Map IRQ number to GPIO line.
*/
extern int irq_to_gpio(unsigned int irq);
+#define irq_to_gpio irq_to_gpio
#endif
diff --git a/arch/arm/mach-mmp/include/mach/gpio.h b/arch/arm/mach-mmp/include/mach/gpio.h
index 6812623..871b4c8 100644
--- a/arch/arm/mach-mmp/include/mach/gpio.h
+++ b/arch/arm/mach-mmp/include/mach/gpio.h
@@ -1,8 +1,6 @@
#ifndef __ASM_MACH_GPIO_H
#define __ASM_MACH_GPIO_H
-#include <asm-generic/gpio.h>
-
#define gpio_to_irq(gpio) (IRQ_GPIO_START + (gpio))
#define irq_to_gpio(irq) ((irq) - IRQ_GPIO_START)
diff --git a/arch/arm/mach-pxa/include/mach/gpio.h b/arch/arm/mach-pxa/include/mach/gpio.h
index 004cade..a28277c 100644
--- a/arch/arm/mach-pxa/include/mach/gpio.h
+++ b/arch/arm/mach-pxa/include/mach/gpio.h
@@ -24,7 +24,6 @@
#ifndef __ASM_ARCH_PXA_GPIO_H
#define __ASM_ARCH_PXA_GPIO_H
-#include <asm-generic/gpio.h>
/* The defines for the driver are needed for the accelerated accessors */
#include "gpio-pxa.h"
@@ -43,6 +42,7 @@ static inline int irq_to_gpio(unsigned int irq)
return -1;
}
+#define irq_to_gpio irq_to_gpio
#include <plat/gpio.h>
#endif
diff --git a/arch/arm/mach-sa1100/include/mach/gpio.h b/arch/arm/mach-sa1100/include/mach/gpio.h
index 7036318..6198f7a 100644
--- a/arch/arm/mach-sa1100/include/mach/gpio.h
+++ b/arch/arm/mach-sa1100/include/mach/gpio.h
@@ -24,12 +24,16 @@
#ifndef __ASM_ARCH_SA1100_GPIO_H
#define __ASM_ARCH_SA1100_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) ((gpio < 11) ? (IRQ_GPIO0 + gpio) : \
+ (IRQ_GPIO11 - 11 + gpio))
+
#include <mach/hardware.h>
#include <asm/irq.h>
#include <asm-generic/gpio.h>
-#define __ARM_GPIOLIB_COMPLEX
-
static inline int gpio_get_value(unsigned gpio)
{
if (__builtin_constant_p(gpio) && (gpio <= GPIO_MAX))
@@ -49,9 +53,4 @@ static inline void gpio_set_value(unsigned gpio, int value)
__gpio_set_value(gpio, value);
}
-#define gpio_cansleep __gpio_cansleep
-
-#define gpio_to_irq(gpio) ((gpio < 11) ? (IRQ_GPIO0 + gpio) : \
- (IRQ_GPIO11 - 11 + gpio))
-
#endif
diff --git a/arch/arm/mach-shmobile/include/mach/gpio.h b/arch/arm/mach-shmobile/include/mach/gpio.h
index 7bf0890..f8a5637 100644
--- a/arch/arm/mach-shmobile/include/mach/gpio.h
+++ b/arch/arm/mach-shmobile/include/mach/gpio.h
@@ -10,23 +10,7 @@
#ifndef __ASM_ARCH_GPIO_H
#define __ASM_ARCH_GPIO_H
-#include <linux/kernel.h>
-#include <linux/errno.h>
-
#define ARCH_NR_GPIOS 1024
#include <linux/sh_pfc.h>
-#ifdef CONFIG_GPIOLIB
-
-static inline int irq_to_gpio(unsigned int irq)
-{
- return -ENOSYS;
-}
-
-#else
-
-#define __ARM_GPIOLIB_COMPLEX
-
-#endif /* CONFIG_GPIOLIB */
-
#endif /* __ASM_ARCH_GPIO_H */
diff --git a/arch/arm/mach-w90x900/include/mach/gpio.h b/arch/arm/mach-w90x900/include/mach/gpio.h
index 5385a42..c905219 100644
--- a/arch/arm/mach-w90x900/include/mach/gpio.h
+++ b/arch/arm/mach-w90x900/include/mach/gpio.h
@@ -26,5 +26,6 @@ static inline int irq_to_gpio(unsigned irq)
{
return irq;
}
+#define irq_to_gpio irq_to_gpio
#endif
diff --git a/arch/arm/plat-omap/include/plat/gpio.h b/arch/arm/plat-omap/include/plat/gpio.h
index 9e86ee0..1fd4986 100644
--- a/arch/arm/plat-omap/include/plat/gpio.h
+++ b/arch/arm/plat-omap/include/plat/gpio.h
@@ -219,9 +219,6 @@ extern void omap_gpio_restore_context(void);
* The original OMAP-specific calls should eventually be removed.
*/
-#include <linux/errno.h>
-#include <asm-generic/gpio.h>
-
static inline int irq_to_gpio(unsigned irq)
{
int tmp;
@@ -238,5 +235,6 @@ static inline int irq_to_gpio(unsigned irq)
/* we don't supply reverse mappings for non-SOC gpios */
return -EIO;
}
+#define irq_to_gpio irq_to_gpio
#endif
diff --git a/arch/arm/plat-pxa/include/plat/gpio.h b/arch/arm/plat-pxa/include/plat/gpio.h
index 258f772..60380f7 100644
--- a/arch/arm/plat-pxa/include/plat/gpio.h
+++ b/arch/arm/plat-pxa/include/plat/gpio.h
@@ -1,11 +1,13 @@
#ifndef __PLAT_GPIO_H
#define __PLAT_GPIO_H
-#define __ARM_GPIOLIB_COMPLEX
-
/* The individual machine provides register offsets and NR_BUILTIN_GPIO */
#include <mach/gpio-pxa.h>
+#define gpio_get_value gpio_get_value
+#define gpio_set_value gpio_set_value
+#include <asm-generic/gpio.h>
+
static inline int gpio_get_value(unsigned gpio)
{
if (__builtin_constant_p(gpio) && (gpio < NR_BUILTIN_GPIO))
@@ -25,6 +27,4 @@ static inline void gpio_set_value(unsigned gpio, int value)
__gpio_set_value(gpio, value);
}
-#define gpio_cansleep __gpio_cansleep
-
#endif /* __PLAT_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/m68k/include/asm/gpio.h b/arch/m68k/include/asm/gpio.h
index b204683..4544b6a 100644
--- a/arch/m68k/include/asm/gpio.h
+++ b/arch/m68k/include/asm/gpio.h
@@ -16,6 +16,13 @@
#ifndef coldfire_gpio_h
#define coldfire_gpio_h
+/* We implement a few ourself */
+#define gpio_get_value gpio_get_value
+#define gpio_set_value gpio_set_value
+#define gpio_cansleep gpio_cansleep
+#define gpio_to_irq gpio_to_irq
+#define irq_to_gpio irq_to_gpio
+
#include <linux/io.h>
#include <asm-generic/gpio.h>
#include <asm/coldfire.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 8c86210..1990836 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -171,6 +171,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
+
extern int gpio_request_one(unsigned gpio, unsigned long flags, const char *label);
extern int gpio_request_array(const struct gpio *array, size_t num);
extern void gpio_free_array(const struct gpio *array, size_t num);
--
1.7.6.1
^ permalink raw reply related
* Re: Regression: patch " hvc_console: display printk messages on console." causing infinite loop with 3.2-rc0 + Xen.
From: Greg KH @ 2011-11-03 1:30 UTC (permalink / raw)
To: Stephen Rothwell
Cc: xen-devel, Konrad Rzeszutek Wilk, Rusty Russell, miche,
linux-kernel, virtualization, Linus, Anton Blanchard, Amit Shah,
ppc-dev
In-Reply-To: <20111102121309.4dbb0d2ac90d2879130820dd@canb.auug.org.au>
On Wed, Nov 02, 2011 at 12:13:09PM +1100, Stephen Rothwell wrote:
> Hi Greg,
>
> On Thu, 27 Oct 2011 07:48:06 +0200 Greg KH <gregkh@suse.de> wrote:
> >
> > On Thu, Oct 27, 2011 at 01:30:08AM -0400, Konrad Rzeszutek Wilk wrote:
> > > Hey Miche.
> > >
> > > The git commit 361162459f62dc0826b82c9690a741a940f457f0:
> > >
> > > hvc_console: display printk messages on console.
> > >
> > > is causing an infinite loop when booting Linux under Xen, as so:
> >
> > Ick, not good, thanks for letting us know.
>
> Indeed. I am wondering why it was put in a tree and sent to Linus without
> any Acks or even being replied to by anyone. It appeared in the tty tree
> between Oct 14 and Oct 25 (while I was unfortunately on vacation). If
> anyone had tried to boot this on any PowerPC server, it would have been
> immediately obvious (as it was when I booted Linus' tree last night).
>
> And the original author expressed doubts as to his understanding of how
> it should all work anyway.
>
> Just a little more care, please.
>
> I would vote for reverting the original and having it resubmitted with
> corrections at some later date.
You are right, I will go do that, sorry for the problems.
greg k-h
^ permalink raw reply
* Re: What does rmo/tce stand for in powerpc?
From: Ryan Wang @ 2011-11-03 1:05 UTC (permalink / raw)
To: Scott Wood; +Cc: Nishanth Aravamudan, linuxppc-dev
In-Reply-To: <4EB197B8.8020504@freescale.com>
[-- Attachment #1: Type: text/plain, Size: 1350 bytes --]
2011/11/3 Scott Wood <scottwood@freescale.com>
> On 11/02/2011 06:17 AM, Ryan Wang wrote:
> >
> >
> > 2011/11/2 Nishanth Aravamudan <nacc@us.ibm.com <mailto:nacc@us.ibm.com>>
> >
> > Hi Ryan,
> >
> > On 01.11.2011 [14:25:43 +0800], Ryan Wang wrote:
> > > Hi,
> > >
> > > In kernel source comments, I saw the words:
> > > ''
> > >
> > > alloc_top is set to the top of RMO, eventually shrink down if the
> > > <http://lxr.linux.no/linux+*/arch/powerpc/kernel/prom_init.c#L972
> > <http://lxr.linux.no/linux+*/arch/powerpc/kernel/prom_init.c#L972
> >>TCEs
> > > overlap
> > >
> > > ''
> > >
> > > I wonder what does RMO mean, and TCE?
> >
> > RMO = Real Mode Offset -- deprecated in terms of Real Mode Area in
> PAPR.
> >
> > TCE = Translation Control Entry
> >
> > You should be able to find descriptions of both in PAPR.
> >
> >
> > Thanks Nish!
> >
> > But I searched <Power.orgTM Standard for Embedded Power ArchitectureTM
> > Platform Requirements> and failed to found the concept RMO or Real Mode
> > Offset.
> >
> > Will you please give me some hints to the docs?Thanks,
>
> ePAPR and PAPR are not the same thing.
>
> It looks like PAPR is only available to power.org members.
>
Got it. Thanks, Nish.
>
> -Scott
>
>
[-- Attachment #2: Type: text/html, Size: 2580 bytes --]
^ permalink raw reply
* [PATCH 4/4] powerpc/time: Fix some style issues
From: Anton Blanchard @ 2011-11-03 0:59 UTC (permalink / raw)
To: benh, paulus, johnstul; +Cc: linuxppc-dev
In-Reply-To: <20111103005922.854058953@samba.org>
Fix some formatting issues and use the DECREMENTER_MAX
define instead of 0x7fffffff.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-build/arch/powerpc/kernel/time.c
===================================================================
--- linux-build.orig/arch/powerpc/kernel/time.c 2011-11-03 10:20:02.117723634 +1100
+++ linux-build/arch/powerpc/kernel/time.c 2011-11-03 10:20:03.101740361 +1100
@@ -82,20 +82,20 @@
static cycle_t rtc_read(struct clocksource *);
static struct clocksource clocksource_rtc = {
- .name = "rtc",
- .rating = 400,
- .flags = CLOCK_SOURCE_IS_CONTINUOUS,
- .mask = CLOCKSOURCE_MASK(64),
- .read = rtc_read,
+ .name = "rtc",
+ .rating = 400,
+ .flags = CLOCK_SOURCE_IS_CONTINUOUS,
+ .mask = CLOCKSOURCE_MASK(64),
+ .read = rtc_read,
};
static cycle_t timebase_read(struct clocksource *);
static struct clocksource clocksource_timebase = {
- .name = "timebase",
- .rating = 400,
- .flags = CLOCK_SOURCE_IS_CONTINUOUS,
- .mask = CLOCKSOURCE_MASK(64),
- .read = timebase_read,
+ .name = "timebase",
+ .rating = 400,
+ .flags = CLOCK_SOURCE_IS_CONTINUOUS,
+ .mask = CLOCKSOURCE_MASK(64),
+ .read = timebase_read,
};
#define DECREMENTER_MAX 0x7fffffff
@@ -106,12 +106,12 @@ static void decrementer_set_mode(enum cl
struct clock_event_device *dev);
static struct clock_event_device decrementer_clockevent = {
- .name = "decrementer",
- .rating = 200,
- .irq = 0,
- .set_next_event = decrementer_set_next_event,
- .set_mode = decrementer_set_mode,
- .features = CLOCK_EVT_FEAT_ONESHOT,
+ .name = "decrementer",
+ .rating = 200,
+ .irq = 0,
+ .set_next_event = decrementer_set_next_event,
+ .set_mode = decrementer_set_mode,
+ .features = CLOCK_EVT_FEAT_ONESHOT,
};
static DEFINE_PER_CPU(struct clock_event_device, decrementers);
@@ -430,7 +430,7 @@ EXPORT_SYMBOL(profile_pc);
/*
* This function recalibrates the timebase based on the 49-bit time-of-day
* value in the Titan chip. The Titan is much more accurate than the value
- * returned by the service processor for the timebase frequency.
+ * returned by the service processor for the timebase frequency.
*/
static int __init iSeries_tb_recal(void)
@@ -628,9 +628,9 @@ static void generic_suspend_disable_irqs
* with suspending.
*/
- set_dec(0x7fffffff);
+ set_dec(DECREMENTER_MAX);
local_irq_disable();
- set_dec(0x7fffffff);
+ set_dec(DECREMENTER_MAX);
}
static void generic_suspend_enable_irqs(void)
@@ -965,10 +965,10 @@ void __init time_init(void)
boot_tb = get_tb_or_rtc();
/* If platform provided a timezone (pmac), we correct the time */
- if (timezone_offset) {
+ if (timezone_offset) {
sys_tz.tz_minuteswest = -timezone_offset / 60;
sys_tz.tz_dsttime = 0;
- }
+ }
vdso_data->tb_update_count = 0;
vdso_data->tb_ticks_per_sec = tb_ticks_per_sec;
^ permalink raw reply
* [PATCH 3/4] powerpc/time: Remove unnecessary sanity check of decrementer expiration
From: Anton Blanchard @ 2011-11-03 0:59 UTC (permalink / raw)
To: benh, paulus, johnstul; +Cc: linuxppc-dev
In-Reply-To: <20111103005922.854058953@samba.org>
The clockevents code uses max_delta_ns to avoid calling a clockevent
with too large a value.
Remove the redundant version of this in the timer_interrupt code.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-build/arch/powerpc/kernel/time.c
===================================================================
--- linux-build.orig/arch/powerpc/kernel/time.c 2011-11-03 10:20:00.965704053 +1100
+++ linux-build/arch/powerpc/kernel/time.c 2011-11-03 10:20:02.117723634 +1100
@@ -114,12 +114,7 @@ static struct clock_event_device decreme
.features = CLOCK_EVT_FEAT_ONESHOT,
};
-struct decrementer_clock {
- struct clock_event_device event;
- u64 next_tb;
-};
-
-static DEFINE_PER_CPU(struct decrementer_clock, decrementers);
+static DEFINE_PER_CPU(struct clock_event_device, decrementers);
#ifdef CONFIG_PPC_ISERIES
static unsigned long __initdata iSeries_recal_titan;
@@ -570,9 +565,7 @@ void arch_irq_work_raise(void)
void timer_interrupt(struct pt_regs * regs)
{
struct pt_regs *old_regs;
- struct decrementer_clock *decrementer = &__get_cpu_var(decrementers);
- struct clock_event_device *evt = &decrementer->event;
- u64 now;
+ struct clock_event_device *evt = &__get_cpu_var(decrementers);
/* Ensure a positive value is written to the decrementer, or else
* some CPUs will continue to take decrementer exceptions.
@@ -607,16 +600,7 @@ void timer_interrupt(struct pt_regs * re
get_lppaca()->int_dword.fields.decr_int = 0;
#endif
- now = get_tb_or_rtc();
- if (now >= decrementer->next_tb) {
- decrementer->next_tb = ~(u64)0;
- if (evt->event_handler)
- evt->event_handler(evt);
- } else {
- now = decrementer->next_tb - now;
- if (now <= DECREMENTER_MAX)
- set_dec((int)now);
- }
+ evt->event_handler(evt);
#ifdef CONFIG_PPC_ISERIES
if (firmware_has_feature(FW_FEATURE_ISERIES) && hvlpevent_is_pending())
@@ -884,7 +868,6 @@ static void __init clocksource_init(void
static int decrementer_set_next_event(unsigned long evt,
struct clock_event_device *dev)
{
- __get_cpu_var(decrementers).next_tb = get_tb_or_rtc() + evt;
set_dec(evt);
return 0;
}
@@ -898,7 +881,7 @@ static void decrementer_set_mode(enum cl
static void register_decrementer_clockevent(int cpu)
{
- struct clock_event_device *dec = &per_cpu(decrementers, cpu).event;
+ struct clock_event_device *dec = &per_cpu(decrementers, cpu);
*dec = decrementer_clockevent;
dec->cpumask = cpumask_of(cpu);
^ permalink raw reply
* [PATCH 2/4] powerpc/time: Use clocksource_register_hz
From: Anton Blanchard @ 2011-11-03 0:59 UTC (permalink / raw)
To: benh, paulus, johnstul; +Cc: linuxppc-dev
In-Reply-To: <20111103005922.854058953@samba.org>
Use clocksource_register_hz which calculates the shift/mult
factors for us.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-build/arch/powerpc/kernel/time.c
===================================================================
--- linux-build.orig/arch/powerpc/kernel/time.c 2011-11-03 10:19:59.493679032 +1100
+++ linux-build/arch/powerpc/kernel/time.c 2011-11-03 10:20:00.965704053 +1100
@@ -86,8 +86,6 @@ static struct clocksource clocksource_rt
.rating = 400,
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
.mask = CLOCKSOURCE_MASK(64),
- .shift = 22,
- .mult = 0, /* To be filled in */
.read = rtc_read,
};
@@ -97,8 +95,6 @@ static struct clocksource clocksource_ti
.rating = 400,
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
.mask = CLOCKSOURCE_MASK(64),
- .shift = 22,
- .mult = 0, /* To be filled in */
.read = timebase_read,
};
@@ -875,9 +871,7 @@ static void __init clocksource_init(void
else
clock = &clocksource_timebase;
- clock->mult = clocksource_hz2mult(tb_ticks_per_sec, clock->shift);
-
- if (clocksource_register(clock)) {
+ if (clocksource_register_hz(clock, tb_ticks_per_sec)) {
printk(KERN_ERR "clocksource: %s is already registered\n",
clock->name);
return;
^ permalink raw reply
* [PATCH 1/4] powerpc/time: Use clockevents_calc_mult_shift
From: Anton Blanchard @ 2011-11-03 0:59 UTC (permalink / raw)
To: benh, paulus, johnstul; +Cc: linuxppc-dev
In-Reply-To: <20111103005922.854058953@samba.org>
We can use clockevents_calc_mult_shift instead of doing all
the work ourselves.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-build/arch/powerpc/kernel/time.c
===================================================================
--- linux-build.orig/arch/powerpc/kernel/time.c 2011-11-03 10:19:55.225606490 +1100
+++ linux-build/arch/powerpc/kernel/time.c 2011-11-03 10:19:59.493679032 +1100
@@ -112,8 +112,6 @@ static void decrementer_set_mode(enum cl
static struct clock_event_device decrementer_clockevent = {
.name = "decrementer",
.rating = 200,
- .shift = 0, /* To be filled in */
- .mult = 0, /* To be filled in */
.irq = 0,
.set_next_event = decrementer_set_next_event,
.set_mode = decrementer_set_mode,
@@ -904,31 +902,6 @@ static void decrementer_set_mode(enum cl
decrementer_set_next_event(DECREMENTER_MAX, dev);
}
-static inline uint64_t div_sc64(unsigned long ticks, unsigned long nsec,
- int shift)
-{
- uint64_t tmp = ((uint64_t)ticks) << shift;
-
- do_div(tmp, nsec);
- return tmp;
-}
-
-static void __init setup_clockevent_multiplier(unsigned long hz)
-{
- u64 mult, shift = 32;
-
- while (1) {
- mult = div_sc64(hz, NSEC_PER_SEC, shift);
- if (mult && (mult >> 32UL) == 0UL)
- break;
-
- shift--;
- }
-
- decrementer_clockevent.shift = shift;
- decrementer_clockevent.mult = mult;
-}
-
static void register_decrementer_clockevent(int cpu)
{
struct clock_event_device *dec = &per_cpu(decrementers, cpu).event;
@@ -946,7 +919,8 @@ static void __init init_decrementer_cloc
{
int cpu = smp_processor_id();
- setup_clockevent_multiplier(ppc_tb_freq);
+ clockevents_calc_mult_shift(&decrementer_clockevent, ppc_tb_freq, 4);
+
decrementer_clockevent.max_delta_ns =
clockevent_delta2ns(DECREMENTER_MAX, &decrementer_clockevent);
decrementer_clockevent.min_delta_ns =
^ permalink raw reply
* [PATCH 0/4] PowerPC time fixes
From: Anton Blanchard @ 2011-11-03 0:59 UTC (permalink / raw)
To: benh, paulus, johnstul; +Cc: linuxppc-dev
Switch to using the common clockevents_calc_mult_shift and
clocksource_register_hz functions, and do some cleanup along
the way.
^ permalink raw reply
* [PATCH] powerpc: Add System RAM to /proc/iomem
From: Anton Blanchard @ 2011-11-03 0:56 UTC (permalink / raw)
To: benh, paulus; +Cc: linuxppc-dev
We've resisted adding System RAM to /proc/iomem because it is
the wrong place for it. Unfortunately we continue to find tools
that rely on this behaviour so give up and add it in.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
Index: linux-build/arch/powerpc/mm/mem.c
===================================================================
--- linux-build.orig/arch/powerpc/mm/mem.c 2011-11-03 11:28:48.128478738 +1100
+++ linux-build/arch/powerpc/mm/mem.c 2011-11-03 11:53:39.002465556 +1100
@@ -34,6 +34,7 @@
#include <linux/suspend.h>
#include <linux/memblock.h>
#include <linux/hugetlb.h>
+#include <linux/slab.h>
#include <asm/pgalloc.h>
#include <asm/prom.h>
@@ -549,3 +550,32 @@ void update_mmu_cache(struct vm_area_str
hash_preload(vma->vm_mm, address, access, trap);
#endif /* CONFIG_PPC_STD_MMU */
}
+
+/*
+ * System memory should not be in /proc/iomem but various tools expect it
+ * (eg kdump).
+ */
+static int add_system_ram_resources(void)
+{
+ struct memblock_region *reg;
+
+ for_each_memblock(memory, reg) {
+ struct resource *res;
+ unsigned long base = reg->base;
+ unsigned long size = reg->size;
+
+ res = kzalloc(sizeof(struct resource), GFP_KERNEL);
+ WARN_ON(!res);
+
+ if (res) {
+ res->name = "System RAM";
+ res->start = base;
+ res->end = base + size - 1;
+ res->flags = IORESOURCE_MEM;
+ WARN_ON(request_resource(&iomem_resource, res) < 0);
+ }
+ }
+
+ return 0;
+}
+subsys_initcall(add_system_ram_resources);
^ permalink raw reply
* Re: [PATCH v2 1/5] [ppc] Process dynamic relocations for kernel
From: Josh Poimboeuf @ 2011-11-02 23:36 UTC (permalink / raw)
To: Suzuki K. Poulose
Cc: Nathan Miller, Josh Poimboeuf, Dave Hansen, Alan Modra,
Scott Wood, Paul Mackerras, linuxppc-dev
In-Reply-To: <20111025115354.8183.48237.stgit@suzukikp.in.ibm.com>
On Tue, 2011-10-25 at 17:23 +0530, Suzuki K. Poulose wrote:
> The following patch implements the dynamic relocation processing for
> PPC32 kernel. relocate() accepts the target virtual address and relocates
> the kernel image to the same.
Hi Suzuki,
Thanks for the patches. I've been testing them on a 440-based card, and
encountered TLB error exceptions because the BSS section wasn't getting
properly cleared in early_init().
It turns out that some of the instructions which were modified in
relocate() weren't then getting flushed out of the d-cache into memory.
After that, early_init() executed the stale (non-modified) instructions
for the BSS area. Those instructions just accessed offset 0 instead of
the actual BSS-related offsets. That resulted in BSS not getting`
zeroed.
I was able to verify this on my 440 by comparing the d-cache and i-cache
entries for the BSS-accessing instructions in early_init() using a
RISCWatch. As I suspected, the instructions in the d-cache showed the
corrected offsets, but the i-cache showed the old, non-relocated
offsets.
To fix the issue, I wrote the following patch, applied on top of your
patches. Suggestions and comments are welcome.
>From c88ae39da0c0352f411aca8d9636990a442d47da Mon Sep 17 00:00:00 2001
From: Josh Poimboeuf <jpoimboe@linux.vnet.ibm.com>
Date: Wed, 2 Nov 2011 16:41:24 -0500
Subject: [PATCH] Flush relocated instructions from data cache
After updating instructions with relocated addresses, flush them from
the data cache and invalidate the icache line so we don't execute stale
instructions.
Signed-off-by: Josh Poimboeuf <jpoimboe@linux.vnet.ibm.com>
---
arch/powerpc/kernel/reloc_32.S | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/kernel/reloc_32.S
b/arch/powerpc/kernel/reloc_32.S
index 045d61e..a92857d 100644
--- a/arch/powerpc/kernel/reloc_32.S
+++ b/arch/powerpc/kernel/reloc_32.S
@@ -137,6 +137,9 @@ get_type:
lwz r0, 8(r9) /* r_addend */
add r0, r0, r3 /* final addend */
stwx r0, r4, r7 /* memory[r4+r7]) = (u32)r0 */
+ dcbst r4,r7 /* flush dcache line to memory */
+ sync /* wait for flush to complete */
+ icbi r4,r7 /* invalidate icache line */
b nxtrela /* continue */
/* R_PPC_ADDR16_HI */
@@ -177,6 +180,9 @@ lo16:
/* Store half word */
store_half:
sthx r0, r4, r7 /* memory[r4+r7] = (u16)r0 */
+ dcbst r4,r7 /* flush dcache line to memory */
+ sync /* wait for flush to complete */
+ icbi r4,r7 /* invalidate icache line */
nxtrela:
cmpwi r8, 0 /* relasz = 0 ? */
@@ -185,7 +191,10 @@ nxtrela:
subf r8, r6, r8 /* relasz -= relaent */
b applyrela
-done: blr
+done:
+ sync /* wait for icache invalidates to complete */
+ isync /* discard any prefetched instructions */
+ blr
p_dyn: .long __dynamic_start - 0b
--
1.7.4.1
^ permalink raw reply related
* fpga driver on custom PPC target platform (P4080) ...
From: Robert Sciuk @ 2011-11-02 22:43 UTC (permalink / raw)
To: devicetree-discuss; +Cc: linuxppc-dev
Dear Tree lovers,
I'm in the process of designing and implementing a Linux device driver
for a Xilinx V6 FPGA which can be loaded from the CPU (P4080) on our
target board (and optionally 2 additional FPGA's on a riser card). The
programming pins of the FPGAs are tied to a MUX (PCA9539) on an i2c bus,
and the port is located on the localbus (simplebus). I'm thinking that
a uio type driver could in theory set the programming bits using the i2c
mux upon open(), and that an mmap() in userspace would perform the .bits
load, and the programming done bit would be returned in the close() of
the device from userland.
I would like to use the device tree to map both the i2c access and the
localbus mappings, and I've yet to start coding, though this may start
RSN. My questions to the list, are:
- am I barking up the wrong tree here?
- is there anyone who has done something similar before which
can be shared?
- Is there an impedance problem having the device accessed on
both I2c and localbus?
- Is there a problem combining device tree and uio drivers?
- How does one specify in the device tree an FPGA which uses
both I2c bus and localbus for programming?
This is kind of an interesting project, as I've never written a
device-tree driver before, and I've yet to use uio type drivers, but it
does seem a good match for the problem. Any comments or pointers would
be well received.
Thanks in advance, and sorry for cross-posting, I'm sure that some of
you may well see this message twice, and for that I'm sorry.
Robert Sciuk
Senior Designer, R&D.
905.738.3741 xt 22621
^ permalink raw reply
* [PATCH RFC 0/3] Support multiple VirtioConsoles.
From: Miche Baker-Harvey @ 2011-11-02 22:19 UTC (permalink / raw)
To: Stephen Rothwell, Greg Kroah-Hartman, Konrad Rzeszutek Wilk,
Benjamin Herrenschmidt, Rusty Russell, Miche Baker-Harvey,
linux-kernel, Mike Waychison, xen-devel, Anton Blanchard,
Amit Shah, virtualization, ppc-dev
This patchset applies to linux-next/next-20111102.
This series implements support for multiple virtio_consoles using KVM.
This patchset addresses several issues associated with trying to
establish multiple virtio consoles.
I'm trying to start a guest via KVM that supports multiple virtual
consoles, with getty's on each, and with some being console devices.
These patches let me establish more than one VirtioConsole (I'm
running eight at the moment), and enable console output appearing on
one of them. It still doesn't successfully generate console output on
multiple VirtioConsoles.
Let me apologise for my last patch having gotten into Linus' tree, and
leaving other people to deal with crashes. I had meant to be asking
for guidance, but I didn't mark it as "RFC".
This series reflects the input from Konrad Rzeszutek, Amit Shah, Stephen
Boyd, and Rusty Russell. I think we do have to limit hvc_alloc() to one
thread.
I would appreciate any comments or feedback, or accept if appropriate.
Thanks,
Miche Baker-Harvey
---
Miche Baker-Harvey (3):
virtio_console: Fix locking of vtermno.
hvc_init(): Enforce one-time initialization.
Use separate struct console structure for each hvc_console.
drivers/char/virtio_console.c | 9 ++++++---
drivers/tty/hvc/hvc_console.c | 33 +++++++++++++++++++++++++++++++--
drivers/tty/hvc/hvc_console.h | 1 +
3 files changed, 38 insertions(+), 5 deletions(-)
--
^ 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