From 65bf77df71ce2bc80541070f542b41867f3c886a Mon Sep 17 00:00:00 2001 From: Marcelo Povoa Date: Fri, 14 Feb 2014 15:29:47 -0800 Subject: [PATCH] aarch64/foundation-armv8: Enable DYNAMIC_CBMEM Some 64-bit pointer casts errors related to DYNAMIC_CBMEM were fixed in a separate patch. BUG=None BRANCH=none TEST=Ran image in foundation model Change-Id: Ia4cce9bef152e9acd9c897de895b7c293f7d2188 Signed-off-by: Marcelo Povoa Reviewed-on: https://chromium-review.googlesource.com/186742 Reviewed-by: David Hendricks --- src/arch/aarch64/Makefile.inc | 2 ++ src/arch/aarch64/cbmem.c | 30 +++++++++++++++++++ .../emulation/foundation-armv8/Kconfig | 1 + 3 files changed, 33 insertions(+) create mode 100644 src/arch/aarch64/cbmem.c diff --git a/src/arch/aarch64/Makefile.inc b/src/arch/aarch64/Makefile.inc index 6ba30dafc3..a945c692ad 100644 --- a/src/arch/aarch64/Makefile.inc +++ b/src/arch/aarch64/Makefile.inc @@ -153,6 +153,7 @@ romstage-y += cpu.S romstage-y += exception.c romstage-y += exception_asm.S romstage-$(CONFIG_EARLY_CONSOLE) += early_console.c +romstage-y += cbmem.c bootblock-y += stages.c romstage-y += stages.c @@ -170,6 +171,7 @@ ramstage-y += cpu.S ramstage-y += boot.c ramstage-y += tables.c +ramstage-y += cbmem.c #romstage-y += memset.S #ramstage-y += memset.S diff --git a/src/arch/aarch64/cbmem.c b/src/arch/aarch64/cbmem.c new file mode 100644 index 0000000000..b33e9b8cd8 --- /dev/null +++ b/src/arch/aarch64/cbmem.c @@ -0,0 +1,30 @@ +/* + * This file is part of the coreboot project. + * + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include + +unsigned long get_top_of_ram(void); + +unsigned long get_top_of_ram(void) +{ + return CONFIG_RAMTOP; +} + +void *cbmem_top(void) +{ + return (void *)get_top_of_ram(); +} diff --git a/src/mainboard/emulation/foundation-armv8/Kconfig b/src/mainboard/emulation/foundation-armv8/Kconfig index 1046378e9f..45439a5e7b 100644 --- a/src/mainboard/emulation/foundation-armv8/Kconfig +++ b/src/mainboard/emulation/foundation-armv8/Kconfig @@ -25,6 +25,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy select HAVE_UART_MEMORY_MAPPED select HAVE_UART_SPECIAL select BOARD_ROMSIZE_KB_4096 + select DYNAMIC_CBMEM config MAINBOARD_DIR string