aboutsummaryrefslogtreecommitdiff
path: root/src/soc/mediatek/common
diff options
context:
space:
mode:
authorRex-BC Chen <rex-bc.chen@mediatek.corp-partner.google.com>2021-08-10 12:28:09 +0800
committerNick Vaccaro <nvaccaro@google.com>2021-08-12 17:59:00 +0000
commit716320b726a4fa6e7f42f2aec90de6f98ef52dd3 (patch)
treef4e543f8c03de46e69ccee6690f34909e663c16d /src/soc/mediatek/common
parent45727275476a495044e205ae8fb273feda3f8d5d (diff)
soc/mediatek/mt8192: move DFD driver to common folder
Move DFD driver to common folder so MT8195 can also use it. BUG=b:192429713 TEST=emerge-asurada coreboot Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com> Change-Id: I7937cddf5f3a66f9269a94301d3134e6f4f9f22e Reviewed-on: https://review.coreboot.org/c/coreboot/+/56908 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Diffstat (limited to 'src/soc/mediatek/common')
-rw-r--r--src/soc/mediatek/common/Kconfig6
-rw-r--r--src/soc/mediatek/common/dfd.c12
-rw-r--r--src/soc/mediatek/common/include/soc/dfd_common.h13
3 files changed, 31 insertions, 0 deletions
diff --git a/src/soc/mediatek/common/Kconfig b/src/soc/mediatek/common/Kconfig
index ab24617d86..754c0da580 100644
--- a/src/soc/mediatek/common/Kconfig
+++ b/src/soc/mediatek/common/Kconfig
@@ -40,4 +40,10 @@ config DPM_FOUR_CHANNEL
help
This option enables four channel configuration for DPM.
+config MTK_DFD
+ bool
+ default n
+ help
+ This option enables DFD (Design for Debug) settings.
+
endif
diff --git a/src/soc/mediatek/common/dfd.c b/src/soc/mediatek/common/dfd.c
new file mode 100644
index 0000000000..103151f377
--- /dev/null
+++ b/src/soc/mediatek/common/dfd.c
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <console/console.h>
+#include <device/mmio.h>
+#include <soc/dfd.h>
+
+void dfd_init(void)
+{
+ printk(BIOS_INFO, "%s: enable DFD (Design For Debug)\n", __func__);
+ setbits32(dfd_cfg, RESET_ON_KEEP_EN);
+ dsb();
+}
diff --git a/src/soc/mediatek/common/include/soc/dfd_common.h b/src/soc/mediatek/common/include/soc/dfd_common.h
new file mode 100644
index 0000000000..d716ed0823
--- /dev/null
+++ b/src/soc/mediatek/common/include/soc/dfd_common.h
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef SOC_MEDIATEK_DFD_COMMON_H
+#define SOC_MEDIATEK_DFD_COMMON_H
+
+#define CPC_FLOW_CTRL_CFG 0x0C53A814
+#define RESET_ON_KEEP_EN BIT(17)
+
+static u32 *const dfd_cfg = (void *)CPC_FLOW_CTRL_CFG;
+
+void dfd_init(void);
+
+#endif