mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-31 01:24:12 +02:00
ArmPlatformPkg/PL011Uart: Ignore BAUD rate if Integral non-zero
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14432 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
c57482d11c
commit
ec6b73d7a6
@ -130,19 +130,17 @@ PL011UartInitializePort (
|
|||||||
// Baud Rate
|
// Baud Rate
|
||||||
//
|
//
|
||||||
|
|
||||||
// If BaudRate is zero then use default baud rate
|
// If PL011 Integral value has been defined then always ignore the BAUD rate
|
||||||
if (*BaudRate == 0) {
|
if (PcdGet32 (PL011UartInteger) != 0) {
|
||||||
if (PcdGet32 (PL011UartInteger) != 0) {
|
|
||||||
MmioWrite32 (UartBase + UARTIBRD, PcdGet32 (PL011UartInteger));
|
MmioWrite32 (UartBase + UARTIBRD, PcdGet32 (PL011UartInteger));
|
||||||
MmioWrite32 (UartBase + UARTFBRD, PcdGet32 (PL011UartFractional));
|
MmioWrite32 (UartBase + UARTFBRD, PcdGet32 (PL011UartFractional));
|
||||||
} else {
|
} else {
|
||||||
|
// If BAUD rate is zero then replace it with the system default value
|
||||||
|
if (*BaudRate == 0) {
|
||||||
*BaudRate = PcdGet32 (PcdSerialBaudRate);
|
*BaudRate = PcdGet32 (PcdSerialBaudRate);
|
||||||
ASSERT (*BaudRate != 0);
|
ASSERT (*BaudRate != 0);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// If BaudRate != 0 then we must calculate the divisor from the value
|
|
||||||
if (*BaudRate != 0) {
|
|
||||||
Divisor = (PcdGet32 (PL011UartClkInHz) * 4) / *BaudRate;
|
Divisor = (PcdGet32 (PL011UartClkInHz) * 4) / *BaudRate;
|
||||||
MmioWrite32 (UartBase + UARTIBRD, Divisor >> 6);
|
MmioWrite32 (UartBase + UARTIBRD, Divisor >> 6);
|
||||||
MmioWrite32 (UartBase + UARTFBRD, Divisor & 0x3F);
|
MmioWrite32 (UartBase + UARTFBRD, Divisor & 0x3F);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user