Skip to contentSkip to conversation

ASoC drivers for the Freescale MPC8610 SoC

PATCH In review Timur Tabi 4 participants 8 messages Jan 7, 2008 – Jan 10, 2008

Subsystems (6)
lore
Share & tools
lore

Timur Tabi

author
#0 lore raw

cover ASoC drivers for the Freescale MPC8610 SoC

These patches add ALSA SoC device drivers for the Freescale MPC8610 SoC and the MPC8610-HPCD reference board.

The first patch updates some files in arch/powerpc and booting-without-of.txt.

The second patch adds the new audio driver files to sound/soc.

Both must be applied in order to avoid a build break.

author
#1 lore raw

PATCH v2 1/1 Update MPC8610 HPCD to support audio drivers

Update the MPC8610 HPCD files to support the audio driver. Update booting-without-of.txt with information on the SSI device.

---

Updated based on comments from mailing lists. Split the patch into two parts.

This patch applies on top of
git://git.kernel.org/pub/scm/linux/kernel/git/perex/alsa.git.

 Documentation/powerpc/booting-without-of.txt |   40 ++++++
 arch/powerpc/boot/dts/mpc8610_hpcd.dts       |  110 ++++++++++++++++-
 arch/powerpc/configs/mpc8610_hpcd_defconfig  |  171 +++++++++++++++++++++++++-
 arch/powerpc/platforms/86xx/mpc8610_hpcd.c   |   18 +++
 4 files changed, 335 insertions(+), 4 deletions(-)
Documentation/powerpc/booting-without-of.txt +40 -0
index e9a3cb1..826af91 100644
@@ -53,6 +53,7 @@ Table of Contents
       j) CFI or JEDEC memory-mapped NOR flash
       k) Global Utilities Block
       l) Xilinx IP cores
+      p) Freescale Synchronous Serial Interface
 
   VII - Specifying interrupt information for devices
     1) interrupts property
@@ -2514,6 +2515,45 @@ platforms are moved over to use the flattened-device-tree model.
       Requred properties:
        - current-speed : Baud rate of uartlite
 
+    p) Freescale Synchronous Serial Interface
+
+       The SSI is a serial device that communicates with audio codecs.  It can
+       be programmed in AC97, I2S, left-justified, or right-justified modes.
+
+       Required properties:
+       - compatible	  : compatible list, containing "fsl,ssi"
+       - cell-index	  : the SSI, <0> = SSI1, <1> = SSI2, and so on
+       - reg		  : offset and length of the register set for the device
+       - interrupts	  : <a b> where a is the interrupt number and b is a
+                            field that represents an encoding of the sense and
+			    level information for the interrupt.  This should be
+			    encoded based on the information in section 2)
+			    depending on the type of interrupt controller you
+			    have.
+       - interrupt-parent : the phandle for the interrupt controller that
+                            services interrupts for this device.
+       - fsl,mode	  : the operating mode for the SSI interface
+			    "i2s-slave" - I2S mode, SSI is clock slave
+			    "i2s-master" - I2S mode, SSI is clock master
+			    "lj-slave" - left-justified mode, SSI is clock slave
+			    "lj-master" - l.j. mode, SSI is clock master
+			    "rj-slave" - right-justified mode, SSI is clock slave
+			    "rj-master" - r.j., SSI is clock master
+			    "ac97-slave" - AC97 mode, SSI is clock slave
+			    "ac97-master" - AC97 mode, SSI is clock master
+
+       Optional properties:
+       - codec		  : child node that defines an audio codec connected
+		 	    to this SSI
+
+       Child 'codec' node required properties:
+       - compatible	  : compatible list, contains the name of the codec
+
+       Child 'codec' node optional properties:
+       - bus-frequency	  : The frequency of the input clock, which typically
+                            comes from an on-board dedicated oscillator.
+
+
    More devices will be defined as this spec matures.
 
 VII - Specifying interrupt information for devices
arch/powerpc/boot/dts/mpc8610_hpcd.dts +109 -1

128 lines not on this page · raw message

arch/powerpc/configs/mpc8610_hpcd_defconfig +168 -3

189 lines not on this page · raw message

arch/powerpc/platforms/86xx/mpc8610_hpcd.c +18 -0
index 6390895..ed45a4a 100644
@@ -34,9 +34,27 @@
 
 #include <asm/mpic.h>
 
+#include <linux/of_platform.h>
 #include <sysdev/fsl_pci.h>
 #include <sysdev/fsl_soc.h>
 
