From owner-p4-projects@FreeBSD.ORG Sun Jan 6 13:50:09 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 394C87C1; Sun, 6 Jan 2013 13:50:09 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D3B987BF for ; Sun, 6 Jan 2013 13:50:08 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id B52FFE2 for ; Sun, 6 Jan 2013 13:50:08 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.5/8.14.5) with ESMTP id r06Do8sn057890 for ; Sun, 6 Jan 2013 13:50:08 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.5/8.14.5/Submit) id r06Do82G057887 for perforce@freebsd.org; Sun, 6 Jan 2013 13:50:08 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sun, 6 Jan 2013 13:50:08 GMT Message-Id: <201301061350.r06Do82G057887@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 219952 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jan 2013 13:50:09 -0000 http://p4web.freebsd.org/@@219952?ac=10 Change 219952 by rwatson@rwatson_zenith_cl_cam_ac_uk on 2013/01/06 13:49:33 Make different bus attachments for Altera and Terasice device drivers share the same devclass_t. Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/dev/altera/avgen/altera_avgen.c#9 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/altera/avgen/altera_avgen.h#5 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/altera/avgen/altera_avgen_fdt.c#3 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/altera/avgen/altera_avgen_nexus.c#3 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/altera/jtag_uart/altera_jtag_uart.h#7 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/altera/jtag_uart/altera_jtag_uart_cons.c#8 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/altera/jtag_uart/altera_jtag_uart_fdt.c#3 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/altera/jtag_uart/altera_jtag_uart_nexus.c#4 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/altera/sdcard/altera_sdcard.c#6 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/altera/sdcard/altera_sdcard.h#13 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/altera/sdcard/altera_sdcard_fdt.c#3 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/altera/sdcard/altera_sdcard_nexus.c#4 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/isf/isf.c#12 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/isf/isf.h#9 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/isf/isf_fdt.c#3 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/isf/isf_nexus.c#6 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/terasic/de4led/terasic_de4led.c#6 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/terasic/de4led/terasic_de4led.h#4 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/terasic/de4led/terasic_de4led_fdt.c#4 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/terasic/de4led/terasic_de4led_nexus.c#3 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/terasic/mtl/terasic_mtl.c#6 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/terasic/mtl/terasic_mtl.h#8 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/terasic/mtl/terasic_mtl_fdt.c#4 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/terasic/mtl/terasic_mtl_nexus.c#4 edit Differences ... ==== //depot/projects/ctsrd/beribsd/src/sys/dev/altera/avgen/altera_avgen.c#9 (text+ko) ==== @@ -60,6 +60,8 @@ * system-on-chip bus environments would work fine with the same code. */ +devclass_t altera_avgen_devclass; + static d_mmap_t altera_avgen_mmap; static d_read_t altera_avgen_read; static d_write_t altera_avgen_write; ==== //depot/projects/ctsrd/beribsd/src/sys/dev/altera/avgen/altera_avgen.h#5 (text+ko) ==== @@ -82,4 +82,6 @@ const char *str_devname, int devunit); void altera_avgen_detach(struct altera_avgen_softc *sc); +extern devclass_t altera_avgen_devclass; + #endif /* _DEV_ALTERA_AVALON_H_ */ ==== //depot/projects/ctsrd/beribsd/src/sys/dev/altera/avgen/altera_avgen_fdt.c#3 (text+ko) ==== @@ -150,7 +150,5 @@ sizeof(struct altera_avgen_softc), }; -static devclass_t altera_avgen_devclass; - DRIVER_MODULE(avgen, simplebus, altera_avgen_fdt_driver, altera_avgen_devclass, 0, 0); ==== //depot/projects/ctsrd/beribsd/src/sys/dev/altera/avgen/altera_avgen_nexus.c#3 (text+ko) ==== @@ -137,7 +137,5 @@ sizeof(struct altera_avgen_softc), }; -static devclass_t altera_avgen_devclass; - DRIVER_MODULE(avgen, nexus, altera_avgen_nexus_driver, altera_avgen_devclass, 0, 0); ==== //depot/projects/ctsrd/beribsd/src/sys/dev/altera/jtag_uart/altera_jtag_uart.h#7 (text+ko) ==== @@ -194,4 +194,6 @@ int altera_jtag_uart_attach(struct altera_jtag_uart_softc *sc); void altera_jtag_uart_detach(struct altera_jtag_uart_softc *sc); +extern devclass_t altera_jtag_uart_devclass; + #endif /* _DEV_ALTERA_JTAG_UART_H_ */ ==== //depot/projects/ctsrd/beribsd/src/sys/dev/altera/jtag_uart/altera_jtag_uart_cons.c#8 (text+ko) ==== @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD: src/sys/dev/altera/jtag_uart/altera_jtag_uart_cons.c,v 1.2 2012/09/14 21:28:56 eadler Exp $"); #include +#include #include #include #include @@ -46,6 +47,8 @@ #include +devclass_t altera_jtag_uart_devclass; + /* * One-byte buffer as we can't check whether the UART is readable without * actually reading from it, synchronised by a spinlock; this lock also ==== //depot/projects/ctsrd/beribsd/src/sys/dev/altera/jtag_uart/altera_jtag_uart_fdt.c#3 (text+ko) ==== @@ -143,7 +143,5 @@ sizeof(struct altera_jtag_uart_softc), }; -static devclass_t altera_jtag_uart_devclass; - DRIVER_MODULE(altera_jtag_uart, simplebus, altera_jtag_uart_fdt_driver, altera_jtag_uart_devclass, 0, 0); ==== //depot/projects/ctsrd/beribsd/src/sys/dev/altera/jtag_uart/altera_jtag_uart_nexus.c#4 (text+ko) ==== @@ -137,7 +137,5 @@ sizeof(struct altera_jtag_uart_softc), }; -static devclass_t altera_jtag_uart_devclass; - DRIVER_MODULE(altera_jtag_uart, nexus, altera_jtag_uart_nexus_driver, altera_jtag_uart_devclass, 0, 0); ==== //depot/projects/ctsrd/beribsd/src/sys/dev/altera/sdcard/altera_sdcard.c#6 (text+ko) ==== @@ -70,6 +70,7 @@ * 3. Handle read-only SD Cards. * 4. Tune timeouts based on real-world SD Card speeds. */ +devclass_t altera_sdcard_devclass; void altera_sdcard_attach(struct altera_sdcard_softc *sc) ==== //depot/projects/ctsrd/beribsd/src/sys/dev/altera/sdcard/altera_sdcard.h#13 (text+ko) ==== @@ -244,4 +244,6 @@ void altera_sdcard_disk_insert(struct altera_sdcard_softc *sc); void altera_sdcard_disk_remove(struct altera_sdcard_softc *sc); +extern devclass_t altera_sdcard_devclass; + #endif /* _DEV_ALTERA_SDCARD_H_ */ ==== //depot/projects/ctsrd/beribsd/src/sys/dev/altera/sdcard/altera_sdcard_fdt.c#3 (text+ko) ==== @@ -116,7 +116,5 @@ sizeof(struct altera_sdcard_softc), }; -static devclass_t altera_sdcard_devclass; - DRIVER_MODULE(altera_sdcard, simplebus, altera_sdcard_fdt_driver, altera_sdcard_devclass, 0, 0); ==== //depot/projects/ctsrd/beribsd/src/sys/dev/altera/sdcard/altera_sdcard_nexus.c#4 (text+ko) ==== @@ -110,7 +110,5 @@ sizeof(struct altera_sdcard_softc), }; -static devclass_t altera_sdcard_devclass; - DRIVER_MODULE(altera_sdcard, nexus, altera_sdcard_nexus_driver, altera_sdcard_devclass, 0, 0); ==== //depot/projects/ctsrd/beribsd/src/sys/dev/isf/isf.c#12 (text+ko) ==== @@ -150,6 +150,7 @@ * physical package, due to variable block size support in the StrataFlash * part. */ +devclass_t isf_devclass; static uint16_t isf_read_reg(struct isf_softc *sc, uint16_t reg) ==== //depot/projects/ctsrd/beribsd/src/sys/dev/isf/isf.h#9 (text+ko) ==== @@ -87,6 +87,8 @@ int isf_attach(struct isf_softc *sc); void isf_detach(struct isf_softc *sc); + +extern devclass_t isf_devclass; #endif /* _KERNEL */ #endif /* _DEV_ISF_H_ */ ==== //depot/projects/ctsrd/beribsd/src/sys/dev/isf/isf_fdt.c#3 (text+ko) ==== @@ -121,6 +121,4 @@ sizeof(struct isf_softc), }; -static devclass_t isf_devclass; - DRIVER_MODULE(isf, simplebus, isf_fdt_driver, isf_devclass, 0, 0); ==== //depot/projects/ctsrd/beribsd/src/sys/dev/isf/isf_nexus.c#6 (text+ko) ==== @@ -115,6 +115,4 @@ sizeof(struct isf_softc), }; -static devclass_t isf_devclass; - DRIVER_MODULE(isf, nexus, isf_nexus_driver, isf_devclass, 0, 0); ==== //depot/projects/ctsrd/beribsd/src/sys/dev/terasic/de4led/terasic_de4led.c#6 (text+ko) ==== @@ -43,6 +43,8 @@ #include #include +devclass_t terasic_de4led_devclass; + static void terasic_de4led_update(struct terasic_de4led_softc *sc) { ==== //depot/projects/ctsrd/beribsd/src/sys/dev/terasic/de4led/terasic_de4led.h#4 (text+ko) ==== @@ -70,4 +70,6 @@ void terasic_de4led_attach(struct terasic_de4led_softc *sc); void terasic_de4led_detach(struct terasic_de4led_softc *sc); +extern devclass_t terasic_de4led_devclass; + #endif /* _DEV_TERASIC_DE4LED_H_ */ ==== //depot/projects/ctsrd/beribsd/src/sys/dev/terasic/de4led/terasic_de4led_fdt.c#4 (text+ko) ==== @@ -114,7 +114,5 @@ sizeof(struct terasic_de4led_softc), }; -static devclass_t terasic_de4led_devclass; - DRIVER_MODULE(terasic_de4led, simplebus, terasic_de4led_fdt_driver, terasic_de4led_devclass, 0, 0); ==== //depot/projects/ctsrd/beribsd/src/sys/dev/terasic/de4led/terasic_de4led_nexus.c#3 (text+ko) ==== @@ -106,7 +106,5 @@ sizeof(struct terasic_de4led_softc), }; -static devclass_t terasic_de4led_devclass; - DRIVER_MODULE(terasic_de4led, nexus, terasic_de4led_nexus_driver, terasic_de4led_devclass, 0, 0); ==== //depot/projects/ctsrd/beribsd/src/sys/dev/terasic/mtl/terasic_mtl.c#6 (text+ko) ==== @@ -63,6 +63,9 @@ * attached as they may be called even if the attach routine hasn't been, on * an error. */ + +devclass_t terasic_mtl_devclass; + int terasic_mtl_attach(struct terasic_mtl_softc *sc) { ==== //depot/projects/ctsrd/beribsd/src/sys/dev/terasic/mtl/terasic_mtl.h#8 (text+ko) ==== @@ -159,6 +159,8 @@ int terasic_mtl_attach(struct terasic_mtl_softc *sc); void terasic_mtl_detach(struct terasic_mtl_softc *sc); +extern devclass_t terasic_mtl_devclass; + /* * Sub-driver setup routines. */ ==== //depot/projects/ctsrd/beribsd/src/sys/dev/terasic/mtl/terasic_mtl_fdt.c#4 (text+ko) ==== @@ -196,7 +196,5 @@ sizeof(struct terasic_mtl_softc), }; -static devclass_t terasic_mtl_devclass; - DRIVER_MODULE(mtl, simplebus, terasic_mtl_fdt_driver, terasic_mtl_devclass, 0, 0); ==== //depot/projects/ctsrd/beribsd/src/sys/dev/terasic/mtl/terasic_mtl_nexus.c#4 (text+ko) ==== @@ -190,7 +190,5 @@ sizeof(struct terasic_mtl_softc), }; -static devclass_t terasic_mtl_devclass; - DRIVER_MODULE(mtl, nexus, terasic_mtl_nexus_driver, terasic_mtl_devclass, 0, 0); From owner-p4-projects@FreeBSD.ORG Mon Jan 7 17:26:59 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 89B6AB7A; Mon, 7 Jan 2013 17:26:59 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 45474B78 for ; Mon, 7 Jan 2013 17:26:59 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 2A685915 for ; Mon, 7 Jan 2013 17:26:59 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.5/8.14.5) with ESMTP id r07HQw1w043461 for ; Mon, 7 Jan 2013 17:26:58 GMT (envelope-from brooks@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.5/8.14.5/Submit) id r07HQwjk043458 for perforce@freebsd.org; Mon, 7 Jan 2013 17:26:58 GMT (envelope-from brooks@freebsd.org) Date: Mon, 7 Jan 2013 17:26:58 GMT Message-Id: <201301071726.r07HQwjk043458@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to brooks@freebsd.org using -f From: Brooks Davis Subject: PERFORCE change 219955 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jan 2013 17:27:00 -0000 http://p4web.freebsd.org/@@219955?ac=10 Change 219955 by brooks@brooks_zenith on 2013/01/07 17:26:50 Checkpoint a slightly less correct, but faster memcpy. Still need to switch to David's version. Affected files ... .. //depot/projects/ctsrd/cheribsd/src/ctsrd/minifile/cheri/cmemcpy.h#2 edit Differences ... ==== //depot/projects/ctsrd/cheribsd/src/ctsrd/minifile/cheri/cmemcpy.h#2 (text+ko) ==== @@ -44,9 +44,20 @@ static inline void memcpy_fromcap(void *dst, u_int creg, off_t off, size_t len) { - size_t count; + size_t count, remainder; uint8_t *v; + /* XXX: assumes the memory in the capability is 8-byte aligned */ + if (off & 0x7 == 0 && (intptr_t)dst & 0x7 == 0) { + remainder = len & 0x7; + len -= remainder; + + for (v = dst, count = 0; (count * 8) < len; v += 8, count++) + CHERI_CLD(*v, off + (count * 8), 0, creg); + len = remainder; + off += count * 8; + } + for (v = dst, count = 0; count < len; v++, count++) CHERI_CLB(*v, off + count, 0, creg); } From owner-p4-projects@FreeBSD.ORG Mon Jan 7 17:48:21 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 96B7C6E; Mon, 7 Jan 2013 17:48:21 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4D3746C for ; Mon, 7 Jan 2013 17:48:21 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 2F60D9C9 for ; Mon, 7 Jan 2013 17:48:21 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.5/8.14.5) with ESMTP id r07HmKon044095 for ; Mon, 7 Jan 2013 17:48:20 GMT (envelope-from brooks@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.5/8.14.5/Submit) id r07HmKN2044092 for perforce@freebsd.org; Mon, 7 Jan 2013 17:48:20 GMT (envelope-from brooks@freebsd.org) Date: Mon, 7 Jan 2013 17:48:20 GMT Message-Id: <201301071748.r07HmKN2044092@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to brooks@freebsd.org using -f From: Brooks Davis Subject: PERFORCE change 219956 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jan 2013 17:48:21 -0000 http://p4web.freebsd.org/@@219956?ac=10 Change 219956 by brooks@brooks_zenith on 2013/01/07 17:47:52 Checkpoint some work from December to produce timings of sandbox performance. Affected files ... .. //depot/projects/ctsrd/cheribsd/src/ctsrd/minifile/capsicum/minifile-capsicum.c#2 edit .. //depot/projects/ctsrd/cheribsd/src/ctsrd/minifile/cheri/Makefile#2 edit .. //depot/projects/ctsrd/cheribsd/src/ctsrd/minifile/cheri/minifile-cheri.c#2 edit .. //depot/projects/ctsrd/cheribsd/src/ctsrd/minifile/minifile.c#7 edit .. //depot/projects/ctsrd/cheribsd/src/ctsrd/minifile/minifile.h#3 edit Differences ... ==== //depot/projects/ctsrd/cheribsd/src/ctsrd/minifile/capsicum/minifile-capsicum.c#2 (text+ko) ==== @@ -33,11 +33,14 @@ #include #include +#include + #include #include #include #define _WITH_DPRINTF #include +#include #include "minifile.h" @@ -50,7 +53,10 @@ void *magicbuf; struct stat filesb, magicsb; magic_t magic; + uint32_t timing[4]; + timing[0] = sysarch(MIPS_GET_COUNT, NULL); + if (cap_enter() == -1) err(1, "cap_enter"); @@ -59,7 +65,7 @@ if (fstat(MINIFILE_FILE_FD, &filesb) == -1) err(1, "fstat input fd"); - filesize = MAX(MINIFILE_BUF_MAX, filesb.st_size); + filesize = MIN(MINIFILE_BUF_MAX, filesb.st_size); if ((filebuf = mmap(NULL, filesize, PROT_READ, 0, MINIFILE_FILE_FD, 0)) == MAP_FAILED) err(1, "mmap input fd"); @@ -79,7 +85,13 @@ exit(1); } + timing[1] = sysarch(MIPS_GET_COUNT, NULL); + type = magic_buffer(magic, filebuf, filesize); + timing[2] = sysarch(MIPS_GET_COUNT, NULL); + /* XXX: idealy would be after the dprintf to capture it's cost */ + timing[3] = sysarch(MIPS_GET_COUNT, NULL); + write(MINIFILE_OUT_FD, timing, sizeof(uint32_t) * 4); dprintf(MINIFILE_OUT_FD, "%s", type != NULL ? type : "badmagic"); return (0); ==== //depot/projects/ctsrd/cheribsd/src/ctsrd/minifile/cheri/Makefile#2 (text+ko) ==== @@ -5,10 +5,12 @@ .PATH: ${.CURDIR}/${MACHINE_ARCH} SRCS= minifile-cheri.c \ + chsbrt.S \ malloc.c \ stub.c \ - subr_prf.c \ - chsbrt.S + subr_prf.c + +# lib.S \ .PATH: ${.CURDIR}/../../../lib/libc/${MACHINE}/gen .PATH: ${.CURDIR}/../../../lib/libc/${MACHINE}/string @@ -25,6 +27,7 @@ SRCS+= _flock_stub.c \ _once_stub.c \ _pthread_stubs.c \ + cerror.S \ ffs.S \ fileno.c \ getprogname.c \ @@ -53,7 +56,9 @@ strstr.c \ strtol.c \ strtoul.c \ - strtoull.c + strtoull.c \ + sysarch.S +# memcpy.S \ # Locale support .PATH: ${.CURDIR}/../../../lib/libc/locale @@ -167,7 +172,6 @@ regerror.c \ regexec.c \ regfree.c \ - cerror.S MAN= ==== //depot/projects/ctsrd/cheribsd/src/ctsrd/minifile/cheri/minifile-cheri.c#2 (text+ko) ==== @@ -33,6 +33,7 @@ #include #include +#include #include #include @@ -46,11 +47,11 @@ * Sandboxed magic_buffer invocation * * a0 holds length of the output capabilty, a1 holds the length of the - * magic data, and a2 holds the length of the input file buffer. + * magic data, and a2 holds the length of the input file buffer. a3 + * indicates if timing data should be collected. */ int -invoke(register_t a0, register_t a1, register_t a2, - register_t a3 __unused) +invoke(register_t a0, register_t a1, register_t a2, register_t a3) { int ret = 0; size_t outsize, magicsize, filesize; @@ -58,10 +59,16 @@ const char *type, *errstr; void *magicbuf; magic_t magic; + int dotimings; + uint32_t timings[4]; outsize = a0; magicsize = a1; filesize = a2; + dotimings = a3; + + if (dotimings) + timings[0] = sysarch(MIPS_GET_COUNT, NULL); if ((magicbuf = malloc(magicsize)) == NULL) return (-1); @@ -78,6 +85,9 @@ return (-1); memcpy_fromcap(filebuf, MINIFILE_FILE_CAP, 0, filesize); + if (dotimings) + timings[1] = sysarch(MIPS_GET_COUNT, NULL); + type = magic_buffer(magic, filebuf, filesize); if (type == NULL) { ret = -1; @@ -85,7 +95,17 @@ type = (errstr == NULL ? "badmagic" : errstr); } + if (dotimings) + timings[2] = sysarch(MIPS_GET_COUNT, NULL); + memcpy_tocap(MINIFILE_OUT_CAP, type, 0, MIN(strlen(type) + 1, outsize)); + if (dotimings) { + timings[3] = sysarch(MIPS_GET_COUNT, NULL); + + memcpy_tocap(MINIFILE_TIMING_CAP, timings, 0, + (4 * sizeof(uint32_t))); + } + return (ret); } ==== //depot/projects/ctsrd/cheribsd/src/ctsrd/minifile/minifile.c#7 (text+ko) ==== @@ -7,6 +7,7 @@ #include #include +#include #include #include @@ -28,13 +29,15 @@ SB_CHERI } sbtype = SB_NONE; +int dotimings; + #define MAGIC_FILE "/usr/share/misc/magic.mgc" static void usage(void) { - errx(1, "usage: minifile [-s ] ...\n"); + errx(1, "usage: minifile [-t] [-s ] ...\n"); } /* @@ -97,9 +100,15 @@ char *type, *ttype; int pfd[2]; int curfds[3], targetfds[3]; + uint32_t start, preinvoke, *invoke, postinvoke, end; + + if (dotimings) + start = sysarch(MIPS_GET_COUNT, NULL); if (pipe(pfd) == -1) err(1, "pipe()"); + if (dotimings) + preinvoke = sysarch(MIPS_GET_COUNT, NULL); pid = fork(); if (pid < 0) err(1, "fork()"); @@ -117,7 +126,8 @@ if (prep_fds(curfds, targetfds, 3) == -1) err(1, "pred_fds()"); - execl("/usr/libexec/minifile-capsicum", "readpng", NULL); + execl("/usr/libexec/minifile-capsicum", "minifile-capsicum", + NULL); err(1, "exec /usr/libexec/minifile-capsicum"); } else { close(pfd[1]); @@ -133,26 +143,37 @@ close(pfd[0]); type = "badmagic"; } else { - rlen = read(pfd[0], buf, 128); + rlen = read(pfd[0], buf, 128 + sizeof(uint32_t) * 4); close(pfd[0]); + if (dotimings) + postinvoke = sysarch(MIPS_GET_COUNT, NULL); if (rlen == -1) type = "read error"; - else if (rlen == 0 || rlen == 1) + else if (rlen <= sizeof(uint32_t) * 4 + 1) type = "unknown"; else { + invoke = (uint32_t*)buf; /* Don't trust the result */ - ttype = buf + rlen; - strvisx(ttype, buf, rlen, 0); + ttype = buf + rlen + sizeof(uint32_t) * 4; + strvisx(ttype, buf + sizeof(uint32_t) * 4, + rlen - sizeof(uint32_t) * 4, 0); type = ttype; } } } + if (dotimings) { + end = sysarch(MIPS_GET_COUNT, NULL); + + printf("counts: %u %u %u %u %u %u %u %u\n", start, preinvoke, + invoke[0], invoke[1], invoke[2], invoke[3], postinvoke, end); + } + return type; } static struct sandbox *sandbox; -static struct chericap file_cap, magic_cap, out_cap; +static struct chericap file_cap, magic_cap, out_cap, timing_cap; const char * cheri_magic_descriptor(void *magicbuf, size_t magicsize, int fd) @@ -164,9 +185,13 @@ static char outbuf[4096]; const char *type; char *ttype; + uint32_t start, preinvoke, invoke[4], postinvoke, end; type = "badfile"; + if (dotimings) + start = sysarch(MIPS_GET_COUNT, NULL); + outsize = 128; CHERI_CINCBASE(10, 0, outbuf); CHERI_CSETLEN(10, 10, outsize); @@ -191,9 +216,19 @@ CHERI_CANDPERM(10, 10, CHERI_PERM_LOAD); CHERI_CSC(10, 0, &file_cap, 0); - v = sandbox_invoke(sandbox, outsize, magicsize, filesize, 0, - &out_cap, &magic_cap, &file_cap, NULL, NULL, NULL, NULL); - printf("%s: sandbox returned %ju\n", __func__, (uintmax_t)v); + CHERI_CINCBASE(10, 0, invoke); + CHERI_CSETLEN(10, 10, sizeof(uint32_t) * 4); + CHERI_CANDPERM(10, 10, CHERI_PERM_STORE); + CHERI_CSC(10, 0, &timing_cap, 0); + + if (dotimings) + preinvoke = sysarch(MIPS_GET_COUNT, NULL); + + v = sandbox_invoke(sandbox, outsize, magicsize, filesize, dotimings, + &out_cap, &magic_cap, &file_cap, &timing_cap, NULL, NULL, NULL); + + if (dotimings) + postinvoke = sysarch(MIPS_GET_COUNT, NULL); outsize = strnlen(outbuf, outsize); if (v == 0) { @@ -207,6 +242,13 @@ if (munmap(filebuf, filesize) == -1) warn("munmap filebuf"); + if (dotimings) { + end = sysarch(MIPS_GET_COUNT, NULL); + + printf("counts: %u %u %u %u %u %u %u %u\n", start, preinvoke, + invoke[0], invoke[1], invoke[2], invoke[3], postinvoke, end); + } + return type; } @@ -222,7 +264,7 @@ struct magic_set *magic; struct stat magicsb; - while ((ch = getopt(argc, argv, "s:")) != -1) { + while ((ch = getopt(argc, argv, "s:t")) != -1) { switch(ch) { case 's': if (strcmp(optarg, "none") == 0) @@ -235,6 +277,12 @@ warnx("invalid sandbox type %s", optarg); usage(); } + break; + case 't': + dotimings = 1; + break; + default: + usage(); } } argc -= optind; ==== //depot/projects/ctsrd/cheribsd/src/ctsrd/minifile/minifile.h#3 (text+ko) ==== @@ -5,5 +5,6 @@ #define MINIFILE_OUT_CAP 1 #define MINIFILE_MAGIC_CAP 2 #define MINIFILE_FILE_CAP 3 +#define MINIFILE_TIMING_CAP 4 #define MINIFILE_BUF_MAX 4096 From owner-p4-projects@FreeBSD.ORG Mon Jan 7 20:17:56 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8ED794A0; Mon, 7 Jan 2013 20:17:56 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4ECE049E for ; Mon, 7 Jan 2013 20:17:56 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 21A8C333 for ; Mon, 7 Jan 2013 20:17:56 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.5/8.14.5) with ESMTP id r07KHurD052199 for ; Mon, 7 Jan 2013 20:17:56 GMT (envelope-from brooks@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.5/8.14.5/Submit) id r07KHtoZ052196 for perforce@freebsd.org; Mon, 7 Jan 2013 20:17:55 GMT (envelope-from brooks@freebsd.org) Date: Mon, 7 Jan 2013 20:17:55 GMT Message-Id: <201301072017.r07KHtoZ052196@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to brooks@freebsd.org using -f From: Brooks Davis Subject: PERFORCE change 219957 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jan 2013 20:17:56 -0000 http://p4web.freebsd.org/@@219957?ac=10 Change 219957 by brooks@brooks_zenith on 2013/01/07 20:17:35 Integrate rwatson's work on FDT support. Affected files ... .. //depot/projects/ctsrd/cheribsd/src/sys/boot/fdt/dts/beri-sim.dts#1 branch .. //depot/projects/ctsrd/cheribsd/src/sys/boot/fdt/dts/beripad-de4.dts#1 branch .. //depot/projects/ctsrd/cheribsd/src/sys/boot/fdt/dts/beripad-tpad.dts#1 branch .. //depot/projects/ctsrd/cheribsd/src/sys/conf/files#5 integrate .. //depot/projects/ctsrd/cheribsd/src/sys/conf/files.mips#5 integrate .. //depot/projects/ctsrd/cheribsd/src/sys/dev/altera/avgen/altera_avgen.c#5 integrate .. //depot/projects/ctsrd/cheribsd/src/sys/dev/altera/avgen/altera_avgen.h#3 integrate .. //depot/projects/ctsrd/cheribsd/src/sys/dev/altera/avgen/altera_avgen_fdt.c#1 branch .. //depot/projects/ctsrd/cheribsd/src/sys/dev/altera/avgen/altera_avgen_nexus.c#1 branch .. //depot/projects/ctsrd/cheribsd/src/sys/dev/altera/jtag_uart/altera_jtag_uart.h#4 integrate .. //depot/projects/ctsrd/cheribsd/src/sys/dev/altera/jtag_uart/altera_jtag_uart_cons.c#5 integrate .. //depot/projects/ctsrd/cheribsd/src/sys/dev/altera/jtag_uart/altera_jtag_uart_fdt.c#1 branch .. //depot/projects/ctsrd/cheribsd/src/sys/dev/altera/jtag_uart/altera_jtag_uart_nexus.c#3 integrate .. //depot/projects/ctsrd/cheribsd/src/sys/dev/altera/sdcard/altera_sdcard.c#3 integrate .. //depot/projects/ctsrd/cheribsd/src/sys/dev/altera/sdcard/altera_sdcard.h#4 integrate .. //depot/projects/ctsrd/cheribsd/src/sys/dev/altera/sdcard/altera_sdcard_fdt.c#1 branch .. //depot/projects/ctsrd/cheribsd/src/sys/dev/altera/sdcard/altera_sdcard_nexus.c#3 integrate .. //depot/projects/ctsrd/cheribsd/src/sys/dev/fdt/fdt_mips.c#2 integrate .. //depot/projects/ctsrd/cheribsd/src/sys/dev/fdt/fdtbus.c#3 integrate .. //depot/projects/ctsrd/cheribsd/src/sys/dev/isf/isf.c#3 integrate .. //depot/projects/ctsrd/cheribsd/src/sys/dev/isf/isf.h#3 integrate .. //depot/projects/ctsrd/cheribsd/src/sys/dev/isf/isf_fdt.c#1 branch .. //depot/projects/ctsrd/cheribsd/src/sys/dev/isf/isf_nexus.c#3 integrate .. //depot/projects/ctsrd/cheribsd/src/sys/dev/terasic/de4led/terasic_de4led.c#5 integrate .. //depot/projects/ctsrd/cheribsd/src/sys/dev/terasic/de4led/terasic_de4led.h#3 integrate .. //depot/projects/ctsrd/cheribsd/src/sys/dev/terasic/de4led/terasic_de4led_fdt.c#1 branch .. //depot/projects/ctsrd/cheribsd/src/sys/dev/terasic/de4led/terasic_de4led_nexus.c#3 integrate .. //depot/projects/ctsrd/cheribsd/src/sys/dev/terasic/mtl/terasic_mtl.c#3 integrate .. //depot/projects/ctsrd/cheribsd/src/sys/dev/terasic/mtl/terasic_mtl.h#4 integrate .. //depot/projects/ctsrd/cheribsd/src/sys/dev/terasic/mtl/terasic_mtl_fdt.c#1 branch .. //depot/projects/ctsrd/cheribsd/src/sys/dev/terasic/mtl/terasic_mtl_nexus.c#3 integrate .. //depot/projects/ctsrd/cheribsd/src/sys/mips/beri/beri_machdep.c#4 integrate .. //depot/projects/ctsrd/cheribsd/src/sys/mips/beri/files.beri#9 integrate .. //depot/projects/ctsrd/cheribsd/src/sys/mips/conf/BERI_DE4.hints#6 integrate .. //depot/projects/ctsrd/cheribsd/src/sys/mips/conf/BERI_DE4_MDROOT#5 edit .. //depot/projects/ctsrd/cheribsd/src/sys/mips/conf/BERI_FDT_DE4.hints#1 branch .. //depot/projects/ctsrd/cheribsd/src/sys/mips/conf/BERI_FDT_DE4_MDROOT#1 branch .. //depot/projects/ctsrd/cheribsd/src/sys/mips/conf/BERI_SIM.hints#3 delete .. //depot/projects/ctsrd/cheribsd/src/sys/mips/conf/BERI_SIM_MDROOT#5 integrate .. //depot/projects/ctsrd/cheribsd/src/sys/mips/conf/CHERI_DE4_MDROOT#2 edit .. //depot/projects/ctsrd/cheribsd/src/sys/mips/include/bus.h#3 integrate .. //depot/projects/ctsrd/cheribsd/src/sys/mips/include/fdt.h#2 integrate .. //depot/projects/ctsrd/cheribsd/src/sys/mips/include/metadata.h#2 integrate .. //depot/projects/ctsrd/cheribsd/src/sys/mips/mips/bus_space_fdt.c#1 branch Differences ... ==== //depot/projects/ctsrd/cheribsd/src/sys/conf/files#5 (text+ko) ==== @@ -638,9 +638,12 @@ dev/alc/if_alc.c optional alc pci dev/ale/if_ale.c optional ale pci dev/altera/avgen/altera_avgen.c optional altera_avgen +dev/altera/avgen/altera_avgen_fdt.c optional altera_avgen fdt +dev/altera/avgen/altera_avgen_nexus.c optional altera_avgen dev/altera/sdcard/altera_sdcard.c optional altera_sdcard dev/altera/sdcard/altera_sdcard_disk.c optional altera_sdcard dev/altera/sdcard/altera_sdcard_io.c optional altera_sdcard +dev/altera/sdcard/altera_sdcard_fdt.c optional altera_sdcard fdt dev/altera/sdcard/altera_sdcard_nexus.c optional altera_sdcard dev/amr/amr.c optional amr dev/amr/amr_cam.c optional amrp amr @@ -1392,6 +1395,7 @@ dev/iscsi/initiator/isc_sm.c optional iscsi_initiator scbus dev/iscsi/initiator/isc_subr.c optional iscsi_initiator scbus dev/isf/isf.c optional isf +dev/isf/isf_fdt.c optional isf fdt dev/isf/isf_nexus.c optional isf dev/isp/isp.c optional isp dev/isp/isp_freebsd.c optional isp ==== //depot/projects/ctsrd/cheribsd/src/sys/conf/files.mips#5 (text+ko) ==== @@ -45,6 +45,7 @@ mips/mips/tlb.c standard mips/mips/bus_space_generic.c standard +mips/mips/bus_space_fdt.c optional fdt mips/mips/busdma_machdep.c standard mips/mips/cache.c standard mips/mips/cache_mipsNN.c standard ==== //depot/projects/ctsrd/cheribsd/src/sys/dev/altera/avgen/altera_avgen.c#5 (text+ko) ==== @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 Robert N. M. Watson + * Copyright (c) 2012-2013 Robert N. M. Watson * All rights reserved. * * This software was developed by SRI International and the University of @@ -60,6 +60,8 @@ * system-on-chip bus environments would work fine with the same code. */ +devclass_t altera_avgen_devclass; + static d_mmap_t altera_avgen_mmap; static d_read_t altera_avgen_read; static d_write_t altera_avgen_write; @@ -226,13 +228,6 @@ return (0); } -static int -altera_avgen_nexus_probe(device_t dev) -{ - - device_set_desc(dev, "Generic Altera Avalon device attachment"); - return (BUS_PROBE_DEFAULT); -} static int altera_avgen_process_options(struct altera_avgen_softc *sc, @@ -321,42 +316,14 @@ return (0); } -static int -altera_avgen_nexus_attach(device_t dev) +int +altera_avgen_attach(struct altera_avgen_softc *sc, const char *str_fileio, + const char *str_mmapio, const char *str_devname, int devunit) { - struct altera_avgen_softc *sc; - const char *str_fileio, *str_mmapio; - const char *str_devname; + device_t dev = sc->avg_dev; char devname[SPECNAMELEN + 1]; - int devunit, error; - - sc = device_get_softc(dev); - sc->avg_dev = dev; - sc->avg_unit = device_get_unit(dev); + int error; - /* - * Query non-standard hints to find out what operations are permitted - * on the device, and whether it is cached. - */ - str_fileio = NULL; - str_mmapio = NULL; - str_devname = NULL; - devunit = -1; - sc->avg_width = 1; - error = resource_int_value(device_get_name(dev), device_get_unit(dev), - ALTERA_AVALON_STR_WIDTH, &sc->avg_width); - if (error != 0 && error != ENOENT) { - device_printf(dev, "invalid %s\n", ALTERA_AVALON_STR_WIDTH); - return (error); - } - (void)resource_string_value(device_get_name(dev), - device_get_unit(dev), ALTERA_AVALON_STR_FILEIO, &str_fileio); - (void)resource_string_value(device_get_name(dev), - device_get_unit(dev), ALTERA_AVALON_STR_MMAPIO, &str_mmapio); - (void)resource_string_value(device_get_name(dev), - device_get_unit(dev), ALTERA_AVALON_STR_DEVNAME, &str_devname); - (void)resource_int_value(device_get_name(dev), device_get_unit(dev), - ALTERA_AVALON_STR_DEVUNIT, &devunit); error = altera_avgen_process_options(sc, str_fileio, str_mmapio, str_devname, devunit); if (error) @@ -374,25 +341,15 @@ snprintf(devname, sizeof(devname), "%s%d", "avgen", sc->avg_unit); - /* Memory allocation and checking. */ - sc->avg_rid = 0; - sc->avg_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &sc->avg_rid, RF_ACTIVE); - if (sc->avg_res == NULL) { - device_printf(dev, "couldn't map memory\n"); - return (ENXIO); - } if (rman_get_size(sc->avg_res) >= PAGE_SIZE || str_mmapio != NULL) { if (rman_get_size(sc->avg_res) % PAGE_SIZE != 0) { device_printf(dev, "memory region not even multiple of page size\n"); - error = ENXIO; - goto error; + return (ENXIO); } if (rman_get_start(sc->avg_res) % PAGE_SIZE != 0) { device_printf(dev, "memory region not page-aligned\n"); - error = ENXIO; - goto error; + return (ENXIO); } } @@ -409,43 +366,16 @@ GID_WHEEL, S_IRUSR | S_IWUSR, str_devname); if (sc->avg_cdev == NULL) { device_printf(sc->avg_dev, "%s: make_dev failed\n", __func__); - error = ENXIO; - goto error; + return (ENXIO); } /* XXXRW: Slight race between make_dev(9) and here. */ sc->avg_cdev->si_drv1 = sc; return (0); - -error: - bus_release_resource(dev, SYS_RES_MEMORY, sc->avg_rid, sc->avg_res); - return (error); } -static int -altera_avgen_nexus_detach(device_t dev) +void +altera_avgen_detach(struct altera_avgen_softc *sc) { - struct altera_avgen_softc *sc; - sc = device_get_softc(dev); destroy_dev(sc->avg_cdev); - bus_release_resource(dev, SYS_RES_MEMORY, sc->avg_rid, sc->avg_res); - return (0); } - -static device_method_t altera_avgen_nexus_methods[] = { - DEVMETHOD(device_probe, altera_avgen_nexus_probe), - DEVMETHOD(device_attach, altera_avgen_nexus_attach), - DEVMETHOD(device_detach, altera_avgen_nexus_detach), - { 0, 0 } -}; - -static driver_t altera_avgen_nexus_driver = { - "altera_avgen", - altera_avgen_nexus_methods, - sizeof(struct altera_avgen_softc), -}; - -static devclass_t altera_avgen_devclass; - -DRIVER_MODULE(avgen, nexus, altera_avgen_nexus_driver, altera_avgen_devclass, - 0, 0); ==== //depot/projects/ctsrd/cheribsd/src/sys/dev/altera/avgen/altera_avgen.h#3 (text+ko) ==== @@ -77,7 +77,11 @@ /* * Driver setup routines from the bus attachment/teardown. */ -int altera_avgen_attach(struct altera_avgen_softc *sc); +int altera_avgen_attach(struct altera_avgen_softc *sc, + const char *str_fileio, const char *str_mmapio, + const char *str_devname, int devunit); void altera_avgen_detach(struct altera_avgen_softc *sc); +extern devclass_t altera_avgen_devclass; + #endif /* _DEV_ALTERA_AVALON_H_ */ ==== //depot/projects/ctsrd/cheribsd/src/sys/dev/altera/jtag_uart/altera_jtag_uart.h#4 (text+ko) ==== @@ -194,4 +194,6 @@ int altera_jtag_uart_attach(struct altera_jtag_uart_softc *sc); void altera_jtag_uart_detach(struct altera_jtag_uart_softc *sc); +extern devclass_t altera_jtag_uart_devclass; + #endif /* _DEV_ALTERA_JTAG_UART_H_ */ ==== //depot/projects/ctsrd/cheribsd/src/sys/dev/altera/jtag_uart/altera_jtag_uart_cons.c#5 (text+ko) ==== @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD: src/sys/dev/altera/jtag_uart/altera_jtag_uart_cons.c,v 1.2 2012/09/14 21:28:56 eadler Exp $"); #include +#include #include #include #include @@ -46,6 +47,8 @@ #include +devclass_t altera_jtag_uart_devclass; + /* * One-byte buffer as we can't check whether the UART is readable without * actually reading from it, synchronised by a spinlock; this lock also ==== //depot/projects/ctsrd/cheribsd/src/sys/dev/altera/jtag_uart/altera_jtag_uart_nexus.c#3 (text+ko) ==== @@ -137,7 +137,5 @@ sizeof(struct altera_jtag_uart_softc), }; -static devclass_t altera_jtag_uart_devclass; - DRIVER_MODULE(altera_jtag_uart, nexus, altera_jtag_uart_nexus_driver, altera_jtag_uart_devclass, 0, 0); ==== //depot/projects/ctsrd/cheribsd/src/sys/dev/altera/sdcard/altera_sdcard.c#3 (text+ko) ==== @@ -70,6 +70,7 @@ * 3. Handle read-only SD Cards. * 4. Tune timeouts based on real-world SD Card speeds. */ +devclass_t altera_sdcard_devclass; void altera_sdcard_attach(struct altera_sdcard_softc *sc) ==== //depot/projects/ctsrd/cheribsd/src/sys/dev/altera/sdcard/altera_sdcard.h#4 (text+ko) ==== @@ -244,4 +244,6 @@ void altera_sdcard_disk_insert(struct altera_sdcard_softc *sc); void altera_sdcard_disk_remove(struct altera_sdcard_softc *sc); +extern devclass_t altera_sdcard_devclass; + #endif /* _DEV_ALTERA_SDCARD_H_ */ ==== //depot/projects/ctsrd/cheribsd/src/sys/dev/altera/sdcard/altera_sdcard_nexus.c#3 (text+ko) ==== @@ -110,7 +110,5 @@ sizeof(struct altera_sdcard_softc), }; -static devclass_t altera_sdcard_devclass; - DRIVER_MODULE(altera_sdcard, nexus, altera_sdcard_nexus_driver, altera_sdcard_devclass, 0, 0); ==== //depot/projects/ctsrd/cheribsd/src/sys/dev/fdt/fdt_mips.c#2 (text+ko) ==== @@ -49,8 +49,26 @@ { NULL, NULL } }; +/* + * For PIC-free boards, provide a PIC decoder to be used with mips4k CP0 + * interrupt control directly. + */ +static int +fdt_pic_decode_mips4k_cp0(phandle_t node, pcell_t *intr, int *interrupt, + int *trig, int *pol) +{ + + if (!fdt_is_compatible(node, "mips4k,cp0")) + return (ENXIO); + + *interrupt = fdt32_to_cpu(intr[0]); + *trig = INTR_TRIGGER_CONFORM; + *pol = INTR_POLARITY_CONFORM; + + return (0); +} + fdt_pic_decode_t fdt_pic_table[] = { - NULL, - NULL, + &fdt_pic_decode_mips4k_cp0, NULL }; ==== //depot/projects/ctsrd/cheribsd/src/sys/dev/fdt/fdtbus.c#3 (text+ko) ==== @@ -257,6 +257,8 @@ struct fdtbus_devinfo *di; di = device_get_ivars(dev); + if (di == NULL) + return; free(di->di_name, M_OFWPROP); free(di->di_type, M_OFWPROP); ==== //depot/projects/ctsrd/cheribsd/src/sys/dev/isf/isf.c#3 (text+ko) ==== @@ -150,6 +150,7 @@ * physical package, due to variable block size support in the StrataFlash * part. */ +devclass_t isf_devclass; static uint16_t isf_read_reg(struct isf_softc *sc, uint16_t reg) ==== //depot/projects/ctsrd/cheribsd/src/sys/dev/isf/isf.h#3 (text+ko) ==== @@ -87,6 +87,8 @@ int isf_attach(struct isf_softc *sc); void isf_detach(struct isf_softc *sc); + +extern devclass_t isf_devclass; #endif /* _KERNEL */ #endif /* _DEV_ISF_H_ */ ==== //depot/projects/ctsrd/cheribsd/src/sys/dev/isf/isf_nexus.c#3 (text+ko) ==== @@ -115,6 +115,4 @@ sizeof(struct isf_softc), }; -static devclass_t isf_devclass; - DRIVER_MODULE(isf, nexus, isf_nexus_driver, isf_devclass, 0, 0); ==== //depot/projects/ctsrd/cheribsd/src/sys/dev/terasic/de4led/terasic_de4led.c#5 (text+ko) ==== @@ -43,6 +43,8 @@ #include #include +devclass_t terasic_de4led_devclass; + static void terasic_de4led_update(struct terasic_de4led_softc *sc) { ==== //depot/projects/ctsrd/cheribsd/src/sys/dev/terasic/de4led/terasic_de4led.h#3 (text+ko) ==== @@ -70,4 +70,6 @@ void terasic_de4led_attach(struct terasic_de4led_softc *sc); void terasic_de4led_detach(struct terasic_de4led_softc *sc); +extern devclass_t terasic_de4led_devclass; + #endif /* _DEV_TERASIC_DE4LED_H_ */ ==== //depot/projects/ctsrd/cheribsd/src/sys/dev/terasic/de4led/terasic_de4led_nexus.c#3 (text+ko) ==== @@ -106,7 +106,5 @@ sizeof(struct terasic_de4led_softc), }; -static devclass_t terasic_de4led_devclass; - DRIVER_MODULE(terasic_de4led, nexus, terasic_de4led_nexus_driver, terasic_de4led_devclass, 0, 0); ==== //depot/projects/ctsrd/cheribsd/src/sys/dev/terasic/mtl/terasic_mtl.c#3 (text+ko) ==== @@ -63,6 +63,9 @@ * attached as they may be called even if the attach routine hasn't been, on * an error. */ + +devclass_t terasic_mtl_devclass; + int terasic_mtl_attach(struct terasic_mtl_softc *sc) { ==== //depot/projects/ctsrd/cheribsd/src/sys/dev/terasic/mtl/terasic_mtl.h#4 (text+ko) ==== @@ -159,6 +159,8 @@ int terasic_mtl_attach(struct terasic_mtl_softc *sc); void terasic_mtl_detach(struct terasic_mtl_softc *sc); +extern devclass_t terasic_mtl_devclass; + /* * Sub-driver setup routines. */ ==== //depot/projects/ctsrd/cheribsd/src/sys/dev/terasic/mtl/terasic_mtl_nexus.c#3 (text+ko) ==== @@ -190,7 +190,5 @@ sizeof(struct terasic_mtl_softc), }; -static devclass_t terasic_mtl_devclass; - DRIVER_MODULE(mtl, nexus, terasic_mtl_nexus_driver, terasic_mtl_devclass, 0, 0); ==== //depot/projects/ctsrd/cheribsd/src/sys/mips/beri/beri_machdep.c#4 (text+ko) ==== @@ -1,7 +1,12 @@ /*- * Copyright (c) 2006 Wojciech A. Koszek + * Copyright (c) 2012 Robert N. M. Watson * All rights reserved. * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -27,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" +#include "opt_platform.h" #include #include @@ -39,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -49,6 +56,11 @@ #include #include +#ifdef FDT +#include +#include +#endif + #include #include #include @@ -59,6 +71,7 @@ #include #include #include +#include #include #include @@ -124,6 +137,10 @@ char **argv = (char **)a1; char **envp = (char **)a2; unsigned int memsize = a3; +#ifdef FDT + vm_offset_t dtbp; + void *kmdp; +#endif int i; /* clear the BSS and SBSS segments */ @@ -134,6 +151,33 @@ mips_pcpu0_init(); +#ifdef FDT + /* + * Find the dtb passed in by the boot loader (currently fictional). + */ + kmdp = preload_search_by_type("elf kernel"); + if (kmdp != NULL) + dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t); + else + dtbp = (vm_offset_t)NULL; + +#if defined(FDT_DTB_STATIC) + /* + * In case the device tree blob was not retrieved (from metadata) try + * to use the statically embedded one. + */ + if (dtbp == (vm_offset_t)NULL) + dtbp = (vm_offset_t)&fdt_static_dtb; +#else +#error "Non-static FDT not yet supported on BERI" +#endif + + if (OF_install(OFW_FDT, 0) == FALSE) + while (1); + if (OF_init(&fdt_static_dtb) != 0) + while (1); +#endif + /* * XXXRW: We have no way to compare wallclock time to cycle rate on * BERI, so for now assume we run at the MALTA default (100MHz). ==== //depot/projects/ctsrd/cheribsd/src/sys/mips/beri/files.beri#9 (text+ko) ==== @@ -1,11 +1,14 @@ # $FreeBSD: src/sys/mips/beri/files.beri,v 1.4 2012/08/26 09:21:59 rwatson Exp $ dev/altera/jtag_uart/altera_jtag_uart_cons.c optional altera_jtag_uart dev/altera/jtag_uart/altera_jtag_uart_tty.c optional altera_jtag_uart +dev/altera/jtag_uart/altera_jtag_uart_fdt.c optional altera_jtag_uart fdt dev/altera/jtag_uart/altera_jtag_uart_nexus.c optional altera_jtag_uart dev/cfi/cfi_bus_nexus.c optional cfi dev/terasic/de4led/terasic_de4led.c optional terasic_de4led +dev/terasic/de4led/terasic_de4led_fdt.c optional terasic_de4led fdt dev/terasic/de4led/terasic_de4led_nexus.c optional terasic_de4led dev/terasic/mtl/terasic_mtl.c optional terasic_mtl +dev/terasic/mtl/terasic_mtl_fdt.c optional terasic_mtl fdt dev/terasic/mtl/terasic_mtl_nexus.c optional terasic_mtl dev/terasic/mtl/terasic_mtl_pixel.c optional terasic_mtl dev/terasic/mtl/terasic_mtl_reg.c optional terasic_mtl ==== //depot/projects/ctsrd/cheribsd/src/sys/mips/conf/BERI_DE4.hints#6 (text+ko) ==== @@ -61,26 +61,26 @@ hint.altera_avgen.0.devname="berirom" # +# Expose the DE4 buttons and switches via an Avalon "generic" device. +# +hint.altera_avgen.1.at="nexus0" +hint.altera_avgen.1.maddr=0x7f009000 +hint.altera_avgen.1.msize=2 +hint.altera_avgen.1.width=1 +hint.altera_avgen.1.fileio="r" +hint.altera_avgen.1.devname="de4bsw" + +# # Expose the DE4 flash via an Avalon "generic" device. # This is incompatible with the isf(4) driver. # -#hint.altera_avgen.0.at="nexus0" -#hint.altera_avgen.0.maddr=0x74000000 -#hint.altera_avgen.0.msize=0x4000000 -#hint.altera_avgen.0.width=2 -#hint.altera_avgen.0.fileio="rw" -#hint.altera_avgen.0.mmapio="rwx" -#hint.altera_avgen.0.devname="de4flash" - -# -# Expose the DE4 buttons and switches via an Avalon "generic" device. -# -hint.altera_avgen.0.at="nexus0" -hint.altera_avgen.0.maddr=0x7f009000 -hint.altera_avgen.0.msize=2 -hint.altera_avgen.0.width=1 -hint.altera_avgen.0.fileio="r" -hint.altera_avgen.0.devname="de4bsw" +#hint.altera_avgen.2.at="nexus0" +#hint.altera_avgen.2.maddr=0x74000000 +#hint.altera_avgen.2.msize=0x4000000 +#hint.altera_avgen.2.width=2 +#hint.altera_avgen.2.fileio="rw" +#hint.altera_avgen.2.mmapio="rwx" +#hint.altera_avgen.2.devname="de4flash" # # General Intel StrataFlash driver ==== //depot/projects/ctsrd/cheribsd/src/sys/mips/conf/BERI_DE4_MDROOT#5 (text+ko) ==== @@ -10,7 +10,12 @@ ident BERI_DE4_MDROOT -hints "BERI_DE4.hints" #Default places to look for devices. +#hints "BERI_DE4.hints" #Default places to look for devices. +hints "BERI_FDT_DE4.hints" #Default places to look for devices. + +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=beripad-de4.dts # # This kernel configuration uses an embedded 8MB memory root file system. ==== //depot/projects/ctsrd/cheribsd/src/sys/mips/conf/BERI_SIM_MDROOT#5 (text+ko) ==== @@ -9,7 +9,9 @@ ident BERI_SIM_MDROOT -hints "BERI_SIM.hints" #Default places to look for devices. +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=beri-sim.dts # # This kernel configuration uses an embedded 8MB memory root file system. ==== //depot/projects/ctsrd/cheribsd/src/sys/mips/conf/CHERI_DE4_MDROOT#2 (text+ko) ==== @@ -9,5 +9,9 @@ include BERI_DE4_MDROOT ident CHERI_DE4_MDROOT +nooptions MD_ROOT_SIZE +options MD_ROOT_SIZE=25600 +makeoptions MFS_IMAGE=/home/bed22/demoroot.img + nocpu CPU_BERI cpu CPU_CHERI ==== //depot/projects/ctsrd/cheribsd/src/sys/mips/include/bus.h#3 (text+ko) ==== @@ -728,6 +728,8 @@ */ DECLARE_BUS_SPACE_PROTOTYPES(generic); extern bus_space_tag_t mips_bus_space_generic; +extern bus_space_tag_t mips_bus_space_fdt; + /* Special bus space for RMI processors */ #if defined(CPU_RMI) || defined (CPU_NLM) extern bus_space_tag_t rmi_bus_space; ==== //depot/projects/ctsrd/cheribsd/src/sys/mips/include/fdt.h#2 (text+ko) ==== @@ -51,7 +51,7 @@ #if defined(CPU_RMI) || defined(CPU_NLM) #define fdtbus_bs_tag rmi_uart_bus_space #else -#define fdtbus_bs_tag NULL +#define fdtbus_bs_tag mips_bus_space_fdt #endif #endif /* _MACHINE_FDT_H_ */ ==== //depot/projects/ctsrd/cheribsd/src/sys/mips/include/metadata.h#2 (text+ko) ==== @@ -30,5 +30,6 @@ #define _MACHINE_METADATA_H_ #define MODINFOMD_SMAP 0x1001 +#define MODINFOMD_DTBP 0x1002 #endif /* !_MACHINE_METADATA_H_ */ From owner-p4-projects@FreeBSD.ORG Mon Jan 7 20:23:02 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 345496C5; Mon, 7 Jan 2013 20:23:02 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E44DC6C3 for ; Mon, 7 Jan 2013 20:23:01 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id BA907369 for ; Mon, 7 Jan 2013 20:23:01 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.5/8.14.5) with ESMTP id r07KN1Cv052457 for ; Mon, 7 Jan 2013 20:23:01 GMT (envelope-from brooks@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.5/8.14.5/Submit) id r07KN1ir052454 for perforce@freebsd.org; Mon, 7 Jan 2013 20:23:01 GMT (envelope-from brooks@freebsd.org) Date: Mon, 7 Jan 2013 20:23:01 GMT Message-Id: <201301072023.r07KN1ir052454@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to brooks@freebsd.org using -f From: Brooks Davis Subject: PERFORCE change 219958 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jan 2013 20:23:02 -0000 http://p4web.freebsd.org/@@219958?ac=10 Change 219958 by brooks@brooks_zenith on 2013/01/07 20:22:20 Revert two premature changes in 219957 that I submitted by mistake. Affected files ... .. //depot/projects/ctsrd/cheribsd/src/sys/mips/conf/BERI_DE4_MDROOT#6 edit .. //depot/projects/ctsrd/cheribsd/src/sys/mips/conf/CHERI_DE4_MDROOT#3 edit Differences ... ==== //depot/projects/ctsrd/cheribsd/src/sys/mips/conf/BERI_DE4_MDROOT#6 (text+ko) ==== @@ -10,12 +10,7 @@ ident BERI_DE4_MDROOT -#hints "BERI_DE4.hints" #Default places to look for devices. -hints "BERI_FDT_DE4.hints" #Default places to look for devices. - -options FDT -options FDT_DTB_STATIC -makeoptions FDT_DTS_FILE=beripad-de4.dts +hints "BERI_DE4.hints" #Default places to look for devices. # # This kernel configuration uses an embedded 8MB memory root file system. ==== //depot/projects/ctsrd/cheribsd/src/sys/mips/conf/CHERI_DE4_MDROOT#3 (text+ko) ==== @@ -9,9 +9,5 @@ include BERI_DE4_MDROOT ident CHERI_DE4_MDROOT -nooptions MD_ROOT_SIZE -options MD_ROOT_SIZE=25600 -makeoptions MFS_IMAGE=/home/bed22/demoroot.img - nocpu CPU_BERI cpu CPU_CHERI From owner-p4-projects@FreeBSD.ORG Mon Jan 7 21:01:42 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B55431BF; Mon, 7 Jan 2013 21:01:42 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6ED241BD for ; Mon, 7 Jan 2013 21:01:42 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 531F8745 for ; Mon, 7 Jan 2013 21:01:42 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.5/8.14.5) with ESMTP id r07L1fbS053839 for ; Mon, 7 Jan 2013 21:01:41 GMT (envelope-from brooks@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.5/8.14.5/Submit) id r07L1fUr053836 for perforce@freebsd.org; Mon, 7 Jan 2013 21:01:41 GMT (envelope-from brooks@freebsd.org) Date: Mon, 7 Jan 2013 21:01:41 GMT Message-Id: <201301072101.r07L1fUr053836@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to brooks@freebsd.org using -f From: Brooks Davis Subject: PERFORCE change 219959 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jan 2013 21:01:42 -0000 http://p4web.freebsd.org/@@219959?ac=10 Change 219959 by brooks@brooks_zenith on 2013/01/07 21:01:04 Switch BERI_DE4 kernels to FDT retaining hints only for flash partitioning. Reduce duplication in BERI_DE4_[MS]DROOT configurations by splitting general DE4 configuration into BERI_DE4_BASE. Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/mips/conf/BERI_DE4.hints#17 edit .. //depot/projects/ctsrd/beribsd/src/sys/mips/conf/BERI_DE4_BASE#1 add .. //depot/projects/ctsrd/beribsd/src/sys/mips/conf/BERI_DE4_MDROOT#10 edit .. //depot/projects/ctsrd/beribsd/src/sys/mips/conf/BERI_DE4_SDROOT#10 edit Differences ... ==== //depot/projects/ctsrd/beribsd/src/sys/mips/conf/BERI_DE4.hints#17 (text+ko) ==== @@ -1,97 +1,5 @@ # $FreeBSD: src/sys/mips/conf/BERI_DE4.hints,v 1.5 2012/08/26 10:40:13 rwatson Exp $ -# -# Altera JTAG UARTs configured for console, debugging, and data putput on the -# Terasic DE-4. -# -hint.altera_jtag_uart.0.at="nexus0" -hint.altera_jtag_uart.0.maddr=0x7f000000 -hint.altera_jtag_uart.0.msize=0x40 -hint.altera_jtag_uart.0.irq=0 - -hint.altera_jtag_uart.1.at="nexus0" -hint.altera_jtag_uart.1.maddr=0x7f001000 -hint.altera_jtag_uart.1.msize=0x40 - -hint.altera_jtag_uart.2.at="nexus0" -hint.altera_jtag_uart.2.maddr=0x7f002000 -hint.altera_jtag_uart.2.msize=0x40 - -# -# On-board DE4 and tPad SD Card IP core -# -hint.altera_sdcardc.0.at="nexus0" -hint.altera_sdcardc.0.maddr=0x7f008000 -hint.altera_sdcardc.0.msize=0x400 - -# -# On-board DE4 8-element LED -# -hint.terasic_de4led.0.at="nexus0" -hint.terasic_de4led.0.maddr=0x7f006000 -hint.terasic_de4led.0.msize=1 -hint.terasic_de4led.0.de4led_0_cmd="f9" - -# -# Altera Triple-Speed Ethernet Mac, present in tPad and DE-4 configurations -# -hint.atse.0.at="nexus0" -hint.atse.0.maddr=0x7f007000 -hint.atse.0.msize=0x540 - -# -# Terasic Multi-touch LCD (MTL), an optional feature in DE-4 configurations. -# -hint.terasic_mtl.0.at="nexus0" -hint.terasic_mtl.0.reg_maddr=0x70400000 -hint.terasic_mtl.0.reg_msize=0x1000 -hint.terasic_mtl.0.pixel_maddr=0x70000000 -hint.terasic_mtl.0.pixel_msize=0x177000 -hint.terasic_mtl.0.text_maddr=0x70177000 -hint.terasic_mtl.0.text_msize=0x2000 - -# -# BERI Hardware Version ROM -# -hint.altera_avgen.0.at="nexus0" -hint.altera_avgen.0.maddr=0x7F00A000 -hint.altera_avgen.0.msize=20 -hint.altera_avgen.0.width=4 -hint.altera_avgen.0.fileio="rw" -hint.altera_avgen.0.devname="berirom" - -# -# Expose the DE4 buttons and switches via an Avalon "generic" device. -# -hint.altera_avgen.1.at="nexus0" -hint.altera_avgen.1.maddr=0x7f009000 -hint.altera_avgen.1.msize=2 -hint.altera_avgen.1.width=1 -hint.altera_avgen.1.fileio="r" -hint.altera_avgen.1.devname="de4bsw" - -# -# Expose the DE4 flash via an Avalon "generic" device. -# This is incompatible with the isf(4) driver. -# -#hint.altera_avgen.2.at="nexus0" -#hint.altera_avgen.2.maddr=0x74000000 -#hint.altera_avgen.2.msize=0x4000000 -#hint.altera_avgen.2.width=2 -#hint.altera_avgen.2.fileio="rw" -#hint.altera_avgen.2.mmapio="rwx" -#hint.altera_avgen.2.devname="de4flash" - -# -# General Intel StrataFlash driver -# -hint.isf.0.at="nexus0" -hint.isf.0.maddr=0x74000000 -hint.isf.0.msize=0x2000000 -hint.isf.1.at="nexus0" -hint.isf.1.maddr=0x76000000 -hint.isf.1.msize=0x2000000 - # Reserved configuration blocks. Don't touch. hint.map.0.at="isf0" hint.map.0.start=0x00000000 @@ -105,13 +13,13 @@ hint.map.1.end=0x01820000 hint.map.1.name="fpga" -# Kernel on first chip +# Currently unused space on the first chip hint.map.2.at="isf0" hint.map.2.start=0x01820000 hint.map.2.end=0x02000000 hint.map.2.name="reserved" -# The second chip +# Kernel on the second chip hint.map.3.at="isf1" hint.map.3.start=0x00000000 hint.map.3.end=0x02000000 ==== //depot/projects/ctsrd/beribsd/src/sys/mips/conf/BERI_DE4_MDROOT#10 (text+ko) ==== @@ -1,30 +1,20 @@ # -# BERI_DE4 -- Kernel for the SRI/Cambridge "BERI" (Bluespec Extensible RISC -# Implementation) FPGA soft core, as configured in its Terasic DE-4 reference -# configuration. +# BERI_DE4_MDROOT -- Kernel for the SRI/Cambridge "BERI" (Bluespec Extensible +# RISC # Implementation) FPGA soft core, as configured in its Terasic DE-4 +# reference configuration. # # $FreeBSD: src/sys/mips/conf/BERI_DE4_MDROOT,v 1.6 2012/09/05 15:55:51 brooks Exp $ # -include "BERI_TEMPLATE" +include "BERI_DE4_BASE" ident BERI_DE4_MDROOT -hints "BERI_DE4.hints" #Default places to look for devices. - # # This kernel configuration uses an embedded 8MB memory root file system. # Adjust the following path based on local requirements. # options MD_ROOT # MD is a potential root device -options MD_ROOT_SIZE=8192 +options MD_ROOT_SIZE=18432 options ROOTDEVNAME=\"ufs:md0\" - -device altera_avgen -device altera_jtag_uart -device altera_sdcard -device terasic_de4led -device terasic_mtl - -device isf -device sc +makeoptions MFS_IMAGE=/home/bed22/demoroot.img ==== //depot/projects/ctsrd/beribsd/src/sys/mips/conf/BERI_DE4_SDROOT#10 (text+ko) ==== @@ -1,24 +1,16 @@ # -# BERI_DE4 -- Kernel for the SRI/Cambridge "BERI" (Bluespec Extensible RISC -# Implementation) FPGA soft core, as configured in its Terasic DE-4 reference -# configuration. +# BERI_DE4_SDROOT -- Kernel for the SRI/Cambridge "BERI" (Bluespec Extensible +# RISC Implementation) FPGA soft core, as configured in its Terasic DE-4 +# reference configuration. # # $FreeBSD: src/sys/mips/conf/BERI_DE4_SDROOT,v 1.5 2012/08/26 09:21:59 rwatson Exp $ # -include "BERI_TEMPLATE" +include "BERI_DE4_BASE" ident BERI_DE4_SDROOT -hints "BERI_DE4.hints" #Default places to look for devices. - +# +# This kernel expects to find its root filesystem on the SD Card. +# options ROOTDEVNAME=\"ufs:altera_sdcard0\" - -device altera_avgen -device altera_jtag_uart -device altera_sdcard -device terasic_de4led -device terasic_mtl - -device isf -device sc From owner-p4-projects@FreeBSD.ORG Mon Jan 7 21:22:04 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0833A4A0; Mon, 7 Jan 2013 21:22:04 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B392449E for ; Mon, 7 Jan 2013 21:22:03 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id A3D187D4 for ; Mon, 7 Jan 2013 21:22:03 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.5/8.14.5) with ESMTP id r07LM3lg055358 for ; Mon, 7 Jan 2013 21:22:03 GMT (envelope-from brooks@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.5/8.14.5/Submit) id r07LM3HJ055355 for perforce@freebsd.org; Mon, 7 Jan 2013 21:22:03 GMT (envelope-from brooks@freebsd.org) Date: Mon, 7 Jan 2013 21:22:03 GMT Message-Id: <201301072122.r07LM3HJ055355@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to brooks@freebsd.org using -f From: Brooks Davis Subject: PERFORCE change 219960 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jan 2013 21:22:04 -0000 http://p4web.freebsd.org/@@219960?ac=10 Change 219960 by brooks@brooks_zenith on 2013/01/07 21:21:18 Remove the temporary FDT kernels as they are no longer needed. Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/mips/conf/BERI_FDT_DE4.hints#11 delete .. //depot/projects/ctsrd/beribsd/src/sys/mips/conf/BERI_FDT_DE4_MDROOT#4 delete Differences ... From owner-p4-projects@FreeBSD.ORG Mon Jan 7 22:24:33 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3BE0C24A; Mon, 7 Jan 2013 22:24:33 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E63E2248 for ; Mon, 7 Jan 2013 22:24:27 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 1AEF19D8 for ; Mon, 7 Jan 2013 22:20:10 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.5/8.14.5) with ESMTP id r07MK32A058138 for ; Mon, 7 Jan 2013 22:20:03 GMT (envelope-from brooks@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.5/8.14.5/Submit) id r07MK3XH058135 for perforce@freebsd.org; Mon, 7 Jan 2013 22:20:03 GMT (envelope-from brooks@freebsd.org) Date: Mon, 7 Jan 2013 22:20:03 GMT Message-Id: <201301072220.r07MK3XH058135@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to brooks@freebsd.org using -f From: Brooks Davis Subject: PERFORCE change 219961 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jan 2013 22:24:33 -0000 http://p4web.freebsd.org/@@219961?ac=10 Change 219961 by brooks@brooks_zenith on 2013/01/07 22:19:53 Switch to using FDT instead of hints. Affected files ... .. //depot/projects/ctsrd/cheribsd/src/sys/mips/conf/BERI_DE4.hints#7 integrate .. //depot/projects/ctsrd/cheribsd/src/sys/mips/conf/BERI_DE4_BASE#1 branch .. //depot/projects/ctsrd/cheribsd/src/sys/mips/conf/BERI_DE4_MDROOT#7 integrate .. //depot/projects/ctsrd/cheribsd/src/sys/mips/conf/BERI_DE4_SDROOT#4 integrate .. //depot/projects/ctsrd/cheribsd/src/sys/mips/conf/BERI_FDT_DE4.hints#2 delete .. //depot/projects/ctsrd/cheribsd/src/sys/mips/conf/BERI_FDT_DE4_MDROOT#2 delete Differences ... ==== //depot/projects/ctsrd/cheribsd/src/sys/mips/conf/BERI_DE4.hints#7 (text+ko) ==== @@ -1,97 +1,5 @@ # $FreeBSD: src/sys/mips/conf/BERI_DE4.hints,v 1.5 2012/08/26 10:40:13 rwatson Exp $ -# -# Altera JTAG UARTs configured for console, debugging, and data putput on the -# Terasic DE-4. -# -hint.altera_jtag_uart.0.at="nexus0" -hint.altera_jtag_uart.0.maddr=0x7f000000 -hint.altera_jtag_uart.0.msize=0x40 -hint.altera_jtag_uart.0.irq=0 - -hint.altera_jtag_uart.1.at="nexus0" -hint.altera_jtag_uart.1.maddr=0x7f001000 -hint.altera_jtag_uart.1.msize=0x40 - -hint.altera_jtag_uart.2.at="nexus0" -hint.altera_jtag_uart.2.maddr=0x7f002000 -hint.altera_jtag_uart.2.msize=0x40 - -# -# On-board DE4 and tPad SD Card IP core -# -hint.altera_sdcardc.0.at="nexus0" -hint.altera_sdcardc.0.maddr=0x7f008000 -hint.altera_sdcardc.0.msize=0x400 - -# -# On-board DE4 8-element LED -# -hint.terasic_de4led.0.at="nexus0" -hint.terasic_de4led.0.maddr=0x7f006000 -hint.terasic_de4led.0.msize=1 -hint.terasic_de4led.0.de4led_0_cmd="f9" - -# -# Altera Triple-Speed Ethernet Mac, present in tPad and DE-4 configurations -# -hint.atse.0.at="nexus0" -hint.atse.0.maddr=0x7f007000 -hint.atse.0.msize=0x540 - -# -# Terasic Multi-touch LCD (MTL), an optional feature in DE-4 configurations. -# -hint.terasic_mtl.0.at="nexus0" -hint.terasic_mtl.0.reg_maddr=0x70400000 -hint.terasic_mtl.0.reg_msize=0x1000 -hint.terasic_mtl.0.pixel_maddr=0x70000000 -hint.terasic_mtl.0.pixel_msize=0x177000 -hint.terasic_mtl.0.text_maddr=0x70177000 -hint.terasic_mtl.0.text_msize=0x2000 - -# -# BERI Hardware Version ROM -# -hint.altera_avgen.0.at="nexus0" -hint.altera_avgen.0.maddr=0x7F00A000 -hint.altera_avgen.0.msize=20 -hint.altera_avgen.0.width=4 -hint.altera_avgen.0.fileio="rw" -hint.altera_avgen.0.devname="berirom" - -# -# Expose the DE4 buttons and switches via an Avalon "generic" device. -# -hint.altera_avgen.1.at="nexus0" -hint.altera_avgen.1.maddr=0x7f009000 -hint.altera_avgen.1.msize=2 -hint.altera_avgen.1.width=1 -hint.altera_avgen.1.fileio="r" -hint.altera_avgen.1.devname="de4bsw" - -# -# Expose the DE4 flash via an Avalon "generic" device. -# This is incompatible with the isf(4) driver. -# -#hint.altera_avgen.2.at="nexus0" -#hint.altera_avgen.2.maddr=0x74000000 -#hint.altera_avgen.2.msize=0x4000000 -#hint.altera_avgen.2.width=2 -#hint.altera_avgen.2.fileio="rw" -#hint.altera_avgen.2.mmapio="rwx" -#hint.altera_avgen.2.devname="de4flash" - -# -# General Intel StrataFlash driver -# -hint.isf.0.at="nexus0" -hint.isf.0.maddr=0x74000000 -hint.isf.0.msize=0x2000000 -hint.isf.1.at="nexus0" -hint.isf.1.maddr=0x76000000 -hint.isf.1.msize=0x2000000 - # Reserved configuration blocks. Don't touch. hint.map.0.at="isf0" hint.map.0.start=0x00000000 @@ -105,13 +13,13 @@ hint.map.1.end=0x01820000 hint.map.1.name="fpga" -# Kernel on first chip +# Currently unused space on the first chip hint.map.2.at="isf0" hint.map.2.start=0x01820000 hint.map.2.end=0x02000000 hint.map.2.name="reserved" -# The second chip +# Kernel on the second chip hint.map.3.at="isf1" hint.map.3.start=0x00000000 hint.map.3.end=0x02000000 ==== //depot/projects/ctsrd/cheribsd/src/sys/mips/conf/BERI_DE4_MDROOT#7 (text+ko) ==== @@ -1,30 +1,20 @@ # -# BERI_DE4 -- Kernel for the SRI/Cambridge "BERI" (Bluespec Extensible RISC -# Implementation) FPGA soft core, as configured in its Terasic DE-4 reference -# configuration. +# BERI_DE4_MDROOT -- Kernel for the SRI/Cambridge "BERI" (Bluespec Extensible +# RISC # Implementation) FPGA soft core, as configured in its Terasic DE-4 +# reference configuration. # # $FreeBSD: src/sys/mips/conf/BERI_DE4_MDROOT,v 1.6 2012/09/05 15:55:51 brooks Exp $ # -include "BERI_TEMPLATE" +include "BERI_DE4_BASE" ident BERI_DE4_MDROOT -hints "BERI_DE4.hints" #Default places to look for devices. - # # This kernel configuration uses an embedded 8MB memory root file system. # Adjust the following path based on local requirements. # options MD_ROOT # MD is a potential root device -options MD_ROOT_SIZE=8192 +options MD_ROOT_SIZE=18432 options ROOTDEVNAME=\"ufs:md0\" - -device altera_avgen -device altera_jtag_uart -device altera_sdcard -device terasic_de4led -device terasic_mtl - -device isf -device sc +makeoptions MFS_IMAGE=/home/bed22/demoroot.img ==== //depot/projects/ctsrd/cheribsd/src/sys/mips/conf/BERI_DE4_SDROOT#4 (text+ko) ==== @@ -1,24 +1,16 @@ # -# BERI_DE4 -- Kernel for the SRI/Cambridge "BERI" (Bluespec Extensible RISC -# Implementation) FPGA soft core, as configured in its Terasic DE-4 reference -# configuration. +# BERI_DE4_SDROOT -- Kernel for the SRI/Cambridge "BERI" (Bluespec Extensible +# RISC Implementation) FPGA soft core, as configured in its Terasic DE-4 +# reference configuration. # # $FreeBSD: src/sys/mips/conf/BERI_DE4_SDROOT,v 1.5 2012/08/26 09:21:59 rwatson Exp $ # -include "BERI_TEMPLATE" +include "BERI_DE4_BASE" ident BERI_DE4_SDROOT -hints "BERI_DE4.hints" #Default places to look for devices. - +# +# This kernel expects to find its root filesystem on the SD Card. +# options ROOTDEVNAME=\"ufs:altera_sdcard0\" - -device altera_avgen -device altera_jtag_uart -device altera_sdcard -device terasic_de4led -device terasic_mtl - -device isf -device sc From owner-p4-projects@FreeBSD.ORG Sat Jan 12 16:03:51 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C7AFA296; Sat, 12 Jan 2013 16:03:51 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 83240294 for ; Sat, 12 Jan 2013 16:03:51 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 7340FE57 for ; Sat, 12 Jan 2013 16:03:51 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.5/8.14.5) with ESMTP id r0CG3paY007840 for ; Sat, 12 Jan 2013 16:03:51 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.5/8.14.5/Submit) id r0CG3ouq007836 for perforce@freebsd.org; Sat, 12 Jan 2013 16:03:50 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 12 Jan 2013 16:03:50 GMT Message-Id: <201301121603.r0CG3ouq007836@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson Subject: PERFORCE change 219962 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jan 2013 16:03:52 -0000 http://p4web.freebsd.org/@@219962?ac=10 Change 219962 by rwatson@rwatson_cinnamon on 2013/01/12 16:03:36 Use the OFW compatible string "mips,mips4k" rather than "mips4k,cp0" for interrupt control using MIPS4k CP0. Suggested by: thompsa Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/boot/fdt/dts/beri-sim.dts#3 edit .. //depot/projects/ctsrd/beribsd/src/sys/boot/fdt/dts/beripad-de4.dts#12 edit .. //depot/projects/ctsrd/beribsd/src/sys/boot/fdt/dts/beripad-tpad.dts#3 edit .. //depot/projects/ctsrd/beribsd/src/sys/dev/fdt/fdt_mips.c#3 edit Differences ... ==== //depot/projects/ctsrd/beribsd/src/sys/boot/fdt/dts/beri-sim.dts#3 (text+ko) ==== @@ -58,10 +58,10 @@ #interrupt-cells = <1>; /* - * Declare mips4k,cp0 since BERI doesn't (yet) have a PIC, so + * Declare mips,mips4k since BERI doesn't (yet) have a PIC, so * we use mips4k coprocessor 0 interrupt management directly. */ - compatible = "simple-bus", "mips4k,cp0"; + compatible = "simple-bus", "mips,mips4k"; ranges = <>; memory { ==== //depot/projects/ctsrd/beribsd/src/sys/boot/fdt/dts/beripad-de4.dts#12 (text+ko) ==== @@ -58,10 +58,10 @@ #interrupt-cells = <1>; /* - * Declare mips4k,cp0 since BERI doesn't (yet) have a PIC, so + * Declare mips,mips4k since BERI doesn't (yet) have a PIC, so * we use mips4k coprocessor 0 interrupt management directly. */ - compatible = "simple-bus", "mips4k,cp0"; + compatible = "simple-bus", "mips,mips4k"; ranges = <>; memory { ==== //depot/projects/ctsrd/beribsd/src/sys/boot/fdt/dts/beripad-tpad.dts#3 (text+ko) ==== @@ -58,10 +58,10 @@ #interrupt-cells = <1>; /* - * Declare mips4k,cp0 since BERI doesn't (yet) have a PIC, so + * Declare mips,mips4k since BERI doesn't (yet) have a PIC, so * we use mips4k coprocessor 0 interrupt management directly. */ - compatible = "simple-bus", "mips4k,cp0"; + compatible = "simple-bus", "mips,mips4k"; ranges = <>; /* ==== //depot/projects/ctsrd/beribsd/src/sys/dev/fdt/fdt_mips.c#3 (text+ko) ==== @@ -58,7 +58,7 @@ int *trig, int *pol) { - if (!fdt_is_compatible(node, "mips4k,cp0")) + if (!fdt_is_compatible(node, "mips,mips4k")) return (ENXIO); *interrupt = fdt32_to_cpu(intr[0]);