drivers/intel/fsp2_0: Remove fsp_find_smbios_memory_info() from FSP2.0 driver
As per FSP 2.0 specification and FSP SOC integration guide, its not expected that SMBIOS Memory Information GUID will be same for all platform. Hence fsp_find_smbios_memory_info() function inside common/driver code is not generic one. Removing this function and making use of fsp_find_extension_hob_by_guid() to find SMBIOS Memory Info GUID from platform code as needed. Change-Id: Ifd5abcd3e0733cedf61fa3dda7230cf3da6b14ce Signed-off-by: Subrata Banik <subrata.banik@intel.com> Reviewed-on: https://review.coreboot.org/23650 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Furquan Shaikh <furquan@google.com> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
parent
93fde11aef
commit
6ee716e863
@ -39,11 +39,6 @@ const uint8_t fsp_nv_storage_guid[16] = {
|
|||||||
0xb3, 0xdc, 0x27, 0x0b, 0x7b, 0xa9, 0xe4, 0xb0
|
0xb3, 0xdc, 0x27, 0x0b, 0x7b, 0xa9, 0xe4, 0xb0
|
||||||
};
|
};
|
||||||
|
|
||||||
const uint8_t smbios_memory_info_guid[16] = {
|
|
||||||
0x8c, 0x10, 0xa1, 0x01, 0xee, 0x9d, 0x84, 0x49,
|
|
||||||
0x88, 0xc3, 0xee, 0xe8, 0xc4, 0x9e, 0xfb, 0x89
|
|
||||||
};
|
|
||||||
|
|
||||||
static const uint8_t uuid_fv_info[16] = {
|
static const uint8_t uuid_fv_info[16] = {
|
||||||
0x2e, 0x72, 0x8e, 0x79, 0xb2, 0x15, 0x13, 0x4e,
|
0x2e, 0x72, 0x8e, 0x79, 0xb2, 0x15, 0x13, 0x4e,
|
||||||
0x8a, 0xe9, 0x6b, 0xa3, 0x0f, 0xf7, 0xf1, 0x67
|
0x8a, 0xe9, 0x6b, 0xa3, 0x0f, 0xf7, 0xf1, 0x67
|
||||||
@ -304,8 +299,3 @@ const void *fsp_find_nv_storage_data(size_t *size)
|
|||||||
{
|
{
|
||||||
return fsp_find_extension_hob_by_guid(fsp_nv_storage_guid, size);
|
return fsp_find_extension_hob_by_guid(fsp_nv_storage_guid, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
const void *fsp_find_smbios_memory_info(size_t *size)
|
|
||||||
{
|
|
||||||
return fsp_find_extension_hob_by_guid(smbios_memory_info_guid, size);
|
|
||||||
}
|
|
||||||
|
@ -74,7 +74,6 @@ const void *fsp_get_hob_list(void);
|
|||||||
void *fsp_get_hob_list_ptr(void);
|
void *fsp_get_hob_list_ptr(void);
|
||||||
const void *fsp_find_extension_hob_by_guid(const uint8_t *guid, size_t *size);
|
const void *fsp_find_extension_hob_by_guid(const uint8_t *guid, size_t *size);
|
||||||
const void *fsp_find_nv_storage_data(size_t *size);
|
const void *fsp_find_nv_storage_data(size_t *size);
|
||||||
const void *fsp_find_smbios_memory_info(size_t *size);
|
|
||||||
enum cb_err fsp_fill_lb_framebuffer(struct lb_framebuffer *framebuffer);
|
enum cb_err fsp_fill_lb_framebuffer(struct lb_framebuffer *framebuffer);
|
||||||
int fsp_find_range_hob(struct range_entry *re, const uint8_t guid[16]);
|
int fsp_find_range_hob(struct range_entry *re, const uint8_t guid[16]);
|
||||||
void fsp_display_fvi_version_hob(void);
|
void fsp_display_fvi_version_hob(void);
|
||||||
|
@ -21,6 +21,12 @@
|
|||||||
#include <soc/meminit.h>
|
#include <soc/meminit.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#define FSP_SMBIOS_MEMORY_INFO_GUID \
|
||||||
|
{ \
|
||||||
|
0x8c, 0x10, 0xa1, 0x01, 0xee, 0x9d, 0x84, 0x49, \
|
||||||
|
0x88, 0xc3, 0xee, 0xe8, 0xc4, 0x9e, 0xfb, 0x89 \
|
||||||
|
}
|
||||||
|
|
||||||
void save_lpddr4_dimm_info(const struct lpddr4_cfg *lp4cfg, size_t mem_sku)
|
void save_lpddr4_dimm_info(const struct lpddr4_cfg *lp4cfg, size_t mem_sku)
|
||||||
{
|
{
|
||||||
int channel, dimm, dimm_max, index;
|
int channel, dimm, dimm_max, index;
|
||||||
@ -30,6 +36,8 @@ void save_lpddr4_dimm_info(const struct lpddr4_cfg *lp4cfg, size_t mem_sku)
|
|||||||
struct memory_info *mem_info;
|
struct memory_info *mem_info;
|
||||||
const CHANNEL_INFO *channel_info;
|
const CHANNEL_INFO *channel_info;
|
||||||
const FSP_SMBIOS_MEMORY_INFO *memory_info_hob;
|
const FSP_SMBIOS_MEMORY_INFO *memory_info_hob;
|
||||||
|
const uint8_t smbios_memory_info_guid[16] =
|
||||||
|
FSP_SMBIOS_MEMORY_INFO_GUID;
|
||||||
|
|
||||||
if (mem_sku >= lp4cfg->num_skus) {
|
if (mem_sku >= lp4cfg->num_skus) {
|
||||||
printk(BIOS_ERR, "Too few LPDDR4 SKUs: 0x%zx/0x%zx\n",
|
printk(BIOS_ERR, "Too few LPDDR4 SKUs: 0x%zx/0x%zx\n",
|
||||||
@ -37,7 +45,15 @@ void save_lpddr4_dimm_info(const struct lpddr4_cfg *lp4cfg, size_t mem_sku)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
memory_info_hob = fsp_find_smbios_memory_info(&hob_size);
|
/* Locate the memory info HOB */
|
||||||
|
memory_info_hob = fsp_find_extension_hob_by_guid(
|
||||||
|
smbios_memory_info_guid,
|
||||||
|
&hob_size);
|
||||||
|
|
||||||
|
if (memory_info_hob == NULL || hob_size == 0) {
|
||||||
|
printk(BIOS_ERR, "SMBIOS memory info HOB is missing\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Allocate CBMEM area for DIMM information used to populate SMBIOS
|
* Allocate CBMEM area for DIMM information used to populate SMBIOS
|
||||||
|
@ -21,6 +21,12 @@
|
|||||||
#include <soc/meminit.h>
|
#include <soc/meminit.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#define FSP_SMBIOS_MEMORY_INFO_GUID \
|
||||||
|
{ \
|
||||||
|
0x8c, 0x10, 0xa1, 0x01, 0xee, 0x9d, 0x84, 0x49, \
|
||||||
|
0x88, 0xc3, 0xee, 0xe8, 0xc4, 0x9e, 0xfb, 0x89 \
|
||||||
|
}
|
||||||
|
|
||||||
void save_lpddr4_dimm_info(const struct lpddr4_cfg *lp4cfg, size_t mem_sku)
|
void save_lpddr4_dimm_info(const struct lpddr4_cfg *lp4cfg, size_t mem_sku)
|
||||||
{
|
{
|
||||||
int channel, dimm, dimm_max, index, node;
|
int channel, dimm, dimm_max, index, node;
|
||||||
@ -31,15 +37,20 @@ void save_lpddr4_dimm_info(const struct lpddr4_cfg *lp4cfg, size_t mem_sku)
|
|||||||
const CHANNEL_INFO *channel_info;
|
const CHANNEL_INFO *channel_info;
|
||||||
const FSP_SMBIOS_MEMORY_INFO *memory_info_hob;
|
const FSP_SMBIOS_MEMORY_INFO *memory_info_hob;
|
||||||
const CONTROLLER_INFO *ctrl_info;
|
const CONTROLLER_INFO *ctrl_info;
|
||||||
|
const uint8_t smbios_memory_info_guid[16] =
|
||||||
|
FSP_SMBIOS_MEMORY_INFO_GUID;
|
||||||
|
|
||||||
if (mem_sku >= lp4cfg->num_skus) {
|
if (mem_sku >= lp4cfg->num_skus) {
|
||||||
printk(BIOS_ERR, "Too few LPDDR4 SKUs: 0x%zx/0x%zx\n",
|
printk(BIOS_ERR, "Too few LPDDR4 SKUs: 0x%zx/0x%zx\n",
|
||||||
mem_sku, lp4cfg->num_skus);
|
mem_sku, lp4cfg->num_skus);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
/* Locate the memory info HOB */
|
||||||
|
memory_info_hob = fsp_find_extension_hob_by_guid(
|
||||||
|
smbios_memory_info_guid,
|
||||||
|
&hob_size);
|
||||||
|
|
||||||
memory_info_hob = fsp_find_smbios_memory_info(&hob_size);
|
if (memory_info_hob == NULL || hob_size == 0) {
|
||||||
if (memory_info_hob == NULL) {
|
|
||||||
printk(BIOS_ERR, "SMBIOS memory info HOB is missing\n");
|
printk(BIOS_ERR, "SMBIOS memory info HOB is missing\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,12 @@
|
|||||||
|
|
||||||
void __attribute__((weak)) mainboard_config_gpios(void) {}
|
void __attribute__((weak)) mainboard_config_gpios(void) {}
|
||||||
|
|
||||||
|
#define FSP_SMBIOS_MEMORY_INFO_GUID \
|
||||||
|
{ \
|
||||||
|
0x8c, 0x10, 0xa1, 0x01, 0xee, 0x9d, 0x84, 0x49, \
|
||||||
|
0x88, 0xc3, 0xee, 0xe8, 0xc4, 0x9e, 0xfb, 0x89 \
|
||||||
|
}
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_DISPLAY_HOBS)
|
#if IS_ENABLED(CONFIG_DISPLAY_HOBS)
|
||||||
static void display_fsp_smbios_memory_info_hob(void)
|
static void display_fsp_smbios_memory_info_hob(void)
|
||||||
{
|
{
|
||||||
@ -38,51 +44,56 @@ static void display_fsp_smbios_memory_info_hob(void)
|
|||||||
const DIMM_INFO *dimm_info;
|
const DIMM_INFO *dimm_info;
|
||||||
const CHANNEL_INFO *channel_info;
|
const CHANNEL_INFO *channel_info;
|
||||||
const FSP_SMBIOS_MEMORY_INFO *memory_info_hob;
|
const FSP_SMBIOS_MEMORY_INFO *memory_info_hob;
|
||||||
|
const uint8_t smbios_memory_info_guid[16] =
|
||||||
|
FSP_SMBIOS_MEMORY_INFO_GUID;
|
||||||
|
|
||||||
/* Locate the memory info HOB */
|
/* Locate the memory info HOB */
|
||||||
memory_info_hob = fsp_find_smbios_memory_info(&hob_size);
|
memory_info_hob = fsp_find_extension_hob_by_guid(
|
||||||
|
smbios_memory_info_guid,
|
||||||
|
&hob_size);
|
||||||
|
|
||||||
|
if (memory_info_hob == NULL || hob_size == 0) {
|
||||||
|
printk(BIOS_ERR, "SMBIOS MEMORY_INFO_DATA_HOB not found\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Display the data in the FSP_SMBIOS_MEMORY_INFO HOB */
|
/* Display the data in the FSP_SMBIOS_MEMORY_INFO HOB */
|
||||||
if (memory_info_hob) {
|
printk(BIOS_DEBUG, "FSP_SMBIOS_MEMORY_INFO HOB\n");
|
||||||
printk(BIOS_DEBUG, "FSP_SMBIOS_MEMORY_INFO HOB\n");
|
printk(BIOS_DEBUG, " 0x%02x: Revision\n",
|
||||||
printk(BIOS_DEBUG, " 0x%02x: Revision\n",
|
memory_info_hob->Revision);
|
||||||
memory_info_hob->Revision);
|
printk(BIOS_DEBUG, " 0x%02x: MemoryType\n",
|
||||||
printk(BIOS_DEBUG, " 0x%02x: MemoryType\n",
|
memory_info_hob->MemoryType);
|
||||||
memory_info_hob->MemoryType);
|
printk(BIOS_DEBUG, " %d: MemoryFrequencyInMHz\n",
|
||||||
printk(BIOS_DEBUG, " %d: MemoryFrequencyInMHz\n",
|
memory_info_hob->MemoryFrequencyInMHz);
|
||||||
memory_info_hob->MemoryFrequencyInMHz);
|
printk(BIOS_DEBUG, " %d: DataWidth in bits\n",
|
||||||
printk(BIOS_DEBUG, " %d: DataWidth in bits\n",
|
memory_info_hob->DataWidth);
|
||||||
memory_info_hob->DataWidth);
|
printk(BIOS_DEBUG, " 0x%02x: ErrorCorrectionType\n",
|
||||||
printk(BIOS_DEBUG, " 0x%02x: ErrorCorrectionType\n",
|
memory_info_hob->ErrorCorrectionType);
|
||||||
memory_info_hob->ErrorCorrectionType);
|
printk(BIOS_DEBUG, " 0x%02x: ChannelCount\n",
|
||||||
printk(BIOS_DEBUG, " 0x%02x: ChannelCount\n",
|
memory_info_hob->ChannelCount);
|
||||||
memory_info_hob->ChannelCount);
|
for (channel = 0; channel < memory_info_hob->ChannelCount;
|
||||||
for (channel = 0; channel < memory_info_hob->ChannelCount;
|
channel++) {
|
||||||
channel++) {
|
channel_info = &memory_info_hob->ChannelInfo[channel];
|
||||||
channel_info = &memory_info_hob->ChannelInfo[channel];
|
printk(BIOS_DEBUG, " Channel %d\n", channel);
|
||||||
printk(BIOS_DEBUG, " Channel %d\n", channel);
|
printk(BIOS_DEBUG, " 0x%02x: ChannelId\n",
|
||||||
printk(BIOS_DEBUG, " 0x%02x: ChannelId\n",
|
channel_info->ChannelId);
|
||||||
channel_info->ChannelId);
|
printk(BIOS_DEBUG, " 0x%02x: DimmCount\n",
|
||||||
printk(BIOS_DEBUG, " 0x%02x: DimmCount\n",
|
channel_info->DimmCount);
|
||||||
channel_info->DimmCount);
|
for (dimm = 0; dimm < channel_info->DimmCount;
|
||||||
for (dimm = 0; dimm < channel_info->DimmCount;
|
dimm++) {
|
||||||
dimm++) {
|
dimm_info = &channel_info->DimmInfo[dimm];
|
||||||
dimm_info = &channel_info->DimmInfo[dimm];
|
printk(BIOS_DEBUG, " DIMM %d\n", dimm);
|
||||||
printk(BIOS_DEBUG, " DIMM %d\n", dimm);
|
printk(BIOS_DEBUG, " 0x%02x: DimmId\n",
|
||||||
printk(BIOS_DEBUG, " 0x%02x: DimmId\n",
|
dimm_info->DimmId);
|
||||||
dimm_info->DimmId);
|
printk(BIOS_DEBUG, " %d: SizeInMb\n",
|
||||||
printk(BIOS_DEBUG, " %d: SizeInMb\n",
|
dimm_info->SizeInMb);
|
||||||
dimm_info->SizeInMb);
|
printk(BIOS_DEBUG, " 0x%04x: MfgId\n",
|
||||||
printk(BIOS_DEBUG, " 0x%04x: MfgId\n",
|
dimm_info->MfgId);
|
||||||
dimm_info->MfgId);
|
printk(BIOS_DEBUG, "%*.*s: ModulePartNum\n",
|
||||||
printk(BIOS_DEBUG, "%*.*s: ModulePartNum\n",
|
(int)sizeof(dimm_info->ModulePartNum),
|
||||||
(int)sizeof(dimm_info->ModulePartNum),
|
(int)sizeof(dimm_info->ModulePartNum),
|
||||||
(int)sizeof(dimm_info->ModulePartNum),
|
dimm_info->ModulePartNum);
|
||||||
dimm_info->ModulePartNum);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
printk(BIOS_DEBUG, "FSP_SMBIOS_MEMORY_INFO HOB not found!!!\n");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user