+static struct of_device_id mpc8610_ids[] = {
+	{ .compatible = "fsl,mpc8610", },
+	{}
+};
+
+static int __init mpc8610_declare_of_platform_devices(void)
+{
+	if (!machine_is(mpc86xx_hpcd))
+		return 0;
+
+	/* Without this call, the SSI device driver won't get probed. */
+	of_platform_bus_probe(NULL, mpc8610_ids, NULL);
+
+	return 0;
+}
+device_initcall(mpc8610_declare_of_platform_devices);
+
 void __init
 mpc86xx_hpcd_init_irq(void)
 {
Signature · 1 line
1.5.2.4
author
#2 lore raw

PATCH v2 1/1 Add ASoC drivers for the Freescale MPC8610 SoC

Add the ASoC drivers for the Freescale MPC8610 SoC and the MPC8610 HPCD reference board.

---
 sound/soc/Kconfig            |    1 +
 sound/soc/Makefile           |    2 +-
 sound/soc/fsl/Kconfig        |   20 +
 sound/soc/fsl/Makefile       |    6 +
 sound/soc/fsl/fsl_dma.c      |  839 ++++++++++++++++++++++++++++++++++++++++++
 sound/soc/fsl/fsl_dma.h      |  149 ++++++++
 sound/soc/fsl/fsl_ssi.c      |  644 ++++++++++++++++++++++++++++++++
 sound/soc/fsl/fsl_ssi.h      |  224 +++++++++++
 sound/soc/fsl/mpc8610_hpcd.c |  628 +++++++++++++++++++++++++++++++
 9 files changed, 2512 insertions(+), 1 deletions(-)
 create mode 100644 sound/soc/fsl/Kconfig
 create mode 100644 sound/soc/fsl/Makefile
 create mode 100644 sound/soc/fsl/fsl_dma.c
 create mode 100644 sound/soc/fsl/fsl_dma.h
 create mode 100644 sound/soc/fsl/fsl_ssi.c
 create mode 100644 sound/soc/fsl/fsl_ssi.h
 create mode 100644 sound/soc/fsl/mpc8610_hpcd.c
sound/soc/Kconfig +1 -0
index 97b2552..43bbc60 100644
@@ -28,6 +28,7 @@ source "sound/soc/at91/Kconfig"
 source "sound/soc/pxa/Kconfig"
 source "sound/soc/s3c24xx/Kconfig"
 source "sound/soc/sh/Kconfig"
+source "sound/soc/fsl/Kconfig"
 
 # Supported codecs
 source "sound/soc/codecs/Kconfig"
sound/soc/Makefile +1 -1
index 3041403..4869c9a 100644
@@ -1,4 +1,4 @@
 snd-soc-core-objs := soc-core.o soc-dapm.o
 
 obj-$(CONFIG_SND_SOC)	+= snd-soc-core.o
-obj-$(CONFIG_SND_SOC)	+= codecs/ at91/ pxa/ s3c24xx/ sh/
+obj-$(CONFIG_SND_SOC)	+= codecs/ at91/ pxa/ s3c24xx/ sh/ fsl/
sound/soc/fsl/Kconfig new file +20 -0
new file mode 100644
index 0000000..257101f
@@ -0,0 +1,20 @@
+menu "ALSA SoC audio for Freescale SOCs"
+
+config SND_SOC_MPC8610
+	bool "ALSA SoC support for the MPC8610 SOC"
+	depends on SND_SOC && MPC8610_HPCD
+	default y if MPC8610
+	help
+	  Say Y if you want to add support for codecs attached to the SSI
+          device on an MPC8610.
+
+config SND_SOC_MPC8610_HPCD
+	bool "ALSA SoC support for the Freescale MPC8610 HPCD board"
+	depends on SND_SOC_MPC8610
+	select SND_SOC_CS4270
+	select SND_SOC_CS4270_VD33_ERRATA
+	default y if MPC8610_HPCD
+	help
+	  Say Y if you want to enable audio on the Freescale MPC8610 HPCD.
+
+endmenu
sound/soc/fsl/Makefile new file +6 -0
new file mode 100644
index 0000000..62f680a
@@ -0,0 +1,6 @@
+# MPC8610 HPCD Machine Support
+obj-$(CONFIG_SND_SOC_MPC8610_HPCD) += mpc8610_hpcd.o
+
+# MPC8610 Platform Support
+obj-$(CONFIG_SND_SOC_MPC8610) += fsl_ssi.o fsl_dma.o
+
sound/soc/fsl/fsl_dma.c new file +839 -0

839 lines not on this page · raw message

sound/soc/fsl/fsl_dma.h new file +149 -0

149 lines not on this page · raw message

sound/soc/fsl/fsl_ssi.c new file +644 -0

644 lines not on this page · raw message

sound/soc/fsl/fsl_ssi.h new file +224 -0

224 lines not on this page · raw message

sound/soc/fsl/mpc8610_hpcd.c new file +628 -0

628 lines not on this page · raw message

Signature · 1 line
1.5.2.4
#4 lore raw

Re: [PATCH v2] [POWERPC] Update MPC8610 HPCD to support audio drivers

In reply to Timur Tabi

Hi Timur,

arch/powerpc/platforms/86xx/mpc8610_hpcd.c line 41

Quoted 11 lines · On Mon, 7 Jan 2008 12:56:43 -0600 Timur Tabi <[email protected]> wrote:

+++ b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c

arch/powerpc/platforms/86xx/mpc8610_hpcd.c +2 -0
@@ -34,9 +34,27 @@
 
 #include <asm/mpic.h>
 
+#include <linux/of_platform.h>
 #include <sysdev/fsl_pci.h>
 #include <sysdev/fsl_soc.h>
 
+static struct of_device_id mpc8610_ids[] = {

__initdata

Quoted 5 lines
arch/powerpc/platforms/86xx/mpc8610_hpcd.c +5 -0
+	{ .compatible = "fsl,mpc8610", },
+	{}
+};
+
+static int __init mpc8610_declare_of_platform_devices(void)

arch/powerpc/platforms/86xx/mpc8610_hpcd.c line 56

Quoted 10 lines
arch/powerpc/platforms/86xx/mpc8610_hpcd.c +10 -0
+{
+	if (!machine_is(mpc86xx_hpcd))
+		return 0;
+
+	/* Without this call, the SSI device driver won't get probed. */
+	of_platform_bus_probe(NULL, mpc8610_ids, NULL);
+
+	return 0;
+}
+device_initcall(mpc8610_declare_of_platform_devices);

We have machine_device_initcall for this now.

Signature · 3 lines
Cheers,
Stephen Rothwell                    [email protected]
http://www.canb.auug.org.au/~sfr/

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev

#5 lore raw

Re: [PATCH v2] [POWERPC] Update MPC8610 HPCD to support audio drivers

Quoted 26 lines · Stephen Rothwell

Hi Timur,

arch/powerpc/platforms/86xx/mpc8610_hpcd.c line 41

Quoted 11 lines · On Mon, 7 Jan 2008 12:56:43 -0600 Timur Tabi <[email protected]> wrote:

+++ b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c

arch/powerpc/platforms/86xx/mpc8610_hpcd.c +2 -0
@@ -34,9 +34,27 @@
 
 #include <asm/mpic.h>
 
+#include <linux/of_platform.h>
 #include <sysdev/fsl_pci.h>
 #include <sysdev/fsl_soc.h>
 
+static struct of_device_id mpc8610_ids[] = {

__initdata

Quoted 9 lines
arch/powerpc/platforms/86xx/mpc8610_hpcd.c +9 -0
+	{ .compatible = "fsl,mpc8610", },
+	{}
+};
+
+static int __init mpc8610_declare_of_platform_devices(void)
+{
+	if (!machine_is(mpc86xx_hpcd))
+		return 0;
+
Quoted 9 lines

arch/powerpc/platforms/86xx/mpc8610_hpcd.c line 56

Quoted 6 lines
arch/powerpc/platforms/86xx/mpc8610_hpcd.c +6 -0
+	/* Without this call, the SSI device driver won't get probed. */
+	of_platform_bus_probe(NULL, mpc8610_ids, NULL);
+
+	return 0;
+}
+device_initcall(mpc8610_declare_of_platform_devices);

We have machine_device_initcall for this now.

Now changed in ASoC dev branch.

Liam

#6 lore raw

Re: [PATCH v2] [POWERPC] Update MPC8610 HPCD to support audio drivers

In reply to Timur Tabi
Quoted 89 lines · Timur Tabi

Update the MPC8610 HPCD files to support the audio driver. Update booting-without-of.txt with information on the SSI device.

---

Updated based on comments from mailing lists. Split the patch into two parts.

This patch applies on top of
git://git.kernel.org/pub/scm/linux/kernel/git/perex/alsa.git.

 Documentation/powerpc/booting-without-of.txt |   40 ++++++
 arch/powerpc/boot/dts/mpc8610_hpcd.dts       |  110 ++++++++++++++++-
 arch/powerpc/configs/mpc8610_hpcd_defconfig  |  171 +++++++++++++++++++++++++-
 arch/powerpc/platforms/86xx/mpc8610_hpcd.c   |   18 +++
 4 files changed, 335 insertions(+), 4 deletions(-)
Documentation/powerpc/booting-without-of.txt +40 -0
index e9a3cb1..826af91 100644
@@ -53,6 +53,7 @@ Table of Contents
       j) CFI or JEDEC memory-mapped NOR flash
       k) Global Utilities Block
       l) Xilinx IP cores
