LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* HELLO
From: colaristide2 @ 2005-09-16 12:29 UTC (permalink / raw)
  To: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 873 bytes --]

Hello,

My name is Col(Rtd) Jon Aristide,brother to the
exiled President of Haiti,(Dr.Jean Bertrand
Aristide)

Due to the evolution against the government
of my brother caused by his political opponents in
Haiti,we managed to enter a red cross airplane that
was evacuating foreigners and we are presently on
political assylum in Central African Repubilc(CAR)

I wish to invest in Real Estate and commercial
Properties and equally start a new life in your
country with your assistance and cooperation.If you
are in a good position to help my family,please send
an e-mail to my personal address below indicating your
desire to help meinvest this funds in your country and
beyond.
I urgently await your e-mail letter.

Reply to my confidential mail box: jonaris05@yahoo.com

Best Regards and hope to meet you soon.

God bless,

Col Jon(Rtd).

    

^ permalink raw reply

* HELLO
From: colaristide2 @ 2005-09-16 12:29 UTC (permalink / raw)
  To: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 873 bytes --]

Hello,

My name is Col(Rtd) Jon Aristide,brother to the
exiled President of Haiti,(Dr.Jean Bertrand
Aristide)

Due to the evolution against the government
of my brother caused by his political opponents in
Haiti,we managed to enter a red cross airplane that
was evacuating foreigners and we are presently on
political assylum in Central African Repubilc(CAR)

I wish to invest in Real Estate and commercial
Properties and equally start a new life in your
country with your assistance and cooperation.If you
are in a good position to help my family,please send
an e-mail to my personal address below indicating your
desire to help meinvest this funds in your country and
beyond.
I urgently await your e-mail letter.

Reply to my confidential mail box: jonaris05@yahoo.com

Best Regards and hope to meet you soon.

God bless,

Col Jon(Rtd).

    

^ permalink raw reply

* [PATCH] ppc32: Add ppc_sys descriptions for PowerQUICC I devices
From: Vitaly Bordug @ 2005-09-16 12:54 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Kumar Gala, linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 542 bytes --]

Added ppc_sys device and system definitions for PowerQUICC I devices.
This will allow drivers for PQI to be proper platform device drivers. 
Currently sys section contains only MPC885 and MPC866. Identification 
should be done with identify_ppc_sys_by_name call, with board-specific 
"name" string passed, since PQI do not have any register that could 
identify the SOC.

Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com>
Signed-off-by: Kumar Gala <kumar.gala@freescale.com>
Signed-off-by: Marcelo Tosatti <marcelo.tosatti@cyclades.com>



[-- Attachment #2: mpc8xx_sys_desc.patch --]
[-- Type: text/x-patch, Size: 8581 bytes --]

diff --git a/arch/ppc/syslib/Makefile b/arch/ppc/syslib/Makefile
--- a/arch/ppc/syslib/Makefile
+++ b/arch/ppc/syslib/Makefile
@@ -34,7 +34,8 @@ ifeq ($(CONFIG_40x),y)
 obj-$(CONFIG_PCI)		+= indirect_pci.o pci_auto.o ppc405_pci.o
 endif
 endif
-obj-$(CONFIG_8xx)		+= m8xx_setup.o ppc8xx_pic.o $(wdt-mpc8xx-y)
+obj-$(CONFIG_8xx)		+= m8xx_setup.o ppc8xx_pic.o $(wdt-mpc8xx-y) \
+				   ppc_sys.o mpc8xx_devices.o mpc8xx_sys.o
 ifeq ($(CONFIG_8xx),y)
 obj-$(CONFIG_PCI)		+= qspan_pci.o i8259.o
 endif
diff --git a/arch/ppc/syslib/mpc8xx_devices.c b/arch/ppc/syslib/mpc8xx_devices.c
new file mode 100644
--- /dev/null
+++ b/arch/ppc/syslib/mpc8xx_devices.c
@@ -0,0 +1,224 @@
+/*
+ * arch/ppc/syslib/mpc8xx_devices.c
+ *
+ * MPC8xx Device descriptions
+ *
+ * Maintainer: Kumar Gala <kumar.gala@freescale.com>
+ *
+ * Copyright 2005 MontaVista Software, Inc. by Vitaly Bordug<vbordug@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.
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/device.h>
+#include <linux/serial_8250.h>
+#include <linux/mii.h>
+#include <asm/commproc.h>
+#include <asm/mpc8xx.h>
+#include <asm/irq.h>
+#include <asm/ppc_sys.h>
+
+/* We use offsets for IORESOURCE_MEM to do not set dependences at compile time.
+ * They will get fixed up by mach_mpc8xx_fixup
+ */
+
+struct platform_device ppc_sys_platform_devices[] = {
+	[MPC8xx_CPM_FEC1] =	{
+		.name = "fsl-cpm-fec",
+		.id	= 1,
+		.num_resources = 2,
+		.resource = (struct resource[])	{
+			{
+				.name 	= "regs",
+				.start	= 0xe00,
+				.end	= 0xe88,
+				.flags	= IORESOURCE_MEM,
+			},
+			{
+				.name	= "interrupt",
+				.start	= MPC8xx_INT_FEC1,
+				.end	= MPC8xx_INT_FEC1,
+				.flags	= IORESOURCE_IRQ,
+			},
+		},
+	},
+	[MPC8xx_CPM_FEC2] =	{
+		.name = "fsl-cpm-fec",
+		.id	= 2,
+		.num_resources = 2,
+		.resource = (struct resource[])	{
+			{
+				.name	= "regs",
+				.start	= 0x1e00,
+				.end	= 0x1e88,
+				.flags	= IORESOURCE_MEM,
+			},
+			{
+				.name	= "interrupt",
+				.start	= MPC8xx_INT_FEC2,
+				.end	= MPC8xx_INT_FEC2,
+				.flags	= IORESOURCE_IRQ,
+			},
+		},
+	},
+	[MPC8xx_CPM_SCC1] = {
+		.name = "fsl-cpm-scc",
+		.id	= 1,
+		.num_resources = 3,
+		.resource = (struct resource[]) {
+			{
+				.name	= "regs",
+				.start	= 0xa00,
+				.end	= 0xa18,
+				.flags	= IORESOURCE_MEM,
+			},
+			{
+				.name 	= "pram",
+				.start 	= 0x3c00,
+				.end 	= 0x3c80,
+				.flags 	= IORESOURCE_MEM,
+			},
+			{
+				.name	= "interrupt",
+				.start	= MPC8xx_INT_SCC1,
+				.end	= MPC8xx_INT_SCC1,
+				.flags	= IORESOURCE_IRQ,
+			},
+		},
+	},
+	[MPC8xx_CPM_SCC2] = {
+		.name = "fsl-cpm-scc",
+		.id	= 2,
+		.num_resources	= 3,
+		.resource = (struct resource[]) {
+			{
+				.name	= "regs",
+				.start	= 0xa20,
+				.end	= 0xa38,
+				.flags	= IORESOURCE_MEM,
+			},
+			{
+				.name 	= "pram",
+				.start 	= 0x3d00,
+				.end 	= 0x3d80,
+				.flags 	= IORESOURCE_MEM,
+			},
+
+			{
+				.name	= "interrupt",
+				.start	= MPC8xx_INT_SCC2,
+				.end	= MPC8xx_INT_SCC2,
+				.flags	= IORESOURCE_IRQ,
+			},
+		},
+	},
+	[MPC8xx_CPM_SCC3] = {
+		.name = "fsl-cpm-scc",
+		.id	= 3,
+		.num_resources	= 3,
+		.resource = (struct resource[]) {
+			{
+				.name	= "regs",
+				.start	= 0xa40,
+				.end	= 0xa58,
+				.flags	= IORESOURCE_MEM,
+			},
+			{
+				.name 	= "pram",
+				.start 	= 0x3e00,
+				.end 	= 0x3e80,
+				.flags 	= IORESOURCE_MEM,
+			},
+
+			{
+				.name	= "interrupt",
+				.start	= MPC8xx_INT_SCC3,
+				.end	= MPC8xx_INT_SCC3,
+				.flags	= IORESOURCE_IRQ,
+			},
+		},
+	},
+	[MPC8xx_CPM_SCC4] = {
+		.name = "fsl-cpm-scc",
+		.id	= 4,
+		.num_resources	= 3,
+		.resource = (struct resource[]) {
+			{
+				.name	= "regs",
+				.start	= 0xa60,
+				.end	= 0xa78,
+				.flags	= IORESOURCE_MEM,
+			},
+			{
+				.name 	= "pram",
+				.start 	= 0x3f00,
+				.end 	= 0x3f80,
+				.flags 	= IORESOURCE_MEM,
+			},
+
+			{
+				.name	= "interrupt",
+				.start	= MPC8xx_INT_SCC4,
+				.end	= MPC8xx_INT_SCC4,
+				.flags	= IORESOURCE_IRQ,
+			},
+		},
+	},
+	[MPC8xx_CPM_SMC1] = {
+		.name = "fsl-cpm-smc",
+		.id	= 1,
+		.num_resources	= 2,
+		.resource = (struct resource[]) {
+			{
+				.name	= "regs",
+				.start	= 0xa82,
+				.end	= 0xa91,
+				.flags	= IORESOURCE_MEM,
+			},
+			{
+				.name	= "interrupt",
+				.start	= MPC8xx_INT_SMC1,
+				.end	= MPC8xx_INT_SMC1,
+				.flags	= IORESOURCE_IRQ,
+			},
+		},
+	},
+	[MPC8xx_CPM_SMC2] = {
+		.name = "fsl-cpm-smc",
+		.id	= 2,
+		.num_resources	= 2,
+		.resource = (struct resource[]) {
+			{
+				.name	= "regs",
+				.start	= 0xa92,
+				.end	= 0xaa1,
+				.flags	= IORESOURCE_MEM,
+			},
+			{
+				.name	= "interrupt",
+				.start	= MPC8xx_INT_SMC2,
+				.end	= MPC8xx_INT_SMC2,
+				.flags	= IORESOURCE_IRQ,
+			},
+		},
+	},
+};
+
+static int __init mach_mpc8xx_fixup(struct platform_device *pdev)
+{
+	ppc_sys_fixup_mem_resource (pdev, IMAP_ADDR);
+	return 0;
+}
+
+static int __init mach_mpc8xx_init(void)
+{
+	ppc_sys_device_fixup = mach_mpc8xx_fixup;
+	return 0;
+}
+
+postcore_initcall(mach_mpc8xx_init);
diff --git a/arch/ppc/syslib/mpc8xx_sys.c b/arch/ppc/syslib/mpc8xx_sys.c
new file mode 100644
--- /dev/null
+++ b/arch/ppc/syslib/mpc8xx_sys.c
@@ -0,0 +1,61 @@
+/*
+ * arch/ppc/platforms/mpc8xx_sys.c
+ *
+ * MPC8xx System descriptions
+ *
+ * Maintainer: Kumar Gala <kumar.gala@freescale.com>
+ *
+ * Copyright 2005 MontaVista Software, Inc. by Vitaly Bordug <vbordug@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.
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/device.h>
+#include <asm/ppc_sys.h>
+
+struct ppc_sys_spec *cur_ppc_sys_spec; 
+struct ppc_sys_spec ppc_sys_specs[] = {
+	{
+		.ppc_sys_name	= "MPC86X",
+		.mask 		= 0xFFFFFFFF,
+		.value 		= 0x00000000,
+		.num_devices	= 2,
+		.device_list	= (enum ppc_sys_devices[])
+		{
+			MPC8xx_CPM_FEC1,
+			MPC8xx_CPM_SCC1,
+			MPC8xx_CPM_SCC2,
+			MPC8xx_CPM_SCC3,
+			MPC8xx_CPM_SCC4,
+			MPC8xx_CPM_SMC1,
+			MPC8xx_CPM_SMC2,
+		},
+	},
+	{
+		.ppc_sys_name	= "MPC885",
+		.mask 		= 0xFFFFFFFF,
+		.value 		= 0x00000000,
+		.num_devices	= 3,
+		.device_list	= (enum ppc_sys_devices[])
+		{
+			MPC8xx_CPM_FEC1,
+			MPC8xx_CPM_FEC2,
+			MPC8xx_CPM_SCC1,
+			MPC8xx_CPM_SCC2,
+			MPC8xx_CPM_SCC3,
+			MPC8xx_CPM_SCC4,
+			MPC8xx_CPM_SMC1,
+			MPC8xx_CPM_SMC2,
+		},
+	},
+	{	/* default match */
+		.ppc_sys_name	= "",
+		.mask 		= 0x00000000,
+		.value 		= 0x00000000,
+	},
+};
diff --git a/include/asm-ppc/irq.h b/include/asm-ppc/irq.h
--- a/include/asm-ppc/irq.h
+++ b/include/asm-ppc/irq.h
@@ -138,6 +138,16 @@ irq_canonicalize(int irq)
 #define	SIU_IRQ7	(14)
 #define	SIU_LEVEL7	(15)
 
+#define MPC8xx_INT_FEC1		SIU_LEVEL1
+#define MPC8xx_INT_FEC2		SIU_LEVEL3
+
+#define MPC8xx_INT_SCC1		(CPM_IRQ_OFFSET + CPMVEC_SCC1)
+#define MPC8xx_INT_SCC2		(CPM_IRQ_OFFSET + CPMVEC_SCC2)
+#define MPC8xx_INT_SCC3		(CPM_IRQ_OFFSET + CPMVEC_SCC3)
+#define MPC8xx_INT_SCC4		(CPM_IRQ_OFFSET + CPMVEC_SCC4)
+#define MPC8xx_INT_SMC1		(CPM_IRQ_OFFSET + CPMVEC_SMC1)
+#define MPC8xx_INT_SMC2		(CPM_IRQ_OFFSET + CPMVEC_SMC2)
+
 /* The internal interrupts we can configure as we see fit.
  * My personal preference is CPM at level 2, which puts it above the
  * MBX PCI/ISA/IDE interrupts.
diff --git a/include/asm-ppc/mpc8xx.h b/include/asm-ppc/mpc8xx.h
--- a/include/asm-ppc/mpc8xx.h
+++ b/include/asm-ppc/mpc8xx.h
@@ -97,6 +97,22 @@ extern unsigned char __res[];
 
 struct pt_regs;
 
+enum ppc_sys_devices {
+	MPC8xx_CPM_FEC1,
+	MPC8xx_CPM_FEC2,
+	MPC8xx_CPM_I2C,
+	MPC8xx_CPM_SCC1,
+	MPC8xx_CPM_SCC2,
+	MPC8xx_CPM_SCC3,
+	MPC8xx_CPM_SCC4,
+	MPC8xx_CPM_SPI,
+	MPC8xx_CPM_MCC1,
+	MPC8xx_CPM_MCC2,
+	MPC8xx_CPM_SMC1,
+	MPC8xx_CPM_SMC2,
+	MPC8xx_CPM_USB,
+};
+
 #endif /* !__ASSEMBLY__ */
 #endif /* CONFIG_8xx */
 #endif /* __CONFIG_8xx_DEFS */
diff --git a/include/asm-ppc/ppc_sys.h b/include/asm-ppc/ppc_sys.h
--- a/include/asm-ppc/ppc_sys.h
+++ b/include/asm-ppc/ppc_sys.h
@@ -27,6 +27,8 @@
 #include <asm/mpc83xx.h>
 #elif defined(CONFIG_85xx)
 #include <asm/mpc85xx.h>
+#elif defined(CONFIG_8xx)
+#include <asm/mpc8xx.h>
 #elif defined(CONFIG_PPC_MPC52xx)
 #include <asm/mpc52xx.h>
 #elif defined(CONFIG_MPC10X_BRIDGE)

^ permalink raw reply

* I2S MPC5200
From: Arnaud Carer @ 2005-09-16 13:29 UTC (permalink / raw)
  To: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 640 bytes --]

Hi,

I am looking for an I2s Linux driver to implement an audio output with the
mpc5200

 

I2s.c and i2s_ring.c include in the DENX ELDK kernel seems to be wrong.

 

>i2s.c is not really a driver, but a (very OLD) test  version  of  one
>used  to  demonstrate  certain  BestComm  related problems. Don't try
>using it as a real driver ;-)
 
>The ring driver appears to be RX only, 
 
 
Thanks,
 
Arnaud

 

 

 

 

___________________________________

 

Arnaud Carer

Firmware Development 

 

 <http://www.cleode.fr/>  <http://www.cleode.fr/> CLEODE

 <http://www.cleode.fr> www.cleode.fr

Tel: 02 96 48 68 18

Fax: 02 96 48 19 11

 


