From patchwork Fri Jan 12 09:46:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 187636 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2614:b0:101:6a76:bbe3 with SMTP id mm20csp64736dyc; Fri, 12 Jan 2024 01:48:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IHgtmWbNemWv7n6It7yGcYBH/jiihL06aZby9xlc4tW+WKke2NqfC5NxKYOYoXQp3KxRMKE X-Received: by 2002:ad4:5c6d:0:b0:680:b44c:140d with SMTP id i13-20020ad45c6d000000b00680b44c140dmr609661qvh.91.1705052918246; Fri, 12 Jan 2024 01:48:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705052918; cv=none; d=google.com; s=arc-20160816; b=Dg6SVS/B9L3HPWG20/hPnxYZiOoxNhzUjD8vOCGtaHDMKPm/aIdT9LutLf0xiBLCjU cBVGh7cV2wmJJ1c65IpHXeOAxo39VNjMepx8pnCpDI99cHb5N92TumZ9mOr4Z2Azg+rR lxFUIlFVExNpmuiaCsl4GwPYjjIJGwVgiYMs/utzd8EXCmF1De3X0VxNe1/BCRuZEKhY EKg0gRI1AnR3bPgskjIIgkX7Uez+MFwh0n/A4ZHYNe6LhyLE3sfI2/W7NQ2a9oP1Gu8F SjrUsTIltylIdt/gspVLu/ZRE30XCGuc9DyuzciY/7jj+q9s948j24vu/ZjLwmBsWS+/ zxug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=B+sHRA/CQ30vrfTV1PsgecbYDFUDnAzvfSGuMILpWE0=; fh=jVP86127nqY6lQ2iFwv7XBo+ATUxJSI3LRZ9chA5Pqo=; b=vH+j0njnTFZ7OdAEsEFHfwslVLClimtdJW1u8qqI0soByo/qWWmlWgMmjz33t/aIeY LWqlKOQoSUJWbVXsyEy++D+JOUxB9ep7Z3jmJSNxx9drlYOmfFoxiXB4aonpvdBHs+w6 od6j3XWR/Jn+sexYtZ+8UJJgP8x32yJYOHPItalKpEGC2I/uo4Fik3TM1RVOjar0MRDe q60s60TvFxL0+ERO0edxGupJILOTlg/cDA3BK1iYOWcuqIW32Zx/MeY5MyUostnbnNvR OiNvPEV5a+l7La6WQwrSJcRHbJMCg9QN5jLaoDyKa/hmrlbeW+F1nXtvnpdi1QTKZ8LG WNEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=fzQERIlO; spf=pass (google.com: domain of linux-kernel+bounces-24504-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24504-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id n3-20020a0c8c03000000b0067f0d1677e7si2432173qvb.517.2024.01.12.01.48.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 01:48:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-24504-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=fzQERIlO; spf=pass (google.com: domain of linux-kernel+bounces-24504-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24504-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 0027D1C253F8 for ; Fri, 12 Jan 2024 09:48:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 214F25EE9D; Fri, 12 Jan 2024 09:46:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="fzQERIlO" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 558425D910; Fri, 12 Jan 2024 09:46:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1705052803; bh=vVV7secnJj63oz5uInWOkRetftEKYjRoVqiH5bnBvmg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fzQERIlOBwgJa7CAAHFtx6d0Ks7iziy2V44abe4pc5HlNc01vAA8EKk1AJQRIUyJz ZXA4IOrZxwFvxH8Uy154FDyA+ujQRc0Ez6RvbDI7LvMHRALHo9fpiTColgBDmFRFZz wY4yONFYvn9huTwS2RPQYq2y/gCyoV8Oad85xE80V57dqwiDZQg4VpEmAV70jjWGTf 6sGGRnvnOCKgZFZP3QO7FcbL3rhILa6ubNnwNyQlQhijcLye5R6jq+KXWX83EDbpzM fGlBWkXv2h+10cVsh2ZvuJo9u/jkmEiWGgEfWNcr19KyDuTAibTMbQuqM7UqbaTuuE hCXZr4AwbJpYQ== Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id C519E3782021; Fri, 12 Jan 2024 09:46:42 +0000 (UTC) From: AngeloGioacchino Del Regno To: linux-mediatek@lists.infradead.org Cc: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com, wenst@chromium.org, hsinyi@chromium.org, nfraprado@collabora.com, macpaul.lin@mediatek.com, sean.wang@mediatek.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@collabora.com Subject: [PATCH 05/15] arm64: dts: mediatek: radxa-nio-12l: Configure board regulators Date: Fri, 12 Jan 2024 10:46:22 +0100 Message-ID: <20240112094632.66310-6-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240112094632.66310-1-angelogioacchino.delregno@collabora.com> References: <20240112094632.66310-1-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787877568690657643 X-GMAIL-MSGID: 1787877568690657643 Add the entire power tree, which also includes all of the voltage regulators found on all of the PMICs and fixed vregs on this board. While at it, also add the two MT6315 PMICs over SPMI, providing CPU-Big and GPU power rails. Signed-off-by: AngeloGioacchino Del Regno --- .../dts/mediatek/mt8395-radxa-nio-12l.dts | 228 ++++++++++++++++++ 1 file changed, 228 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts b/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts index 281847b8f022..0daf27410311 100644 --- a/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts +++ b/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts @@ -8,8 +8,12 @@ */ #include "mt8195.dtsi" +#include "mt6359.dtsi" +#include #include #include +#include +#include / { model = "Radxa NIO 12L"; @@ -36,6 +40,48 @@ memory@40000000 { reg = <0 0x40000000 0x1 0x0>; }; + wifi_vreg: regulator-wifi-3v3-en { + compatible = "regulator-fixed"; + regulator-name = "wifi_3v3_en"; + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + enable-active-high; + gpio = <&pio 67 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&wifi_vreg_pins>; + vin-supply = <&vsys>; + }; + + /* system wide switching 5.0V power rail */ + vsys: regulator-vsys { + compatible = "regulator-fixed"; + regulator-name = "vsys"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <&vcc5v0_vsys>; + }; + + vsys_buck: regulator-vsys-buck { + compatible = "regulator-fixed"; + regulator-name = "vsys_buck"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <&vcc5v0_vsys>; + }; + + /* Rail from power-only "TYPE C DC" port */ + vcc5v0_vsys: regulator-vcc5v0-sys { + compatible = "regulator-fixed"; + regulator-name = "vcc5v0_sys"; + regulator-always-on; + regulator-boot-on; + }; + reserved-memory { #address-cells = <2>; #size-cells = <2>; @@ -118,9 +164,138 @@ mt6360: pmic@34 { interrupt-controller; #interrupt-cells = <1>; pinctrl-0 = <&mt6360_pins>; + + regulator { + compatible = "mediatek,mt6360-regulator"; + LDO_VIN1-supply = <&vsys_buck>; + LDO_VIN3-supply = <&mt6360_buck2>; + + mt6360_buck1: buck1 { + regulator-name = "emi_vdd2"; + regulator-min-microvolt = <300000>; + regulator-max-microvolt = <1300000>; + regulator-allowed-modes = ; + regulator-always-on; + }; + + mt6360_buck2: buck2 { + regulator-name = "emi_vddq"; + regulator-min-microvolt = <300000>; + regulator-max-microvolt = <1300000>; + regulator-allowed-modes = ; + regulator-always-on; + }; + + mt6360_ldo1: ldo1 { + regulator-name = "ext_lcd_3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-allowed-modes = ; + regulator-always-on; + }; + + mt6360_ldo2: ldo2 { + regulator-name = "panel1_p1v8"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-allowed-modes = ; + }; + + mt6360_ldo3: ldo3 { + regulator-name = "vmc_pmu"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <3600000>; + regulator-allowed-modes = ; + }; + + mt6360_ldo5: ldo5 { + regulator-name = "vmch_pmu"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-allowed-modes = ; + regulator-always-on; + }; + + mt6360_ldo6: ldo6 { + regulator-name = "mt6360_ldo6"; /* Test point */ + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <2100000>; + regulator-allowed-modes = ; + }; + + mt6360_ldo7: ldo7 { + regulator-name = "emi_vmddr_en"; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <2100000>; + regulator-allowed-modes = ; + regulator-always-on; + }; + }; }; }; +&mt6359_vaud18_ldo_reg { + regulator-always-on; +}; + +&mt6359_vbbck_ldo_reg { + regulator-always-on; +}; + +/* For USB Hub */ +&mt6359_vcamio_ldo_reg { + regulator-always-on; +}; + +&mt6359_vcn33_2_bt_ldo_reg { + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; +}; + +&mt6359_vcore_buck_reg { + regulator-always-on; +}; + +&mt6359_vgpu11_buck_reg { + regulator-always-on; +}; + +&mt6359_vproc1_buck_reg { + regulator-always-on; +}; + +&mt6359_vproc2_buck_reg { + regulator-always-on; +}; + +&mt6359_vpu_buck_reg { + regulator-always-on; +}; + +&mt6359_vrf12_ldo_reg { + regulator-always-on; +}; + +&mt6359_vsram_md_ldo_reg { + regulator-always-on; +}; + +/* for GPU SRAM */ +&mt6359_vsram_others_ldo_reg { + regulator-min-microvolt = <750000>; + regulator-max-microvolt = <750000>; +}; + &pio { i2c2_pins: i2c2-pins { pins-bus { @@ -164,6 +339,59 @@ pins-bus { ; }; }; + + wifi_vreg_pins: wifi-vreg-pins { + pins-wifi-pmu-en { + pinmux = ; + output-high; + }; + + pins-wifi-vreg-en { + pinmux = ; + }; + }; +}; + +&pmic { + interrupts-extended = <&pio 222 IRQ_TYPE_LEVEL_HIGH>; +}; + +&spmi { + #address-cells = <2>; + #size-cells = <0>; + + mt6315_6: pmic@6 { + compatible = "mediatek,mt6315-regulator"; + reg = <0x6 SPMI_USID>; + + regulators { + mt6315_6_vbuck1: vbuck1 { + regulator-compatible = "vbuck1"; + regulator-name = "Vbcpu"; + regulator-min-microvolt = <300000>; + regulator-max-microvolt = <1193750>; + regulator-enable-ramp-delay = <256>; + regulator-allowed-modes = <0 1 2>; + regulator-always-on; + }; + }; + }; + + mt6315_7: pmic@7 { + compatible = "mediatek,mt6315-regulator"; + reg = <0x7 SPMI_USID>; + + regulators { + mt6315_7_vbuck1: vbuck1 { + regulator-compatible = "vbuck1"; + regulator-name = "Vgpu"; + regulator-min-microvolt = <300000>; + regulator-max-microvolt = <1193750>; + regulator-enable-ramp-delay = <256>; + regulator-allowed-modes = <0 1 2>; + }; + }; + }; }; &uart0 {