diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/.gitignore | 1 | ||||
-rw-r--r-- | firmware/Makefile | 12 | ||||
-rw-r--r-- | firmware/WHENCE | 12 | ||||
-rw-r--r-- | firmware/dsp56k/bootstrap.asm | 26 | ||||
-rw-r--r-- | firmware/e100/d101m_ucode.bin.ihex | 38 | ||||
-rw-r--r-- | firmware/e100/d101s_ucode.bin.ihex | 38 | ||||
-rw-r--r-- | firmware/e100/d102e_ucode.bin.ihex | 38 | ||||
-rw-r--r-- | firmware/ihex2fw.c | 268 |
8 files changed, 145 insertions, 288 deletions
diff --git a/firmware/.gitignore b/firmware/.gitignore index d9c69017bc9..f89a21fffbf 100644 --- a/firmware/.gitignore +++ b/firmware/.gitignore @@ -3,4 +3,3 @@ *.bin *.csp *.dsp -ihex2fw diff --git a/firmware/Makefile b/firmware/Makefile index d872b7942a3..ea1d28f9b44 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -37,6 +37,8 @@ fw-shipped-$(CONFIG_CHELSIO_T3) += cxgb3/t3b_psram-1.1.0.bin \ cxgb3/t3c_psram-1.1.0.bin \ cxgb3/t3fw-7.0.0.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 fw-shipped-$(CONFIG_SMCTR) += tr_smctr.bin fw-shipped-$(CONFIG_SND_KORG1212) += korg/k1212.dsp fw-shipped-$(CONFIG_SND_MAESTRO3) += ess/maestro3_assp_kernel.fw \ @@ -99,10 +101,10 @@ quiet_cmd_ihex = IHEX $@ cmd_ihex = $(OBJCOPY) -Iihex -Obinary $< $@ quiet_cmd_ihex2fw = IHEX2FW $@ - cmd_ihex2fw = $(objtree)/$(obj)/ihex2fw $< $@ + cmd_ihex2fw = $(objtree)/scripts/ihex2fw $< $@ quiet_cmd_h16tofw = H16TOFW $@ - cmd_h16tofw = $(objtree)/$(obj)/ihex2fw -w $< $@ + cmd_h16tofw = $(objtree)/scripts/ihex2fw -w $< $@ quiet_cmd_fwbin = MK_FW $@ cmd_fwbin = FWNAME="$(patsubst firmware/%.gen.S,%,$@)"; \ @@ -165,11 +167,11 @@ $(obj)/%: $(obj)/%.ihex | $(objtree)/$(obj)/$$(dir %) # 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 $(obj)/ihex2fw | $(objtree)/$(obj)/$$(dir %) +$(obj)/%.fw: $(obj)/%.HEX | $(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 $(obj)/ihex2fw | $(objtree)/$(obj)/$$(dir %) +$(obj)/%.fw: $(obj)/%.H16 | $(objtree)/$(obj)/$$(dir %) $(call cmd,h16tofw) $(firmware-dirs): @@ -186,5 +188,3 @@ 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/WHENCE b/firmware/WHENCE index 1bb2cf4b173..8b565134779 100644 --- a/firmware/WHENCE +++ b/firmware/WHENCE @@ -360,6 +360,18 @@ License: GPLv2 or OpenIB.org BSD license, no source visible -------------------------------------------------------------------------- +Driver: e100 -- Intel PRO/100 Ethernet NIC + +File: e100/d101m_ucode.bin +File: e100/d101s_ucode.bin +File: e100/d102e_ucode.bin + +Licence: Unknown + +Found in hex form in kernel source. + +-------------------------------------------------------------------------- + Driver: acenic -- Alteon AceNIC Gigabit Ethernet card File: acenic/tg1.bin diff --git a/firmware/dsp56k/bootstrap.asm b/firmware/dsp56k/bootstrap.asm index 10d891929cd..a411047e6db 100644 --- a/firmware/dsp56k/bootstrap.asm +++ b/firmware/dsp56k/bootstrap.asm @@ -51,19 +51,19 @@ start jmp <$40 ; Copy DSP program control move #real,r0 move #upload,r1 - do #upload_end-upload,<_copy - move P:(r0)+,x0 - move x0,P:(r1)+ -_copy movep #>4,X:<<M_HCR - movep #>$c00,X:<<M_IPR + do #upload_end-upload,_copy + movem P:(r0)+,x0 + movem x0,P:(r1)+ +_copy movep #4,X:<<M_HCR + movep #$c00,X:<<M_IPR and #<$fe,mr jmp upload real org P:$7ea9 upload - movep #>1,X:<<M_PBC - movep #>0,X:<<M_BCR + movep #1,X:<<M_PBC + movep #0,X:<<M_BCR next jclr #0,X:<<M_HSR,* movep X:<<M_HRX,A @@ -81,18 +81,18 @@ _get_length cmp x0,A jeq load_Y -load_P do y0,_load +load_P do y0,_load_P jclr #0,X:<<M_HSR,* movep X:<<M_HRX,P:(r0)+ -_load jmp next -load_X do y0,_load +_load_P jmp next +load_X do y0,_load_X jclr #0,X:<<M_HSR,* movep X:<<M_HRX,X:(r0)+ -_load jmp next -load_Y do y0,_load +_load_X jmp next +load_Y do y0,_load_Y jclr #0,X:<<M_HSR,* movep X:<<M_HRX,Y:(r0)+ -_load jmp next +_load_Y jmp next upload_end end diff --git a/firmware/e100/d101m_ucode.bin.ihex b/firmware/e100/d101m_ucode.bin.ihex new file mode 100644 index 00000000000..12971ed458a --- /dev/null +++ b/firmware/e100/d101m_ucode.bin.ihex @@ -0,0 +1,38 @@ +:10000000150255003704FFFFFFFFFFFF8907A70612 +:10001000FFFFFFFFFFFF580501000C001213100047 +:1000200008000C00160238009C001000564020000A +:10003000CC802300560038009C0010000B4C24009C +:1000400000080000184812003804380000000000C2 +:1000500000001400550538000080300062061000D2 +:100060006105100008040E006148130002000C0036 +:10007000933010000080300024061000610510004D +:1000800008040E00610810007E000C00212C2200E4 +:1000900002000C00933010007A0C380000000800B9 +:1000A000903010007A0C38000000000000000000C2 +:1000B00000000000000000009C0010002D4C2400F7 +:1000C000040001000010040037043A00104004004E +:1000D0008A07380000000000990010007A6C2000A8 +:1000E0009C001000484C24002408130001000C0060 +:1000F00013121000750C260000100400040001000B +:100100002608130006000C00A806220026C91300CA +:1001100013131000A80638000000000000000000C3 +:1001200000000000000000000000000000000000CF +:10013000000000000000000000060800101B100076 +:10014000040005002608100010121000340C3800BE +:1001500000000000000000005B1521009900100065 +:10016000596520009C0010005945240036081300F2 +:1001700000000C00620C220001000C00131B100098 +:100180000E9C22000E0C21000E6C22000E6C210031 +:100190000EFC22000E5C21000E4C2100550538009B +:1001A0000400010000100400678C27000008040010 +:1001B0000081010037043A002608130001000C00FA +:1001C00059052200131310005905380000000000E3 +:1001D000000000000000000000000000000000001F +:1001E00000000000000000000000000031081300C3 +:1001F0000B0910001348120080FF0C00AB0626000C +:100200000010040004000100A806380000000000EF +:0B02100000000000000000004E417ED6 +:00000001FF +/********************************************************/ +/* Micro code for 8086:1229 Rev 8 */ +/********************************************************/ diff --git a/firmware/e100/d101s_ucode.bin.ihex b/firmware/e100/d101s_ucode.bin.ihex new file mode 100644 index 00000000000..102c7feb666 --- /dev/null +++ b/firmware/e100/d101s_ucode.bin.ihex @@ -0,0 +1,38 @@ +:10000000420255007E04FFFFFFFFFFFF1808FF06B6 +:10001000FFFFFFFFFFFFA60501000C0012131000F9 +:1000200008000C00430238009C00100056402000DD +:10003000D0802300560038009C0010008B4F240015 +:1000400000080000184812007F043800000000007B +:1000500000001400A30538000080300010061000D6 +:100060006105100008040E006148130002000C0036 +:10007000933010000080300024061000610510004D +:1000800008040E00610810007E000C00A12F220061 +:1000900002000C0093301000900F380000000800A0 +:1000A00090301000900F38000000000000000000A9 +:1000B00000000000000000009C001000AD4F240074 +:1000C00004000100001004007E043A001040040007 +:1000D000190838000000000099001000FD6F200092 +:1000E0009A001000FDAF20009C001000C84F2400B3 +:1000F0002408130001000C0013121000F70F260053 +:1001000000100400040001002608130006000C0083 +:100110000007220026C9130013131000000738003F +:1001200000000000000000000000000000000000CF +:10013000000000000000000000060800101B100076 +:10014000040005002608100010121000B60F380039 +:100150000000000000000000A91521009900100017 +:10016000A76520009A001000A7A520009C001000A1 +:10017000A74524003608130000000C00E40F2200FD +:1001800001000C00131B10008E9F22008E0F210017 +:100190008E6F22008E6F21008EFF22008E5F210065 +:1001A0008E4F2100A3053800040001000010040058 +:1001B000E98F270000080400008101007E043A0056 +:1001C0002608130001000C00A705220013131000DD +:1001D000A70538000000000000000000000000003B +:1001E000000000000000000000000000000000000F +:1001F00000000000310813000B0910001348120022 +:1002000080FF0C000307260000100400040001001A +:0B02100000073800000000004E438093 +:00000001FF +/********************************************************/ +/* Micro code for 8086:1229 Rev 9 */ +/********************************************************/ diff --git a/firmware/e100/d102e_ucode.bin.ihex b/firmware/e100/d102e_ucode.bin.ihex new file mode 100644 index 00000000000..9e806da854d --- /dev/null +++ b/firmware/e100/d102e_ucode.bin.ihex @@ -0,0 +1,38 @@ +:100000008F027D00F904420E850CED14E914FA14F8 +:10001000360EF70EFF1FFF1FB914E00000000000AE +:100020000000000000000000BD14E000000000001F +:100030000000000000000000D514E00000000000F7 +:1000400000000000000000000000000000000000B0 +:100050000000000000000000C114E00000000000EB +:100060000000000000000000000000000000000090 +:100070000000000000000000000000000000000080 +:100080000000000000000000000000000000000070 +:100090000000000000000000C814E00000000000A4 +:1000A000000000000000000000062000EE14E00048 +:1000B000000000000000000080FF3000460E9400A9 +:1000C0000082030000201000430EE000000000004A +:1000D000000000000000000006003000FB14E000FB +:1000E0000000000000000000000000000000000010 +:1000F0000000000000000000000000000000000000 +:1001000000000000000000000000000000000000EF +:100110000000000000000000416E90003C0E8000D6 +:10012000390EE00000000000FD6E9000FD0E900012 +:10013000F80EE000000000000000000000000000D9 +:1001400000000000000000000000000000000000AF +:10015000000000000000000000000000000000009F +:10016000000000000000000000000000000000008F +:10017000000000000000000000000000000000007F +:10018000000000000000000000000000000000006F +:10019000000000000000000000000000000000005F +:1001A000000000000000000000000000000000004F +:1001B000000000000000000000000000000000003F +:1001C000000000000000000000000000000000002F +:1001D000000000000000000000000000000000001F +:1001E000000000000000000000000000000000000F +:1001F00000000000000000000000000000000000FF +:1002000000000000000000000000000000000000EE +:0B02100000000000000000002A362E55 +:00000001FF +/********************************************************/ +/* Micro code for the 8086:1229 Rev F/10 */ +/********************************************************/ diff --git a/firmware/ihex2fw.c b/firmware/ihex2fw.c deleted file mode 100644 index 8f7fdaa9e01..00000000000 --- a/firmware/ihex2fw.c +++ /dev/null @@ -1,268 +0,0 @@ -/* - * 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; -} |