[-- Attachment #2: Type: text/html, Size: 6536 bytes --]

^ permalink raw reply

* OpenSSL 0.9.8 compile error!
From: Ricardo Fialho Tafas Junior @ 2005-09-16 11:18 UTC (permalink / raw)
  To: linux-ppc-embedded

Hello list,

I'm trying to crosscompile openSSL to PPC8xx. I've downloaded the latest 
version and when I call "make" I get the following error:

ppc_8xx-gcc -I.. -I../.. -I../../include -DOPENSSL_THREADS -D_REENTRANT 
-DDSO_DLFCN -DHAVE_DLFCN_H -DB_ENDIAN -DTERMIO -O3 -Wall -c  -o 
linux_ppc32.o linux_ppc32.s
linux_ppc32.s: Assembler messages:
linux_ppc32.s:109: Error: Unknown pseudo-op:  `.machine'
make[3]: *** [linux_ppc32.o] Error 1
make[3]: Leaving directory `/home/rtafas/voip_devel/openssl-0.9.8/crypto/bn'
make[2]: *** [subdirs] Error 1
make[2]: Leaving directory `/home/rtafas/voip_devel/openssl-0.9.8/crypto'
make[1]: *** [build_crypto] Error 1
make[1]: Leaving directory `/home/rtafas/voip_devel/openssl-0.9.8'
make: *** [top] Error 2

Before that:
I make a "./Configure linux-ppc" and edited the makefile to cross 
compile it and to force it to use ppc-8xx_gcc and ppc_8xx-ar.

Any idea to solve this?
Any "how to" to compile Openssl in embedded enviroment?

Thanks,

-- 
Ricard Fialho Tafas Jr
  R&D Engineer
  Parks S.A. Comunicações Digitais
  www.parks.com.br
  +55 51 4700523
  e-mail: rtafas@parks.com.br

^ permalink raw reply

* Re: PATCH powerpc: Merge asm-ppc*/sections.h
From: Jon Loeliger @ 2005-09-16 14:46 UTC (permalink / raw)
  To: Gabriel Paubert; +Cc: linuxppc64-dev, Arnd Bergmann, linuxppc-dev@ozlabs.org
In-Reply-To: <20050915223702.GA322@iram.es>

On Thu, 2005-09-15 at 17:37, Gabriel Paubert wrote:

> > I assume you compile custom kernels for these machines, so you're
> > happy with using config options to remove the code you don't want?
> 
> Yes, and I have no problems with it. 
> 

> > Having the .pmac.text, .prep.text etc. sections lets us remove
> > unneeded code at runtime, but it sounds like that isn't actually the
> > issue for you (i.e. you don't have a need to run the same kernel on
> > both a pmac and a prep).
> 
> Not at all. For example my pmac kernels need usb to boot 
> (literally), the MVME machines have CONFIG_USB off (this 
> saves a lot).
> 
> Now there are other architectures that could be merged,
> an example is PreP/PowerPlus/MVME5100. 
> 
> 	Gabriel

Hi Gabriel,

I am reading this to mean that you then have no issue with
my proposed changes of removing the special handling of
the .pmac, .prep, .chrp, and .openfirmware sections that
really only apply to MULTIPLATFORM built images.

Again, for embedded boards and for custom-built configurations,
this change really should have no impact on your image size.

So, were there other objects I missed?  If not, I will
proceed with a patch to remove these special sections
so that we may merge the sections.h header file better!

Thanks!
jdl

^ permalink raw reply

* RE: OpenSSL 0.9.8 compile error!
From: Eli Brin @ 2005-09-16 16:04 UTC (permalink / raw)
  To: 'Ricardo Fialho Tafas Junior', linux-ppc-embedded

Dear Ricardo,

You need to add no-asm (and probably no-hw).  Please look at the =
makefile
and Configure.

This works on 0.9.7b, but I believe that's you problem.

Eli



-----Original Message-----
From: Ricardo Fialho Tafas Junior [mailto:rtafas@parks.com.br]
Sent: Friday, September 16, 2005 1:19 PM
To: linux-ppc-embedded
Subject: OpenSSL 0.9.8 compile error!


Hello list,

I'm trying to crosscompile openSSL to PPC8xx. I've downloaded the =
latest=20
version and when I call "make" I get the following error:

ppc_8xx-gcc -I.. -I../.. -I../../include -DOPENSSL_THREADS -D_REENTRANT =

-DDSO_DLFCN -DHAVE_DLFCN_H -DB_ENDIAN -DTERMIO -O3 -Wall -c  -o=20
linux_ppc32.o linux_ppc32.s
linux_ppc32.s: Assembler messages:
linux_ppc32.s:109: Error: Unknown pseudo-op:  `.machine'
make[3]: *** [linux_ppc32.o] Error 1
make[3]: Leaving directory =
`/home/rtafas/voip_devel/openssl-0.9.8/crypto/bn'
make[2]: *** [subdirs] Error 1
make[2]: Leaving directory =
`/home/rtafas/voip_devel/openssl-0.9.8/crypto'
make[1]: *** [build_crypto] Error 1
make[1]: Leaving directory `/home/rtafas/voip_devel/openssl-0.9.8'
make: *** [top] Error 2

Before that:
I make a "./Configure linux-ppc" and edited the makefile to cross=20
compile it and to force it to use ppc-8xx_gcc and ppc_8xx-ar.

Any idea to solve this?
Any "how to" to compile Openssl in embedded enviroment?

Thanks,

--=20
Ricard Fialho Tafas Jr
  R&D Engineer
  Parks S.A. Comunica=E7=F5es Digitais
  www.parks.com.br
  +55 51 4700523
  e-mail: rtafas@parks.com.br

_______________________________________________
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded
 This mail arrived via mail.pineapp.net
=20
************************************************************************=
****
********
This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals & =
computer
viruses.
************************************************************************=
****
********

^ permalink raw reply

* Re: PATCH powerpc: Revised merge asm-ppc*/hardirq.h
From: Jon Loeliger @ 2005-09-16 15:45 UTC (permalink / raw)
  To: linuxppc64-dev, linuxppc-dev@ozlabs.org
In-Reply-To: <1126705294.14036.4.camel@cashmere.sps.mot.com>

This is a revised patch to merge asm-ppc*/hardirq.h.
It removes some unnecessary #includes, but then requires
the addition of #include <asm/irq.h> in PPC32's hw_irq.h
much like ppc64 already does.  Furthermore, several
unnecessary #includes were removed from some ppc32 boards
in order to break resulting bad #include cycles.

Builds pSeries_defconfig and all ppc32 platforms except
the already b0rken bseip.


Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Kumar Gala <kumar.gala@freescale.com>
---


 arch/ppc/platforms/83xx/mpc834x_sys.h        |    1 -
 arch/ppc/platforms/85xx/mpc85xx_ads_common.h |    1 -
 arch/ppc/platforms/85xx/stx_gp3.h            |    1 -
 include/asm-powerpc/hardirq.h                |   24 ++++++++++++++++++++
 include/asm-ppc/hardirq.h                    |   31 --------------------------
 include/asm-ppc/hw_irq.h                     |    1 +
 include/asm-ppc64/hardirq.h                  |   27 -----------------------
 7 files changed, 25 insertions(+), 61 deletions(-)


diff --git a/arch/ppc/platforms/83xx/mpc834x_sys.h b/arch/ppc/platforms/83xx/mpc834x_sys.h
--- a/arch/ppc/platforms/83xx/mpc834x_sys.h
+++ b/arch/ppc/platforms/83xx/mpc834x_sys.h
@@ -19,7 +19,6 @@
 
 #include <linux/config.h>
 #include <linux/init.h>
-#include <linux/seq_file.h>
 #include <syslib/ppc83xx_setup.h>
 #include <asm/ppcboot.h>
 
diff --git a/arch/ppc/platforms/85xx/mpc85xx_ads_common.h b/arch/ppc/platforms/85xx/mpc85xx_ads_common.h
--- a/arch/ppc/platforms/85xx/mpc85xx_ads_common.h
+++ b/arch/ppc/platforms/85xx/mpc85xx_ads_common.h
@@ -19,7 +19,6 @@
 
 #include <linux/config.h>
 #include <linux/init.h>
-#include <linux/seq_file.h>
 #include <asm/ppcboot.h>
 
 #define BOARD_CCSRBAR		((uint)0xe0000000)
diff --git a/arch/ppc/platforms/85xx/stx_gp3.h b/arch/ppc/platforms/85xx/stx_gp3.h
--- a/arch/ppc/platforms/85xx/stx_gp3.h
+++ b/arch/ppc/platforms/85xx/stx_gp3.h
@@ -21,7 +21,6 @@
 
 #include <linux/config.h>
 #include <linux/init.h>
-#include <linux/seq_file.h>
 #include <asm/ppcboot.h>
 
 #define BOARD_CCSRBAR		((uint)0xe0000000)
diff --git a/include/asm-powerpc/hardirq.h b/include/asm-powerpc/hardirq.h
new file mode 100644
--- /dev/null
+++ b/include/asm-powerpc/hardirq.h
@@ -0,0 +1,24 @@
+#ifndef _ASM_POWERPC_HARDIRQ_H
+#define _ASM_POWERPC_HARDIRQ_H
+
+/* The __last_jiffy_stamp field is needed to ensure that no decrementer
+ * interrupt is lost on SMP machines. Since on most CPUs it is in the same
+ * cache line as local_irq_count, it is cheap to access and is also used on UP
+ * for uniformity.
+ */
+typedef struct {
+	unsigned int __softirq_pending;	/* set_bit is used on this */
+	unsigned int __last_jiffy_stamp;
+} ____cacheline_aligned irq_cpustat_t;
+
+#include <linux/irq_cpustat.h>	/* Standard mappings for irq_cpustat_t above */
+
+#define last_jiffy_stamp(cpu) __IRQ_STAT((cpu), __last_jiffy_stamp)
+
+static inline void ack_bad_irq(int irq)
+{
+	printk(KERN_CRIT "illegal vector %d received!\n", irq);
+	BUG();
+}
+
+#endif /* _ASM_POWERPC_HARDIRQ_H */
diff --git a/include/asm-ppc/hardirq.h b/include/asm-ppc/hardirq.h
deleted file mode 100644
--- a/include/asm-ppc/hardirq.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifdef __KERNEL__
-#ifndef __ASM_HARDIRQ_H
-#define __ASM_HARDIRQ_H
-
-#include <linux/config.h>
-#include <linux/cache.h>
-#include <linux/smp_lock.h>
-#include <asm/irq.h>
-
-/* The __last_jiffy_stamp field is needed to ensure that no decrementer
- * interrupt is lost on SMP machines. Since on most CPUs it is in the same
- * cache line as local_irq_count, it is cheap to access and is also used on UP
- * for uniformity.
- */
-typedef struct {
-	unsigned long __softirq_pending;	/* set_bit is used on this */
-	unsigned int __last_jiffy_stamp;
-} ____cacheline_aligned irq_cpustat_t;
-
-#include <linux/irq_cpustat.h>	/* Standard mappings for irq_cpustat_t above */
-
-#define last_jiffy_stamp(cpu) __IRQ_STAT((cpu), __last_jiffy_stamp)
-
-static inline void ack_bad_irq(int irq)
-{
-	printk(KERN_CRIT "illegal vector %d received!\n", irq);
-	BUG();
-}
-
-#endif /* __ASM_HARDIRQ_H */
-#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/hw_irq.h b/include/asm-ppc/hw_irq.h
--- a/include/asm-ppc/hw_irq.h
+++ b/include/asm-ppc/hw_irq.h
@@ -7,6 +7,7 @@
 
 #include <asm/ptrace.h>
 #include <asm/reg.h>
+#include <asm/irq.h>
 
 extern void timer_interrupt(struct pt_regs *);
 
diff --git a/include/asm-ppc64/hardirq.h b/include/asm-ppc64/hardirq.h
deleted file mode 100644
--- a/include/asm-ppc64/hardirq.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef __ASM_HARDIRQ_H
-#define __ASM_HARDIRQ_H
-
-/*
- * 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.
- */
-
-#include <linux/config.h>
-#include <linux/cache.h>
-#include <linux/preempt.h>
-
-typedef struct {
-	unsigned int __softirq_pending;
-} ____cacheline_aligned irq_cpustat_t;
-
-#include <linux/irq_cpustat.h>	/* Standard mappings for irq_cpustat_t above */
-
-static inline void ack_bad_irq(int irq)
-{
-	printk(KERN_CRIT "illegal vector %d received!\n", irq);
-	BUG();
-}
-
-#endif /* __ASM_HARDIRQ_H */

^ permalink raw reply

* Re: I2S MPC5200
From: Bob Peterson @ 2005-09-16 16:16 UTC (permalink / raw)
  To: Arnaud Carer, linuxppc-embedded
In-Reply-To: <20050916132952.9844B24001B4@mwinf0904.wanadoo.fr>

[-- Attachment #1: Type: text/plain, Size: 1122 bytes --]

Hi Arnaud (and all),

My I2S audio driver seems to work fine for our icecube-based mpc5200.
It is attached for all the world to smear.  Hardware assumptions are 
included in
the comments.  It assumes a pcm1717 i2s dac running on psc2.
It implements much of the oss and mixer ioctls, volume controls, etc.

It seems to be pretty stable:
I've fixed many interrupt and timing problems of the original and
played many songs for many days with this version of the driver.

Regards,

Bob Peterson
bob@acdstar.com

At 08:29 AM 9/16/2005, Arnaud Carer wrote:
>Hi,
>I am looking for an I2s Linux driver to implement an audio output 
>with the mpc5200
>
>I2s.c and i2s_ring.c include in the DENX ELDK kernel seems to be wrong.
>
> >i2s.c is not really a driver, but a (very OLD) test  version  of  one
> >used  to  demonstrate  certain  BestComm  related problems. Don't try
> >using it as a real driver ;-)
> >The ring driver appears to be RX only,
>Thanks,
>Arnaud
>___________________________________
>
>Arnaud Carer
>Firmware Development
>
>CLEODE
><http://www.cleode.fr>www.cleode.fr
>Tel: 02 96 48 68 18
>Fax: 02 96 48 19 11


[-- Attachment #2: i2s.c --]
[-- Type: text/plain, Size: 36555 bytes --]

/* Converted from original i2s.c to work with PCM1717 dac by Bob Peterson, */
/* Advanced Communication Design, bob@acdstar.com            4/7/2005      */

/* Assumptions made for our hardware:

   Assumes PSC2 is attached to your i2s audio dac

   The control lines are on GPIO pins, mapped as follows:

   GPIO "Timer 0" = Das Blinken Light
   GPIO "Timer 1" = IDE Power
   GPIO "Timer 2" = RSTB on PCM1717
   GPIO "Timer 3" = MC on PCM1717
   GPIO "Timer 4" = ML on PCM1717
   GPIO "Timer 5" = MD on PCM1717
   GPIO "Timer 6" = Backlight enable
   GPIO "Timer 7" = Beeper

Other assumptions:

   This assumes your primary audio device is /dev/I2S
   Some programs, such as mplayer, assume the audio device is /dev/dsp or dspw
   I just made a symlink, but you can change how the device is registered too.

Changes from the original i2s driver included in eldk:

   1. Receive functions and interrupts are disabled (transmit only)
   2. Added ioctls for oss sound device
   3. Added ioctls for mixer device
   4. Added extra ioctl to sound a beeper for a given length of time
   5. Changed how buffering and interrupts are handled.
   6. Added I2S control functions (such as volume control) separate from DAC.

*/


#include <linux/config.h>
#include <linux/module.h>
#include <linux/version.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/smp_lock.h>
#include <linux/miscdevice.h>

#include <linux/slab.h>
#include <linux/ioport.h>
#include <linux/fcntl.h>
#include <linux/poll.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/system.h>
#include <asm/delay.h>

#include <linux/init.h>
#include <asm/mpc5xxx.h>
#include <bestcomm_api.h>
#include <mgt5200/mgt5200.h>
#include <mgt5200/sdma.h>
#include <asm/mpc5xxx_i2s.h>
#include <linux/sound.h>
#include <linux/soundcard.h>
#include </ppc/eldk/ppc_6xx/usr/src/linux/drivers/sound/sound_config.h>

#define I2S_MINOR 242
#define BEEP_DURATION 5
#define MAX_DMA_BUFFERS 16

/* #define ENABLE_RX */
#define RX_TASK_START
#define TX_TASK_START

/* #define RDEBUG */
/* #define WDEBUG */
/* #define LITEDEBUG */
#define DEBUG_LOST_INT

#ifdef RDEBUG
#define RDPRINTK(fmt, args...)	printk(fmt, ## args)
#else
#define RDPRINTK(fmt, args...)
#endif

#ifdef WDEBUG
#define WDPRINTK(fmt, args...)	printk(fmt, ## args)
#else
#define WDPRINTK(fmt, args...)
#endif

/* Some bit assignments for SICR */
#define DELAY_TIME_SLOT 0x20000000
#define GEN_CLK_INT 0x00800000
#define MULTIWD_ENABLE 0x00400000
#define CLK_POL_RISING 0x00200000
#define LSB_FIRST 0x10000000
#define I2S_WAIT 3 /* 3 microsecond delay between I2S ops */
#define reg1717_vol_l           0
#define reg1717_vol_r           1
#define   reg1717_vol_ldl         0x0100
#define reg1717_mute            2
#define reg1717_io_fmt          3
#define   reg1717_io_iis          0x0001 /* low=normal, high=iis data fmt   */
#define   reg1717_io_lrp          0x0002 /* priority of sample rate clock   */
#define   reg1717_io_iw           0x0004 /* input word length, low=16 h=18  */
#define   reg1717_io_atc          0x0008 /* attenuation ctrl. 0=individual
                                             1=left+right controlled by reg0 */
#define   reg1717_io_output_mute  0x0000 /* all mute */
#define   reg1717_io_output_m_r   0x0010 /* left is mute , right is right */
#define   reg1717_io_output_m_l   0x0020 /* left is mute , right is left  */
#define   reg1717_io_output_m_a   0x0030 /* left is mute , right is l+r/2 */
#define   reg1717_io_output_r_m   0x0040 /* left is right, right is mute  */
#define   reg1717_io_output_r_r   0x0050 /* left is right, right is right */
#define   reg1717_io_output_r_l   0x0060 /* left is right, right is left  */
#define   reg1717_io_output_r_a   0x0070 /* left is right, right is l+r/2 */
#define   reg1717_io_output_l_m   0x0080 /* left is left , right is mute  */
#define   reg1717_io_output_l_r   0x0090 /* left is left , right is right */
#define   reg1717_io_output_l_l   0x00A0 /* left is left , right is left  */
#define   reg1717_io_output_l_a   0x00B0 /* left is left , right is l+r/2 */
#define   reg1717_io_output_a_m   0x00C0 /* left is l+r/2, right is mute  */
#define   reg1717_io_output_a_r   0x00D0 /* left is l+r/2, right is right */
#define   reg1717_io_output_a_l   0x00E0 /* left is l+r/2, right is left  */
#define   reg1717_io_output_a_a   0x00F0 /* left is l+r/2, right is l+r/2 */
#define     reg1717_io_normal (reg1717_io_output_l_r | \
                               reg1717_io_atc /* | \
						reg1717_io_iis*/ ) /* 99 */

#ifdef ENABLE_RX
static volatile ulong rx_released; /* Counter of released BDs */
static volatile ulong rx_assigned; /* Counter of BDs to be assigned */
static volatile ulong rx_data;     /* Counter of BDs read */
#endif
static volatile ulong tx_released; /* Counter of released BDs */
static volatile ulong tx_assigned; /* Counter of BDs to be assigned */

#ifdef DEBUG_LOST_INT
static volatile int tx_int;
static volatile ulong tx_acount; /* real number of assigned BDs */
#endif

static int txtask;
static int initiator_tx;
#ifdef ENABLE_RX
static int rxtask;
static int initiator_rx;
#endif
static int psc_num;
static unsigned long i2s_is_open;
static int configured=0;
static int once;
static int sample_rate = 44100;
static int mixer_dev_id;
static int blinken = 0;
static int beep_duration = 0;
static struct i2s_ioctl defaults;
static DECLARE_WAIT_QUEUE_HEAD(WaitQ);

static void i2s_start_rx_tx (int task);
static void psc_enable(void);

DECLARE_WAIT_QUEUE_HEAD (i2s_wait_tx);

#ifdef ENABLE_RX
DECLARE_WAIT_QUEUE_HEAD (i2s_wait_rx);
#endif

extern int mgt_sdma_load_tasks_image(void);

struct i2s_buffer {
	char *va;
	dma_addr_t pa;
	size_t len;
};

static void timer_int(void *nothing);
static inline void wait(void) { udelay(I2S_WAIT); }
static int i2s_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
		     unsigned long arg);

static struct tq_struct Task = {
  routine: (void(*)(void *)) timer_int, /* The function to run */
  data: NULL
};

static struct i2s_buffer i2s_tx_bufs[MAX_DMA_BUFFERS];
#ifdef ENABLE_RX
static struct i2s_buffer i2s_rx_bufs[MAX_DMA_BUFFERS];
#endif

/* --------------- */
/* ML = frame sync */
/* --------------- */
static void ml_low(void) { /* GPIO Timer 4 */
  u32 gpt4;
  gpt4=*(volatile u32 *)MPC5xxx_GPT4_ENABLE; /* get initial value */
  gpt4&=0xffffff00; /* clear the lower bits, preserve the upper bits */
  gpt4|=0x00000024; /* Set as a GPIO and set the value to zero */
  *(volatile u32 *)MPC5xxx_GPT4_ENABLE=gpt4;
}
static void ml_high(void){
  u32 gpt4;
  gpt4=*(volatile u32 *)MPC5xxx_GPT4_ENABLE; /* get initial value */
  gpt4&=0xffffff00; /* clear the lower bits, preserve the upper bits */
  gpt4|=0x00000034; /* Set as a GPIO and set the value to one */
  *(volatile u32 *)MPC5xxx_GPT4_ENABLE=gpt4;
}

/* --------------- */
/* MC = clock      */
/* --------------- */
static void mc_low(void) { /* GPIO Timer 3 */
  u32 gpt3;
  gpt3=*(volatile u32 *)MPC5xxx_GPT3_ENABLE; /* get initial value */
  gpt3&=0xffffff00; /* clear the lower bits, preserve the upper bits */
  gpt3|=0x00000024; /* Set as a GPIO and set the value to zero */
  *(volatile u32 *)MPC5xxx_GPT3_ENABLE=gpt3;
}
static void mc_high(void){
  u32 gpt3;
  gpt3=*(volatile u32 *)MPC5xxx_GPT3_ENABLE; /* get initial value */
  gpt3&=0xffffff00; /* clear the lower bits, preserve the upper bits */
  gpt3|=0x00000034; /* Set as a GPIO and set the value to one */
  *(volatile u32 *)MPC5xxx_GPT3_ENABLE=gpt3;
}

/* --------------- */
/* MD = data       */
/* --------------- */
static void md_low(void) { /* GPIO Timer 5 */
  u32 gpt5;
  gpt5=*(volatile u32 *)MPC5xxx_GPT5_ENABLE; /* get initial value */
  gpt5&=0xffffff00; /* clear the lower bits, preserve the upper bits */
  gpt5|=0x00000024; /* Set as a GPIO and set the value to zero */
  *(volatile u32 *)MPC5xxx_GPT5_ENABLE=gpt5;
}
static void md_high(void){
  u32 gpt5;
  gpt5=*(volatile u32 *)MPC5xxx_GPT5_ENABLE; /* get initial value */
  gpt5&=0xffffff00; /* clear the lower bits, preserve the upper bits */
  gpt5|=0x00000034; /* Set as a GPIO and set the value to one */
  *(volatile u32 *)MPC5xxx_GPT5_ENABLE=gpt5;
}

/* --------------- */
/* RSTB = Reset    */
/* --------------- */
static void snd_reset(void) { /* GPIO Timer 2 */
  u32 gpt2;
  gpt2=*(volatile u32 *)MPC5xxx_GPT2_ENABLE; /* get initial value f0000620 */
  gpt2&=0xffffff00; /* clear the lower bits, preserve the upper bits */
  gpt2|=0x00000024; /* Set as a GPIO and set the value to zero */
  *(volatile u32 *)MPC5xxx_GPT2_ENABLE=gpt2;
}
static void snd_normal(void) {
  u32 gpt2;
  gpt2=*(volatile u32 *)MPC5xxx_GPT2_ENABLE; /* get initial value */
  gpt2&=0xffffff00; /* clear the lower bits, preserve the upper bits */
  gpt2|=0x00000034; /* Set as a GPIO and set the value to one */
  *(volatile u32 *)MPC5xxx_GPT2_ENABLE=gpt2;
}

/* --------------- */
/* Blinken Licht   */
/* --------------- */
static void blinken_off(void) { /* GPIO Timer 0 */
  u32 gpt0;
  gpt0=*(volatile u32 *)MPC5xxx_GPT0_ENABLE; /* get initial value */
  gpt0&=0xffffff00; /* clear the lower bits, preserve the upper bits */
  gpt0|=0x00000024; /* Set as a GPIO and set the value to zero */
  *(volatile u32 *)MPC5xxx_GPT0_ENABLE=gpt0;
}
static void blinken_on(void) {
  u32 gpt0;
  gpt0=*(volatile u32 *)MPC5xxx_GPT0_ENABLE; /* get initial value */
  gpt0&=0xffffff00; /* clear the lower bits, preserve the upper bits */
  gpt0|=0x00000034; /* Set as a GPIO and set the value to one */
  *(volatile u32 *)MPC5xxx_GPT0_ENABLE=gpt0;
}

/* --------------- */
/* Beeper          */
/* --------------- */
static void beeper_off(void) { /* GPIO Timer 0 */
  u32 gpt7;
  gpt7=*(volatile u32 *)MPC5xxx_GPT7_ENABLE; /* get initial value */
  gpt7&=0xffffff00; /* clear the lower bits, preserve the upper bits */
  gpt7|=0x00000024; /* Set as a GPIO and set the value to zero */
  *(volatile u32 *)MPC5xxx_GPT7_ENABLE=gpt7;
}
static void beeper_on(void) {
  u32 gpt7;
  gpt7=*(volatile u32 *)MPC5xxx_GPT7_ENABLE; /* get initial value */
  gpt7&=0xffffff00; /* clear the lower bits, preserve the upper bits */
  gpt7|=0x00000034; /* Set as a GPIO and set the value to one */
  *(volatile u32 *)MPC5xxx_GPT7_ENABLE=gpt7;
}

/* ------------------------------------------------------------------------- */
/* i2s_sendbit                                                               */
/* ------------------------------------------------------------------------- */
static void i2s_sendbit(int bit, int bit_num)
{
  mc_low();
  wait();
  if (bit)
    md_high();
  else
    md_low();
  wait();
  wait();
  mc_high();
  wait();
  if (bit_num==0)
    ml_low();
  wait();
  if (bit_num==0) {
    wait();
    ml_high();
  }
}
/* ------------------------------------------------------------------------- */
/* i2s_sendword                                                              */
/* ------------------------------------------------------------------------- */
static void i2s_sendword(unsigned short word)
{
  static int i,v;

  ml_high();
  for (i=15; i>=0; i--) {
    v=(word>>i) & 0x00000001;
    i2s_sendbit(v,i);
  }
  wait();
  wait();
  wait();
  wait();
}

/* ------------------------------------------------------------------------- */
/* tipcm1717setregister */
/* ------------------------------------------------------------------------- */
static void tipcm1717setregister(unsigned short reg,unsigned short val)
{
  static short regval;

  regval=(val | (reg<<9));
  i2s_sendword(regval);
}

/* ------------------------------------------------------------------------- */
/* mixer routines */
/* ------------------------------------------------------------------------- */
static int ssp_open_mixdev(struct inode *inode, struct file *file)
{
  return 0;
}

static int ssp_release_mixdev(struct inode *inode, struct file *file)
{
  return 0;
}

static struct file_operations ssp_mixer_fops = {
  owner:        THIS_MODULE,
  llseek:       no_llseek,
  ioctl:        i2s_ioctl,
  open:         ssp_open_mixdev,
  release:      ssp_release_mixdev,
};

/* ------------------------------------------------------------------------- */
/* ssp_audio_reset */
/* ------------------------------------------------------------------------- */
static void ssp_audio_reset(void)
{
  int flags;

  local_irq_save(flags);
  udelay(100);
  snd_reset();
  udelay(100);
  snd_normal();
  udelay(500); /* give the dac time to settle */
  local_irq_restore(flags);
}

/* ------------------------------------------------------------------------- */
/* ssp_audio_init */
/* ------------------------------------------------------------------------- */
static void ssp_audio_init(void)
{
  int flags;

  /*
    Note from Bob Peterson (ACD): According to EJ:

    The [TI PCM1717] audio DAC for [our] PowerPC [board] is on PSC2.
    It will run in i2s mode.  The pin functions are documented on Page 2-34
    (PDF page 80) of the MPC5200 User Manual.

    I expect to run it in "Codec2 with MCLK" mode, with i2s data formatting.
    See chapter 15 for PSC setup details. [pp 501-555]

    We need to program the MCLK signal to have a clock of close to
    11.2896 MHz (we may have to be a small bit off to make the numbers work,
    the target is a 44.1 KHz sample rate times 256).

    This means we'll need to set the Serial Interface Control Register to:
    -first bit of first time slow of a new frame starts one bit clock cycle
    after the rising edge of frame sync.
    -MSB first
    -Codec mode, 32-bit data
    -use bit clock and frame sync generated internally from MCLK. */

  local_irq_save(flags);
  /* set the initial volume */
  tipcm1717setregister(reg1717_vol_l,  0x0008 | reg1717_vol_ldl);
  tipcm1717setregister(reg1717_vol_r,  0x0008 | reg1717_vol_ldl);
  tipcm1717setregister(reg1717_mute,   0x0000);
  tipcm1717setregister(reg1717_io_fmt, reg1717_io_normal);
  local_irq_restore(flags);
}

/* ------------------------------------------------------------------------- */
/* original i2s routines start here */
/* ------------------------------------------------------------------------- */
static int i2s_buffers_init(void)
{
  int i;
  for (i = 0; i < MAX_DMA_BUFFERS; i++) {
    if ((i2s_tx_bufs[i].va = 
	 pci_alloc_consistent(NULL, BUFSIZE, &i2s_tx_bufs[i].pa)) == NULL) {
      printk("Error: unable to allocate tx buffer #%d.\n",i+1);
      return -1;
    }
#ifdef ENABLE_RX
    if ((i2s_rx_bufs[i].va = 
	 pci_alloc_consistent(NULL, BUFSIZE, &i2s_rx_bufs[i].pa)) == NULL) {
      printk("Error: unable to allocate rx buffer #%d.\n",i+1);
      return -1;
    }
#endif
  }
  return 0;
}

/* ------------------------------------------------------------------------- */
/* i2s_buffers_release                                                       */
/* ------------------------------------------------------------------------- */
static int i2s_buffers_release(void)
{
  int i;
  for (i = 0; i < MAX_DMA_BUFFERS; i++) {
    pci_free_consistent(NULL, BUFSIZE, i2s_tx_bufs[i].va, i2s_tx_bufs[i].pa);
    TaskBDRelease(txtask);
#ifdef ENABLE_RX
    pci_free_consistent(NULL, BUFSIZE, i2s_rx_bufs[i].va, i2s_rx_bufs[i].pa);
    TaskBDRelease(rxtask);
#endif
  }
  
  return 0;
}

