summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mainboard/google/kukui/bootblock.c3
-rw-r--r--src/soc/mediatek/mt8183/Makefile.inc2
-rw-r--r--src/soc/mediatek/mt8183/bootblock.c2
-rw-r--r--src/soc/mediatek/mt8183/include/soc/mt8183.h23
-rw-r--r--src/soc/mediatek/mt8183/mt8183.c22
5 files changed, 50 insertions, 2 deletions
diff --git a/src/mainboard/google/kukui/bootblock.c b/src/mainboard/google/kukui/bootblock.c
index 07285882d7..ab537d401a 100644
--- a/src/mainboard/google/kukui/bootblock.c
+++ b/src/mainboard/google/kukui/bootblock.c
@@ -16,6 +16,7 @@
#include <bootblock_common.h>
#include <gpio.h>
#include <soc/gpio.h>
+#include <soc/mt8183.h>
#include <soc/spi.h>
#include "gpio.h"
@@ -25,6 +26,8 @@
void bootblock_mainboard_init(void)
{
+ mt8183_early_init();
+
setup_chromeos_gpios();
/* Turn on real eMMC. */
diff --git a/src/soc/mediatek/mt8183/Makefile.inc b/src/soc/mediatek/mt8183/Makefile.inc
index 9aa1733f38..f24fdccb0b 100644
--- a/src/soc/mediatek/mt8183/Makefile.inc
+++ b/src/soc/mediatek/mt8183/Makefile.inc
@@ -5,6 +5,7 @@ bootblock-y += bootblock.c
bootblock-y += ../common/gpio.c gpio.c
bootblock-y += ../common/pll.c pll.c
bootblock-$(CONFIG_SPI_FLASH) += ../common/spi.c spi.c
+bootblock-y += mt8183.c
bootblock-y += ../common/timer.c
bootblock-y += ../common/uart.c
bootblock-y += ../common/wdt.c
@@ -16,6 +17,7 @@ decompressor-y += ../common/timer.c
verstage-y += auxadc.c
verstage-y += ../common/gpio.c gpio.c
verstage-$(CONFIG_SPI_FLASH) += ../common/spi.c spi.c
+verstage-y += mt8183.c
verstage-y += ../common/timer.c
verstage-y += ../common/uart.c
verstage-y += ../common/wdt.c
diff --git a/src/soc/mediatek/mt8183/bootblock.c b/src/soc/mediatek/mt8183/bootblock.c
index d7d5c2dda4..e4c331e524 100644
--- a/src/soc/mediatek/mt8183/bootblock.c
+++ b/src/soc/mediatek/mt8183/bootblock.c
@@ -15,10 +15,8 @@
#include <bootblock_common.h>
#include <soc/pll.h>
-#include <soc/wdt.h>
void bootblock_soc_init(void)
{
mt_pll_init();
- mtk_wdt_init();
}
diff --git a/src/soc/mediatek/mt8183/include/soc/mt8183.h b/src/soc/mediatek/mt8183/include/soc/mt8183.h
new file mode 100644
index 0000000000..5591ffd5cc
--- /dev/null
+++ b/src/soc/mediatek/mt8183/include/soc/mt8183.h
@@ -0,0 +1,23 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2019 Google Inc.
+ *
+ * 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.
+ */
+
+#ifndef __SOC_MEDIATEK_MT8183_H__
+#define __SOC_MEDIATEK_MT8183_H__
+
+/* Mainboards should manually call this function in early stages (bootblock or
+ * verstage). */
+void mt8183_early_init(void);
+
+#endif /* __SOC_MEDIATEK_MT8183_H__ */
diff --git a/src/soc/mediatek/mt8183/mt8183.c b/src/soc/mediatek/mt8183/mt8183.c
new file mode 100644
index 0000000000..c4419803da
--- /dev/null
+++ b/src/soc/mediatek/mt8183/mt8183.c
@@ -0,0 +1,22 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2019 Google Inc.
+ *
+ * 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.
+ */
+
+#include <soc/mt8183.h>
+#include <soc/wdt.h>
+
+void mt8183_early_init(void)
+{
+ mtk_wdt_init();
+}