public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Gary Lin <glin@suse.com>
To: edk2-devel@lists.01.org
Cc: David Wei <david.wei@intel.com>
Subject: [PATCH v2 11/19] Vlv2DeviceRefCodePkg/ValleyView2Soc: Remove the unused code
Date: Fri, 29 Jul 2016 11:25:30 +0800	[thread overview]
Message-ID: <20160729032538.17730-12-glin@suse.com> (raw)
In-Reply-To: <20160729032538.17730-1-glin@suse.com>

The code in _S3SUPPORT_ in PchAccess.h wasn't used in anywhere. Also,
The declaration of MCRX and MCR made gcc generate the error of
"multiple definition". Just remove the unused code to avoid any
potential issue.

Cc: David Wei <david.wei@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
---
 .../SouthCluster/Include/PchAccess.h               | 49 ----------------------
 1 file changed, 49 deletions(-)

diff --git a/Vlv2DeviceRefCodePkg/ValleyView2Soc/SouthCluster/Include/PchAccess.h b/Vlv2DeviceRefCodePkg/ValleyView2Soc/SouthCluster/Include/PchAccess.h
index 3f44d2b..d080e1b 100644
--- a/Vlv2DeviceRefCodePkg/ValleyView2Soc/SouthCluster/Include/PchAccess.h
+++ b/Vlv2DeviceRefCodePkg/ValleyView2Soc/SouthCluster/Include/PchAccess.h
@@ -474,53 +474,4 @@ typedef struct _PCH_MSG_BUS_TABLE_STRUCT {
   UINT32      WriteOpCode;
 } PCH_MSG_BUS_TABLE_STRUCT_TABLE_STRUCT;
 
-#ifndef _S3SUPPORT_
-#define _S3SUPPORT_
-UINTN MCRX;
-UINTN MCR;
-//
-// In S3 execute, we should follow the MSG BUS access procedure to restore the saving data.
-// To do so, we adopt READ ->> SAVE
-// Indirect IO access: (According BayTrail-M EDS chapter 3.6)
-// 1. Write Index port into MSG BUS_MCRX first.
-// 2. Write content to data register which is called MSG BUS_MDR.
-// 3. Send "message bus control" to complete the procedure.
-//
-#define S3BootScriptSaveMsgBusToMemWrite(PortId, Register, Dbuff, ReadOpCode, WriteOpCode) \
-{ \
-  MCRX = (UINTN) Register & MSGBUS_MASKHI; \
-  MCR = (UINTN) ((ReadOpCode << 24) | (PortId << 16) | ((Register & MSGBUS_MASKLO) << 8) | MESSAGE_DWORD_EN); \
-  MmioWrite32 ((UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MCRX), (UINT32) MCRX); \
-  S3BootScriptSaveMemWrite(EfiBootScriptWidthUint32, (UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MCRX),1, (VOID *) (UINTN) &MCRX); \
-  MmioWrite32 ((UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MCR ), (UINT32) MCR); \
-  (Dbuff) = (UINT32) MmioRead32 ((UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MDR)); \
-  S3BootScriptSaveMemWrite(EfiBootScriptWidthUint32, (UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MDR),1, (VOID *) &Dbuff); \
-  MCR = (UINTN) ((WriteOpCode << 24) | (PortId << 16) | ((Register & MSGBUS_MASKLO) << 8) | MESSAGE_DWORD_EN); \
-  S3BootScriptSaveMemWrite(EfiBootScriptWidthUint32, (UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MCR),1, (VOID *) (UINTN) &MCR); \
-}
-
-//
-// This macro combines two function:  1. PchMsgBusAndThenOr32 ()  2. S3 boot script save
-//
-#define PchMsgBusAndThenOr32AddToS3Save(PortId, Register, Dbuff, AndData, OrData, ReadOpCode, WriteOpCode) \
-{ \
-  MmioWrite32 ((UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MCRX), (UINT32) (Register & MSGBUS_MASKHI)); \
-  MmioWrite32 ((UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MCR ), (UINT32) ((ReadOpCode << 24) | (PortId << 16) | ((Register & MSGBUS_MASKLO) << 8) | MESSAGE_DWORD_EN)); \
-  (Dbuff) = (UINT32) MmioRead32 ((UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MDR)); \
-  MmioWrite32 ((UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MCRX), (UINT32) (Register & MSGBUS_MASKHI)); \
-  MmioWrite32 ((UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MDR ), (UINT32) ((Dbuff & AndData) | OrData)); \
-  MmioWrite32 ((UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MCR ), (UINT32) ((WriteOpCode << 24) | (PortId << 16) | ((Register & MSGBUS_MASKLO) << 8) | MESSAGE_DWORD_EN)); \
-  MCRX = (UINTN) Register & MSGBUS_MASKHI; \
-  MCR = (UINTN) ((ReadOpCode << 24) | (PortId << 16) | ((Register & MSGBUS_MASKLO) << 8) | MESSAGE_DWORD_EN); \
-  MmioWrite32 ((UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MCRX), (UINT32) MCRX); \
-  S3BootScriptSaveMemWrite(EfiBootScriptWidthUint32, (UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MCRX),1,(VOID *) (UINTN) &MCRX); \
-  MmioWrite32 ((UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MCR ), (UINT32) MCR); \
-  (Dbuff) = (UINT32) MmioRead32 ((UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MDR)); \
-  S3BootScriptSaveMemWrite(EfiBootScriptWidthUint32, (UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MDR),1,(VOID *) &Dbuff); \
-  MCR = (UINTN) ((WriteOpCode << 24) | (PortId << 16) | ((Register & MSGBUS_MASKLO) << 8) | MESSAGE_DWORD_EN); \
-  S3BootScriptSaveMemWrite(EfiBootScriptWidthUint32, (UINTN) (PatchPcdGet64 (PcdPciExpressBaseAddress) + MC_MCR),1,(VOID *) (UINTN) &MCR); \
-}
-
-#endif
-
 #endif
