Skip to content

Commit 5ac93b2

Browse files
Xin Xiemergify[bot]
authored andcommitted
ArmPlatformPkg/PL011SerialPortLib: Add hardware flow control support
This change introduces hardware flow control capabilities for the PL011 serial port Library. Signed-off-by: Xin Xie <[email protected]>
1 parent 7772a2a commit 5ac93b2

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,16 @@ SerialPortInitialize (
5757
return Status;
5858
}
5959

60+
if (PcdGetBool (PcdSerialUseHardwareFlowControl)) {
61+
Status = PL011UartSetControl (
62+
(UINTN)PcdGet64 (PcdSerialRegisterBase),
63+
EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE
64+
);
65+
if (EFI_ERROR (Status)) {
66+
return Status;
67+
}
68+
}
69+
6070
while (SerialPortPoll ()) {
6171
SerialPortRead (&Scratch, sizeof (Scratch));
6272
}

ArmPlatformPkg/Library/PL011SerialPortLib/PL011SerialPortLib.inf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232

3333
[Pcd]
3434
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase
35+
gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseHardwareFlowControl
3536

3637
[Pcd]
3738
gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate

0 commit comments

Comments
 (0)