aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2019-05-02 21:42:41 +0800
committerkenny liang <kenny.liang@mediatek.com>2019-09-10 11:25:43 +0800
commit0d8cb4937e7872c6fc49d26cc83bb72be907a073 (patch)
tree5dcd57320e8b4b1146e55b1b7c2c4ac44d172dbb
parent3d91c9c382cf392b7012a2849388426f7b5003e0 (diff)
downloadtrusted-firmware-a-0d8cb4937e7872c6fc49d26cc83bb72be907a073.tar.gz
mediatek: mt8183: Support coreboot configuration
When built for coreboot, we want to enable coreboot library to have better integration. For example, serial console should be initialized by coreboot_serial instead of hard-coded values. Most coreboot configuration will enable memory console, which needs larger XLAT_TABLES so MAX_XLAT_TABLES is increased; and to support that, TZRAM_SIZE also need to be enlarged. Change-Id: I08cf22df2fa26e48284e323d22ad8ce73a6ea803 Signed-off-by: Hung-Te Lin <hungte@chromium.org>
-rw-r--r--plat/mediatek/mt8183/bl31_plat_setup.c9
-rw-r--r--plat/mediatek/mt8183/include/platform_def.h4
-rw-r--r--plat/mediatek/mt8183/platform.mk2
3 files changed, 13 insertions, 2 deletions
diff --git a/plat/mediatek/mt8183/bl31_plat_setup.c b/plat/mediatek/mt8183/bl31_plat_setup.c
index ea39ff6f6..337470abb 100644
--- a/plat/mediatek/mt8183/bl31_plat_setup.c
+++ b/plat/mediatek/mt8183/bl31_plat_setup.c
@@ -14,6 +14,7 @@
#include <drivers/generic_delay_timer.h>
#include <mcucfg.h>
#include <mt_gic_v3.h>
+#include <lib/coreboot.h>
#include <lib/mmio.h>
#include <mtk_plat_common.h>
#include <mtspmc.h>
@@ -77,7 +78,15 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
params_early_setup(arg1);
+#if COREBOOT
+ if (coreboot_serial.type)
+ console_16550_register(coreboot_serial.baseaddr,
+ coreboot_serial.input_hertz,
+ coreboot_serial.baud,
+ &console);
+#else
console_16550_register(UART0_BASE, UART_CLOCK, UART_BAUDRATE, &console);
+#endif
NOTICE("MT8183 bl31_setup\n");
diff --git a/plat/mediatek/mt8183/include/platform_def.h b/plat/mediatek/mt8183/include/platform_def.h
index bc9022bb4..f802ac2f5 100644
--- a/plat/mediatek/mt8183/include/platform_def.h
+++ b/plat/mediatek/mt8183/include/platform_def.h
@@ -273,7 +273,7 @@ INTR_PROP_DESC(MT_IRQ_SEC_SGI_7, GIC_HIGHEST_SEC_PRIORITY, grp, \
******************************************************************************/
#define TZRAM_BASE 0x54600000
-#define TZRAM_SIZE 0x00020000
+#define TZRAM_SIZE 0x00030000
/*******************************************************************************
* BL31 specific defines.
@@ -291,7 +291,7 @@ INTR_PROP_DESC(MT_IRQ_SEC_SGI_7, GIC_HIGHEST_SEC_PRIORITY, grp, \
******************************************************************************/
#define PLAT_PHY_ADDR_SPACE_SIZE (1ULL << 32)
#define PLAT_VIRT_ADDR_SPACE_SIZE (1ULL << 32)
-#define MAX_XLAT_TABLES 4
+#define MAX_XLAT_TABLES 16
#define MAX_MMAP_REGIONS 16
/*******************************************************************************
diff --git a/plat/mediatek/mt8183/platform.mk b/plat/mediatek/mt8183/platform.mk
index 8fb015105..09fd13319 100644
--- a/plat/mediatek/mt8183/platform.mk
+++ b/plat/mediatek/mt8183/platform.mk
@@ -70,3 +70,5 @@ MULTI_CONSOLE_API := 1
MACH_MT8183 := 1
$(eval $(call add_define,MACH_MT8183))
+include lib/coreboot/coreboot.mk
+