Date   

回复: [PATCH v2 2/2] Fixed Library references

gaoliming
 

Ken:
Please combine them into one commit. You just need to update the first
patch.

Thanks
Liming

-----邮件原件-----
发件人: kenlautner3@gmail.com <kenlautner3@gmail.com>
发送时间: 2021年6月11日 7:48
收件人: devel@edk2.groups.io
抄送: Jian J Wang <jian.j.wang@intel.com>; Hao A Wu
<hao.a.wu@intel.com>; Zhichao Gao <zhichao.gao@intel.com>; Ray Ni
<ray.ni@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>
主题: [PATCH v2 2/2] Fixed Library references

From: Ken Lautner <kenlautner3@gmail.com>

Changed BdsEntry.c to use Variable Policy instead of Variable Lock
as Variable Lock will be Deprecated eventually

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Kenneth Lautner <kenlautner3@gmail.com>
---
MdeModulePkg/Universal/BdsDxe/BdsDxe.inf | 1 -
MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 2 +-
2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
index 76ff6a0f5fc3..5bac635def93 100644
--- a/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
+++ b/MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
@@ -50,7 +50,6 @@
BaseMemoryLib

DebugLib

UefiBootManagerLib

- VariablePolicyLib

VariablePolicyHelperLib

PlatformBootManagerLib

PcdLib

diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
index 13723bee299b..13c10bdc5bf8 100644
--- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
+++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
@@ -15,7 +15,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include "Bds.h"

#include "Language.h"

#include "HwErrRecSupport.h"

-#include "library/VariablePolicyHelperLib.h"

+#include <Library/VariablePolicyHelperLib.h>



#define SET_BOOT_OPTION_SUPPORT_KEY_COUNT(a, c) { \

(a) = ((a) & ~EFI_BOOT_OPTION_SUPPORT_COUNT) | (((c) <<
LowBitSet32 (EFI_BOOT_OPTION_SUPPORT_COUNT)) &
EFI_BOOT_OPTION_SUPPORT_COUNT); \

--
2.31.1.windows.1


Event: TianoCore Community Meeting - APAC/NAMO - 06/10/2021 #cal-reminder

devel@edk2.groups.io Calendar <noreply@...>
 

Reminder: TianoCore Community Meeting - APAC/NAMO

When:
06/10/2021
7:30pm to 8:30pm
(UTC-07:00) America/Los Angeles

Where:
https://teams.microsoft.com/l/meetup-join/19%3ameeting_ZWNiZWM1MzgtNWEzMy00MTgwLTgwNjAtNWQ1ZWUwZmQzNjVh%40thread.v2/0?context=%7b%22Tid%22%3a%2246c98d88-e344-4ed4-8496-4ed7712e255d%22%2c%22Oid%22%3a%22b286b53a-1218-4db3-bfc9-3d4c5aa7669e%22%7d

Organizer: Soumya Guptha

View Event

Description:

Microsoft Teams meeting

Join on your computer or mobile app

Click here to join the meeting

Join with a video conferencing device

teams@...

Video Conference ID: 119 132 712 6

Alternate VTC dialing instructions

Or call in (audio only)

+1 916-245-6934,,494156131#   United States, Sacramento

Phone Conference ID: 494 156 131#

Find a local number | Reset PIN

Learn More | Meeting options


回复: [PATCH] MdeModulePkg/RegularExpressionDxe: Fix memory assert in FreePool()

gaoliming
 

Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>

-----邮件原件-----
发件人: Nickle Wang <nickle.wang@hpe.com>
发送时间: 2021年6月10日 12:57
收件人: devel@edk2.groups.io
抄送: gaoliming@byosoft.com.cn; jian.j.wang@intel.com;
hao.a.wu@intel.com; Nickle Wang <nickle.wang@hpe.com>
主题: [PATCH] MdeModulePkg/RegularExpressionDxe: Fix memory assert in
FreePool()

Memory buffer that is allocated by malloc() and realloc() will be
shifted by 8 bytes because Oniguruma keeps its memory signature. This 8
bytes shift is not handled while calling free() to release memory. Add
free() function to check Oniguruma signature before release memory
because memory buffer is not touched when using calloc().

Signed-off-by: Nickle Wang <nickle.wang@hpe.com>
---
.../RegularExpressionDxe/OnigurumaUefiPort.c | 19
++++++++++++++++++-
.../RegularExpressionDxe/OnigurumaUefiPort.h | 14 ++------------
2 files changed, 20 insertions(+), 13 deletions(-)

diff --git
a/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.c
b/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.c
index 9aa7b0a68e..5c34324db8 100644
--- a/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.c
+++ b/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.c
@@ -2,7 +2,7 @@


Module to rewrite stdlib references within Oniguruma



- (C) Copyright 2014-2015 Hewlett Packard Enterprise Development LP<BR>

+ (C) Copyright 2014-2021 Hewlett Packard Enterprise Development
LP<BR>

Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>



SPDX-License-Identifier: BSD-2-Clause-Patent

@@ -96,3 +96,20 @@ void* memset (void *dest, char ch, unsigned int count)
return SetMem (dest, count, ch);

}



+void free(void *ptr)

+{

+ VOID *EvalOnce;

+ ONIGMEM_HEAD *PoolHdr;

+

+ EvalOnce = ptr;

+ if (EvalOnce == NULL) {

+ return;

+ }

+

+ PoolHdr = (ONIGMEM_HEAD *)EvalOnce - 1;

+ if (PoolHdr->Signature == ONIGMEM_HEAD_SIGNATURE) {

+ FreePool (PoolHdr);

+ } else {

+ FreePool (EvalOnce);

+ }

+}

