Attention is currently required from: Hung-Te Lin, Michał Żygowski, Jason Nien, Michał Kopeć, Martin Roth, Yidi Lin, Yu-Ping Wu, Piotr Król.
Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/74450 )
Change subject: [WIP] Avoid literal uses of CONFIG_MAINBOARD_PART_NUMBER ......................................................................
[WIP] Avoid literal uses of CONFIG_MAINBOARD_PART_NUMBER
Change-Id: I917222922560c6273b4be91cd7d99ce2ff8e4231 Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/arch/x86/mpspec.c M src/drivers/i2c/max98390/max98390.c M src/lib/fit.c M src/mainboard/emulation/qemu-i440fx/northbridge.c M src/mainboard/google/cherry/mainboard.c M src/mainboard/google/corsola/mainboard.c M src/mainboard/google/geralt/mainboard.c M src/mainboard/google/guybrush/mainboard.c M src/mainboard/google/herobrine/mainboard.c M src/mainboard/google/kukui/mainboard.c M src/mainboard/google/myst/mainboard.c M src/mainboard/google/skyrim/mainboard.c M src/mainboard/msi/ms7d25/mainboard.c M src/mainboard/pcengines/apu2/mainboard.c 14 files changed, 32 insertions(+), 26 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/50/74450/1
diff --git a/src/arch/x86/mpspec.c b/src/arch/x86/mpspec.c index cbf6743..754460b 100644 --- a/src/arch/x86/mpspec.c +++ b/src/arch/x86/mpspec.c @@ -11,6 +11,7 @@ #include <device/pci_ids.h> #include <stdint.h> #include <string.h> +#include <identity.h>
/* Initialize the specified "mc" struct with initial values. */ void mptable_init(struct mp_config_table *mc) @@ -33,16 +34,16 @@ 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 12c8c9d..fc87332 100644 --- a/src/drivers/i2c/max98390/max98390.c +++ b/src/drivers/i2c/max98390/max98390.c @@ -7,6 +7,7 @@ #include <device/device.h> #include <device/path.h> #include <stdint.h> +#include <identity.h> #include <vendorcode/google/chromeos/chromeos.h> #include "chip.h"
@@ -68,8 +69,8 @@ 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 0513950..7eccc4f 100644 --- a/src/lib/fit.c +++ b/src/lib/fit.c @@ -13,6 +13,7 @@ #include <boardid.h> #include <commonlib/stdlib.h> #include <types.h> +#include <identity.h>
static struct list_node image_nodes; static struct list_node config_nodes; @@ -42,30 +43,28 @@ 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 56693c3..fe3d292 100644 --- a/src/mainboard/emulation/qemu-i440fx/northbridge.c +++ b/src/mainboard/emulation/qemu-i440fx/northbridge.c @@ -9,6 +9,7 @@ #include <device/pci_ops.h> #include <arch/ioapic.h> #include <device/device.h> +#include <identity.h> #include <stdlib.h> #include <smbios.h> #include <types.h> @@ -191,7 +192,7 @@ 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/cherry/mainboard.c b/src/mainboard/google/cherry/mainboard.c index 4447806..c1593ca 100644 --- a/src/mainboard/google/cherry/mainboard.c +++ b/src/mainboard/google/cherry/mainboard.c @@ -159,6 +159,5 @@ }
struct chip_operations mainboard_ops = { - .name = CONFIG_MAINBOARD_PART_NUMBER, .enable_dev = mainboard_enable, }; diff --git a/src/mainboard/google/corsola/mainboard.c b/src/mainboard/google/corsola/mainboard.c index 3efedf8..b6823c6 100644 --- a/src/mainboard/google/corsola/mainboard.c +++ b/src/mainboard/google/corsola/mainboard.c @@ -58,6 +58,5 @@ }
struct chip_operations mainboard_ops = { - .name = CONFIG_MAINBOARD_PART_NUMBER, .enable_dev = mainboard_enable, }; diff --git a/src/mainboard/google/geralt/mainboard.c b/src/mainboard/google/geralt/mainboard.c index 1422398..4042dce 100644 --- a/src/mainboard/google/geralt/mainboard.c +++ b/src/mainboard/google/geralt/mainboard.c @@ -69,6 +69,5 @@ }
struct chip_operations mainboard_ops = { - .name = CONFIG_MAINBOARD_PART_NUMBER, .enable_dev = mainboard_enable, }; diff --git a/src/mainboard/google/guybrush/mainboard.c b/src/mainboard/google/guybrush/mainboard.c index 71d3ec5..af79a5e 100644 --- a/src/mainboard/google/guybrush/mainboard.c +++ b/src/mainboard/google/guybrush/mainboard.c @@ -179,8 +179,6 @@
static void mainboard_enable(struct device *dev) { - printk(BIOS_INFO, "Mainboard " CONFIG_MAINBOARD_PART_NUMBER " Enable.\n"); - dev->ops->acpi_fill_ssdt = mainboard_fill_ssdt;
/* TODO: b/184678786 - Move into espi_config */ diff --git a/src/mainboard/google/herobrine/mainboard.c b/src/mainboard/google/herobrine/mainboard.c index e2c4199..6b54678 100644 --- a/src/mainboard/google/herobrine/mainboard.c +++ b/src/mainboard/google/herobrine/mainboard.c @@ -173,6 +173,5 @@ }
struct chip_operations mainboard_ops = { - .name = CONFIG_MAINBOARD_PART_NUMBER, .enable_dev = mainboard_enable, }; diff --git a/src/mainboard/google/kukui/mainboard.c b/src/mainboard/google/kukui/mainboard.c index e1c50f4..6606cf2 100644 --- a/src/mainboard/google/kukui/mainboard.c +++ b/src/mainboard/google/kukui/mainboard.c @@ -19,6 +19,7 @@ #include <soc/spm.h> #include <soc/usb.h> #include <string.h> +#include <identity.h>
#include "gpio.h" #include "panel.h" @@ -65,7 +66,7 @@ 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/google/myst/mainboard.c b/src/mainboard/google/myst/mainboard.c index e433c98..0e084cb 100644 --- a/src/mainboard/google/myst/mainboard.c +++ b/src/mainboard/google/myst/mainboard.c @@ -37,8 +37,6 @@
static void mainboard_enable(struct device *dev) { - printk(BIOS_INFO, "Mainboard " CONFIG_MAINBOARD_PART_NUMBER " Enable.\n"); - /* TODO: b/184678786 - Move into espi_config */ /* Unmask eSPI IRQ 1 (Keyboard) */ pm_write32(PM_ESPI_INTR_CTRL, PM_ESPI_DEV_INTR_MASK & ~(BIT(1))); diff --git a/src/mainboard/google/skyrim/mainboard.c b/src/mainboard/google/skyrim/mainboard.c index 475e5cf..172f8de 100644 --- a/src/mainboard/google/skyrim/mainboard.c +++ b/src/mainboard/google/skyrim/mainboard.c @@ -90,7 +90,6 @@
static void mainboard_enable(struct device *dev) { - printk(BIOS_INFO, "Mainboard " CONFIG_MAINBOARD_PART_NUMBER " Enable.\n");
/* TODO: b/184678786 - Move into espi_config */ /* Unmask eSPI IRQ 1 (Keyboard) */ diff --git a/src/mainboard/msi/ms7d25/mainboard.c b/src/mainboard/msi/ms7d25/mainboard.c index 539f897e..cc001ff 100644 --- a/src/mainboard/msi/ms7d25/mainboard.c +++ b/src/mainboard/msi/ms7d25/mainboard.c @@ -6,6 +6,7 @@ #include <soc/ramstage.h> #include <smbios.h> #include <string.h> +#include <identity.h>
void mainboard_fill_fadt(acpi_fadt_t *fadt) { @@ -49,7 +50,7 @@ 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 9371ee9..7c1bfc4 100644 --- a/src/mainboard/pcengines/apu2/mainboard.c +++ b/src/mainboard/pcengines/apu2/mainboard.c @@ -16,6 +16,7 @@ #include <superio/nuvoton/nct5104d/nct5104d.h> #include <smbios.h> #include <string.h> +#include <identity.h> #include <AGESA.h> #include "gpio_ftns.h"
@@ -226,7 +227,7 @@ 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();