Get mptable OEM/product ID from kconfig variables.
We currently use "COREBOOT" unconditionally as the "OEM ID" in our mptable.c files, and hardcode the mainboard name in mptable.c like this: mptable_init(mc, "DK8-HTX ", LAPIC_ADDR); However, the spec says "OEM ID: A string that identifies the manufacturer of the system hardware." (Table 4-2, page 42) so "COREBOOT" doesn't match the spec, we should use the hardware vendor name. Thus, use CONFIG_MAINBOARD_VENDOR which we have already as the "OEM ID" (truncate/fill it to 8 characters as per spec). Also, use CONFIG_MAINBOARD_PART_NUMBER (the board name) as "product ID", and truncate/fill it to 12 characters as per spec, if needed. Abuild-tested. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Stefan Reinauer <stepan@coreboot.org> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6183 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
@@ -8,20 +8,17 @@
|
||||
#include <cpu/x86/lapic.h>
|
||||
|
||||
/* Initialize the specified "mc" struct with initial values. */
|
||||
void mptable_init(struct mp_config_table *mc, const char *productid,
|
||||
u32 lapic_addr)
|
||||
void mptable_init(struct mp_config_table *mc, u32 lapic_addr)
|
||||
{
|
||||
/* Error out if 'product_id' length doesn't match exactly. */
|
||||
if (strlen(productid) != 12)
|
||||
die("ERROR: 'productid' must be 12 bytes long!");
|
||||
int i;
|
||||
|
||||
memset(mc, 0, sizeof(*mc));
|
||||
|
||||
memcpy(mc->mpc_signature, MPC_SIGNATURE, 4);
|
||||
|
||||
mc->mpc_length = sizeof(*mc); /* Initially just the header size. */
|
||||
mc->mpc_spec = 0x04; /* MultiProcessor specification 1.4 */
|
||||
mc->mpc_checksum = 0; /* Not yet computed. */
|
||||
memcpy(mc->mpc_oem, "COREBOOT", 8);
|
||||
memcpy(mc->mpc_productid, productid, 12);
|
||||
mc->mpc_oemptr = 0;
|
||||
mc->mpc_oemsize = 0;
|
||||
mc->mpc_entry_count = 0; /* No entries yet... */
|
||||
@@ -29,6 +26,18 @@ void mptable_init(struct mp_config_table *mc, const char *productid,
|
||||
mc->mpe_length = 0;
|
||||
mc->mpe_checksum = 0;
|
||||
mc->reserved = 0;
|
||||
|
||||
strncpy(mc->mpc_oem, CONFIG_MAINBOARD_VENDOR, 8);
|
||||
strncpy(mc->mpc_productid, CONFIG_MAINBOARD_PART_NUMBER, 12);
|
||||
|
||||
/*
|
||||
* The oem/productid fields are exactly 8/12 bytes long. If the resp.
|
||||
* entry is shorter, the remaining bytes are filled with spaces.
|
||||
*/
|
||||
for (i = MIN(strlen(CONFIG_MAINBOARD_VENDOR), 8); i < 8; i++)
|
||||
mc->mpc_oem[i] = ' ';
|
||||
for (i = MIN(strlen(CONFIG_MAINBOARD_PART_NUMBER), 12); i < 12; i++)
|
||||
mc->mpc_productid[i] = ' ';
|
||||
}
|
||||
|
||||
unsigned char smp_compute_checksum(void *v, int len)
|
||||
|
@@ -232,8 +232,7 @@ struct mp_exten_compatibility_address_space {
|
||||
/* Default local apic addr */
|
||||
#define LAPIC_ADDR 0xFEE00000
|
||||
|
||||
void mptable_init(struct mp_config_table *mc, const char *productid,
|
||||
u32 lapic_addr);
|
||||
void mptable_init(struct mp_config_table *mc, u32 lapic_addr);
|
||||
|
||||
void *smp_next_mpc_entry(struct mp_config_table *mc);
|
||||
void *smp_next_mpe_entry(struct mp_config_table *mc);
|
||||
|
Reference in New Issue
Block a user