]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Enhance PcAt IsaAcpi driver to support enable/disable separated functions per PCD...
authorniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 10 Mar 2011 07:33:42 +0000 (07:33 +0000)
committerniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 10 Mar 2011 07:33:42 +0000 (07:33 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11362 6f19259b-4bc3-4df7-8a09-765794883524

PcAtChipsetPkg/IsaAcpiDxe/IsaAcpi.c
PcAtChipsetPkg/IsaAcpiDxe/IsaAcpi.inf
PcAtChipsetPkg/IsaAcpiDxe/PcatIsaAcpi.c
PcAtChipsetPkg/IsaAcpiDxe/PcatIsaAcpi.h
PcAtChipsetPkg/PcAtChipsetPkg.dec

index b5ba25ede9fbfe404a34242fa751b2b6f3d2da73..1194016271ac4edc837fb301c1dacb082568c7e4 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   ISA ACPI Protocol Implementation\r
 \r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -20,6 +20,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 //\r
 // COM 1 UART Controller\r
 //\r
+GLOBAL_REMOVE_IF_UNREFERENCED\r
 EFI_ISA_ACPI_RESOURCE mPcatIsaAcpiCom1DeviceResources[] = {\r
   {EfiIsaAcpiResourceIo,        0, 0x3f8, 0x3ff},\r
   {EfiIsaAcpiResourceInterrupt, 0, 4,     0},\r
@@ -29,6 +30,7 @@ EFI_ISA_ACPI_RESOURCE mPcatIsaAcpiCom1DeviceResources[] = {
 //\r
 // COM 2 UART Controller\r
 //\r
+GLOBAL_REMOVE_IF_UNREFERENCED\r
 EFI_ISA_ACPI_RESOURCE mPcatIsaAcpiCom2DeviceResources[] = {\r
   {EfiIsaAcpiResourceIo,        0, 0x2f8, 0x2ff},\r
   {EfiIsaAcpiResourceInterrupt, 0, 3,     0},\r
@@ -38,6 +40,7 @@ EFI_ISA_ACPI_RESOURCE mPcatIsaAcpiCom2DeviceResources[] = {
 //\r
 // PS/2 Keyboard Controller\r
 //\r
+GLOBAL_REMOVE_IF_UNREFERENCED\r
 EFI_ISA_ACPI_RESOURCE  mPcatIsaAcpiPs2KeyboardDeviceResources[] = {\r
   {EfiIsaAcpiResourceIo,        0, 0x60, 0x64},\r
   {EfiIsaAcpiResourceInterrupt, 0, 1,     0},\r
@@ -47,6 +50,7 @@ EFI_ISA_ACPI_RESOURCE  mPcatIsaAcpiPs2KeyboardDeviceResources[] = {
 //\r
 // PS/2 Mouse Controller\r
 //\r
+GLOBAL_REMOVE_IF_UNREFERENCED\r
 EFI_ISA_ACPI_RESOURCE  mPcatIsaAcpiPs2MouseDeviceResources[] = {\r
   {EfiIsaAcpiResourceIo,        0, 0x60, 0x64},\r
   {EfiIsaAcpiResourceInterrupt, 0, 12,     0},\r
@@ -56,6 +60,7 @@ EFI_ISA_ACPI_RESOURCE  mPcatIsaAcpiPs2MouseDeviceResources[] = {
 //\r
 // Floppy Disk Controller\r
 //\r
+GLOBAL_REMOVE_IF_UNREFERENCED\r
 EFI_ISA_ACPI_RESOURCE mPcatIsaAcpiFloppyResources[] = {\r
   {EfiIsaAcpiResourceIo,        0, 0x3f0, 0x3f7},\r
   {EfiIsaAcpiResourceInterrupt, 0, 6,     0},\r
@@ -63,18 +68,77 @@ EFI_ISA_ACPI_RESOURCE mPcatIsaAcpiFloppyResources[] = {
   {EfiIsaAcpiResourceEndOfList, 0, 0,     0}\r
 };\r
 \r
+GLOBAL_REMOVE_IF_UNREFERENCED\r
+EFI_ISA_ACPI_RESOURCE_LIST mPcatIsaAcpiCom1Device = {\r
+  {EISA_PNP_ID(0x501), 0}, mPcatIsaAcpiCom1DeviceResources\r
+}; // COM 1 UART Controller\r
+\r
+GLOBAL_REMOVE_IF_UNREFERENCED\r
+EFI_ISA_ACPI_RESOURCE_LIST mPcatIsaAcpiCom2Device = {\r
+  {EISA_PNP_ID(0x501), 1}, mPcatIsaAcpiCom2DeviceResources\r
+}; // COM 2 UART Controller\r
+\r
+GLOBAL_REMOVE_IF_UNREFERENCED\r
+EFI_ISA_ACPI_RESOURCE_LIST mPcatIsaAcpiPs2KeyboardDevice = {\r
+  {EISA_PNP_ID(0x303), 0}, mPcatIsaAcpiPs2KeyboardDeviceResources\r
+}; // PS/2 Keyboard Controller\r
+\r
+GLOBAL_REMOVE_IF_UNREFERENCED\r
+EFI_ISA_ACPI_RESOURCE_LIST mPcatIsaAcpiPs2MouseDevice = {\r
+  {EISA_PNP_ID(0x303), 1}, mPcatIsaAcpiPs2MouseDeviceResources\r
+}; // PS/2 Mouse Controller\r
+\r
+GLOBAL_REMOVE_IF_UNREFERENCED\r
+EFI_ISA_ACPI_RESOURCE_LIST mPcatIsaAcpiFloppyADevice = {\r
+  {EISA_PNP_ID(0x604), 0}, mPcatIsaAcpiFloppyResources\r
+}; // Floppy Disk Controller A:\r
+\r
+GLOBAL_REMOVE_IF_UNREFERENCED\r
+EFI_ISA_ACPI_RESOURCE_LIST mPcatIsaAcpiFloppyBDevice = {\r
+  {EISA_PNP_ID(0x604), 1}, mPcatIsaAcpiFloppyResources\r
+}; // Floppy Disk Controller B:\r
+\r
 //\r
 // Table of ISA Controllers\r
 //\r
-EFI_ISA_ACPI_RESOURCE_LIST gPcatIsaAcpiDeviceList[] = {\r
-  {{EISA_PNP_ID(0x501), 0}, mPcatIsaAcpiCom1DeviceResources        }, // COM 1 UART Controller\r
-  {{EISA_PNP_ID(0x501), 1}, mPcatIsaAcpiCom2DeviceResources        }, // COM 2 UART Controller\r
-  {{EISA_PNP_ID(0x303), 0}, mPcatIsaAcpiPs2KeyboardDeviceResources }, // PS/2 Keyboard Controller\r
-  {{EISA_PNP_ID(0x303), 1}, mPcatIsaAcpiPs2MouseDeviceResources    }, // PS/2 Mouse Controller\r
-  {{EISA_PNP_ID(0x604), 0}, mPcatIsaAcpiFloppyResources            }, // Floppy Disk Controller A:\r
-  {{EISA_PNP_ID(0x604), 1}, mPcatIsaAcpiFloppyResources            }, // Floppy Disk Controller B:\r
-  {{0,                  0}, NULL                                   }  // End if ISA Controllers\r
-};\r
+EFI_ISA_ACPI_RESOURCE_LIST gPcatIsaAcpiDeviceList[7] = {0};\r
+\r
+/**\r
+  Initialize gPcatIsaAcpiDeviceList.\r
+**/\r
+VOID\r
+InitializePcatIsaAcpiDeviceList (\r
+  VOID\r
+  )\r
+{\r
+  UINTN  Index;\r
+\r
+  Index = 0;\r
+  if (PcdGetBool (PcdIsaAcpiCom1Enable)) {\r
+    CopyMem (&gPcatIsaAcpiDeviceList[Index], &mPcatIsaAcpiCom1Device, sizeof(mPcatIsaAcpiCom1Device));\r
+    Index++;\r
+  }\r
+  if (PcdGetBool (PcdIsaAcpiCom2Enable)) {\r
+    CopyMem (&gPcatIsaAcpiDeviceList[Index], &mPcatIsaAcpiCom2Device, sizeof(mPcatIsaAcpiCom2Device));\r
+    Index++;\r
+  }\r
+  if (PcdGetBool (PcdIsaAcpiPs2KeyboardEnable)) {\r
+    CopyMem (&gPcatIsaAcpiDeviceList[Index], &mPcatIsaAcpiPs2KeyboardDevice, sizeof(mPcatIsaAcpiPs2KeyboardDevice));\r
+    Index++;\r
+  }\r
+  if (PcdGetBool (PcdIsaAcpiPs2MouseEnable)) {\r
+    CopyMem (&gPcatIsaAcpiDeviceList[Index], &mPcatIsaAcpiPs2MouseDevice, sizeof(mPcatIsaAcpiPs2MouseDevice));\r
+    Index++;\r
+  }\r
+  if (PcdGetBool (PcdIsaAcpiFloppyAEnable)) {\r
+    CopyMem (&gPcatIsaAcpiDeviceList[Index], &mPcatIsaAcpiFloppyADevice, sizeof(mPcatIsaAcpiFloppyADevice));\r
+    Index++;\r
+  }\r
+  if (PcdGetBool (PcdIsaAcpiFloppyBEnable)) {\r
+    CopyMem (&gPcatIsaAcpiDeviceList[Index], &mPcatIsaAcpiFloppyBDevice, sizeof(mPcatIsaAcpiFloppyBDevice));\r
+    Index++;\r
+  }\r
+}\r
 \r
 //\r
 // ISA ACPI Protocol Functions\r
index 5d5101efd720e3ab3ad7f34b2d904a082113cbc0..2edd39a01b80c6856fd2306ac0cc6093da147cdf 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 #   Component description file for PCAT ISA ACPI driver\r
 #\r
-# Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials                          \r
 # are licensed and made available under the terms and conditions of the BSD License         \r
 # which accompanies this distribution.  The full text of the license may be found at        \r
 [Packages]\r
   MdePkg/MdePkg.dec\r
   IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec\r
+  PcAtChipsetPkg/PcAtChipsetPkg.dec\r
 \r
 [LibraryClasses]\r
   UefiDriverEntryPoint\r
   UefiBootServicesTableLib\r
   UefiLib\r
+  BaseMemoryLib\r
+  PcdLib\r
   \r
 [Sources]\r
   PcatIsaAcpi.h\r
 [Protocols]\r
   gEfiPciIoProtocolGuid\r
   gEfiIsaAcpiProtocolGuid\r
+\r
+[Pcd]\r
+  gPcAtChipsetPkgTokenSpaceGuid.PcdIsaAcpiCom1Enable\r
+  gPcAtChipsetPkgTokenSpaceGuid.PcdIsaAcpiCom2Enable\r
+  gPcAtChipsetPkgTokenSpaceGuid.PcdIsaAcpiPs2KeyboardEnable\r
+  gPcAtChipsetPkgTokenSpaceGuid.PcdIsaAcpiPs2MouseEnable\r
+  gPcAtChipsetPkgTokenSpaceGuid.PcdIsaAcpiFloppyAEnable\r
+  gPcAtChipsetPkgTokenSpaceGuid.PcdIsaAcpiFloppyBEnable\r
index ea1180f3abf072e9c8e72438bcce45225a1643da..55fefd4ca21e8a8d14fabeaa95b164ff00695dc1 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   EFI PCAT ISA ACPI Driver for a Generic PC Platform\r
 \r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -242,6 +242,11 @@ PcatIsaAcpiDriverBindingStart (
   PcatIsaAcpiDev->Signature = PCAT_ISA_ACPI_DEV_SIGNATURE;\r
   PcatIsaAcpiDev->Handle    = Controller;\r
   PcatIsaAcpiDev->PciIo     = PciIo;\r
+\r
+  //\r
+  // Initialize PcatIsaAcpiDeviceList\r
+  //\r
+  InitializePcatIsaAcpiDeviceList ();\r
   \r
   //\r
   // IsaAcpi interface\r
index 6eed1f2aec0f9f88127f2d86ac8a1dd16877ab56..1fcac402b950641114e4d351338b60cbfa27015d 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   EFI PCAT ISA ACPI Driver for a Generic PC Platform\r
 \r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
@@ -29,6 +29,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include <Library/UefiLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
+#include <Library/PcdLib.h>\r
 \r
 #include <Protocol/IsaAcpi.h>\r
 //\r
@@ -261,4 +263,12 @@ IsaInterfaceInit (
   IN EFI_ISA_ACPI_PROTOCOL  *This\r
   );  \r
 \r
+/**\r
+  Initialize the ISA device list.\r
+**/\r
+VOID\r
+InitializePcatIsaAcpiDeviceList (\r
+  VOID\r
+  );\r
+\r
 #endif\r
index 3ab147c23b621db0f69d9d3b1378bd3a7c7e2507..c67c2f9f21810bf03f3818944bf5e119b87b7ccf 100644 (file)
@@ -4,7 +4,7 @@
 # This package is designed to public interfaces and implementation which follows\r
 # PcAt defacto standard.\r
 #\r
-# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>\r
 #\r
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
   \r
   ## Pcd8259LegacyModeEdgeLevel defines the default edge level for legacy mode's interrrupt controller.\r
   gPcAtChipsetPkgTokenSpaceGuid.Pcd8259LegacyModeEdgeLevel|0x0000|UINT16|0x00000002\r
-  \r
+\r
+[PcdsFixedAtBuild, PcdsDynamic, PcdsPatchableInModule]\r
+  ## This PCD specifies whether we need enable IsaAcpiCom1 device.\r
+  gPcAtChipsetPkgTokenSpaceGuid.PcdIsaAcpiCom1Enable|TRUE|BOOLEAN|0x00000003\r
+\r
+  ## This PCD specifies whether we need enable IsaAcpiCom2 device.\r
+  gPcAtChipsetPkgTokenSpaceGuid.PcdIsaAcpiCom2Enable|TRUE|BOOLEAN|0x00000004\r
+\r
+  ## This PCD specifies whether we need enable IsaAcpiPs2Keyboard device.\r
+  gPcAtChipsetPkgTokenSpaceGuid.PcdIsaAcpiPs2KeyboardEnable|TRUE|BOOLEAN|0x00000005\r
+\r
+  ## This PCD specifies whether we need enable IsaAcpiPs2Mouse device.\r
+  gPcAtChipsetPkgTokenSpaceGuid.PcdIsaAcpiPs2MouseEnable|TRUE|BOOLEAN|0x00000006\r
+\r
+  ## This PCD specifies whether we need enable IsaAcpiFloppyA device.\r
+  gPcAtChipsetPkgTokenSpaceGuid.PcdIsaAcpiFloppyAEnable|TRUE|BOOLEAN|0x00000007\r
+\r
+  ## This PCD specifies whether we need enable IsaAcpiFloppyB device.\r
+  gPcAtChipsetPkgTokenSpaceGuid.PcdIsaAcpiFloppyBEnable|TRUE|BOOLEAN|0x00000008\r
+\r
 [Guids]\r
   gPcAtChipsetPkgTokenSpaceGuid = { 0x326ae723, 0xae32, 0x4589, { 0x98, 0xb8, 0xca, 0xc2, 0x3c, 0xdc, 0xc1, 0xb1 } }\r
 \r