コード例 #1
0
ファイル: GnbLibMemAcc.c プロジェクト: fishbaoz/KaveriPI
VOID
GnbLibMemRead (
  IN       UINT64       Address,
  IN       ACCESS_WIDTH Width,
     OUT   VOID         *Value,
  IN       VOID         *StdHeader
  )
{
  if (Width == AccessWidth64) {
    LibAmdMemRead (AccessWidth32, Address, Value, StdHeader);
    LibAmdMemRead (AccessWidth32, Address + 4, (VOID *) ((UINT64)Value + 4), StdHeader);
  } else {
    LibAmdMemRead (Width, Address, Value, StdHeader);
  }
}
コード例 #2
0
ファイル: FchLib.c プロジェクト: Godkey/coreboot
/**< cimFchStall - Reserved  */
VOID
CimFchStall (
  IN       UINT32              uSec,
  IN       AMD_CONFIG_PARAMS   *StdHeader
  )
{
  UINT16 timerAddr;
  UINT32 startTime;
  UINT32 elapsedTime;

  LibAmdMemRead (AccessWidth16, (UINT64) (ACPI_MMIO_BASE + PMIO_BASE + FCH_PMIOA_REG64), &timerAddr, StdHeader);
  if ( timerAddr == 0 ) {
    uSec = uSec / 2;
    while ( uSec != 0 ) {
      LibAmdIoRead (AccessWidth8, FCHOEM_IO_DELAY_PORT, (UINT8*)&elapsedTime, StdHeader);
      uSec--;
    }
  } else {
    LibAmdIoRead (AccessWidth32, timerAddr, &startTime, StdHeader);
    for ( ;; ) {
      LibAmdIoRead (AccessWidth32, timerAddr, &elapsedTime, StdHeader);
      if ( elapsedTime < startTime ) {
        elapsedTime = elapsedTime + FCH_MAX_TIMER - startTime;
      } else {
        elapsedTime = elapsedTime - startTime;
      }
      if ( (elapsedTime * FCHOEM_ELAPSED_TIME_UNIT / FCHOEM_ELAPSED_TIME_DIVIDER) > uSec ) {
        break;
      }
    }
  }
}
コード例 #3
0
ファイル: FchPeLib.c プロジェクト: B-Rich/coreboot
/**
 * GetChipSysMode - Get Chip status
 *
 *
 * @param[in] Value - Return Chip strap status
 *   StrapStatus [15.0] - Hudson-2 chip Strap Status
 *    @li <b>0001</b> - Not USED FWH
 *    @li <b>0002</b> - Not USED LPC ROM
 *    @li <b>0004</b> - EC enabled
 *    @li <b>0008</b> - Reserved
 *    @li <b>0010</b> - Internal Clock mode
 * @param[in] StdHeader
 *
 */
VOID
GetChipSysMode (
  IN       VOID                *Value,
  IN       AMD_CONFIG_PARAMS   *StdHeader
  )
{
  LibAmdMemRead (AccessWidth8, (UINT64) (ACPI_MMIO_BASE + MISC_BASE + FCH_MISC_REG80), Value, StdHeader);
}
コード例 #4
0
ファイル: GnbLibMemAcc.c プロジェクト: AdriDlu/coreboot
VOID
GnbLibMemRead (
  IN       UINT64       Address,
  IN       ACCESS_WIDTH Width,
     OUT   VOID         *Value,
  IN       VOID         *StdHeader
  )
{
  LibAmdMemRead (Width, Address, Value, StdHeader);
}
コード例 #5
0
ファイル: IdsDpRam.c プロジェクト: fishbaoz/CarrizoPI
/**
 * Read Debug Print Memory
 *
 *
 * @param[in] AccessWidth   Access width
 * @param[in] MemAddress    Memory address
 * @param[in] Value         Pointer to data
 *
 */
VOID
STATIC
AmdIdsDpRamRead (
  IN       ACCESS_WIDTH AccessWidth,
  IN       UINT64 MemAddress,
     OUT   VOID *Value
  )
{
  LibAmdMemRead (AccessWidth, MemAddress, Value, NULL);
}
コード例 #6
0
ファイル: CsSaveSmmLibCz.c プロジェクト: fishbaoz/CarrizoPI
/**
 *  Prepare a MMIO entry on a family 15h Carrizo core.
 *
 * @param[in]    CurrentEntry       Current entry to process
 *
 * @return       Pointer to next table entry
 */