-- 
2.9.2



  parent reply	other threads:[~2016-07-29  3:26 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-29  3:25 [PATCH v2 00/19] Fix Vlv2TbltDevicePkg gcc build Gary Lin
2016-07-29  3:25 ` [PATCH v2 01/19] Vlv2TbltDevicePkg: Amend the build script Gary Lin
2016-07-29  3:25 ` [PATCH v2 02/19] Vlv2TbltDevicePkg: Only define MDEPKG_NDEBUG for gcc release build Gary Lin
2016-07-29  7:42   ` Laszlo Ersek
2016-07-29  3:25 ` [PATCH v2 03/19] Vlv2TbltDevicePkg/MultiPlatformLib: Remove the unused variables Gary Lin
2016-07-29  3:25 ` [PATCH v2 04/19] Vlv2TbltDevicePkg/PlatformPei: Remove the unused variable Gary Lin
2016-07-29  3:25 ` [PATCH v2 05/19] Vlv2TbltDevicePkg/PlatformBdsLib: " Gary Lin
2016-07-29  3:25 ` [PATCH v2 06/19] Vlv2TbltDevicePkg/PlatformInitPei: Remove the unused variables Gary Lin
2016-07-29  3:25 ` [PATCH v2 07/19] Vlv2TbltDevicePkg/PlatformInitPei: Suppress the gcc error message Gary Lin
2016-07-29  3:25 ` [PATCH v2 08/19] Vlv2TbltDevicePkg/AcpiPlatform: Remove unused variables Gary Lin
2016-07-29  3:25 ` [PATCH v2 09/19] Vlv2TbltDevicePkg/AcpiPlatform: Amend the declaration of mGlobalNvsArea Gary Lin
2016-07-29  3:25 ` [PATCH v2 10/19] Vlv2TbltDevicePkg/PlatformGopPolicy: include UefiBootServicesTableLib.h Gary Lin
2016-07-29  3:25 ` Gary Lin [this message]
2016-07-29  3:25 ` [PATCH v2 12/19] Vlv2TbltDevicePkg/FvbRuntimeDxe: Remove unused variables Gary Lin
2016-07-29  3:25 ` [PATCH v2 13/19] Vlv2TbltDevicePkg/PlatformSetupDxe: Remove the " Gary Lin
2016-07-29  3:25 ` [PATCH v2 14/19] Vlv2TbltDevicePkg/VlvPlatformInitDxe: Remove " Gary Lin
2016-07-29  3:25 ` [PATCH v2 15/19] Vlv2TbltDevicePkg/PlatformDxe: Remove the " Gary Lin
2016-07-29  3:25 ` [PATCH v2 16/19] Vlv2TbltDevicePkg/Wpce791: Remove the unused variable Gary Lin
2016-07-29  3:25 ` [PATCH v2 17/19] Vlv2TbltDevicePkg/SmBiosMiscDxe: Remove unused variables Gary Lin
2016-07-29  3:25 ` [PATCH v2 18/19] Vlv2TbltDevicePkg/PpmPolicy: Remove the usage of global variables Gary Lin
2016-07-29  3:25 ` [PATCH v2 19/19] Vlv2TbltDevicePkg/PpmPolicy: Remove the unused variable Gary Lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160729032538.17730-12-glin@suse.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox