13cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei/*++
23cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei
33cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei  Copyright (c) 2004  - 2014, Intel Corporation. All rights reserved.<BR>
43cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei
53cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei
63cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei  This program and the accompanying materials are licensed and made available under
73cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei
83cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei  the terms and conditions of the BSD License that accompanies this distribution.
93cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei
103cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei  The full text of the license may be found at
113cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei
123cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei  http://opensource.org/licenses/bsd-license.php.
133cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei
143cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei
153cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei
163cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
173cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei
183cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
193cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei
203cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei
213cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei
223cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei
233cbfba02fef9dae07a041fdbf2e89611d72d6f90David WeiModule Name:
243cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei
253cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei  SlotConfig.c
263cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei
273cbfba02fef9dae07a041fdbf2e89611d72d6f90David WeiAbstract:
283cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei
293cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei  Sets platform/SKU specific expansion slot information.
303cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei
313cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei
323cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei
333cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei
343cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei--*/
353cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei
363cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei#include "PlatformDxe.h"
373cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei#include <Protocol/SmbiosSlotPopulation.h>
383cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei#include <IndustryStandard/Pci22.h>
393cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei
403cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei
413cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei//
423cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei// Default bus number for the bridge
433cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei//
443cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei#define DEF_BUS_CONFIG  0x0101
453cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei#define DEF_BUS         0x01
463cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei
473cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei//
483cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei// Data structures for slot information
493cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei//
503cbfba02fef9dae07a041fdbf2e89611d72d6f90David Weitypedef struct {
513cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei  UINT16  SmbiosSlotId;
523cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei  UINT8   Bus;
533cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei  UINT8   Dev;
543cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei  UINT8   Function;
553cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei  UINT8   TargetDevice;
563cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei} EFI_PCI_SLOT_BRIDGE_INFO;
573cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei
583cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei//
593cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei// Product specific bridge to slot routing information
603cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei//
613cbfba02fef9dae07a041fdbf2e89611d72d6f90David WeiEFI_PCI_SLOT_BRIDGE_INFO mSlotBridgeTable[] = {
623cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei  {
633cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei    0x01,             //PCIe x1 ICH (Bridge B0:D28:F1)
643cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei    DEFAULT_PCI_BUS_NUMBER_PCH,
653cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei    PCI_DEVICE_NUMBER_PCH_PCIE_ROOT_PORTS,
663cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei    PCI_FUNCTION_NUMBER_PCH_PCIE_ROOT_PORT_2,
673cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei    0
683cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei  }
693cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei};
703cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei
713cbfba02fef9dae07a041fdbf2e89611d72d6f90David WeiUINTN mSlotBridgeTableSize =
723cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei  sizeof(mSlotBridgeTable) / sizeof(EFI_PCI_SLOT_BRIDGE_INFO);
733cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei
743cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei//
753cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei// Slot entry table for IBX RVP
763cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei//
773cbfba02fef9dae07a041fdbf2e89611d72d6f90David WeiEFI_SMBIOS_SLOT_ENTRY mSlotEntries[] = {
783cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei  {0x06, FALSE, TRUE},    // PCIe x16 Slot 1 (NOT USED)
793cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei  {0x04, FALSE, TRUE},    // PCIe x16 Slot 2 (NOT USED)
803cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei  {0x03, FALSE, TRUE},    // PCIe x4 Slot (NOT USED)
813cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei  {0x02, FALSE, FALSE},   // Mini PCIe x1 Slot
823cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei  {0x15, FALSE, TRUE},    // PCIe x1 Slot 2 (NOT USED)
833cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei  {0x16, FALSE, TRUE},    // PCIe x1 Slot 3 (NOT USED)
843cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei  {0x07, FALSE, FALSE},   // PCI Slot 1
853cbfba02fef9dae07a041fdbf2e89611d72d6f90David Wei  {0x18, FALSE, TRUE},    // PCI Slot 2 (NOT USED)
86  {0x17, FALSE, TRUE},    // PCI Slot 3 (NOT USED)
87};
88
89EFI_SMBIOS_SLOT_POPULATION_INFO mSlotInformation = {
90  sizeof(mSlotEntries) / sizeof(EFI_SMBIOS_SLOT_ENTRY),
91  mSlotEntries
92};
93
94
95