]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
power: pmic: mtk-pwrap: add MT8195 support
authorJulien Stephan <jstephan@baylibre.com>
Thu, 9 Apr 2026 20:30:40 +0000 (15:30 -0500)
committerDavid Lechner <dlechner@baylibre.com>
Wed, 29 Apr 2026 14:27:05 +0000 (09:27 -0500)
Add mt8195 support.

Support comes directly from commit e88edc977b00 ("soc: mediatek: pwrap:
add pwrap driver for MT8195 SoC") from the Linux Kernel.

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Link: https://patch.msgid.link/20260409-mtk-pmic-fixes-v2-8-73e83aa6345b@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
drivers/power/pmic/mtk-pwrap.c

index 9a249c796e727fef9a1eef024902388c02f9eb5d..473477855193d59f69f7f462277228ddff503362 100644 (file)
@@ -278,6 +278,23 @@ static int mt8189_regs[] = {
        [PWRAP_WACS2_RDATA] =           0x8A8,
 };
 
+static int mt8195_regs[] = {
+       [PWRAP_INIT_DONE2] =            0x0,
+       [PWRAP_STAUPD_CTRL] =           0x4C,
+       [PWRAP_TIMER_EN] =              0x3E4,
+       [PWRAP_INT_EN] =                0x420,
+       [PWRAP_INT_FLG] =               0x428,
+       [PWRAP_INT_CLR] =               0x42C,
+       [PWRAP_INT1_EN] =               0x450,
+       [PWRAP_INT1_FLG] =              0x458,
+       [PWRAP_INT1_CLR] =              0x45C,
+       [PWRAP_WACS2_CMD] =             0x880,
+       [PWRAP_SWINF_2_WDATA_31_0] =    0x884,
+       [PWRAP_SWINF_2_RDATA_31_0] =    0x894,
+       [PWRAP_WACS2_VLDCLR] =          0x8A4,
+       [PWRAP_WACS2_RDATA] =           0x8A8,
+};
+
 static int mt8365_regs[] = {
        [PWRAP_MUX_SEL] =               0x0,
        [PWRAP_WRAP_EN] =               0x4,
@@ -848,6 +865,14 @@ static struct pmic_wrapper_type pwrap_mt8189 = {
        .caps = PWRAP_CAP_ARB,
 };
 
+static const struct pmic_wrapper_type pwrap_mt8195 = {
+       .regs = mt8195_regs,
+       .arb_en_all = 0x777f, /* NEED CONFIRM */
+       .spi_w = PWRAP_MAN_CMD_SPI_WRITE,
+       .wdt_src = PWRAP_WDT_SRC_MASK_ALL,
+       .caps = PWRAP_CAP_ARB,
+};
+
 static const struct pmic_wrapper_type pwrap_mt8365 = {
        .regs = mt8365_regs,
        .arb_en_all = 0x3ffff,
@@ -859,6 +884,7 @@ static const struct pmic_wrapper_type pwrap_mt8365 = {
 static const struct udevice_id mtk_pwrap_ids[] = {
        { .compatible = "mediatek,mt8188-pwrap", .data = (ulong)&pwrap_mt8188 },
        { .compatible = "mediatek,mt8189-pwrap", .data = (ulong)&pwrap_mt8189 },
+       { .compatible = "mediatek,mt8195-pwrap", .data = (ulong)&pwrap_mt8195 },
        { .compatible = "mediatek,mt8365-pwrap", .data = (ulong)&pwrap_mt8365 },
        { }
 };