To apply this patch please follow these steps:
(Note: patch can be applied to a clean and "fresh" BSP only)

$ tar xf OSELAS.BSP-Phytec-phyCORE-MPC5200B-tiny-6.tar.gz
$ cd OSELAS.BSP-Phytec-phyCORE-MPC5200B-tiny-6
$ patch -p0 < <this-patch>
$ ptxdist go

Modifications:
 - etc/udev/rules/udev.rules (on target)
  To support all the device nodes for sound the various tools need to work
  (alsamixer/alsactrl and madplay)
 - etc/modules (on target)
  To enable loading all the required kernel modules
 - patches/linux-2.6.23.1/generic/series (BSP)
   patches/linux-2.6.23.1/generic/mpc52xx_ac97_audio_fix.diff (BSP)
  To fix the sound driver
 - ptxconfig
  To use the local udev rules instead of the generic one

Note: The hardware patch to wake up the external Wolfson is still required.

To hear some sound you will need an MP3 song file for example. First run the 
"alsamixer" to unmute the sound device. Unmute "master", "pcm" and "headphone"
and increase their volume.

This audio setting can be saved with "alsactl store". The next time the
system boots you can run "alsactl restore" instead of running "alsamixer"
again and again.

Run "madplay <soundfile>" for a sound demo.

Index: projectroot/etc/udev/rules.d/udev.rules
===================================================================
--- projectroot/etc/udev/rules.d/udev.rules	(Revision 6176)
+++ projectroot/etc/udev/rules.d/udev.rules	(working copy)
@@ -1,4 +1,27 @@
 # make the first rtc device the default one
 KERNEL=="rtc0",		SYMLINK="rtc"
 
+# ALSA devices go in their own subdirectory
 
+KERNEL=="controlC[0-9]*",   GROUP="audio",  NAME="snd/%k"
+KERNEL=="hw[CD0-9]*",       GROUP="audio",  NAME="snd/%k"
+KERNEL=="pcm[CD0-9cp]*",    GROUP="audio",  NAME="snd/%k"
+KERNEL=="midiC[D0-9]*",     GROUP="audio",  NAME="snd/%k"
+KERNEL=="timer",            GROUP="audio",  NAME="snd/%k"
+KERNEL=="seq",              GROUP="audio",  NAME="snd/%k"
+
+# Sound devices
+
+KERNEL=="admmidi*",     GROUP="audio"
+KERNEL=="adsp*",        GROUP="audio"
+KERNEL=="aload*",       GROUP="audio"
+KERNEL=="amidi*",       GROUP="audio"
+KERNEL=="amixer*",      GROUP="audio"
+KERNEL=="audio*",       GROUP="audio"
+KERNEL=="dmfm*",        GROUP="audio"
+KERNEL=="dmmidi*",      GROUP="audio"
+KERNEL=="dsp*",         GROUP="audio"
+KERNEL=="midi*",        GROUP="audio"
+KERNEL=="mixer*",       GROUP="audio"
+KERNEL=="music",        GROUP="audio"
+KERNEL=="sequencer*",   GROUP="audio"
Index: projectroot/etc/modules
===================================================================
--- projectroot/etc/modules	(Revision 6176)
+++ projectroot/etc/modules	(working copy)
@@ -11,5 +11,7 @@
 #
 # TODO: enable this if you are sure it works on your 02REI revision
 #
-#snd-mpc52xx-ac97
+snd-mpc52xx-ac97
+snd_pcm_oss
+snd_mixer_oss
 
