Date: Mon, 27 Jan 2014 19:49:53 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r261216 - head/sys/dev/pccbb Message-ID: <201401271949.s0RJnr7t067977@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhb Date: Mon Jan 27 19:49:52 2014 New Revision: 261216 URL: http://svnweb.freebsd.org/changeset/base/261216 Log: 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. Tested by: Olivier Cochard-Labbe <olivier@cochard.me> Reviewed by: imp MFC after: 3 days Modified: head/sys/dev/pccbb/pccbb.c Modified: head/sys/dev/pccbb/pccbb.c ============================================================================== --- head/sys/dev/pccbb/pccbb.c Mon Jan 27 19:37:35 2014 (r261215) +++ head/sys/dev/pccbb/pccbb.c Mon Jan 27 19:49:52 2014 (r261216) @@ -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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201401271949.s0RJnr7t067977>