Skip to content

Commit 144d52d

Browse files
committed
x86/efistub: Drop long obsolete UGA support
UGA is the EFI graphical output protocol that preceded GOP, and has been long obsolete. Drop support for it from the x86 implementation of the EFI stub - other architectures never bothered to implement it (save for ia64) Signed-off-by: Ard Biesheuvel <[email protected]>
1 parent ec46969 commit 144d52d

File tree

4 files changed

+0
-107
lines changed

4 files changed

+0
-107
lines changed

arch/x86/platform/efi/efi.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,11 @@
5454
#include <asm/uv/uv.h>
5555

5656
static unsigned long efi_systab_phys __initdata;
57-
static unsigned long uga_phys = EFI_INVALID_TABLE_ADDR;
5857
static unsigned long efi_runtime, efi_nr_tables;
5958

6059
unsigned long efi_fw_vendor, efi_config_table;
6160

6261
static const efi_config_table_type_t arch_tables[] __initconst = {
63-
{UGA_IO_PROTOCOL_GUID, &uga_phys, "UGA" },
6462
#ifdef CONFIG_X86_UV
6563
{UV_SYSTEM_TABLE_GUID, &uv_systab_phys, "UVsystab" },
6664
#endif
@@ -72,7 +70,6 @@ static const unsigned long * const efi_tables[] = {
7270
&efi.acpi20,
7371
&efi.smbios,
7472
&efi.smbios3,
75-
&uga_phys,
7673
#ifdef CONFIG_X86_UV
7774
&uv_systab_phys,
7875
#endif
@@ -891,13 +888,6 @@ bool efi_is_table_address(unsigned long phys_addr)
891888
return false;
892889
}
893890

894-
char *efi_systab_show_arch(char *str)
895-
{
896-
if (uga_phys != EFI_INVALID_TABLE_ADDR)
897-
str += sprintf(str, "UGA=0x%lx\n", uga_phys);
898-
return str;
899-
}
900-
901891
#define EFI_FIELD(var) efi_ ## var
902892

903893
#define EFI_ATTR_SHOW(name) \

drivers/firmware/efi/efi.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,6 @@ static ssize_t systab_show(struct kobject *kobj,
148148
if (efi.smbios != EFI_INVALID_TABLE_ADDR)
149149
str += sprintf(str, "SMBIOS=0x%lx\n", efi.smbios);
150150

151-
if (IS_ENABLED(CONFIG_X86))
152-
str = efi_systab_show_arch(str);
153-
154151
return str - buf;
155152
}
156153

drivers/firmware/efi/libstub/x86-stub.c

Lines changed: 0 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -405,96 +405,13 @@ static void setup_quirks(struct boot_params *boot_params)
405405
}
406406
}
407407

408-
/*
409-
* See if we have Universal Graphics Adapter (UGA) protocol
410-
*/
411-
static efi_status_t
412-
setup_uga(struct screen_info *si, efi_guid_t *uga_proto, unsigned long size)
413-
{
414-
efi_status_t status;
415-
u32 width, height;
416-
void **uga_handle = NULL;
417-
efi_uga_draw_protocol_t *uga = NULL, *first_uga;
418-
efi_handle_t handle;
419-
int i;
420-
421-
status = efi_bs_call(allocate_pool, EFI_LOADER_DATA, size,
422-
(void **)&uga_handle);
423-
if (status != EFI_SUCCESS)
424-
return status;
425-
426-
status = efi_bs_call(locate_handle, EFI_LOCATE_BY_PROTOCOL,
427-
uga_proto, NULL, &size, uga_handle);
428-
if (status != EFI_SUCCESS)
429-
goto free_handle;
430-
431-
height = 0;
432-
width = 0;
433-
434-
first_uga = NULL;
435-
for_each_efi_handle(handle, uga_handle, size, i) {
436-
efi_guid_t pciio_proto = EFI_PCI_IO_PROTOCOL_GUID;
437-
u32 w, h, depth, refresh;
438-
void *pciio;
439-
440-
status = efi_bs_call(handle_protocol, handle, uga_proto,
441-
(void **)&uga);
442-
if (status != EFI_SUCCESS)
443-
continue;
444-
445-
pciio = NULL;
446-
efi_bs_call(handle_protocol, handle, &pciio_proto, &pciio);
447-
448-
status = efi_call_proto(uga, get_mode, &w, &h, &depth, &refresh);
449-
if (status == EFI_SUCCESS && (!first_uga || pciio)) {
450-
width = w;
451-
height = h;
452-
453-
/*
454-
* Once we've found a UGA supporting PCIIO,
455-
* don't bother looking any further.
456-
*/
457-
if (pciio)
458-
break;
459-
460-
first_uga = uga;
461-
}
462-
}
463-
464-
if (!width && !height)
465-
goto free_handle;
466-
467-
/* EFI framebuffer */
468-
si->orig_video_isVGA = VIDEO_TYPE_EFI;
469-
470-
si->lfb_depth = 32;
471-
si->lfb_width = width;
472-
si->lfb_height = height;
473-
474-
si->red_size = 8;
475-
si->red_pos = 16;
476-
si->green_size = 8;
477-
si->green_pos = 8;
478-
si->blue_size = 8;
479-
si->blue_pos = 0;
480-
si->rsvd_size = 8;
481-
si->rsvd_pos = 24;
482-
483-
free_handle:
484-
efi_bs_call(free_pool, uga_handle);
485-
486-
return status;
487-
}
488-
489408
static void setup_graphics(struct boot_params *boot_params)
490409
{
491410
efi_guid_t graphics_proto = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID;
492411
struct screen_info *si;
493-
efi_guid_t uga_proto = EFI_UGA_PROTOCOL_GUID;
494412
efi_status_t status;
495413
unsigned long size;
496414
void **gop_handle = NULL;
497-
void **uga_handle = NULL;
498415

499416
si = &boot_params->screen_info;
500417
memset(si, 0, sizeof(*si));
@@ -505,13 +422,6 @@ static void setup_graphics(struct boot_params *boot_params)
505422
if (status == EFI_BUFFER_TOO_SMALL)
506423
status = efi_setup_gop(si, &graphics_proto, size);
507424

508-
if (status != EFI_SUCCESS) {
509-
size = 0;
510-
status = efi_bs_call(locate_handle, EFI_LOCATE_BY_PROTOCOL,
511-
&uga_proto, NULL, &size, uga_handle);
512-
if (status == EFI_BUFFER_TOO_SMALL)
513-
setup_uga(si, &uga_proto, size);
514-
}
515425
}
516426

