From b78e4620375cc5668db668d900340fd89271c330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Thu, 15 Dec 2022 22:12:29 +0200 Subject: [PATCH] Convert literal uses of CONFIG_MAINBOARD_{VENDOR,PART_NUMBER} MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only expand these strings in lib/identity.o. Change-Id: I8732bbeff8cf8a757bf32fdb615b1d0f97584585 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/74907 Tested-by: build bot (Jenkins) Reviewed-by: Hung-Te Lin Reviewed-by: Yu-Ping Wu Reviewed-by: Felix Held --- src/arch/x86/mpspec.c | 9 +++++---- src/drivers/i2c/max98390/max98390.c | 5 +++-- src/lib/fit.c | 13 ++++++------- src/mainboard/emulation/qemu-i440fx/northbridge.c | 7 ++++--- src/mainboard/google/kukui/mainboard.c | 3 ++- src/mainboard/msi/ms7d25/mainboard.c | 3 ++- src/mainboard/pcengines/apu2/mainboard.c | 3 ++- 7 files changed, 24 insertions(+), 19 deletions(-) diff --git a/src/arch/x86/mpspec.c b/src/arch/x86/mpspec.c index cbf67438c4..64712c7800 100644 --- a/src/arch/x86/mpspec.c +++ b/src/arch/x86/mpspec.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -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] = ' '; } diff --git a/src/drivers/i2c/max98390/max98390.c b/src/drivers/i2c/max98390/max98390.c index 12c8c9da9d..9786e2bc13 100644 --- a/src/drivers/i2c/max98390/max98390.c +++ b/src/drivers/i2c/max98390/max98390.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include "chip.h" @@ -68,8 +69,8 @@ static void max98390_fill_ssdt(const struct device *dev) dp = acpi_dp_new_table("_DSD"); size_t chars = snprintf(dsm_name, sizeof(dsm_name), "%s_%s_%s.bin", - config->dsm_param_file_name, CONFIG_MAINBOARD_VENDOR, - CONFIG_MAINBOARD_PART_NUMBER); + config->dsm_param_file_name, mainboard_vendor, + mainboard_part_number); if (chars >= sizeof(dsm_name)) printk(BIOS_ERR, "String too long in %s\n", __func__); diff --git a/src/lib/fit.c b/src/lib/fit.c index 051395054a..9db083e21d 100644 --- a/src/lib/fit.c +++ b/src/lib/fit.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -42,30 +43,28 @@ static void fit_add_default_compat_strings(void) if ((board_id() != UNDEFINED_STRAPPING_ID) && (sku_id() != UNDEFINED_STRAPPING_ID)) { snprintf(compat_string, sizeof(compat_string), - "%s,%s-rev%u-sku%u", CONFIG_MAINBOARD_VENDOR, - CONFIG_MAINBOARD_PART_NUMBER, board_id(), sku_id()); + "%s,%s-rev%u-sku%u", mainboard_vendor, mainboard_part_number, + board_id(), sku_id()); fit_add_compat_string(compat_string); } if (board_id() != UNDEFINED_STRAPPING_ID) { snprintf(compat_string, sizeof(compat_string), "%s,%s-rev%u", - CONFIG_MAINBOARD_VENDOR, CONFIG_MAINBOARD_PART_NUMBER, - board_id()); + mainboard_vendor, mainboard_part_number, board_id()); fit_add_compat_string(compat_string); } if (sku_id() != UNDEFINED_STRAPPING_ID) { snprintf(compat_string, sizeof(compat_string), "%s,%s-sku%u", - CONFIG_MAINBOARD_VENDOR, CONFIG_MAINBOARD_PART_NUMBER, - sku_id()); + mainboard_vendor, mainboard_part_number, sku_id()); fit_add_compat_string(compat_string); } snprintf(compat_string, sizeof(compat_string), "%s,%s", - CONFIG_MAINBOARD_VENDOR, CONFIG_MAINBOARD_PART_NUMBER); + mainboard_vendor, mainboard_part_number); fit_add_compat_string(compat_string); } diff --git a/src/mainboard/emulation/qemu-i440fx/northbridge.c b/src/mainboard/emulation/qemu-i440fx/northbridge.c index 56693c3578..5d24c5ba7f 100644 --- a/src/mainboard/emulation/qemu-i440fx/northbridge.c +++ b/src/mainboard/emulation/qemu-i440fx/northbridge.c @@ -1,14 +1,15 @@ /* SPDX-License-Identifier: GPL-2.0-only */ +#include +#include #include #include #include #include -#include #include #include -#include #include +#include #include #include #include @@ -191,7 +192,7 @@ static int qemu_get_smbios_data17(int handle, int parent_handle, unsigned long * t->type_detail = MEMORY_TYPE_DETAIL_SYNCHRONOUS; t->speed = 200; t->clock_speed = 200; - t->manufacturer = smbios_add_string(t->eos, CONFIG_MAINBOARD_VENDOR); + t->manufacturer = smbios_add_string(t->eos, mainboard_vendor); const int len = smbios_full_table_len(&t->header, t->eos); *current += len; diff --git a/src/mainboard/google/kukui/mainboard.c b/src/mainboard/google/kukui/mainboard.c index e1c50f4a37..69047fa4a2 100644 --- a/src/mainboard/google/kukui/mainboard.c +++ b/src/mainboard/google/kukui/mainboard.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -65,7 +66,7 @@ static void configure_ec(void) struct panel_description __weak *get_panel_description(int panel_id) { printk(BIOS_ERR, "%s: ERROR: No panels defined for board: %s.\n", - __func__, CONFIG_MAINBOARD_PART_NUMBER); + __func__, mainboard_part_number); return NULL; } diff --git a/src/mainboard/msi/ms7d25/mainboard.c b/src/mainboard/msi/ms7d25/mainboard.c index 539f897e7a..ee781d5856 100644 --- a/src/mainboard/msi/ms7d25/mainboard.c +++ b/src/mainboard/msi/ms7d25/mainboard.c @@ -2,6 +2,7 @@ #include #include +#include #include #include #include @@ -49,7 +50,7 @@ const char *smbios_mainboard_product_name(void) return "PRO Z690-A (MS-7D25)"; } - return CONFIG_MAINBOARD_PART_NUMBER; + return mainboard_part_number; } /* Only baseboard serial number is populated */ diff --git a/src/mainboard/pcengines/apu2/mainboard.c b/src/mainboard/pcengines/apu2/mainboard.c index 9371ee9290..ab9156f082 100644 --- a/src/mainboard/pcengines/apu2/mainboard.c +++ b/src/mainboard/pcengines/apu2/mainboard.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -226,7 +227,7 @@ static int mainboard_smbios_data(struct device *dev, int *handle, static void mainboard_enable(struct device *dev) { /* Maintain this text unchanged for manufacture process. */ - printk(BIOS_INFO, "Mainboard " CONFIG_MAINBOARD_PART_NUMBER " Enable.\n"); + printk(BIOS_INFO, "Mainboard %s Enable.\n", mainboard_part_number); config_gpio_mux();