arch/x86/smbios: Reference type 7
Fill in the handle to cache entries of type 7 in the type 4 structure. Tested on Intel Sandy Bridge (Lenovo T520). All 3 caches are referenced. Change-Id: Idf876b0c21c65f72a945d26c5898074b140763f8 Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/32132 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Richard Spiegel <richard.spiegel@silverbackltd.com>
This commit is contained in:
committed by
Patrick Georgi
parent
fc5b80943b
commit
15589b4e56
@@ -730,10 +730,12 @@ smbios_cache_associativity(const u8 num)
|
|||||||
* @param current Pointer to memory address to write the tables to
|
* @param current Pointer to memory address to write the tables to
|
||||||
* @param handle Pointer to handle for the tables
|
* @param handle Pointer to handle for the tables
|
||||||
* @param max_struct_size Pointer to maximum struct size
|
* @param max_struct_size Pointer to maximum struct size
|
||||||
|
* @param type4 Pointer to SMBIOS type 4 structure
|
||||||
*/
|
*/
|
||||||
static int smbios_write_type7_cache_parameters(unsigned long *current,
|
static int smbios_write_type7_cache_parameters(unsigned long *current,
|
||||||
int *handle,
|
int *handle,
|
||||||
int *max_struct_size)
|
int *max_struct_size,
|
||||||
|
struct smbios_type4 *type4)
|
||||||
{
|
{
|
||||||
struct cpuid_result res;
|
struct cpuid_result res;
|
||||||
unsigned int cnt = 0;
|
unsigned int cnt = 0;
|
||||||
@@ -802,9 +804,25 @@ static int smbios_write_type7_cache_parameters(unsigned long *current,
|
|||||||
else
|
else
|
||||||
associativity = smbios_cache_associativity(assoc);
|
associativity = smbios_cache_associativity(assoc);
|
||||||
|
|
||||||
update_max(len, *max_struct_size, smbios_write_type7(current,
|
const int h = (*handle)++;
|
||||||
*handle++, level, SMBIOS_CACHE_SRAM_TYPE_UNKNOWN,
|
|
||||||
associativity, type, cache_size, cache_size));
|
update_max(len, *max_struct_size, smbios_write_type7(current, h,
|
||||||
|
level, SMBIOS_CACHE_SRAM_TYPE_UNKNOWN, associativity,
|
||||||
|
type, cache_size, cache_size));
|
||||||
|
|
||||||
|
if (type4) {
|
||||||
|
switch (level) {
|
||||||
|
case 1:
|
||||||
|
type4->l1_cache_handle = h;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
type4->l2_cache_handle = h;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
type4->l3_cache_handle = h;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return len;
|
return len;
|
||||||
@@ -981,10 +999,12 @@ unsigned long smbios_write_tables(unsigned long current)
|
|||||||
handle++;
|
handle++;
|
||||||
update_max(len, max_struct_size, smbios_write_type3(¤t,
|
update_max(len, max_struct_size, smbios_write_type3(¤t,
|
||||||
handle++));
|
handle++));
|
||||||
|
|
||||||
|
struct smbios_type4 *type4 = (struct smbios_type4 *)current;
|
||||||
update_max(len, max_struct_size, smbios_write_type4(¤t,
|
update_max(len, max_struct_size, smbios_write_type4(¤t,
|
||||||
handle++));
|
handle++));
|
||||||
len += smbios_write_type7_cache_parameters(¤t, &handle,
|
len += smbios_write_type7_cache_parameters(¤t, &handle,
|
||||||
&max_struct_size);
|
&max_struct_size, type4);
|
||||||
update_max(len, max_struct_size, smbios_write_type11(¤t,
|
update_max(len, max_struct_size, smbios_write_type11(¤t,
|
||||||
&handle));
|
&handle));
|
||||||
if (CONFIG(ELOG))
|
if (CONFIG(ELOG))
|
||||||
|
Reference in New Issue
Block a user