-/* FIXME: quick and dirty ifdefs */
-#ifdef SPDIF
- for (i=0; g_HexSpdifFw62[i].type == 0; i++) {
- if (INTERNAL_RAM(g_HexSpdifFw62[i].address)) {
- err = emi62_writememory(dev, g_HexSpdifFw62[i].address, g_HexSpdifFw62[i].data, g_HexSpdifFw62[i].length, ANCHOR_LOAD_INTERNAL);
- if (err < 0) {
- err("%s - error loading firmware: error = %d", __FUNCTION__, err);
- goto wraperr;
- }
- }
- }
-#else /* MIDI */
- for (i=0; g_HexMidiFw62[i].type == 0; i++) {
- if (INTERNAL_RAM(g_HexMidiFw62[i].address)) {
- err = emi62_writememory(dev, g_HexMidiFw62[i].address, g_HexMidiFw62[i].data, g_HexMidiFw62[i].length, ANCHOR_LOAD_INTERNAL);
+ for (rec = (const struct ihex_binrec *)firmware_fw->data;
+ rec; rec = ihex_next_binrec(rec)) {
+ if (INTERNAL_RAM(be32_to_cpu(rec->addr))) {
+ err = emi62_writememory(dev, be32_to_cpu(rec->addr),
+ rec->data, be16_to_cpu(rec->len),
+ ANCHOR_LOAD_EXTERNAL);