From 1a39aa01d118a0d917cbe326bd6cfdfa9bbcf0bf Mon Sep 17 00:00:00 2001 From: Felix Held Date: Mon, 8 Feb 2021 20:02:58 +0100 Subject: soc/amd/picasso: move bert_reserved_region to common/block/cpu/noncar The same functionality will eventually be needed on Cezanne. Signed-off-by: Felix Held Change-Id: Ib49124c2c774ad3352ea2f7d8d827388029be041 Reviewed-on: https://review.coreboot.org/c/coreboot/+/50401 Tested-by: build bot (Jenkins) Reviewed-by: Marshall Dawson --- src/soc/amd/common/block/cpu/noncar/memmap.c | 20 ++++++++++++++++++++ src/soc/amd/picasso/Makefile.inc | 2 -- src/soc/amd/picasso/memmap.c | 28 ---------------------------- 3 files changed, 20 insertions(+), 30 deletions(-) delete mode 100644 src/soc/amd/picasso/memmap.c (limited to 'src/soc/amd') diff --git a/src/soc/amd/common/block/cpu/noncar/memmap.c b/src/soc/amd/common/block/cpu/noncar/memmap.c index 7a7f8efd56..921dd65bd6 100644 --- a/src/soc/amd/common/block/cpu/noncar/memmap.c +++ b/src/soc/amd/common/block/cpu/noncar/memmap.c @@ -2,6 +2,7 @@ #include #include +#include #include #include #include @@ -58,3 +59,22 @@ void smm_region(uintptr_t *start, size_t *size) once = 1; } } + +void bert_reserved_region(void **start, size_t *size) +{ + struct range_entry bert; + int status; + + *start = NULL; + *size = 0; + + status = fsp_find_range_hob(&bert, AMD_FSP_BERT_HOB_GUID.b); + + if (status < 0) { + printk(BIOS_ERR, "Error: unable to find BERT HOB\n"); + return; + } + + *start = (void *)(uintptr_t)range_entry_base(&bert); + *size = range_entry_size(&bert); +} diff --git a/src/soc/amd/picasso/Makefile.inc b/src/soc/amd/picasso/Makefile.inc index e92de1f588..99e2da1040 100644 --- a/src/soc/amd/picasso/Makefile.inc +++ b/src/soc/amd/picasso/Makefile.inc @@ -23,7 +23,6 @@ romstage-y += i2c.c romstage-y += romstage.c romstage-y += gpio.c romstage-y += reset.c -romstage-y += memmap.c romstage-y += uart.c romstage-y += mrc_cache.c @@ -45,7 +44,6 @@ ramstage-y += fch.c ramstage-y += reset.c ramstage-y += acp.c ramstage-y += sata.c -ramstage-y += memmap.c ramstage-y += uart.c ramstage-y += finalize.c ramstage-y += soc_util.c diff --git a/src/soc/amd/picasso/memmap.c b/src/soc/amd/picasso/memmap.c deleted file mode 100644 index 970d1373dc..0000000000 --- a/src/soc/amd/picasso/memmap.c +++ /dev/null @@ -1,28 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -#include -#include -#include -#include -#include -#include -#include - -void bert_reserved_region(void **start, size_t *size) -{ - struct range_entry bert; - int status; - - *start = NULL; - *size = 0; - - status = fsp_find_range_hob(&bert, AMD_FSP_BERT_HOB_GUID.b); - - if (status < 0) { - printk(BIOS_ERR, "Error: unable to find BERT HOB\n"); - return; - } - - *start = (void *)(uintptr_t)range_entry_base(&bert); - *size = range_entry_size(&bert); -} -- cgit v1.2.3