soc/amd/common: move block/pi out of the block folder

Since the binaryPI glue code is specific to a binary interface, but not
for a hardware block, move it out of the common blocks directory. This
also brings the binaryPI support in line with the FSP support which is
used on the newer generations. This also drops the
SOC_AMD_COMMON_BLOCK_PI Kconfig option and makes use of the already
existing SOC_AMD_PI Kconfig option instead.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I014e538f2772938031950475e456cc40dd05d74c
Reviewed-on: https://review.coreboot.org/c/coreboot/+/57884
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
diff --git a/src/soc/amd/common/Kconfig.common b/src/soc/amd/common/Kconfig.common
index 06fd8c5..6711843 100644
--- a/src/soc/amd/common/Kconfig.common
+++ b/src/soc/amd/common/Kconfig.common
@@ -5,10 +5,8 @@
 
 if SOC_AMD_COMMON
 
-config SOC_AMD_PI
-	bool
-
 source "src/soc/amd/common/block/*/Kconfig"
+source "src/soc/amd/common/pi/Kconfig"
 
 if PLATFORM_USES_FSP2_0
 
diff --git a/src/soc/amd/common/Makefile.inc b/src/soc/amd/common/Makefile.inc
index 4f1052d..bc3cb9b 100644
--- a/src/soc/amd/common/Makefile.inc
+++ b/src/soc/amd/common/Makefile.inc
@@ -1,5 +1,6 @@
 ifeq ($(CONFIG_SOC_AMD_COMMON),y)
 subdirs-y += block
 subdirs-y += fsp
+subdirs-y += pi
 subdirs-y += vboot
 endif
diff --git a/src/soc/amd/common/block/pi/Kconfig b/src/soc/amd/common/pi/Kconfig
similarity index 93%
rename from src/soc/amd/common/block/pi/Kconfig
rename to src/soc/amd/common/pi/Kconfig
index b872c13..7b95364 100644
--- a/src/soc/amd/common/block/pi/Kconfig
+++ b/src/soc/amd/common/pi/Kconfig
@@ -1,4 +1,4 @@
-config SOC_AMD_COMMON_BLOCK_PI
+config SOC_AMD_PI
 	bool
 	depends on SOC_AMD_COMMON_BLOCK_ACPI
 	select CACHE_MRC_SETTINGS
@@ -8,7 +8,7 @@
 	  This option builds functions that interface AMD's AGESA reference
 	  code packaged in the binaryPI form and S3-related functionality.
 
-if SOC_AMD_COMMON_BLOCK_PI
+if SOC_AMD_PI
 
 config PI_AGESA_CAR_HEAP_BASE
 	hex
@@ -34,4 +34,4 @@
 	  This option determines the amount of space allowed for AGESA heap
 	  prior to DRAM availability.
 
-endif
+endif # SOC_AMD_PI
diff --git a/src/soc/amd/common/block/pi/Makefile.inc b/src/soc/amd/common/pi/Makefile.inc
similarity index 83%
rename from src/soc/amd/common/block/pi/Makefile.inc
rename to src/soc/amd/common/pi/Makefile.inc
index 59f075d..55fbd95 100644
--- a/src/soc/amd/common/block/pi/Makefile.inc
+++ b/src/soc/amd/common/pi/Makefile.inc
@@ -1,4 +1,4 @@
-ifeq ($(CONFIG_SOC_AMD_COMMON_BLOCK_PI),y)
+ifeq ($(CONFIG_SOC_AMD_PI),y)
 
 romstage-y += agesawrapper.c
 romstage-y += def_callouts.c
@@ -16,4 +16,4 @@
 ramstage-y += refcode_loader.c
 ramstage-y += s3_resume.c
 
-endif # CONFIG_SOC_AMD_COMMON_BLOCK_PI
+endif # CONFIG_SOC_AMD_PI
diff --git a/src/soc/amd/common/block/pi/agesawrapper.c b/src/soc/amd/common/pi/agesawrapper.c
similarity index 100%
rename from src/soc/amd/common/block/pi/agesawrapper.c
rename to src/soc/amd/common/pi/agesawrapper.c
diff --git a/src/soc/amd/common/block/pi/amd_late_init.c b/src/soc/amd/common/pi/amd_late_init.c
similarity index 100%
rename from src/soc/amd/common/block/pi/amd_late_init.c
rename to src/soc/amd/common/pi/amd_late_init.c
diff --git a/src/soc/amd/common/block/pi/amd_resume_final.c b/src/soc/amd/common/pi/amd_resume_final.c
similarity index 100%
rename from src/soc/amd/common/block/pi/amd_resume_final.c
rename to src/soc/amd/common/pi/amd_resume_final.c
diff --git a/src/soc/amd/common/block/pi/def_callouts.c b/src/soc/amd/common/pi/def_callouts.c
similarity index 100%
rename from src/soc/amd/common/block/pi/def_callouts.c
rename to src/soc/amd/common/pi/def_callouts.c
diff --git a/src/soc/amd/common/block/pi/heapmanager.c b/src/soc/amd/common/pi/heapmanager.c
similarity index 100%
rename from src/soc/amd/common/block/pi/heapmanager.c
rename to src/soc/amd/common/pi/heapmanager.c
diff --git a/src/soc/amd/common/block/pi/image.c b/src/soc/amd/common/pi/image.c
similarity index 100%
rename from src/soc/amd/common/block/pi/image.c
rename to src/soc/amd/common/pi/image.c
diff --git a/src/soc/amd/common/block/pi/refcode_loader.c b/src/soc/amd/common/pi/refcode_loader.c
similarity index 100%
rename from src/soc/amd/common/block/pi/refcode_loader.c
rename to src/soc/amd/common/pi/refcode_loader.c
diff --git a/src/soc/amd/common/block/pi/s3_resume.c b/src/soc/amd/common/pi/s3_resume.c
similarity index 100%
rename from src/soc/amd/common/block/pi/s3_resume.c
rename to src/soc/amd/common/pi/s3_resume.c
diff --git a/src/soc/amd/stoneyridge/Kconfig b/src/soc/amd/stoneyridge/Kconfig
index b07b4c9..1f1e1a7 100644
--- a/src/soc/amd/stoneyridge/Kconfig
+++ b/src/soc/amd/stoneyridge/Kconfig
@@ -36,7 +36,6 @@
 	select SOC_AMD_COMMON_BLOCK_LPC
 	select SOC_AMD_COMMON_BLOCK_MCA
 	select SOC_AMD_COMMON_BLOCK_PCI
-	select SOC_AMD_COMMON_BLOCK_PI
 	select SOC_AMD_COMMON_BLOCK_PM
 	select SOC_AMD_COMMON_BLOCK_PSP_GEN1
 	select SOC_AMD_COMMON_BLOCK_SATA