diff --git a/ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.c b/ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.c index 48a0530dcc..05d3547fda 100644 --- a/ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.c +++ b/ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLib.c @@ -200,7 +200,23 @@ SerialPortSetAttributes ( IN OUT EFI_STOP_BITS_TYPE *StopBits ) { - return RETURN_UNSUPPORTED; + RETURN_STATUS Status; + + if (mSerialBaseAddress == 0) { + Status = RETURN_UNSUPPORTED; + } else { + Status = PL011UartInitializePort ( + mSerialBaseAddress, + FixedPcdGet32 (PL011UartClkInHz), + BaudRate, + ReceiveFifoDepth, + Parity, + DataBits, + StopBits + ); + } + + return Status; } /** @@ -219,7 +235,15 @@ SerialPortSetControl ( IN UINT32 Control ) { - return RETURN_UNSUPPORTED; + RETURN_STATUS Status; + + if (mSerialBaseAddress == 0) { + Status = RETURN_UNSUPPORTED; + } else { + Status = PL011UartSetControl (mSerialBaseAddress, Control); + } + + return Status; } /** @@ -238,6 +262,14 @@ SerialPortGetControl ( OUT UINT32 *Control ) { - return RETURN_UNSUPPORTED; + RETURN_STATUS Status; + + if (mSerialBaseAddress == 0) { + Status = RETURN_UNSUPPORTED; + } else { + Status = PL011UartGetControl (mSerialBaseAddress, Control); + } + + return Status; }