/* ------------------------------------------------------------------------- */
/* i2s_tx_irq - handle transmit interrupt                                    */
/* ------------------------------------------------------------------------- */
static void i2s_tx_irq(int irq, void *dev_id, struct pt_regs *regs)
{
  int bdnum;

#ifdef DEBUG_LOST_INT
  tx_int = 1;
#endif

  TaskIntClear(txtask);
  if (tx_assigned == tx_released) {
    printk("%s: %ld:%ld - false int??\n",__FUNCTION__,tx_assigned,tx_released);
    return;
  }
  while ((bdnum = TaskBDRelease(txtask))>=0) {
    tx_released++;
    if (tx_released>100*MAX_DMA_BUFFERS) { /* make sure our numbers never wrap to negative */
      tx_released-=98*MAX_DMA_BUFFERS;
      tx_assigned-=98*MAX_DMA_BUFFERS;
    }
    if (bdnum != tx_released % MAX_DMA_BUFFERS)
      printk("%s: %d:%ld\n", __FUNCTION__,bdnum,tx_released % MAX_DMA_BUFFERS);
    WDPRINTK("%s: released bd %d\n", __FUNCTION__, 
	     (bdnum + MAX_DMA_BUFFERS - 1) % MAX_DMA_BUFFERS);
  } /* while */
  wake_up(&i2s_wait_tx);
}

#ifdef ENABLE_RX
/* ------------------------------------------------------------------------- */
/* i2s_rx_irq                                                                */
/* ------------------------------------------------------------------------- */
static void i2s_rx_irq(int irq, void *dev_id, struct pt_regs *regs)
{
  int bdnum;

  if (rx_assigned == rx_released) {
    printk("%s: %ld:%ld - false int??\n", __FUNCTION__, rx_assigned, rx_released);
    return;
  }
  
  TaskIntClear(rxtask);

  bdnum = TaskBDRelease(rxtask);
  rx_released++;
  if (bdnum != rx_released % MAX_DMA_BUFFERS)
    printk("%s: %d:%ld\n", __FUNCTION__, bdnum, rx_released % MAX_DMA_BUFFERS);
  RDPRINTK("%s: released bd %d\n", __FUNCTION__, 
	   (bdnum + MAX_DMA_BUFFERS - 1) % MAX_DMA_BUFFERS);
  if (rx_assigned > rx_released) {
    bdnum=TaskBDAssign(rxtask, (void *)i2s_rx_bufs[bdnum].pa, NULL, BUFSIZE,0);
    RDPRINTK("%s: assigned bd %d\n", __FUNCTION__, bdnum);
  }
  wake_up(&i2s_wait_rx);
}
#endif

/* ------------------------------------------------------------------------- */
/**
 *	i2s_write:
 *	@file: file handle
 *	@buf: buffer to write (unused as data does not matter here 
 *	@count: count of bytes
 *	@ppos: pointer to the position to write. No seeks allowed
 *
 */
/* ------------------------------------------------------------------------- */
static ssize_t i2s_write(struct file *file, const char *buf, size_t count,
			 loff_t *ppos)
{
  size_t cnt = count;
  size_t tc;
  char *ptr = (char *)buf;
  int bdnum, err;
  int n, flags;
  
  if (!configured) {
    printk("i2s: write when not configured.\n");
    return -EINVAL;
  }
  /*  Can't seek (pwrite) on this device  */
  if (ppos != &file->f_pos) {
    printk("i2s: Can't seek (pwrite) on this device.\n");
    return -ESPIPE;
  }
  if (once) {
    /*printk("i2s: First write: starting rx_tx task.\n");*/
    i2s_start_rx_tx(txtask);
    once = 0;
  }
  /*WDPRINTK("%s: count %d\n", __FUNCTION__, count);*/
  
  while(cnt) {
    /* Wait until all buffers will be released */
    /*err = wait_event_interruptible(i2s_wait_tx, tx_assigned==tx_released);*/
    /* Wait until the number of buffers assigned is less than the    */
    /* number of buffers released plus the size of the buffer queue. */
    /*printk("W: Assigned: %d Released: %d\n",tx_assigned,tx_released);*/
    if (tx_assigned-tx_released>=MAX_DMA_BUFFERS) {
      err = wait_event_interruptible(i2s_wait_tx,
				     tx_assigned-tx_released<MAX_DMA_BUFFERS);
      if (err) {
#ifdef DEBUG_LOST_INT
	printk("%s: interrupted, %ld:%ld:%ld, tx_int %d, err %d\n",
	       __FUNCTION__,tx_assigned, tx_acount, tx_released, tx_int, err);
#endif
	break;
      }
    }
    /* prefill the buffers */
    tc = (cnt > BUFSIZE) ? BUFSIZE : cnt;
    if (copy_from_user(i2s_tx_bufs[tx_assigned % MAX_DMA_BUFFERS].va, 
		       ptr, tc)) {
      err =  -EFAULT;
      break;
    }
      
    i2s_tx_bufs[tx_assigned % MAX_DMA_BUFFERS].len = tc;
    n = tx_assigned % MAX_DMA_BUFFERS;
    tx_assigned++;
    ptr += tc;
    cnt -= tc;
    
    /* Now assign the first buffer to the Bestcomm task */
    
    save_flags(flags);cli(); /* Bestcomm can lose interrupts otherwise ??? */
    
#ifdef DEBUG_LOST_INT
    tx_int = 0;
    tx_acount++;
#endif
    // Note from Bob: bd = Buffer Descriptor

    bdnum = TaskBDAssign(txtask, (void *)i2s_tx_bufs[n].pa, NULL, 
			 i2s_tx_bufs[n].len, 0);
    restore_flags(flags);
    if (bdnum < 0) {
      printk("%s:TaskBDAssign error %d(tx stuck??)\n", __FUNCTION__, bdnum);
      return -EIO;
    }
    WDPRINTK("%s: assigned bd %d (buf %d), tc %d\n", __FUNCTION__,
	     bdnum, n, tc);
  }
  
  /*WDPRINTK("%s: sent %d, err %d\n", __FUNCTION__, count - cnt, err);*/
  return (count - cnt) ? (count - cnt) : err;
} /* i2s_write */

/* ------------------------------------------------------------------------- */
/**
 *	i2s_read:
 *	@file: file handle
 *	@buf: buffer to read
 *	@count: length of buffer
 *	@ptr: offset (no seek allowed)
 *
 */
/* ------------------------------------------------------------------------- */
static ssize_t i2s_read(struct file *file, char *buf,size_t count,loff_t *ppos)
{
#ifdef ENABLE_RX
  size_t cnt = count;
  char *ptr = buf;
  size_t bd_count;
  int bdnum;
  int err;

  if (!configured)
    return -EINVAL;

  /*  Can't seek (pread) on this device  */
  if (ppos != &file->f_pos)
    return -ESPIPE;
  
  if (once) {
    i2s_start_rx_tx(rxtask);
    once = 0;
  }

  while (cnt) {
    /* How much BDs are needed (up to MAX_DMA_BUFFERS) */
    bd_count = (cnt + BUFSIZE - 1) / BUFSIZE;
    if (bd_count > MAX_DMA_BUFFERS)
      bd_count = MAX_DMA_BUFFERS;
    rx_assigned += bd_count;
    RDPRINTK("%s: cnt %d, rx_data %ld, ass %ld, rel %ld\n", __FUNCTION__, cnt,
	     rx_data, rx_assigned, rx_released);
    
    /* Start reading the data */
    bdnum = TaskBDAssign(rxtask, 
			 (void *)i2s_rx_bufs[rx_released % MAX_DMA_BUFFERS].pa,
			 NULL, BUFSIZE, 0);
    if (bdnum < 0) {
      printk("%s:TaskBDAssign error %d\n", __FUNCTION__, bdnum);
      return -EIO;
    }
    RDPRINTK("%s:assigned bd %d (buf %ld)\n", __FUNCTION__,
	     bdnum, rx_assigned % MAX_DMA_BUFFERS);
    
    /* Copy the data to user as it arrives */
    while (bd_count--) {
      int len;
      len = (cnt > BUFSIZE) ? BUFSIZE : cnt;
      
      RDPRINTK("%s:to user:rx_data %ld, ass %ld, rel %ld\n", 
	       __FUNCTION__, rx_data,
	       rx_assigned, rx_released);
      /* Wait at least one BD released */
      err = wait_event_interruptible(i2s_wait_rx, rx_data < rx_released);
      if(err) {
	goto out;
      }
      if (copy_to_user(ptr, i2s_rx_bufs[rx_data % MAX_DMA_BUFFERS].va, len)) {
	err = -EFAULT;
	goto out;
      }
      ptr += len;
      cnt -= len;
      rx_data ++;
    }
  }
 out:
  RDPRINTK("%s: read %d, err %d\n", __FUNCTION__, count - cnt, err);
  return (count - cnt) ? (count - cnt) : err;
#else
  return -EINVAL;
#endif
}

/* ------------------------------------------------------------------------- */
/* i2s_start_rx_tx                                                           */
/* ------------------------------------------------------------------------- */
static void i2s_start_rx_tx(int task)
{
#ifdef ENABLE_RX
  if (task == rxtask) {
#ifdef RX_TASK_START
    TaskStart(rxtask, TASK_AUTOSTART_ENABLE, rxtask, TASK_INTERRUPT_ENABLE);
#endif
  }
#else
  if (task == txtask) {
#endif
#ifdef TX_TASK_START
    TaskStart(txtask, TASK_AUTOSTART_ENABLE, txtask, TASK_INTERRUPT_ENABLE);
#endif
  }
  psc_enable();
}

/* ------------------------------------------------------------------------- */
/* psc_enable                                                                */
/* ------------------------------------------------------------------------- */
static void psc_enable(void)
{
  struct mpc5xxx_psc *psc = (struct mpc5xxx_psc *)(MPC5xxx_PSC1 +
						   ((psc_num - 1) * 0x200));
  psc->command = MPC5xxx_PSC_RX_ENABLE | MPC5xxx_PSC_TX_ENABLE;
}

/* ------------------------------------------------------------------------- */
/* psc_reset                                                                 */
/* ------------------------------------------------------------------------- */
static void psc_reset(void)
{
  struct mpc5xxx_psc *psc = (struct mpc5xxx_psc *)(MPC5xxx_PSC1 +
						   ((psc_num - 1) * 0x200));
  
#ifdef ENABLE_RX
  psc->command = MPC5xxx_PSC_RST_RX;
#endif
  psc->command = MPC5xxx_PSC_RST_TX;
  psc->command = MPC5xxx_PSC_SEL_MODE_REG_1;
  psc->command = MPC5xxx_PSC_RST_ERR_STAT;
}

/* ------------------------------------------------------------------------- */
/* i2s_channel_setup                                                         */
/* ------------------------------------------------------------------------- */
static int i2s_channel_setup(struct i2s_ioctl *arg)
{
  struct mpc5xxx_psc *psc;
  struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio *)MPC5xxx_GPIO;
  struct mpc5xxx_cdm *cdm = (struct mpc5xxx_cdm *)MPC5xxx_CDM;
  TaskSetupParamSet_t i2s_setup_tx;
#ifdef ENABLE_RX
  TaskSetupParamSet_t i2s_setup_rx;
#endif

  if (arg->psc_num < 1 || arg->psc_num > 3) {
    printk("i2s: Invalid psc specified during channel_setup.\n");
    return -EINVAL;
  }
  
  psc_num = arg->psc_num;
  
  switch (psc_num) {
  case 1:
    initiator_tx = INITIATOR_PSC1_TX;
#ifdef ENABLE_RX
    initiator_rx = INITIATOR_PSC1_RX;
#endif
    cdm->mclken_div_psc1 |= (0x8000 | arg->mclk_div);
    break;
  case 2:
    initiator_tx = INITIATOR_PSC2_TX;
#ifdef ENABLE_RX
    initiator_rx = INITIATOR_PSC2_RX;
#endif
    cdm->mclken_div_psc2 = (0x8000 | arg->mclk_div);
    break;
  case 3:
    initiator_tx = INITIATOR_PSC3_TX;
#ifdef ENABLE_RX
    initiator_rx = INITIATOR_PSC3_RX;
#endif
    cdm->mclken_div_psc3 |= (0x8000 | arg->mclk_div);
    break;
  }
  psc = (struct mpc5xxx_psc *)(MPC5xxx_PSC1 + ((psc_num - 1) * 0x200));
  /* disable Tx & Rx */
  psc->command = (MPC5xxx_PSC_TX_DISABLE | MPC5xxx_PSC_RX_DISABLE);
  gpio->port_config &= ~(0x7 << ((psc_num - 1) * 4));
  gpio->port_config &= 0xcfffffff; /* Turn off ALTS */
  
  if (arg->mclk) {
    gpio->port_config|=(0x7 << ((arg->psc_num-1)*4)); /* CODEC with MCLK */
  } else {
    gpio->port_config|=(0x6 << ((arg->psc_num-1)*4)); /* CODEC without MCLK */
  }
  
  cdm->clk_enables |= (1 << (arg->psc_num + 4)); /* PSC clock enable */
  /* reset PSC */
  psc_reset();
  
  psc->mode = 0;
  psc->rfalarm = 0x120; /* alarm threshold level */
  psc->tfalarm = 0x120;
  psc->rfcntl = 4; /* granularity */
  psc->tfcntl = 4;
  psc->mpc5xxx_psc_imr = 0; /* disable interrupts */
  
  /* Configure codec parameters  (MSB first) */
  switch (arg->data_width) {
  case 8:
    psc->sicr = 0x01000000;
    psc->ctur = 0x7; /* 8 bits per frame */
    break;
  case 16:
    psc->sicr = 0x02000000; /* 004xxxxx=multi word*/
    psc->ctur = 0xf; /* 0xf; 16 bits per frame */
    break;
  case 24:
    psc->sicr = 0x07000000;
    psc->ctur = 0x17; /* 24 bits per frame */
    break;
  case 32:
    psc->sicr = 0x0f000000;
    psc->ctur = 0x1f; /* 32 bits per frame: set frame width to 32 sclks */
    break;
  default:
    printk("Invalid data_width specified.\n");
    return -EINVAL;
  }

  psc->ccr = (arg->frsync_div*0x100) + arg->bclk_div;
  /* Bob note: I think ccr must be a write-only register.  It comes back 0. */
  /*           However, the databook seems to indicate r/w.  Not sure why. */
  /* DTS = 1, Data MSB first, use 5200 clk and frame sync, multiword.
   * Frame sync active low, data sampled on CLK high.
   */
  psc->sicr |= /*DELAY_TIME_SLOT |*/ MULTIWD_ENABLE | CLK_POL_RISING;
  
  if (arg->master) /* Master mode - PSC will drive SCLK and LRCK */
    psc->sicr |= GEN_CLK_INT;
  
  /* reset PSC again */
  psc_reset();
  
  /* setup the tasks */
  memset(&i2s_setup_tx, 0, sizeof(i2s_setup_tx));
  i2s_setup_tx.Initiator = (MPC5200Initiator_t)(initiator_tx);
  i2s_setup_tx.NumBD = MAX_DMA_BUFFERS;
  i2s_setup_tx.Size.MaxBuf = BUFSIZE;
  i2s_setup_tx.StartAddrDst = (volatile u32)&(psc->tfdata);
  i2s_setup_tx.IncrSrc = arg->data_width/8; /* added by Bob: was 4 */
  i2s_setup_tx.IncrDst = 0;
  i2s_setup_tx.SzSrc = arg->data_width/8; /* was 4 */
  i2s_setup_tx.SzDst = arg->data_width/8; /* was 4 */
  txtask = TaskSetup(TASK_GEN_TX_BD, &i2s_setup_tx);
  
  if (request_irq(MPC5xxx_SDMA_IRQ_BASE + txtask, i2s_tx_irq,
		  SA_INTERRUPT, "i2s tx dma", NULL)) {
    printk(KERN_ERR "i2s: SDMA tx irq allocation failed\n");
    return -EINVAL;
  }
  
#ifdef ENABLE_RX
  memset(&i2s_setup_rx, 0, sizeof(i2s_setup_rx));
  i2s_setup_rx.Initiator = (MPC5200Initiator_t)(initiator_rx);
  i2s_setup_rx.NumBD = MAX_DMA_BUFFERS;
  i2s_setup_rx.Size.MaxBuf = BUFSIZE;
  i2s_setup_rx.StartAddrSrc = (volatile u32)&(psc->rfdata);
  i2s_setup_rx.IncrDst = 4;
  i2s_setup_rx.IncrSrc = 0;
  i2s_setup_rx.SzDst = 4;
  rxtask = TaskSetup(TASK_GEN_RX_BD, &i2s_setup_rx);
  
  if (request_irq(MPC5xxx_SDMA_IRQ_BASE + rxtask, i2s_rx_irq,
		  SA_INTERRUPT, "i2s rx dma", NULL)) {
    printk(KERN_ERR "i2s: SDMA rx irq allocation failed\n");
    return -EINVAL;
  }
#endif  
  configured = 1;
  return 0;
}/* i2s_channel_setup */

/* ------------------------------------------------------------------------- */
/**
 *	i2s_ioctl:
 *	@inode: inode of the device
 *	@file: file handle to the device
 *	@arg: argument pointer
 */
/* ------------------------------------------------------------------------- */
static int i2s_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
		     unsigned long arg)
{
  long val;
  int ret;
  struct i2s_ioctl i2s_arg;
  static int *intpnd,*intmsk;

  switch (cmd) {
  case I2S_SET_CHANNEL:
    if (copy_from_user (&i2s_arg, (struct i2s_ioctl *)arg, sizeof(i2s_arg)))
      return -EFAULT;
    ret = i2s_channel_setup(&i2s_arg);
    break;

  case I2S_DEBUG:
    intpnd=(int *)(0xf0001214);
    intmsk=(int *)(0xf0001218);
    printk("txtask=%d INTPND=%08X INTMSK=%08X\n",
	   txtask,(unsigned int)*intpnd,(unsigned int)*intmsk);
    printk("Assigned=%ld Released=%ld\n",tx_assigned,tx_released);
    break;

  case I2S_BEEP:
    if (arg)
      beep_duration=(int)arg;
    else
      beep_duration=BEEP_DURATION; /* in 100ths of a second */
    beeper_on();
    break;

  case I2S_RESET:
    ssp_audio_reset();
    break;

  case SNDCTL_DSP_STEREO:
    ret = get_user(val, (int *) arg);
    if (ret)
      return ret;
    /* Simple standard DACs are stereo only */
    ret = (val == 0) ? -EINVAL : 1;
    return put_user(ret, (int *) arg);

  case SNDCTL_DSP_CHANNELS:
  case SOUND_PCM_READ_CHANNELS:
    /* Simple standard DACs are stereo only */
    return put_user(2, (long *) arg);

  case SNDCTL_DSP_SPEED:
  case SOUND_PCM_READ_RATE:
    /* We assume the clock doesn't change */
    return put_user(sample_rate, (long *) arg);
    
  case SNDCTL_DSP_SETFMT:
    if (arg!=AFMT_S16_BE) { /* if not signed 16-bit big-endian */
      printk("SNDCTL_DSP_SETFMT: request for 0x%08X rejected.\n",arg);
      return -1;
    }
    /* Simple standard DACs are 16-bit only */
    return put_user(16, (long *) arg);

  case SNDCTL_DSP_GETFMTS:
    /* Simple standard DACs are 16-bit only */
    return put_user(16, (long *) arg);

  case SNDCTL_DSP_SYNC:
    wait_event_interruptible(i2s_wait_tx,tx_assigned==tx_released);
    return 0;

  case SOUND_MIXER_WRITE_VOLUME:
    tipcm1717setregister(reg1717_vol_l, (unsigned short)arg | reg1717_vol_ldl);
    tipcm1717setregister(reg1717_vol_r, (unsigned short)arg | reg1717_vol_ldl);
    return 0;

  case SNDCTL_DSP_GETOSPACE:
    {
      audio_buf_info inf = { 0, };
      int i;
    
      if (!(file->f_mode & FMODE_WRITE))
	return -EINVAL;
      inf.fragments=MAX_DMA_BUFFERS-(tx_assigned-tx_released);
      inf.bytes = BUFSIZE*(MAX_DMA_BUFFERS-(tx_assigned-tx_released));
      inf.fragstotal = MAX_DMA_BUFFERS;
      inf.fragsize = BUFSIZE;
      return copy_to_user((void *)arg, &inf, sizeof(inf));
    }

  case SNDCTL_DSP_GETODELAY:
    if (!(file->f_mode & FMODE_WRITE))
      return -EINVAL;
    put_user(BUFSIZE*(tx_assigned-tx_released), (int *)arg);
    return 0;

  default:
    ret = -EINVAL;
    break;
  }
  return ret;
}

/* ------------------------------------------------------------------------- */
/**
 *	i2s_open:
 *	@inode: inode of device
 *	@file: file handle to device
 */
/* ------------------------------------------------------------------------- */
static int i2s_open(struct inode *inode, struct file *file)
{
  if(test_and_set_bit(0, &i2s_is_open))
    return -EBUSY;
  
  i2s_channel_setup(&defaults);
  ssp_audio_init();
  i2s_is_open = 1;
  tx_assigned = tx_released = 0;
#ifdef ENABLE_RX
  rx_assigned = rx_released = 0;
  rx_data = 0;
#endif
#ifdef DEBUG_LOST_INT
  tx_acount = 0;
#endif
  once = 1;
  return 0;
}

/* ------------------------------------------------------------------------- */
/**
 *	i2s_release
 *	@inode: inode to board
 *	@file: file handle to board
 */
/* ------------------------------------------------------------------------- */
static int i2s_release(struct inode *inode, struct file *file)
{
  wait_event_interruptible(i2s_wait_tx, tx_assigned == tx_released);
  psc_reset();
  
#ifdef ENABLE_RX
  if (rxtask) {
    TaskStop(rxtask);
    free_irq(MPC5xxx_SDMA_IRQ_BASE + rxtask, NULL);
    rxtask = 0;
  }
#endif
  if (txtask) {
    TaskStop(txtask);
    free_irq(MPC5xxx_SDMA_IRQ_BASE + txtask, NULL);
    TaskBDReset(txtask);
    txtask = 0;
  }

  configured = 0;
  clear_bit(0, &i2s_is_open);
  return 0;
}

/* ------------------------------------------------------------------------- */
/* i2s_poll                                                                  */
/* ------------------------------------------------------------------------- */
static unsigned int i2s_poll(struct file *file, poll_table *wait)
{
  int ret = 0;
  if (configured) {
    ret = (POLLIN | POLLRDNORM);
  }
  return ret;
}

static struct file_operations i2s_fops = {
	owner:		THIS_MODULE,
	llseek:		no_llseek,
	read:		i2s_read,
	write:		i2s_write,
	ioctl:		i2s_ioctl,
	open:		i2s_open,
	release:	i2s_release,
	poll:           i2s_poll,
};

static struct miscdevice i2s_miscdev=
{
	I2S_MINOR,
	"I2S",
	&i2s_fops
};

/* ------------------------------------------------------------------------- */
/*
 *	cleanup_module:
 */
/* ------------------------------------------------------------------------- */
static void __exit i2s_exit(void)
{
  misc_deregister(&i2s_miscdev);
  i2s_buffers_release();
  TaskStop(txtask);
  free_irq(MPC5xxx_SDMA_IRQ_BASE + txtask, NULL);
#ifdef ENABLE_RX
  TaskStop(rxtask);
  free_irq(MPC5xxx_SDMA_IRQ_BASE + rxtask, NULL);
#endif
}

/* ------------------------------------------------------------------------- */
/*
 * 	i2s_init:
 */
