14ad7e9b0SAdrian Chadd /*- 24d846d26SWarner Losh * SPDX-License-Identifier: BSD-2-Clause 36e778a7eSPedro F. Giffuni * 44ad7e9b0SAdrian Chadd * Copyright (c) 2015 Landon Fuller <landon@landonf.org> 54ad7e9b0SAdrian Chadd * All rights reserved. 64ad7e9b0SAdrian Chadd * 74ad7e9b0SAdrian Chadd * Redistribution and use in source and binary forms, with or without 84ad7e9b0SAdrian Chadd * modification, are permitted provided that the following conditions 94ad7e9b0SAdrian Chadd * are met: 104ad7e9b0SAdrian Chadd * 1. Redistributions of source code must retain the above copyright 114ad7e9b0SAdrian Chadd * notice, this list of conditions and the following disclaimer, 124ad7e9b0SAdrian Chadd * without modification. 134ad7e9b0SAdrian Chadd * 2. Redistributions in binary form must reproduce at minimum a disclaimer 144ad7e9b0SAdrian Chadd * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any 154ad7e9b0SAdrian Chadd * redistribution must be conditioned upon including a substantially 164ad7e9b0SAdrian Chadd * similar Disclaimer requirement for further binary redistribution. 174ad7e9b0SAdrian Chadd * 184ad7e9b0SAdrian Chadd * NO WARRANTY 194ad7e9b0SAdrian Chadd * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 204ad7e9b0SAdrian Chadd * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 214ad7e9b0SAdrian Chadd * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY 224ad7e9b0SAdrian Chadd * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 234ad7e9b0SAdrian Chadd * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, 244ad7e9b0SAdrian Chadd * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 254ad7e9b0SAdrian Chadd * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 264ad7e9b0SAdrian Chadd * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 274ad7e9b0SAdrian Chadd * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 284ad7e9b0SAdrian Chadd * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 294ad7e9b0SAdrian Chadd * THE POSSIBILITY OF SUCH DAMAGES. 304ad7e9b0SAdrian Chadd */ 314ad7e9b0SAdrian Chadd 324ad7e9b0SAdrian Chadd #include <sys/cdefs.h> 334ad7e9b0SAdrian Chadd __FBSDID("$FreeBSD$"); 344ad7e9b0SAdrian Chadd 354ad7e9b0SAdrian Chadd /* 36bb64eeccSAdrian Chadd * Broadcom PCI/PCIe-Gen1 Host-PCI bridge. 374ad7e9b0SAdrian Chadd * 38bb64eeccSAdrian Chadd * This driver handles all interactions with PCI bridge cores operating in 39bb64eeccSAdrian Chadd * root complex mode. 404ad7e9b0SAdrian Chadd */ 414ad7e9b0SAdrian Chadd 424ad7e9b0SAdrian Chadd #include <sys/param.h> 434ad7e9b0SAdrian Chadd #include <sys/kernel.h> 444ad7e9b0SAdrian Chadd #include <sys/bus.h> 454ad7e9b0SAdrian Chadd #include <sys/module.h> 464ad7e9b0SAdrian Chadd 474ad7e9b0SAdrian Chadd #include <machine/bus.h> 484ad7e9b0SAdrian Chadd #include <sys/rman.h> 494ad7e9b0SAdrian Chadd #include <machine/resource.h> 504ad7e9b0SAdrian Chadd 514ad7e9b0SAdrian Chadd #include <dev/bhnd/bhnd.h> 524ad7e9b0SAdrian Chadd 534ad7e9b0SAdrian Chadd #include "bhnd_pcireg.h" 544ad7e9b0SAdrian Chadd #include "bhnd_pcibvar.h" 554ad7e9b0SAdrian Chadd 564ad7e9b0SAdrian Chadd static int 574ad7e9b0SAdrian Chadd bhnd_pcib_attach(device_t dev) 584ad7e9b0SAdrian Chadd { 59bb64eeccSAdrian Chadd // TODO 60bb64eeccSAdrian Chadd return (bhnd_pci_generic_attach(dev)); 614ad7e9b0SAdrian Chadd } 624ad7e9b0SAdrian Chadd 634ad7e9b0SAdrian Chadd static int 644ad7e9b0SAdrian Chadd bhnd_pcib_detach(device_t dev) 654ad7e9b0SAdrian Chadd { 66bb64eeccSAdrian Chadd // TODO 67bb64eeccSAdrian Chadd return (bhnd_pci_generic_detach(dev)); 684ad7e9b0SAdrian Chadd } 694ad7e9b0SAdrian Chadd 704ad7e9b0SAdrian Chadd static int 714ad7e9b0SAdrian Chadd bhnd_pcib_suspend(device_t dev) 724ad7e9b0SAdrian Chadd { 73bb64eeccSAdrian Chadd return (bhnd_pci_generic_suspend(dev)); 744ad7e9b0SAdrian Chadd } 754ad7e9b0SAdrian Chadd 764ad7e9b0SAdrian Chadd static int 774ad7e9b0SAdrian Chadd bhnd_pcib_resume(device_t dev) 784ad7e9b0SAdrian Chadd { 79bb64eeccSAdrian Chadd return (bhnd_pci_generic_resume(dev)); 804ad7e9b0SAdrian Chadd } 814ad7e9b0SAdrian Chadd 824ad7e9b0SAdrian Chadd static device_method_t bhnd_pcib_methods[] = { 834ad7e9b0SAdrian Chadd /* Device interface */ 844ad7e9b0SAdrian Chadd DEVMETHOD(device_attach, bhnd_pcib_attach), 854ad7e9b0SAdrian Chadd DEVMETHOD(device_detach, bhnd_pcib_detach), 864ad7e9b0SAdrian Chadd DEVMETHOD(device_suspend, bhnd_pcib_suspend), 874ad7e9b0SAdrian Chadd DEVMETHOD(device_resume, bhnd_pcib_resume), 884ad7e9b0SAdrian Chadd DEVMETHOD_END 894ad7e9b0SAdrian Chadd }; 904ad7e9b0SAdrian Chadd 918ef24a0dSAdrian Chadd DEFINE_CLASS_1(pcib, bhnd_pcib_driver, bhnd_pcib_methods, sizeof(struct bhnd_pcib_softc), bhnd_pci_driver); 928ef24a0dSAdrian Chadd 93162c26adSJohn Baldwin DRIVER_MODULE(bhnd_pcib, bhnd, bhnd_pcib_driver, 0, 0); 944ad7e9b0SAdrian Chadd 954ad7e9b0SAdrian Chadd MODULE_VERSION(bhnd_pcib, 1); 96eaddb807SAdrian Chadd MODULE_DEPEND(bhnd_pcib, bhnd, 1, 1, 1); 97eaddb807SAdrian Chadd MODULE_DEPEND(bhnd_pcib, bhnd_pci, 1, 1, 1); 984ad7e9b0SAdrian Chadd MODULE_DEPEND(bhnd_pcib, pci, 1, 1, 1); 99