npe_misc.c revision 70025d765b044c6d8594bb965a2247a61e991a99
70025d765b044c6d8594bb965a2247a61e991a99johnny * CDDL HEADER START
70025d765b044c6d8594bb965a2247a61e991a99johnny * The contents of this file are subject to the terms of the
70025d765b044c6d8594bb965a2247a61e991a99johnny * Common Development and Distribution License, Version 1.0 only
70025d765b044c6d8594bb965a2247a61e991a99johnny * (the "License"). You may not use this file except in compliance
70025d765b044c6d8594bb965a2247a61e991a99johnny * with the License.
70025d765b044c6d8594bb965a2247a61e991a99johnny * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
70025d765b044c6d8594bb965a2247a61e991a99johnny * See the License for the specific language governing permissions
70025d765b044c6d8594bb965a2247a61e991a99johnny * and limitations under the License.
70025d765b044c6d8594bb965a2247a61e991a99johnny * When distributing Covered Code, include this CDDL HEADER in each
70025d765b044c6d8594bb965a2247a61e991a99johnny * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
70025d765b044c6d8594bb965a2247a61e991a99johnny * If applicable, add the following below this CDDL HEADER, with the
70025d765b044c6d8594bb965a2247a61e991a99johnny * fields enclosed by brackets "[]" replaced with your own identifying
70025d765b044c6d8594bb965a2247a61e991a99johnny * information: Portions Copyright [yyyy] [name of copyright owner]
70025d765b044c6d8594bb965a2247a61e991a99johnny * CDDL HEADER END
70025d765b044c6d8594bb965a2247a61e991a99johnny * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
70025d765b044c6d8594bb965a2247a61e991a99johnny * Use is subject to license terms.
70025d765b044c6d8594bb965a2247a61e991a99johnny#pragma ident "%Z%%M% %I% %E% SMI"
70025d765b044c6d8594bb965a2247a61e991a99johnny * Library file that has miscellaneous support for npe(7d)
70025d765b044c6d8594bb965a2247a61e991a99johnny * Prototype declaration
70025d765b044c6d8594bb965a2247a61e991a99johnny * Default ecfga base address
70025d765b044c6d8594bb965a2247a61e991a99johnny * Query the MCFG table using ACPI. If MCFG is found, setup the
70025d765b044c6d8594bb965a2247a61e991a99johnny * 'ecfga-base-address' (Enhanced Configuration Access base address)
70025d765b044c6d8594bb965a2247a61e991a99johnny * property accordingly. Otherwise, set the value of the property
70025d765b044c6d8594bb965a2247a61e991a99johnny * to the default value.
70025d765b044c6d8594bb965a2247a61e991a99johnny /* Query the MCFG table using ACPI */
70025d765b044c6d8594bb965a2247a61e991a99johnny if (AcpiGetFirmwareTable(MCFG_SIG, 1, ACPI_LOGICAL_ADDRESSING,
70025d765b044c6d8594bb965a2247a61e991a99johnny cfg_baap = (CFG_BASE_ADDR_ALLOC *)mcfgp->CfgBaseAddrAllocList;
70025d765b044c6d8594bb965a2247a61e991a99johnny * Setup the 'ecfga-base-address' property to
70025d765b044c6d8594bb965a2247a61e991a99johnny * the base_addr found in the MCFG and return.
70025d765b044c6d8594bb965a2247a61e991a99johnny * If MCFG is not found or ecfga_base is not found in MCFG table,
70025d765b044c6d8594bb965a2247a61e991a99johnny * set the 'ecfga-base-address' property to the default value.
70025d765b044c6d8594bb965a2247a61e991a99johnny * Enable reporting of AER capability next pointer.
70025d765b044c6d8594bb965a2247a61e991a99johnny * This needs to be done only for CK8-04 devices
70025d765b044c6d8594bb965a2247a61e991a99johnny * by setting NV_XVR_VEND_CYA1 (offset 0xf40) bit 13
70025d765b044c6d8594bb965a2247a61e991a99johnny * NOTE: BIOS is disabling this, it needs to be enabled temporarily
70025d765b044c6d8594bb965a2247a61e991a99johnny if (pci_config_setup(child, &config_handle) != DDI_SUCCESS)
70025d765b044c6d8594bb965a2247a61e991a99johnny vid = pci_config_get16(config_handle, PCI_CONF_VENID);
70025d765b044c6d8594bb965a2247a61e991a99johnny did = pci_config_get16(config_handle, PCI_CONF_DEVID);