diff --git
a/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.h
b/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.h
index 20b75c3361..0bdb7be529 100644
--- a/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.h
+++
b/MdeModulePkg/Universal/RegularExpressionDxe/OnigurumaUefiPort.h
@@ -2,7 +2,7 @@


Module to rewrite stdlib references within Oniguruma



- (C) Copyright 2014-2015 Hewlett Packard Enterprise Development LP<BR>

+ (C) Copyright 2014-2021 Hewlett Packard Enterprise Development
LP<BR>

Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>



SPDX-License-Identifier: BSD-2-Clause-Patent

@@ -46,17 +46,6 @@ typedef INTN intptr_t;
#endif



#define calloc(n,s) AllocateZeroPool((n)*(s))

-

-#define free(p) \

- do { \

- VOID *EvalOnce; \

- \

- EvalOnce = (p); \

- if (EvalOnce != NULL) { \

- FreePool (EvalOnce); \

- } \

- } while (FALSE)

-

#define xmemmove(Dest,Src,Length) CopyMem(Dest,Src,Length)

#define xmemcpy(Dest,Src,Length) CopyMem(Dest,Src,Length)

#define xmemset(Buffer,Value,Length) SetMem(Buffer,Length,Value)

@@ -98,6 +87,7 @@ void* malloc(size_t size);
void* realloc(void *ptr, size_t size);

void* memcpy (void *dest, const void *src, unsigned int count);

void* memset (void *dest, char ch, unsigned int count);

+void free(void *ptr);



#define exit(n) ASSERT(FALSE);



--
2.31.1.windows.1


Event: TianoCore Community Meeting - APAC/NAMO - 06/10/2021 #cal-reminder

devel@edk2.groups.io Calendar <noreply@...>
 

Reminder: TianoCore Community Meeting - APAC/NAMO

When:
06/10/2021
7:30pm to 8:30pm
(UTC-07:00) America/Los Angeles

Where:
https://teams.microsoft.com/l/meetup-join/19%3ameeting_ZWNiZWM1MzgtNWEzMy00MTgwLTgwNjAtNWQ1ZWUwZmQzNjVh%40thread.v2/0?context=%7b%22Tid%22%3a%2246c98d88-e344-4ed4-8496-4ed7712e255d%22%2c%22Oid%22%3a%22b286b53a-1218-4db3-bfc9-3d4c5aa7669e%22%7d

Organizer: Soumya Guptha

View Event

Description:

Microsoft Teams meeting

Join on your computer or mobile app

Click here to join the meeting

Join with a video conferencing device

teams@...

Video Conference ID: 119 132 712 6

Alternate VTC dialing instructions

Or call in (audio only)

+1 916-245-6934,,494156131#   United States, Sacramento

Phone Conference ID: 494 156 131#

Find a local number | Reset PIN

Learn More | Meeting options


Re: [edk2-rfc] [edk2-devel] RFC: design review for TDVF in OVMF

James Bottomley
 

On Thu, 2021-06-10 at 21:38 -0400, James Bottomley wrote:
On Fri, 2021-06-11 at 01:36 +0000, Yao, Jiewen wrote:
Hi James.
I attached the invitation and copied all content below:

==================================
## TOPIC

1. NA

For more info, see here: https://www.tianocore.org/design-meeting/

---
## Microsoft Teams meeting

### Join on your computer or mobile app

[Click here to join the meeting](
https://teams.microsoft.com/l/meetup-join/19%3ameeting_OTNmZTNhMWEtOWQwNi00ZTdkLWI5NDgtYTFmYjNkOWI0ZDg4%40thread.v2/0?context=%7b%22Tid%22%3a%2246c98d88-e344-4ed4-8496-4ed7712e255d%22%2c%22Oid%22%3a%2255d36a50-78be-4ced-bc27-3d06c576cc19%22%7d
)
Apparently it's not possible to join from a web browser: is there a
dial in?
In the absence of a dial in, I'll view the recording. I did most of my
comments in the email thread anyway and I'll be boarding my next flight
soon.

However, next time can we hold meetings with usable web based meeting
technologies, like zoom or webex? It's not feasible to demand
downloading gigabytes of app from a remote location ... even when it
works, which this one doesn't seem to do: the app download just keeps
going back to the meeting screen.

Thanks,

James


Re: [edk2-rfc] [edk2-devel] RFC: design review for TDVF in OVMF

James Bottomley
 

On Fri, 2021-06-11 at 01:36 +0000, Yao, Jiewen wrote:
Hi James.
I attached the invitation and copied all content below:

==================================
## TOPIC

1. NA

For more info, see here: https://www.tianocore.org/design-meeting/

---
## Microsoft Teams meeting

### Join on your computer or mobile app

[Click here to join the meeting](
https://teams.microsoft.com/l/meetup-join/19%3ameeting_OTNmZTNhMWEtOWQwNi00ZTdkLWI5NDgtYTFmYjNkOWI0ZDg4%40thread.v2/0?context=%7b%22Tid%22%3a%2246c98d88-e344-4ed4-8496-4ed7712e255d%22%2c%22Oid%22%3a%2255d36a50-78be-4ced-bc27-3d06c576cc19%22%7d
)
Apparently it's not possible to join from a web browser: is there a
dial in?

James


Re: [edk2-rfc] [edk2-devel] RFC: design review for TDVF in OVMF

Yao, Jiewen
 

Hi James.
I attached the invitation and copied all content below:

==================================
## TOPIC

1. NA

For more info, see here: https://www.tianocore.org/design-meeting/

---
## Microsoft Teams meeting

### Join on your computer or mobile app

