Tristan Hsieh has uploaded this change for review. ( https://review.coreboot.org/27026
Change subject: mediatek/mt8183: Using common watchdog timer code in mt8183
......................................................................
mediatek/mt8183: Using common watchdog timer code in mt8183
BUG=b:80501386
BRANCH=none
TEST=the refactored code works fine on the new platform (with the rest
of the patches applied) and Elm platform
Change-Id: I4be3a133dbb8a64604133cefb0c5f02d01afd0d4
Signed-off-by: Tristan Shieh <tristan.shieh(a)mediatek.com>
---
M src/soc/mediatek/mt8183/Makefile.inc
A src/soc/mediatek/mt8183/bootblock.c
M src/soc/mediatek/mt8183/include/soc/addressmap.h
3 files changed, 25 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/26/27026/1
diff --git a/src/soc/mediatek/mt8183/Makefile.inc b/src/soc/mediatek/mt8183/Makefile.inc
index 9f80500..59c6166 100644
--- a/src/soc/mediatek/mt8183/Makefile.inc
+++ b/src/soc/mediatek/mt8183/Makefile.inc
@@ -1,11 +1,13 @@
ifeq ($(CONFIG_SOC_MEDIATEK_MT8183),y)
+bootblock-y += bootblock.c
bootblock-$(CONFIG_SPI_FLASH) += flash_controller.c
bootblock-$(CONFIG_SPI_FLASH) += spi.c
bootblock-y += ../common/timer.c
ifeq ($(CONFIG_BOOTBLOCK_CONSOLE),y)
bootblock-$(CONFIG_DRIVERS_UART) += ../common/uart.c
endif
+bootblock-y += ../common/wdt.c
verstage-$(CONFIG_SPI_FLASH) += flash_controller.c
verstage-$(CONFIG_SPI_FLASH) += spi.c
diff --git a/src/soc/mediatek/mt8183/bootblock.c b/src/soc/mediatek/mt8183/bootblock.c
new file mode 100644
index 0000000..4eca0f1
--- /dev/null
+++ b/src/soc/mediatek/mt8183/bootblock.c
@@ -0,0 +1,22 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2018 MediaTek 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 <bootblock_common.h>
+#include <soc/wdt.h>
+
+void bootblock_soc_init(void)
+{
+ mtk_wdt_init();
+}
diff --git a/src/soc/mediatek/mt8183/include/soc/addressmap.h b/src/soc/mediatek/mt8183/include/soc/addressmap.h
index 59f4acf..bbb4094 100644
--- a/src/soc/mediatek/mt8183/include/soc/addressmap.h
+++ b/src/soc/mediatek/mt8183/include/soc/addressmap.h
@@ -22,6 +22,7 @@
};
enum {
+ RGU_BASE = IO_PHYS + 0x00007000,
GPT_BASE = IO_PHYS + 0x00008000,
UART0_BASE = IO_PHYS + 0x01002000,
};
--
To view, visit https://review.coreboot.org/27026
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4be3a133dbb8a64604133cefb0c5f02d01afd0d4
Gerrit-Change-Number: 27026
Gerrit-PatchSet: 1
Gerrit-Owner: Tristan Hsieh <tristan.shieh(a)mediatek.com>
Tristan Hsieh has uploaded this change for review. ( https://review.coreboot.org/27025
Change subject: mediatek: Move watchdog timer code to a common directory.
......................................................................
mediatek: Move watchdog timer code to a common directory.
This patch moves watchdog timer(WDT) code which can be reused into a
common directory under soc/mediatek.
BUG=b:80501386
BRANCH=none
TEST=the refactored code works fine on the new platform (with the rest
of the patches applied) and Elm platform
Change-Id: Icbeb04f775c3c0fdc18dd198df8591f5c4b6ddce
Signed-off-by: Tristan Shieh <tristan.shieh(a)mediatek.com>
---
R src/soc/mediatek/common/include/soc/wdt.h
R src/soc/mediatek/common/wdt.c
M src/soc/mediatek/mt8173/Makefile.inc
3 files changed, 5 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/25/27025/1
diff --git a/src/soc/mediatek/mt8173/include/soc/wdt.h b/src/soc/mediatek/common/include/soc/wdt.h
similarity index 97%
rename from src/soc/mediatek/mt8173/include/soc/wdt.h
rename to src/soc/mediatek/common/include/soc/wdt.h
index ddca102..a15434c 100644
--- a/src/soc/mediatek/mt8173/include/soc/wdt.h
+++ b/src/soc/mediatek/common/include/soc/wdt.h
@@ -1,7 +1,7 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2015 MediaTek Inc.
+ * Copyright 2018 MediaTek 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
diff --git a/src/soc/mediatek/mt8173/wdt.c b/src/soc/mediatek/common/wdt.c
similarity index 98%
rename from src/soc/mediatek/mt8173/wdt.c
rename to src/soc/mediatek/common/wdt.c
index bd2a614..c261753 100644
--- a/src/soc/mediatek/mt8173/wdt.c
+++ b/src/soc/mediatek/common/wdt.c
@@ -1,7 +1,7 @@
/*
* This file is part of the coreboot project.
*
- * Copyright 2015 MediaTek Inc.
+ * Copyright 2018 MediaTek 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
diff --git a/src/soc/mediatek/mt8173/Makefile.inc b/src/soc/mediatek/mt8173/Makefile.inc
index 3bb0ae0..b382455 100644
--- a/src/soc/mediatek/mt8173/Makefile.inc
+++ b/src/soc/mediatek/mt8173/Makefile.inc
@@ -28,7 +28,7 @@
endif
bootblock-y += gpio.c gpio_init.c pmic_wrap.c mt6391.c
-bootblock-y += wdt.c
+bootblock-y += ../common/wdt.c
bootblock-y += mmu_operations.c
################################################################################
@@ -40,7 +40,7 @@
verstage-y += ../common/timer.c
verstage-y += timer.c
-verstage-y += wdt.c
+verstage-y += ../common/wdt.c
verstage-$(CONFIG_SPI_FLASH) += flash_controller.c
verstage-y += gpio.c
@@ -74,7 +74,7 @@
ramstage-y += mt6311.c
ramstage-y += da9212.c
ramstage-y += gpio.c
-ramstage-y += wdt.c
+ramstage-y += ../common/wdt.c
ramstage-y += pll.c
ramstage-y += rtc.c
--
To view, visit https://review.coreboot.org/27025
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Icbeb04f775c3c0fdc18dd198df8591f5c4b6ddce
Gerrit-Change-Number: 27025
Gerrit-PatchSet: 1
Gerrit-Owner: Tristan Hsieh <tristan.shieh(a)mediatek.com>