aboutsummaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/intel/fsp1_1/Kconfig1
-rw-r--r--src/drivers/intel/fsp1_1/Makefile.inc4
-rw-r--r--src/drivers/intel/fsp1_1/fsp_gop.c2
-rw-r--r--src/drivers/intel/fsp1_1/fsp_relocate.c3
-rw-r--r--src/drivers/intel/fsp1_1/fsp_util.c2
-rw-r--r--src/drivers/intel/fsp1_1/hob.c2
-rw-r--r--src/drivers/intel/fsp1_1/include/fsp/api.h41
-rw-r--r--src/drivers/intel/fsp1_1/include/fsp/gop.h (renamed from src/drivers/intel/fsp1_1/fsp_gop.h)4
-rw-r--r--src/drivers/intel/fsp1_1/include/fsp/soc_binding.h43
-rw-r--r--src/drivers/intel/fsp1_1/include/fsp/uefi_binding.h39
-rw-r--r--src/drivers/intel/fsp1_1/include/fsp/util.h (renamed from src/drivers/intel/fsp1_1/fsp_util.h)36
11 files changed, 147 insertions, 30 deletions
diff --git a/src/drivers/intel/fsp1_1/Kconfig b/src/drivers/intel/fsp1_1/Kconfig
index 2ffa323253..d23d9666f0 100644
--- a/src/drivers/intel/fsp1_1/Kconfig
+++ b/src/drivers/intel/fsp1_1/Kconfig
@@ -19,6 +19,7 @@
config PLATFORM_USES_FSP1_1
bool
+ select UEFI_2_4_BINDING
help
Does the code require the Intel Firmware Support Package?
diff --git a/src/drivers/intel/fsp1_1/Makefile.inc b/src/drivers/intel/fsp1_1/Makefile.inc
index f831f9d696..bab68e142d 100644
--- a/src/drivers/intel/fsp1_1/Makefile.inc
+++ b/src/drivers/intel/fsp1_1/Makefile.inc
@@ -26,7 +26,9 @@ ramstage-y += fsp_relocate.c
ramstage-y += fsp_util.c
ramstage-y += hob.c
-CPPFLAGS_common += -Isrc/drivers/intel/fsp1_1
+CPPFLAGS_common += -Isrc/drivers/intel/fsp1_1/include
+# Where FspUpdVpd.h can be picked up from.
+CPPFLAGS_common += -I$(CONFIG_FSP_INCLUDE_PATH)
cpu_incs-$(CONFIG_USE_GENERIC_FSP_CAR_INC) += $(src)/drivers/intel/fsp1_1/cache_as_ram.inc
diff --git a/src/drivers/intel/fsp1_1/fsp_gop.c b/src/drivers/intel/fsp1_1/fsp_gop.c
index ed1f1b4057..c5b515c1b3 100644
--- a/src/drivers/intel/fsp1_1/fsp_gop.c
+++ b/src/drivers/intel/fsp1_1/fsp_gop.c
@@ -19,7 +19,7 @@
#include <cbfs.h>
#include <console/console.h>
-#include "fsp_util.h"
+#include <fsp/util.h>
#include <lib.h>
/* Reading VBT table from flash */
diff --git a/src/drivers/intel/fsp1_1/fsp_relocate.c b/src/drivers/intel/fsp1_1/fsp_relocate.c
index 3e526086e2..2cc2560d33 100644
--- a/src/drivers/intel/fsp1_1/fsp_relocate.c
+++ b/src/drivers/intel/fsp1_1/fsp_relocate.c
@@ -19,11 +19,10 @@
#include <console/console.h>
#include <cbmem.h>
-#include <fsp_util.h>
+#include <fsp/util.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
-#include <uefi_types.h>
#define FSP_DBG_LVL BIOS_NEVER
diff --git a/src/drivers/intel/fsp1_1/fsp_util.c b/src/drivers/intel/fsp1_1/fsp_util.c
index e6e3889eb4..d44f0f0157 100644
--- a/src/drivers/intel/fsp1_1/fsp_util.c
+++ b/src/drivers/intel/fsp1_1/fsp_util.c
@@ -21,7 +21,7 @@
#include <bootstate.h>
#include <cbmem.h>
#include <console/console.h>
-#include "fsp_util.h"
+#include <fsp/util.h>
#include <timestamp.h>
/* Locate the FSP binary in the coreboot filesystem */
diff --git a/src/drivers/intel/fsp1_1/hob.c b/src/drivers/intel/fsp1_1/hob.c
index 05044cb778..467d4afd0f 100644
--- a/src/drivers/intel/fsp1_1/hob.c
+++ b/src/drivers/intel/fsp1_1/hob.c
@@ -23,7 +23,7 @@
#include <bootstate.h>
#include <cbmem.h>
#include <console/console.h>
-#include "fsp_util.h"
+#include <fsp/util.h>
#include <ip_checksum.h>
#include <lib.h> // hexdump
#include <string.h>
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/fsp_gop.h b/src/drivers/intel/fsp1_1/include/fsp/gop.h
index 2999369e2f..14bada6f96 100644
--- a/src/drivers/intel/fsp1_1/fsp_gop.h
+++ b/src/drivers/intel/fsp1_1/include/fsp/gop.h
@@ -17,8 +17,8 @@
* Foundation, Inc.
*/
-#ifndef _FSP_GOP_H_
-#define _FSP_GOP_H_
+#ifndef _FSP1_1_GOP_H_
+#define _FSP1_1_GOP_H_
/* GOP support */
#if IS_ENABLED(CONFIG_GOP_SUPPORT)
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/fsp_util.h b/src/drivers/intel/fsp1_1/include/fsp/util.h
index 51ecb98f2c..9695b3b697 100644
--- a/src/drivers/intel/fsp1_1/fsp_util.h
+++ b/src/drivers/intel/fsp1_1/include/fsp/util.h
@@ -18,29 +18,16 @@
* Foundation, Inc.
*/
-#ifndef FSP_UTIL_H
-#define FSP_UTIL_H
+#ifndef FSP1_1_UTIL_H
+#define FSP1_1_UTIL_H
-#include <types.h>
-#include <arch/cpu.h>
-#include <fsp_gop.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>
-/*
- * The following are functions with prototypes defined in the EDK2 headers. The
- * EDK2 headers are included with chipset_fsp_util.h. Define the following
- * names to reduce the use of CamelCase in the other source files.
- */
-#define GetHobList get_hob_list
-#define GetNextHob get_next_hob
-#define GetFirstHob get_first_hob
-#define GetNextGuidHob get_next_guid_hob
-#define GetFirstGuidHob get_first_guid_hob
-
-/* Include the EDK2 headers */
-#include <soc/chipset_fsp_util.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. */
@@ -88,8 +75,6 @@ int fsp_relocate(struct prog *fsp_relocd, const struct region_device *fsp_src);
#define FSP_IMAGE_ATTRIBUTE_LOC 32
#define GRAPHICS_SUPPORT_BIT (1 << 0)
-#define FSP_SIG 0x48505346 /* 'FSPH' */
-
#define ERROR_NO_FV_SIG 1
#define ERROR_NO_FFS_GUID 2
#define ERROR_NO_INFO_HEADER 3
@@ -101,4 +86,11 @@ int fsp_relocate(struct prog *fsp_relocd, const struct region_device *fsp_src);
extern void *FspHobListPtr;
#endif
-#endif /* FSP_UTIL_H */
+/* 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 */