mediatek: mt8183: Support coreboot configuration
authorHung-Te Lin <hungte@chromium.org>
Thu, 2 May 2019 13:42:41 +0000 (21:42 +0800)
committerkenny liang <kenny.liang@mediatek.com>
Tue, 10 Sep 2019 03:25:43 +0000 (11:25 +0800)
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>
plat/mediatek/mt8183/bl31_plat_setup.c
plat/mediatek/mt8183/include/platform_def.h
plat/mediatek/mt8183/platform.mk

index ea39ff6f63a8228ee36921487787a4d42c017e45..337470abbd00ac82f55065311f4fcd76944613df 100644 (file)
@@ -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");
 
index bc9022bb433bb914fa280954275380c706c0614b..f802ac2f50364b1f58ce9cf17030286476bd9ec0 100644 (file)
@@ -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
 
 /*******************************************************************************
index 8fb015105163565a94aa55f148c30983c44c71e3..09fd13319e07bf6bcc80165bd3275ec702872fc1 100644 (file)
@@ -70,3 +70,5 @@ MULTI_CONSOLE_API := 1
 MACH_MT8183 := 1
 $(eval $(call add_define,MACH_MT8183))
 
+include lib/coreboot/coreboot.mk
+