170025d76Sjohnny /* 270025d76Sjohnny * CDDL HEADER START 370025d76Sjohnny * 470025d76Sjohnny * The contents of this file are subject to the terms of the 54ac39488Sprasad * Common Development and Distribution License (the "License"). 64ac39488Sprasad * You may not use this file except in compliance with the License. 770025d76Sjohnny * 870025d76Sjohnny * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 970025d76Sjohnny * or http://www.opensolaris.org/os/licensing. 1070025d76Sjohnny * See the License for the specific language governing permissions 1170025d76Sjohnny * and limitations under the License. 1270025d76Sjohnny * 1370025d76Sjohnny * When distributing Covered Code, include this CDDL HEADER in each 1470025d76Sjohnny * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 1570025d76Sjohnny * If applicable, add the following below this CDDL HEADER, with the 1670025d76Sjohnny * fields enclosed by brackets "[]" replaced with your own identifying 1770025d76Sjohnny * information: Portions Copyright [yyyy] [name of copyright owner] 1870025d76Sjohnny * 1970025d76Sjohnny * CDDL HEADER END 2070025d76Sjohnny */ 2170025d76Sjohnny /* 22fc51f9bbSKrishna Elango * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 23fc51f9bbSKrishna Elango * Use is subject to license terms. 2470025d76Sjohnny */ 2570025d76Sjohnny 2670025d76Sjohnny #include <sys/types.h> 2770025d76Sjohnny #include <sys/ddi.h> 28*e762302fSShesha Sreenivasamurthy #include <sys/kmem.h> 29*e762302fSShesha Sreenivasamurthy #include <sys/sysmacros.h> 3070025d76Sjohnny #include <sys/sunddi.h> 31*e762302fSShesha Sreenivasamurthy #include <sys/sunpm.h> 32*e762302fSShesha Sreenivasamurthy #include <sys/epm.h> 33fc51f9bbSKrishna Elango #include <sys/sunndi.h> 34*e762302fSShesha Sreenivasamurthy #include <sys/ddi_impldefs.h> 35*e762302fSShesha Sreenivasamurthy #include <sys/ddi_implfuncs.h> 36*e762302fSShesha Sreenivasamurthy #include <sys/pcie.h> 37fc51f9bbSKrishna Elango #include <sys/pcie_impl.h> 38*e762302fSShesha Sreenivasamurthy #include <sys/pcie_pwr.h> 39*e762302fSShesha Sreenivasamurthy #include <sys/pcie_acpi.h> /* pcie_x86_priv_t */ 4070025d76Sjohnny 41fc51f9bbSKrishna Elango void pcie_init_plat(dev_info_t * dip)42fc51f9bbSKrishna Elangopcie_init_plat(dev_info_t *dip) 43fc51f9bbSKrishna Elango { 44*e762302fSShesha Sreenivasamurthy pcie_bus_t *bus_p = PCIE_DIP2BUS(dip); 45*e762302fSShesha Sreenivasamurthy bus_p->bus_plat_private = 46*e762302fSShesha Sreenivasamurthy (pcie_x86_priv_t *)kmem_zalloc(sizeof (pcie_x86_priv_t), KM_SLEEP); 47fc51f9bbSKrishna Elango } 4870025d76Sjohnny 4970025d76Sjohnny void pcie_fini_plat(dev_info_t * dip)50fc51f9bbSKrishna Elangopcie_fini_plat(dev_info_t *dip) 51*e762302fSShesha Sreenivasamurthy { 52*e762302fSShesha Sreenivasamurthy pcie_bus_t *bus_p = PCIE_DIP2BUS(dip); 53*e762302fSShesha Sreenivasamurthy 54*e762302fSShesha Sreenivasamurthy kmem_free(bus_p->bus_plat_private, sizeof (pcie_x86_priv_t)); 55*e762302fSShesha Sreenivasamurthy } 56*e762302fSShesha Sreenivasamurthy 57*e762302fSShesha Sreenivasamurthy /* ARGSUSED */ 58*e762302fSShesha Sreenivasamurthy int pcie_plat_pwr_setup(dev_info_t * dip)59*e762302fSShesha Sreenivasamurthypcie_plat_pwr_setup(dev_info_t *dip) 60*e762302fSShesha Sreenivasamurthy { 61*e762302fSShesha Sreenivasamurthy return (DDI_SUCCESS); 62*e762302fSShesha Sreenivasamurthy } 63*e762302fSShesha Sreenivasamurthy 64*e762302fSShesha Sreenivasamurthy /* 65*e762302fSShesha Sreenivasamurthy * Undo whatever is done in pcie_plat_pwr_common_setup 66*e762302fSShesha Sreenivasamurthy */ 67*e762302fSShesha Sreenivasamurthy /* ARGSUSED */ 68*e762302fSShesha Sreenivasamurthy void pcie_plat_pwr_teardown(dev_info_t * dip)69*e762302fSShesha Sreenivasamurthypcie_plat_pwr_teardown(dev_info_t *dip) 7070025d76Sjohnny { 7170025d76Sjohnny } 72