From b7c51c9cf4864df6aabb99a1ae843becd577237c Mon Sep 17 00:00:00 2001 From: raywu Date: Fri, 15 Jun 2018 00:00:50 +0800 Subject: init. 1AQQW051 --- Board/CPU/CpuPeiDebugger.c | 99 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 Board/CPU/CpuPeiDebugger.c (limited to 'Board/CPU/CpuPeiDebugger.c') diff --git a/Board/CPU/CpuPeiDebugger.c b/Board/CPU/CpuPeiDebugger.c new file mode 100644 index 0000000..de14bfe --- /dev/null +++ b/Board/CPU/CpuPeiDebugger.c @@ -0,0 +1,99 @@ +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1987-2013, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* + +//********************************************************************** +// +// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/Haswell/AMI Cpu PKG/CPU Board/CpuPeiDebugger.c 1 2/07/12 3:57a Davidhsieh $ +// +// $Revision: 1 $ +// +// $Date: 2/07/12 3:57a $ +// +//***************************************************************************** +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/Haswell/AMI Cpu PKG/CPU Board/CpuPeiDebugger.c $ +// +// 1 2/07/12 3:57a Davidhsieh +// +//***************************************************************************** + +// +//---------------------------------------------------------------------------- +// +// Name: CpuPeiDebugger.C +// +// Description: +// This file contains PEI stage board component code for Template CPU module +// +//---------------------------------------------------------------------------- +// +#include +#include +#include +#include "AmiDebugPort.h" +#include "CpuCspLib.h" + +// +//---------------------------------------------------------------------------- +// Procedure: CPUPEIDBG_Initialize +// +// Description: +// This eLink function is used to initialize CPU for PEI debugger support +// +// Input: DbgXportIfStruc Debug transport interface structure +// +// Output: EFI_STATUS +// +// Notes: PORTING REQUIRED +//---------------------------------------------------------------------------- +// + +EFI_STATUS +CPUPEIDBG_Initialize ( + PEI_DBG_PORT_INFO *DebugPort +) +{ + MemReadWrite32((UINT32*)(UINTN)(LOCAL_APIC_BASE + APIC_SPURIOUS_VECTOR_REGISTER), 1 << 8, 0xffffffff); + + //-------------------------- + //Program Virtual Wire Mode. + //-------------------------- + + //Program LINT0 vector as ExtInt + MemReadWrite32((UINT32*)(UINTN)(LOCAL_APIC_BASE + APIC_LVT_LINT0_REGISTER), + 0x700, 0xfffe00ff + ); + + //Program the LINT1 vector entry as NMI + MemReadWrite32((UINT32*)(UINTN)(LOCAL_APIC_BASE + APIC_LVT_LINT1_REGISTER), + 0x10400, 0xfffe00ff + ); + + return EFI_SUCCESS; +} + +//************************************************************************* +//************************************************************************* +//** ** +//** (C)Copyright 1987-2013, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//************************************************************************* +//************************************************************************* -- cgit v1.2.3