diff options
Diffstat (limited to 'src/drivers/intel/fsp1_1/include/fsp')
-rw-r--r-- | src/drivers/intel/fsp1_1/include/fsp/api.h | 41 | ||||
-rw-r--r-- | src/drivers/intel/fsp1_1/include/fsp/gop.h | 33 | ||||
-rw-r--r-- | src/drivers/intel/fsp1_1/include/fsp/soc_binding.h | 43 | ||||
-rw-r--r-- | src/drivers/intel/fsp1_1/include/fsp/uefi_binding.h | 39 | ||||
-rw-r--r-- | src/drivers/intel/fsp1_1/include/fsp/util.h | 96 |
5 files changed, 252 insertions, 0 deletions
diff --git a/src/drivers/intel/fsp1_1/include/fsp/api.h b/src/drivers/intel/fsp1_1/include/fsp/api.h new file mode 100644 index 0000000000..414532c09b --- /dev/null +++ b/src/drivers/intel/fsp1_1/include/fsp/api.h @@ -0,0 +1,41 @@ +/* + * This file is part of the coreboot project. + * + * Copyright 2015 Google Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc. + */ + +#ifndef _FSP1_1_API_H_ +#define _FSP1_1_API_H_ + +#define FSP_SIG 0x48505346 /* 'FSPH' */ + +/* All the FSP headers need to have UEFI types provided before inclusion. */ +#include <fsp/uefi_binding.h> + +/* + * Intel's code does not have a handle on changing global packing state. + * Therefore, one needs to protect against packing policies that are set + * globally for a compliation unit just by including a header file. + */ +#pragma pack(push) + +#include <vendorcode/intel/fsp/fsp1_1/IntelFspPkg/Include/FspApi.h> +#include <vendorcode/intel/fsp/fsp1_1/IntelFspPkg/Include/FspInfoHeader.h> + +/* Restore original packing policy. */ +#pragma pack(pop) + +#endif diff --git a/src/drivers/intel/fsp1_1/include/fsp/gop.h b/src/drivers/intel/fsp1_1/include/fsp/gop.h new file mode 100644 index 0000000000..14bada6f96 --- /dev/null +++ b/src/drivers/intel/fsp1_1/include/fsp/gop.h @@ -0,0 +1,33 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2015 Intel Corp. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc. + */ + +#ifndef _FSP1_1_GOP_H_ +#define _FSP1_1_GOP_H_ + +/* GOP support */ +#if IS_ENABLED(CONFIG_GOP_SUPPORT) + +#include <boot/coreboot_tables.h> +#include <soc/intel/common/gma.h> + +const optionrom_vbt_t *fsp_get_vbt(uint32_t *vbt_len); +void fsp_gop_framebuffer(struct lb_header *header); + +#endif /* CONFIG_GOP_SUPPORT */ +#endif /* _FSP_GOP_H_ */ diff --git a/src/drivers/intel/fsp1_1/include/fsp/soc_binding.h b/src/drivers/intel/fsp1_1/include/fsp/soc_binding.h new file mode 100644 index 0000000000..1625040be8 --- /dev/null +++ b/src/drivers/intel/fsp1_1/include/fsp/soc_binding.h @@ -0,0 +1,43 @@ +/* + * This file is part of the coreboot project. + * + * Copyright 2015 Google Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc. + */ + +#ifndef _FSP1_1_SOC_BINDING_H_ +#define _FSP1_1_SOC_BINDING_H_ + +/* All the FSP headers need to have UEFI types provided before inclusion. */ +#include <fsp/uefi_binding.h> + +/* + * Intel's code does not have a handle on changing global packing state. + * Therefore, one needs to protect against packing policies that are set + * globally for a compliation unit just by including a header file. + */ +#pragma pack(push) + +/* + * This file is found by way of the Kconfig FSP_INCLUDE_PATH option. It is + * a per implementation specific header. i.e. different FSP implementations + * for different chipsets. + */ +#include <FspUpdVpd.h> + +/* Restore original packing policy. */ +#pragma pack(pop) + +#endif diff --git a/src/drivers/intel/fsp1_1/include/fsp/uefi_binding.h b/src/drivers/intel/fsp1_1/include/fsp/uefi_binding.h new file mode 100644 index 0000000000..73a8a4a7dc --- /dev/null +++ b/src/drivers/intel/fsp1_1/include/fsp/uefi_binding.h @@ -0,0 +1,39 @@ +/* + * This file is part of the coreboot project. + * + * Copyright 2015 Google Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc. + */ + +#ifndef _FSP1_1_UEFI_BINDING_H_ +#define _FSP1_1_UEFI_BINDING_H_ + +/* + * Intel's code does not have a handle on changing global packing state. + * Therefore, one needs to protect against packing policies that are set + * globally for a compliation unit just by including a header file. + */ +#pragma pack(push) + +/* + * Pull in the UEFI types from 2.4. Smarter decisions can be made on what + * version to bind to, but for now 2.4 is standard for FSP 1.1. + */ +#include <vendorcode/intel/edk2/uefi_2.4/uefi_types.h> + +/* Restore original packing policy. */ +#pragma pack(pop) + +#endif diff --git a/src/drivers/intel/fsp1_1/include/fsp/util.h b/src/drivers/intel/fsp1_1/include/fsp/util.h new file mode 100644 index 0000000000..9695b3b697 --- /dev/null +++ b/src/drivers/intel/fsp1_1/include/fsp/util.h @@ -0,0 +1,96 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2013-2014 Sage Electronic Engineering, LLC. + * Copyright (C) 2015 Intel Corp. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc. + */ + +#ifndef FSP1_1_UTIL_H +#define FSP1_1_UTIL_H + +#include <fsp/api.h> +/* Current users expect to get the SoC's FSP definitions by including util.h. */ +#include <fsp/soc_binding.h> +#include <fsp/gop.h> +#include <program_loading.h> +#include <region.h> + +/* find_fsp() should only be called from assembly code. */ +FSP_INFO_HEADER *find_fsp(uintptr_t fsp_base_address); +/* Set FSP's runtime information. */ +void fsp_set_runtime(FSP_INFO_HEADER *fih, void *hob_list); +/* Use a new FSP_INFO_HEADER at runtime. */ +void fsp_update_fih(FSP_INFO_HEADER *fih); +/* fsp_get_fih() is only valid after calling fsp_set_runtime(). */ +FSP_INFO_HEADER *fsp_get_fih(void); +/* fsp_get_hob_list() is only valid after calling fsp_set_runtime(). */ +void *fsp_get_hob_list(void); +void fsp_early_init(FSP_INFO_HEADER *fsp_info); +void fsp_notify(u32 phase); +void print_hob_type_structure(u16 hob_type, void *hob_list_ptr); +void print_fsp_info(FSP_INFO_HEADER *fsp_header); +void *get_next_type_guid_hob(UINT16 type, const EFI_GUID *guid, + const void *hob_start); +void *get_next_resource_hob(const EFI_GUID *guid, const void *hob_start); +void *get_first_resource_hob(const EFI_GUID *guid); +/* + * Relocate FSP entire binary into ram. Returns < 0 on error, 0 on success. + * The FSP source is pointed to by region_device and the relocation information + * is encoded in a struct prog with its entry point set to the FSP info header. + */ +int fsp_relocate(struct prog *fsp_relocd, const struct region_device *fsp_src); + +/* Additional HOB types not included in the FSP: + * #define EFI_HOB_TYPE_HANDOFF 0x0001 + * #define EFI_HOB_TYPE_MEMORY_ALLOCATION 0x0002 + * #define EFI_HOB_TYPE_RESOURCE_DESCRIPTOR 0x0003 + * #define EFI_HOB_TYPE_GUID_EXTENSION 0x0004 + * #define EFI_HOB_TYPE_FV 0x0005 + * #define EFI_HOB_TYPE_CPU 0x0006 + * #define EFI_HOB_TYPE_MEMORY_POOL 0x0007 + * #define EFI_HOB_TYPE_CV 0x0008 + * #define EFI_HOB_TYPE_UNUSED 0xFFFE + * #define EFI_HOB_TYPE_END_OF_HOB_LIST 0xffff + */ +#define EFI_HOB_TYPE_HANDOFF 0x0001 +#define EFI_HOB_TYPE_MEMORY_POOL 0x0007 + +/* The offset in bytes from the start of the info structure */ +#define FSP_IMAGE_SIG_LOC 0 +#define FSP_IMAGE_ID_LOC 16 +#define FSP_IMAGE_BASE_LOC 28 +#define FSP_IMAGE_ATTRIBUTE_LOC 32 +#define GRAPHICS_SUPPORT_BIT (1 << 0) + +#define ERROR_NO_FV_SIG 1 +#define ERROR_NO_FFS_GUID 2 +#define ERROR_NO_INFO_HEADER 3 +#define ERROR_IMAGEBASE_MISMATCH 4 +#define ERROR_INFO_HEAD_SIG_MISMATCH 5 +#define ERROR_FSP_SIG_MISMATCH 6 + +#if ENV_RAMSTAGE +extern void *FspHobListPtr; +#endif + +/* TODO: Remove the EFI types and decorations from coreboot implementations. */ +VOID * EFIAPI get_hob_list(VOID); +VOID * EFIAPI get_next_hob(UINT16 type, CONST VOID *hob_start); +VOID * EFIAPI get_first_hob(UINT16 type); +VOID * EFIAPI get_next_guid_hob(CONST EFI_GUID * guid, CONST VOID *hob_start); +VOID * EFIAPI get_first_guid_hob(CONST EFI_GUID * guid); + +#endif /* FSP1_1_UTIL_H */ |