LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: Java on PowerPC
From: Robert Swindells @ 2005-09-16 11:07 UTC (permalink / raw)
  To: ritac_c; +Cc: linuxppc-embedded
In-Reply-To: <BAY7-F9CCE196E3FF0097799A069E910@phx.gbl>


Rita Carvalho wrote:
>I am trying use IBMJava2-SDK-142.ppc.tgz in a PowerPc 440 GX with 
>Montavista.
>When I try the command  ./java  - version the error Illegal instruction 
>(core dumped) occurs.

<http://www-128.ibm.com/developerworks/linux/library/l-pow-apple.html>

^ permalink raw reply

* RE: How to use kerberos in ELDK
From: JohnsonCheng @ 2005-09-16 12:09 UTC (permalink / raw)
  To: wd; +Cc: 'linux-ppc-embedded'
In-Reply-To: <20050916112324.0528D352B7B@atlas.denx.de>

Yes. I have find out how to do it.
./install -d ppc_6xx

Thanks,
Johnson Cheng

-----Original Message-----
From: wd@denx.de [mailto:wd@denx.de] 
Sent: Friday, September 16, 2005 7:23 PM
To: JohnsonCheng
Cc: 'linux-ppc-embedded'
Subject: Re: How to use kerberos in ELDK 

In message <20050916070358.781D2422AF@denx.de> you wrote:
> 
> Maybe I meet the big trouble.
> I find no powerpc-linux-rpm in my build machine, only have
> powerpc-linux-gcc, powerpc-linux-ar .....
> What should I do?

You should really READ the documentation. It says, and I  explicitely
quoted this in my previous posting:

> You must use "${CROSS_COMPILE}rpm" instead.

So instead of trying powerpc-linux-rpm which indeed  does  not  exist
you  should  run  ppc_8xx-rpm  or whichever other architecture you're
using (alternatively ppc-rpm would work, but this is undocumented and
not recommended).

Please RTFM!


Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
"...and the fully armed nuclear warheads, are, of  course,  merely  a
courtesy detail."

^ permalink raw reply

* 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


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