diff options
-rw-r--r-- | src/device/root_device.c | 2 | ||||
-rw-r--r-- | src/include/device/device.h | 2 | ||||
-rw-r--r-- | src/include/identity.h | 11 | ||||
-rw-r--r-- | src/include/version.h | 4 | ||||
-rw-r--r-- | src/lib/Makefile.inc | 8 | ||||
-rw-r--r-- | src/lib/coreboot_table.c | 3 | ||||
-rw-r--r-- | src/lib/identity.c | 14 | ||||
-rw-r--r-- | src/lib/version.c | 10 | ||||
-rw-r--r-- | util/sconfig/main.c | 1 |
9 files changed, 30 insertions, 25 deletions
diff --git a/src/device/root_device.c b/src/device/root_device.c index 1f51786153..d8edbd58bb 100644 --- a/src/device/root_device.c +++ b/src/device/root_device.c @@ -5,8 +5,6 @@ #include <device/pci.h> #include <reset.h> -const char mainboard_name[] = CONFIG_MAINBOARD_VENDOR " " CONFIG_MAINBOARD_PART_NUMBER; - void enable_static_device(struct device *dev) { if (dev->chip_ops && dev->chip_ops->enable_dev) diff --git a/src/include/device/device.h b/src/include/device/device.h index 0b67d3dc02..d044ae2b8f 100644 --- a/src/include/device/device.h +++ b/src/include/device/device.h @@ -174,8 +174,6 @@ extern DEVTREE_CONST struct device * DEVTREE_CONST all_devices; extern struct resource *free_resources; extern struct bus *free_links; -extern const char mainboard_name[]; - /* Generic device interface functions */ struct device *alloc_dev(struct bus *parent, struct device_path *path); void dev_initialize_chips(void); diff --git a/src/include/identity.h b/src/include/identity.h new file mode 100644 index 0000000000..d939291647 --- /dev/null +++ b/src/include/identity.h @@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef IDENTITY_H +#define IDENTITY_H + +/* Motherboard Information */ +extern const char mainboard_name[]; +extern const char mainboard_vendor[]; +extern const char mainboard_part_number[]; + +#endif /* IDENTITY_H */ diff --git a/src/include/version.h b/src/include/version.h index 84bb34a7b5..926756a534 100644 --- a/src/include/version.h +++ b/src/include/version.h @@ -3,10 +3,6 @@ #ifndef VERSION_H #define VERSION_H -/* Motherboard Information */ -extern const char mainboard_vendor[]; -extern const char mainboard_part_number[]; - /* coreboot Version */ extern const char coreboot_version[]; extern const char coreboot_extra_version[]; diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc index c83004a866..385c87eb7c 100644 --- a/src/lib/Makefile.inc +++ b/src/lib/Makefile.inc @@ -229,12 +229,8 @@ ifeq ($(CONFIG_DEBUG_SMI),y) smm-$(CONFIG_CONSOLE_CBMEM) += cbmem_console.c endif -bootblock-y += version.c -romstage-y += version.c -ramstage-y += version.c -smm-y += version.c -verstage-y += version.c -postcar-y += version.c +all-y += identity.c version.c +smm-y += identity.c version.c $(call src-to-obj,bootblock,$(dir)/version.c) : $(obj)/build.h $(call src-to-obj,romstage,$(dir)/version.c) : $(obj)/build.h diff --git a/src/lib/coreboot_table.c b/src/lib/coreboot_table.c index 0707fd3eca..bee389d0bf 100644 --- a/src/lib/coreboot_table.c +++ b/src/lib/coreboot_table.c @@ -4,12 +4,12 @@ #include <arch/cbconfig.h> #include <console/console.h> #include <console/uart.h> +#include <identity.h> #include <ip_checksum.h> #include <boot/coreboot_tables.h> #include <boot/tables.h> #include <boot_device.h> #include <string.h> -#include <version.h> #include <boardid.h> #include <device/device.h> #include <drivers/tpm/tpm_ppi.h> @@ -23,6 +23,7 @@ #include <spi_flash.h> #include <smmstore.h> #include <types.h> +#include <version.h> #if CONFIG(USE_OPTION_TABLE) #include <option_table.h> diff --git a/src/lib/identity.c b/src/lib/identity.c new file mode 100644 index 0000000000..04371a7382 --- /dev/null +++ b/src/lib/identity.c @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <identity.h> + +#ifndef CONFIG_MAINBOARD_VENDOR +#error CONFIG_MAINBOARD_VENDOR not defined +#endif +#ifndef CONFIG_MAINBOARD_PART_NUMBER +#error CONFIG_MAINBOARD_PART_NUMBER not defined +#endif + +const char mainboard_vendor[] = CONFIG_MAINBOARD_VENDOR; +const char mainboard_part_number[] = CONFIG_MAINBOARD_PART_NUMBER; +const char mainboard_name[] = CONFIG_MAINBOARD_VENDOR " " CONFIG_MAINBOARD_PART_NUMBER; diff --git a/src/lib/version.c b/src/lib/version.c index 84718328f0..43d6a45821 100644 --- a/src/lib/version.c +++ b/src/lib/version.c @@ -3,13 +3,6 @@ #include <version.h> #include <build.h> -#ifndef CONFIG_MAINBOARD_VENDOR -#error CONFIG_MAINBOARD_VENDOR not defined -#endif -#ifndef CONFIG_MAINBOARD_PART_NUMBER -#error CONFIG_MAINBOARD_PART_NUMBER not defined -#endif - #ifndef COREBOOT_VERSION #error COREBOOT_VERSION not defined #endif @@ -25,9 +18,6 @@ #define COREBOOT_EXTRA_VERSION "" #endif -const char mainboard_vendor[] = CONFIG_MAINBOARD_VENDOR; -const char mainboard_part_number[] = CONFIG_MAINBOARD_PART_NUMBER; - const char coreboot_version[] = COREBOOT_VERSION; const char coreboot_extra_version[] = COREBOOT_EXTRA_VERSION; const char coreboot_build[] = COREBOOT_BUILD; diff --git a/util/sconfig/main.c b/util/sconfig/main.c index aa79f1e187..a246c01c67 100644 --- a/util/sconfig/main.c +++ b/util/sconfig/main.c @@ -1965,6 +1965,7 @@ static void generate_outputc(FILE *f, const char *static_header) fprintf(f, "#include <device/device.h>\n"); fprintf(f, "#include <device/pci.h>\n"); fprintf(f, "#include <fw_config.h>\n"); + fprintf(f, "#include <identity.h>\n"); fprintf(f, "#include <%s>\n", static_header); emit_chip_headers(f, chip_header.next); emit_identifiers(f, "struct device_operations", device_operations); |