summaryrefslogtreecommitdiff
path: root/src/soc/mediatek/mt8192/include
diff options
context:
space:
mode:
authorHsin-Hsiung Wang <hsin-hsiung.wang@mediatek.com>2020-07-10 16:50:53 +0800
committerHung-Te Lin <hungte@chromium.org>2020-11-18 06:12:50 +0000
commit9247d128390a70ab8ad5a2eba4ea73dc56a51375 (patch)
treeec5e51e2f8e6f63febca157846af7e80fa30b149 /src/soc/mediatek/mt8192/include
parented7bb850310ec579db0b53a9dda4ad411c68f998 (diff)
soc/mediatek/mt8192: add pmic MT6315 driver
MT6315 is a buck converter for Mediatek MT8192 platform. Reference datasheet: MT6315 datasheet v1.4.2.pdf, RH-D-2019-0616. BUG=b:155253454 BRANCH=none TEST=boot asurada correctly Signed-off-by: Hsin-Hsiung Wang <hsin-hsiung.wang@mediatek.com> Change-Id: I6b47473ee5d56a197bd21d4ab9b539d9663b6636 Reviewed-on: https://review.coreboot.org/c/coreboot/+/45400 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/mediatek/mt8192/include')
-rw-r--r--src/soc/mediatek/mt8192/include/soc/mt6315.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/soc/mediatek/mt8192/include/soc/mt6315.h b/src/soc/mediatek/mt8192/include/soc/mt6315.h
new file mode 100644
index 0000000000..4d179bed68
--- /dev/null
+++ b/src/soc/mediatek/mt8192/include/soc/mt6315.h
@@ -0,0 +1,40 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef __SOC_MEDIATEK_MT6315_H__
+#define __SOC_MEDIATEK_MT6315_H__
+
+#include <soc/spmi.h>
+#include <types.h>
+
+struct mt6315_setting {
+ unsigned short addr;
+ unsigned short val;
+ unsigned short mask;
+ unsigned char shift;
+};
+
+enum {
+ MT6315_CPU = SPMI_SLAVE_6,
+ MT6315_GPU = SPMI_SLAVE_7,
+ MT6315_MAX,
+};
+
+enum {
+ MT6315_BUCK_1 = 0,
+ MT6315_BUCK_2,
+ MT6315_BUCK_3,
+ MT6315_BUCK_4,
+ MT6315_BUCK_max,
+};
+
+enum {
+ MT6315_BUCK_TOP_ELR0 = 0x1449,
+ MT6315_BUCK_TOP_ELR3 = 0x144d,
+ MT6315_BUCK_VBUCK1_DBG0 = 0x1499,
+ MT6315_BUCK_VBUCK1_DBG3 = 0x1599,
+};
+
+void mt6315_init(void);
+void mt6315_buck_set_voltage(u32 slvid, u32 buck_id, u32 buck_uv);
+u32 mt6315_buck_get_voltage(u32 slvid, u32 buck_id);
+#endif /* __SOC_MEDIATEK_MT6315_H__ */