Convert literal uses of CONFIG_MAINBOARD_{VENDOR,PART_NUMBER}

Only expand these strings in lib/identity.o.

Change-Id: I8732bbeff8cf8a757bf32fdb615b1d0f97584585
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/74907
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
This commit is contained in:
Kyösti Mälkki
2022-12-15 22:12:29 +02:00
committed by Felix Held
parent f574c3305a
commit b78e462037
7 changed files with 24 additions and 19 deletions

View File

@@ -9,6 +9,7 @@
#include <device/device.h>
#include <device/path.h>
#include <device/pci_ids.h>
#include <identity.h>
#include <stdint.h>
#include <string.h>
@@ -33,16 +34,16 @@ void mptable_init(struct mp_config_table *mc)
mc->mpe_checksum = 0;
mc->reserved = 0;
strncpy(mc->mpc_oem, CONFIG_MAINBOARD_VENDOR, 8);
strncpy(mc->mpc_productid, CONFIG_MAINBOARD_PART_NUMBER, 12);
strncpy(mc->mpc_oem, mainboard_vendor, 8);
strncpy(mc->mpc_productid, 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++)
for (i = MIN(strlen(mainboard_vendor), 8); i < 8; i++)
mc->mpc_oem[i] = ' ';
for (i = MIN(strlen(CONFIG_MAINBOARD_PART_NUMBER), 12); i < 12; i++)
for (i = MIN(strlen(mainboard_part_number), 12); i < 12; i++)
mc->mpc_productid[i] = ' ';
}