]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.c
ArmVirtPkg/FdtPL011SerialPortLib: call PL011UartLib in all SerialPortLib APIs
[mirror_edk2.git] / ArmVirtPkg / Library / FdtPL011SerialPortLib / FdtPL011SerialPortLib.c
index 48a0530dcc2fe59a87b37d2df6eba44c1247ad84..05d3547fda913169ee10b120d17f648cd9ad4122 100644 (file)
@@ -200,7 +200,23 @@ SerialPortSetAttributes (
   IN OUT EFI_STOP_BITS_TYPE *StopBits\r
   )\r
 {\r
-  return RETURN_UNSUPPORTED;\r
+  RETURN_STATUS Status;\r
+\r
+  if (mSerialBaseAddress == 0) {\r
+    Status = RETURN_UNSUPPORTED;\r
+  } else {\r
+    Status = PL011UartInitializePort (\r
+               mSerialBaseAddress,\r
+               FixedPcdGet32 (PL011UartClkInHz),\r
+               BaudRate,\r
+               ReceiveFifoDepth,\r
+               Parity,\r
+               DataBits,\r
+               StopBits\r
+               );\r
+  }\r
+\r
+  return Status;\r
 }\r
 \r
 /**\r
@@ -219,7 +235,15 @@ SerialPortSetControl (
   IN UINT32 Control\r
   )\r
 {\r
-  return RETURN_UNSUPPORTED;\r
+  RETURN_STATUS Status;\r
+\r
+  if (mSerialBaseAddress == 0) {\r
+    Status = RETURN_UNSUPPORTED;\r
+  } else {\r
+    Status = PL011UartSetControl (mSerialBaseAddress, Control);\r
+  }\r
+\r
+  return Status;\r
 }\r
 \r
 /**\r
@@ -238,6 +262,14 @@ SerialPortGetControl (
   OUT UINT32 *Control\r
   )\r
 {\r
-  return RETURN_UNSUPPORTED;\r
+  RETURN_STATUS Status;\r
+\r
+  if (mSerialBaseAddress == 0) {\r
+    Status = RETURN_UNSUPPORTED;\r
+  } else {\r
+    Status = PL011UartGetControl (mSerialBaseAddress, Control);\r
+  }\r
+\r
+  return Status;\r
 }\r
 \r