summaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_device_path_to_text.c
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2021-03-19 02:49:54 +0100
committerHeinrich Schuchardt <xypron.glpk@gmx.de>2021-03-19 20:54:40 +0100
commit62df6e9c9994c66efd34afe710a64de27dd120bc (patch)
treee991158345b91c597671f18424bc27f95822eae4 /lib/efi_loader/efi_device_path_to_text.c
parenta95f4c88599176d9a88dc19c02fa8dd95003eebf (diff)
efi_loader: Uart device path
When uploading an EFI binary via the UART we need to assign a device path. * Provide devicepath node to text conversion for Uart() node. * Provide function to create Uart() device path. * Add UART support to efi_dp_from_name(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'lib/efi_loader/efi_device_path_to_text.c')
-rw-r--r--lib/efi_loader/efi_device_path_to_text.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/efi_loader/efi_device_path_to_text.c b/lib/efi_loader/efi_device_path_to_text.c
index edc9fdc3870..43554cd771b 100644
--- a/lib/efi_loader/efi_device_path_to_text.c
+++ b/lib/efi_loader/efi_device_path_to_text.c
@@ -118,6 +118,19 @@ static char *dp_msging(char *s, struct efi_device_path *dp)
ide->logical_unit_number);
break;
}
+ case DEVICE_PATH_SUB_TYPE_MSG_UART: {
+ struct efi_device_path_uart *uart =
+ (struct efi_device_path_uart *)dp;
+ s += sprintf(s, "Uart(%lld,%d,%d,", uart->baud_rate,
+ uart->data_bits, uart->parity);
+ switch (uart->stop_bits) {
+ case 2:
+ s += sprintf(s, "1.5)");
+ default:
+ s += sprintf(s, "%d)", uart->stop_bits);
+ }
+ break;
+ }
case DEVICE_PATH_SUB_TYPE_MSG_USB: {
struct efi_device_path_usb *udp =
(struct efi_device_path_usb *)dp;