/* ------------------------------------------------------------------------- */
static int __init i2s_init(void)
{
  static int ret;
  /*struct mpc5xxx_intr *int_ctrl;*/
  /*sdma_regs *sdma = (sdma_regs *)MPC5xxx_SDMA;*/
  struct mpc5xxx_cdm *cdm = (struct mpc5xxx_cdm *)MPC5xxx_CDM;
  
  printk("i2s.c: audio device driver for PowerPC.\n");
  cdm->pci_clk_sel&=0xfffffffc; /* Speed up the pci clock by factor of 2*/
  udelay(50); /* wait just a little */
  ret = misc_register(&i2s_miscdev);
  if (ret) {
    printk(KERN_ERR "i2s: can't misc_register on minor=%d\n", I2S_MINOR);
    goto out;
  }
  i2s_buffers_init();
  defaults.psc_num=2;
  defaults.mclk_div=0x2e;
  defaults.mclk=1;
  defaults.data_width=16;
  defaults.frsync_div=0x1f;
  defaults.bclk_div=7;
  defaults.master=1;

  printk("We have audio for mpc5200!\n");
  mixer_dev_id = register_sound_mixer(&ssp_mixer_fops, -1);
  /*printk( KERN_INFO "Mixer registered.  id=%d\n",mixer_dev_id);*/
  /*printk(KERN_INFO "Initializing pcm1717 chip.\n");*/
  ssp_audio_reset();
  ssp_audio_init();
  /* int_ctrl=(struct mpc5xxx_intr *)MPC5xxx_INTR; * MBAR_INT_CTRL */
  /* int_ctrl->pimsk &= (~(PIMSK_BESTCOMM)); */
  /* Bob: Assume that u-boot has initialized Bestcomm for the purposes */
  /*      of dmaing to and from the ethernet FEC.                      */
  TasksInitAPI((uint8 *)MPC5xxx_MBAR); /* Still needed */
  /* sdma->taskBar = MPC5xxx_SRAM; */
  /* TasksLoadImage(sdma); */

  ret = 0;
  printk(KERN_INFO "MPC5200 I2S driver (%d BDs x %d bytes).\n", 
	 MAX_DMA_BUFFERS, BUFSIZE);
  /* --------------------------------------------------------------------- */
  /* Install our timer interrupt routine                                   */
  /* --------------------------------------------------------------------- */
  queue_task(&Task, &tq_timer);
 out:
  return ret;
}

/* ------------------------------------------------------------------------ */
/* timer_int - Timer Interrupt                                              */
/* ------------------------------------------------------------------------ */
static void timer_int(void *nothing)
{
  if (beep_duration>0) {
    beep_duration--; /* in 100ths of a second */
    if (!beep_duration)
      beeper_off();
  }

  if (waitqueue_active(&WaitQ)) /* if Cleanup wants us to die */
    wake_up(&WaitQ); /* Now cleanup_module can return */
  else
    queue_task(&Task, &tq_timer); /* put ourselves back in the task queue. */
}

module_init(i2s_init);
module_exit(i2s_exit);

MODULE_DESCRIPTION("Simple driver for the MPC5200 PSC in CODEC I2S mode.\n");
MODULE_LICENSE("GPL");
EXPORT_NO_SYMBOLS;

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply

* Re: [PATCH] ppc32: cleanup AMCC PPC4xx eval boards to better support U-Boot
From: Eugene Surovegin @ 2005-09-16 16:27 UTC (permalink / raw)
  To: Stefan Roese; +Cc: linuxppc-embedded
In-Reply-To: <200509161306.17103.sr@denx.de>

On Fri, Sep 16, 2005 at 01:06:16PM +0200, Stefan Roese wrote:
> Add U-Boot support to AMCC PPC405 eval boards (bubinga, sycamore and walnut)
> and cleanup PPC440 eval boards (bamboo, ebony, luan and ocotea) to better
> support U-Boot as bootloader.

In general, 44x pieces look OK, but 40x aren't. Notice, that we don't 
have any #ifdef CONFIG_UBOOT in 44x sources. Let's not add them for 
40x, try to replicate the same boot-wrapper approach as Matt used for 
44x.

[snip]

> diff --git a/arch/ppc/platforms/4xx/Kconfig b/arch/ppc/platforms/4xx/Kconfig
> --- a/arch/ppc/platforms/4xx/Kconfig
> +++ b/arch/ppc/platforms/4xx/Kconfig
> @@ -212,10 +212,18 @@ config EMBEDDEDBOOT
>  	depends on EP405 || XILINX_ML300
>  	default y
>  
> -config IBM_OPENBIOS
> -	bool
> +choice
> +	prompt "Bootloader support"
>  	depends on ASH || BUBINGA || REDWOOD_5 || REDWOOD_6 || SYCAMORE || WALNUT
> -	default y
> +	default IBM_OPENBIOS
> +
> +config IBM_OPENBIOS
> +	bool "IBM OpenBIOS"
> +
> +config UBOOT
> +	bool "U-Boot"
> +
> +endchoice

Do we really need this? U-Boot build is different from OpenBIOS 
already (we just use vmlinux without any boot-wrapper) and is selected 
by different make target.

[snip]

> --- a/arch/ppc/platforms/4xx/bubinga.c
> +++ b/arch/ppc/platforms/4xx/bubinga.c
> @@ -89,7 +89,11 @@ bubinga_early_serial_map(void)
>            * by 16.
>            */
>  	uart_div = (mfdcr(DCRN_CPC0_UCR_BASE) & DCRN_CPC0_UCR_U0DIV);
> +#ifdef CONFIG_UBOOT
> +	uart_clock = __res.bi_procfreq / uart_div;
> +#else
>  	uart_clock = __res.bi_pllouta_freq / uart_div;
> +#endif

Why not just rename this field and skip this ugly ifdefing?

-- 
Eugene

^ permalink raw reply

* Reminder: removal of APUS and Gemini still pending
From: Kumar Gala @ 2005-09-16 16:36 UTC (permalink / raw)
  To: ppc-dev list

This is a reminder email to all those that care that APUS and Gemini  
configs are still not building in the kernel.  They are still  
scheduled to be removed after the release of 2.6.15.

- kumar

^ permalink raw reply

* [PATCH] ppc32: Removed non-inlined versions of local_irq* functions
From: Kumar Gala @ 2005-09-16 16:37 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev

We always use the inlined versions of local_irq_enable, local_irq_disable,
local_save_flags_ptr, and local_irq_restore on ppc32 so the non-inlined
versions where just taking up space.

Signed-off-by: Kumar Gala <kumar.gala@freescale.com>

---
commit d32a678da44acac59f2767d7437466ab0db90de1
tree 8abc5e2e4846159c467f38ef63c1cda0fc70fdcc
parent 065d9cac98a5406ecd5a1368f8fd38f55739dee9
author Kumar K. Gala <kumar.gala@freescale.com> Fri, 16 Sep 2005 11:30:25 -0500
committer Kumar K. Gala <kumar.gala@freescale.com> Fri, 16 Sep 2005 11:30:25 -0500

 arch/ppc/kernel/misc.S      |  128 -------------------------------------------
 arch/ppc/kernel/ppc_ksyms.c |   10 ---
 include/asm-ppc/hw_irq.h    |   16 -----
 3 files changed, 0 insertions(+), 154 deletions(-)

diff --git a/arch/ppc/kernel/misc.S b/arch/ppc/kernel/misc.S
--- a/arch/ppc/kernel/misc.S
+++ b/arch/ppc/kernel/misc.S
@@ -273,134 +273,6 @@ _GLOBAL(low_choose_7447a_dfs)
 
 #endif /* CONFIG_CPU_FREQ_PMAC && CONFIG_6xx */
 
-/* void local_save_flags_ptr(unsigned long *flags) */
-_GLOBAL(local_save_flags_ptr)
-	mfmsr	r4
-	stw	r4,0(r3)
-	blr
-	/*
-	 * Need these nops here for taking over save/restore to
-	 * handle lost intrs
-	 * -- Cort
-	 */
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-_GLOBAL(local_save_flags_ptr_end)
-
-/* void local_irq_restore(unsigned long flags) */
-_GLOBAL(local_irq_restore)
-/*
- * Just set/clear the MSR_EE bit through restore/flags but do not
- * change anything else.  This is needed by the RT system and makes
- * sense anyway.
- *    -- Cort
- */
-	mfmsr 	r4
-	/* Copy all except the MSR_EE bit from r4 (current MSR value)
-	   to r3.  This is the sort of thing the rlwimi instruction is
-	   designed for.  -- paulus. */
-	rlwimi	r3,r4,0,17,15
-	 /* Check if things are setup the way we want _already_. */
-	cmpw	0,r3,r4
-	beqlr
-1:	SYNC
-	mtmsr	r3
-	SYNC
-	blr
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-_GLOBAL(local_irq_restore_end)
-
-_GLOBAL(local_irq_disable)
-	mfmsr	r0		/* Get current interrupt state */
-	rlwinm	r3,r0,16+1,32-1,31	/* Extract old value of 'EE' */
-	rlwinm	r0,r0,0,17,15	/* clear MSR_EE in r0 */
-	SYNC			/* Some chip revs have problems here... */
-	mtmsr	r0		/* Update machine state */
-	blr			/* Done */
-	/*
-	 * Need these nops here for taking over save/restore to
-	 * handle lost intrs
-	 * -- Cort
-	 */
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-_GLOBAL(local_irq_disable_end)
-
-_GLOBAL(local_irq_enable)
-	mfmsr	r3		/* Get current state */
-	ori	r3,r3,MSR_EE	/* Turn on 'EE' bit */
-	SYNC			/* Some chip revs have problems here... */
-	mtmsr	r3		/* Update machine state */
-	blr
-	/*
-	 * Need these nops here for taking over save/restore to
-	 * handle lost intrs
-	 * -- Cort
-	 */
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-	nop
-_GLOBAL(local_irq_enable_end)
-
 /*
  * complement mask on the msr then "or" some values on.
  *     _nmask_and_or_msr(nmask, value_to_or)
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
--- a/arch/ppc/kernel/ppc_ksyms.c
+++ b/arch/ppc/kernel/ppc_ksyms.c
@@ -272,16 +272,6 @@ EXPORT_SYMBOL(screen_info);
 #endif
 
 EXPORT_SYMBOL(__delay);
-#ifndef INLINE_IRQS
-EXPORT_SYMBOL(local_irq_enable);
-EXPORT_SYMBOL(local_irq_enable_end);
-EXPORT_SYMBOL(local_irq_disable);
-EXPORT_SYMBOL(local_irq_disable_end);
-EXPORT_SYMBOL(local_save_flags_ptr);
-EXPORT_SYMBOL(local_save_flags_ptr_end);
-EXPORT_SYMBOL(local_irq_restore);
-EXPORT_SYMBOL(local_irq_restore_end);
-#endif
 EXPORT_SYMBOL(timer_interrupt);
 EXPORT_SYMBOL(irq_desc);
 EXPORT_SYMBOL(tb_ticks_per_jiffy);
diff --git a/include/asm-ppc/hw_irq.h b/include/asm-ppc/hw_irq.h
--- a/include/asm-ppc/hw_irq.h
+++ b/include/asm-ppc/hw_irq.h
@@ -10,12 +10,8 @@
 
 extern void timer_interrupt(struct pt_regs *);
 
-#define INLINE_IRQS
-
 #define irqs_disabled()	((mfmsr() & MSR_EE) == 0)
 
-#ifdef INLINE_IRQS
-
 static inline void local_irq_disable(void)
 {
 	unsigned long msr;
@@ -45,18 +41,6 @@ static inline void local_irq_save_ptr(un
 #define local_irq_save(flags)		local_irq_save_ptr(&flags)
 #define local_irq_restore(flags)	mtmsr(flags)
 
-#else
-
-extern void local_irq_enable(void);
-extern void local_irq_disable(void);
-extern void local_irq_restore(unsigned long);
-extern void local_save_flags_ptr(unsigned long *);
-
-#define local_save_flags(flags) local_save_flags_ptr(&flags)
-#define local_irq_save(flags) ({local_save_flags(flags);local_irq_disable();})
-
-#endif
-
 extern void do_lost_interrupts(unsigned long);
 
 #define mask_irq(irq) ({if (irq_desc[irq].handler && irq_desc[irq].handler->disable) irq_desc[irq].handler->disable(irq);})

^ permalink raw reply

* bseip config doesn't build
From: Kumar Gala @ 2005-09-16 16:41 UTC (permalink / raw)
  To: linuxppc-embedded

Anyone have any ideas why the bseip_defconfig doesnt build.  I get the 
following error:

  CC      arch/ppc/8xx_io/enet.o
arch/ppc/8xx_io/enet.c:705:2: #error Exactly ONE pair of PA_ENET_[RT]XD, PB_ENET_[RT]XD must be defined
arch/ppc/8xx_io/enet.c: In function `scc_enet_init':
arch/ppc/8xx_io/enet.c:726: error: `PA_ENET_TCLK' undeclared (first use in this function)
arch/ppc/8xx_io/enet.c:726: error: (Each undeclared identifier is reported only once
arch/ppc/8xx_io/enet.c:726: error: for each function it appears in.)
arch/ppc/8xx_io/enet.c:726: error: `PA_ENET_RCLK' undeclared (first use in this function)
arch/ppc/8xx_io/enet.c:732: error: `PC_ENET_CLSN' undeclared (first use in this function)
arch/ppc/8xx_io/enet.c:732: error: `PC_ENET_RENA' undeclared (first use in this function)
arch/ppc/8xx_io/enet.c:739: error: `SICR_ENET_MASK' undeclared (first use in this function)
arch/ppc/8xx_io/enet.c:740: error: `SICR_ENET_CLKRT' undeclared (first use in this function)
arch/ppc/8xx_io/enet.c:918:2: #error Configuration Error: define exactly ONE of PB_ENET_TENA, PC_ENET_TENA, PE_ENET_TENA
arch/ppc/8xx_io/enet.c:932: error: `PB_BSE_POWERUP' undeclared (first use in this function)
arch/ppc/8xx_io/enet.c:932: error: `PB_BSE_FDXDIS' undeclared (first use in this function)
arch/ppc/8xx_io/enet.c:936: error: `PC_BSE_LOOPBACK' undeclared (first use in this function)
make[1]: *** [arch/ppc/8xx_io/enet.o] Error 1
make: *** [arch/ppc/8xx_io] Error 2

- kumar

^ permalink raw reply

* Re: bseip config doesn't build
From: Dan Malek @ 2005-09-16 17:34 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-embedded
In-Reply-To: <Pine.LNX.4.61.0509161138130.20199@nylon.am.freescale.net>


On Sep 16, 2005, at 12:41 PM, Kumar Gala wrote:

> Anyone have any ideas why the bseip_defconfig doesnt build.  I get the
> following error:

I'll look into it.

>   CC      arch/ppc/8xx_io/enet.o

I thought we are should be using the drivers/net/* version of this?

Thanks.

	-- Dan

^ permalink raw reply

* Re: OpenSSL 0.9.8 compile error!
From: Ricardo Fialho Tafas Junior @ 2005-09-16 15:34 UTC (permalink / raw)
  To: linux-ppc-embedded
In-Reply-To: <023EF71CB65AA949A2C510353690C86B5BF2C0@rokonet-e.rokonet_tree.local>

it worked and compiled ok.

thanks

Ricard Fialho Tafas Jr
  R&D Engineer
  Parks S.A. Comunicações Digitais
  www.parks.com.br
  +55 51 4700523
  e-mail: rtafas@parks.com.br



Eli Brin wrote:
> Dear Ricardo,
> 
> You need to add no-asm (and probably no-hw).  Please look at the makefile
> and Configure.
> 
> This works on 0.9.7b, but I believe that's you problem.
> 
> Eli
> 
> 
> 
> -----Original Message-----
> From: Ricardo Fialho Tafas Junior [mailto:rtafas@parks.com.br]
> Sent: Friday, September 16, 2005 1:19 PM
> To: linux-ppc-embedded
> Subject: OpenSSL 0.9.8 compile error!
> 
> 
> Hello list,
> 
> I'm trying to crosscompile openSSL to PPC8xx. I've downloaded the latest 
> version and when I call "make" I get the following error:
> 
> ppc_8xx-gcc -I.. -I../.. -I../../include -DOPENSSL_THREADS -D_REENTRANT 
> -DDSO_DLFCN -DHAVE_DLFCN_H -DB_ENDIAN -DTERMIO -O3 -Wall -c  -o 
> linux_ppc32.o linux_ppc32.s
> linux_ppc32.s: Assembler messages:
> linux_ppc32.s:109: Error: Unknown pseudo-op:  `.machine'
> make[3]: *** [linux_ppc32.o] Error 1
> make[3]: Leaving directory `/home/rtafas/voip_devel/openssl-0.9.8/crypto/bn'
> make[2]: *** [subdirs] Error 1
> make[2]: Leaving directory `/home/rtafas/voip_devel/openssl-0.9.8/crypto'
> make[1]: *** [build_crypto] Error 1
> make[1]: Leaving directory `/home/rtafas/voip_devel/openssl-0.9.8'
> make: *** [top] Error 2
> 
> Before that:
> I make a "./Configure linux-ppc" and edited the makefile to cross 
> compile it and to force it to use ppc-8xx_gcc and ppc_8xx-ar.
> 
> Any idea to solve this?
> Any "how to" to compile Openssl in embedded enviroment?
> 
> Thanks,
> 

^ permalink raw reply

* Re: bseip config doesn't build
From: Kumar Gala @ 2005-09-16 19:29 UTC (permalink / raw)
  To: Dan Malek; +Cc: Gala Kumar K.-galak, linuxppc-embedded
In-Reply-To: <580ff9f6f516e94ae546c695bad0071c@embeddededge.com>


On Sep 16, 2005, at 12:34 PM, Dan Malek wrote:

>
> On Sep 16, 2005, at 12:41 PM, Kumar Gala wrote:
>
>
>> Anyone have any ideas why the bseip_defconfig doesnt build.  I get  
>> the
>> following error:
>>
>
> I'll look into it.
>
>
>>   CC      arch/ppc/8xx_io/enet.o
>>
>
> I thought we are should be using the drivers/net/* version of this?

I think that is the longer term plan.  I believe at this point we are  
still using 8xx_io/enet.c.  Not sure how this broken and it might be  
a simple defconfig update that is required.

thanks for looking into it.

- kumar

^ permalink raw reply

* Re: [PATCH] powerpc: merge include/asm/cputable.h
From: Kumar Gala @ 2005-09-16 21:40 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linuxppc-dev, pantelis.antoniou, linuxppc64-dev,
	linuxppc-embedded
In-Reply-To: <200509160511.39277.arnd@arndb.de>

Ok, I've given into the enum as I dont see anything better.

However, I do have some questions, why introduce new Kconfig options  
for ppc64.  It seems overkill to have specific build options for each  
"class" of ppc64.  One could make the argument we should go do the  
same thing for classic ppc32.  From an embedded point of view I could  
reduce down to the specific cpu I'm using.  I really dont think we  
want to start doing this.

If we did I would have to say we would have to add Kconfig for 601,  
603, 604, 750 (740, 750, 755), 7400 (7400/7410), 7450 (744x/745x).   
That's six more Kconfig options

I'm ok with the patch, but think we should drop the arch/ppc64/ 
Kconfig portion and its related effects.

Also, I've changed CPU_FTR to CPU_FTRS for the "left hand side" of  
the enum.

- kumar

On Sep 15, 2005, at 10:11 PM, Arnd Bergmann wrote:

> On Freedag 16 September 2005 04:22, Kumar Gala wrote:
>
>
>>> #define CPU_FTR_POSSIBLE CPU_FTR_PSERIES_POSSIBLE |
>>> CPU_FTR_PMAC_POSSIBLE \
>>>          | CPU_FTR_...
>>> #define CPU_FTR_ALWAYS CPU_FTR_POSSIBLE & CPU_FTR_PSERIES_ALWAYS \
>>>         & CPU_FTR_PMAC_ALWAYS & CPU_FTR_ ...
>>>
>>
>> Yes, something like that.  Why do we need the CPU_FTR_ALWAYS.  It
>> seems that CPU_FTR_POSSIBLE is sufficient.  I may just not understand
>> the purpose of CPU_FTR_ALWAYS.
>>
>>
>>> One point to consider is that we traditionally use #ifdef in the
>>> source for many places that could simply use cpu_has_feature(). E.g.
>>> most instances of #ifdef CONFIG_ALTIVEC could be replaced by
>>> cpu_has_feature(CPU_FTR_ALTIVEC) without additional run-time  
>>> overhead.
>>>
>>
>> These should stay as CONFIG options because to reduce the code size
>> of the kernel which is important to embedded people.
>>
>
> The whole point of the logic is to reduce code size, because gcc
> is smart enough to remove all dead code then.
> Consider again the definition of
>
> | static inline int have_feature(unsigned long feature)
> | {
> |      return (FEATURE_ALWAYS & feature) ||
> |             (FEATURE_POSSIBLE & runtime_feature & feature);
> | }
>
> If the feature is part of FEATURE_ALWAYS, this will be optimized to
>
> |      return 1 || FEATURE_POSSIBLE & runtime_feature & feature;
>
> and subsequently
>
> |      return 1;
>
> If it is not part of FEATURE_POSSIBLE, it it equivalent to
>
> |      return 0 || (0 & runtime_feature & feature);
>
> which becomes
>
> |      return 0;
>
>
> Any code inside of
>
> |      if (0) { /* ... */ }
>
> is only checked for syntax by gcc but will not end up in the object  
> code.
> For the 'if(1)' case, the code gets smaller as well, because the  
> runtime
> flag does not have to be dereferenced.
>
> For some places, we might prefer to replace '#ifdef CONFIG_FOO' not  
> with
> have_feature(FOO), but rather with feature_possible(FOO), given a  
> definition
> of
>
> static inline int have_feature(unsigned int feature)
> {
>     return !!(FEATURE_POSSIBLE & feature);
> }
>
> which always get evaluated at compile time.
>
>     Arnd <><
>

^ permalink raw reply

* squashfs on ppc
From: Tolunay Orkun @ 2005-09-16 21:48 UTC (permalink / raw)
  To: linuxppc-embedded

Hi,

Has anyone any positive or negative experience of using squashfs on 
PowerPC as initrd?

Our environment is PowerPC 405GP running 2.4.31 kernel. U-Boot is our 
bootloader. Any comparison with respect to CramFS?

Best regards,
Tolunay

^ permalink raw reply

* Re: squashfs on ppc
From: Eugene Surovegin @ 2005-09-16 22:41 UTC (permalink / raw)
  To: Tolunay Orkun; +Cc: linuxppc-embedded
In-Reply-To: <432B3D99.5030209@orkun.us>

On Fri, Sep 16, 2005 at 04:48:09PM -0500, Tolunay Orkun wrote:
> Has anyone any positive or negative experience of using squashfs on 
> PowerPC as initrd?
> 
> Our environment is PowerPC 405GP running 2.4.31 kernel. U-Boot is our 
> bootloader. Any comparison with respect to CramFS?

I use squashfs and squashfs2. Both work just fine on PPC.

They provide significantly better compression ration than cramfs, 
although at the expense of some speed (mostly visible during initial 
startup of big user-space app).

-- 
Eugene

^ permalink raw reply

* Re: [PATCH] powerpc: merge include/asm/cputable.h
From: Arnd Bergmann @ 2005-09-17  0:36 UTC (permalink / raw)
  To: Kumar Gala
  Cc: linuxppc-dev, pantelis.antoniou, linuxppc64-dev,
	linuxppc-embedded
In-Reply-To: <17FA692D-4643-4390-AE8A-AEF6F716C5EE@freescale.com>

On Freedag 16 September 2005 23:40, Kumar Gala wrote:
> However, I do have some questions, why introduce new Kconfig options  
> for ppc64.  It seems overkill to have specific build options for each  
> "class" of ppc64.  One could make the argument we should go do the  
> same thing for classic ppc32.  From an embedded point of view I could  
> reduce down to the specific cpu I'm using.  I really dont think we  
> want to start doing this.

