From owner-svn-soc-all@freebsd.org Sun May 15 12:25:21 2016 Return-Path: Delivered-To: svn-soc-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7A12B3A3CE for ; Sun, 15 May 2016 12:25:21 +0000 (UTC) (envelope-from iateaca@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1B2A1E8B for ; Sun, 15 May 2016 12:25:21 +0000 (UTC) (envelope-from iateaca@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.15.2/8.15.2) with ESMTP id u4FCPLig023316 for ; Sun, 15 May 2016 12:25:21 GMT (envelope-from iateaca@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.15.2/8.15.2/Submit) id u4FCPKfP023243 for svn-soc-all@FreeBSD.org; Sun, 15 May 2016 12:25:20 GMT (envelope-from iateaca@FreeBSD.org) Date: Sun, 15 May 2016 12:25:20 GMT Message-Id: <201605151225.u4FCPKfP023243@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to iateaca@FreeBSD.org using -f From: iateaca@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r303011 - soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 12:25:22 -0000 Author: iateaca Date: Sun May 15 12:25:20 2016 New Revision: 303011 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=303011 Log: change the prototype of the set_reg_handler: add the offset parameter design the layout of the callbacks for the stream description registers add a callback for the SDCTL stream register implement a function to get the stream index from the offset register M bhyve/pci_hda.c Modified: soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/pci_hda.c Modified: soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/pci_hda.c ============================================================================== --- soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/pci_hda.c Sun May 15 08:36:12 2016 (r303010) +++ soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/pci_hda.c Sun May 15 12:25:20 2016 (r303011) @@ -105,7 +105,7 @@ struct hda_softc; -typedef void (*hda_set_reg_handler)(struct hda_softc *sc, uint32_t old); +typedef void (*hda_set_reg_handler)(struct hda_softc *sc, uint32_t offset, uint32_t old); struct hda_softc { uint32_t regs[HDA_LAST_OFFSET]; @@ -128,6 +128,12 @@ static int hda_write(struct hda_softc *sc, uint32_t offset, uint32_t value); +static inline uint8_t +hda_get_stream_by_offsets(uint32_t offset, uint8_t reg_offset); + +static void +hda_set_sdctl(struct hda_softc *sc, uint32_t offset, uint32_t old); + /* * PCI HDA function declarations */ @@ -144,6 +150,22 @@ */ static const hda_set_reg_handler hda_set_reg_table[] = { +#define HDAC_ISTREAM(n, iss, oss) \ + [_HDAC_ISDCTL(n, iss, oss)] = hda_set_sdctl, \ + +#define HDAC_OSTREAM(n, iss, oss) \ + [_HDAC_OSDCTL(n, iss, oss)] = hda_set_sdctl, \ + + HDAC_ISTREAM(0, HDA_ISS_NO, HDA_OSS_NO) + HDAC_ISTREAM(1, HDA_ISS_NO, HDA_OSS_NO) + HDAC_ISTREAM(2, HDA_ISS_NO, HDA_OSS_NO) + HDAC_ISTREAM(3, HDA_ISS_NO, HDA_OSS_NO) + + HDAC_OSTREAM(0, HDA_ISS_NO, HDA_OSS_NO) + HDAC_OSTREAM(1, HDA_ISS_NO, HDA_OSS_NO) + HDAC_OSTREAM(2, HDA_ISS_NO, HDA_OSS_NO) + HDAC_OSTREAM(3, HDA_ISS_NO, HDA_OSS_NO) + [HDA_LAST_OFFSET] = NULL, }; @@ -236,11 +258,27 @@ hda_set_reg_by_offset(sc, offset, value); if (set_reg_handler) - set_reg_handler(sc, old); + set_reg_handler(sc, offset, old); return 0; } +static inline uint8_t +hda_get_stream_by_offsets(uint32_t offset, uint8_t reg_offset) +{ + return (offset - reg_offset - 0x80) / 0x20; +} + +static void +hda_set_sdctl(struct hda_softc *sc, uint32_t offset, uint32_t old) +{ + uint8_t stream_ind = hda_get_stream_by_offsets(offset, 0x00); + + DPRINTF("stream_ind: 0x%x old: 0x%x\n", stream_ind, old); + + return; +} + /* * PCI HDA function definitions */ From owner-svn-soc-all@freebsd.org Sun May 15 13:15:22 2016 Return-Path: Delivered-To: svn-soc-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 424A0B3AB4A for ; Sun, 15 May 2016 13:15:22 +0000 (UTC) (envelope-from iateaca@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 364DB1E5A for ; Sun, 15 May 2016 13:15:22 +0000 (UTC) (envelope-from iateaca@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.15.2/8.15.2) with ESMTP id u4FDFMgb040623 for ; Sun, 15 May 2016 13:15:22 GMT (envelope-from iateaca@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.15.2/8.15.2/Submit) id u4FDFLgL040515 for svn-soc-all@FreeBSD.org; Sun, 15 May 2016 13:15:21 GMT (envelope-from iateaca@FreeBSD.org) Date: Sun, 15 May 2016 13:15:21 GMT Message-Id: <201605151315.u4FDFLgL040515@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to iateaca@FreeBSD.org using -f From: iateaca@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r303012 - soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 13:15:22 -0000 Author: iateaca Date: Sun May 15 13:15:20 2016 New Revision: 303012 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=303012 Log: add callbacks for GCTL, CORBCTL, RIRBCTL Modified: soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/pci_hda.c Modified: soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/pci_hda.c ============================================================================== --- soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/pci_hda.c Sun May 15 12:25:20 2016 (r303011) +++ soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/pci_hda.c Sun May 15 13:15:20 2016 (r303012) @@ -132,6 +132,12 @@ hda_get_stream_by_offsets(uint32_t offset, uint8_t reg_offset); static void +hda_set_gctl(struct hda_softc *sc, uint32_t offset, uint32_t old); +static void +hda_set_corbctl(struct hda_softc *sc, uint32_t offset, uint32_t old); +static void +hda_set_rirbctl(struct hda_softc *sc, uint32_t offset, uint32_t old); +static void hda_set_sdctl(struct hda_softc *sc, uint32_t offset, uint32_t old); /* @@ -150,6 +156,10 @@ */ static const hda_set_reg_handler hda_set_reg_table[] = { + [HDAC_GCTL] = hda_set_gctl, + [HDAC_CORBCTL] = hda_set_corbctl, + [HDAC_RIRBCTL] = hda_set_rirbctl, + #define HDAC_ISTREAM(n, iss, oss) \ [_HDAC_ISDCTL(n, iss, oss)] = hda_set_sdctl, \ @@ -270,6 +280,24 @@ } static void +hda_set_gctl(struct hda_softc *sc, uint32_t offset, uint32_t old) +{ + return; +} + +static void +hda_set_corbctl(struct hda_softc *sc, uint32_t offset, uint32_t old) +{ + return; +} + +static void +hda_set_rirbctl(struct hda_softc *sc, uint32_t offset, uint32_t old) +{ + return; +} + +static void hda_set_sdctl(struct hda_softc *sc, uint32_t offset, uint32_t old) { uint8_t stream_ind = hda_get_stream_by_offsets(offset, 0x00); From owner-svn-soc-all@freebsd.org Sun May 15 13:17:58 2016 Return-Path: Delivered-To: svn-soc-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F74FB3AC22 for ; Sun, 15 May 2016 13:17:58 +0000 (UTC) (envelope-from iateaca@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92F212000 for ; Sun, 15 May 2016 13:17:58 +0000 (UTC) (envelope-from iateaca@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.15.2/8.15.2) with ESMTP id u4FDHwLR044518 for ; Sun, 15 May 2016 13:17:58 GMT (envelope-from iateaca@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.15.2/8.15.2/Submit) id u4FDHwat044501 for svn-soc-all@FreeBSD.org; Sun, 15 May 2016 13:17:58 GMT (envelope-from iateaca@FreeBSD.org) Date: Sun, 15 May 2016 13:17:58 GMT Message-Id: <201605151317.u4FDHwat044501@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to iateaca@FreeBSD.org using -f From: iateaca@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r303013 - soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 13:17:58 -0000 Author: iateaca Date: Sun May 15 13:17:57 2016 New Revision: 303013 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=303013 Log: clone the sys/dev/sound/pci/hda/hdac_reg.h header in bhyve Added: soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/hdac_reg.h - copied unchanged from r302727, soc2016/iateaca/bhyve-hda-head/sys/dev/sound/pci/hda/hdac_reg.h Copied: soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/hdac_reg.h (from r302727, soc2016/iateaca/bhyve-hda-head/sys/dev/sound/pci/hda/hdac_reg.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/hdac_reg.h Sun May 15 13:17:57 2016 (r303013, copy of r302727, soc2016/iateaca/bhyve-hda-head/sys/dev/sound/pci/hda/hdac_reg.h) @@ -0,0 +1,268 @@ +/*- + * Copyright (c) 2006 Stephane E. Potvin + * 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. + * + * $FreeBSD$ + */ + +#ifndef _HDAC_REG_H_ +#define _HDAC_REG_H_ + +/**************************************************************************** + * HDA Controller Register Set + ****************************************************************************/ +#define HDAC_GCAP 0x00 /* 2 - Global Capabilities*/ +#define HDAC_VMIN 0x02 /* 1 - Minor Version */ +#define HDAC_VMAJ 0x03 /* 1 - Major Version */ +#define HDAC_OUTPAY 0x04 /* 2 - Output Payload Capability */ +#define HDAC_INPAY 0x06 /* 2 - Input Payload Capability */ +#define HDAC_GCTL 0x08 /* 4 - Global Control */ +#define HDAC_WAKEEN 0x0c /* 2 - Wake Enable */ +#define HDAC_STATESTS 0x0e /* 2 - State Change Status */ +#define HDAC_GSTS 0x10 /* 2 - Global Status */ +#define HDAC_OUTSTRMPAY 0x18 /* 2 - Output Stream Payload Capability */ +#define HDAC_INSTRMPAY 0x1a /* 2 - Input Stream Payload Capability */ +#define HDAC_INTCTL 0x20 /* 4 - Interrupt Control */ +#define HDAC_INTSTS 0x24 /* 4 - Interrupt Status */ +#define HDAC_WALCLK 0x30 /* 4 - Wall Clock Counter */ +#define HDAC_SSYNC 0x38 /* 4 - Stream Synchronization */ +#define HDAC_CORBLBASE 0x40 /* 4 - CORB Lower Base Address */ +#define HDAC_CORBUBASE 0x44 /* 4 - CORB Upper Base Address */ +#define HDAC_CORBWP 0x48 /* 2 - CORB Write Pointer */ +#define HDAC_CORBRP 0x4a /* 2 - CORB Read Pointer */ +#define HDAC_CORBCTL 0x4c /* 1 - CORB Control */ +#define HDAC_CORBSTS 0x4d /* 1 - CORB Status */ +#define HDAC_CORBSIZE 0x4e /* 1 - CORB Size */ +#define HDAC_RIRBLBASE 0x50 /* 4 - RIRB Lower Base Address */ +#define HDAC_RIRBUBASE 0x54 /* 4 - RIRB Upper Base Address */ +#define HDAC_RIRBWP 0x58 /* 2 - RIRB Write Pointer */ +#define HDAC_RINTCNT 0x5a /* 2 - Response Interrupt Count */ +#define HDAC_RIRBCTL 0x5c /* 1 - RIRB Control */ +#define HDAC_RIRBSTS 0x5d /* 1 - RIRB Status */ +#define HDAC_RIRBSIZE 0x5e /* 1 - RIRB Size */ +#define HDAC_ICOI 0x60 /* 4 - Immediate Command Output Interface */ +#define HDAC_ICII 0x64 /* 4 - Immediate Command Input Interface */ +#define HDAC_ICIS 0x68 /* 2 - Immediate Command Status */ +#define HDAC_DPIBLBASE 0x70 /* 4 - DMA Position Buffer Lower Base */ +#define HDAC_DPIBUBASE 0x74 /* 4 - DMA Position Buffer Upper Base */ +#define HDAC_SDCTL0 0x80 /* 3 - Stream Descriptor Control */ +#define HDAC_SDCTL1 0x81 /* 3 - Stream Descriptor Control */ +#define HDAC_SDCTL2 0x82 /* 3 - Stream Descriptor Control */ +#define HDAC_SDSTS 0x83 /* 1 - Stream Descriptor Status */ +#define HDAC_SDLPIB 0x84 /* 4 - Link Position in Buffer */ +#define HDAC_SDCBL 0x88 /* 4 - Cyclic Buffer Length */ +#define HDAC_SDLVI 0x8C /* 2 - Last Valid Index */ +#define HDAC_SDFIFOS 0x90 /* 2 - FIFOS */ +#define HDAC_SDFMT 0x92 /* 2 - fmt */ +#define HDAC_SDBDPL 0x98 /* 4 - Buffer Descriptor Pointer Lower Base */ +#define HDAC_SDBDPU 0x9C /* 4 - Buffer Descriptor Pointer Upper Base */ + +#define _HDAC_ISDOFFSET(n, iss, oss) (0x80 + ((n) * 0x20)) +#define _HDAC_ISDCTL(n, iss, oss) (0x00 + _HDAC_ISDOFFSET(n, iss, oss)) +#define _HDAC_ISDSTS(n, iss, oss) (0x03 + _HDAC_ISDOFFSET(n, iss, oss)) +#define _HDAC_ISDPICB(n, iss, oss) (0x04 + _HDAC_ISDOFFSET(n, iss, oss)) +#define _HDAC_ISDCBL(n, iss, oss) (0x08 + _HDAC_ISDOFFSET(n, iss, oss)) +#define _HDAC_ISDLVI(n, iss, oss) (0x0c + _HDAC_ISDOFFSET(n, iss, oss)) +#define _HDAC_ISDFIFOD(n, iss, oss) (0x10 + _HDAC_ISDOFFSET(n, iss, oss)) +#define _HDAC_ISDFMT(n, iss, oss) (0x12 + _HDAC_ISDOFFSET(n, iss, oss)) +#define _HDAC_ISDBDPL(n, iss, oss) (0x18 + _HDAC_ISDOFFSET(n, iss, oss)) +#define _HDAC_ISDBDPU(n, iss, oss) (0x1c + _HDAC_ISDOFFSET(n, iss, oss)) + +#define _HDAC_OSDOFFSET(n, iss, oss) (0x80 + ((iss) * 0x20) + ((n) * 0x20)) +#define _HDAC_OSDCTL(n, iss, oss) (0x00 + _HDAC_OSDOFFSET(n, iss, oss)) +#define _HDAC_OSDSTS(n, iss, oss) (0x03 + _HDAC_OSDOFFSET(n, iss, oss)) +#define _HDAC_OSDPICB(n, iss, oss) (0x04 + _HDAC_OSDOFFSET(n, iss, oss)) +#define _HDAC_OSDCBL(n, iss, oss) (0x08 + _HDAC_OSDOFFSET(n, iss, oss)) +#define _HDAC_OSDLVI(n, iss, oss) (0x0c + _HDAC_OSDOFFSET(n, iss, oss)) +#define _HDAC_OSDFIFOD(n, iss, oss) (0x10 + _HDAC_OSDOFFSET(n, iss, oss)) +#define _HDAC_OSDFMT(n, iss, oss) (0x12 + _HDAC_OSDOFFSET(n, iss, oss)) +#define _HDAC_OSDBDPL(n, iss, oss) (0x18 + _HDAC_OSDOFFSET(n, iss, oss)) +#define _HDAC_OSDBDPU(n, iss, oss) (0x1c + _HDAC_OSDOFFSET(n, iss, oss)) + +#define _HDAC_BSDOFFSET(n, iss, oss) (0x80 + ((iss) * 0x20) + ((oss) * 0x20) + ((n) * 0x20)) +#define _HDAC_BSDCTL(n, iss, oss) (0x00 + _HDAC_BSDOFFSET(n, iss, oss)) +#define _HDAC_BSDSTS(n, iss, oss) (0x03 + _HDAC_BSDOFFSET(n, iss, oss)) +#define _HDAC_BSDPICB(n, iss, oss) (0x04 + _HDAC_BSDOFFSET(n, iss, oss)) +#define _HDAC_BSDCBL(n, iss, oss) (0x08 + _HDAC_BSDOFFSET(n, iss, oss)) +#define _HDAC_BSDLVI(n, iss, oss) (0x0c + _HDAC_BSDOFFSET(n, iss, oss)) +#define _HDAC_BSDFIFOD(n, iss, oss) (0x10 + _HDAC_BSDOFFSET(n, iss, oss)) +#define _HDAC_BSDFMT(n, iss, oss) (0x12 + _HDAC_BSDOFFSET(n, iss, oss)) +#define _HDAC_BSDBDPL(n, iss, oss) (0x18 + _HDAC_BSDOFFSET(n, iss, oss)) +#define _HDAC_BSDBDBU(n, iss, oss) (0x1c + _HDAC_BSDOFFSET(n, iss, oss)) + +/**************************************************************************** + * HDA Controller Register Fields + ****************************************************************************/ + +/* GCAP - Global Capabilities */ +#define HDAC_GCAP_64OK 0x0001 +#define HDAC_GCAP_NSDO_MASK 0x0006 +#define HDAC_GCAP_NSDO_SHIFT 1 +#define HDAC_GCAP_BSS_MASK 0x00f8 +#define HDAC_GCAP_BSS_SHIFT 3 +#define HDAC_GCAP_ISS_MASK 0x0f00 +#define HDAC_GCAP_ISS_SHIFT 8 +#define HDAC_GCAP_OSS_MASK 0xf000 +#define HDAC_GCAP_OSS_SHIFT 12 + +#define HDAC_GCAP_NSDO_1SDO 0x00 +#define HDAC_GCAP_NSDO_2SDO 0x02 +#define HDAC_GCAP_NSDO_4SDO 0x04 + +#define HDAC_GCAP_BSS(gcap) \ + (((gcap) & HDAC_GCAP_BSS_MASK) >> HDAC_GCAP_BSS_SHIFT) +#define HDAC_GCAP_ISS(gcap) \ + (((gcap) & HDAC_GCAP_ISS_MASK) >> HDAC_GCAP_ISS_SHIFT) +#define HDAC_GCAP_OSS(gcap) \ + (((gcap) & HDAC_GCAP_OSS_MASK) >> HDAC_GCAP_OSS_SHIFT) +#define HDAC_GCAP_NSDO(gcap) \ + (((gcap) & HDAC_GCAP_NSDO_MASK) >> HDAC_GCAP_NSDO_SHIFT) + +/* GCTL - Global Control */ +#define HDAC_GCTL_CRST 0x00000001 +#define HDAC_GCTL_FCNTRL 0x00000002 +#define HDAC_GCTL_UNSOL 0x00000100 + +/* WAKEEN - Wake Enable */ +#define HDAC_WAKEEN_SDIWEN_MASK 0x7fff +#define HDAC_WAKEEN_SDIWEN_SHIFT 0 + +/* STATESTS - State Change Status */ +#define HDAC_STATESTS_SDIWAKE_MASK 0x7fff +#define HDAC_STATESTS_SDIWAKE_SHIFT 0 + +#define HDAC_STATESTS_SDIWAKE(statests, n) \ + (((((statests) & HDAC_STATESTS_SDIWAKE_MASK) >> \ + HDAC_STATESTS_SDIWAKE_SHIFT) >> (n)) & 0x0001) + +/* GSTS - Global Status */ +#define HDAC_GSTS_FSTS 0x0002 + +/* INTCTL - Interrut Control */ +#define HDAC_INTCTL_SIE_MASK 0x3fffffff +#define HDAC_INTCTL_SIE_SHIFT 0 +#define HDAC_INTCTL_CIE 0x40000000 +#define HDAC_INTCTL_GIE 0x80000000 + +/* INTSTS - Interrupt Status */ +#define HDAC_INTSTS_SIS_MASK 0x3fffffff +#define HDAC_INTSTS_SIS_SHIFT 0 +#define HDAC_INTSTS_CIS 0x40000000 +#define HDAC_INTSTS_GIS 0x80000000 + +/* SSYNC - Stream Synchronization */ +#define HDAC_SSYNC_SSYNC_MASK 0x3fffffff +#define HDAC_SSYNC_SSYNC_SHIFT 0 + +/* CORBWP - CORB Write Pointer */ +#define HDAC_CORBWP_CORBWP_MASK 0x00ff +#define HDAC_CORBWP_CORBWP_SHIFT 0 + +/* CORBRP - CORB Read Pointer */ +#define HDAC_CORBRP_CORBRP_MASK 0x00ff +#define HDAC_CORBRP_CORBRP_SHIFT 0 +#define HDAC_CORBRP_CORBRPRST 0x8000 + +/* CORBCTL - CORB Control */ +#define HDAC_CORBCTL_CMEIE 0x01 +#define HDAC_CORBCTL_CORBRUN 0x02 + +/* CORBSTS - CORB Status */ +#define HDAC_CORBSTS_CMEI 0x01 + +/* CORBSIZE - CORB Size */ +#define HDAC_CORBSIZE_CORBSIZE_MASK 0x03 +#define HDAC_CORBSIZE_CORBSIZE_SHIFT 0 +#define HDAC_CORBSIZE_CORBSZCAP_MASK 0xf0 +#define HDAC_CORBSIZE_CORBSZCAP_SHIFT 4 + +#define HDAC_CORBSIZE_CORBSIZE_2 0x00 +#define HDAC_CORBSIZE_CORBSIZE_16 0x01 +#define HDAC_CORBSIZE_CORBSIZE_256 0x02 + +#define HDAC_CORBSIZE_CORBSZCAP_2 0x10 +#define HDAC_CORBSIZE_CORBSZCAP_16 0x20 +#define HDAC_CORBSIZE_CORBSZCAP_256 0x40 + +#define HDAC_CORBSIZE_CORBSIZE(corbsize) \ + (((corbsize) & HDAC_CORBSIZE_CORBSIZE_MASK) >> HDAC_CORBSIZE_CORBSIZE_SHIFT) + +/* RIRBWP - RIRB Write Pointer */ +#define HDAC_RIRBWP_RIRBWP_MASK 0x00ff +#define HDAC_RIRBWP_RIRBWP_SHIFT 0 +#define HDAC_RIRBWP_RIRBWPRST 0x8000 + +/* RINTCTN - Response Interrupt Count */ +#define HDAC_RINTCNT_MASK 0x00ff +#define HDAC_RINTCNT_SHIFT 0 + +/* RIRBCTL - RIRB Control */ +#define HDAC_RIRBCTL_RINTCTL 0x01 +#define HDAC_RIRBCTL_RIRBDMAEN 0x02 +#define HDAC_RIRBCTL_RIRBOIC 0x04 + +/* RIRBSTS - RIRB Status */ +#define HDAC_RIRBSTS_RINTFL 0x01 +#define HDAC_RIRBSTS_RIRBOIS 0x04 + +/* RIRBSIZE - RIRB Size */ +#define HDAC_RIRBSIZE_RIRBSIZE_MASK 0x03 +#define HDAC_RIRBSIZE_RIRBSIZE_SHIFT 0 +#define HDAC_RIRBSIZE_RIRBSZCAP_MASK 0xf0 +#define HDAC_RIRBSIZE_RIRBSZCAP_SHIFT 4 + +#define HDAC_RIRBSIZE_RIRBSIZE_2 0x00 +#define HDAC_RIRBSIZE_RIRBSIZE_16 0x01 +#define HDAC_RIRBSIZE_RIRBSIZE_256 0x02 + +#define HDAC_RIRBSIZE_RIRBSZCAP_2 0x10 +#define HDAC_RIRBSIZE_RIRBSZCAP_16 0x20 +#define HDAC_RIRBSIZE_RIRBSZCAP_256 0x40 + +#define HDAC_RIRBSIZE_RIRBSIZE(rirbsize) \ + (((rirbsize) & HDAC_RIRBSIZE_RIRBSIZE_MASK) >> HDAC_RIRBSIZE_RIRBSIZE_SHIFT) + +/* DPLBASE - DMA Position Lower Base Address */ +#define HDAC_DPLBASE_DPLBASE_MASK 0xffffff80 +#define HDAC_DPLBASE_DPLBASE_SHIFT 7 +#define HDAC_DPLBASE_DPLBASE_DMAPBE 0x00000001 + +/* SDCTL - Stream Descriptor Control */ +#define HDAC_SDCTL_SRST 0x000001 +#define HDAC_SDCTL_RUN 0x000002 +#define HDAC_SDCTL_IOCE 0x000004 +#define HDAC_SDCTL_FEIE 0x000008 +#define HDAC_SDCTL_DEIE 0x000010 +#define HDAC_SDCTL2_STRIPE_MASK 0x03 +#define HDAC_SDCTL2_STRIPE_SHIFT 0 +#define HDAC_SDCTL2_TP 0x04 +#define HDAC_SDCTL2_DIR 0x08 +#define HDAC_SDCTL2_STRM_MASK 0xf0 +#define HDAC_SDCTL2_STRM_SHIFT 4 + +#define HDAC_SDSTS_DESE (1 << 4) +#define HDAC_SDSTS_FIFOE (1 << 3) +#define HDAC_SDSTS_BCIS (1 << 2) + +#endif From owner-svn-soc-all@freebsd.org Sun May 15 13:24:02 2016 Return-Path: Delivered-To: svn-soc-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 741E6B3B2F8 for ; Sun, 15 May 2016 13:24:02 +0000 (UTC) (envelope-from iateaca@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 58DC11AD0 for ; Sun, 15 May 2016 13:24:02 +0000 (UTC) (envelope-from iateaca@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.15.2/8.15.2) with ESMTP id u4FDO2VA059869 for ; Sun, 15 May 2016 13:24:02 GMT (envelope-from iateaca@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.15.2/8.15.2/Submit) id u4FDO1Br059836 for svn-soc-all@FreeBSD.org; Sun, 15 May 2016 13:24:01 GMT (envelope-from iateaca@FreeBSD.org) Date: Sun, 15 May 2016 13:24:01 GMT Message-Id: <201605151324.u4FDO1Br059836@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to iateaca@FreeBSD.org using -f From: iateaca@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r303014 - soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 13:24:02 -0000 Author: iateaca Date: Sun May 15 13:24:01 2016 New Revision: 303014 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=303014 Log: remove the HDAC register defines and use the ones from the hdac_reg.h instead Modified: soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/pci_hda.c Modified: soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/pci_hda.c ============================================================================== --- soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/pci_hda.c Sun May 15 13:17:57 2016 (r303013) +++ soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/pci_hda.c Sun May 15 13:24:01 2016 (r303014) @@ -3,6 +3,7 @@ #include #include +#include "hdac_reg.h" #include "pci_emul.h" /* @@ -29,77 +30,6 @@ #define HDA_LAST_OFFSET (0x80 + ((HDA_ISS_NO) * 0x20) + ((HDA_OSS_NO) * 0x20)) /* - * HDA Controller Register Offsets - */ -#define HDAC_GCAP 0x00 /* 2 - Global Capabilities*/ -#define HDAC_VMIN 0x02 /* 1 - Minor Version */ -#define HDAC_VMAJ 0x03 /* 1 - Major Version */ -#define HDAC_OUTPAY 0x04 /* 2 - Output Payload Capability */ -#define HDAC_INPAY 0x06 /* 2 - Input Payload Capability */ -#define HDAC_GCTL 0x08 /* 4 - Global Control */ -#define HDAC_WAKEEN 0x0c /* 2 - Wake Enable */ -#define HDAC_STATESTS 0x0e /* 2 - State Change Status */ -#define HDAC_GSTS 0x10 /* 2 - Global Status */ -#define HDAC_OUTSTRMPAY 0x18 /* 2 - Output Stream Payload Capability */ -#define HDAC_INSTRMPAY 0x1a /* 2 - Input Stream Payload Capability */ -#define HDAC_INTCTL 0x20 /* 4 - Interrupt Control */ -#define HDAC_INTSTS 0x24 /* 4 - Interrupt Status */ -#define HDAC_WALCLK 0x30 /* 4 - Wall Clock Counter */ -#define HDAC_SSYNC 0x38 /* 4 - Stream Synchronization */ -#define HDAC_CORBLBASE 0x40 /* 4 - CORB Lower Base Address */ -#define HDAC_CORBUBASE 0x44 /* 4 - CORB Upper Base Address */ -#define HDAC_CORBWP 0x48 /* 2 - CORB Write Pointer */ -#define HDAC_CORBRP 0x4a /* 2 - CORB Read Pointer */ -#define HDAC_CORBCTL 0x4c /* 1 - CORB Control */ -#define HDAC_CORBSTS 0x4d /* 1 - CORB Status */ -#define HDAC_CORBSIZE 0x4e /* 1 - CORB Size */ -#define HDAC_RIRBLBASE 0x50 /* 4 - RIRB Lower Base Address */ -#define HDAC_RIRBUBASE 0x54 /* 4 - RIRB Upper Base Address */ -#define HDAC_RIRBWP 0x58 /* 2 - RIRB Write Pointer */ -#define HDAC_RINTCNT 0x5a /* 2 - Response Interrupt Count */ -#define HDAC_RIRBCTL 0x5c /* 1 - RIRB Control */ -#define HDAC_RIRBSTS 0x5d /* 1 - RIRB Status */ -#define HDAC_RIRBSIZE 0x5e /* 1 - RIRB Size */ -#define HDAC_ICOI 0x60 /* 4 - Immediate Command Output Interface */ -#define HDAC_ICII 0x64 /* 4 - Immediate Command Input Interface */ -#define HDAC_ICIS 0x68 /* 2 - Immediate Command Status */ -#define HDAC_DPIBLBASE 0x70 /* 4 - DMA Position Buffer Lower Base */ -#define HDAC_DPIBUBASE 0x74 /* 4 - DMA Position Buffer Upper Base */ -#define HDAC_SDCTL0 0x80 /* 3 - Stream Descriptor Control */ -#define HDAC_SDCTL1 0x81 /* 3 - Stream Descriptor Control */ -#define HDAC_SDCTL2 0x82 /* 3 - Stream Descriptor Control */ -#define HDAC_SDSTS 0x83 /* 1 - Stream Descriptor Status */ -#define HDAC_SDLPIB 0x84 /* 4 - Link Position in Buffer */ -#define HDAC_SDCBL 0x88 /* 4 - Cyclic Buffer Length */ -#define HDAC_SDLVI 0x8C /* 2 - Last Valid Index */ -#define HDAC_SDFIFOS 0x90 /* 2 - FIFOS */ -#define HDAC_SDFMT 0x92 /* 2 - fmt */ -#define HDAC_SDBDPL 0x98 /* 4 - Buffer Descriptor Pointer Lower Base */ -#define HDAC_SDBDPU 0x9C /* 4 - Buffer Descriptor Pointer Upper Base */ - -#define _HDAC_ISDOFFSET(n, iss, oss) (0x80 + ((n) * 0x20)) -#define _HDAC_ISDCTL(n, iss, oss) (0x00 + _HDAC_ISDOFFSET(n, iss, oss)) -#define _HDAC_ISDSTS(n, iss, oss) (0x03 + _HDAC_ISDOFFSET(n, iss, oss)) -#define _HDAC_ISDPICB(n, iss, oss) (0x04 + _HDAC_ISDOFFSET(n, iss, oss)) -#define _HDAC_ISDCBL(n, iss, oss) (0x08 + _HDAC_ISDOFFSET(n, iss, oss)) -#define _HDAC_ISDLVI(n, iss, oss) (0x0c + _HDAC_ISDOFFSET(n, iss, oss)) -#define _HDAC_ISDFIFOD(n, iss, oss) (0x10 + _HDAC_ISDOFFSET(n, iss, oss)) -#define _HDAC_ISDFMT(n, iss, oss) (0x12 + _HDAC_ISDOFFSET(n, iss, oss)) -#define _HDAC_ISDBDPL(n, iss, oss) (0x18 + _HDAC_ISDOFFSET(n, iss, oss)) -#define _HDAC_ISDBDPU(n, iss, oss) (0x1c + _HDAC_ISDOFFSET(n, iss, oss)) - -#define _HDAC_OSDOFFSET(n, iss, oss) (0x80 + ((iss) * 0x20) + ((n) * 0x20)) -#define _HDAC_OSDCTL(n, iss, oss) (0x00 + _HDAC_OSDOFFSET(n, iss, oss)) -#define _HDAC_OSDSTS(n, iss, oss) (0x03 + _HDAC_OSDOFFSET(n, iss, oss)) -#define _HDAC_OSDPICB(n, iss, oss) (0x04 + _HDAC_OSDOFFSET(n, iss, oss)) -#define _HDAC_OSDCBL(n, iss, oss) (0x08 + _HDAC_OSDOFFSET(n, iss, oss)) -#define _HDAC_OSDLVI(n, iss, oss) (0x0c + _HDAC_OSDOFFSET(n, iss, oss)) -#define _HDAC_OSDFIFOD(n, iss, oss) (0x10 + _HDAC_OSDOFFSET(n, iss, oss)) -#define _HDAC_OSDFMT(n, iss, oss) (0x12 + _HDAC_OSDOFFSET(n, iss, oss)) -#define _HDAC_OSDBDPL(n, iss, oss) (0x18 + _HDAC_OSDOFFSET(n, iss, oss)) -#define _HDAC_OSDBDPU(n, iss, oss) (0x1c + _HDAC_OSDOFFSET(n, iss, oss)) - -/* * HDA data structures */ From owner-svn-soc-all@freebsd.org Sun May 15 14:23:52 2016 Return-Path: Delivered-To: svn-soc-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8138B3BFEB for ; Sun, 15 May 2016 14:23:52 +0000 (UTC) (envelope-from iateaca@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B84A1EE8 for ; Sun, 15 May 2016 14:23:52 +0000 (UTC) (envelope-from iateaca@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.15.2/8.15.2) with ESMTP id u4FENqMp030343 for ; Sun, 15 May 2016 14:23:52 GMT (envelope-from iateaca@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.15.2/8.15.2/Submit) id u4FENqFU030339 for svn-soc-all@FreeBSD.org; Sun, 15 May 2016 14:23:52 GMT (envelope-from iateaca@FreeBSD.org) Date: Sun, 15 May 2016 14:23:52 GMT Message-Id: <201605151423.u4FENqFU030339@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to iateaca@FreeBSD.org using -f From: iateaca@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r303017 - soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 May 2016 14:23:52 -0000 Author: iateaca Date: Sun May 15 14:23:51 2016 New Revision: 303017 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=303017 Log: reset the HDA controller registers when the GCTL_RESET is cleared Modified: soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/pci_hda.c Modified: soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/pci_hda.c ============================================================================== --- soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/pci_hda.c Sun May 15 13:20:59 2016 (r303016) +++ soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/pci_hda.c Sun May 15 14:23:51 2016 (r303017) @@ -174,11 +174,17 @@ static void hda_reset_regs(struct hda_softc *sc) { + DPRINTF("Reset the HDA controller registers ...\n"); + memset(sc->regs, 0, sizeof(sc->regs)); - hda_set_reg_by_offset(sc, HDAC_GCAP, 0x4401); - hda_set_reg_by_offset(sc, HDAC_CORBSIZE, 0x42); - hda_set_reg_by_offset(sc, HDAC_RIRBSIZE, 0x42); + hda_set_reg_by_offset(sc, HDAC_GCAP, + HDAC_GCAP_64OK | + (HDA_ISS_NO << HDAC_GCAP_ISS_SHIFT) | + (HDA_OSS_NO << HDAC_GCAP_OSS_SHIFT)); + + hda_set_reg_by_offset(sc, HDAC_CORBSIZE, HDAC_CORBSIZE_CORBSZCAP_256 | HDAC_CORBSIZE_CORBSIZE_256); + hda_set_reg_by_offset(sc, HDAC_RIRBSIZE, HDAC_RIRBSIZE_RIRBSZCAP_256 | HDAC_RIRBSIZE_RIRBSIZE_256); return; } @@ -212,6 +218,12 @@ static void hda_set_gctl(struct hda_softc *sc, uint32_t offset, uint32_t old) { + uint32_t value = sc->regs[offset]; + + if (!(value & HDAC_GCTL_CRST)) { + hda_reset_regs(sc); + } + return; } From owner-svn-soc-all@freebsd.org Wed May 18 14:43:21 2016 Return-Path: Delivered-To: svn-soc-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F25DB412A9 for ; Wed, 18 May 2016 14:43:21 +0000 (UTC) (envelope-from litong@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B42E1187 for ; Wed, 18 May 2016 14:43:21 +0000 (UTC) (envelope-from litong@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.15.2/8.15.2) with ESMTP id u4IEhKnQ054112 for ; Wed, 18 May 2016 14:43:20 GMT (envelope-from litong@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.15.2/8.15.2/Submit) id u4IEhKQb054110 for svn-soc-all@FreeBSD.org; Wed, 18 May 2016 14:43:20 GMT (envelope-from litong@FreeBSD.org) Date: Wed, 18 May 2016 14:43:20 GMT Message-Id: <201605181443.u4IEhKQb054110@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to litong@FreeBSD.org using -f From: litong@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r303312 - soc2016/litong MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 14:43:21 -0000 Author: litong Date: Wed May 18 14:43:20 2016 New Revision: 303312 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=303312 Log: Added: soc2016/litong/ From owner-svn-soc-all@freebsd.org Wed May 18 14:45:16 2016 Return-Path: Delivered-To: svn-soc-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16633B4136C for ; Wed, 18 May 2016 14:45:16 +0000 (UTC) (envelope-from litong@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5CA21317 for ; Wed, 18 May 2016 14:45:15 +0000 (UTC) (envelope-from litong@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.15.2/8.15.2) with ESMTP id u4IEjFD8057161 for ; Wed, 18 May 2016 14:45:15 GMT (envelope-from litong@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.15.2/8.15.2/Submit) id u4IEjFQL057158 for svn-soc-all@FreeBSD.org; Wed, 18 May 2016 14:45:15 GMT (envelope-from litong@FreeBSD.org) Date: Wed, 18 May 2016 14:45:15 GMT Message-Id: <201605181445.u4IEjFQL057158@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to litong@FreeBSD.org using -f From: litong@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r303313 - soc2016/litong/vagrant-bhyve MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 14:45:16 -0000 Author: litong Date: Wed May 18 14:45:15 2016 New Revision: 303313 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=303313 Log: Importing git repo Added: soc2016/litong/vagrant-bhyve/ From owner-svn-soc-all@freebsd.org Thu May 19 05:50:27 2016 Return-Path: Delivered-To: svn-soc-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 392B8B4179B for ; Thu, 19 May 2016 05:50:27 +0000 (UTC) (envelope-from litong@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02916124E for ; Thu, 19 May 2016 05:50:27 +0000 (UTC) (envelope-from litong@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.15.2/8.15.2) with ESMTP id u4J5oQQw098540 for ; Thu, 19 May 2016 05:50:26 GMT (envelope-from litong@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.15.2/8.15.2/Submit) id u4J5oQIZ098531 for svn-soc-all@FreeBSD.org; Thu, 19 May 2016 05:50:26 GMT (envelope-from litong@FreeBSD.org) Date: Thu, 19 May 2016 05:50:26 GMT Message-Id: <201605190550.u4J5oQIZ098531@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to litong@FreeBSD.org using -f From: litong@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r303361 - soc2016/litong/vagrant-bhyve/trunk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 05:50:27 -0000 Author: litong Date: Thu May 19 05:50:26 2016 New Revision: 303361 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=303361 Log: Added: soc2016/litong/vagrant-bhyve/trunk/ From owner-svn-soc-all@freebsd.org Thu May 19 11:35:01 2016 Return-Path: Delivered-To: svn-soc-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05CFFB420C5 for ; Thu, 19 May 2016 11:35:01 +0000 (UTC) (envelope-from litong@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0C7111A6 for ; Thu, 19 May 2016 11:35:00 +0000 (UTC) (envelope-from litong@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.15.2/8.15.2) with ESMTP id u4JBZ01U029031 for ; Thu, 19 May 2016 11:35:00 GMT (envelope-from litong@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.15.2/8.15.2/Submit) id u4JBYsx7028856 for svn-soc-all@FreeBSD.org; Thu, 19 May 2016 11:34:54 GMT (envelope-from litong@FreeBSD.org) Date: Thu, 19 May 2016 11:34:54 GMT Message-Id: <201605191134.u4JBYsx7028856@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to litong@FreeBSD.org using -f From: litong@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r303369 - in soc2016/litong/vagrant-bhyve/trunk: . bin lib lib/vagrant-bhyve locales spec spec/vagrant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 11:35:01 -0000 Author: litong Date: Thu May 19 11:34:54 2016 New Revision: 303369 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=303369 Log: Initial commit Added: soc2016/litong/vagrant-bhyve/trunk/.gitignore soc2016/litong/vagrant-bhyve/trunk/.rspec soc2016/litong/vagrant-bhyve/trunk/.travis.yml soc2016/litong/vagrant-bhyve/trunk/Gemfile soc2016/litong/vagrant-bhyve/trunk/LICENSE.txt soc2016/litong/vagrant-bhyve/trunk/README.md soc2016/litong/vagrant-bhyve/trunk/Rakefile soc2016/litong/vagrant-bhyve/trunk/bin/ soc2016/litong/vagrant-bhyve/trunk/bin/console (contents, props changed) soc2016/litong/vagrant-bhyve/trunk/bin/setup (contents, props changed) soc2016/litong/vagrant-bhyve/trunk/lib/ soc2016/litong/vagrant-bhyve/trunk/lib/vagrant-bhyve/ soc2016/litong/vagrant-bhyve/trunk/lib/vagrant-bhyve.rb soc2016/litong/vagrant-bhyve/trunk/lib/vagrant-bhyve/version.rb soc2016/litong/vagrant-bhyve/trunk/locales/ soc2016/litong/vagrant-bhyve/trunk/locales/en.yml soc2016/litong/vagrant-bhyve/trunk/spec/ soc2016/litong/vagrant-bhyve/trunk/spec/spec_helper.rb soc2016/litong/vagrant-bhyve/trunk/spec/vagrant/ soc2016/litong/vagrant-bhyve/trunk/spec/vagrant/bhyve_spec.rb soc2016/litong/vagrant-bhyve/trunk/vagrant-bhyve.gemspec Added: soc2016/litong/vagrant-bhyve/trunk/.gitignore ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2016/litong/vagrant-bhyve/trunk/.gitignore Thu May 19 11:34:54 2016 (r303369) @@ -0,0 +1,9 @@ +/.bundle/ +/.yardoc +/Gemfile.lock +/_yardoc/ +/coverage/ +/doc/ +/pkg/ +/spec/reports/ +/tmp/ Added: soc2016/litong/vagrant-bhyve/trunk/.rspec ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2016/litong/vagrant-bhyve/trunk/.rspec Thu May 19 11:34:54 2016 (r303369) @@ -0,0 +1,2 @@ +--format documentation +--color Added: soc2016/litong/vagrant-bhyve/trunk/.travis.yml ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2016/litong/vagrant-bhyve/trunk/.travis.yml Thu May 19 11:34:54 2016 (r303369) @@ -0,0 +1,4 @@ +language: ruby +rvm: + - 2.3.1 +before_install: gem install bundler -v 1.10.6 Added: soc2016/litong/vagrant-bhyve/trunk/Gemfile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2016/litong/vagrant-bhyve/trunk/Gemfile Thu May 19 11:34:54 2016 (r303369) @@ -0,0 +1,11 @@ +source 'https://rubygems.org' + +group :development do + gem 'vagrant', :git => 'https://github.com/mitchellh/vagrant.git' +end + +group :plugins do + gem 'vagrant-bhyve', path: '.' +end + +gemspec Added: soc2016/litong/vagrant-bhyve/trunk/LICENSE.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2016/litong/vagrant-bhyve/trunk/LICENSE.txt Thu May 19 11:34:54 2016 (r303369) @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Tong Li + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. Added: soc2016/litong/vagrant-bhyve/trunk/README.md ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2016/litong/vagrant-bhyve/trunk/README.md Thu May 19 11:34:54 2016 (r303369) @@ -0,0 +1,41 @@ +# VagrantPlugin::ProviderBhyve + +Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/vagrant/bhyve`. To experiment with that code, run `bin/console` for an interactive prompt. + +TODO: Delete this and the text above, and describe your gem + +## Installation + +Add this line to your application's Gemfile: + +```ruby +gem 'vagrant-bhyve' +``` + +And then execute: + + $ bundle + +Or install it yourself as: + + $ gem install vagrant-bhyve + +## Usage + +TODO: Write usage instructions here + +## Development + +After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. + +To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). + +## Contributing + +Bug reports and pull requests are welcome on GitHub at https://github.com/jesa7955/vagrant-bhyve. + + +## License + +The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT). + Added: soc2016/litong/vagrant-bhyve/trunk/Rakefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2016/litong/vagrant-bhyve/trunk/Rakefile Thu May 19 11:34:54 2016 (r303369) @@ -0,0 +1,6 @@ +require "bundler/gem_tasks" +require "rspec/core/rake_task" + +RSpec::Core::RakeTask.new(:spec) + +task :default => :spec Added: soc2016/litong/vagrant-bhyve/trunk/bin/console ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2016/litong/vagrant-bhyve/trunk/bin/console Thu May 19 11:34:54 2016 (r303369) @@ -0,0 +1,14 @@ +#!/usr/bin/env ruby + +require "bundler/setup" +require "vagrant/bhyve" + +# You can add fixtures and/or initialization code here to make experimenting +# with your gem easier. You can also use a different console, if you like. + +# (If you use this, don't forget to add pry to your Gemfile!) +# require "pry" +# Pry.start + +require "irb" +IRB.start Added: soc2016/litong/vagrant-bhyve/trunk/bin/setup ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2016/litong/vagrant-bhyve/trunk/bin/setup Thu May 19 11:34:54 2016 (r303369) @@ -0,0 +1,7 @@ +#!/bin/bash +set -euo pipefail +IFS=$'\n\t' + +bundle install + +# Do any other automated setup that you need to do here Added: soc2016/litong/vagrant-bhyve/trunk/lib/vagrant-bhyve.rb ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2016/litong/vagrant-bhyve/trunk/lib/vagrant-bhyve.rb Thu May 19 11:34:54 2016 (r303369) @@ -0,0 +1,17 @@ +require "pathname" + +require "vagrant-bhyve/version" + +module VagrantPlugin + module Bhyve + lib_path = Pathname.new(File.expand_path("../vagrant-bhyve", __FILE__)) + + + # This function returns the path to the source of this plugin + # + # @return [Pathname] + def self.source_root + @source_root ||= Pathname.new(File.expand_path("../.../", __FILE__)) + end + end +end Added: soc2016/litong/vagrant-bhyve/trunk/lib/vagrant-bhyve/version.rb ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2016/litong/vagrant-bhyve/trunk/lib/vagrant-bhyve/version.rb Thu May 19 11:34:54 2016 (r303369) @@ -0,0 +1,5 @@ +module Vagrant + module Bhyve + VERSION = "0.1.0" + end +end Added: soc2016/litong/vagrant-bhyve/trunk/locales/en.yml ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2016/litong/vagrant-bhyve/trunk/locales/en.yml Thu May 19 11:34:54 2016 (r303369) @@ -0,0 +1 @@ +en: Added: soc2016/litong/vagrant-bhyve/trunk/spec/spec_helper.rb ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2016/litong/vagrant-bhyve/trunk/spec/spec_helper.rb Thu May 19 11:34:54 2016 (r303369) @@ -0,0 +1,2 @@ +$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) +require 'vagrant/bhyve' Added: soc2016/litong/vagrant-bhyve/trunk/spec/vagrant/bhyve_spec.rb ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2016/litong/vagrant-bhyve/trunk/spec/vagrant/bhyve_spec.rb Thu May 19 11:34:54 2016 (r303369) @@ -0,0 +1,11 @@ +require 'spec_helper' + +describe Vagrant::Bhyve do + it 'has a version number' do + expect(Vagrant::Bhyve::VERSION).not_to be nil + end + + it 'does something useful' do + expect(false).to eq(true) + end +end Added: soc2016/litong/vagrant-bhyve/trunk/vagrant-bhyve.gemspec ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ soc2016/litong/vagrant-bhyve/trunk/vagrant-bhyve.gemspec Thu May 19 11:34:54 2016 (r303369) @@ -0,0 +1,33 @@ +# coding: utf-8 +lib = File.expand_path('../lib', __FILE__) +$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) +require 'vagrant/bhyve/version' + +Gem::Specification.new do |spec| + spec.name = "vagrant-bhyve" + spec.version = VagrantPlugins::ProviderBhyve::VERSION + spec.authors = ["Tong Li"] + spec.email = ["jesa7955@gmail.com"] + + spec.summary = %q{Vagrant provider plugin to support bhyve} + spec.description = spec.summary + spec.homepage = "https://github.com/jesa7955/vagrant-bhyve" + spec.license = "MIT" + + # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or + # delete this section to allow pushing this gem to any host. + if spec.respond_to?(:metadata) + spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'" + else + raise "RubyGems 2.0 or newer is required to protect against public gem pushes." + end + + spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } + spec.bindir = "exe" + spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } + spec.require_paths = ["lib"] + + spec.add_development_dependency "bundler", "~> 1.10" + spec.add_development_dependency "rake", "~> 10.0" + spec.add_development_dependency "rspec" +end From owner-svn-soc-all@freebsd.org Thu May 19 11:35:11 2016 Return-Path: Delivered-To: svn-soc-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6E0CB420DE for ; Thu, 19 May 2016 11:35:11 +0000 (UTC) (envelope-from litong@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA96911C9 for ; Thu, 19 May 2016 11:35:11 +0000 (UTC) (envelope-from litong@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.15.2/8.15.2) with ESMTP id u4JBZBDK029289 for ; Thu, 19 May 2016 11:35:11 GMT (envelope-from litong@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.15.2/8.15.2/Submit) id u4JBZAWa029241 for svn-soc-all@FreeBSD.org; Thu, 19 May 2016 11:35:10 GMT (envelope-from litong@FreeBSD.org) Date: Thu, 19 May 2016 11:35:10 GMT Message-Id: <201605191135.u4JBZAWa029241@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to litong@FreeBSD.org using -f From: litong@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r303370 - in soc2016/litong/vagrant-bhyve/trunk: . bin lib/vagrant-bhyve spec/vagrant spec/vagrant-bhyve MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2016 11:35:11 -0000 Author: litong Date: Thu May 19 11:35:09 2016 New Revision: 303370 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=303370 Log: remove bin Added: soc2016/litong/vagrant-bhyve/trunk/spec/vagrant-bhyve/ soc2016/litong/vagrant-bhyve/trunk/spec/vagrant-bhyve/bhyve_spec.rb - copied, changed from r303369, soc2016/litong/vagrant-bhyve/trunk/spec/vagrant/bhyve_spec.rb Deleted: soc2016/litong/vagrant-bhyve/trunk/bin/console soc2016/litong/vagrant-bhyve/trunk/bin/setup soc2016/litong/vagrant-bhyve/trunk/spec/vagrant/bhyve_spec.rb Modified: soc2016/litong/vagrant-bhyve/trunk/.gitignore soc2016/litong/vagrant-bhyve/trunk/lib/vagrant-bhyve/version.rb Modified: soc2016/litong/vagrant-bhyve/trunk/.gitignore ============================================================================== --- soc2016/litong/vagrant-bhyve/trunk/.gitignore Thu May 19 11:34:54 2016 (r303369) +++ soc2016/litong/vagrant-bhyve/trunk/.gitignore Thu May 19 11:35:09 2016 (r303370) @@ -7,3 +7,4 @@ /pkg/ /spec/reports/ /tmp/ +/svn-commit.tmp Modified: soc2016/litong/vagrant-bhyve/trunk/lib/vagrant-bhyve/version.rb ============================================================================== --- soc2016/litong/vagrant-bhyve/trunk/lib/vagrant-bhyve/version.rb Thu May 19 11:34:54 2016 (r303369) +++ soc2016/litong/vagrant-bhyve/trunk/lib/vagrant-bhyve/version.rb Thu May 19 11:35:09 2016 (r303370) @@ -1,4 +1,4 @@ -module Vagrant +module VagrantPlugins module Bhyve VERSION = "0.1.0" end Copied and modified: soc2016/litong/vagrant-bhyve/trunk/spec/vagrant-bhyve/bhyve_spec.rb (from r303369, soc2016/litong/vagrant-bhyve/trunk/spec/vagrant/bhyve_spec.rb) ============================================================================== From owner-svn-soc-all@freebsd.org Fri May 20 06:57:06 2016 Return-Path: Delivered-To: svn-soc-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A070B38B42 for ; Fri, 20 May 2016 06:57:06 +0000 (UTC) (envelope-from yuanxunzhang@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 148AD17B5 for ; Fri, 20 May 2016 06:57:06 +0000 (UTC) (envelope-from yuanxunzhang@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K6v5Xw004651 for ; Fri, 20 May 2016 06:57:05 GMT (envelope-from yuanxunzhang@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.15.2/8.15.2/Submit) id u4K6v5VD004649 for svn-soc-all@FreeBSD.org; Fri, 20 May 2016 06:57:05 GMT (envelope-from yuanxunzhang@FreeBSD.org) Date: Fri, 20 May 2016 06:57:05 GMT Message-Id: <201605200657.u4K6v5VD004649@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to yuanxunzhang@FreeBSD.org using -f From: yuanxunzhang@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r303438 - soc2016/yuanxunzhang MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 06:57:06 -0000 Author: yuanxunzhang Date: Fri May 20 06:57:05 2016 New Revision: 303438 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=303438 Log: Added: soc2016/yuanxunzhang/ From owner-svn-soc-all@freebsd.org Fri May 20 07:02:58 2016 Return-Path: Delivered-To: svn-soc-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55DCCB38FE6 for ; Fri, 20 May 2016 07:02:58 +0000 (UTC) (envelope-from yuanxunzhang@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31CF41F72 for ; Fri, 20 May 2016 07:02:58 +0000 (UTC) (envelope-from yuanxunzhang@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.15.2/8.15.2) with ESMTP id u4K72wC8051905 for ; Fri, 20 May 2016 07:02:58 GMT (envelope-from yuanxunzhang@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.15.2/8.15.2/Submit) id u4K72wN5051898 for svn-soc-all@FreeBSD.org; Fri, 20 May 2016 07:02:58 GMT (envelope-from yuanxunzhang@FreeBSD.org) Date: Fri, 20 May 2016 07:02:58 GMT Message-Id: <201605200702.u4K72wN5051898@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to yuanxunzhang@FreeBSD.org using -f From: yuanxunzhang@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r303455 - soc2016/yuanxunzhang/head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 May 2016 07:02:58 -0000 Author: yuanxunzhang Date: Fri May 20 07:02:57 2016 New Revision: 303455 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=303455 Log: Added: soc2016/yuanxunzhang/head/ (props changed) - copied from r303454, mirror/FreeBSD/head/ From owner-svn-soc-all@freebsd.org Sat May 21 14:38:09 2016 Return-Path: Delivered-To: svn-soc-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92378B44247 for ; Sat, 21 May 2016 14:38:09 +0000 (UTC) (envelope-from iateaca@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76FF8171F for ; Sat, 21 May 2016 14:38:09 +0000 (UTC) (envelope-from iateaca@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.15.2/8.15.2) with ESMTP id u4LEc950082383 for ; Sat, 21 May 2016 14:38:09 GMT (envelope-from iateaca@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.15.2/8.15.2/Submit) id u4LEc8nv082380 for svn-soc-all@FreeBSD.org; Sat, 21 May 2016 14:38:08 GMT (envelope-from iateaca@FreeBSD.org) Date: Sat, 21 May 2016 14:38:08 GMT Message-Id: <201605211438.u4LEc8nv082380@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to iateaca@FreeBSD.org using -f From: iateaca@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r303547 - soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 14:38:09 -0000 Author: iateaca Date: Sat May 21 14:38:08 2016 New Revision: 303547 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=303547 Log: design the HDA command and control data structure (CORB or RIBB) implement the CORB engine initialization implement the DMA store and load functions M bhyve/pci_hda.c Modified: soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/pci_hda.c Modified: soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/pci_hda.c ============================================================================== --- soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/pci_hda.c Sat May 21 11:40:41 2016 (r303546) +++ soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/pci_hda.c Sat May 21 14:38:08 2016 (r303547) @@ -2,9 +2,12 @@ #include #include #include +#include +#include -#include "hdac_reg.h" +#include "bhyverun.h" #include "pci_emul.h" +#include "hdac_reg.h" /* * HDA Debug Log @@ -28,6 +31,8 @@ #define HDA_OSS_NO 0x04 #define HDA_ISS_NO 0x04 #define HDA_LAST_OFFSET (0x80 + ((HDA_ISS_NO) * 0x20) + ((HDA_OSS_NO) * 0x20)) +#define HDA_CORB_ENTRY_LEN 0x04 +#define HDA_RIRB_ENTRY_LEN 0x08 /* * HDA data structures @@ -37,8 +42,21 @@ typedef void (*hda_set_reg_handler)(struct hda_softc *sc, uint32_t offset, uint32_t old); +struct hda_codec_cmd_ctl { + char *name; + void *dma_vaddr; + uint16_t size; + uint16_t wp; + uint16_t rp; + uint8_t run; +}; + struct hda_softc { + struct pci_devinst *pci_dev; uint32_t regs[HDA_LAST_OFFSET]; + + struct hda_codec_cmd_ctl corb; + struct hda_codec_cmd_ctl rirb; }; /* @@ -58,6 +76,20 @@ static int hda_write(struct hda_softc *sc, uint32_t offset, uint32_t value); +static void +hda_print_cmd_ctl_data(struct hda_codec_cmd_ctl *p); +static int +hda_corb_start(struct hda_softc *sc); +static int +hda_corb_run(struct hda_softc *sc); + +static void * +hda_dma_get_vaddr(struct hda_softc *sc, uint64_t dma_paddr, size_t len); +static void +hda_dma_st_dword(void *dma_vaddr, uint32_t data); +static uint32_t +hda_dma_ld_dword(void *dma_vaddr); + static inline uint8_t hda_get_stream_by_offsets(uint32_t offset, uint8_t reg_offset); @@ -109,6 +141,13 @@ [HDA_LAST_OFFSET] = NULL, }; +static const uint16_t hda_corb_sizes[] = { + [HDAC_CORBSIZE_CORBSIZE_2] = 2, + [HDAC_CORBSIZE_CORBSIZE_16] = 16, + [HDAC_CORBSIZE_CORBSIZE_256] = 256, + [HDAC_CORBSIZE_CORBSIZE_MASK] = 0, +}; + struct pci_devemu pci_de_hda = { .pe_emu = "hda", .pe_init = pci_hda_init, @@ -209,6 +248,90 @@ return 0; } +static void +hda_print_cmd_ctl_data(struct hda_codec_cmd_ctl *p) +{ + char *name = p->name; + + DPRINTF("%s size: %d\n", name, p->size); + DPRINTF("%s dma_vaddr: %p\n", name, p->dma_vaddr); + DPRINTF("%s wp: %d\n", name, p->wp); + DPRINTF("%s rp: %d\n", name, p->rp); + + return; +} + +static int +hda_corb_start(struct hda_softc *sc) +{ + struct hda_codec_cmd_ctl *corb = &sc->corb; + uint8_t corbsize = 0; + uint64_t corblbase = 0; + uint64_t corbubase = 0; + uint64_t corbpaddr; + + corb->name = "CORB"; + + corbsize = hda_get_reg_by_offset(sc, HDAC_CORBSIZE) & HDAC_CORBSIZE_CORBSIZE_MASK; + corb->size = hda_corb_sizes[corbsize]; + + if (!corb->size) { + DPRINTF("Invalid corb size\n"); + return -1; + } + + corblbase = hda_get_reg_by_offset(sc, HDAC_CORBLBASE); + corbubase = hda_get_reg_by_offset(sc, HDAC_CORBUBASE); + + corbpaddr = corblbase | (corbubase << 32); + DPRINTF("CORB dma_paddr: %p\n", (void *)corbpaddr); + + corb->dma_vaddr = hda_dma_get_vaddr(sc, corbpaddr, HDA_CORB_ENTRY_LEN * corb->size); + if (!corb->dma_vaddr) { + DPRINTF("Fail to get the guest virtual address\n"); + return -1; + } + + corb->wp = hda_get_reg_by_offset(sc, HDAC_CORBWP); + corb->rp = hda_get_reg_by_offset(sc, HDAC_CORBRP); + + corb->run = 1; + + hda_print_cmd_ctl_data(corb); + + return 0; +} + +static int +hda_corb_run(struct hda_softc *sc) +{ + return 0; +} + +static void * +hda_dma_get_vaddr(struct hda_softc *sc, uint64_t dma_paddr, size_t len) +{ + struct pci_devinst *pi = sc->pci_dev; + + assert(pi); + + return paddr_guest2host(pi->pi_vmctx, (uintptr_t)dma_paddr, len); +} + +static void +hda_dma_st_dword(void *dma_vaddr, uint32_t data) +{ + *(uint32_t*)dma_vaddr = data; + + return; +} + +static uint32_t +hda_dma_ld_dword(void *dma_vaddr) +{ + return *(uint32_t*)dma_vaddr; +} + static inline uint8_t hda_get_stream_by_offsets(uint32_t offset, uint8_t reg_offset) { @@ -230,6 +353,18 @@ static void hda_set_corbctl(struct hda_softc *sc, uint32_t offset, uint32_t old) { + uint32_t value = sc->regs[offset]; + int err; + struct hda_codec_cmd_ctl *corb = NULL; + + if (value & HDAC_CORBCTL_CORBRUN) { + err = hda_corb_start(sc); + assert(!err); + } else { + corb = &sc->corb; + memset(corb, 0, sizeof(*corb)); + } + return; } @@ -277,6 +412,7 @@ if (!sc) return -1; + sc->pci_dev = pi; pi->pi_arg = sc; return 0; From owner-svn-soc-all@freebsd.org Sat May 21 15:54:42 2016 Return-Path: Delivered-To: svn-soc-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D9C3B4529E for ; Sat, 21 May 2016 15:54:42 +0000 (UTC) (envelope-from iateaca@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 53FD517F2 for ; Sat, 21 May 2016 15:54:42 +0000 (UTC) (envelope-from iateaca@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.15.2/8.15.2) with ESMTP id u4LFsgxw035919 for ; Sat, 21 May 2016 15:54:42 GMT (envelope-from iateaca@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.15.2/8.15.2/Submit) id u4LFsfvw035904 for svn-soc-all@FreeBSD.org; Sat, 21 May 2016 15:54:41 GMT (envelope-from iateaca@FreeBSD.org) Date: Sat, 21 May 2016 15:54:41 GMT Message-Id: <201605211554.u4LFsfvw035904@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to iateaca@FreeBSD.org using -f From: iateaca@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r303549 - soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 May 2016 15:54:42 -0000 Author: iateaca Date: Sat May 21 15:54:41 2016 New Revision: 303549 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=303549 Log: implement the RIRB initialization M bhyve/pci_hda.c Modified: soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/pci_hda.c Modified: soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/pci_hda.c ============================================================================== --- soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/pci_hda.c Sat May 21 14:51:49 2016 (r303548) +++ soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/pci_hda.c Sat May 21 15:54:41 2016 (r303549) @@ -82,6 +82,8 @@ hda_corb_start(struct hda_softc *sc); static int hda_corb_run(struct hda_softc *sc); +static int +hda_rirb_start(struct hda_softc *sc); static void * hda_dma_get_vaddr(struct hda_softc *sc, uint64_t dma_paddr, size_t len); @@ -148,6 +150,13 @@ [HDAC_CORBSIZE_CORBSIZE_MASK] = 0, }; +static const uint16_t hda_rirb_sizes[] = { + [HDAC_RIRBSIZE_RIRBSIZE_2] = 2, + [HDAC_RIRBSIZE_RIRBSIZE_16] = 16, + [HDAC_RIRBSIZE_RIRBSIZE_256] = 256, + [HDAC_RIRBSIZE_RIRBSIZE_MASK] = 0, +}; + struct pci_devemu pci_de_hda = { .pe_emu = "hda", .pe_init = pci_hda_init, @@ -255,8 +264,8 @@ DPRINTF("%s size: %d\n", name, p->size); DPRINTF("%s dma_vaddr: %p\n", name, p->dma_vaddr); - DPRINTF("%s wp: %d\n", name, p->wp); - DPRINTF("%s rp: %d\n", name, p->rp); + DPRINTF("%s wp: 0x%x\n", name, p->wp); + DPRINTF("%s rp: 0x%x\n", name, p->rp); return; } @@ -268,7 +277,7 @@ uint8_t corbsize = 0; uint64_t corblbase = 0; uint64_t corbubase = 0; - uint64_t corbpaddr; + uint64_t corbpaddr = 0; corb->name = "CORB"; @@ -308,6 +317,47 @@ return 0; } +static int +hda_rirb_start(struct hda_softc *sc) +{ + struct hda_codec_cmd_ctl *rirb = &sc->rirb; + uint8_t rirbsize = 0; + uint64_t rirblbase = 0; + uint64_t rirbubase = 0; + uint64_t rirbpaddr = 0; + + rirb->name = "RIRB"; + + rirbsize = hda_get_reg_by_offset(sc, HDAC_RIRBSIZE) & HDAC_RIRBSIZE_RIRBSIZE_MASK; + rirb->size = hda_rirb_sizes[rirbsize]; + + if (!rirb->size) { + DPRINTF("Invalid rirb size\n"); + return -1; + } + + rirblbase = hda_get_reg_by_offset(sc, HDAC_RIRBLBASE); + rirbubase = hda_get_reg_by_offset(sc, HDAC_RIRBUBASE); + + rirbpaddr = rirblbase | (rirbubase << 32); + DPRINTF("RIRB dma_paddr: %p\n", (void *)rirbpaddr); + + rirb->dma_vaddr = hda_dma_get_vaddr(sc, rirbpaddr, HDA_RIRB_ENTRY_LEN * rirb->size); + if (!rirb->dma_vaddr) { + DPRINTF("Fail to get the guest virtual address\n"); + return -1; + } + + rirb->wp = hda_get_reg_by_offset(sc, HDAC_RIRBWP); + rirb->rp = 0x0000; + + rirb->run = 1; + + hda_print_cmd_ctl_data(rirb); + + return 0; +} + static void * hda_dma_get_vaddr(struct hda_softc *sc, uint64_t dma_paddr, size_t len) { @@ -371,6 +421,18 @@ static void hda_set_rirbctl(struct hda_softc *sc, uint32_t offset, uint32_t old) { + uint32_t value = sc->regs[offset]; + int err; + struct hda_codec_cmd_ctl *rirb = NULL; + + if (value & HDAC_RIRBCTL_RIRBDMAEN) { + err = hda_rirb_start(sc); + assert(!err); + } else { + rirb = &sc->rirb; + memset(rirb, 0, sizeof(*rirb)); + } + return; }