socsvn commit: r303017 - soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve

iateaca at FreeBSD.org iateaca at FreeBSD.org
Sun May 15 14:23:52 UTC 2016


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;
 }
 


More information about the svn-soc-all mailing list