soc/intel/common: Add feature directory for SoC-specific common code
Introduce a new directory structure src/soc/intel/common/feature/ for sharing SoC-specific code across Intel SoC generations to reduce code duplication. Unlike the common block code (src/soc/intel/common/block/) which is intended for reusable IP blocks, the feature code is for SoC-specific functionality that is similar (but not identical) across multiple generations. Platform-specific differences are handled through configuration options or platform-specific macros. This commit: - Creates src/soc/intel/common/feature/ directory - Adds feature/Kconfig defining SOC_INTEL_COMMON_FEATURE - Adds feature/Makefile.mk to build subdirectories - Updates src/soc/intel/common/Kconfig.common to source feature/Kconfig - Updates src/soc/intel/common/Makefile.mk to include feature/ subdirs - Documents the common code directory structure in Documentation/soc/intel/code_development_model/code_development_model.md Change-Id: Idb842376a0a785a6439eeeb5a3a934d0bc575b09 Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/91360 Reviewed-by: Bora Guvendik <bora.guvendik@intel.corp-partner.google.com> Reviewed-by: Jakub "Kuba" Czapiga <czapiga@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Pranava Y N <pranavayn@google.com>
This commit is contained in:
parent
f691421daf
commit
78295974f8
5 changed files with 35 additions and 3 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
18
src/soc/intel/common/feature/Kconfig
Normal file
18
src/soc/intel/common/feature/Kconfig
Normal file
|
|
@ -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
|
||||
6
src/soc/intel/common/feature/Makefile.mk
Normal file
6
src/soc/intel/common/feature/Makefile.mk
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
## SPDX-License-Identifier: GPL-2.0-only
|
||||
ifeq ($(CONFIG_SOC_INTEL_COMMON_FEATURE),y)
|
||||
|
||||
subdirs-y += ./*
|
||||
|
||||
endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue