summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2007-04-19 04:04:59 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2007-04-19 04:04:59 +0000
commitb462aaafb9a97d503c63fe43c8676dcec988d482 (patch)
treea4393bdb8515d8e9283ff1edafb092d04ba70bdf /sys/dev
parentcddb6cc5208df75aab21e71013144c0f88c30903 (diff)
add bits to turn microcode.h into an actual blob. needs endian fixes yet.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/microcode/tht/Makefile35
-rw-r--r--sys/dev/microcode/tht/build.c49
-rw-r--r--sys/dev/microcode/tht/microcode.h2
-rw-r--r--sys/dev/microcode/tht/tht-license36
4 files changed, 122 insertions, 0 deletions
diff --git a/sys/dev/microcode/tht/Makefile b/sys/dev/microcode/tht/Makefile
new file mode 100644
index 00000000000..fdfbf58c480
--- /dev/null
+++ b/sys/dev/microcode/tht/Makefile
@@ -0,0 +1,35 @@
+# $OpenBSD: Makefile,v 1.1 2007/04/19 04:04:58 dlg Exp $
+
+NOPROG=
+NOMAN=
+CC=${HOSTCC}
+
+# PCI capable systems only
+.if (${MACHINE_ARCH} == "powerpc") || (${MACHINE} == "alpha") || \
+ (${MACHINE} == "amd64") || (${MACHINE} == "armish") || \
+ (${MACHINE} == "cats") || (${MACHINE} == "hppa") || \
+ (${MACHINE} == "hppa64") || (${MACHINE} == "i386") || \
+ (${MACHINE} == "sgi") || (${MACHINE} == "sparc64")
+
+FIRM= tht
+
+PROG= build
+
+CLEANFILES+= ${FIRM} ${PROG}
+
+all: ${FIRM}
+
+${FIRM}: build
+ ${.OBJDIR}/build
+
+realinstall:
+
+afterinstall:
+ ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 \
+ ${FIRM} ${DESTDIR}/etc/firmware
+ ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 \
+ ${.CURDIR}/tht-license ${DESTDIR}/etc/firmware
+
+.endif
+
+.include <bsd.prog.mk>
diff --git a/sys/dev/microcode/tht/build.c b/sys/dev/microcode/tht/build.c
new file mode 100644
index 00000000000..eff9dee362f
--- /dev/null
+++ b/sys/dev/microcode/tht/build.c
@@ -0,0 +1,49 @@
+/* $OpenBSD: build.c,v 1.1 2007/04/19 04:04:58 dlg Exp $ */
+
+/*
+ * Copyright (c) 2007 David Gwynne <dlg@openbsd.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <sys/types.h>
+
+#include <err.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#include "microcode.h"
+
+#define THT_FW_NAME "tht"
+
+int
+main(int argc, char *argv[])
+{
+ ssize_t len;
+ int fd;
+
+ fd = open(THT_FW_NAME, O_WRONLY | O_CREAT | O_TRUNC, 0644);
+ if (fd == -1)
+ err(1, "%s", THT_FW_NAME);
+
+ len = write(fd, tht_fw, sizeof(tht_fw));
+ if (len == -1)
+ err(1, "%s write", THT_FW_NAME);
+ if (len != sizeof(tht_fw))
+ errx(1, "%s: short write", THT_FW_NAME);
+
+ close(fd);
+
+ return (0);
+}
diff --git a/sys/dev/microcode/tht/microcode.h b/sys/dev/microcode/tht/microcode.h
index b58ed6caa30..93cb09a020d 100644
--- a/sys/dev/microcode/tht/microcode.h
+++ b/sys/dev/microcode/tht/microcode.h
@@ -32,6 +32,7 @@
*
*/
+u_int32_t tht_fw[] = {
// Loading Firmware ,
// INT_MEM Ver ,
0x000f0002,
@@ -10732,3 +10733,4 @@
0x807187c4,
0x0000003d,
0xf780006f
+};
diff --git a/sys/dev/microcode/tht/tht-license b/sys/dev/microcode/tht/tht-license
new file mode 100644
index 00000000000..d06dfcb730e
--- /dev/null
+++ b/sys/dev/microcode/tht/tht-license
@@ -0,0 +1,36 @@
+Copyright (c) 2007 Tehuti Networks.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. All advertising materials mentioning features or use of this software
+ must display the following acknowledgement:
+ This product includes software developed by Tehuti Networks.
+4. Neither the name of Tehuti Networks nor the names of any co-contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY Tehuti Networks AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL Tehuti Networks OR THE VOICES IN HIS HEAD
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGE.
+
+The following files are under the above license:
+
+ tht
+
+These files are used by Tehuti Networks Ltd 10Gb Ethernet controllers