]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg: Add more DataBits support to Port80 output
authorLiming Gao <liming.gao@intel.com>
Wed, 11 Nov 2015 02:16:35 +0000 (02:16 +0000)
committerlgao4 <lgao4@Edk2>
Wed, 11 Nov 2015 02:16:35 +0000 (02:16 +0000)
The BasePostCodeLibPort80 instance just prints UINT8 to IoPort 80. Some boards
may support 16bit or 32bit. To support them, new PCD PcdPort80DataWidth is
introduced to specify the width of data bits to Port80.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18765 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Library/BasePostCodeLibPort80/BasePostCodeLibPort80.inf
MdePkg/Library/BasePostCodeLibPort80/PostCode.c
MdePkg/MdePkg.dec
MdePkg/MdePkg.uni

index e2f0be551d465c0e48b74097b3b146f1ea2183d6..ebe115872883b4243b42d275b86b48506bd68a10 100644 (file)
@@ -3,7 +3,7 @@
 #\r
 #  Post Code Library that writes post code values to I/O port 0x80.\r
 #\r
-#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2015, 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
@@ -40,8 +40,9 @@
 [LibraryClasses]\r
   IoLib\r
   PcdLib\r
+  DebugLib\r
 \r
 \r
 [Pcd]\r
   gEfiMdePkgTokenSpaceGuid.PcdPostCodePropertyMask  ## CONSUMES\r
-\r
+  gEfiMdePkgTokenSpaceGuid.PcdPort80DataWidth ## CONSUMES\r
index 925c7404bc39b7f8db57fca10b5b1af50f1d15cd..f1fdbabce4b458fb80c3fa265fdd7654c1648aa3 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Post Code Library instance that writes post code values to I/O port 0x80.\r
 \r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2015, 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
@@ -17,6 +17,7 @@
 #include <Library/PostCodeLib.h>\r
 #include <Library/PcdLib.h>\r
 #include <Library/IoLib.h>\r
+#include <Library/DebugLib.h>\r
 \r
 /**\r
   Sends an 32-bit value to a POST card.\r
@@ -42,7 +43,24 @@ PostCode (
   IN UINT32  Value\r
   )\r
 {\r
-  IoWrite8 (0x80, (UINT8)(Value));\r
+  switch (PcdGet8 (PcdPort80DataWidth)) {\r
+  case 8:\r
+    IoWrite8 (0x80, (UINT8)(Value));\r
+    break;\r
+  case 16:\r
+    IoWrite16 (0x80, (UINT16)(Value));\r
+    break;\r
+  case 32:\r
+    IoWrite32 (0x80, Value);\r
+    break;\r
+  default:\r
+    //\r
+    // Assert on the invalid data width\r
+    //\r
+    ASSERT (FALSE);\r
+    break;\r
+  }\r
+  \r
   return Value;\r
 }\r
 \r
@@ -78,7 +96,7 @@ PostCodeWithDescription (
   IN CONST CHAR8  *Description  OPTIONAL\r
   )\r
 {\r
-  IoWrite8 (0x80, (UINT8)(Value));\r
+  PostCode (Value);\r
   return Value;\r
 }\r
 \r
index 337059a6a60254dea3cb8e6d1b11017a5d1f461e..7ab0cbbcfbfbe24fe71a85bdd3759d905ba045e4 100644 (file)
   # @Expression  0x80000002 | (gEfiMdePkgTokenSpaceGuid.PcdPostCodePropertyMask & 0xFC) == 0\r
   gEfiMdePkgTokenSpaceGuid.PcdPostCodePropertyMask|0|UINT8|0x0000000b\r
 \r
+  ## The bit width of data to be written to Port80. The default value is 8.\r
+  # @Prompt Port80 Data Width\r
+  # @ValidList  0x80000001 | 8, 16, 32\r
+  gEfiMdePkgTokenSpaceGuid.PcdPort80DataWidth|8|UINT8|0x0000002d\r
+\r
   ## This value is used to configure X86 Processor FSB clock.\r
   # @Prompt FSB Clock.\r
   gEfiMdePkgTokenSpaceGuid.PcdFSBClock|200000000|UINT32|0x0000000c\r
index 38211344e0ae01e984d5d9b916e42f4f8b4c1c66..5a5126213e4f72ea8c47772aebf5e31e007bbc46 100644 (file)
Binary files a/MdePkg/MdePkg.uni and b/MdePkg/MdePkg.uni differ