517427

include/linux/efi.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,6 @@ void efi_native_runtime_setup(void);
363363
#define ACPI_20_TABLE_GUID EFI_GUID(0x8868e871, 0xe4f1, 0x11d3, 0xbc, 0x22, 0x00, 0x80, 0xc7, 0x3c, 0x88, 0x81)
364364
#define SMBIOS_TABLE_GUID EFI_GUID(0xeb9d2d31, 0x2d88, 0x11d3, 0x9a, 0x16, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d)
365365
#define SMBIOS3_TABLE_GUID EFI_GUID(0xf2fd1544, 0x9794, 0x4a2c, 0x99, 0x2e, 0xe5, 0xbb, 0xcf, 0x20, 0xe3, 0x94)
366-
#define UGA_IO_PROTOCOL_GUID EFI_GUID(0x61a4d49e, 0x6f68, 0x4f1b, 0xb9, 0x22, 0xa8, 0x6e, 0xed, 0x0b, 0x07, 0xa2)
367366
#define EFI_GLOBAL_VARIABLE_GUID EFI_GUID(0x8be4df61, 0x93ca, 0x11d2, 0xaa, 0x0d, 0x00, 0xe0, 0x98, 0x03, 0x2b, 0x8c)
368367
#define UV_SYSTEM_TABLE_GUID EFI_GUID(0x3b13a7d4, 0x633e, 0x11dd, 0x93, 0xec, 0xda, 0x25, 0x56, 0xd8, 0x95, 0x93)
369368
#define LINUX_EFI_CRASH_GUID EFI_GUID(0xcfc8fc79, 0xbe2e, 0x4ddc, 0x97, 0xf0, 0x9f, 0x98, 0xbf, 0xe2, 0x98, 0xa0)
@@ -373,7 +372,6 @@ void efi_native_runtime_setup(void);
373372
#define EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID EFI_GUID(0x8b843e20, 0x8132, 0x4852, 0x90, 0xcc, 0x55, 0x1a, 0x4e, 0x4a, 0x7f, 0x1c)
374373
#define EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID EFI_GUID(0x05c99a21, 0xc70f, 0x4ad2, 0x8a, 0x5f, 0x35, 0xdf, 0x33, 0x43, 0xf5, 0x1e)
375374
#define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID EFI_GUID(0x9042a9de, 0x23dc, 0x4a38, 0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a)
376-
#define EFI_UGA_PROTOCOL_GUID EFI_GUID(0x982c298b, 0xf4fa, 0x41cb, 0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39)
377375
#define EFI_PCI_IO_PROTOCOL_GUID EFI_GUID(0x4cf5b200, 0x68b8, 0x4ca5, 0x9e, 0xec, 0xb2, 0x3e, 0x3f, 0x50, 0x02, 0x9a)
378376
#define EFI_FILE_INFO_ID EFI_GUID(0x09576e92, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b)
379377
#define EFI_SYSTEM_RESOURCE_TABLE_GUID EFI_GUID(0xb122a263, 0x3661, 0x4f68, 0x99, 0x29, 0x78, 0xf8, 0xb0, 0xd6, 0x21, 0x80)
@@ -1286,8 +1284,6 @@ struct linux_efi_memreserve {
12861284

12871285
void __init efi_arch_mem_reserve(phys_addr_t addr, u64 size);
12881286

1289-
char *efi_systab_show_arch(char *str);
1290-
12911287
/*
12921288
* The LINUX_EFI_MOK_VARIABLE_TABLE_GUID config table can be provided
12931289
* to the kernel by an EFI boot loader. The table contains a packed

0 commit comments

Comments
 (0)