loader.efi: Make framebuffer commands available for arm64

Move framebuffer.{c,h} to sys/boot/efi/loader and add the efifb
related metadata and pass it to the kernel

Reviewed by:	imp, andrew
Differential Revision:	https://reviews.freebsd.org/D12757
This commit is contained in:
Emmanuel Vadot 2017-10-25 18:55:04 +00:00
parent 3de0952fba
commit 7562d7ddbd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=324995
6 changed files with 18 additions and 4 deletions

View File

@ -31,6 +31,7 @@
#define MODINFOMD_EFI_MAP 0x1001
#define MODINFOMD_DTBP 0x1002
#define MODINFOMD_EFI_FB 0x1003
struct efi_map_header {
size_t memory_size;
@ -38,4 +39,16 @@ struct efi_map_header {
uint32_t descriptor_version;
};
struct efi_fb {
uint64_t fb_addr;
uint64_t fb_size;
uint32_t fb_height;
uint32_t fb_width;
uint32_t fb_stride;
uint32_t fb_mask_red;
uint32_t fb_mask_green;
uint32_t fb_mask_blue;
uint32_t fb_mask_reserved;
};
#endif /* !_MACHINE_METADATA_H_ */

View File

@ -22,6 +22,7 @@ SRCS= autoload.c \
conf.c \
copy.c \
efi_main.c \
framebuffer.c \
main.c \
self_reloc.c \
smbios.c \

View File

@ -2,7 +2,6 @@
SRCS+= amd64_tramp.S \
start.S \
framebuffer.c \
elf64_freebsd.c \
trap.c \
exc.S

View File

@ -48,9 +48,10 @@ __FBSDID("$FreeBSD$");
#if defined(__amd64__)
#include <machine/specialreg.h>
#include "framebuffer.h"
#endif
#include "framebuffer.h"
#if defined(LOADER_FDT_SUPPORT)
#include <fdt_platform.h>
#endif
@ -247,12 +248,12 @@ bi_load_efi_data(struct preloaded_file *kfp)
UINT32 mmver;
struct efi_map_header *efihdr;
#if defined(__amd64__)
#if defined(__amd64__) || defined(__aarch64__)
struct efi_fb efifb;
if (efi_find_framebuffer(&efifb) == 0) {
printf("EFI framebuffer information:\n");
printf("addr, size 0x%lx, 0x%lx\n", efifb.fb_addr,
printf("addr, size 0x%jx, 0x%jx\n", efifb.fb_addr,
efifb.fb_size);
printf("dimensions %d x %d\n", efifb.fb_width,
efifb.fb_height);