diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2004-12-19 15:20:14 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2004-12-19 15:20:14 +0000 |
commit | 5844a156c3a421f5f6299304aed52ebe119bf0a0 (patch) | |
tree | 2043e8c2a005918705ab7743e7d29204734cc176 /sys/dev/microcode/uyap | |
parent | 161132942c7ffc3eaa5e23d828f5d9c0215fe9b8 (diff) |
filesystem firmware loading for uyap(4). this should work, i wrote it very
carefully. unfortunately, we cannot find anyone who has one of these devices
in our entire user community, thus far. commit it anyways. whoever finds
one can contact me if there is a problem.
Diffstat (limited to 'sys/dev/microcode/uyap')
-rw-r--r-- | sys/dev/microcode/uyap/Makefile | 27 | ||||
-rw-r--r-- | sys/dev/microcode/uyap/build.c | 40 | ||||
-rw-r--r-- | sys/dev/microcode/uyap/uyap-license | 34 | ||||
-rw-r--r-- | sys/dev/microcode/uyap/uyap_firmware.h | 4 |
4 files changed, 104 insertions, 1 deletions
diff --git a/sys/dev/microcode/uyap/Makefile b/sys/dev/microcode/uyap/Makefile new file mode 100644 index 00000000000..8aa599e274b --- /dev/null +++ b/sys/dev/microcode/uyap/Makefile @@ -0,0 +1,27 @@ +# $OpenBSD: Makefile,v 1.1 2004/12/19 15:20:13 deraadt Exp $ + +NOPROG= +NOMAN= + +# USB capable systems only +.if (${MACHINE} == "i386") || (${MACHINE} == "amd64") || \ + (${MACHINE} == "alpha") || (${MACHINE} == "sparc64") || \ + (${MACHINE_ARCH} == "powerpc") || (${MACHINE} == "cats") || \ + (${MACHINE} == "hppa") || (${MACHINE} == "sgi") + +FIRM= uyap + +CLEANFILES+= ${FIRM} build + +all: build + ${.OBJDIR}/build + +afterinstall: + ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 \ + ${FIRM} ${DESTDIR}/etc/firmware + ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 \ + ${.CURDIR}/uyap-license ${DESTDIR}/etc/firmware +.endif + +.include <bsd.prog.mk> + diff --git a/sys/dev/microcode/uyap/build.c b/sys/dev/microcode/uyap/build.c new file mode 100644 index 00000000000..30fc01ba80f --- /dev/null +++ b/sys/dev/microcode/uyap/build.c @@ -0,0 +1,40 @@ +/* $OpenBSD: build.c,v 1.1 2004/12/19 15:20:13 deraadt Exp $ */ + +/* + * Copyright (c) 2004 Theo de Raadt <deraadt@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 <fcntl.h> +#include <sys/param.h> + +#include <dev/usb/ezload.h> +#include "uyap_firmware.h" +#define FILENAME "uyap" + +int +main(int argc, char *argv[]) +{ + int i; + int fd; + + printf("creating %s length %d\n", FILENAME, sizeof uyap_firmware); + fd = open(FILENAME, O_WRONLY|O_CREAT|O_TRUNC, 0644); + if (fd == -1) + err(1, "%s", FILENAME); + + write(fd, uyap_firmware, sizeof uyap_firmware); + close(fd); + return 0; +} diff --git a/sys/dev/microcode/uyap/uyap-license b/sys/dev/microcode/uyap/uyap-license new file mode 100644 index 00000000000..38aaf9363e1 --- /dev/null +++ b/sys/dev/microcode/uyap/uyap-license @@ -0,0 +1,34 @@ + * Copyright (c) 2000 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Silicon Portals. + * + * 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 the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 THE FOUNDATION OR CONTRIBUTORS + * 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. + diff --git a/sys/dev/microcode/uyap/uyap_firmware.h b/sys/dev/microcode/uyap/uyap_firmware.h index a42a54250fb..064b3101c03 100644 --- a/sys/dev/microcode/uyap/uyap_firmware.h +++ b/sys/dev/microcode/uyap/uyap_firmware.h @@ -1,4 +1,4 @@ -/* $OpenBSD: uyap_firmware.h,v 1.1 2001/12/17 01:39:08 deraadt Exp $ */ +/* $OpenBSD: uyap_firmware.h,v 1.2 2004/12/19 15:20:13 deraadt Exp $ */ /* $NetBSD: uyap_firmware.h,v 1.2 2001/01/16 03:10:09 augustss Exp $ */ /* @@ -37,6 +37,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ +const struct ezdata uyap_firmware[] = { {0x10,0x146C, "\xC2\x00\x90\x7F\xA5\xE0\x54\x18\xFF\x13\x13\x13\x54\x1F\x44\x50"}, {0x10,0x147C, @@ -1234,3 +1235,4 @@ {0x01,0x02F1, "\x00"}, {0x00,0x0000,""} +}; |