+      p) Freescale Synchronous Serial Interface
 
   VII - Specifying interrupt information for devices
     1) interrupts property
@@ -2514,6 +2515,45 @@ platforms are moved over to use the flattened-device-tree model.
       Requred properties:
        - current-speed : Baud rate of uartlite
 
+    p) Freescale Synchronous Serial Interface
+
+       The SSI is a serial device that communicates with audio codecs.  It can
+       be programmed in AC97, I2S, left-justified, or right-justified modes.
+
+       Required properties:
+       - compatible      : compatible list, containing "fsl,ssi"
+       - cell-index      : the SSI, <0> = SSI1, <1> = SSI2, and so on
+       - reg             : offset and length of the register set for the device
+       - interrupts      : <a b> where a is the interrupt number and b is a
+                            field that represents an encoding of the sense and
+                           level information for the interrupt.  This should be
+                           encoded based on the information in section 2)
+                           depending on the type of interrupt controller you
+                           have.
+       - interrupt-parent : the phandle for the interrupt controller that
+                            services interrupts for this device.
+       - fsl,mode        : the operating mode for the SSI interface
+                           "i2s-slave" - I2S mode, SSI is clock slave
+                           "i2s-master" - I2S mode, SSI is clock master
+                           "lj-slave" - left-justified mode, SSI is clock slave
+                           "lj-master" - l.j. mode, SSI is clock master
+                           "rj-slave" - right-justified mode, SSI is clock slave
+                           "rj-master" - r.j., SSI is clock master
+                           "ac97-slave" - AC97 mode, SSI is clock slave
+                           "ac97-master" - AC97 mode, SSI is clock master
+
+       Optional properties:
+       - codec           : child node that defines an audio codec connected
+                           to this SSI
+
+       Child 'codec' node required properties:
+       - compatible      : compatible list, contains the name of the codec
+
+       Child 'codec' node optional properties:
+       - bus-frequency   : The frequency of the input clock, which typically
+                            comes from an on-board dedicated oscillator.
+
+
    More devices will be defined as this spec matures.
 
 VII - Specifying interrupt information for devices
