From 2e973942bc34ff2d7b110ba35bf3cda987838907 Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Thu, 3 Sep 2020 21:17:20 -0700 Subject: program_loading: Replace prog_rdev() with raw start pointer and size Since prog_locate() was eliminated, prog_rdev() only ever represents the loaded program in memory now. Using the rdev API for this is unnecessary if we know that the "device" is always just memory. This patch changes it to be represented by a simple pointer and size. Since some code still really wants this to be an rdev, introduce a prog_chain_rdev() helper to translate back to that if necessary. Signed-off-by: Julius Werner Change-Id: If7c0f1c5698fa0c326e23c553ea0fe928b25d202 Reviewed-on: https://review.coreboot.org/c/coreboot/+/46483 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- src/soc/amd/common/block/pi/refcode_loader.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/soc/amd') diff --git a/src/soc/amd/common/block/pi/refcode_loader.c b/src/soc/amd/common/block/pi/refcode_loader.c index 1d8db89440..fe2df5b972 100644 --- a/src/soc/amd/common/block/pi/refcode_loader.c +++ b/src/soc/amd/common/block/pi/refcode_loader.c @@ -57,8 +57,9 @@ static int agesa_locate_stage_file_ramstage(const char *name, stage_cache_add(STAGE_REFCODE, &prog); } - return rdev_chain(rdev, prog_rdev(&prog), 0, - region_device_sz(prog_rdev(&prog))); + prog_chain_rdev(&prog, rdev); + + return 0; } static int agesa_locate_stage_file(const char *name, struct region_device *rdev) -- cgit v1.2.3