Index: patches/linux-2.6.23.1/generic/mpc52xx_ac97_audio_fix.diff
===================================================================
--- patches/linux-2.6.23.1/generic/mpc52xx_ac97_audio_fix.diff	(Revision 0)
+++ patches/linux-2.6.23.1/generic/mpc52xx_ac97_audio_fix.diff	(Revision 0)
@@ -0,0 +1,74 @@
+Subject: [@num@/@total@] mpc52xx: Change the AC97 driver to be more generic
+From: Juergen Beisert <j.beisert@pengutronix.de>
+
+The current AC97 driver for the mpc52xx CPU is fixed to work on PSC2. This
+patch tries to make it more generic, as it detects the PSC unit for AC97 usage
+to forward this information into the Bestcomm-API.
+
+Signed-off-by: Juergen Beisert <j.beisert@pengutronix.de>
+---
+ sound/ppc/mpc52xx_ac97.c |   26 +++++++++++++++++++++++---
+ 1 file changed, 23 insertions(+), 3 deletions(-)
+
+Index: sound/ppc/mpc52xx_ac97.c
+===================================================================
+--- sound/ppc/mpc52xx_ac97.c.orig
++++ sound/ppc/mpc52xx_ac97.c
+@@ -639,7 +639,6 @@ mpc52xx_ac97_hwshutdown(struct mpc52xx_a
+ 	return 0;
+ }
+ 
+-
+ /* ======================================================================== */
+ /* OF Platform Driver                                                       */
+ /* ======================================================================== */
+@@ -651,7 +650,9 @@ mpc52xx_ac97_probe(struct of_device *op,
+ 	struct mpc52xx_ac97_priv *priv;
+ 	struct snd_card *card;
+ 	struct resource res;
++	int tx_initiator;
+ 	int rv;
++	const unsigned int *devno;
+ 
+ 	dev_dbg(&op->dev, "probing MPC52xx PSC AC97 driver\n");
+ 
+@@ -699,11 +700,29 @@ mpc52xx_ac97_probe(struct of_device *op,
+ 	/* Setup Bestcomm tasks */
+ 	spin_lock_init(&priv->dma_lock);
+ 
++	/*
++	 * PSC1 or PSC2 can be configured for AC97 usage. Select the right
++	 * channel, to let the BCOMM unit does its job correctly.
++	 */
++	devno = of_get_property(dn, "cell-index", NULL);
++	switch (*devno) {
++	case 0:	/* PSC1 */
++		tx_initiator = 14;
++		break;
++	case 1:	/* PSC2 */
++		tx_initiator = 12;
++		break;
++	default:
++		dev_dbg(priv->dev, "Unknown PSC unit for AC97 usage!\n");
++		rv = -ENODEV;
++		goto err_irq;
++	}
++
+ 	priv->tsk_tx = bcom_gen_bd_tx_init(AC97_TX_NUM_BD,
+ 				priv->mem_start + offsetof(struct mpc52xx_psc,
+ 							tfdata),
+-				12,	/* initiator : FIXME */
+-				2);	/* ipr : FIXME */
++			tx_initiator,
++			2);	/* ipr : FIXME */
+ 	if (!priv->tsk_tx) {
+ 		printk(KERN_ERR DRV_NAME ": bcom_gen_bd_tx_init failed\n");
+ 		rv = -ENOMEM;
+@@ -759,6 +778,7 @@ err_irqreq:
+ 	bcom_gen_bd_tx_release(priv->tsk_tx);
+ err_bcomm:
+ 	mpc52xx_ac97_hwshutdown(priv);
++err_irq:
+ 	irq_dispose_mapping(priv->irq);
+ err_irqmap:
+ 	iounmap(priv->psc);
Index: patches/linux-2.6.23.1/generic/series
===================================================================
--- patches/linux-2.6.23.1/generic/series	(Revision 3900)
+++ patches/linux-2.6.23.1/generic/series	(working copy)
@@ -456,3 +456,4 @@
 #
 mainline-fixes/cfi_query_table.patch -p0
 
+mpc52xx_ac97_audio_fix.diff -p0
Index: ptxconfig
===================================================================
--- ptxconfig   (revision 5083)
+++ ptxconfig   (working copy)
@@ -1064,8 +1064,8 @@
 PTXCONF_ROOTFS_ETC_UDEV_CONF=y
 PTXCONF_ROOTFS_ETC_UDEV_CONF_DEFAULT=y
 # PTXCONF_ROOTFS_ETC_UDEV_CONF_USER is not set
-PTXCONF_ROOTFS_ETC_UDEV_DEFAULT_RULES=y
-# PTXCONF_ROOTFS_ETC_UDEV_USER_RULES is not set
+# PTXCONF_ROOTFS_ETC_UDEV_DEFAULT_RULES is not set
+PTXCONF_ROOTFS_ETC_UDEV_USER_RULES=y
 PTXCONF_ROOTFS_ETC_INITD_UDEV=y
 PTXCONF_ROOTFS_ETC_INITD_UDEV_DEFAULT=y
 # PTXCONF_ROOTFS_ETC_INITD_UDEV_USER is not set

