diff --git a/Documentation/soc/intel/code_development_model/code_development_model.md b/Documentation/soc/intel/code_development_model/code_development_model.md index ad27bd498a..11674e8bdc 100644 --- a/Documentation/soc/intel/code_development_model/code_development_model.md +++ b/Documentation/soc/intel/code_development_model/code_development_model.md @@ -87,9 +87,13 @@ Code design after common code in coreboot will look as follows: [coreboot_common_code_design]: coreboot_common_code_design.png -There will be still some duplicated files left in each SOC folder and we may -copy across a SOC as a base but these files are subject to change as -development continues. +There will be still some duplicated files left in each SOC folder and we +may copy across a SOC as a base but these files are subject to change as +development continues. Some of those files, presenting strong similarities +from generation to generation, can be consolidated into the common feature +directory to reduce code duplication and improve +maintenance. Platform-specific differences are handled through +configuration options or platform-specific macros. ## Benefits diff --git a/src/soc/intel/common/Kconfig.common b/src/soc/intel/common/Kconfig.common index a1a2f39cfb..5e6ae6b19f 100644 --- a/src/soc/intel/common/Kconfig.common +++ b/src/soc/intel/common/Kconfig.common @@ -94,6 +94,9 @@ if SOC_INTEL_COMMON comment "Intel SoC Common Code for IP blocks" source "src/soc/intel/common/block/Kconfig" +comment "Intel SoC Common Code for features" +source "src/soc/intel/common/feature/Kconfig" + comment "Intel SoC Common PCH Code" source "src/soc/intel/common/pch/Kconfig" diff --git a/src/soc/intel/common/Makefile.mk b/src/soc/intel/common/Makefile.mk index b273ed7c12..d1eacbfd17 100644 --- a/src/soc/intel/common/Makefile.mk +++ b/src/soc/intel/common/Makefile.mk @@ -3,6 +3,7 @@ ifeq ($(CONFIG_SOC_INTEL_COMMON),y) subdirs-y += basecode/ subdirs-y += block/ +subdirs-y += feature/ subdirs-y += pch/ verstage-$(CONFIG_SOC_INTEL_COMMON_RESET) += reset.c diff --git a/src/soc/intel/common/feature/Kconfig b/src/soc/intel/common/feature/Kconfig new file mode 100644 index 0000000000..357ebf3643 --- /dev/null +++ b/src/soc/intel/common/feature/Kconfig @@ -0,0 +1,18 @@ +## SPDX-License-Identifier: GPL-2.0-only + +config SOC_INTEL_COMMON_FEATURE + bool + help + Intel SoC common feature code. This option enables sharing of + SoC-specific code across Intel SoC generations to reduce code + duplication. Unlike the common block code which is intended for + reusable IP blocks, the feature code is for SoC-specific + functionality that is similar across multiple generations but + may have minor platform-specific differences handled through + configuration options or platform-specific macros. + +if SOC_INTEL_COMMON_FEATURE + +source "src/soc/intel/common/feature/*/Kconfig" + +endif diff --git a/src/soc/intel/common/feature/Makefile.mk b/src/soc/intel/common/feature/Makefile.mk new file mode 100644 index 0000000000..62cccaad42 --- /dev/null +++ b/src/soc/intel/common/feature/Makefile.mk @@ -0,0 +1,6 @@ +## SPDX-License-Identifier: GPL-2.0-only +ifeq ($(CONFIG_SOC_INTEL_COMMON_FEATURE),y) + +subdirs-y += ./* + +endif