Skip to content

Commit 58ff3b7

Browse files
committed
Merge tag 'efi-core-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull EFI updates from Ingo Molnar: "The EFI changes for this cycle are: - preliminary changes for RISC-V - Add support for setting the resolution on the EFI framebuffer - Simplify kernel image loading for arm64 - Move .bss into .data via the linker script instead of relying on symbol annotations. - Get rid of __pure getters to access global variables - Clean up the config table matching arrays - Rename pr_efi/pr_efi_err to efi_info/efi_err, and use them consistently - Simplify and unify initrd loading - Parse the builtin command line on x86 (if provided) - Implement printk() support, including support for wide character strings - Simplify GDT handling in early mixed mode thunking code - Some other minor fixes and cleanups" * tag 'efi-core-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (79 commits) efi/x86: Don't blow away existing initrd efi/x86: Drop the special GDT for the EFI thunk efi/libstub: Add missing prototype for PE/COFF entry point efi/efivars: Add missing kobject_put() in sysfs entry creation error path efi/libstub: Use pool allocation for the command line efi/libstub: Don't parse overlong command lines efi/libstub: Use snprintf with %ls to convert the command line efi/libstub: Get the exact UTF-8 length efi/libstub: Use %ls for filename efi/libstub: Add UTF-8 decoding to efi_puts efi/printf: Add support for wchar_t (UTF-16) efi/gop: Add an option to list out the available GOP modes efi/libstub: Add definitions for console input and events efi/libstub: Implement printk-style logging efi/printf: Turn vsprintf into vsnprintf efi/printf: Abort on invalid format efi/printf: Refactor code to consolidate padding and output efi/printf: Handle null string input efi/printf: Factor out integer argument retrieval efi/printf: Factor out width/precision parsing ...
2 parents a7092c8 + e9524fb commit 58ff3b7

File tree

38 files changed

+2050
-829
lines changed

38 files changed

+2050
-829
lines changed

Documentation/fb/efifb.rst

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
What is efifb?
33
==============
44

5-
This is a generic EFI platform driver for Intel based Apple computers.
6-
efifb is only for EFI booted Intel Macs.
5+
This is a generic EFI platform driver for systems with UEFI firmware. The
6+
system must be booted via the EFI stub for this to be usable. efifb supports
7+
both firmware with Graphics Output Protocol (GOP) displays as well as older
8+
systems with only Universal Graphics Adapter (UGA) displays.
79

810
Supported Hardware
911
==================
@@ -12,11 +14,14 @@ Supported Hardware
1214
- Macbook
1315
- Macbook Pro 15"/17"
1416
- MacMini
17+
- ARM/ARM64/X86 systems with UEFI firmware
1518

1619
How to use it?
1720
==============
1821

19-
efifb does not have any kind of autodetection of your machine.
22+
For UGA displays, efifb does not have any kind of autodetection of your
23+
machine.
24+
2025
You have to add the following kernel parameters in your elilo.conf::
2126

2227
Macbook :
@@ -28,6 +33,9 @@ You have to add the following kernel parameters in your elilo.conf::
2833
Macbook Pro 17", iMac 20" :
2934
video=efifb:i20
3035

36+
For GOP displays, efifb can autodetect the display's resolution and framebuffer
37+
address, so these should work out of the box without any special parameters.
38+
3139
Accepted options:
3240

3341
======= ===========================================================
@@ -36,4 +44,28 @@ nowc Don't map the framebuffer write combined. This can be used
3644
when large amounts of console data are written.
3745
======= ===========================================================
3846

47+
Options for GOP displays:
48+
49+
mode=n
50+
The EFI stub will set the mode of the display to mode number n if
51+
possible.
52+
53+
<xres>x<yres>[-(rgb|bgr|<bpp>)]
54+
The EFI stub will search for a display mode that matches the specified
55+
horizontal and vertical resolution, and optionally bit depth, and set
56+
the mode of the display to it if one is found. The bit depth can either
57+
"rgb" or "bgr" to match specifically those pixel formats, or a number
58+
for a mode with matching bits per pixel.
59+
60+
auto
61+
The EFI stub will choose the mode with the highest resolution (product
62+
of horizontal and vertical resolution). If there are multiple modes
63+
with the highest resolution, it will choose one with the highest color
64+
depth.
65+
66+
list
67+
The EFI stub will list out all the display modes that are available. A
68+
specific mode can then be chosen using one of the above options for the
69+
next boot.
70+
3971
Edgar Hucek <[email protected]>

arch/arm/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1955,7 +1955,7 @@ config EFI
19551955
select UCS2_STRING
19561956
select EFI_PARAMS_FROM_FDT
19571957
select EFI_STUB
1958-
select EFI_ARMSTUB
1958+
select EFI_GENERIC_STUB
19591959
select EFI_RUNTIME_WRAPPERS
19601960
---help---
19611961
This option provides support for runtime services provided

