svn commit: r261292 - stable/10/sys/dev/pccbb

John Baldwin jhb at FreeBSD.org
Thu Jan 30 19:10:00 UTC 2014


Author: jhb
Date: Thu Jan 30 19:09:59 2014
New Revision: 261292
URL: http://svnweb.freebsd.org/changeset/base/261292

Log:
  MFC 261216:
  Explicitly enable I/O and memory decoding in the bridge's command register
  when activating an I/O or memory window on the CardBus bridge.

Modified:
  stable/10/sys/dev/pccbb/pccbb.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/pccbb/pccbb.c
==============================================================================
--- stable/10/sys/dev/pccbb/pccbb.c	Thu Jan 30 18:32:33 2014	(r261291)
+++ stable/10/sys/dev/pccbb/pccbb.c	Thu Jan 30 19:09:59 2014	(r261292)
@@ -1038,6 +1038,13 @@ cbb_cardbus_power_disable_socket(device_
 /* CardBus Resource							*/
 /************************************************************************/
 
+static void
+cbb_activate_window(device_t brdev, int type)
+{
+
+	PCI_ENABLE_IO(device_get_parent(brdev), brdev, type);
+}
+
 static int
 cbb_cardbus_io_open(device_t brdev, int win, uint32_t start, uint32_t end)
 {
@@ -1055,6 +1062,7 @@ cbb_cardbus_io_open(device_t brdev, int 
 
 	pci_write_config(brdev, basereg, start, 4);
 	pci_write_config(brdev, limitreg, end, 4);
+	cbb_activate_window(brdev, SYS_RES_IOPORT);
 	return (0);
 }
 
@@ -1075,6 +1083,7 @@ cbb_cardbus_mem_open(device_t brdev, int
 
 	pci_write_config(brdev, basereg, start, 4);
 	pci_write_config(brdev, limitreg, end, 4);
+	cbb_activate_window(brdev, SYS_RES_MEMORY);
 	return (0);
 }
 
@@ -1342,7 +1351,12 @@ cbb_pcic_activate_resource(device_t brde
     struct resource *res)
 {
 	struct cbb_softc *sc = device_get_softc(brdev);
-	return (exca_activate_resource(&sc->exca[0], child, type, rid, res));
+	int error;
+
+	error = exca_activate_resource(&sc->exca[0], child, type, rid, res);
+	if (error == 0)
+		cbb_activate_window(brdev, type);
+	return (error);
 }
 
 static int


More information about the svn-src-all mailing list