/** * Initialize the coherent fabric. * * Perform discovery and initialization of the coherent fabric, for builds including * support for multiple coherent nodes. * * @param[in] State global state */ VOID STATIC CoherentInit ( IN OUT STATE_DATA *State ) { UINT8 i; UINT8 j; UINT8 ModuleType; UINT8 Module; UINT8 HardwareSocket; COHERENT_FABRIC Fabric; // Because Node 0, the BSP, is not discovered, initialize info about it specially here. // Allocate Socket Die Map. // While the BSP is always capable of being the only processor in the system, call the // IsExceededCapable method to make sure the BSP's capability is included in the aggregate system // capability. We don't care to check the return value. // State->Fabric = &Fabric; State->NodesDiscovered = 0; State->TotalLinks = 0; State->SysMpCap = MAX_NODES; State->Nb->IsExceededCapable (0, State, State->Nb); HardwareSocket = State->Nb->GetSocket (0, 0, State->Nb); ModuleType = 0; Module = 0; State->Nb->GetModuleInfo (0, &ModuleType, &Module, State->Nb); // No predecessor info for BSP, so pass 0xFF for those parameters. State->HtInterface->SetNodeToSocketMap (0xFF, 0xFF, 0xFF, 0, HardwareSocket, Module, State); // Initialize system state data structures for (i = 0; i < MAX_NODES; i++) { State->Fabric->SysDegree[i] = 0; for (j = 0; j < MAX_NODES; j++) { State->Fabric->SysMatrix[i][j] = 0; } } // // Call the coherent init features // // Discovery State->HtFeatures->CoherentDiscovery (State); State->HtInterface->PostMapToAp (State); // Topology matching and Routing AGESA_TESTPOINT (TpProcHtTopology, State->ConfigHandle); State->HtFeatures->LookupComputeAndLoadRoutingTables (State); State->HtFeatures->MakeHopCountTable (State); // UpdateCoreRanges requires the other maps to be initialized, and the node count set. FinalizeCoherentInit (State); UpdateCoreRanges (State); State->Fabric = NULL; }
/** * Initialize the Node and Socket maps for an AP Core. * * In each core's local heap, create a Node to Socket map and a Socket/Module to Node map. * * @param[in] State global state, input data * */ VOID STATIC InitApMaps ( IN STATE_DATA *State ) { // There is no option to not have socket - node maps, if they aren't allocated that is a fatal bug. ASSERT (State->SocketDieToNodeMap != NULL); ASSERT (State->NodeToSocketDieMap != NULL); (*State->SocketDieToNodeMap)[0][0].Node = 0; (*State->NodeToSocketDieMap)[0].Socket = 0; (*State->NodeToSocketDieMap)[0].Die = 0; // This requires the other maps to be initialized. UpdateCoreRanges (State); }
/** * Initialize the coherent fabric. * * Create the topology map of the coherent fabric. * * @param[in,out] State global state */ VOID STATIC CoherentInit ( IN OUT STATE_DATA *State ) { // Because Node 0, the BSP, is not discovered, initialize info about it specially here. // Set Socket Die Map for the BSP. // There is no option to not have socket - node maps, if they aren't allocated that is a fatal bug. ASSERT (State->SocketDieToNodeMap != NULL); ASSERT (State->NodeToSocketDieMap != NULL); (*State->SocketDieToNodeMap)[0][0].Node = 0; (*State->NodeToSocketDieMap)[0].Socket = 0; (*State->NodeToSocketDieMap)[0].Die = 0; // UpdateCoreRanges requires the other maps to be initialized, and the node count set. FinalizeCoherentInit (State); UpdateCoreRanges (State); }
/** * Initialize the Node and Socket maps for an AP Core. * * In each core's local heap, create a Node to Socket map and a Socket/Module to Node map. * The mapping is filled in by reading the AP Mailboxes from PCI config on each node. * * @param[in] State global state, input data * */ VOID STATIC InitApMaps ( IN STATE_DATA *State ) { UINT8 Node; AP_MAIL_INFO NodeApMailBox; // There is no option to not have socket - node maps, if they aren't allocated that is a fatal bug. ASSERT (State->SocketDieToNodeMap != NULL); ASSERT (State->NodeToSocketDieMap != NULL); for (Node = 0; Node < State->Nb->GetNodeCount (State->Nb); Node++) { NodeApMailBox = State->Nb->RetrieveMailbox (Node, State->Nb); (*State->SocketDieToNodeMap)[NodeApMailBox.Fields.Socket][NodeApMailBox.Fields.Module].Node = Node; (*State->NodeToSocketDieMap)[Node].Socket = (UINT8)NodeApMailBox.Fields.Socket; (*State->NodeToSocketDieMap)[Node].Die = (UINT8)NodeApMailBox.Fields.Module; } // This requires the other maps to be initialized. UpdateCoreRanges (State); }