CS_RESTORATION_ENTRY_HEADER*
F15CzProcessMmioEntry (
  IN       CS_RESTORATION_ENTRY_HEADER  *CurrentEntry
  )
{
  CS_MMIO  *MmioEntry;

  MmioEntry = (CS_MMIO *) CurrentEntry;
  if (MmioEntry->Header.SaveReadValue) {
    LibAmdMemRead (AccessWidth32, MmioEntry->Address, &MmioEntry->Value, NULL);
  }
  MmioEntry++;
  return &MmioEntry->Header;
}
コード例 #7
0
ファイル: CsSaveSmmLibCz.c プロジェクト: fishbaoz/CarrizoPI
/**
 *  Prepare an FCH 8bit memory mapped IO entry on a family 15h Carrizo core.
 *
 * @param[in]    CurrentEntry       Current entry to process
 *
 * @return       Pointer to next table entry
 */
CS_RESTORATION_ENTRY_HEADER*
F15CzProcessFchMmioByteEntry (
  IN       CS_RESTORATION_ENTRY_HEADER  *CurrentEntry
  )
{
  UINT64            MmioAddress;
  CS_FCH_MMIO_BYTE  *FchMmioByteEntry;

  FchMmioByteEntry = (CS_FCH_MMIO_BYTE *) CurrentEntry;
  if (FchMmioByteEntry->Header.SaveReadValue) {
    MmioAddress = FCH_MMIO_BASE + FchMmioByteEntry->Address;
    LibAmdMemRead (AccessWidth8, MmioAddress, &FchMmioByteEntry->Value, NULL);
  }
  FchMmioByteEntry++;
  return &FchMmioByteEntry->Header;
}
コード例 #8
0
ファイル: CsSaveSmmLibCz.c プロジェクト: fishbaoz/CarrizoPI
/**
 *  Prepare an FCH 16bit memory mapped IO bits entry on a family 15h Carrizo core.
 *
 * @param[in]    CurrentEntry       Current entry to process
 *
 * @return       Pointer to next table entry
 */
CS_RESTORATION_ENTRY_HEADER*
F15CzProcessFchMmioWordBitsEntry (
  IN       CS_RESTORATION_ENTRY_HEADER  *CurrentEntry
  )
{
  UINT64                 MmioAddress;
  CS_FCH_MMIO_WORD_BITS  *FchMmioWordBitsEntry;

  FchMmioWordBitsEntry = (CS_FCH_MMIO_WORD_BITS *) CurrentEntry;
  if (FchMmioWordBitsEntry->Header.SaveReadValue) {
    MmioAddress = FCH_MMIO_BASE + FchMmioWordBitsEntry->Address;
    LibAmdMemRead (AccessWidth16, MmioAddress, &FchMmioWordBitsEntry->Value, NULL);
    FchMmioWordBitsEntry->Value &= ~FchMmioWordBitsEntry->Mask;
  }
  FchMmioWordBitsEntry++;
  return &FchMmioWordBitsEntry->Header;
}
コード例 #9
0
ファイル: CsSaveSmmLibCz.c プロジェクト: fishbaoz/CarrizoPI
/**
 *  Prepare an FCH AB link entry on a family 15h Carrizo core.
 *
 * @param[in]    CurrentEntry       Current entry to process
 *
 * @return       Pointer to next table entry
 */
CS_RESTORATION_ENTRY_HEADER*
F15CzProcessFchAbEntry (
  IN       CS_RESTORATION_ENTRY_HEADER  *CurrentEntry
  )
{
  UINT32     RegisterIndex;
  UINT64     MmioAddr;
  CS_FCH_AB  *FchAbEntry;

  FchAbEntry = (CS_FCH_AB *) CurrentEntry;
  if (FchAbEntry->Header.SaveReadValue) {
    if (AbIoAddress == 0xFFFF) {
      MmioAddr = 0xFED803E0;
      LibAmdMemRead (AccessWidth16, MmioAddr, &AbIoAddress, NULL);
    }
    RegisterIndex = FchAbEntry->Address + 0xC0000000;
    LibAmdIoWrite (AccessWidth32, AbIoAddress, &RegisterIndex, NULL);
    LibAmdIoRead (AccessWidth32, AbIoAddress + 4, &FchAbEntry->Value, NULL);
  }
  FchAbEntry++;
  return &FchAbEntry->Header;
}
コード例 #10
0
ファイル: FchLib.c プロジェクト: Godkey/coreboot
/** GetRomSigPtr - Reserved **/
VOID*
GetRomSigPtr (
  IN      UINTN               *RomSigPtr,
  IN      AMD_CONFIG_PARAMS   *StdHeader
  )
{
  UINT32   RomPtr;
  UINT32   RomSig;
  UINT16   MswAddr;

  *RomSigPtr = 0;
  MswAddr = 0xFFF0;
  do {
    RomPtr = (MswAddr << 16) + FCH_ROMSIG_BASE_IO;
    LibAmdMemRead (AccessWidth32, (UINT64) RomPtr, &RomSig, StdHeader);
    if (RomSig == FCH_ROMSIG_SIGNATURE) {
      *RomSigPtr = RomPtr;
      break;
    }
    MswAddr <<= 1;
  } while (MswAddr != 0xFE00);
  return RomSigPtr;
}