summaryrefslogtreecommitdiff
path: root/src/soc/mediatek/mt8183/include
diff options
context:
space:
mode:
authorPo Xu <jg_poxu@mediatek.com>2018-09-16 13:27:44 +0800
committerJulius Werner <jwerner@chromium.org>2018-11-02 19:57:47 +0000
commit96631f941dc3e958585cc4798d3c7c74c032c7bd (patch)
treed80e4b4daa2319578e70916fcfc06442568ac56c /src/soc/mediatek/mt8183/include
parent7a70b664c4ba123dfa51a73fca87f67c168bffd3 (diff)
downloadcoreboot-96631f941dc3e958585cc4798d3c7c74c032c7bd.tar.xz
mediatek/mt8183: Add AUXADC driver
We plan to get board id and RAM code from AUXADC on Kukui. Add AUXADC driver to support it. BUG=b:80501386 BRANCH=none TEST=Boots correctly on Kukui Change-Id: I121a6a0240f9c517c0cbc07e0c18b09167849ff1 Signed-off-by: Po Xu <jg_poxu@mediatek.com> Reviewed-on: https://review.coreboot.org/29061 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src/soc/mediatek/mt8183/include')
-rw-r--r--src/soc/mediatek/mt8183/include/soc/addressmap.h1
-rw-r--r--src/soc/mediatek/mt8183/include/soc/auxadc.h34
2 files changed, 35 insertions, 0 deletions
diff --git a/src/soc/mediatek/mt8183/include/soc/addressmap.h b/src/soc/mediatek/mt8183/include/soc/addressmap.h
index 1ba9cc88ee..cee9bd8160 100644
--- a/src/soc/mediatek/mt8183/include/soc/addressmap.h
+++ b/src/soc/mediatek/mt8183/include/soc/addressmap.h
@@ -32,6 +32,7 @@ enum {
EMI_BASE = IO_PHYS + 0x00219000,
EMI_MPU_BASE = IO_PHYS + 0x00226000,
DRAMC_CH_BASE = IO_PHYS + 0x00228000,
+ AUXADC_BASE = IO_PHYS + 0x01001000,
UART0_BASE = IO_PHYS + 0x01002000,
SPI0_BASE = IO_PHYS + 0x0100A000,
SPI1_BASE = IO_PHYS + 0x01010000,
diff --git a/src/soc/mediatek/mt8183/include/soc/auxadc.h b/src/soc/mediatek/mt8183/include/soc/auxadc.h
new file mode 100644
index 0000000000..aafc8a1df4
--- /dev/null
+++ b/src/soc/mediatek/mt8183/include/soc/auxadc.h
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+
+#ifndef _MTK_ADC_H
+#define _MTK_ADC_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;
+
+/* Return voltage in uVolt */
+int auxadc_get_voltage(unsigned int channel);
+#endif