summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-04-10 12:01:22 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-10 12:01:22 -0700
commit1e17d774db837fe1a536066cbe971114405d2ba1 (patch)
tree41f2a21f6676eaace57ed4f4872f57d551e00c42 /firmware
parentd848223808c5d21e1b3cea090047e34722c6254b (diff)
parent0ce49d6da993adf8b17b7f3ed9805ade14a6a6f3 (diff)
Merge git://git.infradead.org/~dwmw2/firmware-2.6
* git://git.infradead.org/~dwmw2/firmware-2.6: qla1280: Fix off-by-some error in firmware loading. Add README.AddingFirmware file. Basically telling people not to. firmware: Remove newly-added slicoss and sxg firmware images firmware/WHENCE: Add missing origin information for Ambassador atmsar11.fw ALSA: wavefront - Always use request_firmware() Remove fdump tool for av7110 firmware firmware: convert av7110 driver to request_firmware() Partially revert "V4L/DVB (9533): cx88: Add support for TurboSight TBS8910 DVB-S PCI card" Revert "fix modules_install via NFS" Add-add conflicts in firmware/WHENCE fixed manually
Diffstat (limited to 'firmware')
-rw-r--r--firmware/.gitignore1
-rw-r--r--firmware/Makefile30
-rw-r--r--firmware/README.AddingFirmware34
-rw-r--r--firmware/WHENCE92
-rw-r--r--firmware/av7110/Boot.S109
-rw-r--r--firmware/av7110/bootcode.bin.ihex15
-rw-r--r--firmware/ihex2fw.c268
-rw-r--r--firmware/slicoss/gbdownload.sys.ihex6148
-rw-r--r--firmware/slicoss/gbrcvucode.sys.ihex162
-rw-r--r--firmware/slicoss/oasisdbgdownload.sys.ihex5124
-rw-r--r--firmware/slicoss/oasisdownload.sys.ihex5124
-rw-r--r--firmware/slicoss/oasisrcvucode.sys.ihex162
-rw-r--r--firmware/sxg/saharadbgdownloadB.sys.ihex3937
-rw-r--r--firmware/sxg/saharadownloadB.sys.ihex3385
-rw-r--r--firmware/yamaha/yss225_registers.bin.ihex998
15 files changed, 1484 insertions, 24105 deletions
diff --git a/firmware/.gitignore b/firmware/.gitignore
index f89a21fffbf1..d9c69017bc9a 100644
--- a/firmware/.gitignore
+++ b/firmware/.gitignore
@@ -3,3 +3,4 @@
*.bin
*.csp
*.dsp
+ihex2fw
diff --git a/firmware/Makefile b/firmware/Makefile
index 1e7fd4df16a7..142c17ab9e57 100644
--- a/firmware/Makefile
+++ b/firmware/Makefile
@@ -41,6 +41,7 @@ fw-shipped-$(CONFIG_COMPUTONE) += intelliport2.bin
fw-shipped-$(CONFIG_CHELSIO_T3) += cxgb3/t3b_psram-1.1.0.bin \
cxgb3/t3c_psram-1.1.0.bin \
cxgb3/t3fw-7.1.0.bin
+fw-shipped-$(CONFIG_DVB_AV7110) += av7110/bootcode.bin
fw-shipped-$(CONFIG_DVB_TTUSB_BUDGET) += ttusb-budget/dspbootcode.bin
fw-shipped-$(CONFIG_E100) += e100/d101m_ucode.bin e100/d101s_ucode.bin \
e100/d102e_ucode.bin
@@ -59,14 +60,9 @@ fw-shipped-$(CONFIG_SND_SB16_CSP) += sb16/mulaw_main.csp sb16/alaw_main.csp \
sb16/ima_adpcm_init.csp \
sb16/ima_adpcm_playback.csp \
sb16/ima_adpcm_capture.csp
-fw-shipped-$(CONFIG_SLICOSS) += slicoss/gbdownload.sys slicoss/gbrcvucode.sys \
- slicoss/oasisdbgdownload.sys \
- slicoss/oasisdownload.sys \
- slicoss/oasisrcvucode.sys
-fw-shipped-$(CONFIG_SXG) += sxg/saharadownloadB.sys \
- sxg/saharadbgdownloadB.sys
fw-shipped-$(CONFIG_SND_YMFPCI) += yamaha/ds1_ctrl.fw yamaha/ds1_dsp.fw \
yamaha/ds1e_ctrl.fw
+fw-shipped-$(CONFIG_SND_WAVEFRONT) += yamaha/yss225_registers.bin
fw-shipped-$(CONFIG_TEHUTI) += tehuti/bdx.bin
fw-shipped-$(CONFIG_TIGON3) += tigon/tg3.bin tigon/tg3_tso.bin \
tigon/tg3_tso5.bin
@@ -123,10 +119,10 @@ quiet_cmd_ihex = IHEX $@
cmd_ihex = $(OBJCOPY) -Iihex -Obinary $< $@
quiet_cmd_ihex2fw = IHEX2FW $@
- cmd_ihex2fw = $(objtree)/scripts/ihex2fw $< $@
+ cmd_ihex2fw = $(objtree)/$(obj)/ihex2fw $< $@
quiet_cmd_h16tofw = H16TOFW $@
- cmd_h16tofw = $(objtree)/scripts/ihex2fw -w $< $@
+ cmd_h16tofw = $(objtree)/$(obj)/ihex2fw -w $< $@
quiet_cmd_fwbin = MK_FW $@
cmd_fwbin = FWNAME="$(patsubst firmware/%.gen.S,%,$@)"; \
@@ -185,15 +181,27 @@ $(patsubst %,$(obj)/%.gen.o, $(fw-external-y)): $(obj)/%.gen.o: $(fwdir)/%
$(obj)/%: $(obj)/%.ihex | $(objtree)/$(obj)/$$(dir %)
$(call cmd,ihex)
+# Don't depend on ihex2fw if we're installing and it already exists.
+# Putting it after | in the dependencies doesn't seem sufficient when
+# we're installing after a cross-compile, because ihex2fw has dependencies
+# on stuff like /usr/lib/gcc/ppc64-redhat-linux/4.3.0/include/stddef.h and
+# thus wants to be rebuilt. Which it can't be, if the prebuilt kernel tree
+# is exported read-only for someone to run 'make install'.
+ifeq ($(INSTALL):$(wildcard $(obj)/ihex2fw),install:$(obj)/ihex2fw)
+ihex2fw_dep :=
+else
+ihex2fw_dep := $(obj)/ihex2fw
+endif
+
# .HEX is also Intel HEX, but where the offset and length in each record
# is actually meaningful, because the firmware has to be loaded in a certain
# order rather than as a single binary blob. Thus, we convert them into our
# more compact binary representation of ihex records (<linux/ihex.h>)
-$(obj)/%.fw: $(obj)/%.HEX | $(objtree)/$(obj)/$$(dir %)
+$(obj)/%.fw: $(obj)/%.HEX $(ihex2fw_dep) | $(objtree)/$(obj)/$$(dir %)
$(call cmd,ihex2fw)
# .H16 is our own modified form of Intel HEX, with 16-bit length for records.
-$(obj)/%.fw: $(obj)/%.H16 | $(objtree)/$(obj)/$$(dir %)
+$(obj)/%.fw: $(obj)/%.H16 $(ihex2fw_dep) | $(objtree)/$(obj)/$$(dir %)
$(call cmd,h16tofw)
$(firmware-dirs):
@@ -210,3 +218,5 @@ targets := $(fw-shipped-) $(patsubst $(obj)/%,%, \
# Without this, built-in.o won't be created when it's empty, and the
# final vmlinux link will fail.
obj-n := dummy
+
+hostprogs-y := ihex2fw
diff --git a/firmware/README.AddingFirmware b/firmware/README.AddingFirmware
new file mode 100644
index 000000000000..e24cd8986d8b
--- /dev/null
+++ b/firmware/README.AddingFirmware
@@ -0,0 +1,34 @@
+
+ DO NOT ADD FIRMWARE TO THIS DIRECTORY.
+ ======================================
+
+This directory is only here to contain firmware images extracted from old
+device drivers which predate the common use of request_firmware().
+
+As we update those drivers to use request_firmware() and keep a clean
+separation between code and firmware, we put the extracted firmware
+here.
+
+This directory is _NOT_ for adding arbitrary new firmware images. The
+place to add those is the separate linux-firmware repository:
+
+ git://git.kernel.org/pub/scm/linux/kernel/git/dwmw2/linux-firmware.git
+
+That repository contains all these firmware images which have been
+extracted from older drivers, as well various new firmware images which
+we were never permitted to include in a GPL'd work, but which we _have_
+been permitted to redistribute under separate cover.
+
+To submit firmware to that repository, please send either a git binary
+diff or preferably a git pull request to:
+ David Woodhouse <dwmw2@infradead.org>
+
+Your commit should include an update to the WHENCE file clearly
+identifying the licence under which the firmware is available, and
+that it is redistributable. If the licence is long and involved, it's
+permitted to include it in a separate file and refer to it from the
+WHENCE file.
+
+Ideally, your commit should contain a Signed-Off-By: from someone
+authoritative on the licensing of the firmware in question (i.e. from
+within the company that owns the code).
diff --git a/firmware/WHENCE b/firmware/WHENCE
index e4deb511cc73..10f61c9e5a8a 100644
--- a/firmware/WHENCE
+++ b/firmware/WHENCE
@@ -8,6 +8,24 @@ kernel.
--------------------------------------------------------------------------
+Driver: ambassador -- Madge Ambassador (Collage PCI 155 Server) ATM NIC.
+
+File: firmware/atmsar11.fw
+
+Licence: Allegedly GPLv2+, but no source visible. Marked:
+
+ Madge Ambassador ATM Adapter microcode.
+ Copyright (C) 1995-1999 Madge Networks Ltd.
+
+ This microcode data is placed under the terms of the GNU General
+ Public License. The GPL is contained in /usr/doc/copyright/GPL on a
+ Debian system and in the file COPYING in the Linux kernel source.
+
+ We would prefer you not to distribute modified versions without
+ consultation and not to ask for assembly/other microcode source.
+
+--------------------------------------------------------------------------
+
Driver: korg1212 -- Korg 1212 IO audio device
File: korg/k1212.dsp
@@ -390,59 +408,6 @@ Found in hex form in kernel source.
--------------------------------------------------------------------------
-Driver: SLICOSS - Alacritech IS-NIC products
-
-File: slicoss/gbdownload.sys.ihex
-File: slicoss/gbrcvucode.sys.ihex
-File: slicoss/oasisdbgdownload.sys.ihex
-File: slicoss/oasisdownload.sys.ihex
-File: slicoss/oasisrcvucode.sys.ihex
-
-Licence:
- Copyright (C) 1999-2009 Alacritech, Inc.
-
- as an unpublished work. This notice does not imply unrestricted or
- public access to the source code from which this firmware image is
- derived. Except as noted below this firmware image may not be
- reproduced, used, sold or transferred to any third party without
- Alacritech's prior written consent. All Rights Reserved.
-
- Permission is hereby granted for the distribution of this firmware
- image as part of a Linux or other Open Source operating system kernel
- in text or binary form as required.
-
- This firmware may not be modified and may only be used with
- Alacritech hardware.
-
-Found in hex form in kernel source.
-
---------------------------------------------------------------------------
-
-Driver: SXG - Alacritech IS-NIC products
-
-File: sxg/saharadownloadB.sys.ihex
-File: sxg/saharadbgdownloadB.sys.ihex
-
-Licence:
- Copyright (C) 1999-2009 Alacritech, Inc.
-
- as an unpublished work. This notice does not imply unrestricted or
- public access to the source code from which this firmware image is
- derived. Except as noted below this firmware image may not be
- reproduced, used, sold or transferred to any third party without
- Alacritech's prior written consent. All Rights Reserved.
-
- Permission is hereby granted for the distribution of this firmware
- image as part of a Linux or other Open Source operating system kernel
- in text or binary form as required.
-
- This firmware may not be modified and may only be used with
- Alacritech hardware.
-
-Found in hex form in kernel source.
-
---------------------------------------------------------------------------
-
Driver: cxgb3 - Chelsio Terminator 3 1G/10G Ethernet adapter
File: cxgb3/t3b_psram-1.1.0.bin.ihex
@@ -662,3 +627,24 @@ Licence:
Found in hex form in kernel source.
--------------------------------------------------------------------------
+
+Driver: DVB AV7110 -- AV7110 cards
+
+File: av7110/bootcode.bin
+
+Licence: GPLv2 or later
+
+ARM assembly source code available at http://www.linuxtv.org/downloads/firmware/Boot.S
+
+--------------------------------------------------------------------------
+
+Driver: wavefront - ISA WaveFront sound card
+
+File: yamaha/yss225_registers.bin
+
+Licence: Allegedly GPLv2+, but no source visible.
+
+Found in hex form in kernel source, with the following comment:
+ Copyright (c) 1998-2002 by Paul Davis <pbd@op.net>
+
+--------------------------------------------------------------------------
diff --git a/firmware/av7110/Boot.S b/firmware/av7110/Boot.S
new file mode 100644
index 000000000000..d562fdc2908f
--- /dev/null
+++ b/firmware/av7110/Boot.S
@@ -0,0 +1,109 @@
+/*
+ Boot.S: boot loader for Siemens DVB-S card
+
+ Copyright (C) 2001 Convergence integrated media GmbH
+ Written by Ralph Metzler
+ <rjkm@convergence.de>
+ Copyright (C) 2006 Matthieu CASTET <castet.mattheiu@free.fr>
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+*/
+
+/*
+ check AV711x_3_1.pdf for some hardware infos
+ build it with :
+ $ cc -mbig-endian -c Boot.S
+ $ ld -Ttext 0x2c000000 -EB -o Boot Boot.o
+ $ objcopy -Obinary Boot
+*/
+
+ .text
+ .align
+ .globl _start
+_start:
+ b reset // reset vector
+ movs pc, r14 // undefined
+ subs pc, r14, #4 // SWI
+ subs pc, r14, #4 // prefetch abort
+ subs pc, r14, #8 // data abort
+ subs pc, r14, #4 // reserved
+ subs pc, r14, #4 // IRQ
+ subs pc, r14, #4 // FIQ
+
+ .word tbl // table needed by firmware ROM
+tbl: .word (endtbl - tbl)
+ .word 0
+ .word conf
+endtbl: .word 0
+conf: .word 0xa5a55a5a
+ .word 0x001f1555
+ .word 0x00000009
+
+reset: ldr r13, buffer
+ ldr r4, flag
+ mov r0, #0
+ str r0, [r4]
+ str r0, [r4, #4]
+
+ ldr r1, wait_address
+ ldr r2, flag_address
+ ldr r3, sram
+
+copycode: // copy the code HW Sram
+ ldmia r1!, {r5-r12}
+ stmia r3!, {r5-r12}
+ cmp r1, r2
+ ble copycode
+ ldr pc, sram // jump to the copied code
+
+wait: ldrh r1, [r4] // wait for flag!=0
+ cmp r1, #0
+ beq wait
+
+ mov r1, r13 // buffer address
+ ldr r3, [r4,#4] // destaddr
+
+ ldrh r2, [r4,#2] // get segment length
+ add r2, r2, #63 // round length to next 64 bytes
+ movs r2, r2, lsr #6 // and divide by 64
+ moveq r0, #2 // if 0, set flag to 2, else signal
+ strh r0, [r4] // that buffer is accepted by setting to 0
+ beq wait
+
+copyloop:
+ ldmia r1!, {r5-r12}
+ stmia r3!, {r5-r12}
+ ldmia r1!, {r5-r12}
+ stmia r3!, {r5-r12}
+ subs r2, r2, #1
+ bne copyloop
+
+ eor r13, r13, #0x1400 // switch to other buffer
+ b wait
+
+// flag is stored at 0x2c0003f8, length at 0x2c0003fa,
+// destaddr at 0x2c0003fc
+
+flag: .word 0x2c0003f8
+
+
+// buffer 1 is at 0x2c000400, buffer 2 at 0x2c001000
+
+buffer: .word 0x2c000400
+
+sram: .word 0x9e000800
+wait_address: .word wait
+flag_address: .word flag
diff --git a/firmware/av7110/bootcode.bin.ihex b/firmware/av7110/bootcode.bin.ihex
new file mode 100644
index 000000000000..26a2993e0723
--- /dev/null
+++ b/firmware/av7110/bootcode.bin.ihex
@@ -0,0 +1,15 @@
+:10000000EA00000EE1B0F00EE25EF004E25EF00401
+:10001000E25EF008E25EF004E25EF004E25EF0040C
+:100020002C0000240000000C000000002C00003414
+:1000300000000000A5A55A5A001F15550000000930
+:10004000E59FD07CE59F4074E3A00000E5840000BC
+:10005000E5840004E59F1070E59F2070E59F306403
+:10006000E8B11FE0E8A31FE0E1510002DAFFFFFB67
+:10007000E59FF050E1D410B0E35100000AFFFFFC0F
+:10008000E1A0100DE5943004E1D420B2E282203FDB
+:10009000E1B0232203A00002E1C400B00AFFFFF494
+:1000A000E8B11FE0E8A31FE0E8B11FE0E8A31FE00C
+:1000B000E25220011AFFFFF9E22DDB05EAFFFFEC17
+:1000C0002C0003F82C0004009E0008002C00007493
+:0400D0002C0000C040
+:00000001FF
diff --git a/firmware/ihex2fw.c b/firmware/ihex2fw.c
new file mode 100644
index 000000000000..8f7fdaa9e010
--- /dev/null
+++ b/firmware/ihex2fw.c
@@ -0,0 +1,268 @@
+/*
+ * Parser/loader for IHEX formatted data.
+ *
+ * Copyright © 2008 David Woodhouse <dwmw2@infradead.org>
+ * Copyright © 2005 Jan Harkes <jaharkes@cs.cmu.edu>
+ *
+ * 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 by the Free Software Foundation.
+ */
+
+#include <stdint.h>
+#include <arpa/inet.h>
+#include <stdio.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/mman.h>
+#include <fcntl.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdlib.h>
+#define _GNU_SOURCE
+#include <getopt.h>
+
+
+struct ihex_binrec {
+ struct ihex_binrec *next; /* not part of the real data structure */
+ uint32_t addr;
+ uint16_t len;
+ uint8_t data[];
+};
+
+/**
+ * nybble/hex are little helpers to parse hexadecimal numbers to a byte value
+ **/
+static uint8_t nybble(const uint8_t n)
+{
+ if (n >= '0' && n <= '9') return n - '0';
+ else if (n >= 'A' && n <= 'F') return n - ('A' - 10);
+ else if (n >= 'a' && n <= 'f') return n - ('a' - 10);
+ return 0;
+}
+
+static uint8_t hex(const uint8_t *data, uint8_t *crc)
+{
+ uint8_t val = (nybble(data[0]) << 4) | nybble(data[1]);
+ *crc += val;
+ return val;
+}
+
+static int process_ihex(uint8_t *data, ssize_t size);
+static void file_record(struct ihex_binrec *record);
+static int output_records(int outfd);
+
+static int sort_records = 0;
+static int wide_records = 0;
+
+int usage(void)
+{
+ fprintf(stderr, "ihex2fw: Convert ihex files into binary "
+ "representation for use by Linux kernel\n");
+ fprintf(stderr, "usage: ihex2fw [<options>] <src.HEX> <dst.fw>\n");
+ fprintf(stderr, " -w: wide records (16-bit length)\n");
+ fprintf(stderr, " -s: sort records by address\n");
+ return 1;
+}
+
+int main(int argc, char **argv)
+{
+ int infd, outfd;
+ struct stat st;
+ uint8_t *data;
+ int opt;
+
+ while ((opt = getopt(argc, argv, "ws")) != -1) {
+ switch (opt) {
+ case 'w':
+ wide_records = 1;
+ break;
+ case 's':
+ sort_records = 1;
+ break;
+ default:
+ return usage();
+ }
+ }
+
+ if (optind + 2 != argc)
+ return usage();
+
+ if (!strcmp(argv[optind], "-"))
+ infd = 0;
+ else
+ infd = open(argv[optind], O_RDONLY);
+ if (infd == -1) {
+ fprintf(stderr, "Failed to open source file: %s",
+ strerror(errno));
+ return usage();
+ }
+ if (fstat(infd, &st)) {
+ perror("stat");
+ return 1;
+ }
+ data = mmap(NULL, st.st_size, PROT_READ, MAP_SHARED, infd, 0);
+ if (data == MAP_FAILED) {
+ perror("mmap");
+ return 1;
+ }
+
+ if (!strcmp(argv[optind+1], "-"))
+ outfd = 1;
+ else
+ outfd = open(argv[optind+1], O_TRUNC|O_CREAT|O_WRONLY, 0644);
+ if (outfd == -1) {
+ fprintf(stderr, "Failed to open destination file: %s",
+ strerror(errno));
+ return usage();
+ }
+ if (process_ihex(data, st.st_size))
+ return 1;
+
+ output_records(outfd);
+ return 0;
+}
+
+static int process_ihex(uint8_t *data, ssize_t size)
+{
+ struct ihex_binrec *record;
+ uint32_t offset = 0;
+ uint8_t type, crc = 0, crcbyte = 0;
+ int i, j;
+ int line = 1;
+ int len;
+
+ i = 0;
+next_record:
+ /* search for the start of record character */
+ while (i < size) {
+ if (data[i] == '\n') line++;
+ if (data[i++] == ':') break;
+ }
+
+ /* Minimum record length would be about 10 characters */
+ if (i + 10 > size) {
+ fprintf(stderr, "Can't find valid record at line %d\n", line);
+ return -EINVAL;
+ }
+
+ len = hex(data + i, &crc); i += 2;
+ if (wide_records) {
+ len <<= 8;
+ len += hex(data + i, &crc); i += 2;
+ }
+ record = malloc((sizeof (*record) + len + 3) & ~3);
+ if (!record) {
+ fprintf(stderr, "out of memory for records\n");
+ return -ENOMEM;
+ }
+ memset(record, 0, (sizeof(*record) + len + 3) & ~3);
+ record->len = len;
+
+ /* now check if we have enough data to read everything */
+ if (i + 8 + (record->len * 2) > size) {
+ fprintf(stderr, "Not enough data to read complete record at line %d\n",
+ line);
+ return -EINVAL;
+ }
+
+ record->addr = hex(data + i, &crc) << 8; i += 2;
+ record->addr |= hex(data + i, &crc); i += 2;
+ type = hex(data + i, &crc); i += 2;
+
+ for (j = 0; j < record->len; j++, i += 2)
+ record->data[j] = hex(data + i, &crc);
+
+ /* check CRC */
+ crcbyte = hex(data + i, &crc); i += 2;
+ if (crc != 0) {
+ fprintf(stderr, "CRC failure at line %d: got 0x%X, expected 0x%X\n",
+ line, crcbyte, (unsigned char)(crcbyte-crc));
+ return -EINVAL;
+ }
+
+ /* Done reading the record */
+ switch (type) {
+ case 0:
+ /* old style EOF record? */
+ if (!record->len)
+ break;
+
+ record->addr += offset;
+ file_record(record);
+ goto next_record;
+
+ case 1: /* End-Of-File Record */
+ if (record->addr || record->len) {
+ fprintf(stderr, "Bad EOF record (type 01) format at line %d",
+ line);
+ return -EINVAL;
+ }
+ break;
+
+ case 2: /* Extended Segment Address Record (HEX86) */
+ case 4: /* Extended Linear Address Record (HEX386) */
+ if (record->addr || record->len != 2) {
+ fprintf(stderr, "Bad HEX86/HEX386 record (type %02X) at line %d\n",
+ type, line);
+ return -EINVAL;
+ }
+
+ /* We shouldn't really be using the offset for HEX86 because
+ * the wraparound case is specified quite differently. */
+ offset = record->data[0] << 8 | record->data[1];
+ offset <<= (type == 2 ? 4 : 16);
+ goto next_record;
+
+ case 3: /* Start Segment Address Record */
+ case 5: /* Start Linear Address Record */
+ if (record->addr || record->len != 4) {
+ fprintf(stderr, "Bad Start Address record (type %02X) at line %d\n",
+ type, line);
+ return -EINVAL;
+ }
+
+ /* These records contain the CS/IP or EIP where execution
+ * starts. Don't really know what to do with them. */
+ goto next_record;
+
+ default:
+ fprintf(stderr, "Unknown record (type %02X)\n", type);
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
+static struct ihex_binrec *records;
+
+static void file_record(struct ihex_binrec *record)
+{
+ struct ihex_binrec **p = &records;
+
+ while ((*p) && (!sort_records || (*p)->addr < record->addr))
+ p = &((*p)->next);
+
+ record->next = *p;
+ *p = record;
+}
+
+static int output_records(int outfd)
+{
+ unsigned char zeroes[6] = {0, 0, 0, 0, 0, 0};
+ struct ihex_binrec *p = records;
+
+ while (p) {
+ uint16_t writelen = (p->len + 9) & ~3;
+
+ p->addr = htonl(p->addr);
+ p->len = htons(p->len);
+ write(outfd, &p->addr, writelen);
+ p = p->next;
+ }
+ /* EOF record is zero length, since we don't bother to represent
+ the type field in the binary version */
+ write(outfd, zeroes, 6);
+ return 0;
+}
diff --git a/firmware/slicoss/gbdownload.sys.ihex b/firmware/slicoss/gbdownload.sys.ihex
deleted file mode 100644
index dc17e639b69a..000000000000
--- a/firmware/slicoss/gbdownload.sys.ihex
+++ /dev/null
@@ -1,6148 +0,0 @@
-:10000000020000000080000000000100000000006D
-:10001000008000001200004081B200001800004083
-:1000200081B200001E00004081B2000003000040C9
-:1000300081B20000000000A898B001000480A24036
-:10004000FD7F00000900A249DD7D00000000004C9A
-:1000500080B2010007000040D1B100000000004C58
-:1000600080B201000900A240757D000060000040E0
-:10007000619901000B00A8B17E3100000900004029
-:1000800081B200001100004081B2000000801FE931
-:1000900018310000000041E980B201000F0040E982
-:1000A00080B2000000000040A59901001600294020
-:1000B00081320000160014BC803200000F0093BC97
-:1000C000803200000000504081B2010000800040FA
-:1000D00081B2000010000040A59901001C002940D9
-:1000E000813200001C0014BC80320000110093BC5F
-:1000F000803200000000504081B2010001800040C9
-:1001000081B2000020000040A59901002200294092
-:1001100081320000220014BC803200000E0093BC2B
-:100120008032000000000049DD8101002B01004009
-:10013000813201003C01004081320100270014BCE3
-:1001400080320000140113BC80320000549500403E
-:1001500045990100FFFF0040E599010000002F4094
-:1001600049B1010000000040E1B101000000004B76
-:10017000B7B3010000000040B5B30100D900004052
-:10018000B333010000000040B6D30100320095E80F
-:1001900080320000FFFF00E880880100B8002640A0
-:1001A0008132000000000040FDB30100000000406B
-:1001B000FFB301003C002250836C000000000045AA
-:1001C000FD930100A5A500A6B4A701003C00A25024
-:1001D000B573000000010040813201003C00A245DF
-:1001E0008032000000000046FD9301004100004005
-:1001F00081B200007F000020F5CF01001C0100FA51
-:10020000B3330100A5A500DAB5AB01009900A250F7
-:10021000B563000000000044FD930100D5000044D8
-:10022000B333010000000040D5990100000000DA5E
-:10023000D7B10100FFFF00DAED8B0100D5000046C9
-:10024000B333010008000040D5990100000000DA36
-:10025000D7B10100FF0000DAEF8B0100FF0000DAE8
-:10026000E38F0100D5000048B33301003C0000409B
-:10027000D5990100FF0000DAD78D0100FFFF00DAF9
-:10028000F1DB0100FF0000DAE98B0100000000480B
-:10029000E9E30100D500004BB33301002C0000401E
-:1002A000D5990100000000DAD7B10100D500004C5B
-:1002B000B3330100FFFF00DAEBDB0100D500004E95
-:1002C000B3330100030000DA818801000000005C04
-:1002D00081E00100FFFF00DAB5DB01005C00264091
-:1002E00081320000010000DAB5CF010000F000A764
-:1002F000B4870100000000DA819401000000004092
-:10030000D8B10100D5000050B3330100FFFF00DA7F
-:10031000B58B01006200264CB5630000010000DAD5
-:10032000B5CF0100000000DADFB10100D5000052B6
-:10033000B3330100FF0000DA4B890100080000DA46
-:10034000DFF70100FF0000EFDF8B010069002240B2
-:10035000DF7F000000000047FD9301002000004007
-:10036000B39B0100D500004081320100060000402F
-:10037000D5990100080000DAD7E50100F80000DA9D
-:10038000B38B010034000040D5990100000000D972
-:10039000D7B10100020000D9D5C90100000000DA80
-:1003A000D7B1010022000040B39B0100D5000040FE
-:1003B0008132010000000048B5F30100030000DABB
-:1003C0007B89010000010040DD9B0100D500005D3C
-:1003D000B3330100FFFF00DAE78B01008A002640FB
-:1003E0008132000000000041FD9301000000005038
-:1003F000E7E3010000010040D5990100000000F68C
-:10040000E7970100000000F3D7B10100D500005EBE
-:10041000B3330100FF0000DAE58B01000000004863
-:10042000E5E3010008010040D5990100FF0000DA72
-:10043000B58F0100000000F7B5970100000000DA59
-:10044000D7B101003C010040D5990100000000F83F
-:10045000E5970100000000F2D7B101000002004062
-:10046000DD9B0100960022F5813200000000004271
-:10047000FD930100000000EED5B10100000000F680
-:10048000EB970100000000F5D7B10100080000EA79
-:10049000D4C90100000000F7E3970100000000F15B
-:1004A000D7B101003C0000EEDDCB0100000000EE02
-:1004B000D5B10100000000F8E9970100000000F448
-:1004C000D7B10100D500004AB3330100FFFF00DAC5
-:1004D000DD890100B700004081B20000000000404B
-:1004E000D5990100050000A6D6B101009A1300EBD2
-:1004F000D699010008000040D5990100000200A62D
-:10050000D6B10100010000EBD69901002C0000409B
-:10051000D5990100050000A6D6B101009A1300EBA1
-:10052000D69901003C010040D5990100000200402D
-:10053000D799010000000042FD9301003C000040FB
-:10054000D5990100000000A6D6B10100000100EB22
-:10055000D699010000010040D5990100060000A6CF
-:10056000D6B101009A1300EBD699010008010040B2
-:10057000D5990100000200A6D6B10100010000EBF0
-:10058000D699010000000040D9B1010000000040F0
-:10059000DFB1010006000040D5990100A00000A6CF
-:1005A000D6B10100640000404B99010000000040FA
-:1005B0007B99010002040040DD990100B70013BCE3
-:1005C0008032000002080040DD9901000000004C6C
-:1005D000DD910100B80095E88430000000002FE9AB
-:1005E000FAB3010000000040D1B10100FF00004259
-:1005F000808801003400004080CE0100B800A64091
-:1006000081320000C100004081320100028022409E
-:1006100080320000B800004081B200000000004FAE
-:1006200081B00100CA0009F981320000C80008F950
-:1006300081320000D4001FFDF9330000C7009EFD89
-:10064000813200000000004AF3930100000080485E
-:10065000F3930100000000FDF7B3010000008049A2
-:10066000F3930100000000FC19B10100CF000AF96A
-:1006700081320000000040FB81B20100000041FD1A
-:1006800081B20100000780F9F38F0100000742F9F1
-:10069000F38F0100D300A2FFF76F0000000043407A
-:1006A00081B201000000A2FFFBEF0000000080FC0F
-:1006B000E1B101000000804081B00100D80006FED9
-:1006C0008132000000000041B3E301001C0100FA88
-:1006D000B3C30000DA0000428DB00000000000410A
-:1006E0008DB001000004004083980100EB00004041
-:1006F000813201000000005083B0010000008496A8
-:1007000080B2000026010040813201002501004036
-:100710002D110100000000402D810100000000DAD1
-:10072000B5EB0100E400849680320000E500004053
-:10073000B593000000000040B5830100DE00A24137
-:1007400083500000000000422D810100260100417D
-:100750002D01010000000041B3C30100DA00A241F5
-:100760008D500000000080DAB5BF01000000004B92
-:1007700081B00100000000DB81D00100000000D941
-:10078000B9B3010000000040B8E30100000000DC44
-:10079000B9EB010000000041B8970100150000DC32
-:1007A000B9E70100000000412D810100000000DBDD
-:1007B00081B00100270100422D11010025010040F8
-:1007C0002D110100280100402D0101000000004111
-:1007D0002D910100260100408132010025010040D9
-:1007E0002D110100000000402D8101000000A241F8
-:1007F00081D000000000849680320100FF00A0DC60
-:10080000B96B0000F80000412D910000F800004194
-:100810002D810000D8000040B3330100000090DAC1
-:100820008BB000001100004588F401004000004436
-:1008300080CE01000000A44081B200000000A3446B
-:1008400089EC00000000004289D001000000004255
-:1008500087B00100D9000043B2330100000000500E
-:10086000B5F301000C01A0DA8B400000000000414C
-:100870008BC001000000004187C001000801A241B7
-:1008800089500000FFFF00458888010010000045E6
-:100890008AF40100120190448A40000000000041E7
-:1008A0008BC00100FFFF00458AA8010000008050B6
-:1008B0008BE0010000800040F99B010000C0004077
-:1008C000B3CF01001C0100FC193101001C0140DA0A
-:1008D00081320100000041DA81B2010000000041D4
-:1008E000F9C3010016019FDA813200000280004046
-:1008F00081B200000000004491B00100000000D966
-:100900002BB101001E019F9480320000180000945A
-:1009100092E4010000000048B5F301000000004926
-:10092000B497010000000041B3C301001D01A241C2
-:1009300091500000000080402BB1010029010051BE
-:1009400093B000002901004D93B000002901004937
-:1009500093B000000000004293B001002901A241C1
-:10096000935000000000804081B201000000104060
-:1009700081B201000000114081B20100000012406C
-:1009800081B201000000134081B201000000144058
-:1009900081B201000000154081B201000000164044
-:1009A00081B201000000174081B201000000184030
-:1009B00081B201000000194081B2010000001A401C
-:1009C00081B2010000001B4081B2010000001C4008
-:1009D00081B2010000001D4081B2010000001E40F4
-:1009E00081B2010000001F4081B201000000804080
-:1009F00081B2010000040040A199010000000050F4
-:100A0000A1D10100000000401BB001000000004027
-:100A100019B001000000004017B0010000000040C4
-:100A200015B001000000004013B0010000000040BC
-:100A300011B00100000000400FB0010000000040B4
-:100A40000DB00100000000400BB0010000000040AC
-:100A500009B001000000004007B0010000000040A4
-:100A600005B001000000004003B00100000000409C
-:100A700001B0010044012048A15100000000804065
-:100A800081B201005001224B747D000000008040C3
-:100A900081B201006000004B60990100000000B1CC
-:100AA0007EB101005101A840813200004E0100409A
-:100AB00081B20000040080409798010000000058B7
-:100AC00007900100F39F004081B200000000004445
-:100AD000A5B30100AF02004081320100C502004011
-:100AE000813201000000005C07900100F39F00408C
-:100AF000BFB300005F0122CC857F000000000051E1
-:100B000007900100F39F004081B200000000004008
-:100B100049B10100AE0300CBA3C90100D0140040CD
-:100B2000A19B01000000002046B101000000004828
-:100B3000F1B10100000000D0F1B10100000000CAD5
-:100B4000F1B10100000000D5E1B101000700004053
-:100B5000619901002000002062DD01006801A840C9
-:100B600081320000000000CC85930100C5020040E6
-:100B700081320100D014004043990100000000FAC6
-:100B8000BAB30100000000FAA4B30100000000F8AD
-:100B9000BCB3010000142F4081B00100000000E749
-:100BA000A7B30100000000D8A9B30100FF0000DDD9
-:100BB000818801000200004080F4010078010040BB
-:100BC00080C80100880100DD813200000000004083
-:100BD00010B100008901004081B200008A0100408C
-:100BE00081B200008B01004081B200008C01004006
-:100BF00081B200008D01004081B200008F010040F1
-:100C000081B200009101004081B200005501004016
-:100C100081B20000D201004081B2000055010040C5
-:100C200081B20000E001004081B20000E10100401B
-:100C300081B200007F02004081B2000080020040CB
-:100C400081B20000F19F004081B20000F29F00409D
-:100C500081B200007701004181C01A005A01514061
-:100C600081B21A005A01524081B21A005A0155400D
-:100C700081B21A005A01564081B21A005501918181
-:100C800080301A005A01454081B21A005501918204
-:100C900080301A005A01464081B200000000004036
-:100CA00089B0010000002F4081B001000014004015
-:100CB00049990100B50122DEE16D00000000004C01
-:100CC00049C101000000004181C001009401A2441B
-:100CD000816C00000000004C49D101009C012240C1
-:100CE000E16D00009801A2418150000055010041D2
-:100CF000BFB3000000000042BFB301005501A00FC8
-:100D0000BD6F0000000000DEE1B101000000004402
-:100D100049C10100B701004019990100000042409B
-:100D200081B20100000043FF85B00100000000DE39
-:100D300019B10100000042FF87B00100000043FF2D
-:100D4000E1B101000000004449C1010000002FFF93
-:100D5000E1B10100081400A480CC0100AC012640E0
-:100D6000813200000000004185C00100AA01A24CB0
-:100D700081500000B60122D281320000B10122412F
-:100D8000A56F00005501A2E081320000000000D2F2
-:100D9000C1B301000000005C8990010000004042E6
-:100DA00080B201000000414380B20100000000F069
-:100DB000889401005A010044E0B10000B3010048EA
-:100DC00049C10000B101005B89900000B09F00A004
-:100DD0009EB000000000004D81B001000000004303
-:100DE000CB8301000000454081B20100BA01A2415D
-:100DF000815000000000454081B2010000004540E4
-:100E000081B20100C4019182823000000000008A9A
-:100E100080B00100B69F004080CE0100C301A64013
-:100E200081320000C401564081B20000000000532E
-:100E30006F930100F39F00526F9300000000004D7C
-:100E400081B0010000000042CD8301000000464057
-:100E500081B20100C701A24181500000000046405C
-:100E600081B201000000464081B20100D1019181B0
-:100E7000823000000000008980B00100B69F004071
-:100E800080CE0100D001A64081320000D101554042
-:100E900081B20000000000526F930100F39F0053E5
-:100EA0006F9300000000004083B001000014004078
-:100EB000499901000000234081B00100DA0122DEDF
-:100EC000E16D00000000004C49C10100000000413C
-:100ED0008