From 32151d40172870e7772b1a393935001979a01aea Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Tue, 12 Jun 2018 08:36:18 -0700 Subject: x86: Add generic EFI payload support It is possible to create a generic EFI payload for all x86 boards. The payload is configured to include as many generic drivers as possible. All stuff that touches low-level initialization are not allowed as such is the EFI BIOS's responsibility. Platform specific drivers (like gpio, spi, etc) are not included. Signed-off-by: Bin Meng Reviewed-by: Simon Glass --- include/configs/efi-x86_payload.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 include/configs/efi-x86_payload.h (limited to 'include') diff --git a/include/configs/efi-x86_payload.h b/include/configs/efi-x86_payload.h new file mode 100644 index 00000000000..9c62fd24b88 --- /dev/null +++ b/include/configs/efi-x86_payload.h @@ -0,0 +1,32 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (C) 2018, Bin Meng + */ + +/* + * board/config.h - configuration options, board specific + */ + +#ifndef __CONFIG_H +#define __CONFIG_H + +#include + +#define CONFIG_SYS_MONITOR_LEN (1 << 20) + +#define CONFIG_STD_DEVICES_SETTINGS "stdin=serial,i8042-kbd\0" \ + "stdout=serial,vidconsole\0" \ + "stderr=serial,vidconsole\0" + +/* ATA/IDE support */ +#define CONFIG_SYS_IDE_MAXBUS 2 +#define CONFIG_SYS_IDE_MAXDEVICE 4 +#define CONFIG_SYS_ATA_BASE_ADDR 0 +#define CONFIG_SYS_ATA_DATA_OFFSET 0 +#define CONFIG_SYS_ATA_REG_OFFSET 0 +#define CONFIG_SYS_ATA_ALT_OFFSET 0 +#define CONFIG_SYS_ATA_IDE0_OFFSET 0x1f0 +#define CONFIG_SYS_ATA_IDE1_OFFSET 0x170 +#define CONFIG_ATAPI + +#endif /* __CONFIG_H */ -- cgit v1.2.3 From d1fe9927465c3df03c7c0c8f62bd8468d24f66bc Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Tue, 12 Jun 2018 08:36:21 -0700 Subject: efi: stub: Pass EFI GOP information to U-Boot payload If UEFI BIOS has the graphics output protocol (GOP), let's pass its information to U-Boot payload so that U-Boot can utilize it (eg: an EFI framebuffer driver). Signed-off-by: Bin Meng Reviewed-by: Simon Glass --- include/efi.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'include') diff --git a/include/efi.h b/include/efi.h index e30a3c51c67..2448dde3fe7 100644 --- a/include/efi.h +++ b/include/efi.h @@ -241,6 +241,7 @@ struct efi_open_protocol_info_entry { enum efi_entry_t { EFIET_END, /* Signals this is the last (empty) entry */ EFIET_MEMORY_MAP, + EFIET_GOP_MODE, /* Number of entries */ EFIET_MEMORY_COUNT, @@ -297,6 +298,40 @@ struct efi_entry_memmap { struct efi_mem_desc desc[]; }; +/** + * struct efi_entry_gopmode - a GOP mode table passed to U-Boot + * + * @fb_base: EFI's framebuffer base address + * @fb_size: EFI's framebuffer size + * @info_size: GOP mode info structure size + * @info: Start address of the GOP mode info structure + */ +struct efi_entry_gopmode { + efi_physical_addr_t fb_base; + /* + * Not like the ones in 'struct efi_gop_mode' which are 'unsigned + * long', @fb_size and @info_size have to be 'u64' here. As the EFI + * stub codes may have different bit size from the U-Boot payload, + * using 'long' will cause mismatch between the producer (stub) and + * the consumer (payload). + */ + u64 fb_size; + u64 info_size; + /* + * We cannot directly use 'struct efi_gop_mode_info info[]' here as + * it causes compiler to complain: array type has incomplete element + * type 'struct efi_gop_mode_info'. + */ + struct /* efi_gop_mode_info */ { + u32 version; + u32 width; + u32 height; + u32 pixel_format; + u32 pixel_bitmask[4]; + u32 pixels_per_scanline; + } info[]; +}; + static inline struct efi_mem_desc *efi_get_next_mem_desc( struct efi_entry_memmap *map, struct efi_mem_desc *desc) { -- cgit v1.2.3 From 3ebd892fda2d07f153a14cb30e60ae707e9e4208 Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Tue, 12 Jun 2018 08:36:24 -0700 Subject: x86: Rename efi-x86 target to efi-x86_app To avoid confusion, let's rename the efi-x86 target to efi-x86_app. Signed-off-by: Bin Meng Reviewed-by: Simon Glass --- include/configs/efi-x86.h | 17 ----------------- include/configs/efi-x86_app.h | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 17 deletions(-) delete mode 100644 include/configs/efi-x86.h create mode 100644 include/configs/efi-x86_app.h (limited to 'include') diff --git a/include/configs/efi-x86.h b/include/configs/efi-x86.h deleted file mode 100644 index 33418cfbec4..00000000000 --- a/include/configs/efi-x86.h +++ /dev/null @@ -1,17 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* - * Copyright (c) 2015 Google, Inc - */ - -#ifndef __CONFIG_H -#define __CONFIG_H - -#include - -#undef CONFIG_TPM_TIS_BASE_ADDRESS - -#define CONFIG_STD_DEVICES_SETTINGS "stdin=usbkbd,vga,serial\0" \ - "stdout=vga,serial\0" \ - "stderr=vga,serial\0" - -#endif diff --git a/include/configs/efi-x86_app.h b/include/configs/efi-x86_app.h new file mode 100644 index 00000000000..33418cfbec4 --- /dev/null +++ b/include/configs/efi-x86_app.h @@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (c) 2015 Google, Inc + */ + +#ifndef __CONFIG_H +#define __CONFIG_H + +#include + +#undef CONFIG_TPM_TIS_BASE_ADDRESS + +#define CONFIG_STD_DEVICES_SETTINGS "stdin=usbkbd,vga,serial\0" \ + "stdout=vga,serial\0" \ + "stderr=vga,serial\0" + +#endif -- cgit v1.2.3