[coreboot-gerrit] Patch set updated for coreboot: google/oak: Add soc ARM Trusted Firmware support

Patrick Georgi (pgeorgi@google.com) gerrit at coreboot.org
Thu Jan 21 18:05:44 CET 2016


Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13101

-gerrit

commit b741d16bbd2b69e3111a3ff56ec8aa0c6bcd91ac
Author: Jimmy Huang <jimmy.huang at mediatek.com>
Date:   Fri Jul 31 17:11:00 2015 +0800

    google/oak: Add soc ARM Trusted Firmware support
    
    We define a mechanism to pass board specific parameters to BL31. The
    idea is BL31 doesn't need to have the board revision knowledge, it
    only needs to process the board specific parameters to initialize and
    control specific hardware. In this way, we can support different boards
    with same BL31 binary.
    
    BRANCH=none
    BUG=none
    TEST=booted on oak-rev2 and oak-rev3 boards, and confirmed they got
         different board arguments in ARM TF
    
    Change-Id: I0df2c6d7d1ffac7d443511c3317c142efeb5701e
    Signed-off-by: Patrick Georgi <pgeorgi at chromium.org>
    Original-Commit-Id: 0f9a4a2776110c5ddc113f0d605d4337d5773ace
    Original-Change-Id: I985d9555238f5ac5385e126479140b772b36bac8
    Original-Signed-off-by: Jimmy Huang <jimmy.huang at mediatek.com>
    Original-Reviewed-on: https://chromium-review.googlesource.com/292678
    Original-Commit-Ready: Yidi Lin <yidi.lin at mediatek.com>
    Original-Tested-by: Yidi Lin <yidi.lin at mediatek.com>
    Original-Reviewed-by: Julius Werner <jwerner at chromium.org>
---
 src/mainboard/google/oak/mainboard.c | 54 ++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/src/mainboard/google/oak/mainboard.c b/src/mainboard/google/oak/mainboard.c
index 52d6bd4..1545418 100644
--- a/src/mainboard/google/oak/mainboard.c
+++ b/src/mainboard/google/oak/mainboard.c
@@ -21,12 +21,65 @@
 #include <device/device.h>
 
 #include <gpio.h>
+#include <soc/bl31_plat_params.h>
 #include <soc/mt6391.h>
 #include <soc/mtcmos.h>
 #include <soc/pinmux.h>
 #include <soc/pll.h>
 #include <soc/usb.h>
 
+static void register_da9212_to_bl31(void)
+{
+#if IS_ENABLED(CONFIG_ARM64_USE_ARM_TRUSTED_FIRMWARE)
+	static struct bl31_da9212_param param_da9212 = {
+		.h = {
+			.type = PARAM_CLUSTER1_DA9212,
+		},
+		.i2c_bus = 1,
+		.ic_en = {
+			.type = PARAM_GPIO_SOC,
+			.polarity = PARAM_GPIO_ACTIVE_HIGH,
+			.index = PAD_UCTS2,
+		},
+		.en_a = {
+			.type = PARAM_GPIO_MT6391,
+			.polarity = PARAM_GPIO_ACTIVE_HIGH,
+			.index = MT6391_KP_ROW4,
+		},
+		.en_b = {
+			.type = PARAM_GPIO_NONE,
+		},
+	};
+	register_bl31_param(&param_da9212.h);
+#endif
+}
+
+static void register_mt6311_to_bl31(void)
+{
+#if IS_ENABLED(CONFIG_ARM64_USE_ARM_TRUSTED_FIRMWARE)
+	static struct bl31_mt6311_param param_mt6311 = {
+		.h = {
+			.type = PARAM_CLUSTER1_MT6311,
+		},
+		.i2c_bus = 1,
+	};
+	register_bl31_param(&param_mt6311.h);
+#endif
+}
+
+static void configure_bl31(void)
+{
+	switch (board_id()) {
+	case 2:
+		register_da9212_to_bl31();
+		break;
+	default:
+		/* rev-3 and rev-4 use mt6311 as external buck */
+		register_mt6311_to_bl31();
+		break;
+	}
+}
+
 static void configure_audio(void)
 {
 	mtcmos_audio_power_on();
@@ -116,6 +169,7 @@ static void mainboard_init(device_t dev)
 	configure_audio();
 	configure_backlight();
 	configure_usb();
+	configure_bl31();
 }
 
 static void mainboard_enable(device_t dev)



More information about the coreboot-gerrit mailing list