X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=ArmPlatformPkg%2FLibrary%2FPL011SerialPortLib%2FPL011SerialPortLib.c;h=d576f79c3e6e045ef2f59ea3a827ebe7d1063bd7;hp=3b5f1edf68ea5dc84bd0dad66cfe404b6ed27332;hb=5a9b3eb8e5fbbc0a49f80630039d58712aacfab8;hpb=9f08a052a3e48295b19da20995a6cab23d31e8cf diff --git a/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.c b/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.c index 3b5f1edf68..d576f79c3e 100644 --- a/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.c +++ b/ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.c @@ -19,18 +19,16 @@ #include #include +#include +#include #include -#include +/** Initialise the serial device hardware with default settings. - -/** - - Programmed hardware of Serial port. - - @return Always return RETURN_UNSUPPORTED. - -**/ + @retval RETURN_SUCCESS The serial device was initialised. + @retval RETURN_INVALID_PARAMETER One or more of the default settings + has an unsupported value. + **/ RETURN_STATUS EFIAPI SerialPortInitialize ( @@ -43,20 +41,21 @@ SerialPortInitialize ( UINT8 DataBits; EFI_STOP_BITS_TYPE StopBits; - BaudRate = (UINTN)PcdGet64 (PcdUartDefaultBaudRate); + BaudRate = FixedPcdGet64 (PcdUartDefaultBaudRate); ReceiveFifoDepth = 0; // Use default FIFO depth - Parity = (EFI_PARITY_TYPE)PcdGet8 (PcdUartDefaultParity); - DataBits = PcdGet8 (PcdUartDefaultDataBits); - StopBits = (EFI_STOP_BITS_TYPE) PcdGet8 (PcdUartDefaultStopBits); + Parity = (EFI_PARITY_TYPE)FixedPcdGet8 (PcdUartDefaultParity); + DataBits = FixedPcdGet8 (PcdUartDefaultDataBits); + StopBits = (EFI_STOP_BITS_TYPE) FixedPcdGet8 (PcdUartDefaultStopBits); return PL011UartInitializePort ( - (UINTN)PcdGet64 (PcdSerialRegisterBase), - &BaudRate, - &ReceiveFifoDepth, - &Parity, - &DataBits, - &StopBits - ); + (UINTN)PcdGet64 (PcdSerialRegisterBase), + PL011UartClockGetFreq(), + &BaudRate, + &ReceiveFifoDepth, + &Parity, + &DataBits, + &StopBits + ); } /** @@ -102,9 +101,8 @@ SerialPortRead ( /** Check to see if any data is available to be read from the debug device. - @retval EFI_SUCCESS At least one byte of data is available to be read - @retval EFI_NOT_READY No data is available to be read - @retval EFI_DEVICE_ERROR The serial device is not functioning properly + @retval TRUE At least one byte of data is available to be read + @retval FALSE No data is available to be read **/ BOOLEAN @@ -158,13 +156,14 @@ SerialPortSetAttributes ( ) { return PL011UartInitializePort ( - (UINTN)PcdGet64 (PcdSerialRegisterBase), - BaudRate, - ReceiveFifoDepth, - Parity, - DataBits, - StopBits - ); + (UINTN)PcdGet64 (PcdSerialRegisterBase), + PL011UartClockGetFreq(), + BaudRate, + ReceiveFifoDepth, + Parity, + DataBits, + StopBits + ); } /**