summaryrefslogtreecommitdiffstats
path: root/src/soc/mediatek/mt8195/include/soc
diff options
context:
space:
mode:
authorhenryc.chen <henryc.chen@mediatek.com>2021-03-04 09:44:42 +0800
committerHung-Te Lin <hungte@chromium.org>2021-06-18 08:47:06 +0000
commit21e4bd4e8cedcf11d2bf82fb727b0863c19aa310 (patch)
treeada0f1e487a4ee6456eacb95b2599230cc1a25ee /src/soc/mediatek/mt8195/include/soc
parentf2c259cf2a16714bd2695507b9241080de660e05 (diff)
downloadcoreboot-21e4bd4e8cedcf11d2bf82fb727b0863c19aa310.tar.gz
coreboot-21e4bd4e8cedcf11d2bf82fb727b0863c19aa310.tar.bz2
coreboot-21e4bd4e8cedcf11d2bf82fb727b0863c19aa310.zip
soc/mediatek/mt8195: add mt6691 driver
Add mt6691 buck control for DRAM to run fast calibration test. It is needed to get and set voltage during testing. Signed-off-by: Henry Chen <henryc.chen@mediatek.com> Change-Id: I4fb9f7245d44383a6a3a0cf8d00f7f503cbdeb06 Reviewed-on: https://review.coreboot.org/c/coreboot/+/55575 Reviewed-by: Yu-Ping Wu <yupingso@google.com> Reviewed-by: Hung-Te Lin <hungte@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/mediatek/mt8195/include/soc')
-rw-r--r--src/soc/mediatek/mt8195/include/soc/mt6691.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/soc/mediatek/mt8195/include/soc/mt6691.h b/src/soc/mediatek/mt8195/include/soc/mt6691.h
new file mode 100644
index 000000000000..c347c41d93cd
--- /dev/null
+++ b/src/soc/mediatek/mt8195/include/soc/mt6691.h
@@ -0,0 +1,37 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef __SOC_MEDIATEK_MT8195_MT6691_H__
+#define __SOC_MEDIATEK_MT8195_MT6691_H__
+
+#include <stdint.h>
+
+void mt6691_probe(uint8_t i2c_num);
+int mt6691_set_voltage(uint8_t i2c_num, unsigned int volt_uv);
+int mt6691_get_voltage(uint8_t i2c_num);
+
+#define MT6691_CID_CODE 0x01
+
+#define MT6691_VDD2_ID 0x0000
+#define MT6691_VDDQ_ID 0x0000
+#define MT6691_PGOOD_SHIFT 7
+#define MT6691_DN_SR_MASK 0x7
+#define MT6691_DN_SR_SHIFT 5
+
+enum {
+ /* Voltage setting */
+ MT6691_VSEL0 = 0x00,
+ MT6691_VSEL1 = 0x01,
+ /* Control register */
+ MT6691_CONTROL = 0x02,
+ /* IC Type */
+ MT6691_ID1 = 0x03,
+ /* IC mask version */
+ MT6691_ID2 = 0x04,
+ /* Monitor register */
+ MT6691_MONITOR = 0x05,
+ MT6691_CTRL2 = 0x06,
+ MT6691_CTRL3 = 0x07,
+ MT6691_CTRL4 = 0x08,
+};
+
+#endif