From: "Kubacki, Michael A" <michael.a.kubacki@intel.com>
To: "Agyeman, Prince" <prince.agyeman@intel.com>,
"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Sinha, Ankit" <ankit.sinha@intel.com>,
"Desimone, Nathaniel L" <nathaniel.l.desimone@intel.com>
Subject: Re: [edk2-platforms] [PATCH] SimicsOpenBoardPkg: Add CmosAccessLib to BoardX58Ich10
Date: Thu, 31 Oct 2019 07:22:14 +0000 [thread overview]
Message-ID: <BYAPR11MB3831A04F5B5DCA42AF3652E3B5630@BYAPR11MB3831.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20191029222719.13912-1-prince.agyeman@intel.com>
I still see custom implementation of CMOS functions and usage of those
functions in SimicsOpenBoardPkg. Examples:
1. Platform\Intel\SimicsOpenBoardPkg\BoardX58Ich10\Library\BoardInitLib\PeiX58Ich10InitPreMemLib.c:
* CmosRead8 ()
* CmosWrite8 ()
2. Platform\Intel\SimicsOpenBoardPkg\SimicsPei\MemDetect.c:
* CmosRead8 ()
3. Platform\Intel\SimicsOpenBoardPkg\SimicsPei\Platform.c:
* CmosRead8 ()
4. Platform\Intel\SimicsOpenBoardPkg\SmbiosPlatformDxe\SmbiosPlatformDxe.c:
* CmosRead8 ()
Can you please check these and clean any other CMOS usage that is handled by the library?
Thanks,
Michael
> -----Original Message-----
> From: Agyeman, Prince <prince.agyeman@intel.com>
> Sent: Tuesday, October 29, 2019 3:27 PM
> To: devel@edk2.groups.io
> Cc: Sinha, Ankit <ankit.sinha@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>; Kubacki, Michael A
> <michael.a.kubacki@intel.com>
> Subject: [edk2-platforms] [PATCH] SimicsOpenBoardPkg: Add CmosAccessLib
> to BoardX58Ich10
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2164
>
> Replaced Cmos.c and Cmos.h with BoardModulePkg's Cmos library
> CmosAccessLib
>
> Cc: Ankit Sinha <ankit.sinha@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Kubacki Michael A <michael.a.kubacki@intel.com>
>
> Signed-off-by: Prince Agyeman <prince.agyeman@intel.com>
> ---
> .../BoardX58Ich10/OpenBoardPkg.dsc | 2 +
> .../Intel/SimicsOpenBoardPkg/SimicsPei/Cmos.c | 57 -------------------
> .../Intel/SimicsOpenBoardPkg/SimicsPei/Cmos.h | 50 ----------------
> .../SimicsOpenBoardPkg/SimicsPei/MemDetect.c | 4 +-
> .../SimicsOpenBoardPkg/SimicsPei/Platform.c | 4 +-
> .../SimicsPei/SimicsPei.inf | 3 +-
> 6 files changed, 8 insertions(+), 112 deletions(-) delete mode 100644
> Platform/Intel/SimicsOpenBoardPkg/SimicsPei/Cmos.c
> delete mode 100644 Platform/Intel/SimicsOpenBoardPkg/SimicsPei/Cmos.h
>
> diff --git
> a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
> b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
> index 4f8ab4170d..67f1680a4f 100644
> ---
> a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
> +++
> b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
> @@ -115,6 +115,8 @@
>
> SerializeVariablesLib|$(BOARD_PKG)/Library/SerializeVariablesLib/SerializeV
> ariablesLib.inf
>
> SiliconPolicyInitLib|$(BOARD_PKG)/Policy/Library/SiliconPolicyInitLib/SiliconP
> olicyInitLib.inf
>
> SiliconPolicyUpdateLib|$(BOARD_PKG)/Policy/Library/SiliconPolicyUpdateLib
> /SiliconPolicyUpdateLib.inf
> +
> +
> PlatformCmosAccessLib|BoardModulePkg/Library/PlatformCmosAccessLibN
> ull
> + /PlatformCmosAccessLibNull.inf
> +
> CmosAccessLib|BoardModulePkg/Library/CmosAccessLib/CmosAccessLib.inf
>
> [LibraryClasses.common.SEC]
> #######################################
> diff --git a/Platform/Intel/SimicsOpenBoardPkg/SimicsPei/Cmos.c
> b/Platform/Intel/SimicsOpenBoardPkg/SimicsPei/Cmos.c
> deleted file mode 100644
> index b34ba9283b..0000000000
> --- a/Platform/Intel/SimicsOpenBoardPkg/SimicsPei/Cmos.c
> +++ /dev/null
> @@ -1,57 +0,0 @@
> -/** @file
> - PC/AT CMOS access routines
> -
> - Copyright (c) 2006 - 2019 Intel Corporation. All rights reserved. <BR>
> -
> - SPDX-License-Identifier: BSD-2-Clause-Patent -**/
> -
> -#include "Cmos.h"
> -#include "Library/IoLib.h"
> -
> -/**
> - Reads 8-bits of CMOS data.
> -
> - Reads the 8-bits of CMOS data at the location specified by Index.
> - The 8-bit read value is returned.
> -
> - @param Index The CMOS location to read.
> -
> - @return The value read.
> -
> -**/
> -UINT8
> -EFIAPI
> -CmosRead8 (
> - IN UINTN Index
> - )
> -{
> - IoWrite8 (0x70, (UINT8) Index);
> - return IoRead8 (0x71);
> -}
> -
> -
> -/**
> - Writes 8-bits of CMOS data.
> -
> - Writes 8-bits of CMOS data to the location specified by Index
> - with the value specified by Value and returns Value.
> -
> - @param Index The CMOS location to write.
> - @param Value The value to write to CMOS.
> -
> - @return The value written to CMOS.
> -
> -**/
> -UINT8
> -EFIAPI
> -CmosWrite8 (
> - IN UINTN Index,
> - IN UINT8 Value
> - )
> -{
> - IoWrite8 (0x70, (UINT8) Index);
> - IoWrite8 (0x71, Value);
> - return Value;
> -}
> -
> diff --git a/Platform/Intel/SimicsOpenBoardPkg/SimicsPei/Cmos.h
> b/Platform/Intel/SimicsOpenBoardPkg/SimicsPei/Cmos.h
> deleted file mode 100644
> index 07fa2e2d11..0000000000
> --- a/Platform/Intel/SimicsOpenBoardPkg/SimicsPei/Cmos.h
> +++ /dev/null
> @@ -1,50 +0,0 @@
> -/** @file
> - PC/AT CMOS access routines
> -
> - Copyright (c) 2006 - 2019 Intel Corporation. All rights reserved. <BR>
> -
> - SPDX-License-Identifier: BSD-2-Clause-Patent -**/
> -
> -#ifndef __CMOS_H__
> -#define __CMOS_H__
> -
> -/**
> - Reads 8-bits of CMOS data.
> -
> - Reads the 8-bits of CMOS data at the location specified by Index.
> - The 8-bit read value is returned.
> -
> - @param Index The CMOS location to read.
> -
> - @return The value read.
> -
> -**/
> -UINT8
> -EFIAPI
> -CmosRead8 (
> - IN UINTN Index
> - );
> -
> -/**
> - Writes 8-bits of CMOS data.
> -
> - Writes 8-bits of CMOS data to the location specified by Index
> - with the value specified by Value and returns Value.
> -
> - @param Index The CMOS location to write.
> - @param Value The value to write to CMOS.
> -
> - @return The value written to CMOS.
> -
> -**/
> -UINT8
> -EFIAPI
> -CmosWrite8 (
> - IN UINTN Index,
> - IN UINT8 Value
> - );
> -
> -
> -#endif
> -
> diff --git a/Platform/Intel/SimicsOpenBoardPkg/SimicsPei/MemDetect.c
> b/Platform/Intel/SimicsOpenBoardPkg/SimicsPei/MemDetect.c
> index ee0eead5a8..4d16fd2fac 100644
> --- a/Platform/Intel/SimicsOpenBoardPkg/SimicsPei/MemDetect.c
> +++ b/Platform/Intel/SimicsOpenBoardPkg/SimicsPei/MemDetect.c
> @@ -22,11 +22,11 @@
> #include <Library/PeimEntryPoint.h>
> #include <Library/ResourcePublicationLib.h>
> #include <Library/MtrrLib.h>
> +#include <Library/CmosAccessLib.h>
> #include <SimicsPlatforms.h>
> #include <Guid/SmramMemoryReserve.h>
>
> #include "Platform.h"
> -#include "Cmos.h"
>
> UINT8 mPhysMemAddressWidth;
>
> @@ -105,7 +105,7 @@ GetSystemMemorySizeAbove4gb (
> )
> {
> UINT32 Size;
> - UINTN CmosIndex;
> + UINT8 CmosIndex;
>
> //
> // CMOS 0x5b-0x5d specifies the system memory above 4GB MB.
> diff --git a/Platform/Intel/SimicsOpenBoardPkg/SimicsPei/Platform.c
> b/Platform/Intel/SimicsOpenBoardPkg/SimicsPei/Platform.c
> index 7568d25c4e..0bec76e496 100644
> --- a/Platform/Intel/SimicsOpenBoardPkg/SimicsPei/Platform.c
> +++ b/Platform/Intel/SimicsOpenBoardPkg/SimicsPei/Platform.c
> @@ -22,13 +22,13 @@
> #include <Library/PeimEntryPoint.h>
> #include <Library/PeiServicesLib.h>
> #include <Library/ResourcePublicationLib.h>
> +#include <Library/CmosAccessLib.h>
> #include <Guid/MemoryTypeInformation.h> #include
> <Ppi/MasterBootMode.h> #include <IndustryStandard/Pci22.h> #include
> <SimicsPlatforms.h>
>
> #include "Platform.h"
> -#include "Cmos.h"
>
> EFI_MEMORY_TYPE_INFORMATION mDefaultMemoryTypeInformation[] = {
> { EfiACPIMemoryNVS, 0x004 },
> @@ -524,7 +524,7 @@ DebugDumpCmos (
> VOID
> )
> {
> - UINT32 Loop;
> + UINT8 Loop;
>
> DEBUG ((EFI_D_INFO, "CMOS:\n"));
>
> diff --git a/Platform/Intel/SimicsOpenBoardPkg/SimicsPei/SimicsPei.inf
> b/Platform/Intel/SimicsOpenBoardPkg/SimicsPei/SimicsPei.inf
> index 9499d2aad5..710fa680be 100644
> --- a/Platform/Intel/SimicsOpenBoardPkg/SimicsPei/SimicsPei.inf
> +++ b/Platform/Intel/SimicsOpenBoardPkg/SimicsPei/SimicsPei.inf
> @@ -23,7 +23,6 @@
> #
>
> [Sources]
> - Cmos.c
> FeatureControl.c
> MemDetect.c
> Platform.c
> @@ -36,6 +35,7 @@
> MinPlatformPkg/MinPlatformPkg.dec
> SimicsX58SktPkg/SktPkg.dec
> SimicsIch10Pkg/Ich10Pkg.dec
> + BoardModulePkg/BoardModulePkg.dec
>
> [Guids]
> gEfiMemoryTypeInformationGuid
> @@ -53,6 +53,7 @@
> PeimEntryPoint
> MtrrLib
> PcdLib
> + CmosAccessLib
>
> [Pcd]
> gSimicsOpenBoardPkgTokenSpaceGuid.PcdSimicsPeiMemFvBase
> --
> 2.19.1.windows.1
prev parent reply other threads:[~2019-10-31 7:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-29 22:27 [edk2-platforms] [PATCH] SimicsOpenBoardPkg: Add CmosAccessLib to BoardX58Ich10 Agyeman, Prince
2019-10-31 1:22 ` Nate DeSimone
2019-10-31 7:22 ` Kubacki, Michael A [this message]
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=BYAPR11MB3831A04F5B5DCA42AF3652E3B5630@BYAPR11MB3831.namprd11.prod.outlook.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