From 84978674e30965b00ea512579b05af5ad890102f Mon Sep 17 00:00:00 2001 From: Richard Spiegel Date: Thu, 16 Aug 2018 11:08:25 -0700 Subject: soc/amd/common/block: Port vendorcode's LibAmdLocateImage In preparation to removing AmdLib, function LibAmdLocateImage() has to be ported to be used by agesawrapper. The most important aspect of this porting is that it has to obey coreboot format, specifically 8 character tab and 80 characters max. This required breaking the function in 2 (to solve indentation) and rename some variables to shorter names. One important aspect was breaking (AMD_MODULE_HEADER*)(((AMD_IMAGE_HEADER *) CurrentPtr)->ModuleInfoOffset) into: image_ptr = (AMD_IMAGE_HEADER *) current_ptr; if (validate_image((void *)image_ptr->ModuleInfoOffset, and, within validate_image completed by: AMD_MODULE_HEADER *mod_ptr = (AMD_MODULE_HEADER *)module_chain; BUG=b:112625809 TEST=Build grunt, functionality tested in next commit. Change-Id: I0d1e8b966cf7606fdb15a95de5771f835f07b2bc Signed-off-by: Richard Spiegel Reviewed-on: https://review.coreboot.org/28144 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth --- src/soc/amd/common/block/include/amdblocks/image.h | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/soc/amd/common/block/include/amdblocks/image.h (limited to 'src/soc/amd/common/block/include') diff --git a/src/soc/amd/common/block/include/amdblocks/image.h b/src/soc/amd/common/block/include/amdblocks/image.h new file mode 100644 index 0000000000..ccfcac5a5d --- /dev/null +++ b/src/soc/amd/common/block/include/amdblocks/image.h @@ -0,0 +1,24 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2018 Silverback, ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef __AMD_IMAGE_H__ +#define __AMD_IMAGE_H__ + +#include + +void *amd_find_image(const void *start_address, const void *end_address, + uint32_t alignment, const char name[8]); + +#endif /* __AMD_IMAGE_H__ */ -- cgit v1.2.3