Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33426
Change subject: soc/ucb/riscv: Protect CBFS from payload loader ......................................................................
soc/ucb/riscv: Protect CBFS from payload loader
The payload loader doesn't know about CBFS in DRAM. Mark the region as RAMSTAGE to make sure the payload won't overwrite the CBFS while decompressing.
Change-Id: I36a18cb727f660ac9e77df413026627ea160c1e1 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/soc/ucb/riscv/Makefile.inc A src/soc/ucb/riscv/tables.c 2 files changed, 24 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/26/33426/1
diff --git a/src/soc/ucb/riscv/Makefile.inc b/src/soc/ucb/riscv/Makefile.inc index ef03642..ba2a246 100644 --- a/src/soc/ucb/riscv/Makefile.inc +++ b/src/soc/ucb/riscv/Makefile.inc @@ -7,5 +7,6 @@
ramstage-y += cbmem.c ramstage-y += ipi.c +ramstage-y += tables.c
endif diff --git a/src/soc/ucb/riscv/tables.c b/src/soc/ucb/riscv/tables.c new file mode 100644 index 0000000..749cb0c --- /dev/null +++ b/src/soc/ucb/riscv/tables.c @@ -0,0 +1,23 @@ +/* + * This file is part of the coreboot project. + * + * Copyright (C) 2019 9elements Agency GmbH patrick.rudolph@9elements.com + * + * 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. + */ + +#include <bootmem.h> + +void bootmem_platform_add_ranges(void) +{ + // Protect CBFS in DRAM + bootmem_add_range((uintptr_t)0x80000000, + CONFIG_COREBOOT_ROMSIZE_KB * 1024, BM_MEM_RAMSTAGE); +}