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
#\r
# Post Code Library that writes post code values to I/O port 0x80.\r
#\r
#\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
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
[LibraryClasses]\r
IoLib\r
PcdLib\r
[LibraryClasses]\r
IoLib\r
PcdLib\r
\r
\r
[Pcd]\r
gEfiMdePkgTokenSpaceGuid.PcdPostCodePropertyMask ## CONSUMES\r
\r
\r
[Pcd]\r
gEfiMdePkgTokenSpaceGuid.PcdPostCodePropertyMask ## CONSUMES\r
+ gEfiMdePkgTokenSpaceGuid.PcdPort80DataWidth ## CONSUMES\r
/** @file\r
Post Code Library instance that writes post code values to I/O port 0x80.\r
\r
/** @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
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
#include <Library/PostCodeLib.h>\r
#include <Library/PcdLib.h>\r
#include <Library/IoLib.h>\r
#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
\r
/**\r
Sends an 32-bit value to a POST card.\r
IN UINT32 Value\r
)\r
{\r
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
IN CONST CHAR8 *Description OPTIONAL\r
)\r
{\r
IN CONST CHAR8 *Description OPTIONAL\r
)\r
{\r
- IoWrite8 (0x80, (UINT8)(Value));\r
# @Expression 0x80000002 | (gEfiMdePkgTokenSpaceGuid.PcdPostCodePropertyMask & 0xFC) == 0\r
gEfiMdePkgTokenSpaceGuid.PcdPostCodePropertyMask|0|UINT8|0x0000000b\r
\r
# @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
## This value is used to configure X86 Processor FSB clock.\r
# @Prompt FSB Clock.\r
gEfiMdePkgTokenSpaceGuid.PcdFSBClock|200000000|UINT32|0x0000000c\r