arch/powerpc/boot/dts/mpc8610_hpcd.dts +1 -1
index 966edf1..fda0ace 100644
@@ -1,7 +1,7 @@
 /*
  * MPC8610 HPCD Device Tree Source
  *
- * Copyright 2007 Freescale Semiconductor Inc.
+ * Copyright 2007-2008 Freescale Semiconductor Inc.
  *
  * This program is free software; you can redistribute  it and/or modify it
  * under the terms of the GNU General Public License Version 2 as published

arch/powerpc/boot/dts/mpc8610_hpcd.dts line 45

Quoted 4 lines
arch/powerpc/boot/dts/mpc8610_hpcd.dts +1 -0
@@ -42,6 +42,7 @@
                #size-cells = <1>;
                #interrupt-cells = <2>;
                device_type = "soc";
+               compatible = "fsl,mpc8610";

Something like "fsl,mpc8610-immr" might be a better choice here. This node doesn't actually describe the entire chip (for example, the PPC cores are in the cpus node); but it does describe the internally memory mapped registers.

Cheers,
g.

Signature · 2 lines
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
#7 lore raw
In reply to Timur Tabi
Quoted 9 lines · Timur Tabi

These patches add ALSA SoC device drivers for the Freescale MPC8610 SoC and the MPC8610-HPCD reference board.

The first patch updates some files in arch/powerpc and booting-without-of.txt.

The second patch adds the new audio driver files to sound/soc.

Both must be applied in order to avoid a build break.

Both applied to the dev branch. This should let others use them atm and allow us to port to ASoC v2.

I'll make a start on the port now.

Liam