Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/47876 )
Change subject: soc/amd/common: simplify conditionals in Makefiles ......................................................................
soc/amd/common: simplify conditionals in Makefiles
If there are multiple statements that are conditional on the same Kconfig option, group them and move the condition check around the statement. If there's only one statement depending on one condition, use the short form instead.
Change-Id: I89cb17954150c146ffc762d8cb2e3b3b374924de Signed-off-by: Felix Held felix-coreboot@felixheld.de --- M src/soc/amd/common/block/acpi/Makefile.inc M src/soc/amd/common/block/acpimmio/Makefile.inc M src/soc/amd/common/block/alink/Makefile.inc M src/soc/amd/common/block/gpio_banks/Makefile.inc M src/soc/amd/common/block/lpc/Makefile.inc M src/soc/amd/common/block/psp/Makefile.inc M src/soc/amd/common/block/spi/Makefile.inc 7 files changed, 91 insertions(+), 60 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/76/47876/1
diff --git a/src/soc/amd/common/block/acpi/Makefile.inc b/src/soc/amd/common/block/acpi/Makefile.inc index f0b336d..10e522f 100644 --- a/src/soc/amd/common/block/acpi/Makefile.inc +++ b/src/soc/amd/common/block/acpi/Makefile.inc @@ -1,6 +1,10 @@ -bootblock-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPI) += acpi.c -verstage_x86-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPI) += acpi.c -romstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPI) += acpi.c -ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPI) += acpi.c -postcar-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPI) += acpi.c -smm-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPI) += acpi.c +ifeq ($(CONFIG_SOC_AMD_COMMON_BLOCK_ACPI),y) + +bootblock-y += acpi.c +verstage_x86-y += acpi.c +romstage-y += acpi.c +ramstage-y += acpi.c +postcar-y += acpi.c +smm-y += acpi.c + +endif # CONFIG_SOC_AMD_COMMON_BLOCK_ACPI diff --git a/src/soc/amd/common/block/acpimmio/Makefile.inc b/src/soc/amd/common/block/acpimmio/Makefile.inc index 553d9e2..6b3e423 100644 --- a/src/soc/amd/common/block/acpimmio/Makefile.inc +++ b/src/soc/amd/common/block/acpimmio/Makefile.inc @@ -1,13 +1,17 @@ -bootblock-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPIMMIO) += mmio_util.c -verstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPIMMIO) += mmio_util.c -romstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPIMMIO) += mmio_util.c -postcar-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPIMMIO) += mmio_util.c -ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPIMMIO) += mmio_util.c -smm-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPIMMIO) += mmio_util.c +ifeq ($(CONFIG_SOC_AMD_COMMON_BLOCK_ACPIMMIO),y)
-bootblock-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPIMMIO) += biosram.c -verstage_x86-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPIMMIO) += biosram.c -romstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPIMMIO) += biosram.c -postcar-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPIMMIO) += biosram.c -ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPIMMIO) += biosram.c -smm-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPIMMIO) += biosram.c +bootblock-y += mmio_util.c +verstage-y += mmio_util.c +romstage-y += mmio_util.c +postcar-y += mmio_util.c +ramstage-y += mmio_util.c +smm-y += mmio_util.c + +bootblock-y += biosram.c +verstage_x86-y += biosram.c +romstage-y += biosram.c +postcar-y += biosram.c +ramstage-y += biosram.c +smm-y += biosram.c + +endif # CONFIG_SOC_AMD_COMMON_BLOCK_ACPIMMIO diff --git a/src/soc/amd/common/block/alink/Makefile.inc b/src/soc/amd/common/block/alink/Makefile.inc index 9d27aec..b393c3d 100644 --- a/src/soc/amd/common/block/alink/Makefile.inc +++ b/src/soc/amd/common/block/alink/Makefile.inc @@ -1,6 +1,10 @@ -bootblock-$(CONFIG_SOC_AMD_COMMON_BLOCK_ALINK) += alink.c -verstage_x86-$(CONFIG_SOC_AMD_COMMON_BLOCK_ALINK) += alink.c -romstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_ALINK) += alink.c -postcar-$(CONFIG_SOC_AMD_COMMON_BLOCK_ALINK) += alink.c -ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_ALINK) += alink.c -smm-$(CONFIG_SOC_AMD_COMMON_BLOCK_ALINK) += alink.c +ifeq ($(CONFIG_SOC_AMD_COMMON_BLOCK_ALINK),y) + +bootblock-y += alink.c +verstage_x86-y += alink.c +romstage-y += alink.c +postcar-y += alink.c +ramstage-y += alink.c +smm-y += alink.c + +endif # CONFIG_SOC_AMD_COMMON_BLOCK_ALINK diff --git a/src/soc/amd/common/block/gpio_banks/Makefile.inc b/src/soc/amd/common/block/gpio_banks/Makefile.inc index f1555b1..5b738bd 100644 --- a/src/soc/amd/common/block/gpio_banks/Makefile.inc +++ b/src/soc/amd/common/block/gpio_banks/Makefile.inc @@ -1,6 +1,10 @@ -bootblock-$(CONFIG_SOC_AMD_COMMON_BLOCK_BANKED_GPIOS) += gpio.c -verstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_BANKED_GPIOS) += gpio.c -romstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_BANKED_GPIOS) += gpio.c -postcar-$(CONFIG_SOC_AMD_COMMON_BLOCK_BANKED_GPIOS) += gpio.c -ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_BANKED_GPIOS) += gpio.c -smm-$(CONFIG_SOC_AMD_COMMON_BLOCK_BANKED_GPIOS) += gpio.c +ifeq ($(CONFIG_SOC_AMD_COMMON_BLOCK_BANKED_GPIOS),y) + +bootblock-y += gpio.c +verstage-y += gpio.c +romstage-y += gpio.c +postcar-y += gpio.c +ramstage-y += gpio.c +smm-y += gpio.c + +endif # CONFIG_SOC_AMD_COMMON_BLOCK_BANKED_GPIOS diff --git a/src/soc/amd/common/block/lpc/Makefile.inc b/src/soc/amd/common/block/lpc/Makefile.inc index 7db176b..68e528f 100644 --- a/src/soc/amd/common/block/lpc/Makefile.inc +++ b/src/soc/amd/common/block/lpc/Makefile.inc @@ -1,13 +1,21 @@ -ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_LPC) += lpc.c +ifeq ($(CONFIG_SOC_AMD_COMMON_BLOCK_LPC),y)
-bootblock-$(CONFIG_SOC_AMD_COMMON_BLOCK_LPC) += lpc_util.c -verstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_LPC) += lpc_util.c -romstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_LPC) += lpc_util.c -postcar-$(CONFIG_SOC_AMD_COMMON_BLOCK_LPC) += lpc_util.c -ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_LPC) += lpc_util.c -smm-$(CONFIG_SOC_AMD_COMMON_BLOCK_LPC) += lpc_util.c +ramstage-y += lpc.c
-bootblock-$(CONFIG_SOC_AMD_COMMON_BLOCK_USE_ESPI) += espi_util.c -romstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_USE_ESPI) += espi_util.c -ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_USE_ESPI) += espi_util.c -verstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_USE_ESPI) += espi_util.c +bootblock-y += lpc_util.c +verstage-y += lpc_util.c +romstage-y += lpc_util.c +postcar-y += lpc_util.c +ramstage-y += lpc_util.c +smm-y += lpc_util.c + +endif # CONFIG_SOC_AMD_COMMON_BLOCK_LPC + +ifeq ($(CONFIG_SOC_AMD_COMMON_BLOCK_USE_ESPI),y) + +bootblock-y += espi_util.c +romstage-y += espi_util.c +ramstage-y += espi_util.c +verstage-y += espi_util.c + +endif # CONFIG_SOC_AMD_COMMON_BLOCK_USE_ESPI diff --git a/src/soc/amd/common/block/psp/Makefile.inc b/src/soc/amd/common/block/psp/Makefile.inc index c2a3335..363a0ab 100644 --- a/src/soc/amd/common/block/psp/Makefile.inc +++ b/src/soc/amd/common/block/psp/Makefile.inc @@ -1,16 +1,27 @@ -bootblock-$(CONFIG_SOC_AMD_COMMON_BLOCK_PSP) += psp.c -bootblock-$(CONFIG_SOC_AMD_COMMON_BLOCK_PSP_GEN1) += psp_gen1.c -bootblock-$(CONFIG_SOC_AMD_COMMON_BLOCK_PSP_GEN2) += psp_gen2.c +ifeq ($(CONFIG_SOC_AMD_COMMON_BLOCK_PSP),y)
-romstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_PSP) += psp.c -romstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_PSP_GEN1) += psp_gen1.c -romstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_PSP_GEN2) += psp_gen2.c +bootblock-y += psp.c +romstage-y += psp.c +ramstage-y += psp.c +smm-y += psp.c +smm-y += psp_smm.c
-ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_PSP) += psp.c -ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_PSP_GEN1) += psp_gen1.c -ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_PSP_GEN2) += psp_gen2.c +endif # CONFIG_SOC_AMD_COMMON_BLOCK_PSP
-smm-$(CONFIG_SOC_AMD_COMMON_BLOCK_PSP) += psp.c -smm-$(CONFIG_SOC_AMD_COMMON_BLOCK_PSP) += psp_smm.c -smm-$(CONFIG_SOC_AMD_COMMON_BLOCK_PSP_GEN1) += psp_gen1.c -smm-$(CONFIG_SOC_AMD_COMMON_BLOCK_PSP_GEN2) += psp_gen2.c +ifeq ($(CONFIG_SOC_AMD_COMMON_BLOCK_PSP_GEN1),y) + +bootblock-y += psp_gen1.c +romstage-y += psp_gen1.c +ramstage-y += psp_gen1.c +smm-y += psp_gen1.c + +endif # CONFIG_SOC_AMD_COMMON_BLOCK_PSP_GEN1 + +ifeq ($(CONFIG_SOC_AMD_COMMON_BLOCK_PSP_GEN2),y) + +bootblock-y += psp_gen2.c +romstage-y += psp_gen2.c +ramstage-y += psp_gen2.c +smm-y += psp_gen2.c + +endif # CONFIG_SOC_AMD_COMMON_BLOCK_PSP_GEN2 diff --git a/src/soc/amd/common/block/spi/Makefile.inc b/src/soc/amd/common/block/spi/Makefile.inc index c8b733f..c58df39 100644 --- a/src/soc/amd/common/block/spi/Makefile.inc +++ b/src/soc/amd/common/block/spi/Makefile.inc @@ -5,18 +5,14 @@ verstage-y += fch_spi_ctrl.c postcar-y += fch_spi_ctrl.c ramstage-y += fch_spi_ctrl.c -ifeq ($(CONFIG_SPI_FLASH_SMM),y) -smm-y += fch_spi_ctrl.c -endif +smm-$(CONFIG_SPI_FLASH_SMM) += fch_spi_ctrl.c
bootblock-y += fch_spi.c romstage-y += fch_spi.c postcar-y += fch_spi.c ramstage-y += fch_spi.c verstage-y += fch_spi.c -ifeq ($(CONFIG_SPI_FLASH_SMM),y) -smm-y += fch_spi.c -endif +smm-$(CONFIG_SPI_FLASH_SMM) += fch_spi.c
bootblock-y += fch_spi_util.c romstage-y += fch_spi_util.c
Arthur Heymans has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/47876 )
Change subject: soc/amd/common: simplify conditionals in Makefiles ......................................................................
Patch Set 3: Code-Review+2
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/47876 )
Change subject: soc/amd/common: simplify conditionals in Makefiles ......................................................................
soc/amd/common: simplify conditionals in Makefiles
If there are multiple statements that are conditional on the same Kconfig option, group them and move the condition check around the statement. If there's only one statement depending on one condition, use the short form instead.
Change-Id: I89cb17954150c146ffc762d8cb2e3b3b374924de Signed-off-by: Felix Held felix-coreboot@felixheld.de Reviewed-on: https://review.coreboot.org/c/coreboot/+/47876 Reviewed-by: Arthur Heymans arthur@aheymans.xyz Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/soc/amd/common/block/acpi/Makefile.inc M src/soc/amd/common/block/acpimmio/Makefile.inc M src/soc/amd/common/block/alink/Makefile.inc M src/soc/amd/common/block/gpio_banks/Makefile.inc M src/soc/amd/common/block/lpc/Makefile.inc M src/soc/amd/common/block/psp/Makefile.inc M src/soc/amd/common/block/spi/Makefile.inc 7 files changed, 91 insertions(+), 60 deletions(-)
Approvals: build bot (Jenkins): Verified Arthur Heymans: Looks good to me, approved
diff --git a/src/soc/amd/common/block/acpi/Makefile.inc b/src/soc/amd/common/block/acpi/Makefile.inc index f0b336d..10e522f 100644 --- a/src/soc/amd/common/block/acpi/Makefile.inc +++ b/src/soc/amd/common/block/acpi/Makefile.inc @@ -1,6 +1,10 @@ -bootblock-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPI) += acpi.c -verstage_x86-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPI) += acpi.c -romstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPI) += acpi.c -ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPI) += acpi.c -postcar-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPI) += acpi.c -smm-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPI) += acpi.c +ifeq ($(CONFIG_SOC_AMD_COMMON_BLOCK_ACPI),y) + +bootblock-y += acpi.c +verstage_x86-y += acpi.c +romstage-y += acpi.c +ramstage-y += acpi.c +postcar-y += acpi.c +smm-y += acpi.c + +endif # CONFIG_SOC_AMD_COMMON_BLOCK_ACPI diff --git a/src/soc/amd/common/block/acpimmio/Makefile.inc b/src/soc/amd/common/block/acpimmio/Makefile.inc index 553d9e2..6b3e423 100644 --- a/src/soc/amd/common/block/acpimmio/Makefile.inc +++ b/src/soc/amd/common/block/acpimmio/Makefile.inc @@ -1,13 +1,17 @@ -bootblock-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPIMMIO) += mmio_util.c -verstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPIMMIO) += mmio_util.c -romstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPIMMIO) += mmio_util.c -postcar-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPIMMIO) += mmio_util.c -ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPIMMIO) += mmio_util.c -smm-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPIMMIO) += mmio_util.c +ifeq ($(CONFIG_SOC_AMD_COMMON_BLOCK_ACPIMMIO),y)
-bootblock-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPIMMIO) += biosram.c -verstage_x86-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPIMMIO) += biosram.c -romstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPIMMIO) += biosram.c -postcar-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPIMMIO) += biosram.c -ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPIMMIO) += biosram.c -smm-$(CONFIG_SOC_AMD_COMMON_BLOCK_ACPIMMIO) += biosram.c +bootblock-y += mmio_util.c +verstage-y += mmio_util.c +romstage-y += mmio_util.c +postcar-y += mmio_util.c +ramstage-y += mmio_util.c +smm-y += mmio_util.c + +bootblock-y += biosram.c +verstage_x86-y += biosram.c +romstage-y += biosram.c +postcar-y += biosram.c +ramstage-y += biosram.c +smm-y += biosram.c + +endif # CONFIG_SOC_AMD_COMMON_BLOCK_ACPIMMIO diff --git a/src/soc/amd/common/block/alink/Makefile.inc b/src/soc/amd/common/block/alink/Makefile.inc index 9d27aec..b393c3d 100644 --- a/src/soc/amd/common/block/alink/Makefile.inc +++ b/src/soc/amd/common/block/alink/Makefile.inc @@ -1,6 +1,10 @@ -bootblock-$(CONFIG_SOC_AMD_COMMON_BLOCK_ALINK) += alink.c -verstage_x86-$(CONFIG_SOC_AMD_COMMON_BLOCK_ALINK) += alink.c -romstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_ALINK) += alink.c -postcar-$(CONFIG_SOC_AMD_COMMON_BLOCK_ALINK) += alink.c -ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_ALINK) += alink.c -smm-$(CONFIG_SOC_AMD_COMMON_BLOCK_ALINK) += alink.c +ifeq ($(CONFIG_SOC_AMD_COMMON_BLOCK_ALINK),y) + +bootblock-y += alink.c +verstage_x86-y += alink.c +romstage-y += alink.c +postcar-y += alink.c +ramstage-y += alink.c +smm-y += alink.c + +endif # CONFIG_SOC_AMD_COMMON_BLOCK_ALINK diff --git a/src/soc/amd/common/block/gpio_banks/Makefile.inc b/src/soc/amd/common/block/gpio_banks/Makefile.inc index f1555b1..5b738bd 100644 --- a/src/soc/amd/common/block/gpio_banks/Makefile.inc +++ b/src/soc/amd/common/block/gpio_banks/Makefile.inc @@ -1,6 +1,10 @@ -bootblock-$(CONFIG_SOC_AMD_COMMON_BLOCK_BANKED_GPIOS) += gpio.c -verstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_BANKED_GPIOS) += gpio.c -romstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_BANKED_GPIOS) += gpio.c -postcar-$(CONFIG_SOC_AMD_COMMON_BLOCK_BANKED_GPIOS) += gpio.c -ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_BANKED_GPIOS) += gpio.c -smm-$(CONFIG_SOC_AMD_COMMON_BLOCK_BANKED_GPIOS) += gpio.c +ifeq ($(CONFIG_SOC_AMD_COMMON_BLOCK_BANKED_GPIOS),y) + +bootblock-y += gpio.c +verstage-y += gpio.c +romstage-y += gpio.c +postcar-y += gpio.c +ramstage-y += gpio.c +smm-y += gpio.c + +endif # CONFIG_SOC_AMD_COMMON_BLOCK_BANKED_GPIOS diff --git a/src/soc/amd/common/block/lpc/Makefile.inc b/src/soc/amd/common/block/lpc/Makefile.inc index 7db176b..68e528f 100644 --- a/src/soc/amd/common/block/lpc/Makefile.inc +++ b/src/soc/amd/common/block/lpc/Makefile.inc @@ -1,13 +1,21 @@ -ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_LPC) += lpc.c +ifeq ($(CONFIG_SOC_AMD_COMMON_BLOCK_LPC),y)
-bootblock-$(CONFIG_SOC_AMD_COMMON_BLOCK_LPC) += lpc_util.c -verstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_LPC) += lpc_util.c -romstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_LPC) += lpc_util.c -postcar-$(CONFIG_SOC_AMD_COMMON_BLOCK_LPC) += lpc_util.c -ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_LPC) += lpc_util.c -smm-$(CONFIG_SOC_AMD_COMMON_BLOCK_LPC) += lpc_util.c +ramstage-y += lpc.c
-bootblock-$(CONFIG_SOC_AMD_COMMON_BLOCK_USE_ESPI) += espi_util.c -romstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_USE_ESPI) += espi_util.c -ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_USE_ESPI) += espi_util.c -verstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_USE_ESPI) += espi_util.c +bootblock-y += lpc_util.c +verstage-y += lpc_util.c +romstage-y += lpc_util.c +postcar-y += lpc_util.c +ramstage-y += lpc_util.c +smm-y += lpc_util.c + +endif # CONFIG_SOC_AMD_COMMON_BLOCK_LPC + +ifeq ($(CONFIG_SOC_AMD_COMMON_BLOCK_USE_ESPI),y) + +bootblock-y += espi_util.c +romstage-y += espi_util.c +ramstage-y += espi_util.c +verstage-y += espi_util.c + +endif # CONFIG_SOC_AMD_COMMON_BLOCK_USE_ESPI diff --git a/src/soc/amd/common/block/psp/Makefile.inc b/src/soc/amd/common/block/psp/Makefile.inc index c2a3335..363a0ab 100644 --- a/src/soc/amd/common/block/psp/Makefile.inc +++ b/src/soc/amd/common/block/psp/Makefile.inc @@ -1,16 +1,27 @@ -bootblock-$(CONFIG_SOC_AMD_COMMON_BLOCK_PSP) += psp.c -bootblock-$(CONFIG_SOC_AMD_COMMON_BLOCK_PSP_GEN1) += psp_gen1.c -bootblock-$(CONFIG_SOC_AMD_COMMON_BLOCK_PSP_GEN2) += psp_gen2.c +ifeq ($(CONFIG_SOC_AMD_COMMON_BLOCK_PSP),y)
-romstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_PSP) += psp.c -romstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_PSP_GEN1) += psp_gen1.c -romstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_PSP_GEN2) += psp_gen2.c +bootblock-y += psp.c +romstage-y += psp.c +ramstage-y += psp.c +smm-y += psp.c +smm-y += psp_smm.c
-ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_PSP) += psp.c -ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_PSP_GEN1) += psp_gen1.c -ramstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_PSP_GEN2) += psp_gen2.c +endif # CONFIG_SOC_AMD_COMMON_BLOCK_PSP
-smm-$(CONFIG_SOC_AMD_COMMON_BLOCK_PSP) += psp.c -smm-$(CONFIG_SOC_AMD_COMMON_BLOCK_PSP) += psp_smm.c -smm-$(CONFIG_SOC_AMD_COMMON_BLOCK_PSP_GEN1) += psp_gen1.c -smm-$(CONFIG_SOC_AMD_COMMON_BLOCK_PSP_GEN2) += psp_gen2.c +ifeq ($(CONFIG_SOC_AMD_COMMON_BLOCK_PSP_GEN1),y) + +bootblock-y += psp_gen1.c +romstage-y += psp_gen1.c +ramstage-y += psp_gen1.c +smm-y += psp_gen1.c + +endif # CONFIG_SOC_AMD_COMMON_BLOCK_PSP_GEN1 + +ifeq ($(CONFIG_SOC_AMD_COMMON_BLOCK_PSP_GEN2),y) + +bootblock-y += psp_gen2.c +romstage-y += psp_gen2.c +ramstage-y += psp_gen2.c +smm-y += psp_gen2.c + +endif # CONFIG_SOC_AMD_COMMON_BLOCK_PSP_GEN2 diff --git a/src/soc/amd/common/block/spi/Makefile.inc b/src/soc/amd/common/block/spi/Makefile.inc index c8b733f..c58df39 100644 --- a/src/soc/amd/common/block/spi/Makefile.inc +++ b/src/soc/amd/common/block/spi/Makefile.inc @@ -5,18 +5,14 @@ verstage-y += fch_spi_ctrl.c postcar-y += fch_spi_ctrl.c ramstage-y += fch_spi_ctrl.c -ifeq ($(CONFIG_SPI_FLASH_SMM),y) -smm-y += fch_spi_ctrl.c -endif +smm-$(CONFIG_SPI_FLASH_SMM) += fch_spi_ctrl.c
bootblock-y += fch_spi.c romstage-y += fch_spi.c postcar-y += fch_spi.c ramstage-y += fch_spi.c verstage-y += fch_spi.c -ifeq ($(CONFIG_SPI_FLASH_SMM),y) -smm-y += fch_spi.c -endif +smm-$(CONFIG_SPI_FLASH_SMM) += fch_spi.c
bootblock-y += fch_spi_util.c romstage-y += fch_spi_util.c