svn commit: r261293 - stable/9/sys/dev/pccbb

John Baldwin jhb at FreeBSD.org
Thu Jan 30 19:13:15 UTC 2014


Author: jhb
Date: Thu Jan 30 19:13:14 2014
New Revision: 261293
URL: http://svnweb.freebsd.org/changeset/base/261293

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/9/sys/dev/pccbb/pccbb.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/pccbb/pccbb.c
==============================================================================
--- stable/9/sys/dev/pccbb/pccbb.c	Thu Jan 30 19:09:59 2014	(r261292)
+++ stable/9/sys/dev/pccbb/pccbb.c	Thu Jan 30 19:13:14 2014	(r261293)
@@ -1031,6 +1031,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)
 {
@@ -1048,6 +1055,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);
 }
 
@@ -1068,6 +1076,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);
 }
 
@@ -1335,7 +1344,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-stable-9 mailing list