diff options
author | Felix Held <felix.held@amd.corp-partner.google.com> | 2021-09-23 17:16:32 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2021-09-24 15:47:59 +0000 |
commit | c9737c5ce9d5a3c52ae86ea5fe538bec0b305b99 (patch) | |
tree | b2c0ef3904b50b29add494f5f75b105bb8e2ead5 /src/soc/amd/common/block/pi/image.c | |
parent | c0982abf86a6312e2572cc0225bbfe702c7ff2bd (diff) | |
download | coreboot-c9737c5ce9d5a3c52ae86ea5fe538bec0b305b99.tar.gz coreboot-c9737c5ce9d5a3c52ae86ea5fe538bec0b305b99.tar.bz2 coreboot-c9737c5ce9d5a3c52ae86ea5fe538bec0b305b99.zip |
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>
Diffstat (limited to 'src/soc/amd/common/block/pi/image.c')
-rw-r--r-- | src/soc/amd/common/block/pi/image.c | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/src/soc/amd/common/block/pi/image.c b/src/soc/amd/common/block/pi/image.c deleted file mode 100644 index 03a2a473a0bd..000000000000 --- a/src/soc/amd/common/block/pi/image.c +++ /dev/null @@ -1,48 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -#include <agesa_headers.h> -#include <amdblocks/image.h> -#include <types.h> - -/* Check if the image has the desired module. */ -static bool validate_image(void *module_chain, const char module_signature[8]) -{ - AMD_MODULE_HEADER *mod_ptr = (AMD_MODULE_HEADER *)module_chain; - uint64_t signature = *(uint64_t *)module_signature; - char *checking_str; - - while ((mod_ptr != NULL) && - (MODULE_SIGNATURE == *(uint32_t *)&mod_ptr->ModuleHeaderSignature)) { - checking_str = (char *)&mod_ptr->ModuleIdentifier; - if (signature == *(uint64_t *)checking_str) - return true; - mod_ptr = (AMD_MODULE_HEADER *)mod_ptr->NextBlock; - } - return false; -} - -/* - * Find an image that has the desired module. The image is aligned within - * a given range. - */ -void *amd_find_image(const void *start_address, const void *end_address, - uint32_t alignment, const char name[8]) -{ - uint8_t *current_ptr = (uint8_t *)start_address; - uint8_t *start = (uint8_t *)start_address; - uint8_t *end = (uint8_t *)end_address; - AMD_IMAGE_HEADER *image_ptr; - - while ((current_ptr >= start) && (current_ptr < end)) { - if (IMAGE_SIGNATURE == *((uint32_t *)current_ptr)) { - image_ptr = (AMD_IMAGE_HEADER *) current_ptr; - - /* Check if the image has the desired module */ - if (validate_image((void *)image_ptr->ModuleInfoOffset, - name)) - return current_ptr; - } - current_ptr += alignment; - } - return NULL; -} |