Note that the configuration options that my patch introduced are
all autodetected from the existing platform CONFIG_PPC_ symbols, so
they don't give you extra settings that might be messed up.

Having the options makes the enum in cpufeatures.h more readable
imho, but if you want to do a patch without them, I wont complain.

> If we did I would have to say we would have to add Kconfig for 601,  
> 603, 604, 750 (740, 750, 755), 7400 (7400/7410), 7450 (744x/745x).   
> That's six more Kconfig options

I actually like the idea more flexibility to which CPU optimizations
you get in the kernel. These could be combined with the gcc -mcpu=
argument, if there is a way for Kconfig to deduce the most generic
cpu type that still supports all selected models.
The easiest way to do something like this should be to add more
choices to the existing "Processor Type" submenu instead of having
each one selectable separately.

Something tells me that the platform and CPU type selection will
keep us busy for some time, because they are currently treated very
differently in ppc and ppc64. Please tell me if I understand this
correctly:

In ppc, the user can select one out of 27 platforms and one out of
seven separate sets of CPUs. All platforms except CHRP/PowerMac/PReP
can only ever work with a specific CPU selection, while that one
platform has the choice between 6xx/7xx/74xx/52xx/82xx/83xx, POWER3
and POWER4/970. These connections are currently not documented.

In ppc64, the user has to choose between the legacy iSeries and 
the generic platform. Generic means any combination of pSeries, 
PowerMac, Cell or Maple. The only CPU selection possibility is
'any cpu' or 'Power4 or better'. In future, we will have at least
a third option 'Book E' (or e700), which is incompatible with the
others. With my patch applied, the kernel would automatically disable
support for CPUs that are not possible with the selected platform
setting.

	Arnd <><

^ permalink raw reply

* Repeated corruption of file->f_ep_lock
From: David Woodhouse @ 2005-09-17 11:27 UTC (permalink / raw)
  To: ppc-dev list; +Cc: Davide Libenzi, viro

For a while I've been seeing occasional deadlocks on one CPU of a PPC
SMP machine:

_spin_lock(c8cbf250) CPU#1 NIP c02bb740 holder: cpu 2305 pc 00000000 (lock 24000484)

Further debugging shows that it's always due to file->f_ep_lock being
corrupted, and the deadlock happens when epoll is used on such a file.
The owner_cpu field is almost always 2305. However, it's not due to the
epoll code itself -- I've turned all three of the epoll syscalls into
sys_ni_syscall and it's still happening. I also added sanity checks for
(file->f_ep_lock.owner_cpu > 1) throughout fs/file_table.c, and I see it
happen ten or twenty times during a kernel compile.

The previous and next members of 'struct file', which are f_ep_list and
f_mapping respectively, are always fine. It's just f_ep_lock which is
scribbled upon, and the scribble is fairly repeatable: 'owner_cpu' is
almost always set to 0x901 but occasionally 0x501, and the 'lock' field
has values like 20282484, 24042884, 28022484, 24042084, 22000424 (hex).
Do those numbers seem meaningful to anyone? Any clues as to where they
might be coming from?

During a kernel compile, the corruption is mostly detected in fget()
from vfs_fstat(), but also I've seen it once or twice in vfs_read() from
do_execve():

 File cb2f5b40 (fops d107c980) has corrupted f_epoll_lock!
 lock 24002484, owner_pc 0, owner_cpu 901
 f->private_data 00000000, f->f_ep_links (cb2f5bc8, cb2f5bc8), f->f_mapping cc21c1c8
 f->f_mapping->a_ops d107cad8
 Pid 16648, comm gcc
 File is /usr/bin/gcc
 Badness in dumpbadfile at fs/file_table.c:133
 Call trace:
  [c00059b8] check_bug_trap+0xa8/0x120
  [c0005c94] ProgramCheckException+0x264/0x4e0
  [c00050a8] ret_from_except_full+0x0/0x4c
  [c0080bb4] dumpbadfile+0x114/0x160
  [c007f9f0] vfs_read+0xa0/0x1c0
  [c008ef7c] kernel_read+0x3c/0x60
  [c0091810] do_execve+0x1e0/0x280
  [c0008594] sys_execve+0x64/0xd0
  [c0004980] ret_from_syscall+0x0/0x44

This is the Fedora Core kernel (currently 2.6.12.5). The 'owner_cpu > 1'
sanity check isn't applicable to 2.6.13, so I haven't yet tried to
reproduce the problem there.

-- 
dwmw2

^ permalink raw reply

* Re: Repeated corruption of file->f_ep_lock
From: Paul Mackerras @ 2005-09-17 13:11 UTC (permalink / raw)
  To: David Woodhouse; +Cc: ppc-dev list, Davide Libenzi, viro
In-Reply-To: <1126956437.4171.20.camel@baythorne.infradead.org>

David Woodhouse writes:

> The previous and next members of 'struct file', which are f_ep_list and
> f_mapping respectively, are always fine. It's just f_ep_lock which is
> scribbled upon, and the scribble is fairly repeatable: 'owner_cpu' is
> almost always set to 0x901 but occasionally 0x501, and the 'lock' field
> has values like 20282484, 24042884, 28022484, 24042084, 22000424 (hex).
> Do those numbers seem meaningful to anyone? Any clues as to where they
> might be coming from?

They look like part of an exception stack frame.  The 901 or 501 would
be the trap number; 500 for an external interrupt or 900 for a
decrementer interrupt, plus 1 which we use as a marker to say that
only the volatile registers have been saved in the frame.  The other
values (20282484 etc.) could possibly be condition register values.
That would fit with owner_cpu being 2 words past the lock field; the
trap field in struct pt_regs is 2 words past the ccr field.

Paul.

^ permalink raw reply

* Re: Reminder: removal of APUS and Gemini still pending
From: Simon Richter @ 2005-09-17 14:09 UTC (permalink / raw)
  To: Kumar Gala; +Cc: ppc-dev list
In-Reply-To: <15A1D026-00E3-4652-ABA5-9A8B8517A2CA@freescale.com>

Kumar Gala wrote:

> This is a reminder email to all those that care that APUS and Gemini  
> configs are still not building in the kernel.  They are still  scheduled 
> to be removed after the release of 2.6.15.

I have a tree that builds an APUS kernel (with Roman Zippel's patches 
forwarded to HEAD), however I wanted to hold back with merging it until 
the ppc/ppc64 -> powerpc transition is finished; also, I would like to 
get proper changesets with attribution instead of a big patch (the plan 
is to forward-merge the changes until after the transition, then turn 
them back into a diff and apply them step by step).

    Simon

^ permalink raw reply

* PATCH powerpc: 00/04 Remove __pmac, etc, sections, merge sections.h
From: Jon Loeliger @ 2005-09-17 15:31 UTC (permalink / raw)
  To: linuxppc-dev, linuxppc64-dev


Here is a new patch that removes all notion of the pmac, prep,
chrp and openfirmware initialization sections, and then unifies
the sections.h files without those __pmac, etc, sections identifiers
cluttering things up.

Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Kumar Gala <kumar.gala@freescale.com>
---

Part 01/04 - Remove sections use from ppc
 arch/ppc/kernel/pci.c               |   10 +-
 arch/ppc/kernel/setup.c             |    2 
 arch/ppc/platforms/chrp_pci.c       |    8 +-
 arch/ppc/platforms/chrp_setup.c     |   16 ++-
 arch/ppc/platforms/chrp_smp.c       |    2 
 arch/ppc/platforms/chrp_time.c      |    8 +-
 arch/ppc/platforms/pmac_backlight.c |   16 ++-
 arch/ppc/platforms/pmac_cpufreq.c   |   36 ++++---
 arch/ppc/platforms/pmac_feature.c   |  176 ++++++++++++++++++-----------------
 arch/ppc/platforms/pmac_nvram.c     |   42 ++++----
 arch/ppc/platforms/pmac_pci.c       |   22 ++--
 arch/ppc/platforms/pmac_pic.c       |   26 +++--
 arch/ppc/platforms/pmac_setup.c     |   12 +-
 arch/ppc/platforms/pmac_smp.c       |   10 +-
 arch/ppc/platforms/pmac_time.c      |    8 +-
 arch/ppc/platforms/prep_pci.c       |   64 ++++++-------
 arch/ppc/platforms/prep_setup.c     |   44 ++++-----
 arch/ppc/platforms/residual.c       |    2 
 arch/ppc/syslib/btext.c             |    6 +
 arch/ppc/syslib/prep_nvram.c        |   13 +--
 arch/ppc/syslib/prom.c              |   18 ++--

Part 02/04 - Remove sections use from ppc64 and drivers
 arch/ppc64/kernel/pmac_feature.c    |   60 ++++++------
 arch/ppc64/kernel/pmac_nvram.c      |   30 +++---
 arch/ppc64/kernel/pmac_pci.c        |   12 +-
 arch/ppc64/kernel/pmac_setup.c      |   10 +-
 arch/ppc64/kernel/pmac_smp.c        |    2 
 arch/ppc64/kernel/pmac_time.c       |    4 -
 drivers/ide/ppc/pmac.c              |   80 ++++++++--------
 drivers/macintosh/ans-lcd.c         |   10 +-
 drivers/macintosh/mediabay.c        |   56 ++++++-----
 drivers/macintosh/via-cuda.c        |    1 
 drivers/macintosh/via-pmu.c         |  129 +++++++++++++-------------
 drivers/macintosh/via-pmu68k.c      |   15 +--

Part 03/04 - Remove section free() and linker script
 arch/ppc/kernel/vmlinux.lds.S       |   26 -----
 arch/ppc/mm/init.c                  |   12 --

Part 04/04 - Merge simplified sections.h into asm-powerpc
 include/asm-powerpc/sections.h      |   20 ++++
 include/asm-ppc/sections.h          |   33 -------
 include/asm-ppc64/sections.h        |   29 ------

 38 files changed, 492 insertions(+), 578 deletions(-)

^ permalink raw reply

* PATCH powerpc: 01/04 Remove sections use from ppc
From: Jon Loeliger @ 2005-09-17 15:35 UTC (permalink / raw)
  To: linuxppc-dev, linuxppc64-dev
In-Reply-To: <E1EGefQ-00072D-34@jdl.com>

diff --git a/arch/ppc/kernel/pci.c b/arch/ppc/kernel/pci.c
--- a/arch/ppc/kernel/pci.c
+++ b/arch/ppc/kernel/pci.c
@@ -644,7 +644,7 @@ pcibios_alloc_controller(void)
 /*
  * Functions below are used on OpenFirmware machines.
  */
-static void __openfirmware
+static void
 make_one_node_map(struct device_node* node, u8 pci_bus)
 {
 	int *bus_range;
@@ -678,7 +678,7 @@ make_one_node_map(struct device_node* no
 	}
 }
 	
