From dd923601fdf9f0abf1ec801fa5b6c34ffd1ef3e3 Mon Sep 17 00:00:00 2001 From: Fu Wei Date: Mon, 31 Jul 2017 18:28:32 +0800 Subject: [PATCH] qemu: use translation tables library v2 as default. Almost all the arm platform has switch to translation tables library v2 as default. Because qemu platform doesn't use arm_common.mk like other arm platforms, QEMU haven't switched to v2 yet. This patch adds all the necessary code for adding translation tables library v2 support on QEMU and use it as default. Fixes ARM-software/tf-issues#508 Signed-off-by: Fu Wei --- plat/qemu/platform.mk | 16 ++++++++++++++-- plat/qemu/qemu_common.c | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/plat/qemu/platform.mk b/plat/qemu/platform.mk index cf4f9ca7..e6d7014f 100644 --- a/plat/qemu/platform.mk +++ b/plat/qemu/platform.mk @@ -11,11 +11,23 @@ PLAT_INCLUDES := -Iinclude/plat/arm/common/ \ -Iplat/qemu/include \ -Iinclude/common/tbbr +# Use translation tables library v2 by default +ARM_XLAT_TABLES_LIB_V1 := 0 +$(eval $(call assert_boolean,ARM_XLAT_TABLES_LIB_V1)) +$(eval $(call add_define,ARM_XLAT_TABLES_LIB_V1)) + PLAT_BL_COMMON_SOURCES := plat/qemu/qemu_common.c \ - drivers/arm/pl011/aarch64/pl011_console.S \ - lib/xlat_tables/xlat_tables_common.c \ + drivers/arm/pl011/aarch64/pl011_console.S + +ifeq (${ARM_XLAT_TABLES_LIB_V1}, 1) +PLAT_BL_COMMON_SOURCES += lib/xlat_tables/xlat_tables_common.c \ lib/xlat_tables/aarch64/xlat_tables.c +else +include lib/xlat_tables_v2/xlat_tables.mk + +PLAT_BL_COMMON_SOURCES += ${XLAT_TABLES_LIB_SRCS} +endif BL1_SOURCES += drivers/io/io_semihosting.c \ drivers/io/io_storage.c \ diff --git a/plat/qemu/qemu_common.c b/plat/qemu/qemu_common.c index daa9fc14..e34b16fe 100644 --- a/plat/qemu/qemu_common.c +++ b/plat/qemu/qemu_common.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include "qemu_private.h" #define MAP_DEVICE0 MAP_REGION_FLAT(DEVICE0_BASE, \ -- 2.30.2