diff options
author | Hui Liu <hui.liu@mediatek.corp-partner.google.com> | 2022-07-25 14:51:36 +0800 |
---|---|---|
committer | Paul Fagerburg <pfagerburg@chromium.org> | 2022-07-29 15:04:10 +0000 |
commit | feb573e395ea6e82088fe15b4c34afb974a15249 (patch) | |
tree | 1bac4a174b5e0f4c0d8fb9e895822c10052e1f41 /src/soc/mediatek | |
parent | a8c9674c420f164024cc3e2f7b310ca336d2b5e0 (diff) |
soc/mediatek/mt8188: Add AUXADC support
TEST=get voltage as 340mV for channel 0 in MTK EVB.
BUG=b:233720142
Signed-off-by: Hui Liu <hui.liu@mediatek.corp-partner.google.com>
Change-Id: Idd1edcce6cb62fcf6991bb9342c409150989c5ca
Reviewed-on: https://review.coreboot.org/c/coreboot/+/66121
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Diffstat (limited to 'src/soc/mediatek')
-rw-r--r-- | src/soc/mediatek/mt8188/Makefile.inc | 1 | ||||
-rw-r--r-- | src/soc/mediatek/mt8188/include/soc/auxadc.h | 17 | ||||
-rw-r--r-- | src/soc/mediatek/mt8188/include/soc/efuse.h | 17 |
3 files changed, 35 insertions, 0 deletions
diff --git a/src/soc/mediatek/mt8188/Makefile.inc b/src/soc/mediatek/mt8188/Makefile.inc index 0d3dfb07d2..8db9c789a4 100644 --- a/src/soc/mediatek/mt8188/Makefile.inc +++ b/src/soc/mediatek/mt8188/Makefile.inc @@ -21,6 +21,7 @@ romstage-y += ../common/pmif.c ../common/pmif_clk.c pmif_clk.c romstage-y += ../common/pmif_spi.c pmif_spi.c romstage-y += ../common/pmif_spmi.c pmif_spmi.c +ramstage-y += ../common/auxadc.c ramstage-y += emi.c ramstage-y += ../common/mcu.c ramstage-y += ../common/mcupm.c diff --git a/src/soc/mediatek/mt8188/include/soc/auxadc.h b/src/soc/mediatek/mt8188/include/soc/auxadc.h new file mode 100644 index 0000000000..b8f0234b95 --- /dev/null +++ b/src/soc/mediatek/mt8188/include/soc/auxadc.h @@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +/* + * This file is created based on MT8188 Functional Specification + * Chapter number: 5.10 + */ + +#ifndef SOC_MEDIATEK_MT8188_AUXADC_H +#define SOC_MEDIATEK_MT8188_AUXADC_H + +#include <soc/auxadc_common.h> +#include <soc/infracfg.h> +#include <stdint.h> + +static struct mt8188_infracfg_ao_regs *const mtk_infracfg = mt8188_infracfg_ao; + +#endif diff --git a/src/soc/mediatek/mt8188/include/soc/efuse.h b/src/soc/mediatek/mt8188/include/soc/efuse.h new file mode 100644 index 0000000000..3b693f7fe2 --- /dev/null +++ b/src/soc/mediatek/mt8188/include/soc/efuse.h @@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef SOC_MEDIATEK_MT8188_EFUSE_H +#define SOC_MEDIATEK_MT8188_EFUSE_H + +#include <soc/addressmap.h> +#include <types.h> + +struct efuse_regs { + uint32_t reserved[107]; + uint32_t adc_cali_reg; +}; + +check_member(efuse_regs, adc_cali_reg, 0x1AC); +static struct efuse_regs *const mtk_efuse = (void *)EFUSE_BASE; + +#endif |