2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. 2N/A * Create a topology node for a PRI node of type 'pciexrc' 2N/A * Create a pciexrc topo by calling the pciexrc enumerator for this instance. 2N/A * Create the root complex topo node. Use the generic enumerator to 2N/A * do this, and then we will add more attributes below. 2N/A "%s node_0x%llx failed to create topo node: %s\n",
2N/A /* Update the topo node with more specific information */ 2N/A "%s node_0x%llx failed to create node properites: %s\n",
2N/A * The node exists in this domain. We will call the PCIBUS 2N/A * enumerator after the entire PRI graph has been walked so 2N/A * that all the possible FRU nodes are available for bus's 2N/A * that span multiple FRU boundaries. 2N/A /* We cannot defer the call, so we need to do it now */ 2N/A * It is OK if the node does not exist for further PCIBUS 2N/A * enumeration. We can return success having created the 2N/A * root complex node itself. 2N/A /* Make sure our dependent modules are loaded */ 2N/A /* Create a node range for children of this bus */ 2N/A "%s node_0x%llx failed to create node range: %s\n",
2N/A * Invoke the pcibus enumerator for this node. 2N/A * The following is mostly a duplicate of code contained in: 2N/A * Determine if decorating a PCIE root complex or a hostbridge 2N/A "pi_enum_update node_0x%llx unknown hc name %s\n",
2N/A * Calculate the device path for this root complex node. 2N/A /* "path" not required for hostbridge */ 2N/A * Set the ASRU for this node using the dev scheme 2N/A * Create property groups. 2N/A "topo_pgroup_create for io pgroup failed\n",
2N/A "topo_pgroup_create for pci pgroup failed\n",
2N/A "%s node_0x%llx failed to set DEV property\n",
2N/A /* device type is always "pciex" */ 2N/A "%s node_0x%llx failed to set DEVTYPE property\n",
2N/A * Derived the driver name from the device path. 2N/A * Derived the BDF property from the devinfo node. 2N/A "%s node_0x%llx failed to set DRIVER property\n",
2N/A "%s node_0x%llx failed to create module fmri\n",
2N/A "%s node_0x%llx failed to set MODULE property\n",
2N/A /* This is a PCIEX root complex */ 2N/A "%s node_0x%llx failed to set EXCAP property\n",
2N/A /* Set BDF for root complex */ 2N/A "%s node_0x%llx failed to set BDF property\n",
2N/A /* Create a node range for the children of this root complex */ 2N/A "%s node_0x%llx failed to create %s range\n",
2N/A /* Initialize the device information structure for this module */ 2N/A * Find the PRI node path property. This will be used to associate 2N/A * the PRI node with the device node. 2N/A * Scan the device node list and find the node associated with 2N/A * the given PRI node. Equality is defined when the PRI path 2N/A * is the same as the device node path. 2N/A /* We have found the matching dnode */ 2N/A /* We have not found the matching dnode yet */ 2N/A * Associate this dnode with the topo node. The PCI 2N/A * enumerator requires this information. 2N/A * Find the BDF property and return as a string. 2N/A * The string must be freed with topo_mod_strfree() 2N/A * Look for the "reg" property from the devinfo node. 2N/A * If the "reg" property is not found in the di_node; look for it in 2N/A * The reg property is divided like this: 2N/A * ----------------------------------------------------- 2N/A * | 23 Bus 16 | 15 Dev 11 | 10 Fn 8 | 7 Reg 0 | 2N/A * ----------------------------------------------------- 2N/A * PCI_REG_* macros strip off Reg and shift to get individual 2N/A /* Pass BDF back as a string */