+GENERAL
+=======
+
This package contains the firmware binaries for each loader program
-included in alsa-tools package. Specify the same prefix option given
-to the alsa-tools configure script, too, in order to keep the
+included in alsa-tools package. The firmware data can be used by each
+ALSA firmware loader program like vxloader, or passed through the
+hotplug firmware-loading mechanism.
+
+
+HOTPLUG FIRMWARE LOADER SUPPORT
+===============================
+
+The recent ALSA driver supports the hotplug firmware loader.
+As default, the package will install firmware data to the places for
+both the old ALSA fw loader and the hotplug fw loader. To disable
+the installation of old ALSA fw loader data (if both ALSA and hotplug
+fw loaders are available), pass --disable-loader to configure.
+Similarly, to disable the hotplug fw loader data, pass
+--disable-hotplug option.
+
+For the old ALSA fw loader, specify the same prefix option given to
+the alsa-tools configure script, too, in order to keep the
installation directories consistent.
+The default directory for hotplug firmware data files is
+/usr/lib/hotplug/firmware. You can change to another path via
+--with-hotplug-dir option.
+
+
+LICENSE AND COPYRIGHT
+=====================
+
+The files contained in this package is regarded as the example data
+for each alsa-tools program. Hence, their copyright and license
+follow basically to the definition of alsa-tools programs. The
+detailed license and copyright is found in README of each
+subdirectory.
echo $VERSION > $srcdir/version
+AC_ARG_ENABLE(loader,
+ [ --disable-loader Disable the old ALSA fw loader support],
+ [loader="$enableval"],[loader=yes])
+AC_ARG_ENABLE(hotplug,
+ [ --disable-hotplug Disable the hotplug fw loader support],
+ [hotplug="$enableval"],[hotplug=yes])
+
+AM_CONDITIONAL(USE_LOADER, test "$loader" = "yes")
+AM_CONDITIONAL(USE_HOTPLUG, test "$hotplug" = "yes")
+
+AC_ARG_WITH(hotplug-dir,
+ [ --with-hotplug-dir Specify the hotplug firmware directory],
+ [hotplugfwdir="$withval"],
+ [hotplugfwdir="/usr/lib/hotplug/firmware"])
+HOTPLUGFWDIR="$hotplugfwdir"
+AC_SUBST(HOTPLUGFWDIR)
+
+
AC_OUTPUT(Makefile \
hdsploader/Makefile \
mixartloader/Makefile \
MYNAME = mixartloader
-cfg_files = miXart.conf \
+cfg_files = miXart.conf
+dsp_files = \
miXart8AES.xlx \
miXart8.elf \
miXart8.xlx
-EXTRA_DIST = $(cfg_files)
+EXTRA_DIST = $(cfg_files) $(dsp_files)
+if USE_LOADER
firmwaredir = $(datadir)/alsa/firmware/$(MYNAME)
-firmware_DATA = $(cfg_files)
+firmware_DATA = $(cfg_files) $(dsp_files)
+else
+firmwaredir =
+firmware_DATA =
+endif
+
+if USE_HOTPLUG
+hotplugfwdir = @HOTPLUGFWDIR@/mixart
+hotplugfw_DATA = $(dsp_files)
+else
+hotplugfwdir =
+hotplugfw_DATA =
+endif
MYNAME = vxloader
-cfg_files = vx222.conf vxboard.conf vxpocket.conf vxp440.conf \
+cfg_files = vx222.conf vxboard.conf vxpocket.conf vxp440.conf
+
+dsp_files = \
bd56002.boot \
bd563s3.boot \
bd563v2.boot \
l_1_v22.d56 \
l_1_vx2.d56 \
l_1_vxp.d56 \
- l_1_vp4.d56 \
+ l_1_vp4.d56
+
+rbt_files = \
x1_2_v22.rbt \
x1_1_vx2.rbt \
x1_1_vxp.rbt \
x1_1_vp4.rbt
-EXTRA_DIST = $(cfg_files)
+xlx_files = $(rbt_files:%.rbt=%.xlx)
+
+noinst_PROGRAMS = toxlx
+toxlx_SOURCES = toxlx.c
+EXTRA_DIST = $(cfg_files) $(dsp_files) $(rbt_files) toxlx.c
+CLEANFILES = $(xlx_files)
+
+if USE_LOADER
firmwaredir = $(datadir)/alsa/firmware/$(MYNAME)
-firmware_DATA = $(cfg_files)
+firmware_DATA = $(cfg_files) $(dsp_files) $(rbt_files)
+else
+firmwaredir =
+firmware_DATA =
+endif
+
+if USE_HOTPLUG
+hotplugfwdir = @HOTPLUGFWDIR@/vx
+hotplugfw_DATA = $(dsp_files) $(xlx_files)
+else
+hotplugfwdir =
+hotplugfw_DATA =
+endif
+
+%.xlx: %.rbt toxlx
+ ./toxlx < $< > $@
--- /dev/null
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+
+int main()
+{
+ char buf[256];
+ int data, c, idx, length;
+ unsigned char *imgbuf = NULL;
+ char *p;
+
+ c = 0;
+ data = 0;
+ idx = 0;
+ length = 0;
+ while (fgets(buf, sizeof(buf), stdin)) {
+ if (strncmp(buf, "Bits:", 5) == 0) {
+ for (p = buf + 5; *p && isspace(*p); p++)
+ ;
+ if (! *p) {
+ fprintf(stderr, "corrupted file in Bits line\n");
+ return 1;
+ }
+ length = atoi(p);
+ length /= 8;
+ if (length <= 0) {
+ fprintf(stderr, "corrupted file, detected length = %d\n", length);
+ return 1;
+ }
+ imgbuf = malloc(length);
+ if (! imgbuf) {
+ fprintf(stderr, "cannot alloc %d bytes\n", length);
+ return 1;
+ }
+ continue;
+ }
+ if (buf[0] != '0' && buf[1] != '1')
+ continue;
+ if (length <= 0) {
+ fprintf(stderr, "corrupted file, starting without Bits line\n");
+ return 1;
+ }
+ for (p = buf; *p == '0' || *p == '1'; p++) {
+ data |= (*p - '0') << c;
+ c++;
+ if (c >= 8) {
+ imgbuf[idx] = data;
+ data = 0;
+ c = 0;
+ idx++;
+ if (idx >= length)
+ break;
+ }
+ }
+ }
+ if (c)
+ imgbuf[idx++] = data;
+ if (idx != length) {
+ fprintf(stderr, "length doesn't match: %d != %d\n", idx, length);
+ return 1;
+ }
+
+ for (idx = 0; idx < length; idx++)
+ putchar(imgbuf[idx]);
+
+ return 0;
+}