-void __openfirmware
+void
 pcibios_make_OF_bus_map(void)
 {
 	int i;
@@ -720,7 +720,7 @@ pcibios_make_OF_bus_map(void)
 
 typedef int (*pci_OF_scan_iterator)(struct device_node* node, void* data);
 
-static struct device_node* __openfirmware
+static struct device_node*
 scan_OF_pci_childs(struct device_node* node, pci_OF_scan_iterator filter, void* data)
 {
 	struct device_node* sub_node;
@@ -761,7 +761,7 @@ scan_OF_pci_childs_iterator(struct devic
 	return 0;
 }
 
-static struct device_node* __openfirmware
+static struct device_node*
 scan_OF_childs_for_device(struct device_node* node, u8 bus, u8 dev_fn)
 {
 	u8 filter_data[2] = {bus, dev_fn};
@@ -842,7 +842,7 @@ pci_find_hose_for_OF_device(struct devic
 	return NULL;
 }
 
-static int __openfirmware
+static int
 find_OF_pci_device_filter(struct device_node* node, void* data)
 {
 	return ((void *)node == data);
diff --git a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c
--- a/arch/ppc/kernel/setup.c
+++ b/arch/ppc/kernel/setup.c
@@ -339,7 +339,7 @@ early_init(int r3, int r4, int r5)
  * Assume here that all clock rates are the same in a
  * smp system.  -- Cort
  */
-int __openfirmware
+int
 of_show_percpuinfo(struct seq_file *m, int i)
 {
 	struct device_node *cpu_node;
diff --git a/arch/ppc/platforms/chrp_pci.c b/arch/ppc/platforms/chrp_pci.c
--- a/arch/ppc/platforms/chrp_pci.c
+++ b/arch/ppc/platforms/chrp_pci.c
@@ -29,7 +29,7 @@ void __iomem *gg2_pci_config_base;
  * limit the bus number to 3 bits
  */
 
-int __chrp gg2_read_config(struct pci_bus *bus, unsigned int devfn, int off,
+int gg2_read_config(struct pci_bus *bus, unsigned int devfn, int off,
 			   int len, u32 *val)
 {
 	volatile void __iomem *cfg_data;
@@ -56,7 +56,7 @@ int __chrp gg2_read_config(struct pci_bu
 	return PCIBIOS_SUCCESSFUL;
 }
 
-int __chrp gg2_write_config(struct pci_bus *bus, unsigned int devfn, int off,
+int gg2_write_config(struct pci_bus *bus, unsigned int devfn, int off,
 			    int len, u32 val)
 {
 	volatile void __iomem *cfg_data;
@@ -92,7 +92,7 @@ static struct pci_ops gg2_pci_ops =
 /*
  * Access functions for PCI config space using RTAS calls.
  */
-int __chrp
+int
 rtas_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
 		 int len, u32 *val)
 {
@@ -108,7 +108,7 @@ rtas_read_config(struct pci_bus *bus, un
 	return rval? PCIBIOS_DEVICE_NOT_FOUND: PCIBIOS_SUCCESSFUL;
 }
 
-int __chrp
+int
 rtas_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
 		  int len, u32 val)
 {
diff --git a/arch/ppc/platforms/chrp_setup.c b/arch/ppc/platforms/chrp_setup.c
--- a/arch/ppc/platforms/chrp_setup.c
+++ b/arch/ppc/platforms/chrp_setup.c
@@ -105,7 +105,7 @@ static const char *gg2_cachemodes[4] = {
 	"Disabled", "Write-Through", "Copy-Back", "Transparent Mode"
 };
 
-int __chrp
+int
 chrp_show_cpuinfo(struct seq_file *m)
 {
 	int i, sdramen;
@@ -303,7 +303,7 @@ void __init chrp_setup_arch(void)
 	pci_create_OF_bus_map();
 }
 
-void __chrp
+void
 chrp_event_scan(void)
 {
 	unsigned char log[1024];
@@ -314,7 +314,7 @@ chrp_event_scan(void)
 	ppc_md.heartbeat_count = ppc_md.heartbeat_reset;
 }
 
-void __chrp
+void
 chrp_restart(char *cmd)
 {
 	printk("RTAS system-reboot returned %d\n",
@@ -322,7 +322,7 @@ chrp_restart(char *cmd)
 	for (;;);
 }
 
-void __chrp
+void
 chrp_power_off(void)
 {
 	/* allow power on only with power button press */
@@ -331,13 +331,13 @@ chrp_power_off(void)
 	for (;;);
 }
 
-void __chrp
+void
 chrp_halt(void)
 {
 	chrp_power_off();
 }
 
-u_int __chrp
+u_int
 chrp_irq_canonicalize(u_int irq)
 {
 	if (irq == 2)
@@ -572,7 +572,7 @@ chrp_init(unsigned long r3, unsigned lon
 	if (ppc_md.progress) ppc_md.progress("Linux/PPC "UTS_RELEASE"\n", 0x0);
 }
 
-void __chrp
+void
 rtas_display_progress(char *s, unsigned short hex)
 {
 	int width;
@@ -599,7 +599,7 @@ rtas_display_progress(char *s, unsigned 
 	call_rtas( "display-character", 1, 1, NULL, ' ' );
 }
 
-void __chrp
+void
 rtas_indicator_progress(char *s, unsigned short hex)
 {
 	call_rtas("set-indicator", 3, 1, NULL, 6, 0, hex);
diff --git a/arch/ppc/platforms/chrp_smp.c b/arch/ppc/platforms/chrp_smp.c
--- a/arch/ppc/platforms/chrp_smp.c
+++ b/arch/ppc/platforms/chrp_smp.c
@@ -88,7 +88,7 @@ smp_chrp_take_timebase(void)
 }
 
 /* CHRP with openpic */
-struct smp_ops_t chrp_smp_ops __chrpdata = {
+struct smp_ops_t chrp_smp_ops = {
 	.message_pass = smp_openpic_message_pass,
 	.probe = smp_chrp_probe,
 	.kick_cpu = smp_chrp_kick_cpu,
diff --git a/arch/ppc/platforms/chrp_time.c b/arch/ppc/platforms/chrp_time.c
--- a/arch/ppc/platforms/chrp_time.c
+++ b/arch/ppc/platforms/chrp_time.c
@@ -52,7 +52,7 @@ long __init chrp_time_init(void)
 	return 0;
 }
 
-int __chrp chrp_cmos_clock_read(int addr)
+int chrp_cmos_clock_read(int addr)
 {
 	if (nvram_as1 != 0)
 		outb(addr>>8, nvram_as1);
@@ -60,7 +60,7 @@ int __chrp chrp_cmos_clock_read(int addr
 	return (inb(nvram_data));
 }
 
-void __chrp chrp_cmos_clock_write(unsigned long val, int addr)
+void chrp_cmos_clock_write(unsigned long val, int addr)
 {
 	if (nvram_as1 != 0)
 		outb(addr>>8, nvram_as1);
@@ -72,7 +72,7 @@ void __chrp chrp_cmos_clock_write(unsign
 /*
  * Set the hardware clock. -- Cort
  */
-int __chrp chrp_set_rtc_time(unsigned long nowtime)
+int chrp_set_rtc_time(unsigned long nowtime)
 {
 	unsigned char save_control, save_freq_select;
 	struct rtc_time tm;
@@ -118,7 +118,7 @@ int __chrp chrp_set_rtc_time(unsigned lo
 	return 0;
 }
 
-unsigned long __chrp chrp_get_rtc_time(void)
+unsigned long chrp_get_rtc_time(void)
 {
 	unsigned int year, mon, day, hour, min, sec;
 	int uip, i;
diff --git a/arch/ppc/platforms/pmac_backlight.c b/arch/ppc/platforms/pmac_backlight.c
--- a/arch/ppc/platforms/pmac_backlight.c
+++ b/arch/ppc/platforms/pmac_backlight.c
@@ -37,7 +37,7 @@ static int backlight_req_enable = -1;
 static void backlight_callback(void *);
 static DECLARE_WORK(backlight_work, backlight_callback, NULL);
 
-void __pmac register_backlight_controller(struct backlight_controller *ctrler,
+void register_backlight_controller(struct backlight_controller *ctrler,
 					  void *data, char *type)
 {
 	struct device_node* bk_node;
@@ -99,7 +99,7 @@ void __pmac register_backlight_controlle
 }
 EXPORT_SYMBOL(register_backlight_controller);
 
-void __pmac unregister_backlight_controller(struct backlight_controller
+void unregister_backlight_controller(struct backlight_controller
 					    *ctrler, void *data)
 {
 	/* We keep the current backlight level (for now) */
@@ -108,7 +108,7 @@ void __pmac unregister_backlight_control
 }
 EXPORT_SYMBOL(unregister_backlight_controller);
 
-static int __pmac __set_backlight_enable(int enable)
+static int __set_backlight_enable(int enable)
 {
 	int rc;
 
@@ -122,7 +122,7 @@ static int __pmac __set_backlight_enable
 	release_console_sem();
 	return rc;
 }
-int __pmac set_backlight_enable(int enable)
+int set_backlight_enable(int enable)
 {
 	if (!backlighter)
 		return -ENODEV;
@@ -133,7 +133,7 @@ int __pmac set_backlight_enable(int enab
 
 EXPORT_SYMBOL(set_backlight_enable);
 
-int __pmac get_backlight_enable(void)
+int get_backlight_enable(void)
 {
 	if (!backlighter)
 		return -ENODEV;
@@ -141,7 +141,7 @@ int __pmac get_backlight_enable(void)
 }
 EXPORT_SYMBOL(get_backlight_enable);
 
-static int __pmac __set_backlight_level(int level)
+static int __set_backlight_level(int level)
 {
 	int rc = 0;
 
@@ -165,7 +165,7 @@ static int __pmac __set_backlight_level(
 	}
 	return rc;
 }
-int __pmac set_backlight_level(int level)
+int set_backlight_level(int level)
 {
 	if (!backlighter)
 		return -ENODEV;
@@ -176,7 +176,7 @@ int __pmac set_backlight_level(int level
 
 EXPORT_SYMBOL(set_backlight_level);
 
-int __pmac get_backlight_level(void)
+int get_backlight_level(void)
 {
 	if (!backlighter)
 		return -ENODEV;
diff --git a/arch/ppc/platforms/pmac_cpufreq.c b/arch/ppc/platforms/pmac_cpufreq.c
--- a/arch/ppc/platforms/pmac_cpufreq.c
+++ b/arch/ppc/platforms/pmac_cpufreq.c
@@ -136,7 +136,7 @@ static inline void debug_calc_bogomips(v
 
 /* Switch CPU speed under 750FX CPU control
  */
-static int __pmac cpu_750fx_cpu_speed(int low_speed)
+static int cpu_750fx_cpu_speed(int low_speed)
 {
 	u32 hid2;
 
@@ -172,7 +172,7 @@ static int __pmac cpu_750fx_cpu_speed(in
 	return 0;
 }
 
-static unsigned int __pmac cpu_750fx_get_cpu_speed(void)
+static unsigned int cpu_750fx_get_cpu_speed(void)
 {
 	if (mfspr(SPRN_HID1) & HID1_PS)
 		return low_freq;
@@ -181,7 +181,7 @@ static unsigned int __pmac cpu_750fx_get
 }
 
 /* Switch CPU speed using DFS */
-static int __pmac dfs_set_cpu_speed(int low_speed)
+static int dfs_set_cpu_speed(int low_speed)
 {
 	if (low_speed == 0) {
 		/* ramping up, set voltage first */
@@ -205,7 +205,7 @@ static int __pmac dfs_set_cpu_speed(int 
 	return 0;
 }
 
-static unsigned int __pmac dfs_get_cpu_speed(void)
+static unsigned int dfs_get_cpu_speed(void)
 {
 	if (mfspr(SPRN_HID1) & HID1_DFS)
 		return low_freq;
@@ -216,7 +216,7 @@ static unsigned int __pmac dfs_get_cpu_s
 
 /* Switch CPU speed using slewing GPIOs
  */
-static int __pmac gpios_set_cpu_speed(int low_speed)
+static int gpios_set_cpu_speed(int low_speed)
 {
 	int gpio, timeout = 0;
 
@@ -258,7 +258,7 @@ static int __pmac gpios_set_cpu_speed(in
 
 /* Switch CPU speed under PMU control
  */
-static int __pmac pmu_set_cpu_speed(int low_speed)
+static int pmu_set_cpu_speed(int low_speed)
 {
 	struct adb_request req;
 	unsigned long save_l2cr;
@@ -354,7 +354,7 @@ static int __pmac pmu_set_cpu_speed(int 
 	return 0;
 }
 
-static int __pmac do_set_cpu_speed(int speed_mode, int notify)
+static int do_set_cpu_speed(int speed_mode, int notify)
 {
 	struct cpufreq_freqs freqs;
 	unsigned long l3cr;
@@ -391,17 +391,17 @@ static int __pmac do_set_cpu_speed(int s
 	return 0;
 }
 
-static unsigned int __pmac pmac_cpufreq_get_speed(unsigned int cpu)
+static unsigned int pmac_cpufreq_get_speed(unsigned int cpu)
 {
 	return cur_freq;
 }
 
-static int __pmac pmac_cpufreq_verify(struct cpufreq_policy *policy)
+static int pmac_cpufreq_verify(struct cpufreq_policy *policy)
 {
 	return cpufreq_frequency_table_verify(policy, pmac_cpu_freqs);
 }
 
-static int __pmac pmac_cpufreq_target(	struct cpufreq_policy *policy,
+static int pmac_cpufreq_target(	struct cpufreq_policy *policy,
 					unsigned int target_freq,
 					unsigned int relation)
 {
@@ -414,13 +414,13 @@ static int __pmac pmac_cpufreq_target(	s
 	return do_set_cpu_speed(newstate, 1);
 }
 
-unsigned int __pmac pmac_get_one_cpufreq(int i)
+unsigned int pmac_get_one_cpufreq(int i)
 {
 	/* Supports only one CPU for now */
 	return (i == 0) ? cur_freq : 0;
 }
 
-static int __pmac pmac_cpufreq_cpu_init(struct cpufreq_policy *policy)
+static int pmac_cpufreq_cpu_init(struct cpufreq_policy *policy)
 {
 	if (policy->cpu != 0)
 		return -ENODEV;
@@ -433,7 +433,7 @@ static int __pmac pmac_cpufreq_cpu_init(
 	return cpufreq_frequency_table_cpuinfo(policy, pmac_cpu_freqs);
 }
 
-static u32 __pmac read_gpio(struct device_node *np)
+static u32 read_gpio(struct device_node *np)
 {
 	u32 *reg = (u32 *)get_property(np, "reg", NULL);
 	u32 offset;
@@ -452,7 +452,7 @@ static u32 __pmac read_gpio(struct devic
 	return offset;
 }
 
-static int __pmac pmac_cpufreq_suspend(struct cpufreq_policy *policy, pm_message_t pmsg)
+static int pmac_cpufreq_suspend(struct cpufreq_policy *policy, pm_message_t pmsg)
 {
 	/* Ok, this could be made a bit smarter, but let's be robust for now. We
 	 * always force a speed change to high speed before sleep, to make sure
@@ -468,7 +468,7 @@ static int __pmac pmac_cpufreq_suspend(s
 	return 0;
 }
 
-static int __pmac pmac_cpufreq_resume(struct cpufreq_policy *policy)
+static int pmac_cpufreq_resume(struct cpufreq_policy *policy)
 {
 	/* If we resume, first check if we have a get() function */
 	if (get_speed_proc)
@@ -501,7 +501,7 @@ static struct cpufreq_driver pmac_cpufre
 };
 
 
-static int __pmac pmac_cpufreq_init_MacRISC3(struct device_node *cpunode)
+static int pmac_cpufreq_init_MacRISC3(struct device_node *cpunode)
 {
 	struct device_node *volt_gpio_np = of_find_node_by_name(NULL,
 								"voltage-gpio");
@@ -593,7 +593,7 @@ static int __pmac pmac_cpufreq_init_MacR
 	return 0;
 }
 
-static int __pmac pmac_cpufreq_init_7447A(struct device_node *cpunode)
+static int pmac_cpufreq_init_7447A(struct device_node *cpunode)
 {
 	struct device_node *volt_gpio_np;
 
@@ -620,7 +620,7 @@ static int __pmac pmac_cpufreq_init_7447
 	return 0;
 }
 
-static int __pmac pmac_cpufreq_init_750FX(struct device_node *cpunode)
+static int pmac_cpufreq_init_750FX(struct device_node *cpunode)
 {
 	struct device_node *volt_gpio_np;
 	u32 pvr, *value;
diff --git a/arch/ppc/platforms/pmac_feature.c b/arch/ppc/platforms/pmac_feature.c
--- a/arch/ppc/platforms/pmac_feature.c
+++ b/arch/ppc/platforms/pmac_feature.c
@@ -63,7 +63,7 @@ extern struct device_node *k2_skiplist[2
  * We use a single global lock to protect accesses. Each driver has
  * to take care of its own locking
  */
-static DEFINE_SPINLOCK(feature_lock  __pmacdata);
+static DEFINE_SPINLOCK(feature_lock);
 
 #define LOCK(flags)	spin_lock_irqsave(&feature_lock, flags);
 #define UNLOCK(flags)	spin_unlock_irqrestore(&feature_lock, flags);
@@ -72,9 +72,9 @@ static DEFINE_SPINLOCK(feature_lock  __p
 /*
  * Instance of some macio stuffs
  */
-struct macio_chip macio_chips[MAX_MACIO_CHIPS]  __pmacdata;
+struct macio_chip macio_chips[MAX_MACIO_CHIPS];
 
-struct macio_chip* __pmac macio_find(struct device_node* child, int type)
+struct macio_chip* macio_find(struct device_node* child, int type)
 {
 	while(child) {
 		int	i;
@@ -89,7 +89,7 @@ struct macio_chip* __pmac macio_find(str
 }
 EXPORT_SYMBOL_GPL(macio_find);
 
-static const char* macio_names[] __pmacdata =
+static const char* macio_names[] =
 {
 	"Unknown",
 	"Grand Central",
@@ -116,10 +116,10 @@ static const char* macio_names[] __pmacd
 #define UN_BIS(r,v)	(UN_OUT((r), UN_IN(r) | (v)))
 #define UN_BIC(r,v)	(UN_OUT((r), UN_IN(r) & ~(v)))
 
-static struct device_node* uninorth_node __pmacdata;
-static u32 __iomem * uninorth_base __pmacdata;
-static u32 uninorth_rev __pmacdata;
-static int uninorth_u3 __pmacdata;
+static struct device_node* uninorth_node;
+static u32 __iomem * uninorth_base;
+static u32 uninorth_rev;
+static int uninorth_u3;
 static void __iomem *u3_ht;
 
 /*
@@ -142,13 +142,13 @@ struct pmac_mb_def
 	struct feature_table_entry* 	features;
 	unsigned long			board_flags;
 };
-static struct pmac_mb_def pmac_mb __pmacdata;
+static struct pmac_mb_def pmac_mb;
 
 /*
  * Here are the chip specific feature functions
  */
 
-static inline int __pmac
+static inline int
 simple_feature_tweak(struct device_node* node, int type, int reg, u32 mask, int value)
 {
 	struct macio_chip*	macio;
@@ -170,7 +170,7 @@ simple_feature_tweak(struct device_node*
 
 #ifndef CONFIG_POWER4
 
-static long __pmac
+static long
 ohare_htw_scc_enable(struct device_node* node, long param, long value)
 {
 	struct macio_chip*	macio;
@@ -263,21 +263,21 @@ ohare_htw_scc_enable(struct device_node*
 	return 0;
 }
 
-static long __pmac
+static long
 ohare_floppy_enable(struct device_node* node, long param, long value)
 {
 	return simple_feature_tweak(node, macio_ohare,
 		OHARE_FCR, OH_FLOPPY_ENABLE, value);
 }
 
-static long __pmac
+static long
 ohare_mesh_enable(struct device_node* node, long param, long value)
 {
 	return simple_feature_tweak(node, macio_ohare,
 		OHARE_FCR, OH_MESH_ENABLE, value);
 }
 
-static long __pmac
+static long
 ohare_ide_enable(struct device_node* node, long param, long value)
 {
 	switch(param) {
@@ -298,7 +298,7 @@ ohare_ide_enable(struct device_node* nod
 	}
 }
 
-static long __pmac
+static long
 ohare_ide_reset(struct device_node* node, long param, long value)
 {
 	switch(param) {
@@ -313,7 +313,7 @@ ohare_ide_reset(struct device_node* node
 	}
 }
 
-static long __pmac
+static long
 ohare_sleep_state(struct device_node* node, long param, long value)
 {
 	struct macio_chip*	macio = &macio_chips[0];
@@ -329,7 +329,7 @@ ohare_sleep_state(struct device_node* no
 	return 0;
 }
 
-static long __pmac
+static long
 heathrow_modem_enable(struct device_node* node, long param, long value)
 {
 	struct macio_chip*	macio;
@@ -373,7 +373,7 @@ heathrow_modem_enable(struct device_node
 	return 0;
 }
 
-static long __pmac
+static long
 heathrow_floppy_enable(struct device_node* node, long param, long value)
 {
 	return simple_feature_tweak(node, macio_unknown,
@@ -382,7 +382,7 @@ heathrow_floppy_enable(struct device_nod
 		value);
 }
 
-static long __pmac
+static long
 heathrow_mesh_enable(struct device_node* node, long param, long value)
 {
 	struct macio_chip*	macio;
@@ -411,7 +411,7 @@ heathrow_mesh_enable(struct device_node*
 	return 0;
 }
 
-static long __pmac
+static long
 heathrow_ide_enable(struct device_node* node, long param, long value)
 {
 	switch(param) {
@@ -426,7 +426,7 @@ heathrow_ide_enable(struct device_node* 
 	}
 }
 
-static long __pmac
+static long
 heathrow_ide_reset(struct device_node* node, long param, long value)
 {
 	switch(param) {
@@ -441,7 +441,7 @@ heathrow_ide_reset(struct device_node* n
 	}
 }
 
-static long __pmac
+static long
 heathrow_bmac_enable(struct device_node* node, long param, long value)
 {
 	struct macio_chip*	macio;
@@ -470,7 +470,7 @@ heathrow_bmac_enable(struct device_node*
 	return 0;
 }
 
-static long __pmac
+static long
 heathrow_sound_enable(struct device_node* node, long param, long value)
 {
 	struct macio_chip*	macio;
@@ -501,16 +501,16 @@ heathrow_sound_enable(struct device_node
 	return 0;
 }
 
-static u32 save_fcr[6] __pmacdata;
-static u32 save_mbcr __pmacdata;
-static u32 save_gpio_levels[2] __pmacdata;
-static u8 save_gpio_extint[KEYLARGO_GPIO_EXTINT_CNT] __pmacdata;
-static u8 save_gpio_normal[KEYLARGO_GPIO_CNT] __pmacdata;
-static u32 save_unin_clock_ctl __pmacdata;
-static struct dbdma_regs save_dbdma[13] __pmacdata;
-static struct dbdma_regs save_alt_dbdma[13] __pmacdata;
+static u32 save_fcr[6];
+static u32 save_mbcr;
+static u32 save_gpio_levels[2];
+static u8 save_gpio_extint[KEYLARGO_GPIO_EXTINT_CNT];
+static u8 save_gpio_normal[KEYLARGO_GPIO_CNT];
+static u32 save_unin_clock_ctl;
+static struct dbdma_regs save_dbdma[13];
+static struct dbdma_regs save_alt_dbdma[13];
 
-static void __pmac
+static void
 dbdma_save(struct macio_chip* macio, struct dbdma_regs* save)
 {
 	int i;
@@ -527,7 +527,7 @@ dbdma_save(struct macio_chip* macio, str
 	}
 }
 
-static void __pmac
+static void
 dbdma_restore(struct macio_chip* macio, struct dbdma_regs* save)
 {
 	int i;
@@ -547,7 +547,7 @@ dbdma_restore(struct macio_chip* macio, 
 	}
 }
 
-static void __pmac
+static void
 heathrow_sleep(struct macio_chip* macio, int secondary)
 {
 	if (secondary) {
@@ -580,7 +580,7 @@ heathrow_sleep(struct macio_chip* macio,
 	(void)MACIO_IN32(HEATHROW_FCR);
 }
 
-static void __pmac
+static void
 heathrow_wakeup(struct macio_chip* macio, int secondary)
 {
 	if (secondary) {
@@ -605,7 +605,7 @@ heathrow_wakeup(struct macio_chip* macio
 	}
 }
 
-static long __pmac
+static long
 heathrow_sleep_state(struct device_node* node, long param, long value)
 {
 	if ((pmac_mb.board_flags & PMAC_MB_CAN_SLEEP) == 0)
@@ -622,7 +622,7 @@ heathrow_sleep_state(struct device_node*
 	return 0;
 }
 
-static long __pmac
+static long
 core99_scc_enable(struct device_node* node, long param, long value)
 {
 	struct macio_chip*	macio;
@@ -723,7 +723,7 @@ core99_scc_enable(struct device_node* no
 	return 0;
 }
 
-static long __pmac
+static long
 core99_modem_enable(struct device_node* node, long param, long value)
 {
 	struct macio_chip*	macio;
@@ -775,7 +775,7 @@ core99_modem_enable(struct device_node* 
 	return 0;
 }
 
-static long __pmac
+static long
 pangea_modem_enable(struct device_node* node, long param, long value)
 {
 	struct macio_chip*	macio;
@@ -830,7 +830,7 @@ pangea_modem_enable(struct device_node* 
 	return 0;
 }
 
-static long __pmac
+static long
 core99_ata100_enable(struct device_node* node, long value)
 {
 	unsigned long flags;
@@ -860,7 +860,7 @@ core99_ata100_enable(struct device_node*
     	return 0;
 }
 
-static long __pmac
+static long
 core99_ide_enable(struct device_node* node, long param, long value)
 {
 	/* Bus ID 0 to 2 are KeyLargo based IDE, busID 3 is U2
@@ -883,7 +883,7 @@ core99_ide_enable(struct device_node* no
 	}
 }
 
-static long __pmac
+static long
 core99_ide_reset(struct device_node* node, long param, long value)
 {
 	switch(param) {
@@ -901,7 +901,7 @@ core99_ide_reset(struct device_node* nod
 	}
 }
 
-static long __pmac
+static long
 core99_gmac_enable(struct device_node* node, long param, long value)
 {
 	unsigned long flags;
@@ -918,7 +918,7 @@ core99_gmac_enable(struct device_node* n
 	return 0;
 }
 
-static long __pmac
+static long
 core99_gmac_phy_reset(struct device_node* node, long param, long value)
 {
 	unsigned long flags;
@@ -943,7 +943,7 @@ core99_gmac_phy_reset(struct device_node
 	return 0;
 }
 
-static long __pmac
+static long
 core99_sound_chip_enable(struct device_node* node, long param, long value)
 {
 	struct macio_chip*	macio;
@@ -973,7 +973,7 @@ core99_sound_chip_enable(struct device_n
 	return 0;
 }
 
-static long __pmac
+static long
 core99_airport_enable(struct device_node* node, long param, long value)
 {
 	struct macio_chip*	macio;
@@ -1060,7 +1060,7 @@ core99_airport_enable(struct device_node
 }
 
 #ifdef CONFIG_SMP
-static long __pmac
+static long
 core99_reset_cpu(struct device_node* node, long param, long value)
 {
 	unsigned int reset_io = 0;
@@ -1104,7 +1104,7 @@ core99_reset_cpu(struct device_node* nod
 }
 #endif /* CONFIG_SMP */
 
-static long __pmac
+static long
 core99_usb_enable(struct device_node* node, long param, long value)
 {
 	struct macio_chip* macio;
@@ -1257,7 +1257,7 @@ core99_usb_enable(struct device_node* no
 	return 0;
 }
 
-static long __pmac
+static long
 core99_firewire_enable(struct device_node* node, long param, long value)
 {
 	unsigned long flags;
@@ -1284,7 +1284,7 @@ core99_firewire_enable(struct device_nod
 	return 0;
 }
 
-static long __pmac
+static long
 core99_firewire_cable_power(struct device_node* node, long param, long value)
 {
 	unsigned long flags;
@@ -1315,7 +1315,7 @@ core99_firewire_cable_power(struct devic
 	return 0;
 }
 
-static long __pmac
+static long
 intrepid_aack_delay_enable(struct device_node* node, long param, long value)
 {
 	unsigned long flags;
@@ -1336,7 +1336,7 @@ intrepid_aack_delay_enable(struct device
 
 #endif /* CONFIG_POWER4 */
 
-static long __pmac
+static long
 core99_read_gpio(struct device_node* node, long param, long value)
 {
 	struct macio_chip* macio = &macio_chips[0];
@@ -1345,7 +1345,7 @@ core99_read_gpio(struct device_node* nod
 }
 
 
-static long __pmac
+static long
 core99_write_gpio(struct device_node* node, long param, long value)
 {
 	struct macio_chip* macio = &macio_chips[0];
@@ -1356,7 +1356,7 @@ core99_write_gpio(struct device_node* no
 
 #ifdef CONFIG_POWER4
 
-static long __pmac
+static long
 g5_gmac_enable(struct device_node* node, long param, long value)
 {
 	struct macio_chip* macio = &macio_chips[0];
@@ -1380,7 +1380,7 @@ g5_gmac_enable(struct device_node* node,
 	return 0;
 }
 
-static long __pmac
+static long
 g5_fw_enable(struct device_node* node, long param, long value)
 {
 	struct macio_chip* macio = &macio_chips[0];
@@ -1403,7 +1403,7 @@ g5_fw_enable(struct device_node* node, l
 	return 0;
 }
 
-static long __pmac
+static long
 g5_mpic_enable(struct device_node* node, long param, long value)
 {
 	unsigned long flags;
@@ -1419,7 +1419,7 @@ g5_mpic_enable(struct device_node* node,
 }
 
 #ifdef CONFIG_SMP
-static long __pmac
+static long
 g5_reset_cpu(struct device_node* node, long param, long value)
 {
 	unsigned int reset_io = 0;
@@ -1465,7 +1465,7 @@ g5_reset_cpu(struct device_node* node, l
  * This takes the second CPU off the bus on dual CPU machines
  * running UP
  */
-void __pmac g5_phy_disable_cpu1(void)
+void g5_phy_disable_cpu1(void)
 {
 	UN_OUT(U3_API_PHY_CONFIG_1, 0);
 }
@@ -1474,7 +1474,7 @@ void __pmac g5_phy_disable_cpu1(void)
 
 #ifndef CONFIG_POWER4
 
-static void __pmac
+static void
 keylargo_shutdown(struct macio_chip* macio, int sleep_mode)
 {
 	u32 temp;
@@ -1528,7 +1528,7 @@ keylargo_shutdown(struct macio_chip* mac
 	(void)MACIO_IN32(KEYLARGO_FCR0); mdelay(1);
 }
 
-static void __pmac
+static void
 pangea_shutdown(struct macio_chip* macio, int sleep_mode)
 {
 	u32 temp;
@@ -1562,7 +1562,7 @@ pangea_shutdown(struct macio_chip* macio
 	(void)MACIO_IN32(KEYLARGO_FCR0); mdelay(1);
 }
 
-static void __pmac
+static void
 intrepid_shutdown(struct macio_chip* macio, int sleep_mode)
 {
 	u32 temp;
@@ -1591,7 +1591,7 @@ intrepid_shutdown(struct macio_chip* mac
 }
 
 
-void __pmac pmac_tweak_clock_spreading(int enable)
+void pmac_tweak_clock_spreading(int enable)
 {
 	struct macio_chip* macio = &macio_chips[0];
 
@@ -1698,7 +1698,7 @@ void __pmac pmac_tweak_clock_spreading(i
 }
 
 
-static int __pmac
+static int
 core99_sleep(void)
 {
 	struct macio_chip* macio;
@@ -1791,7 +1791,7 @@ core99_sleep(void)
 	return 0;
 }
 
-static int __pmac
+static int
 core99_wake_up(void)
 {
 	struct macio_chip* macio;
@@ -1854,7 +1854,7 @@ core99_wake_up(void)
 	return 0;
 }
 
-static long __pmac
+static long
 core99_sleep_state(struct device_node* node, long param, long value)
 {
 	/* Param == 1 means to enter the "fake sleep" mode that is
@@ -1884,7 +1884,7 @@ core99_sleep_state(struct device_node* n
 
 #endif /* CONFIG_POWER4 */
 
-static long __pmac
+static long
 generic_dev_can_wake(struct device_node* node, long param, long value)
 {
 	/* Todo: eventually check we are really dealing with on-board
@@ -1896,7 +1896,7 @@ generic_dev_can_wake(struct device_node*
 	return 0;
 }
 
-static long __pmac
+static long
 generic_get_mb_info(struct device_node* node, long param, long value)
 {
 	switch(param) {
@@ -1919,7 +1919,7 @@ generic_get_mb_info(struct device_node* 
 
 /* Used on any machine
  */
-static struct feature_table_entry any_features[]  __pmacdata = {
+static struct feature_table_entry any_features[] = {
 	{ PMAC_FTR_GET_MB_INFO,		generic_get_mb_info },
 	{ PMAC_FTR_DEVICE_CAN_WAKE,	generic_dev_can_wake },
 	{ 0, NULL }
@@ -1931,7 +1931,7 @@ static struct feature_table_entry any_fe
  * 2400,3400 and 3500 series powerbooks. Some older desktops seem
  * to have issues with turning on/off those asic cells
  */
-static struct feature_table_entry ohare_features[]  __pmacdata = {
+static struct feature_table_entry ohare_features[] = {
 	{ PMAC_FTR_SCC_ENABLE,		ohare_htw_scc_enable },
 	{ PMAC_FTR_SWIM3_ENABLE,	ohare_floppy_enable },
 	{ PMAC_FTR_MESH_ENABLE,		ohare_mesh_enable },
@@ -1945,7 +1945,7 @@ static struct feature_table_entry ohare_
  * Separated as some features couldn't be properly tested
  * and the serial port control bits appear to confuse it.
  */
-static struct feature_table_entry heathrow_desktop_features[]  __pmacdata = {
+static struct feature_table_entry heathrow_desktop_features[] = {
 	{ PMAC_FTR_SWIM3_ENABLE,	heathrow_floppy_enable },
 	{ PMAC_FTR_MESH_ENABLE,		heathrow_mesh_enable },
 	{ PMAC_FTR_IDE_ENABLE,		heathrow_ide_enable },
@@ -1957,7 +1957,7 @@ static struct feature_table_entry heathr
 /* Heathrow based laptop, that is the Wallstreet and mainstreet
  * powerbooks.
  */
-static struct feature_table_entry heathrow_laptop_features[]  __pmacdata = {
+static struct feature_table_entry heathrow_laptop_features[] = {
 	{ PMAC_FTR_SCC_ENABLE,		ohare_htw_scc_enable },
 	{ PMAC_FTR_MODEM_ENABLE,	heathrow_modem_enable },
 	{ PMAC_FTR_SWIM3_ENABLE,	heathrow_floppy_enable },
@@ -1973,7 +1973,7 @@ static struct feature_table_entry heathr
 /* Paddington based machines
  * The lombard (101) powerbook, first iMac models, B&W G3 and Yikes G4.
  */
-static struct feature_table_entry paddington_features[]  __pmacdata = {
+static struct feature_table_entry paddington_features[] = {
 	{ PMAC_FTR_SCC_ENABLE,		ohare_htw_scc_enable },
 	{ PMAC_FTR_MODEM_ENABLE,	heathrow_modem_enable },
 	{ PMAC_FTR_SWIM3_ENABLE,	heathrow_floppy_enable },
@@ -1991,7 +1991,7 @@ static struct feature_table_entry paddin
  * chipset. The pangea chipset is the "combo" UniNorth/KeyLargo
  * used on iBook2 & iMac "flow power".
  */
-static struct feature_table_entry core99_features[]  __pmacdata = {
+static struct feature_table_entry core99_features[] = {
 	{ PMAC_FTR_SCC_ENABLE,		core99_scc_enable },
 	{ PMAC_FTR_MODEM_ENABLE,	core99_modem_enable },
 	{ PMAC_FTR_IDE_ENABLE,		core99_ide_enable },
@@ -2014,7 +2014,7 @@ static struct feature_table_entry core99
 
 /* RackMac
  */
-static struct feature_table_entry rackmac_features[]  __pmacdata = {
+static struct feature_table_entry rackmac_features[] = {
 	{ PMAC_FTR_SCC_ENABLE,		core99_scc_enable },
 	{ PMAC_FTR_IDE_ENABLE,		core99_ide_enable },
 	{ PMAC_FTR_IDE_RESET,		core99_ide_reset },
@@ -2034,7 +2034,7 @@ static struct feature_table_entry rackma
 
 /* Pangea features
  */
-static struct feature_table_entry pangea_features[]  __pmacdata = {
+static struct feature_table_entry pangea_features[] = {
 	{ PMAC_FTR_SCC_ENABLE,		core99_scc_enable },
 	{ PMAC_FTR_MODEM_ENABLE,	pangea_modem_enable },
 	{ PMAC_FTR_IDE_ENABLE,		core99_ide_enable },
@@ -2054,7 +2054,7 @@ static struct feature_table_entry pangea
 
 /* Intrepid features
  */
-static struct feature_table_entry intrepid_features[]  __pmacdata = {
+static struct feature_table_entry intrepid_features[] = {
 	{ PMAC_FTR_SCC_ENABLE,		core99_scc_enable },
 	{ PMAC_FTR_MODEM_ENABLE,	pangea_modem_enable },
 	{ PMAC_FTR_IDE_ENABLE,		core99_ide_enable },
@@ -2077,7 +2077,7 @@ static struct feature_table_entry intrep
 
 /* G5 features
  */
-static struct feature_table_entry g5_features[]  __pmacdata = {
+static struct feature_table_entry g5_features[] = {
 	{ PMAC_FTR_GMAC_ENABLE,		g5_gmac_enable },
 	{ PMAC_FTR_1394_ENABLE,		g5_fw_enable },
 	{ PMAC_FTR_ENABLE_MPIC,		g5_mpic_enable },
@@ -2091,7 +2091,7 @@ static struct feature_table_entry g5_fea
 
 #endif /* CONFIG_POWER4 */
 
-static struct pmac_mb_def pmac_mb_defs[] __pmacdata = {
+static struct pmac_mb_def pmac_mb_defs[] = {
 #ifndef CONFIG_POWER4
 	/*
 	 * Desktops
@@ -2352,7 +2352,7 @@ static struct pmac_mb_def pmac_mb_defs[]
 /*
  * The toplevel feature_call callback
  */
-long __pmac
+long
 pmac_do_feature_call(unsigned int selector, ...)
 {
 	struct device_node* node;
@@ -2935,8 +2935,8 @@ void __init pmac_check_ht_link(void)
  * Early video resume hook
  */
 
-static void (*pmac_early_vresume_proc)(void *data) __pmacdata;
-static void *pmac_early_vresume_data __pmacdata;
+static void (*pmac_early_vresume_proc)(void *data);
+static void *pmac_early_vresume_data;
 
 void pmac_set_early_video_resume(void (*proc)(void *data), void *data)
 {
@@ -2949,7 +2949,7 @@ void pmac_set_early_video_resume(void (*
 }
 EXPORT_SYMBOL(pmac_set_early_video_resume);
 
-void __pmac pmac_call_early_video_resume(void)
+void pmac_call_early_video_resume(void)
 {
 	if (pmac_early_vresume_proc)
 		pmac_early_vresume_proc(pmac_early_vresume_data);
@@ -2959,11 +2959,11 @@ void __pmac pmac_call_early_video_resume
  * AGP related suspend/resume code
  */
 
-static struct pci_dev *pmac_agp_bridge __pmacdata;
-static int (*pmac_agp_suspend)(struct pci_dev *bridge) __pmacdata;
-static int (*pmac_agp_resume)(struct pci_dev *bridge) __pmacdata;
+static struct pci_dev *pmac_agp_bridge;
+static int (*pmac_agp_suspend)(struct pci_dev *bridge);
+static int (*pmac_agp_resume)(struct pci_dev *bridge);
 
-void __pmac pmac_register_agp_pm(struct pci_dev *bridge,
+void pmac_register_agp_pm(struct pci_dev *bridge,
 				 int (*suspend)(struct pci_dev *bridge),
 				 int (*resume)(struct pci_dev *bridge))
 {
@@ -2980,7 +2980,7 @@ void __pmac pmac_register_agp_pm(struct 
 }
 EXPORT_SYMBOL(pmac_register_agp_pm);
 
-void __pmac pmac_suspend_agp_for_card(struct pci_dev *dev)
+void pmac_suspend_agp_for_card(struct pci_dev *dev)
 {
 	if (pmac_agp_bridge == NULL || pmac_agp_suspend == NULL)
 		return;
@@ -2990,7 +2990,7 @@ void __pmac pmac_suspend_agp_for_card(st
 }
 EXPORT_SYMBOL(pmac_suspend_agp_for_card);
 
-void __pmac pmac_resume_agp_for_card(struct pci_dev *dev)
+void pmac_resume_agp_for_card(struct pci_dev *dev)
 {
 	if (pmac_agp_bridge == NULL || pmac_agp_resume == NULL)
 		return;
diff --git a/arch/ppc/platforms/pmac_nvram.c b/arch/ppc/platforms/pmac_nvram.c
--- a/arch/ppc/platforms/pmac_nvram.c
+++ b/arch/ppc/platforms/pmac_nvram.c
@@ -88,17 +88,17 @@ extern int system_running;
 static int (*core99_write_bank)(int bank, u8* datas);
 static int (*core99_erase_bank)(int bank);
 
-static char *nvram_image __pmacdata;
+static char *nvram_image;
 
 
-static unsigned char __pmac core99_nvram_read_byte(int addr)
+static unsigned char core99_nvram_read_byte(int addr)
 {
 	if (nvram_image == NULL)
 		return 0xff;
 	return nvram_image[addr];
 }
 
-static void __pmac core99_nvram_write_byte(int addr, unsigned char val)
+static void core99_nvram_write_byte(int addr, unsigned char val)
 {
 	if (nvram_image == NULL)
 		return;
@@ -106,18 +106,18 @@ static void __pmac core99_nvram_write_by
 }
 
 
-static unsigned char __openfirmware direct_nvram_read_byte(int addr)
+static unsigned char direct_nvram_read_byte(int addr)
 {
 	return in_8(&nvram_data[(addr & (NVRAM_SIZE - 1)) * nvram_mult]);
 }
 
-static void __openfirmware direct_nvram_write_byte(int addr, unsigned char val)
+static void direct_nvram_write_byte(int addr, unsigned char val)
 {
 	out_8(&nvram_data[(addr & (NVRAM_SIZE - 1)) * nvram_mult], val);
 }
 
 
-static unsigned char __pmac indirect_nvram_read_byte(int addr)
+static unsigned char indirect_nvram_read_byte(int addr)
 {
 	unsigned char val;
 	unsigned long flags;
@@ -130,7 +130,7 @@ static unsigned char __pmac indirect_nvr
 	return val;
 }
 
-static void __pmac indirect_nvram_write_byte(int addr, unsigned char val)
+static void indirect_nvram_write_byte(int addr, unsigned char val)
 {
 	unsigned long flags;
 
@@ -143,13 +143,13 @@ static void __pmac indirect_nvram_write_
 
 #ifdef CONFIG_ADB_PMU
 
-static void __pmac pmu_nvram_complete(struct adb_request *req)
+static void pmu_nvram_complete(struct adb_request *req)
 {
 	if (req->arg)
 		complete((struct completion *)req->arg);
 }
 
-static unsigned char __pmac pmu_nvram_read_byte(int addr)
+static unsigned char pmu_nvram_read_byte(int addr)
 {
 	struct adb_request req;
 	DECLARE_COMPLETION(req_complete); 
@@ -165,7 +165,7 @@ static unsigned char __pmac pmu_nvram_re
 	return req.reply[0];
 }
 
-static void __pmac pmu_nvram_write_byte(int addr, unsigned char val)
+static void pmu_nvram_write_byte(int addr, unsigned char val)
 {
 	struct adb_request req;
 	DECLARE_COMPLETION(req_complete); 
@@ -183,7 +183,7 @@ static void __pmac pmu_nvram_write_byte(
 #endif /* CONFIG_ADB_PMU */
 
 
-static u8 __pmac chrp_checksum(struct chrp_header* hdr)
+static u8 chrp_checksum(struct chrp_header* hdr)
 {
 	u8 *ptr;
 	u16 sum = hdr->signature;
@@ -194,7 +194,7 @@ static u8 __pmac chrp_checksum(struct ch
 	return sum;
 }
 
-static u32 __pmac core99_calc_adler(u8 *buffer)
+static u32 core99_calc_adler(u8 *buffer)
 {
 	int cnt;
 	u32 low, high;
@@ -216,7 +216,7 @@ static u32 __pmac core99_calc_adler(u8 *
 	return (high << 16) | low;
 }
 
-static u32 __pmac core99_check(u8* datas)
+static u32 core99_check(u8* datas)
 {
 	struct core99_header* hdr99 = (struct core99_header*)datas;
 
@@ -235,7 +235,7 @@ static u32 __pmac core99_check(u8* datas
 	return hdr99->generation;
 }
 
-static int __pmac sm_erase_bank(int bank)
+static int sm_erase_bank(int bank)
 {
 	int stat, i;
 	unsigned long timeout;
@@ -267,7 +267,7 @@ static int __pmac sm_erase_bank(int bank
 	return 0;
 }
 
-static int __pmac sm_write_bank(int bank, u8* datas)
+static int sm_write_bank(int bank, u8* datas)
 {
 	int i, stat = 0;
 	unsigned long timeout;
@@ -302,7 +302,7 @@ static int __pmac sm_write_bank(int bank
 	return 0;
 }
 
-static int __pmac amd_erase_bank(int bank)
+static int amd_erase_bank(int bank)
 {
 	int i, stat = 0;
 	unsigned long timeout;
@@ -349,7 +349,7 @@ static int __pmac amd_erase_bank(int ban
 	return 0;
 }
 
-static int __pmac amd_write_bank(int bank, u8* datas)
+static int amd_write_bank(int bank, u8* datas)
 {
 	int i, stat = 0;
 	unsigned long timeout;
@@ -430,7 +430,7 @@ static void __init lookup_partitions(voi
 	DBG("nvram: NR partition at 0x%x\n", nvram_partitions[pmac_nvram_NR]);
 }
 
-static void __pmac core99_nvram_sync(void)
+static void core99_nvram_sync(void)
 {
 	struct core99_header* hdr99;
 	unsigned long flags;
@@ -554,12 +554,12 @@ void __init pmac_nvram_init(void)
 	lookup_partitions();
 }
 
-int __pmac pmac_get_partition(int partition)
+int pmac_get_partition(int partition)
 {
 	return nvram_partitions[partition];
 }
 
-u8 __pmac pmac_xpram_read(int xpaddr)
+u8 pmac_xpram_read(int xpaddr)
 {
 	int offset = nvram_partitions[pmac_nvram_XPRAM];
 
@@ -569,7 +569,7 @@ u8 __pmac pmac_xpram_read(int xpaddr)
 	return ppc_md.nvram_read_val(xpaddr + offset);
 }
 
-void __pmac pmac_xpram_write(int xpaddr, u8 data)
+void pmac_xpram_write(int xpaddr, u8 data)
 {
 	int offset = nvram_partitions[pmac_nvram_XPRAM];
 
diff --git a/arch/ppc/platforms/pmac_pci.c b/arch/ppc/platforms/pmac_pci.c
--- a/arch/ppc/platforms/pmac_pci.c
+++ b/arch/ppc/platforms/pmac_pci.c
@@ -141,7 +141,7 @@ fixup_bus_range(struct device_node *brid
 	|(((unsigned long)(off)) & 0xFCUL) \
 	|1UL)
 
-static void volatile __iomem * __pmac
+static void volatile __iomem *
 macrisc_cfg_access(struct pci_controller* hose, u8 bus, u8 dev_fn, u8 offset)
 {
 	unsigned int caddr;
@@ -162,7 +162,7 @@ macrisc_cfg_access(struct pci_controller
 	return hose->cfg_data + offset;
 }
 
-static int __pmac
+static int
 macrisc_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
 		    int len, u32 *val)
 {
@@ -190,7 +190,7 @@ macrisc_read_config(struct pci_bus *bus,
 	return PCIBIOS_SUCCESSFUL;
 }
 
-static int __pmac
+static int
 macrisc_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
 		     int len, u32 val)
 {
@@ -230,7 +230,7 @@ static struct pci_ops macrisc_pci_ops =
 /*
  * Verifiy that a specific (bus, dev_fn) exists on chaos
  */
-static int __pmac
+static int
 chaos_validate_dev(struct pci_bus *bus, int devfn, int offset)
 {
 	struct device_node *np;
@@ -252,7 +252,7 @@ chaos_validate_dev(struct pci_bus *bus, 
 	return PCIBIOS_SUCCESSFUL;
 }
 
-static int __pmac
+static int
 chaos_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
 		  int len, u32 *val)
 {
@@ -264,7 +264,7 @@ chaos_read_config(struct pci_bus *bus, u
 	return macrisc_read_config(bus, devfn, offset, len, val);
 }
 
-static int __pmac
+static int
 chaos_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
 		   int len, u32 val)
 {
@@ -294,7 +294,7 @@ static struct pci_ops chaos_pci_ops =
 		+ (((unsigned long)bus) << 16) \
 		+ 0x01000000UL)
 
-static void volatile __iomem * __pmac
+static void volatile __iomem *
 u3_ht_cfg_access(struct pci_controller* hose, u8 bus, u8 devfn, u8 offset)
 {
 	if (bus == hose->first_busno) {
@@ -307,7 +307,7 @@ u3_ht_cfg_access(struct pci_controller* 
 		return hose->cfg_data + U3_HT_CFA1(bus, devfn, offset);
 }
 
-static int __pmac
+static int
 u3_ht_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
 		    int len, u32 *val)
 {
@@ -357,7 +357,7 @@ u3_ht_read_config(struct pci_bus *bus, u
 	return PCIBIOS_SUCCESSFUL;
 }
 
-static int __pmac
+static int
 u3_ht_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
 		     int len, u32 val)
 {
@@ -899,7 +899,7 @@ pmac_pcibios_fixup(void)
 	pcibios_fixup_OF_interrupts();
 }
 
-int __pmac
+int
 pmac_pci_enable_device_hook(struct pci_dev *dev, int initial)
 {
 	struct device_node* node;
@@ -1096,7 +1096,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_
  * Disable second function on K2-SATA, it's broken
  * and disable IO BARs on first one
  */
-void __pmac pmac_pci_fixup_k2_sata(struct pci_dev* dev)
+void pmac_pci_fixup_k2_sata(struct pci_dev* dev)
 {
 	int i;
 	u16 cmd;
diff --git a/arch/ppc/platforms/pmac_pic.c b/arch/ppc/platforms/pmac_pic.c
--- a/arch/ppc/platforms/pmac_pic.c
+++ b/arch/ppc/platforms/pmac_pic.c
@@ -53,7 +53,7 @@ struct pmac_irq_hw {
 };
 
 /* Default addresses */
-static volatile struct pmac_irq_hw *pmac_irq_hw[4] __pmacdata = {
+static volatile struct pmac_irq_hw *pmac_irq_hw[4] = {
         (struct pmac_irq_hw *) 0xf3000020,
         (struct pmac_irq_hw *) 0xf3000010,
         (struct pmac_irq_hw *) 0xf4000020,
@@ -64,22 +64,22 @@ static volatile struct pmac_irq_hw *pmac
 #define OHARE_LEVEL_MASK	0x1ff00000
 #define HEATHROW_LEVEL_MASK	0x1ff00000
 
-static int max_irqs __pmacdata;
-static int max_real_irqs __pmacdata;
-static u32 level_mask[4] __pmacdata;
+static int max_irqs;
+static int max_real_irqs;
+static u32 level_mask[4];
 
-static DEFINE_SPINLOCK(pmac_pic_lock __pmacdata);
+static DEFINE_SPINLOCK(pmac_pic_lock);
 
 
 #define GATWICK_IRQ_POOL_SIZE        10
-static struct interrupt_info gatwick_int_pool[GATWICK_IRQ_POOL_SIZE] __pmacdata;
+static struct interrupt_info gatwick_int_pool[GATWICK_IRQ_POOL_SIZE];
 
 /*
  * Mark an irq as "lost".  This is only used on the pmac
  * since it can lose interrupts (see pmac_set_irq_mask).
  * -- Cort
  */
-void __pmac
+void
 __set_lost(unsigned long irq_nr, int nokick)
 {
 	if (!test_and_set_bit(irq_nr, ppc_lost_interrupts)) {
@@ -89,7 +89,7 @@ __set_lost(unsigned long irq_nr, int nok
 	}
 }
 
-static void __pmac
+static void
 pmac_mask_and_ack_irq(unsigned int irq_nr)
 {
         unsigned long bit = 1UL << (irq_nr & 0x1f);
@@ -114,7 +114,7 @@ pmac_mask_and_ack_irq(unsigned int irq_n
 	spin_unlock_irqrestore(&pmac_pic_lock, flags);
 }
 
-static void __pmac pmac_set_irq_mask(unsigned int irq_nr, int nokicklost)
+static void pmac_set_irq_mask(unsigned int irq_nr, int nokicklost)
 {
         unsigned long bit = 1UL << (irq_nr & 0x1f);
         int i = irq_nr >> 5;
@@ -147,7 +147,7 @@ static void __pmac pmac_set_irq_mask(uns
 /* When an irq gets requested for the first client, if it's an
  * edge interrupt, we clear any previous one on the controller
  */
-static unsigned int __pmac pmac_startup_irq(unsigned int irq_nr)
+static unsigned int pmac_startup_irq(unsigned int irq_nr)
 {
         unsigned long bit = 1UL << (irq_nr & 0x1f);
         int i = irq_nr >> 5;
@@ -160,20 +160,20 @@ static unsigned int __pmac pmac_startup_
 	return 0;
 }
 
-static void __pmac pmac_mask_irq(unsigned int irq_nr)
+static void pmac_mask_irq(unsigned int irq_nr)
 {
         clear_bit(irq_nr, ppc_cached_irq_mask);
         pmac_set_irq_mask(irq_nr, 0);
         mb();
 }
 
-static void __pmac pmac_unmask_irq(unsigned int irq_nr)
+static void pmac_unmask_irq(unsigned int irq_nr)
 {
         set_bit(irq_nr, ppc_cached_irq_mask);
         pmac_set_irq_mask(irq_nr, 0);
 }
 
-static void __pmac pmac_end_irq(unsigned int irq_nr)
+static void pmac_end_irq(unsigned int irq_nr)
 {
 	if (!(irq_desc[irq_nr].status & (IRQ_DISABLED|IRQ_INPROGRESS))
 	    && irq_desc[irq_nr].action) {
diff --git a/arch/ppc/platforms/pmac_setup.c b/arch/ppc/platforms/pmac_setup.c
--- a/arch/ppc/platforms/pmac_setup.c
+++ b/arch/ppc/platforms/pmac_setup.c
@@ -123,7 +123,7 @@ extern struct smp_ops_t psurge_smp_ops;
 extern struct smp_ops_t core99_smp_ops;
 #endif /* CONFIG_SMP */
 
-static int __pmac
+static int
 pmac_show_cpuinfo(struct seq_file *m)
 {
 	struct device_node *np;
@@ -227,7 +227,7 @@ pmac_show_cpuinfo(struct seq_file *m)
 	return 0;
 }
 
-static int __openfirmware
+static int
 pmac_show_percpuinfo(struct seq_file *m, int i)
 {
 #ifdef CONFIG_CPU_FREQ_PMAC
@@ -486,7 +486,7 @@ static int pmac_late_init(void)
 late_initcall(pmac_late_init);
 
 /* can't be __init - can be called whenever a disk is first accessed */
-void __pmac
+void
 note_bootable_part(dev_t dev, int part, int goodness)
 {
 	static int found_boot = 0;
@@ -512,7 +512,7 @@ note_bootable_part(dev_t dev, int part, 
 	}
 }
 
-static void __pmac
+static void
 pmac_restart(char *cmd)
 {
 #ifdef CONFIG_ADB_CUDA
@@ -537,7 +537,7 @@ pmac_restart(char *cmd)
 	}
 }
 
-static void __pmac
+static void
 pmac_power_off(void)
 {
 #ifdef CONFIG_ADB_CUDA
@@ -562,7 +562,7 @@ pmac_power_off(void)
 	}
 }
 
-static void __pmac
+static void
 pmac_halt(void)
 {
    pmac_power_off();
diff --git a/arch/ppc/platforms/pmac_smp.c b/arch/ppc/platforms/pmac_smp.c
--- a/arch/ppc/platforms/pmac_smp.c
+++ b/arch/ppc/platforms/pmac_smp.c
@@ -186,7 +186,7 @@ static inline void psurge_clr_ipi(int cp
  */
 static unsigned long psurge_smp_message[NR_CPUS];
 
-void __pmac psurge_smp_message_recv(struct pt_regs *regs)
+void psurge_smp_message_recv(struct pt_regs *regs)
 {
 	int cpu = smp_processor_id();
 	int msg;
@@ -203,13 +203,13 @@ void __pmac psurge_smp_message_recv(stru
 			smp_message_recv(msg, regs);
 }
 
-irqreturn_t __pmac psurge_primary_intr(int irq, void *d, struct pt_regs *regs)
+irqreturn_t psurge_primary_intr(int irq, void *d, struct pt_regs *regs)
 {
 	psurge_smp_message_recv(regs);
 	return IRQ_HANDLED;
 }
 
-static void __pmac smp_psurge_message_pass(int target, int msg, unsigned long data,
+static void smp_psurge_message_pass(int target, int msg, unsigned long data,
 					   int wait)
 {
 	int i;
@@ -629,7 +629,7 @@ void smp_core99_give_timebase(void)
 
 
 /* PowerSurge-style Macs */
-struct smp_ops_t psurge_smp_ops __pmacdata = {
+struct smp_ops_t psurge_smp_ops = {
 	.message_pass	= smp_psurge_message_pass,
 	.probe		= smp_psurge_probe,
 	.kick_cpu	= smp_psurge_kick_cpu,
@@ -639,7 +639,7 @@ struct smp_ops_t psurge_smp_ops __pmacda
 };
 
 /* Core99 Macs (dual G4s) */
-struct smp_ops_t core99_smp_ops __pmacdata = {
+struct smp_ops_t core99_smp_ops = {
 	.message_pass	= smp_openpic_message_pass,
 	.probe		= smp_core99_probe,
 	.kick_cpu	= smp_core99_kick_cpu,
diff --git a/arch/ppc/platforms/pmac_time.c b/arch/ppc/platforms/pmac_time.c
--- a/arch/ppc/platforms/pmac_time.c
+++ b/arch/ppc/platforms/pmac_time.c
@@ -77,7 +77,7 @@ pmac_time_init(void)
 #endif
 }
 
-unsigned long __pmac
+unsigned long
 pmac_get_rtc_time(void)
 {
 #if defined(CONFIG_ADB_CUDA) || defined(CONFIG_ADB_PMU)
@@ -118,7 +118,7 @@ pmac_get_rtc_time(void)
 	return 0;
 }
 
-int __pmac
+int
 pmac_set_rtc_time(unsigned long nowtime)
 {
 #if defined(CONFIG_ADB_CUDA) || defined(CONFIG_ADB_PMU)
@@ -210,7 +210,7 @@ via_calibrate_decr(void)
 /*
  * Reset the time after a sleep.
  */
-static int __pmac
+static int
 time_sleep_notify(struct pmu_sleep_notifier *self, int when)
 {
 	static unsigned long time_diff;
@@ -235,7 +235,7 @@ time_sleep_notify(struct pmu_sleep_notif
 	return PBOOK_SLEEP_OK;
 }
 
-static struct pmu_sleep_notifier time_sleep_notifier __pmacdata = {
+static struct pmu_sleep_notifier time_sleep_notifier = {
 	time_sleep_notify, SLEEP_LEVEL_MISC,
 };
 #endif /* CONFIG_PM */
diff --git a/arch/ppc/platforms/prep_pci.c b/arch/ppc/platforms/prep_pci.c
--- a/arch/ppc/platforms/prep_pci.c
+++ b/arch/ppc/platforms/prep_pci.c
@@ -43,7 +43,7 @@ static unsigned long	*ProcInfo;
 /* Tables for known hardware */
 
 /* Motorola PowerStackII - Utah */
-static char Utah_pci_IRQ_map[23] __prepdata =
+static char Utah_pci_IRQ_map[23] =
 {
         0,   /* Slot 0  - unused */
         0,   /* Slot 1  - unused */
@@ -72,7 +72,7 @@ static char Utah_pci_IRQ_map[23] __prepd
         0,   /* Slot 22 - unused */
 };
 
-static char Utah_pci_IRQ_routes[] __prepdata =
+static char Utah_pci_IRQ_routes[] =
 {
         0,   /* Line 0 - Unused */
         9,   /* Line 1 */
@@ -84,7 +84,7 @@ static char Utah_pci_IRQ_routes[] __prep
 
 /* Motorola PowerStackII - Omaha */
 /* no integrated SCSI or ethernet */
-static char Omaha_pci_IRQ_map[23] __prepdata =
+static char Omaha_pci_IRQ_map[23] =
 {
         0,   /* Slot 0  - unused */
         0,   /* Slot 1  - unused */
@@ -111,7 +111,7 @@ static char Omaha_pci_IRQ_map[23] __prep
         0,
 };
 
-static char Omaha_pci_IRQ_routes[] __prepdata =
+static char Omaha_pci_IRQ_routes[] =
 {
         0,   /* Line 0 - Unused */
         9,   /* Line 1 */
@@ -121,7 +121,7 @@ static char Omaha_pci_IRQ_routes[] __pre
 };
 
 /* Motorola PowerStack */
-static char Blackhawk_pci_IRQ_map[19] __prepdata =
+static char Blackhawk_pci_IRQ_map[19] =
 {
   	0,	/* Slot 0  - unused */
   	0,	/* Slot 1  - unused */
@@ -144,7 +144,7 @@ static char Blackhawk_pci_IRQ_map[19] __
  	3,	/* Slot P5 */
 };
 
-static char Blackhawk_pci_IRQ_routes[] __prepdata =
+static char Blackhawk_pci_IRQ_routes[] =
 {
    	0,	/* Line 0 - Unused */
    	9,	/* Line 1 */
@@ -154,7 +154,7 @@ static char Blackhawk_pci_IRQ_routes[] _
 };
 
 /* Motorola Mesquite */
-static char Mesquite_pci_IRQ_map[23] __prepdata =
+static char Mesquite_pci_IRQ_map[23] =
 {
 	0,	/* Slot 0  - unused */
 	0,	/* Slot 1  - unused */
@@ -182,7 +182,7 @@ static char Mesquite_pci_IRQ_map[23] __p
 };
 
 /* Motorola Sitka */
-static char Sitka_pci_IRQ_map[21] __prepdata =
+static char Sitka_pci_IRQ_map[21] =
 {
 	0,      /* Slot 0  - unused */
 	0,      /* Slot 1  - unused */
@@ -208,7 +208,7 @@ static char Sitka_pci_IRQ_map[21] __prep
 };
 
 /* Motorola MTX */
-static char MTX_pci_IRQ_map[23] __prepdata =
+static char MTX_pci_IRQ_map[23] =
 {
 	0,	/* Slot 0  - unused */
 	0,	/* Slot 1  - unused */
@@ -237,7 +237,7 @@ static char MTX_pci_IRQ_map[23] __prepda
 
 /* Motorola MTX Plus */
 /* Secondary bus interrupt routing is not supported yet */
-static char MTXplus_pci_IRQ_map[23] __prepdata =
+static char MTXplus_pci_IRQ_map[23] =
 {
         0,      /* Slot 0  - unused */
         0,      /* Slot 1  - unused */
@@ -264,13 +264,13 @@ static char MTXplus_pci_IRQ_map[23] __pr
         0,      /* Slot 22 - unused */
 };
 
-static char Raven_pci_IRQ_routes[] __prepdata =
+static char Raven_pci_IRQ_routes[] =
 {
    	0,	/* This is a dummy structure */
 };
 
 /* Motorola MVME16xx */
-static char Genesis_pci_IRQ_map[16] __prepdata =
+static char Genesis_pci_IRQ_map[16] =
 {
   	0,	/* Slot 0  - unused */
   	0,	/* Slot 1  - unused */
@@ -290,7 +290,7 @@ static char Genesis_pci_IRQ_map[16] __pr
   	0,	/* Slot 15 - unused */
 };
 
-static char Genesis_pci_IRQ_routes[] __prepdata =
+static char Genesis_pci_IRQ_routes[] =
 {
    	0,	/* Line 0 - Unused */
    	10,	/* Line 1 */
@@ -299,7 +299,7 @@ static char Genesis_pci_IRQ_routes[] __p
    	15	/* Line 4 */
 };
 
-static char Genesis2_pci_IRQ_map[23] __prepdata =
+static char Genesis2_pci_IRQ_map[23] =
 {
 	0,	/* Slot 0  - unused */
 	0,	/* Slot 1  - unused */
@@ -327,7 +327,7 @@ static char Genesis2_pci_IRQ_map[23] __p
 };
 
 /* Motorola Series-E */
-static char Comet_pci_IRQ_map[23] __prepdata =
+static char Comet_pci_IRQ_map[23] =
 {
   	0,	/* Slot 0  - unused */
   	0,	/* Slot 1  - unused */
@@ -354,7 +354,7 @@ static char Comet_pci_IRQ_map[23] __prep
 	0,
 };
 
-static char Comet_pci_IRQ_routes[] __prepdata =
+static char Comet_pci_IRQ_routes[] =
 {
    	0,	/* Line 0 - Unused */
    	10,	/* Line 1 */
@@ -364,7 +364,7 @@ static char Comet_pci_IRQ_routes[] __pre
 };
 
 /* Motorola Series-EX */
-static char Comet2_pci_IRQ_map[23] __prepdata =
+static char Comet2_pci_IRQ_map[23] =
 {
 	0,	/* Slot 0  - unused */
 	0,	/* Slot 1  - unused */
@@ -391,7 +391,7 @@ static char Comet2_pci_IRQ_map[23] __pre
 	0,
 };
 
-static char Comet2_pci_IRQ_routes[] __prepdata =
+static char Comet2_pci_IRQ_routes[] =
 {
 	0,	/* Line 0 - Unused */
 	10,	/* Line 1 */
@@ -405,7 +405,7 @@ static char Comet2_pci_IRQ_routes[] __pr
  * This is actually based on the Carolina motherboard
  * -- Cort
  */
-static char ibm8xx_pci_IRQ_map[23] __prepdata = {
+static char ibm8xx_pci_IRQ_map[23] = {
         0, /* Slot 0  - unused */
         0, /* Slot 1  - unused */
         0, /* Slot 2  - unused */
@@ -431,7 +431,7 @@ static char ibm8xx_pci_IRQ_map[23] __pre
         2, /* Slot 22 - PCI slot 1 PCIINTx# (See below) */
 };
 
-static char ibm8xx_pci_IRQ_routes[] __prepdata = {
+static char ibm8xx_pci_IRQ_routes[] = {
         0,      /* Line 0 - unused */
         15,     /* Line 1 */
         15,     /* Line 2 */
@@ -443,7 +443,7 @@ static char ibm8xx_pci_IRQ_routes[] __pr
  * a 6015 ibm board
  * -- Cort
  */
-static char ibm6015_pci_IRQ_map[23] __prepdata = {
+static char ibm6015_pci_IRQ_map[23] = {
         0, /* Slot 0  - unused */
         0, /* Slot 1  - unused */
         0, /* Slot 2  - unused */
@@ -469,7 +469,7 @@ static char ibm6015_pci_IRQ_map[23] __pr
         2, /* Slot 22 -  */
 };
 
-static char ibm6015_pci_IRQ_routes[] __prepdata = {
+static char ibm6015_pci_IRQ_routes[] = {
         0,      /* Line 0 - unused */
         13,     /* Line 1 */
         15,     /* Line 2 */
@@ -479,7 +479,7 @@ static char ibm6015_pci_IRQ_routes[] __p
 
 
 /* IBM Nobis and Thinkpad 850 */
-static char Nobis_pci_IRQ_map[23] __prepdata ={
+static char Nobis_pci_IRQ_map[23] ={
         0, /* Slot 0  - unused */
         0, /* Slot 1  - unused */
         0, /* Slot 2  - unused */
@@ -498,7 +498,7 @@ static char Nobis_pci_IRQ_map[23] __prep
         0, /* Slot 15 - unused */
 };
 
-static char Nobis_pci_IRQ_routes[] __prepdata = {
+static char Nobis_pci_IRQ_routes[] = {
         0, /* Line 0 - Unused */
         13, /* Line 1 */
         13, /* Line 2 */
@@ -510,7 +510,7 @@ static char Nobis_pci_IRQ_routes[] __pre
  * IBM RS/6000 43p/140  -- paulus
  * XXX we should get all this from the residual data
  */
-static char ibm43p_pci_IRQ_map[23] __prepdata = {
+static char ibm43p_pci_IRQ_map[23] = {
         0, /* Slot 0  - unused */
         0, /* Slot 1  - unused */
         0, /* Slot 2  - unused */
@@ -536,7 +536,7 @@ static char ibm43p_pci_IRQ_map[23] __pre
         1, /* Slot 22 - PCI slot 1 PCIINTx# (See below) */
 };
 
-static char ibm43p_pci_IRQ_routes[] __prepdata = {
+static char ibm43p_pci_IRQ_routes[] = {
         0,      /* Line 0 - unused */
         15,     /* Line 1 */
         15,     /* Line 2 */
@@ -559,7 +559,7 @@ struct powerplus_irq_list
  * are routed to OpenPIC inputs 5-8.  These values are offset by
  * 16 in the table to reflect the Linux kernel interrupt value.
  */
-struct powerplus_irq_list Powerplus_pci_IRQ_list __prepdata =
+struct powerplus_irq_list Powerplus_pci_IRQ_list =
 {
 	{25, 26, 27, 28},
 	{21, 22, 23, 24}
@@ -572,7 +572,7 @@ struct powerplus_irq_list Powerplus_pci_
  * are routed to OpenPIC inputs 12-15. These values are offset by
  * 16 in the table to reflect the Linux kernel interrupt value.
  */
-struct powerplus_irq_list Mesquite_pci_IRQ_list __prepdata =
+struct powerplus_irq_list Mesquite_pci_IRQ_list =
 {
 	{24, 25, 26, 27},
 	{28, 29, 30, 31}
@@ -582,7 +582,7 @@ struct powerplus_irq_list Mesquite_pci_I
  * This table represents the standard PCI swizzle defined in the
  * PCI bus specification.
  */
-static unsigned char prep_pci_intpins[4][4] __prepdata =
+static unsigned char prep_pci_intpins[4][4] =
 {
 	{ 1, 2, 3, 4},  /* Buses 0, 4, 8, ... */
 	{ 2, 3, 4, 1},  /* Buses 1, 5, 9, ... */
@@ -622,7 +622,7 @@ static unsigned char prep_pci_intpins[4]
 #define MIN_DEVNR	11
 #define MAX_DEVNR	22
 
-static int __prep
+static int
 prep_read_config(struct pci_bus *bus, unsigned int devfn, int offset,
 		 int len, u32 *val)
 {
@@ -652,7 +652,7 @@ prep_read_config(struct pci_bus *bus, un
 	return PCIBIOS_SUCCESSFUL;
 }
 
-static int __prep
+static int
 prep_write_config(struct pci_bus *bus, unsigned int devfn, int offset,
 		  int len, u32 val)
 {
@@ -804,7 +804,7 @@ struct mot_info {
 	void            (*map_non0_bus)(struct pci_dev *);      /* For boards with more than bus 0 devices. */
 	struct powerplus_irq_list *pci_irq_list; /* List of PCI MPIC inputs */
 	unsigned char   secondary_bridge_devfn; /* devfn of secondary bus transparent bridge */
-} mot_info[] __prepdata = {
+} mot_info[] = {
 	{0x300, 0x00, 0x00, "MVME 2400",			Genesis2_pci_IRQ_map,	Raven_pci_IRQ_routes, Powerplus_Map_Non0, &Powerplus_pci_IRQ_list, 0xFF},
 	{0x010, 0x00, 0x00, "Genesis",				Genesis_pci_IRQ_map,	Genesis_pci_IRQ_routes, Powerplus_Map_Non0, &Powerplus_pci_IRQ_list, 0x00},
 	{0x020, 0x00, 0x00, "Powerstack (Series E)",		Comet_pci_IRQ_map,	Comet_pci_IRQ_routes, NULL, NULL, 0x00},
diff --git a/arch/ppc/platforms/prep_setup.c b/arch/ppc/platforms/prep_setup.c
--- a/arch/ppc/platforms/prep_setup.c
+++ b/arch/ppc/platforms/prep_setup.c
@@ -173,7 +173,7 @@ prep_carolina_enable_l2(void)
 }
 
 /* cpuinfo code common to all IBM PReP */
-static void __prep
+static void
 prep_ibm_cpuinfo(struct seq_file *m)
 {
 	unsigned int equip_reg = inb(PREP_IBM_EQUIPMENT);
@@ -209,14 +209,14 @@ prep_ibm_cpuinfo(struct seq_file *m)
 	}
 }
 
-static int __prep
+static int
 prep_gen_cpuinfo(struct seq_file *m)
 {
 	prep_ibm_cpuinfo(m);
 	return 0;
 }
 
-static int __prep
+static int
 prep_sandalfoot_cpuinfo(struct seq_file *m)
 {
 	unsigned int equip_reg = inb(PREP_IBM_EQUIPMENT);
@@ -243,7 +243,7 @@ prep_sandalfoot_cpuinfo(struct seq_file 
 	return 0;
 }
 
-static int __prep
+static int
 prep_thinkpad_cpuinfo(struct seq_file *m)
 {
 	unsigned int equip_reg = inb(PREP_IBM_EQUIPMENT);
@@ -314,7 +314,7 @@ prep_thinkpad_cpuinfo(struct seq_file *m
 	return 0;
 }
 
-static int __prep
+static int
 prep_carolina_cpuinfo(struct seq_file *m)
 {
 	unsigned int equip_reg = inb(PREP_IBM_EQUIPMENT);
@@ -350,7 +350,7 @@ prep_carolina_cpuinfo(struct seq_file *m
 	return 0;
 }
 
-static int __prep
+static int
 prep_tiger1_cpuinfo(struct seq_file *m)
 {
 	unsigned int l2_reg = inb(PREP_IBM_L2INFO);
@@ -393,7 +393,7 @@ prep_tiger1_cpuinfo(struct seq_file *m)
 
 
 /* Used by all Motorola PReP */
-static int __prep
+static int
 prep_mot_cpuinfo(struct seq_file *m)
 {
 	unsigned int cachew = *((unsigned char *)CACHECRBA);
@@ -454,7 +454,7 @@ no_l2:
 	return 0;
 }
 
-static void __prep
+static void
 prep_restart(char *cmd)
 {
 #define PREP_SP92	0x92	/* Special Port 92 */
@@ -473,7 +473,7 @@ prep_restart(char *cmd)
 #undef PREP_SP92
 }
 
-static void __prep
+static void
 prep_halt(void)
 {
 	local_irq_disable(); /* no interrupts */
@@ -488,7 +488,7 @@ prep_halt(void)
 /* Carrera is the power manager in the Thinkpads. Unfortunately not much is
  * known about it, so we can't power down.
  */
-static void __prep
+static void
 prep_carrera_poweroff(void)
 {
 	prep_halt();
@@ -501,7 +501,7 @@ prep_carrera_poweroff(void)
  * somewhat in the IBM Carolina Technical Specification.
  * -Hollis
  */
-static void __prep
+static void
 utah_sig87c750_setbit(unsigned int bytenum, unsigned int bitnum, int value)
 {
 	/*
@@ -539,7 +539,7 @@ utah_sig87c750_setbit(unsigned int byten
 	udelay(100);				/* important: let controller recover */
 }
 
-static void __prep
+static void
 prep_sig750_poweroff(void)
 {
 	/* tweak the power manager found in most IBM PRePs (except Thinkpads) */
@@ -554,7 +554,7 @@ prep_sig750_poweroff(void)
 	/* not reached */
 }
 
-static int __prep
+static int
 prep_show_percpuinfo(struct seq_file *m, int i)
 {
 	/* PREP's without residual data will give incorrect values here */
@@ -700,12 +700,12 @@ prep_set_bat(void)
 /*
  * IBM 3-digit status LED
  */
-static unsigned int ibm_statusled_base __prepdata;
+static unsigned int ibm_statusled_base;
 
-static void __prep
+static void
 ibm_statusled_progress(char *s, unsigned short hex);
 
-static int __prep
+static int
 ibm_statusled_panic(struct notifier_block *dummy1, unsigned long dummy2,
 		    void * dummy3)
 {
@@ -713,13 +713,13 @@ ibm_statusled_panic(struct notifier_bloc
 	return NOTIFY_DONE;
 }
 
-static struct notifier_block ibm_statusled_block __prepdata = {
+static struct notifier_block ibm_statusled_block = {
 	ibm_statusled_panic,
 	NULL,
 	INT_MAX /* try to do it first */
 };
 
-static void __prep
+static void
 ibm_statusled_progress(char *s, unsigned short hex)
 {
 	static int notifier_installed;
@@ -945,7 +945,7 @@ prep_calibrate_decr(void)
 		todc_calibrate_decr();
 }
 
-static unsigned int __prep
+static unsigned int
 prep_irq_canonicalize(u_int irq)
 {
 	if (irq == 2)
@@ -996,7 +996,7 @@ prep_init_IRQ(void)
 /*
  * IDE stuff.
  */
-static int __prep
+static int
 prep_ide_default_irq(unsigned long base)
 {
 	switch (base) {
@@ -1010,7 +1010,7 @@ prep_ide_default_irq(unsigned long base)
 	}
 }
 
-static unsigned long __prep
+static unsigned long
 prep_ide_default_io_base(int index)
 {
 	switch (index) {
@@ -1055,7 +1055,7 @@ smp_prep_setup_cpu(int cpu_nr)
 		do_openpic_setup_cpu();
 }
 
-static struct smp_ops_t prep_smp_ops __prepdata = {
+static struct smp_ops_t prep_smp_ops = {
 	smp_openpic_message_pass,
 	smp_prep_probe,
 	smp_prep_kick_cpu,
diff --git a/arch/ppc/platforms/residual.c b/arch/ppc/platforms/residual.c
--- a/arch/ppc/platforms/residual.c
+++ b/arch/ppc/platforms/residual.c
@@ -47,7 +47,7 @@
 #include <asm/ide.h>
 
 
-unsigned char __res[sizeof(RESIDUAL)] __prepdata = {0,};
+unsigned char __res[sizeof(RESIDUAL)] = {0,};
 RESIDUAL *res = (RESIDUAL *)&__res;
 
 char * PnP_BASE_TYPES[] __initdata = {
diff --git a/arch/ppc/syslib/btext.c b/arch/ppc/syslib/btext.c
--- a/arch/ppc/syslib/btext.c
+++ b/arch/ppc/syslib/btext.c
@@ -53,8 +53,8 @@ extern char *klimit;
  * chrp only uses it during early boot.
  */
 #ifdef CONFIG_XMON
-#define BTEXT	__pmac
-#define BTDATA	__pmacdata
+#define BTEXT
+#define BTDATA
 #else
 #define BTEXT	__init
 #define BTDATA	__initdata
@@ -187,7 +187,7 @@ btext_setup_display(int width, int heigh
  *    changes.
  */
 
-void __openfirmware
+void
 map_boot_text(void)
 {
 	unsigned long base, offset, size;
diff --git a/arch/ppc/syslib/prep_nvram.c b/arch/ppc/syslib/prep_nvram.c
--- a/arch/ppc/syslib/prep_nvram.c
+++ b/arch/ppc/syslib/prep_nvram.c
@@ -22,14 +22,14 @@
 static char nvramData[MAX_PREP_NVRAM];
 static NVRAM_MAP *nvram=(NVRAM_MAP *)&nvramData[0];
 
-unsigned char __prep prep_nvram_read_val(int addr)
+unsigned char prep_nvram_read_val(int addr)
 {
 	outb(addr, PREP_NVRAM_AS0);
 	outb(addr>>8, PREP_NVRAM_AS1);
 	return inb(PREP_NVRAM_DATA);
 }
 
-void __prep prep_nvram_write_val(int           addr,
+void prep_nvram_write_val(int           addr,
 			  unsigned char val)
 {
 	outb(addr, PREP_NVRAM_AS0);
@@ -81,8 +81,7 @@ void __init init_prep_nvram(void)
 	}
 }
 
-__prep
-char __prep *prep_nvram_get_var(const char *name)
+char *prep_nvram_get_var(const char *name)
 {
 	char *cp;
 	int  namelen;
@@ -101,8 +100,7 @@ char __prep *prep_nvram_get_var(const ch
 	return NULL;
 }
 
-__prep
-char __prep *prep_nvram_first_var(void)
+char *prep_nvram_first_var(void)
 {
         if (nvram->Header.GELength == 0) {
 		return NULL;
@@ -112,8 +110,7 @@ char __prep *prep_nvram_first_var(void)
 	}
 }
 
-__prep
-char __prep *prep_nvram_next_var(char *name)
+char *prep_nvram_next_var(char *name)
 {
 	char *cp;
 
diff --git a/arch/ppc/syslib/prom.c b/arch/ppc/syslib/prom.c
--- a/arch/ppc/syslib/prom.c
+++ b/arch/ppc/syslib/prom.c
@@ -89,7 +89,7 @@ extern char cmd_line[512];	/* XXX */
 extern boot_infos_t *boot_infos;
 unsigned long dev_tree_size;
 
-void __openfirmware
+void
 phys_call_rtas(int service, int nargs, int nret, ...)
 {
 	va_list list;
@@ -862,7 +862,7 @@ find_type_devices(const char *type)
 /*
  * Returns all nodes linked together
  */
-struct device_node * __openfirmware
+struct device_node *
 find_all_nodes(void)
 {
 	struct device_node *head, **prevp, *np;
@@ -1165,7 +1165,7 @@ get_property(struct device_node *np, con
 /*
  * Add a property to a node
  */
-void __openfirmware
+void
 prom_add_property(struct device_node* np, struct property* prop)
 {
 	struct property **next = &np->properties;
@@ -1177,7 +1177,7 @@ prom_add_property(struct device_node* np
 }
 
 /* I quickly hacked that one, check against spec ! */
-static inline unsigned long __openfirmware
+static inline unsigned long
 bus_space_to_resource_flags(unsigned int bus_space)
 {
 	u8 space = (bus_space >> 24) & 0xf;
@@ -1194,7 +1194,7 @@ bus_space_to_resource_flags(unsigned int
 	}
 }
 
-static struct resource* __openfirmware
+static struct resource*
 find_parent_pci_resource(struct pci_dev* pdev, struct address_range *range)
 {
 	unsigned long mask;
@@ -1224,7 +1224,7 @@ find_parent_pci_resource(struct pci_dev*
  * or other nodes attached to the root node. Ultimately, put some
  * link to resources in the OF node.
  */
-struct resource* __openfirmware
+struct resource*
 request_OF_resource(struct device_node* node, int index, const char* name_postfix)
 {
 	struct pci_dev* pcidev;
@@ -1280,7 +1280,7 @@ fail:
 	return NULL;
 }
 
-int __openfirmware
+int
 release_OF_resource(struct device_node* node, int index)
 {
 	struct pci_dev* pcidev;
@@ -1346,7 +1346,7 @@ release_OF_resource(struct device_node* 
 }
 
 #if 0
-void __openfirmware
+void
 print_properties(struct device_node *np)
 {
 	struct property *pp;
@@ -1400,7 +1400,7 @@ print_properties(struct device_node *np)
 static DEFINE_SPINLOCK(rtas_lock);
 
 /* this can be called after setup -- Cort */
-int __openfirmware
+int
 call_rtas(const char *service, int nargs, int nret,
 	  unsigned long *outputs, ...)
 {

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox