mirror of
https://github.com/edk2-porting/edk2-rk3588.git
synced 2025-12-17 19:14:40 +08:00
Silicon/RK3588: Add option to change serial baud rate within UEFI
Firstly, split up the Dw8250 serial lib into "full" and "debug" versions. The full version is only used at SEC phase (PrePi) for setting the specified baud rate, while the debug one is used everywhere else and cannot reinitialize the UART. To read the baud rate NV variable in SEC, introduce BaseVariableLib, which is just a slightly modified FaultTolerantWritePei + VariablePei to not use HOBs and PPIs, since they're not available this early. Previous boot stages (DDR, TF-A, U-Boot SPL) are still hardcoded to output at 1.5 Mbaud. Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
This commit is contained in:
@@ -65,10 +65,10 @@ STATIC PLATFORM_SERIAL_CONSOLE mSerialConsole = {
|
||||
{
|
||||
{ MESSAGING_DEVICE_PATH, MSG_UART_DP, DP_NODE_LEN (UART_DEVICE_PATH) },
|
||||
0, // Reserved
|
||||
FixedPcdGet64 (PcdUartDefaultBaudRate), // BaudRate
|
||||
FixedPcdGet8 (PcdUartDefaultDataBits), // DataBits
|
||||
FixedPcdGet8 (PcdUartDefaultParity), // Parity
|
||||
FixedPcdGet8 (PcdUartDefaultStopBits) // StopBits
|
||||
0, // BaudRate
|
||||
0, // DataBits
|
||||
0, // Parity
|
||||
0, // StopBits
|
||||
},
|
||||
|
||||
//
|
||||
@@ -926,6 +926,11 @@ PlatformBootManagerBeforeConsole (
|
||||
"PcdUartDefaultStopBits must be set to an actual value, not 'default'"
|
||||
);
|
||||
|
||||
mSerialConsole.Uart.BaudRate = PcdGet64 (PcdUartDefaultBaudRate);
|
||||
mSerialConsole.Uart.DataBits = PcdGet8 (PcdUartDefaultDataBits);
|
||||
mSerialConsole.Uart.Parity = PcdGet8 (PcdUartDefaultParity);
|
||||
mSerialConsole.Uart.StopBits = PcdGet8 (PcdUartDefaultStopBits);
|
||||
|
||||
CopyGuid (&mSerialConsole.TermType.Guid, &gEfiTtyTermGuid);
|
||||
|
||||
EfiBootManagerUpdateConsoleVariable (
|
||||
|
||||
Reference in New Issue
Block a user