summaryrefslogtreecommitdiff
path: root/src/soc/mediatek/mt8186/include
diff options
context:
space:
mode:
authorGuodong Liu <guodong.liu@mediatek.corp-partner.google.com>2021-10-18 14:36:50 +0800
committerHung-Te Lin <hungte@chromium.org>2021-11-15 03:07:36 +0000
commita10bc29dd25dd57f7532e7a1826be43fb024159a (patch)
treedab7439799f0dc9f48423ba05a03d60715adf72a /src/soc/mediatek/mt8186/include
parentb9f95db1dcf14b7f14a4d5ad7b4340e00093c684 (diff)
soc/mediatek/mt8186: Add AUXADC driver support
Add AUXADC controller driver code. TEST=build pass BUG=b:202871018 Signed-off-by: Guodong Liu <guodong.liu@mediatek.corp-partner.google.com> Change-Id: I9fb7fd4903d67a2804c31ff404bc0486983c742f Reviewed-on: https://review.coreboot.org/c/coreboot/+/59253 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Diffstat (limited to 'src/soc/mediatek/mt8186/include')
-rw-r--r--src/soc/mediatek/mt8186/include/soc/auxadc.h28
-rw-r--r--src/soc/mediatek/mt8186/include/soc/efuse.h17
2 files changed, 45 insertions, 0 deletions
diff --git a/src/soc/mediatek/mt8186/include/soc/auxadc.h b/src/soc/mediatek/mt8186/include/soc/auxadc.h
new file mode 100644
index 0000000000..13a52e3f9d
--- /dev/null
+++ b/src/soc/mediatek/mt8186/include/soc/auxadc.h
@@ -0,0 +1,28 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+/*
+ * This file is created based on MT8186 Functional Specification
+ * Chapter number: 5.9
+ */
+
+#ifndef SOC_MEDIATEK_MT8186_AUXADC_H
+#define SOC_MEDIATEK_MT8186_AUXADC_H
+
+#include <soc/auxadc_common.h>
+#include <soc/infracfg.h>
+#include <stdint.h>
+
+typedef struct mtk_auxadc_regs {
+ uint32_t con0;
+ uint32_t con1;
+ uint32_t con1_set;
+ uint32_t con1_clr;
+ uint32_t con2;
+ uint32_t data[16];
+ uint32_t reserved[16];
+ uint32_t misc;
+} mtk_auxadc_regs;
+
+static struct mt8186_infracfg_ao_regs *const mtk_infracfg = mt8186_infracfg_ao;
+
+#endif
diff --git a/src/soc/mediatek/mt8186/include/soc/efuse.h b/src/soc/mediatek/mt8186/include/soc/efuse.h
new file mode 100644
index 0000000000..fe3dfff9aa
--- /dev/null
+++ b/src/soc/mediatek/mt8186/include/soc/efuse.h
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef SOC_MEDIATEK_MT8186_EFUSE_H
+#define SOC_MEDIATEK_MT8186_EFUSE_H
+
+#include <soc/addressmap.h>
+#include <types.h>
+
+struct efuse_regs {
+ uint32_t reserved[130];
+ uint32_t adc_cali_reg;
+};
+
+check_member(efuse_regs, adc_cali_reg, 0x208);
+static struct efuse_regs *const mtk_efuse = (void *)EFUSEC_BASE;
+
+#endif