arch/arm/boot/compressed/efi-header.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ optional_header:
6060
.long __pecoff_code_size @ SizeOfCode
6161
.long __pecoff_data_size @ SizeOfInitializedData
6262
.long 0 @ SizeOfUninitializedData
63-
.long efi_entry - start @ AddressOfEntryPoint
63+
.long efi_pe_entry - start @ AddressOfEntryPoint
6464
.long start_offset @ BaseOfCode
6565
.long __pecoff_data_start - start @ BaseOfData
6666

arch/arm/boot/compressed/vmlinux.lds.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ SECTIONS
7878
* The EFI stub always executes from RAM, and runs strictly before the
7979
* decompressor, so we can make an exception for its r/w data, and keep it
8080
*/
81-
*(.data.efistub)
81+
*(.data.efistub .bss.efistub)
8282
__pecoff_data_end = .;
8383

8484
/*

arch/arm/include/asm/efi.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,6 @@ void efi_virtmap_unload(void);
5050

5151
/* arch specific definitions used by the stub code */
5252

53-
#define efi_bs_call(func, ...) efi_system_table()->boottime->func(__VA_ARGS__)
54-
#define efi_rt_call(func, ...) efi_system_table()->runtime->func(__VA_ARGS__)
55-
#define efi_is_native() (true)
56-
57-
#define efi_table_attr(inst, attr) (inst->attr)
58-
59-
#define efi_call_proto(inst, func, ...) inst->func(inst, ##__VA_ARGS__)
60-
6153
struct screen_info *alloc_screen_info(void);
6254
void free_screen_info(struct screen_info *si);
6355

arch/arm64/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1786,7 +1786,7 @@ config EFI
17861786
select EFI_PARAMS_FROM_FDT
17871787
select EFI_RUNTIME_WRAPPERS
17881788
select EFI_STUB
1789-
select EFI_ARMSTUB
1789+
select EFI_GENERIC_STUB
17901790
default y
17911791
help
17921792
This option provides support for runtime services provided

arch/arm64/include/asm/efi.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,6 @@ static inline unsigned long efi_get_max_initrd_addr(unsigned long dram_base,
8686
return (image_addr & ~(SZ_1G - 1UL)) + (1UL << (VA_BITS_MIN - 1));
8787
}
8888

89-
#define efi_bs_call(func, ...) efi_system_table()->boottime->func(__VA_ARGS__)
90-
#define efi_rt_call(func, ...) efi_system_table()->runtime->func(__VA_ARGS__)
91-
#define efi_is_native() (true)
92-
93-
#define efi_table_attr(inst, attr) (inst->attr)
94-
95-
#define efi_call_proto(inst, func, ...) inst->func(inst, ##__VA_ARGS__)
96-
9789
#define alloc_screen_info(x...) &screen_info
9890

9991
static inline void free_screen_info(struct screen_info *si)

arch/arm64/kernel/efi-entry.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
SYM_CODE_START(efi_enter_kernel)
1616
/*
17-
* efi_entry() will have copied the kernel image if necessary and we
17+
* efi_pe_entry() will have copied the kernel image if necessary and we
1818
* end up here with device tree address in x1 and the kernel entry
1919
* point stored in x0. Save those values in registers which are
2020
* callee preserved.

arch/arm64/kernel/efi-header.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ optional_header:
2727
.long __initdata_begin - efi_header_end // SizeOfCode
2828
.long __pecoff_data_size // SizeOfInitializedData
2929
.long 0 // SizeOfUninitializedData
30-
.long __efistub_efi_entry - _head // AddressOfEntryPoint
30+
.long __efistub_efi_pe_entry - _head // AddressOfEntryPoint
3131
.long efi_header_end - _head // BaseOfCode
3232

3333
extra_header_fields:

arch/ia64/kernel/efi.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ unsigned long hcdp_phys = EFI_INVALID_TABLE_ADDR;
5757
unsigned long sal_systab_phys = EFI_INVALID_TABLE_ADDR;
5858

5959
static const efi_config_table_type_t arch_tables[] __initconst = {
60-
{ESI_TABLE_GUID, "ESI", &esi_phys},
61-
{HCDP_TABLE_GUID, "HCDP", &hcdp_phys},
62-
{MPS_TABLE_GUID, "MPS", &mps_phys},
63-
{PROCESSOR_ABSTRACTION_LAYER_OVERWRITE_GUID, "PALO", &palo_phys},
64-
{SAL_SYSTEM_TABLE_GUID, "SALsystab", &sal_systab_phys},
65-
{NULL_GUID, NULL, 0},
60+
{ESI_TABLE_GUID, &esi_phys, "ESI" },
61+
{HCDP_TABLE_GUID, &hcdp_phys, "HCDP" },
62+
{MPS_TABLE_GUID, &mps_phys, "MPS" },
63+
{PROCESSOR_ABSTRACTION_LAYER_OVERWRITE_GUID, &palo_phys, "PALO" },
64+
{SAL_SYSTEM_TABLE_GUID, &sal_systab_phys, "SALsystab" },
65+
{},
6666
};
6767

6868
extern efi_status_t efi_call_phys (void *, ...);

0 commit comments

Comments
 (0)