Martin Roth (gaumless(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8308
-gerrit
commit 91f63bf3d1f75a135e1a016c668eba279901bb6e
Author: Martin Roth <gaumless(a)gmail.com>
Date: Fri Jan 30 20:56:05 2015 -0700
fsp_baytrail: Get FSP reserved memory from the FSP HOB list
Because the pointer to the FSP HOB list is now being saved, we can
use that to find the top of usable memory. This eliminates the need
to hardcode the size of the FSP reserved memory area.
Tested on minnowboard max for baytrail.
The HOB structure used does not seem to be present for the rangeley
or ivybridge/pantherpoint FSPs. At the very least, the GUID is not
documented in the integration guides.
Change-Id: I643e57655f55bfada60075b55aad2ce010ec4f67
Signed-off-by: Martin Roth <gaumless(a)gmail.com>
---
src/drivers/intel/fsp/fsp_util.c | 20 ++++++++++++++++++++
src/drivers/intel/fsp/fsp_util.h | 1 +
src/soc/intel/fsp_baytrail/fsp/chipset_fsp_util.h | 2 --
src/soc/intel/fsp_baytrail/memmap.c | 15 +++++++--------
src/soc/intel/fsp_baytrail/northcluster.c | 7 +------
5 files changed, 29 insertions(+), 16 deletions(-)
diff --git a/src/drivers/intel/fsp/fsp_util.c b/src/drivers/intel/fsp/fsp_util.c
index 0844b37..2a53c25 100644
--- a/src/drivers/intel/fsp/fsp_util.c
+++ b/src/drivers/intel/fsp/fsp_util.c
@@ -195,6 +195,26 @@ void * find_saved_temp_mem(void *hob_list_ptr)
return (void *) ((char *) saved_mem_hob + sizeof(EFI_HOB_GUID_TYPE));
}
+#ifndef FSP_RESERVE_MEMORY_SIZE
+/** @brief locates the HOB containing the location of the fsp reserved mem area
+ *
+ * @param hob_list_ptr pointer to the start of the hob list
+ * @return pointer to the start of the FSP reserved memory or NULL if not found.
+ */
+void * find_fsp_reserved_mem(void *hob_list_ptr)
+{
+ EFI_GUID fsp_reserved_guid = FSP_HOB_RESOURCE_OWNER_FSP_GUID;
+ EFI_HOB_RESOURCE_DESCRIPTOR *fsp_reserved_mem =
+ (EFI_HOB_RESOURCE_DESCRIPTOR *) find_hob_by_guid(
+ hob_list_ptr, &fsp_reserved_guid);
+
+ if (fsp_reserved_mem == NULL)
+ return NULL;
+
+ return (void *)((uintptr_t)fsp_reserved_mem->PhysicalStart);
+}
+#endif /* FSP_RESERVE_MEMORY_SIZE */
+
#ifndef __PRE_RAM__ /* Only parse HOB data in ramstage */
void print_fsp_info(void) {
diff --git a/src/drivers/intel/fsp/fsp_util.h b/src/drivers/intel/fsp/fsp_util.h
index a39f5a2..d65b842 100644
--- a/src/drivers/intel/fsp/fsp_util.h
+++ b/src/drivers/intel/fsp/fsp_util.h
@@ -38,6 +38,7 @@ void chipset_fsp_early_init(FSP_INIT_PARAMS *FspInitParams,
FSP_INFO_HEADER *fsp_ptr);
void ChipsetFspReturnPoint(EFI_STATUS Status, VOID *HobListPtr);
void * find_saved_temp_mem(void *hob_list_ptr);
+void * find_fsp_reserved_mem(void *hob_list_ptr);
/* functions in hob.c */
void print_hob_mem_attributes(void *Hobptr);
diff --git a/src/soc/intel/fsp_baytrail/fsp/chipset_fsp_util.h b/src/soc/intel/fsp_baytrail/fsp/chipset_fsp_util.h
index 1f4fa74..29309bf 100644
--- a/src/soc/intel/fsp_baytrail/fsp/chipset_fsp_util.h
+++ b/src/soc/intel/fsp_baytrail/fsp/chipset_fsp_util.h
@@ -32,8 +32,6 @@
#include <fspvpd.h>
#include <azalia.h>
-#define FSP_RESERVE_MEMORY_SIZE 0x200000
-
#define FSP_INFO_HEADER_GUID \
{ \
0x912740BE, 0x2284, 0x4734, {0xB9, 0x71, 0x84, 0xB0, 0x27, 0x35, 0x3F, 0x0C} \
diff --git a/src/soc/intel/fsp_baytrail/memmap.c b/src/soc/intel/fsp_baytrail/memmap.c
index 615916b..8a10ac8 100644
--- a/src/soc/intel/fsp_baytrail/memmap.c
+++ b/src/soc/intel/fsp_baytrail/memmap.c
@@ -29,18 +29,17 @@ uintptr_t smm_region_start(void)
return (iosf_bunit_read(BUNIT_SMRRL) << 20);
}
-/*
- * Calculate the top of usable (low) DRAM.
- * The FSP's reserved memory sits just below the SMM region,
- * allowing calculation of the top of usable memory.
+/** @brief get the top of usable low memory from the FSP's HOB list
+ *
+ * The FSP's reserved memory sits just below the SMM region. The memory
+ * region below it is usable memory.
*
* The entire memory map is shown in northcluster.c
+ *
+ * @return pointer to the first byte of reserved memory
*/
void *cbmem_top(void)
{
- uintptr_t tom = smm_region_start();
- if (!tom)
- tom = iosf_bunit_read(BUNIT_BMBOUND);
- return (void *) tom - FSP_RESERVE_MEMORY_SIZE;
+ return find_fsp_reserved_mem(*(void **)CBMEM_FSP_HOB_PTR);
}
diff --git a/src/soc/intel/fsp_baytrail/northcluster.c b/src/soc/intel/fsp_baytrail/northcluster.c
index 838e554..b288388 100644
--- a/src/soc/intel/fsp_baytrail/northcluster.c
+++ b/src/soc/intel/fsp_baytrail/northcluster.c
@@ -149,8 +149,7 @@ static void mc_add_dram_resources(device_t dev)
uint32_t fsp_mem_base = 0;
GetHighMemorySize(&highmem_size);
- GetLowMemorySize(&fsp_mem_base);
-
+ fsp_mem_base=(uint32_t)cbmem_top();
bmbound = iosf_bunit_read(BUNIT_BMBOUND);
bsmmrrl = iosf_bunit_read(BUNIT_SMRRL) << 20;
@@ -162,10 +161,6 @@ static void mc_add_dram_resources(device_t dev)
printk(BIOS_DEBUG, "FSP memory location: 0x%x\nFSP memory size: %dM\n",
fsp_mem_base, (bsmmrrl - fsp_mem_base) >> 20);
-
- if ((bsmmrrl - fsp_mem_base ) != FSP_RESERVE_MEMORY_SIZE)
- printk(BIOS_WARNING, "Warning: Fsp memory size does not match "
- "expected memory size (%x).\n", FSP_RESERVE_MEMORY_SIZE);
}
printk(BIOS_INFO, "Available memory below 4GB: 0x%08x (%dM)\n",
Kyösti Mälkki (kyosti.malkki(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4503
-gerrit
commit d8ebd578a93a75554311961ff3c7c0126c9e1361
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Sun Dec 8 07:56:34 2013 +0200
cpu/amd (non-AGESA): Replace UPDATE_CPU_MICROCODE with SUPPORT_UCODE_IN_CBFS
Change-Id: I71e5b19bf451cef857cad2e2bb4bd8cc19d0ddd0
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
---
src/cpu/amd/microcode/Makefile.inc | 4 ++--
src/cpu/amd/model_10xxx/Kconfig | 33 +--------------------------------
src/cpu/amd/model_10xxx/Makefile.inc | 2 +-
src/cpu/amd/model_fxx/Kconfig | 1 +
src/cpu/amd/model_fxx/Makefile.inc | 2 +-
src/include/cpu/amd/microcode.h | 2 +-
6 files changed, 7 insertions(+), 37 deletions(-)
diff --git a/src/cpu/amd/microcode/Makefile.inc b/src/cpu/amd/microcode/Makefile.inc
index 48f1d0d..6da939e 100644
--- a/src/cpu/amd/microcode/Makefile.inc
+++ b/src/cpu/amd/microcode/Makefile.inc
@@ -1,2 +1,2 @@
-ramstage-y += microcode.c
-romstage-$(CONFIG_UPDATE_CPU_MICROCODE) += microcode.c
+ramstage-$(CONFIG_SUPPORT_CPU_UCODE_IN_CBFS) += microcode.c
+romstage-$(CONFIG_SUPPORT_CPU_UCODE_IN_CBFS) += microcode.c
diff --git a/src/cpu/amd/model_10xxx/Kconfig b/src/cpu/amd/model_10xxx/Kconfig
index cf5748c..1b79eb0 100644
--- a/src/cpu/amd/model_10xxx/Kconfig
+++ b/src/cpu/amd/model_10xxx/Kconfig
@@ -9,6 +9,7 @@ config CPU_AMD_MODEL_10XXX
select MMCONF_SUPPORT_DEFAULT
select TSC_SYNC_LFENCE
select UDELAY_LAPIC
+ select SUPPORT_CPU_UCODE_IN_CBFS
if CPU_AMD_MODEL_10XXX
@@ -70,36 +71,4 @@ config UDELAY_LAPIC_FIXED_FSB
int
default 200
-config UPDATE_CPU_MICROCODE
- bool
- default y
-
-config UPDATE_CPU_MICROCODE
- bool "Update CPU microcode"
- default y
- depends on EXPERT && CPU_AMD_MODEL_10XXX
- help
- Select this to apply patches to the CPU microcode provided by
- AMD without source, and distributed with coreboot, to address
- issues in the CPU post production.
-
- Microcode updates distributed with coreboot are not necessarily
- the latest version available from AMD. Updates are only applied
- if they are newer than the microcode already in your CPU.
-
- Unselect this to let Fam10h CPUs run with microcode as shipped
- from factory. No binary microcode patches will be included in the
- coreboot image in that case, which can help with creating an image
- for which complete source code is available, which in turn might
- simplify license compliance.
-
- Microcode updates intend to solve issues that have been discovered
- after CPU production. The common case is that systems work as
- intended with updated microcode, but we have also seen cases where
- issues were solved by not applying the microcode updates.
-
- Note that some operating system include these same microcode
- patches, so you may need to also disable microcode updates in
- your operating system in order for this option to matter.
-
endif # CPU_AMD_MODEL_10XXX
diff --git a/src/cpu/amd/model_10xxx/Makefile.inc b/src/cpu/amd/model_10xxx/Makefile.inc
index 7d216ab..4dbfd4b 100644
--- a/src/cpu/amd/model_10xxx/Makefile.inc
+++ b/src/cpu/amd/model_10xxx/Makefile.inc
@@ -2,7 +2,7 @@ romstage-y += ../../x86/mtrr/earlymtrr.c
ramstage-y += model_10xxx_init.c
ramstage-y += processor_name.c
-romstage-$(CONFIG_UPDATE_CPU_MICROCODE) += update_microcode.c
+romstage-$(CONFIG_SUPPORT_CPU_UCODE_IN_CBFS) += update_microcode.c
ramstage-$(CONFIG_HAVE_ACPI_TABLES) += powernow_acpi.c
cpu_microcode-$(CONFIG_CPU_MICROCODE_CBFS_GENERATE) += microcode_blob.c
diff --git a/src/cpu/amd/model_fxx/Kconfig b/src/cpu/amd/model_fxx/Kconfig
index bdcf5bb..9ee2bf7 100644
--- a/src/cpu/amd/model_fxx/Kconfig
+++ b/src/cpu/amd/model_fxx/Kconfig
@@ -9,6 +9,7 @@ config CPU_AMD_MODEL_FXX
select SSE2
select TSC_SYNC_LFENCE
select UDELAY_LAPIC
+ select SUPPORT_CPU_UCODE_IN_CBFS
if CPU_AMD_MODEL_FXX
config UDELAY_IO
diff --git a/src/cpu/amd/model_fxx/Makefile.inc b/src/cpu/amd/model_fxx/Makefile.inc
index 19a6255..c059de5 100644
--- a/src/cpu/amd/model_fxx/Makefile.inc
+++ b/src/cpu/amd/model_fxx/Makefile.inc
@@ -2,7 +2,7 @@ romstage-y += ../../x86/mtrr/earlymtrr.c
# no conditionals here. If you include this file from a socket, then you get all the binaries.
ramstage-y += model_fxx_init.c
-ramstage-y += model_fxx_update_microcode.c
+ramstage-$(CONFIG_SUPPORT_CPU_UCODE_IN_CBFS) += model_fxx_update_microcode.c
ramstage-y += processor_name.c
ramstage-$(CONFIG_HAVE_ACPI_TABLES) += powernow_acpi.c
diff --git a/src/include/cpu/amd/microcode.h b/src/include/cpu/amd/microcode.h
index 9876a24..cec5e58 100644
--- a/src/include/cpu/amd/microcode.h
+++ b/src/include/cpu/amd/microcode.h
@@ -1,7 +1,7 @@
#ifndef CPU_AMD_MICROCODE_H
#define CPU_AMD_MICROCODE_H
-#if CONFIG_UPDATE_CPU_MICROCODE || CONFIG_NORTHBRIDGE_AMD_AMDK8
+#if CONFIG_SUPPORT_CPU_UCODE_IN_CBFS
void update_microcode(u32 cpu_deviceid);
void amd_update_microcode_from_cbfs(u32 equivalent_processor_rev_id);
#else