Skip to contentSkip to conversation

Add AACI audio playback support to the ARM Versatile/PB platform

PATCH Superseded Mathieu Sonet 1 participant 1 message Oct 12, 2011 Kbuild

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 Add AACI audio playback support to the ARM Versatile/PB platform

This driver emulates the ARM AACI interface (PL041) connected to a LM4549 codec. It enables audio playback for the Versatile/PB platform.

Limitations:
- Supports only a playback on one channel (Versatile/Vexpress)
- Supports only one TX FIFO in compact-mode or non-compact mode.
- Supports playback of 12, 16, 18 and 20 bits samples.
- Record is not supported.
- The PL041 is hardwired to a LM4549 codec.

Versatile/PB test build:
linux-2.6.38.5
buildroot-2010.11
alsa-lib-1.0.22
alsa-utils-1.0.22
mpg123-0.66

Qemu host: Ubuntu 10.04 in Vmware/OS X

Playback tested successfully with speaker-test/aplay/mpg123.

---
v3->v4

* Fix debug message compile error
* Remove Versatile/PB reference in pl041.c
* Use 20-bit samples in the LM4549 API
* Add support for non-compact mode
* Now support 12, 16, 18 and 20 bit sample size
* A FIFO reset is triggered when the AACIFE bit is reset

 Makefile.target  |    1 +
 hw/lm4549.c      |  332 ++++++++++++++++++++++++++++
 hw/lm4549.h      |   44 ++++
 hw/pl041.c       |  644 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 hw/pl041.h       |  135 ++++++++++++
 hw/pl041.hx      |   81 +++++++
 hw/versatilepb.c |    8 +
 7 files changed, 1245 insertions(+), 0 deletions(-)
 create mode 100644 hw/lm4549.c
 create mode 100644 hw/lm4549.h
 create mode 100644 hw/pl041.c
 create mode 100644 hw/pl041.h
 create mode 100644 hw/pl041.hx
Makefile.target +1 -0
index 42adfec..00173cd 100644
@@ -355,6 +355,7 @@ obj-arm-y += syborg_virtio.o
 obj-arm-y += vexpress.o
 obj-arm-y += strongarm.o
 obj-arm-y += collie.o
+obj-arm-y += pl041.o lm4549.o
 
 obj-sh4-y = shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o
 obj-sh4-y += sh_timer.o sh_serial.o sh_intc.o sh_pci.o sm501.o
hw/lm4549.c new file +332 -0

332 lines not on this page · raw message

hw/lm4549.h new file +44 -0

44 lines not on this page · raw message

hw/pl041.c new file +644 -0

644 lines not on this page · raw message

hw/pl041.h new file +135 -0

135 lines not on this page · raw message

hw/pl041.hx new file +81 -0

81 lines not on this page · raw message

hw/versatilepb.c +8 -0
index 49f8f5f..33bbeb9 100644
@@ -181,6 +181,7 @@ static void versatile_init(ram_addr_t ram_size,
     qemu_irq pic[32];
     qemu_irq sic[32];
     DeviceState *dev, *sysctl;
+    DeviceState *pl041;
     PCIBus *pci_bus;
     NICInfo *nd;
     int n;
@@ -265,6 +266,13 @@ static void versatile_init(ram_addr_t ram_size,
     /* Add PL031 Real Time Clock. */
     sysbus_create_simple("pl031", 0x101e8000, pic[10]);
 
+    /* Add PL041 AACI Interface to the LM4549 codec */
+    pl041 = qdev_create(NULL, "pl041");
+    qdev_prop_set_uint32(pl041, "nc_fifo_depth", 512);
+    qdev_init_nofail(pl041);
+    sysbus_mmio_map(sysbus_from_qdev(pl041), 0, 0x10004000);
+    sysbus_connect_irq(sysbus_from_qdev(pl041), 0, sic[24]);
+
     /* Memory map for Versatile/PB:  */
     /* 0x10000000 System registers.  */
     /* 0x10001000 PCI controller config registers.  */

--
1.7.0.4