[Click here to join the meeting](https://teams.microsoft.com/l/meetup-join/19%3ameeting_OTNmZTNhMWEtOWQwNi00ZTdkLWI5NDgtYTFmYjNkOWI0ZDg4%40thread.v2/0?context=%7b%22Tid%22%3a%2246c98d88-e344-4ed4-8496-4ed7712e255d%22%2c%22Oid%22%3a%2255d36a50-78be-4ced-bc27-3d06c576cc19%22%7d)

### Join with a video conferencing device

teams@conf.intel.com

Video Conference ID: 119 715 416 0

[Alternate VTC dialing instructions](https://conf.intel.com/teams/?conf=1197154160&ivr=teams&d=conf.intel.com&test=test_call)

[Learn More](https://aka.ms/JoinTeamsMeeting) | [Meeting options](https://teams.microsoft.com/meetingOptions/?organizerId=55d36a50-78be-4ced-bc27-3d06c576cc19&tenantId=46c98d88-e344-4ed4-8496-4ed7712e255d&threadId=19_meeting_OTNmZTNhMWEtOWQwNi00ZTdkLWI5NDgtYTFmYjNkOWI0ZDg4@thread.v2&messageId=0&language=en-US)

==================================

-----Original Message-----
From: James Bottomley <jejb@linux.ibm.com>
Sent: Friday, June 11, 2021 9:33 AM
To: Xu, Min M <min.m.xu@intel.com>; devel@edk2.groups.io; Yao, Jiewen
<jiewen.yao@intel.com>; rfc@edk2.groups.io
Cc: Laszlo Ersek <lersek@redhat.com>; Brijesh Singh <brijesh.singh@amd.com>;
Tom Lendacky <thomas.lendacky@amd.com>; erdemaktas@google.com;
cho@microsoft.com; bret.barkelew@microsoft.com; Jon Lange
<jlange@microsoft.com>; Karen Noel <knoel@redhat.com>; Paolo Bonzini
<pbonzini@redhat.com>; Nathaniel McCallum <npmccallum@redhat.com>; Dr.
David Alan Gilbert <dgilbert@redhat.com>; Ademar de Souza Reis Jr.
<areis@redhat.com>
Subject: Re: [edk2-rfc] [edk2-devel] RFC: design review for TDVF in OVMF

On Thu, 2021-06-10 at 22:30 +0000, Xu, Min M wrote:
Hi, All
Thanks much for the valuable comments and discussion about the
design.
We have updated the slides (v0.9) in below link. If some comments or
concerns are not answered/addressed in the new slides, please don't
hesitate to tell us. We do want to answer/address all the
comments/concerns. But to be honest it is a rather complicated one
and we appreciate your feedbacks.
https://edk2.groups.io/g/devel/files/Designs/2021/0611/TDVF_Design_Review
%28v0.9%29.pptx

What's the url of the meeting? Apparently it isn't in the calendar
entry.

James


Re: [edk2-rfc] [edk2-devel] RFC: design review for TDVF in OVMF

James Bottomley
 

On Thu, 2021-06-10 at 22:30 +0000, Xu, Min M wrote:
Hi, All
Thanks much for the valuable comments and discussion about the
design.
We have updated the slides (v0.9) in below link. If some comments or
concerns are not answered/addressed in the new slides, please don't
hesitate to tell us. We do want to answer/address all the
comments/concerns. But to be honest it is a rather complicated one
and we appreciate your feedbacks.
https://edk2.groups.io/g/devel/files/Designs/2021/0611/TDVF_Design_Review%28v0.9%29.pptx
What's the url of the meeting? Apparently it isn't in the calendar
entry.

James


Happening Now: TianoCore Design Meeting - APAC/NAMO - 06/11/2021 #cal-notice

devel@edk2.groups.io Calendar <noreply@...>
 

TianoCore Design Meeting - APAC/NAMO

When:
06/11/2021
9:30am to 10:30am
(UTC+08:00) Asia/Shanghai

Where:
Microsoft Teams

Organizer: Ray Ni ray.ni@...

View Event

Description:

TOPIC

  1. TDX Virtual Firmware (TDVF) Design Review (Min Xu / Intel)

    Slides: https://edk2.groups.io/g/devel/files/Designs/2021/0611/TDVF_Design_Review%28v0.8%29.pptx

For more info, see here: https://www.tianocore.org/design-meeting/


Microsoft Teams meeting

Join on your computer or mobile app

Click here to join the meeting

Join with a video conferencing device

teams@...

Video Conference ID: 119 715 416 0

Alternate VTC dialing instructions

Learn More | Meeting options


Event: TianoCore Design Meeting - APAC/NAMO - 06/11/2021 #cal-reminder

devel@edk2.groups.io Calendar <noreply@...>
 

Reminder: TianoCore Design Meeting - APAC/NAMO

When:
06/11/2021
9:30am to 10:30am
(UTC+08:00) Asia/Shanghai

Where:
Microsoft Teams

Organizer: Ray Ni ray.ni@...

View Event

Description:

TOPIC

  1. TDX Virtual Firmware (TDVF) Design Review (Min Xu / Intel)

    Slides: https://edk2.groups.io/g/devel/files/Designs/2021/0611/TDVF_Design_Review%28v0.8%29.pptx

For more info, see here: https://www.tianocore.org/design-meeting/


Microsoft Teams meeting

Join on your computer or mobile app

Click here to join the meeting

Join with a video conferencing device

teams@...

Video Conference ID: 119 715 416 0

Alternate VTC dialing instructions

Learn More | Meeting options


Re: [edk2-platforms][Patch 2/3] KabylakeSiliconPkg/BaseSmbusLib: Fix SmBusSendByte value

Chiu, Chasel
 

Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>

-----Original Message-----
From: Kinney, Michael D <michael.d.kinney@intel.com>
Sent: Friday, June 11, 2021 6:46 AM
To: devel@edk2.groups.io
Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L
<nathaniel.l.desimone@intel.com>
Subject: [edk2-platforms][Patch 2/3] KabylakeSiliconPkg/BaseSmbusLib: Fix
SmBusSendByte value

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3451

Update SmBusSendByte() to write value to Command Register instead of Host
Data registers.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
.../Pch/Library/BaseSmbusLib/BaseSmbusLib.c | 24 +++++++++++++------
1 file changed, 17 insertions(+), 7 deletions(-)

diff --git
a/Silicon/Intel/KabylakeSiliconPkg/Pch/Library/BaseSmbusLib/BaseSmbusLib.c
b/Silicon/Intel/KabylakeSiliconPkg/Pch/Library/BaseSmbusLib/BaseSmbusLib.c
index 5d09e18613..68dc698aaf 100644
---
a/Silicon/Intel/KabylakeSiliconPkg/Pch/Library/BaseSmbusLib/BaseSmbusLib.c
+++ b/Silicon/Intel/KabylakeSiliconPkg/Pch/Library/BaseSmbusLib/BaseSmbu
+++ sLib.c
@@ -201,14 +201,24 @@ InternalSmBusNonBlock (
HostControl |= B_PCH_SMBUS_PEC_EN;
}
//
- // Set Host Commond Register.
+ // We do not need Data Register for SendByte Command
//
- IoWrite8 (IoPortBaseAddress + R_PCH_SMBUS_HCMD, (UINT8)
SMBUS_LIB_COMMAND (SmBusAddress));
- //
- // Write value to Host Data 0 and Host Data 1 Registers.
- //
- IoWrite8 (IoPortBaseAddress + R_PCH_SMBUS_HD0, (UINT8) Value);
- IoWrite8 (IoPortBaseAddress + R_PCH_SMBUS_HD1, (UINT8) (Value >> 8));
+ if ((HostControl == V_PCH_SMBUS_SMB_CMD_BYTE) && ((SmBusAddress &
BIT0) == B_PCH_SMBUS_WRITE)) {
+ //
+ // Set Host Command Register.
+ //
+ IoWrite8 (IoPortBaseAddress + R_PCH_SMBUS_HCMD, (UINT8)Value); }
+ else {
+ //
+ // Set Host Command Register.
+ //
+ IoWrite8 (IoPortBaseAddress + R_PCH_SMBUS_HCMD, (UINT8)
SMBUS_LIB_COMMAND (SmBusAddress));
+ //
+ // Write value to Host Data 0 and Host Data 1 Registers.
+ //
+ IoWrite8 (IoPortBaseAddress + R_PCH_SMBUS_HD0, (UINT8) Value);
+ IoWrite8 (IoPortBaseAddress + R_PCH_SMBUS_HD1, (UINT8) (Value >>
+ 8)); }
//
// Set Auxiliary Control Regiester.
//
--
2.31.1.windows.1


Re: [edk2-platforms][Patch 1/3] CoffeelakeSiliconPkg/BaseSmbusLib: Fix SmBusSendByte value

Chiu, Chasel
 

Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>

-----Original Message-----
From: Kinney, Michael D <michael.d.kinney@intel.com>
Sent: Friday, June 11, 2021 6:46 AM
To: devel@edk2.groups.io
Cc: Chiu, Chasel <chasel.chiu@intel.com>; Chaganty, Rangasai V
<rangasai.v.chaganty@intel.com>
Subject: [edk2-platforms][Patch 1/3] CoffeelakeSiliconPkg/BaseSmbusLib: Fix
SmBusSendByte value

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3450

Update SmBusSendByte() to write value to Command Register instead of Host
Data registers.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
.../Pch/Library/BaseSmbusLib/BaseSmbusLib.c | 24 +++++++++++++------
1 file changed, 17 insertions(+), 7 deletions(-)

diff --git
a/Silicon/Intel/CoffeelakeSiliconPkg/Pch/Library/BaseSmbusLib/BaseSmbusLib.c
b/Silicon/Intel/CoffeelakeSiliconPkg/Pch/Library/BaseSmbusLib/BaseSmbusLib.c
index 3d6386d433..dacf9d03b2 100644
---
a/Silicon/Intel/CoffeelakeSiliconPkg/Pch/Library/BaseSmbusLib/BaseSmbusLib.c
+++ b/Silicon/Intel/CoffeelakeSiliconPkg/Pch/Library/BaseSmbusLib/BaseSm
+++ busLib.c
@@ -203,14 +203,24 @@ InternalSmBusNonBlock (
AuxiliaryControl |= B_SMBUS_IO_AAC;
}
//
- // Set Host Commond Register.
+ // We do not need Data Register for SendByte Command
//
- IoWrite8 (IoPortBaseAddress + R_SMBUS_IO_HCMD, (UINT8)
SMBUS_LIB_COMMAND (SmBusAddress));
- //
- // Write value to Host Data 0 and Host Data 1 Registers.
- //
- IoWrite8 (IoPortBaseAddress + R_SMBUS_IO_HD0, (UINT8) Value);
- IoWrite8 (IoPortBaseAddress + R_SMBUS_IO_HD1, (UINT8) (Value >> 8));
+ if ((HostControl == V_SMBUS_IO_SMB_CMD_BYTE) && ((SmBusAddress &
BIT0) == B_SMBUS_IO_WRITE)) {
+ //
+ // Set Host Command Register.
+ //
+ IoWrite8 (IoPortBaseAddress + R_SMBUS_IO_HCMD, (UINT8)Value); }
+ else {
+ //
+ // Set Host Command Register.
+ //
+ IoWrite8 (IoPortBaseAddress + R_SMBUS_IO_HCMD, (UINT8)
SMBUS_LIB_COMMAND (SmBusAddress));
+ //
+ // Write value to Host Data 0 and Host Data 1 Registers.
+ //
+ IoWrite8 (IoPortBaseAddress + R_SMBUS_IO_HD0, (UINT8) Value);
+ IoWrite8 (IoPortBaseAddress + R_SMBUS_IO_HD1, (UINT8) (Value >>
+ 8)); }
//
// Set Auxiliary Control Regiester.
//
--
2.31.1.windows.1


Re: [edk2-platforms][Patch 0/3] Fix SmBusSendByte value

Nate DeSimone
 

Hi Mike,

Please remember to update the copyright year on all 3 files. With that change...

Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

-----Original Message-----
From: Kinney, Michael D <michael.d.kinney@intel.com>
Sent: Thursday, June 10, 2021 3:46 PM
To: devel@edk2.groups.io
Cc: Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Chiu, Chasel <chasel.chiu@intel.com>; Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>
Subject: [edk2-platforms][Patch 0/3] Fix SmBusSendByte value

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3452
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3451
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3450

Update SmBusSendByte() to write value to Command Register instead of Host Data registers.

Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>

Michael D Kinney (3):
CoffeelakeSiliconPkg/BaseSmbusLib: Fix SmBusSendByte value
KabylakeSiliconPkg/BaseSmbusLib: Fix SmBusSendByte value
QuarkSocPkg/SmbusLib: Fix SmBusSendByte value

.../Pch/Library/BaseSmbusLib/BaseSmbusLib.c | 24 ++++++++++++-----
.../Pch/Library/BaseSmbusLib/BaseSmbusLib.c | 24 ++++++++++++-----
.../Library/SmbusLib/SmbusLib.c | 27 ++++++++++++-------
3 files changed, 52 insertions(+), 23 deletions(-)

--
2.31.1.windows.1


Re: [edk2][PATCH] MdePkg : Add IPMI Macro and Structure Defintions to resolve the IPMI build error

Oram, Isaac W
 

Please comment the following commenting per normal style
/*----------------------------------------------------------------------------------------
Definitions for Get BMC Execution Context
----------------------------------------------------------------------------------------*/

Which would correctly be:
//
// Definitions for Get BMC Execution Context
//

Please don't use EFI_ or Efi prefix for items that are not part of UEFI owned specifications. Please correct:
EFI_IPMI_MSG_GET_BMC_EXEC_RSP
EFI_FIRMWARE_GET_BMC_EXECUTION_CONTEXT
EFI_FIRMWARE_BMC_IN_FULL_RUNTIME
EFI_FIRMWARE_BMC_IN_FORCED_UPDATE_MODE
and any uses.

Thanks,
Isaac

-----Original Message-----
From: manickavasakam karpagavinayagam <manickavasakamk@ami.com>
Sent: Thursday, June 10, 2021 4:41 PM
To: devel@edk2.groups.io
Cc: Oram, Isaac W <isaac.w.oram@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Felixp@ami.com; DOPPALAPUDI, HARIKRISHNA <harikrishnad@ami.com>; Jha, Manish <manishj@ami.com>; Bobroff, Zachary <zacharyb@ami.com>
Subject: [edk2][PATCH] MdePkg : Add IPMI Macro and Structure Defintions to resolve the IPMI build error

Build error reported for missing structures IPMI_SET_BOOT_OPTIONS_RESPONSE,
EFI_IPMI_MSG_GET_BMC_EXEC_RSP and macros EFI_FIRMWARE_GET_BMC_EXECUTION_CONTEXT
EFI_FIRMWARE_BMC_IN_FULL_RUNTIME/EFI_FIRMWARE_BMC_IN_FORCED_UPDATE_MODE
when using edk2-platforms\Features\Intel\OutOfBandManagement\IpmiFeaturePkg
---
MdePkg/Include/IndustryStandard/IpmiNetFnChassis.h | 4 ++++
MdePkg/Include/IndustryStandard/IpmiNetFnFirmware.h | 19 +++++++++++++++++++
2 files changed, 23 insertions(+)

diff --git a/MdePkg/Include/IndustryStandard/IpmiNetFnChassis.h b/MdePkg/Include/IndustryStandard/IpmiNetFnChassis.h
index 79db55523d..d7cdd3a865 100644
--- a/MdePkg/Include/IndustryStandard/IpmiNetFnChassis.h
+++ b/MdePkg/Include/IndustryStandard/IpmiNetFnChassis.h
@@ -186,6 +186,10 @@ typedef struct {
UINT8 ParameterData[0];

} IPMI_SET_BOOT_OPTIONS_REQUEST;



+typedef struct {

+ UINT8 CompletionCode:8;

+} IPMI_SET_BOOT_OPTIONS_RESPONSE;

+

//

// Definitions for Get System Boot options command

//

diff --git a/MdePkg/Include/IndustryStandard/IpmiNetFnFirmware.h b/MdePkg/Include/IndustryStandard/IpmiNetFnFirmware.h
index 2d892dbd5a..1c692cc792 100644
--- a/MdePkg/Include/IndustryStandard/IpmiNetFnFirmware.h
+++ b/MdePkg/Include/IndustryStandard/IpmiNetFnFirmware.h
@@ -17,4 +17,23 @@
// All Firmware commands and their structure definitions to follow here

//



+/*----------------------------------------------------------------------------------------

+ Definitions for Get BMC Execution Context

+----------------------------------------------------------------------------------------*/

+#define EFI_FIRMWARE_GET_BMC_EXECUTION_CONTEXT 0x23

+

+//

+// Constants and Structure definitions for "Get Device ID" command to follow here

+//

+typedef struct {

+ UINT8 CurrentExecutionContext;

+ UINT8 PartitionPointer;

+} EFI_IPMI_MSG_GET_BMC_EXEC_RSP;

+

+//

+// Current Execution Context responses

+//

+#define EFI_FIRMWARE_BMC_IN_FULL_RUNTIME 0x10

+#define EFI_FIRMWARE_BMC_IN_FORCED_UPDATE_MODE 0x11

+

#endif

--
2.25.0.windows.1


Please consider the environment before printing this email.

The information contained in this message may be confidential and proprietary to American Megatrends (AMI). This communication is intended to be read only by the individual or entity to whom it is addressed or by their designee. If the reader of this message is not the intended recipient, you are on notice that any distribution of this message, in any form, is strictly prohibited. Please promptly notify the sender by reply e-mail or by telephone at 770-246-8600, and then delete or destroy all copies of the transmission.


Re: [edk2-platforms][PATCH] IpmiFeaturePkg: IPMI Transport PPI and Protocol for BIOS/BMC communication

Oram, Isaac W
 

Reviewed-by: Isaac Oram <isaac.w.oram@intel.com>

-----Original Message-----
From: manickavasakam karpagavinayagam <manickavasakamk@ami.com>
Sent: Thursday, June 10, 2021 4:44 PM
To: devel@edk2.groups.io
Cc: Oram, Isaac W <isaac.w.oram@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Felixp@ami.com; DOPPALAPUDI, HARIKRISHNA <harikrishnad@ami.com>; Jha, Manish <manishj@ami.com>; Bobroff, Zachary <zacharyb@ami.com>; KARPAGAVINAYAGAM, MANICKAVASAKAM <manickavasakamk@ami.com>
Subject: [edk2-platforms][PATCH] IpmiFeaturePkg: IPMI Transport PPI and Protocol for BIOS/BMC communication

Enable IPMI Transport PPI and Protocol for BIOS/BMC communication
Add PlatformIpmiIoRangeSet() to enable OEM specific southbridge SIO KCS I/O address range
---
Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.c | 7 ++++++-
Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.inf | 2 ++
Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PostMemory.fdf | 5 +++--
Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PreMemory.fdf | 3 ++-
Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiBaseLib/IpmiBaseLib.inf | 3 +++
Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/PeiIpmiBaseLib/PeiIpmiBaseLib.inf | 3 +++
6 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.c b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.c
index 31f613925d..14040c089c 100644
--- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.c
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.c
@@ -9,7 +9,7 @@
#include <IndustryStandard/Ipmi.h>

#include "PeiGenericIpmi.h"

#include <Library/ReportStatusCodeLib.h>

-

+#include <Library/IpmiPlatformHookLib.h>



///////////////////////////////////////////////////////////////////////////////

// Function Implementations

@@ -48,6 +48,11 @@ PeiInitializeIpmiKcsPhysicalLayer (
// Enable OEM specific southbridge SIO KCS I/O address range 0xCA0 to 0xCAF at here

// if the the I/O address range has not been enabled.

//

+ Status = PlatformIpmiIoRangeSet (PcdGet16 (PcdIpmiIoBaseAddress));

+ DEBUG ((DEBUG_INFO, "IPMI Peim:PlatformIpmiIoRangeSet - %r!\n", Status));

+ if (EFI_ERROR(Status)) {

+ return Status;

+ }



mIpmiInstance = AllocateZeroPool (sizeof (PEI_IPMI_BMC_INSTANCE_DATA));

if (mIpmiInstance == NULL) {

diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.inf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.inf
index 0ef2c18116..883a9168e5 100644
--- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.inf
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.inf
@@ -41,7 +41,9 @@
MemoryAllocationLib

DebugLib

IoLib

+ ReportStatusCodeLib

TimerLib

+ IpmiPlatformHookLib



[Guids]



diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PostMemory.fdf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PostMemory.fdf
index b5b37ddd9f..cbd9453cf0 100644
--- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PostMemory.fdf
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PostMemory.fdf
@@ -7,10 +7,11 @@
#

##



- INF OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/BmcAcpi.inf

+ INF OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/GenericIpmi.inf

+ INF OutOfBandManagement/IpmiFeaturePkg/IpmiInit/DxeIpmiInit.inf

+ INF RuleOverride = DRIVER_ACPITABLE OutOfBandManagement/IpmiFeaturePkg/BmcAcpi/BmcAcpi.inf

INF OutOfBandManagement/IpmiFeaturePkg/BmcElog/BmcElog.inf

INF OutOfBandManagement/IpmiFeaturePkg/Frb/FrbDxe.inf

INF OutOfBandManagement/IpmiFeaturePkg/IpmiFru/IpmiFru.inf

- INF OutOfBandManagement/IpmiFeaturePkg/IpmiInit/DxeIpmiInit.inf

INF OutOfBandManagement/IpmiFeaturePkg/OsWdt/OsWdt.inf

INF OutOfBandManagement/IpmiFeaturePkg/SolStatus/SolStatus.inf

diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PreMemory.fdf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PreMemory.fdf
index 4aa2d8e9da..826490952b 100644
--- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PreMemory.fdf
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/PreMemory.fdf
@@ -7,5 +7,6 @@
#

##



-INF OutOfBandManagement/IpmiFeaturePkg/Frb/FrbPei.inf

+INF OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.inf

INF OutOfBandManagement/IpmiFeaturePkg/IpmiInit/PeiIpmiInit.inf

+INF OutOfBandManagement/IpmiFeaturePkg/Frb/FrbPei.inf

diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiBaseLib/IpmiBaseLib.inf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiBaseLib/IpmiBaseLib.inf
index b429d3b7b9..86df943560 100644
--- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiBaseLib/IpmiBaseLib.inf
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/IpmiBaseLib/IpmiBaseLib.inf
@@ -26,3 +26,6 @@


[Protocols]

gIpmiTransportProtocolGuid

+

+[Depex]

+ gIpmiTransportProtocolGuid

diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/PeiIpmiBaseLib/PeiIpmiBaseLib.inf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/PeiIpmiBaseLib/PeiIpmiBaseLib.inf
index f89614adfb..9a2c87873f 100644
--- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/PeiIpmiBaseLib/PeiIpmiBaseLib.inf
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Library/PeiIpmiBaseLib/PeiIpmiBaseLib.inf
@@ -28,3 +28,6 @@


[Ppis]

gPeiIpmiTransportPpiGuid

+

+[Depex]

+ gPeiIpmiTransportPpiGuid

--
2.25.0.windows.1


Please consider the environment before printing this email.

The information contained in this message may be confidential and proprietary to American Megatrends (AMI). This communication is intended to be read only by the individual or entity to whom it is addressed or by their designee. If the reader of this message is not the intended recipient, you are on notice that any distribution of this message, in any form, is strictly prohibited. Please promptly notify the sender by reply e-mail or by telephone at 770-246-8600, and then delete or destroy all copies of the transmission.


[edk2-platforms][Patch 2/3] KabylakeSiliconPkg/BaseSmbusLib: Fix SmBusSendByte value

Michael D Kinney
 

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3451

Update SmBusSendByte() to write value to Command Register instead of
Host Data registers.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
.../Pch/Library/BaseSmbusLib/BaseSmbusLib.c | 24 +++++++++++++------
1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/Silicon/Intel/KabylakeSiliconPkg/Pch/Library/BaseSmbusLib/BaseSmbusLib.c b/Silicon/Intel/KabylakeSiliconPkg/Pch/Library/BaseSmbusLib/BaseSmbusLib.c
index 5d09e18613..68dc698aaf 100644
--- a/Silicon/Intel/KabylakeSiliconPkg/Pch/Library/BaseSmbusLib/BaseSmbusLib.c
+++ b/Silicon/Intel/KabylakeSiliconPkg/Pch/Library/BaseSmbusLib/BaseSmbusLib.c
@@ -201,14 +201,24 @@ InternalSmBusNonBlock (
HostControl |= B_PCH_SMBUS_PEC_EN;
}
//
- // Set Host Commond Register.
+ // We do not need Data Register for SendByte Command
//
- IoWrite8 (IoPortBaseAddress + R_PCH_SMBUS_HCMD, (UINT8) SMBUS_LIB_COMMAND (SmBusAddress));
- //
- // Write value to Host Data 0 and Host Data 1 Registers.
- //
- IoWrite8 (IoPortBaseAddress + R_PCH_SMBUS_HD0, (UINT8) Value);
- IoWrite8 (IoPortBaseAddress + R_PCH_SMBUS_HD1, (UINT8) (Value >> 8));
+ if ((HostControl == V_PCH_SMBUS_SMB_CMD_BYTE) && ((SmBusAddress & BIT0) == B_PCH_SMBUS_WRITE)) {
+ //
+ // Set Host Command Register.
+ //
+ IoWrite8 (IoPortBaseAddress + R_PCH_SMBUS_HCMD, (UINT8)Value);
+ } else {
+ //
+ // Set Host Command Register.
+ //
+ IoWrite8 (IoPortBaseAddress + R_PCH_SMBUS_HCMD, (UINT8) SMBUS_LIB_COMMAND (SmBusAddress));
+ //
+ // Write value to Host Data 0 and Host Data 1 Registers.
+ //
+ IoWrite8 (IoPortBaseAddress + R_PCH_SMBUS_HD0, (UINT8) Value);
+ IoWrite8 (IoPortBaseAddress + R_PCH_SMBUS_HD1, (UINT8) (Value >> 8));
+ }
//
// Set Auxiliary Control Regiester.
//
--
2.31.1.windows.1


[edk2-platforms][Patch 3/3] QuarkSocPkg/SmbusLib: Fix SmBusSendByte value

Michael D Kinney
 

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3452

Update SmBusSendByte() to write value to Command Register instead of
Host Data registers.

Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
.../Library/SmbusLib/SmbusLib.c | 27 ++++++++++++-------
1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/Silicon/Intel/QuarkSocPkg/QuarkNorthCluster/Library/SmbusLib/SmbusLib.c b/Silicon/Intel/QuarkSocPkg/QuarkNorthCluster/Library/SmbusLib/SmbusLib.c
index 319e103cf4..34437582d4 100644
--- a/Silicon/Intel/QuarkSocPkg/QuarkNorthCluster/Library/SmbusLib/SmbusLib.c
+++ b/Silicon/Intel/QuarkSocPkg/QuarkNorthCluster/Library/SmbusLib/SmbusLib.c
@@ -165,15 +165,24 @@ InternalSmBusNonBlock (
}

//
- // Set Host Commond Register.
+ // We do not need Data Register for SendByte Command
//
- IoWrite8 (IoPortBaseAddress + R_QNC_SMBUS_HCMD, (UINT8) SMBUS_LIB_COMMAND (SmBusAddress));
- //
- // Write value to Host Data 0 and Host Data 1 Registers.
- //
- IoWrite8 (IoPortBaseAddress + R_QNC_SMBUS_HD0, (UINT8) Value);
- IoWrite8 (IoPortBaseAddress + R_QNC_SMBUS_HD1, (UINT8) (Value >> 8));
-
+ if ((HostControl == V_QNC_SMBUS_HCTL_CMD_BYTE) && ((SmBusAddress & BIT0) == V_QNC_SMBUS_RW_SEL_WRITE)) {
+ //
+ // Set Host Command Register.
+ //
+ IoWrite8 (IoPortBaseAddress + R_QNC_SMBUS_HCMD, (UINT8)Value);
+ } else {
+ //
+ // Set Host Command Register.
+ //
+ IoWrite8 (IoPortBaseAddress + R_QNC_SMBUS_HCMD, (UINT8) SMBUS_LIB_COMMAND (SmBusAddress));
+ //
+ // Write value to Host Data 0 and Host Data 1 Registers.
+ //
+ IoWrite8 (IoPortBaseAddress + R_QNC_SMBUS_HD0, (UINT8) Value);
+ IoWrite8 (IoPortBaseAddress + R_QNC_SMBUS_HD1, (UINT8) (Value >> 8));
+ }

//
// Set SMBUS slave address for the device to send/receive from.
@@ -351,7 +360,7 @@ SmBusSendByte (

return (UINT8) InternalSmBusNonBlock (
V_QNC_SMBUS_HCTL_CMD_BYTE,
- SmBusAddress & V_QNC_SMBUS_RW_SEL_WRITE,
+ SmBusAddress | V_QNC_SMBUS_RW_SEL_WRITE,
Value,
Status
);
--
2.31.1.windows.1


[edk2-platforms][Patch 0/3] Fix SmBusSendByte value

Michael D Kinney
 

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3452
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3451
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3450

Update SmBusSendByte() to write value to Command Register instead of
Host Data registers.

Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>

Michael D Kinney (3):
CoffeelakeSiliconPkg/BaseSmbusLib: Fix SmBusSendByte value
KabylakeSiliconPkg/BaseSmbusLib: Fix SmBusSendByte value
QuarkSocPkg/SmbusLib: Fix SmBusSendByte value

.../Pch/Library/BaseSmbusLib/BaseSmbusLib.c | 24 ++++++++++++-----
.../Pch/Library/BaseSmbusLib/BaseSmbusLib.c | 24 ++++++++++++-----
.../Library/SmbusLib/SmbusLib.c | 27 ++++++++++++-------
3 files changed, 52 insertions(+), 23 deletions(-)

--
2.31.1.windows.1


[edk2-platforms][Patch 1/3] CoffeelakeSiliconPkg/BaseSmbusLib: Fix SmBusSendByte value

Michael D Kinney
 

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3450

Update SmBusSendByte() to write value to Command Register instead of
Host Data registers.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
---
.../Pch/Library/BaseSmbusLib/BaseSmbusLib.c | 24 +++++++++++++------
1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/Silicon/Intel/CoffeelakeSiliconPkg/Pch/Library/BaseSmbusLib/BaseSmbusLib.c b/Silicon/Intel/CoffeelakeSiliconPkg/Pch/Library/BaseSmbusLib/BaseSmbusLib.c
index 3d6386d433..dacf9d03b2 100644
--- a/Silicon/Intel/CoffeelakeSiliconPkg/Pch/Library/BaseSmbusLib/BaseSmbusLib.c
+++ b/Silicon/Intel/CoffeelakeSiliconPkg/Pch/Library/BaseSmbusLib/BaseSmbusLib.c
@@ -203,14 +203,24 @@ InternalSmBusNonBlock (
AuxiliaryControl |= B_SMBUS_IO_AAC;
}
//
- // Set Host Commond Register.
+ // We do not need Data Register for SendByte Command
//
- IoWrite8 (IoPortBaseAddress + R_SMBUS_IO_HCMD, (UINT8) SMBUS_LIB_COMMAND (SmBusAddress));
- //
- // Write value to Host Data 0 and Host Data 1 Registers.
- //
- IoWrite8 (IoPortBaseAddress + R_SMBUS_IO_HD0, (UINT8) Value);
- IoWrite8 (IoPortBaseAddress + R_SMBUS_IO_HD1, (UINT8) (Value >> 8));
+ if ((HostControl == V_SMBUS_IO_SMB_CMD_BYTE) && ((SmBusAddress & BIT0) == B_SMBUS_IO_WRITE)) {
+ //
+ // Set Host Command Register.
+ //
+ IoWrite8 (IoPortBaseAddress + R_SMBUS_IO_HCMD, (UINT8)Value);
+ } else {
+ //
+ // Set Host Command Register.
+ //
+ IoWrite8 (IoPortBaseAddress + R_SMBUS_IO_HCMD, (UINT8) SMBUS_LIB_COMMAND (SmBusAddress));
+ //
+ // Write value to Host Data 0 and Host Data 1 Registers.
+ //
+ IoWrite8 (IoPortBaseAddress + R_SMBUS_IO_HD0, (UINT8) Value);
+ IoWrite8 (IoPortBaseAddress + R_SMBUS_IO_HD1, (UINT8) (Value >> 8));
+ }
//
// Set Auxiliary Control Regiester.
//
--
2.31.1.windows.1


Re: [PATCH 1/1] ArmPkg: Move cache defs used in Universal/Smbios into ArmLib.h

Rebecca Cran
 

On 6/10/21 9:04 AM, Ard Biesheuvel wrote:
On Tue, 8 Jun 2021 at 15:54, Rebecca Cran <rebecca@nuviainc.com> wrote:
Many of the cache definitions in ArmLibPrivate.h are being used outside
of ArmLib, in Universal/Smbios. Move them into ArmLib.h to make them
public, and remove the include of ArmLibPrivate.h from files in
Universal/Smbios.

Signed-off-by: Rebecca Cran <rebecca@nuviainc.com>
Hi Rebecca,

If these definitions describe anything more than the software
interface exposed by the library, they really belong under
IndustryStandard/ not Library.

It looks like I'd need to create a new file under ArmPkg/Include/IndustryStandard since the existing files don't look appropriate. I was wondering if a filename like ArmCache.h would be good?


--

Rebecca Cran

4501 - 4520 of 80786