Added support for UART and Terminal PCD settings
authorAJFISH <AJFISH@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 16 Aug 2007 21:29:09 +0000 (21:29 +0000)
committerAJFISH <AJFISH@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 16 Aug 2007 21:29:09 +0000 (21:29 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3662 6f19259b-4bc3-4df7-8a09-765794883524

Nt32Pkg/Nt32Pkg.dsc
Nt32Pkg/WinNtSerialIoDxe/ComponentName.c
Nt32Pkg/WinNtSerialIoDxe/WinNtSerialIo.c
Nt32Pkg/WinNtSerialIoDxe/WinNtSerialIo.h
Nt32Pkg/WinNtSerialIoDxe/WinNtSerialIoDxe.inf

index 2e5e3278cd77325ab97aff6b162b9eae7a46000c..bca4092023a3cbbd7838ac6150bdf54676c5bf27 100644 (file)
   PcdStatusCodeValueSetVirtualAddressMap|gEfiMdePkgTokenSpaceGuid|0x03101004\r
   PcdStatusCodeValueUncorrectableMemoryError|gEfiMdePkgTokenSpaceGuid|0x00051003\r
   PcdUefiLibMaxPrintBufferSize|gEfiMdePkgTokenSpaceGuid|320\r
+  PcdUartDefaultBaudRate|gEfiMdePkgTokenSpaceGuid|115200\r
+  PcdUartDefaultDataBits|gEfiMdePkgTokenSpaceGuid|8\r
+  PcdUartDefaultParity|gEfiMdePkgTokenSpaceGuid|1\r
+  PcdUartDefaultStopBits|gEfiMdePkgTokenSpaceGuid|1\r
+  PcdDefaultTerminalType|gEfiMdePkgTokenSpaceGuid|0\r
 \r
   PcdWinNtFirmwareFdSize|gEfiNt32PkgTokenSpaceGuid|0x2a0000\r
   PcdWinNtFirmwareBlockSize|gEfiNt32PkgTokenSpaceGuid|0x10000\r
   PcdWinNtCpuModel|gEfiNt32PkgTokenSpaceGuid|L"NT32 Processor Emulation"|52\r
   PcdWinNtCpuSpeed|gEfiNt32PkgTokenSpaceGuid|L"1234"|8\r
   PcdWinNtMemorySize|gEfiNt32PkgTokenSpaceGuid|L"64!64"|10\r
-  PcdWinNtPhysicalDisk|gEfiNt32PkgTokenSpaceGuid|L"a:RW;2880;512!e:RW;262144;512"|58\r
+  PcdWinNtPhysicalDisk|gEfiNt32PkgTokenSpaceGuid|L"a:RW;2880;512!d:RO;307200;2048!j:RW;262144;512"|100\r
   PcdWinNtUga|gEfiNt32PkgTokenSpaceGuid|L"UGA Window 1!UGA Window 2"|50\r
 \r
   PcdFlashNvStorageFtwSpareBase|gEfiMdeModulePkgTokenSpaceGuid|0\r
index 5454291070a8195035436e63f97d9998cbd55c6b..d22f030f4b6a5f913732fca3145750d0750a61a3 100644 (file)
@@ -16,30 +16,6 @@ Module Name:
 Abstract:\r
 \r
 --*/\r
-//\r
-// The package level header files this module uses\r
-//\r
-#include <Uefi.h>\r
-#include <WinNtDxe.h>\r
-//\r
-// The protocols, PPI and GUID defintions for this module\r
-//\r
-#include <Protocol/WinNtIo.h>\r
-#include <Protocol/ComponentName.h>\r
-#include <Protocol/SerialIo.h>\r
-#include <Protocol/DriverBinding.h>\r
-#include <Protocol/DevicePath.h>\r
-//\r
-// The Library classes this module consumes\r
-//\r
-#include <Library/DebugLib.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/DevicePathLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
 \r
 #include "WinNtSerialIo.h"\r
 \r
index 85001404e03f57cf8c7cdddb2663c00b09ab603b..44bbf5765cd8f6aa5182a81bfb3c9848456b535e 100644 (file)
@@ -45,31 +45,6 @@ Abstract:
 \r
 --*/\r
 \r
-//\r
-// The package level header files this module uses\r
-//\r
-#include <Uefi.h>\r
-#include <WinNtDxe.h>\r
-//\r
-// The protocols, PPI and GUID defintions for this module\r
-//\r
-#include <Protocol/WinNtIo.h>\r
-#include <Protocol/ComponentName.h>\r
-#include <Protocol/SerialIo.h>\r
-#include <Protocol/DriverBinding.h>\r
-#include <Protocol/DevicePath.h>\r
-//\r
-// The Library classes this module consumes\r
-//\r
-#include <Library/DebugLib.h>\r
-#include <Library/BaseLib.h>\r
-#include <Library/UefiDriverEntryPoint.h>\r
-#include <Library/UefiLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
-#include <Library/DevicePathLib.h>\r
-#include <Library/MemoryAllocationLib.h>\r
-\r
 #include "WinNtSerialIo.h"\r
 \r
 EFI_DRIVER_BINDING_PROTOCOL gWinNtSerialIoDriverBinding = {\r
@@ -780,7 +755,7 @@ Returns:
   //   we must set the default values if a null argument is passed in.\r
   //\r
   if (BaudRate == 0) {\r
-    BaudRate = SERIAL_BAUD_DEFAULT;\r
+    BaudRate = FixedPcdGet64 (PcdUartDefaultBaudRate);\r
   }\r
 \r
   if (ReceiveFifoDepth == 0) {\r
@@ -792,15 +767,15 @@ Returns:
   }\r
 \r
   if (Parity == DefaultParity) {\r
-    Parity = NoParity;\r
+    Parity = FixedPcdGet8 (PcdUartDefaultParity);\r
   }\r
 \r
   if (DataBits == 0) {\r
-    DataBits = SERIAL_DATABITS_DEFAULT;\r
+    DataBits = FixedPcdGet8 (PcdUartDefaultDataBits);\r
   }\r
 \r
   if (StopBits == DefaultStopBits) {\r
-    StopBits = OneStopBit;\r
+    StopBits = (EFI_STOP_BITS_TYPE) FixedPcdGet8 (PcdUartDefaultStopBits);\r
   }\r
   //\r
   // See if the new attributes already match the current attributes\r
index c53d2e3fec83096f6f6c033821c31cf56546cb98..affc392b511dbf1bf09c49fecf4aca92bdf2ed1e 100644 (file)
@@ -21,6 +21,32 @@ Abstract:
 #ifndef _WIN_NT_SERIAL_IO_\r
 #define _WIN_NT_SERIAL_IO_\r
 \r
+//\r
+// The package level header files this module uses\r
+//\r
+#include <Uefi.h>\r
+#include <WinNtDxe.h>\r
+//\r
+// The protocols, PPI and GUID defintions for this module\r
+//\r
+#include <Protocol/WinNtIo.h>\r
+#include <Protocol/ComponentName.h>\r
+#include <Protocol/SerialIo.h>\r
+#include <Protocol/DriverBinding.h>\r
+#include <Protocol/DevicePath.h>\r
+//\r
+// The Library classes this module consumes\r
+//\r
+#include <Library/DebugLib.h>\r
+#include <Library/BaseLib.h>\r
+#include <Library/UefiDriverEntryPoint.h>\r
+#include <Library/UefiLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/DevicePathLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
+#include <Library/PcdLib.h>\r
+\r
 \r
 #define SERIAL_MAX_BUFFER_SIZE  256\r
 #define TIMEOUT_STALL_INTERVAL  10\r
index 503c225ad20df0f310b799bad11d281ccf6c5817..9638baa57db829df337047253f9f3f16a8629427 100644 (file)
@@ -66,3 +66,9 @@
   gEfiDevicePathProtocolGuid                    # PROTOCOL TO_START\r
   gEfiWinNtIoProtocolGuid                       # PROTOCOL TO_START\r
 \r
+[PcdsFixedAtBuild.common]\r
+  PcdUartDefaultBaudRate|gEfiMdePkgTokenSpaceGuid|115200\r
+  PcdUartDefaultDataBits|gEfiMdePkgTokenSpaceGuid|8\r
+  PcdUartDefaultParity|gEfiMdePkgTokenSpaceGuid|1\r
+  PcdUartDefaultStopBits|gEfiMdePkgTokenSpaceGuid|1\r
+\r