[PATCH v2] SpcrFeaturePkg: Modify PCI device interrupt setting.


Tan, Ming
 

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

The original code will cause FWTS V21.08.00 testing failed.
spcr: SPCR PC-AT compatible IRQ 0xff is invalid
spcr: SPCR PCI flags compatibility bit 0 is 0, expecting 1 for PCI device

Now modify the SpcrAcpi for following:
1. Disable the support of PC-AT compatible IRQ support.
Now only support IO-APIC interrupt type.
2. Set irq to 0.
3. Set the GSI to the value read from PCI device cfg space 0x3C.
4. Set PCI Flags to 1.

Signed-off-by: Ming Tan <ming.tan@intel.com>
---
V2: Fix a typo

.../SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/=
SpcrAcpi.c b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/=
SpcrAcpi.c
index 86c40e90b8..7ad0c058c8 100644
--- a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcp=
i.c
+++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcp=
i.c
@@ -324,7 +324,9 @@ GetPciTypeInfo (
}=0D
=0D
gSpcrInfo.BaseAddress.Address =3D BaseAddress;=0D
- gSpcrInfo.Irq =3D (UINT8) Irq;=0D
+ gSpcrInfo.InterruptType =3D EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TAB=
LE_INTERRUPT_TYPE_APIC;=0D
+ gSpcrInfo.Irq =3D 0;=0D
+ gSpcrInfo.GlobalSystemInterrupt =3D (UINT32)Irq;=0D
=0D
gSpcrInfo.PciDeviceId =3D DeviceId;=0D
gSpcrInfo.PciVendorId =3D VendorId;=0D
@@ -332,6 +334,7 @@ GetPciTypeInfo (
gSpcrInfo.PciDeviceNumber =3D (UINT8) Device;=0D
gSpcrInfo.PciFunctionNumber =3D (UINT8) Function;=0D
gSpcrInfo.PciSegment =3D (UINT8) SegNum;=0D
+ gSpcrInfo.PciFlags =3D 1;=0D
=0D
Done:=0D
if (Resources !=3D NULL) {=0D
--=20
2.29.2.windows.3


Tan, Ming
 

Abdul:
The following are the testing result using FWTS 21.08.00:
spcr: SPCR Serial Port Console Redirection Table test.
--------------------------------------------------------------------------------
Test 1 of 3: SPCR Serial Port Console Redirection Table test.
Serial Interface: 16550 compatible
Baud Rate: 115200
Terminal Type: VT100
PASSED: Test 1, No issues found in SPCR table.

Test 2 of 3: SPCR Revision Test.

Test 3 of 3: SPCR GSIV Interrupt Test.

================================================================================
1 passed, 0 failed, 0 warning, 0 aborted, 0 skipped, 0 info only.
================================================================================

The following are currently code without my patch using FWTS 21.08.00:
spcr: SPCR Serial Port Console Redirection Table test.
--------------------------------------------------------------------------------
Test 1 of 3: SPCR Serial Port Console Redirection Table test.
Serial Interface: 16550 compatible
FAILED [HIGH] SPCRIllegalIRQ: Test 1, SPCR PC-AT compatible IRQ 0xff is invalid
Baud Rate: 115200
Terminal Type: VT100
FAILED [HIGH] SPCRPciFlagsBit0: Test 1, SPCR PCI flags compatibility bit 0 is 0,
expecting 1 for PCI device

Test 2 of 3: SPCR Revision Test.

Test 3 of 3: SPCR GSIV Interrupt Test.

================================================================================
0 passed, 2 failed, 0 warning, 0 aborted, 0 skipped, 0 info only.
================================================================================

BR/Tan Ming.

-----Original Message-----
From: Attar, AbdulLateef (Abdul Lateef) <AbdulLateef.Attar@amd.com>
Sent: Thursday, November 4, 2021 1:22 PM
To: devel@edk2.groups.io; Tan, Ming <ming.tan@intel.com>
Subject: RE: [edk2-devel] [PATCH v2] SpcrFeaturePkg: Modify PCI device interrupt setting.

[Public]

Code changes looks good.

Is fwts passing now? I think FWTS has wrong test case.
It expects Global system interrupt number to be zero for APIC interrupt type, which is wrong.
In my opinion it should check for Global system interrupt number for zero in case of PC-AT interrupt type.

Thanks
AbduL

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Tan, Ming via groups.io
Sent: Wednesday, October 27, 2021 12:27 PM
To: devel@edk2.groups.io
Subject: [edk2-devel] [PATCH v2] SpcrFeaturePkg: Modify PCI device interrupt setting.

[CAUTION: External Email]

REF: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3708&;data=04%7C01%7CAbdulLateef.Attar%40amd.com%7Cb53806998fbe4d20cfc008d99917110f%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637709147065715846%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=rvzXQBpKAzzWr0VGZZoCJyVcJBhOvzvlbdrxzEe1KQk%3D&amp;reserved=0

The original code will cause FWTS V21.08.00 testing failed.
spcr: SPCR PC-AT compatible IRQ 0xff is invalid
spcr: SPCR PCI flags compatibility bit 0 is 0, expecting 1 for PCI device

Now modify the SpcrAcpi for following:
1. Disable the support of PC-AT compatible IRQ support.
Now only support IO-APIC interrupt type.
2. Set irq to 0.
3. Set the GSI to the value read from PCI device cfg space 0x3C.
4. Set PCI Flags to 1.

Signed-off-by: Ming Tan <ming.tan@intel.com>
---
V2: Fix a typo

.../SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c
index 86c40e90b8..7ad0c058c8 100644
--- a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c
+++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr
+++ Acpi.c
@@ -324,7 +324,9 @@ GetPciTypeInfo (
}



gSpcrInfo.BaseAddress.Address = BaseAddress;

- gSpcrInfo.Irq = (UINT8) Irq;

+ gSpcrInfo.InterruptType =
+ EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_APIC;

+ gSpcrInfo.Irq = 0;

+ gSpcrInfo.GlobalSystemInterrupt = (UINT32)Irq;



gSpcrInfo.PciDeviceId = DeviceId;

gSpcrInfo.PciVendorId = VendorId;

@@ -332,6 +334,7 @@ GetPciTypeInfo (
gSpcrInfo.PciDeviceNumber = (UINT8) Device;

gSpcrInfo.PciFunctionNumber = (UINT8) Function;

gSpcrInfo.PciSegment = (UINT8) SegNum;

+ gSpcrInfo.PciFlags = 1;



Done:

if (Resources != NULL) {

--
2.29.2.windows.3



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#82732): https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Fmessage%2F82732&;data=04%7C01%7CAbdulLateef.Attar%40amd.com%7Cb53806998fbe4d20cfc008d99917110f%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637709147065715846%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=m6rywrR9G355hZ1IHgi5XCtuYpK52Fu19aQaGZFBtbA%3D&amp;reserved=0
Mute This Topic: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.io%2Fmt%2F86622293%2F6129197&;data=04%7C01%7CAbdulLateef.Attar%40amd.com%7Cb53806998fbe4d20cfc008d99917110f%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637709147065715846%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=GrAh49Txcr%2Bd9xAwq1l%2FFo6sGqZZN%2BcXX2Q1TT3ss44%3D&amp;reserved=0
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Funsub&;data=04%7C01%7CAbdulLateef.Attar%40amd.com%7Cb53806998fbe4d20cfc008d99917110f%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637709147065715846%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=CYm4d5gMEDoei40a4lXbB6eEB%2B81It7wXuCu6maMZ5M%3D&amp;reserved=0 [abdattar@amd.com] -=-=-=-=-=-=


Attar, AbdulLateef (Abdul Lateef) <AbdulLateef.Attar@...>
 

[Public]

Code changes looks good.

Is fwts passing now? I think FWTS has wrong test case.
It expects Global system interrupt number to be zero for APIC interrupt type, which is wrong.
In my opinion it should check for Global system interrupt number for zero in case of PC-AT interrupt type.

Thanks
AbduL

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Tan, Ming via groups.io
Sent: Wednesday, October 27, 2021 12:27 PM
To: devel@edk2.groups.io
Subject: [edk2-devel] [PATCH v2] SpcrFeaturePkg: Modify PCI device interrupt setting.

[CAUTION: External Email]

REF: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D3708&;data=04%7C01%7CAbdulLateef.Attar%40amd.com%7Cb53806998fbe4d20cfc008d99917110f%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637709147065715846%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=rvzXQBpKAzzWr0VGZZoCJyVcJBhOvzvlbdrxzEe1KQk%3D&amp;reserved=0

The original code will cause FWTS V21.08.00 testing failed.
spcr: SPCR PC-AT compatible IRQ 0xff is invalid
spcr: SPCR PCI flags compatibility bit 0 is 0, expecting 1 for PCI device

Now modify the SpcrAcpi for following:
1. Disable the support of PC-AT compatible IRQ support.
Now only support IO-APIC interrupt type.
2. Set irq to 0.
3. Set the GSI to the value read from PCI device cfg space 0x3C.
4. Set PCI Flags to 1.

Signed-off-by: Ming Tan <ming.tan@intel.com>
---
V2: Fix a typo

.../SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c
index 86c40e90b8..7ad0c058c8 100644
--- a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c
+++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr
+++ Acpi.c
@@ -324,7 +324,9 @@ GetPciTypeInfo (
}



gSpcrInfo.BaseAddress.Address = BaseAddress;

- gSpcrInfo.Irq = (UINT8) Irq;

+ gSpcrInfo.InterruptType =
+ EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_APIC;

+ gSpcrInfo.Irq = 0;

+ gSpcrInfo.GlobalSystemInterrupt = (UINT32)Irq;



gSpcrInfo.PciDeviceId = DeviceId;

gSpcrInfo.PciVendorId = VendorId;

@@ -332,6 +334,7 @@ GetPciTypeInfo (
gSpcrInfo.PciDeviceNumber = (UINT8) Device;

gSpcrInfo.PciFunctionNumber = (UINT8) Function;

gSpcrInfo.PciSegment = (UINT8) SegNum;

+ gSpcrInfo.PciFlags = 1;



Done:

if (Resources != NULL) {

--
2.29.2.windows.3



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#82732): https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Fmessage%2F82732&;data=04%7C01%7CAbdulLateef.Attar%40amd.com%7Cb53806998fbe4d20cfc008d99917110f%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637709147065715846%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=m6rywrR9G355hZ1IHgi5XCtuYpK52Fu19aQaGZFBtbA%3D&amp;reserved=0
Mute This Topic: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.io%2Fmt%2F86622293%2F6129197&;data=04%7C01%7CAbdulLateef.Attar%40amd.com%7Cb53806998fbe4d20cfc008d99917110f%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637709147065715846%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=GrAh49Txcr%2Bd9xAwq1l%2FFo6sGqZZN%2BcXX2Q1TT3ss44%3D&amp;reserved=0
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk2.groups.io%2Fg%2Fdevel%2Funsub&;data=04%7C01%7CAbdulLateef.Attar%40amd.com%7Cb53806998fbe4d20cfc008d99917110f%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637709147065715846%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=CYm4d5gMEDoei40a4lXbB6eEB%2B81It7wXuCu6maMZ5M%3D&amp;reserved=0 [abdattar@amd.com] -=-=-=-=-=-=


Nate DeSimone
 

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

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Tan, Ming
Sent: Tuesday, October 26, 2021 11:57 PM
To: devel@edk2.groups.io
Subject: [edk2-devel] [PATCH v2] SpcrFeaturePkg: Modify PCI device interrupt setting.

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

The original code will cause FWTS V21.08.00 testing failed.
spcr: SPCR PC-AT compatible IRQ 0xff is invalid
spcr: SPCR PCI flags compatibility bit 0 is 0, expecting 1 for PCI device

Now modify the SpcrAcpi for following:
1. Disable the support of PC-AT compatible IRQ support.
Now only support IO-APIC interrupt type.
2. Set irq to 0.
3. Set the GSI to the value read from PCI device cfg space 0x3C.
4. Set PCI Flags to 1.

Signed-off-by: Ming Tan <ming.tan@intel.com>
---
V2: Fix a typo

.../SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c
index 86c40e90b8..7ad0c058c8 100644
--- a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c
+++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr
+++ Acpi.c
@@ -324,7 +324,9 @@ GetPciTypeInfo (
} gSpcrInfo.BaseAddress.Address = BaseAddress;- gSpcrInfo.Irq = (UINT8) Irq;+ gSpcrInfo.InterruptType = EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_APIC;+ gSpcrInfo.Irq = 0;+ gSpcrInfo.GlobalSystemInterrupt = (UINT32)Irq; gSpcrInfo.PciDeviceId = DeviceId; gSpcrInfo.PciVendorId = VendorId;@@ -332,6 +334,7 @@ GetPciTypeInfo (
gSpcrInfo.PciDeviceNumber = (UINT8) Device; gSpcrInfo.PciFunctionNumber = (UINT8) Function; gSpcrInfo.PciSegment = (UINT8) SegNum;+ gSpcrInfo.PciFlags = 1; Done: if (Resources != NULL) {--
2.29.2.windows.3



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#82732): https://edk2.groups.io/g/devel/message/82732
Mute This Topic: https://groups.io/mt/86622293/1767664
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [nathaniel.l.desimone@intel.com] -=-=-=-=-=-=


Nate DeSimone
 

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Tan, Ming
Sent: Tuesday, October 26, 2021 11:57 PM
To: devel@edk2.groups.io
Subject: [edk2-devel] [PATCH v2] SpcrFeaturePkg: Modify PCI device interrupt setting.

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

The original code will cause FWTS V21.08.00 testing failed.
spcr: SPCR PC-AT compatible IRQ 0xff is invalid
spcr: SPCR PCI flags compatibility bit 0 is 0, expecting 1 for PCI device

Now modify the SpcrAcpi for following:
1. Disable the support of PC-AT compatible IRQ support.
Now only support IO-APIC interrupt type.
2. Set irq to 0.
3. Set the GSI to the value read from PCI device cfg space 0x3C.
4. Set PCI Flags to 1.

Signed-off-by: Ming Tan <ming.tan@intel.com>
---
V2: Fix a typo

.../SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c
index 86c40e90b8..7ad0c058c8 100644
--- a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c
+++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr
+++ Acpi.c
@@ -324,7 +324,9 @@ GetPciTypeInfo (
} gSpcrInfo.BaseAddress.Address = BaseAddress;- gSpcrInfo.Irq = (UINT8) Irq;+ gSpcrInfo.InterruptType = EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_APIC;+ gSpcrInfo.Irq = 0;+ gSpcrInfo.GlobalSystemInterrupt = (UINT32)Irq; gSpcrInfo.PciDeviceId = DeviceId; gSpcrInfo.PciVendorId = VendorId;@@ -332,6 +334,7 @@ GetPciTypeInfo (
gSpcrInfo.PciDeviceNumber = (UINT8) Device; gSpcrInfo.PciFunctionNumber = (UINT8) Function; gSpcrInfo.PciSegment = (UINT8) SegNum;+ gSpcrInfo.PciFlags = 1; Done: if (Resources != NULL) {--
2.29.2.windows.3



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#82732): https://edk2.groups.io/g/devel/message/82732
Mute This Topic: https://groups.io/mt/86622293/1767664
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [nathaniel.l.desimone@intel.com] -=-=-=-=-=-=