Wonkyu Kim has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34174 )
Change subject: soc/intel/icelake: use existing type definition ......................................................................
soc/intel/icelake: use existing type definition
use config_t type denfinition instead of soc speific structure name (soc_intel_icelake_config) in c file
TEST= Build icelake platform
Change-Id: I05d7ec376d0d4f263a1e27f36b3d37f16a695e61 Signed-off-by: Wonkyu Kim wonkyu.kim@intel.com --- M src/soc/intel/icelake/acpi.c M src/soc/intel/icelake/fsp_params.c M src/soc/intel/icelake/memmap.c M src/soc/intel/icelake/pmutil.c M src/soc/intel/icelake/romstage/fsp_params.c M src/soc/intel/icelake/smihandler.c 6 files changed, 9 insertions(+), 9 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/74/34174/1
diff --git a/src/soc/intel/icelake/acpi.c b/src/soc/intel/icelake/acpi.c index ae7b344..99c9ee8 100644 --- a/src/soc/intel/icelake/acpi.c +++ b/src/soc/intel/icelake/acpi.c @@ -169,7 +169,7 @@ { const uint16_t pmbase = ACPI_BASE_ADDRESS; const struct device *dev = pcidev_on_root(0, 0); - const struct soc_intel_icelake_config *config = dev->chip_info; + const config_t *config = dev->chip_info;
if (!config->PmTimerDisabled) { fadt->pm_tmr_blk = pmbase + PM1_TMR; @@ -194,7 +194,7 @@ void acpi_create_gnvs(struct global_nvs_t *gnvs) { const struct device *dev = pcidev_on_root(0, 0); - const struct soc_intel_icelake_config *config = dev->chip_info; + const config_t *config = dev->chip_info;
/* Set unknown wake source */ gnvs->pm1i = -1; diff --git a/src/soc/intel/icelake/fsp_params.c b/src/soc/intel/icelake/fsp_params.c index 8b65a89..f9e8f64 100644 --- a/src/soc/intel/icelake/fsp_params.c +++ b/src/soc/intel/icelake/fsp_params.c @@ -35,7 +35,7 @@ return; }
- const struct soc_intel_icelake_config *config = dev->chip_info; + const config_t *config = dev->chip_info;
for (int i = 0; i < CONFIG_SOC_INTEL_I2C_DEV_MAX; i++) params->SerialIoI2cMode[i] = config->SerialIoI2cMode[i]; diff --git a/src/soc/intel/icelake/memmap.c b/src/soc/intel/icelake/memmap.c index 67f71da..0704dc7 100644 --- a/src/soc/intel/icelake/memmap.c +++ b/src/soc/intel/icelake/memmap.c @@ -94,7 +94,7 @@
/* Calculate PRMRR size based on user input PRMRR size and alignment */ static size_t get_prmrr_size(uintptr_t dram_base, - const struct soc_intel_icelake_config *config) + const config_t *config) { uintptr_t prmrr_base = dram_base; size_t prmrr_size; @@ -164,7 +164,7 @@ { uintptr_t reserve_mem_base = dram_base; size_t reserve_mem_size; - const struct soc_intel_icelake_config *config; + const config_t *config;
config = dev->chip_info;
diff --git a/src/soc/intel/icelake/pmutil.c b/src/soc/intel/icelake/pmutil.c index 45f2a70..3683a5a 100644 --- a/src/soc/intel/icelake/pmutil.c +++ b/src/soc/intel/icelake/pmutil.c @@ -172,7 +172,7 @@
void soc_get_gpi_gpe_configs(uint8_t *dw0, uint8_t *dw1, uint8_t *dw2) { - DEVTREE_CONST struct soc_intel_icelake_config *config; + DEVTREE_CONST config_t *config;
/* Look up the device in devicetree */ DEVTREE_CONST struct device *dev = pcidev_path_on_root(PCH_DEVFN_PMC); diff --git a/src/soc/intel/icelake/romstage/fsp_params.c b/src/soc/intel/icelake/romstage/fsp_params.c index 420c427..1a44d9b 100644 --- a/src/soc/intel/icelake/romstage/fsp_params.c +++ b/src/soc/intel/icelake/romstage/fsp_params.c @@ -22,7 +22,7 @@ #include <soc/soc_chip.h>
static void soc_memory_init_params(FSP_M_CONFIG *m_cfg, - const struct soc_intel_icelake_config *config) + const config_t *config) { unsigned int i; const struct device *dev; @@ -67,7 +67,7 @@ { const struct device *dev = pcidev_on_root(0, 0); assert(dev != NULL); - const struct soc_intel_icelake_config *config = dev->chip_info; + const config_t *config = dev->chip_info; FSP_M_CONFIG *m_cfg = &mupd->FspmConfig;
soc_memory_init_params(m_cfg, config); diff --git a/src/soc/intel/icelake/smihandler.c b/src/soc/intel/icelake/smihandler.c index 3d41ee0..5cb39cbd 100644 --- a/src/soc/intel/icelake/smihandler.c +++ b/src/soc/intel/icelake/smihandler.c @@ -74,7 +74,7 @@ */ void smihandler_soc_at_finalize(void) { - const struct soc_intel_icelake_config *config; + const config_t *config; const struct device *dev = pcidev_path_on_root(PCH_DEVFN_CSE);
if (!dev || !dev->chip_info) {
Wonkyu Kim has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34174 )
Change subject: soc/intel/icelake: use existing type definition ......................................................................
Patch Set 1: Code-Review+1
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34174 )
Change subject: soc/intel/icelake: use existing type definition ......................................................................
Patch Set 1: Code-Review-1
Use of typedefs is discouraged in coreboot.
Wonkyu Kim has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34174 )
Change subject: soc/intel/icelake: use existing type definition ......................................................................
Patch Set 1:
I understand your concern for using type definition. C files already used both soc_intel_icelake_config and contig_t. So, the change is using config_t for all icelake soc c file.
And main reason why we try to use config_t is making more reusable code. By using config_t, some files can be used directly for other silicon rather than adding same c file in other soc folder.
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34174 )
Change subject: soc/intel/icelake: use existing type definition ......................................................................
Patch Set 1:
Copy pasting code around is even more discouraged. Please use a common shared codebase instead. Please get rid of existing typedef usage.
Wonkyu Kim has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34174 )
Change subject: soc/intel/icelake: use existing type definition ......................................................................
Patch Set 1:
Patch Set 1:
Copy pasting code around is even more discouraged. Please use a common shared codebase instead. Please get rid of existing typedef usage.
it's not pasting code but reuse code directly. And the code can't be pure common but we can reuse similar generation soc code direcly for avoiding duplicated similar code.
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34174 )
Change subject: soc/intel/icelake: use existing type definition ......................................................................
Patch Set 1: Code-Review-1
Patch Set 1:
Patch Set 1:
Copy pasting code around is even more discouraged. Please use a common shared codebase instead. Please get rid of existing typedef usage.
it's not pasting code but reuse code directly. And the code can't be pure common but we can reuse similar generation soc code direcly for avoiding duplicated similar code.
Yes, that makes sense. However that can be achieved without using typedefs, too.
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34174 )
Change subject: soc/intel/icelake: use existing type definition ......................................................................
Patch Set 1: -Code-Review
Wonkyu Kim has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/34174 )
Change subject: soc/intel/icelake: use existing type definition ......................................................................
Abandoned