From patchwork Tue Jun 7 11:44:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laxman Dewangan X-Patchwork-Id: 9160943 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CF1EF60572 for ; Tue, 7 Jun 2016 12:00:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF1062793B for ; Tue, 7 Jun 2016 12:00:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B3D0A281F9; Tue, 7 Jun 2016 12:00:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 967552793B for ; Tue, 7 Jun 2016 12:00:24 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1bAFeU-0008W1-TY; Tue, 07 Jun 2016 11:58:34 +0000 Received: from nat-hk.nvidia.com ([203.18.50.4] helo=hkmmgate101.nvidia.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1bAFeK-00086F-5f for linux-arm-kernel@lists.infradead.org; Tue, 07 Jun 2016 11:58:30 +0000 Received: from hkpgpgate101.nvidia.com (Not Verified[10.18.92.9]) by hkmmgate101.nvidia.com id ; Tue, 07 Jun 2016 19:58:42 +0800 Received: from HKMAIL101.nvidia.com ([10.18.67.137]) by hkpgpgate101.nvidia.com (PGP Universal service); Tue, 07 Jun 2016 04:57:59 -0700 X-PGP-Universal: processed; by hkpgpgate101.nvidia.com on Tue, 07 Jun 2016 04:57:59 -0700 Received: from DRBGMAIL103.nvidia.com (10.18.16.22) by HKMAIL101.nvidia.com (10.18.16.10) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Tue, 7 Jun 2016 11:57:57 +0000 Received: from HQMAIL103.nvidia.com (172.20.187.11) by DRBGMAIL103.nvidia.com (10.18.16.22) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Tue, 7 Jun 2016 11:57:55 +0000 Received: from ldewanganubuntu-System-Product-Name.nvidia.com (172.20.13.39) by HQMAIL103.nvidia.com (172.20.187.11) with Microsoft SMTP Server id 15.0.1130.7 via Frontend Transport; Tue, 7 Jun 2016 11:57:51 +0000 From: Laxman Dewangan To: , , , Subject: [PATCH V2 2/2] ARM64: tegra: Add device node for system PMIC MAX77620 Date: Tue, 7 Jun 2016 17:14:57 +0530 Message-ID: <1465299897-2491-2-git-send-email-ldewangan@nvidia.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1465299897-2491-1-git-send-email-ldewangan@nvidia.com> References: <1465299897-2491-1-git-send-email-ldewangan@nvidia.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160607_045824_944557_C8FAF900 X-CRM114-Status: GOOD ( 16.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: gnurou@gmail.com, arnd@arndb.de, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Laxman Dewangan , linux-tegra@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Jetson-TX1 uses the Maxim MAX77620 as system Power management IC. Add device node for the MAX77620 with following details: - Add device max77620 with. - Add all pins configurations. - Configure FPS of the device. - Configure SD/DCDC and LDOs regulators. - populate the bus expander on base board P2597. - Populate all fixed voltage regulators controlled by GPIOs from Tegra, PMIC and bus expanders. For the different details, jetson-CV device tree files are referred from downstream. Signed-off-by: Laxman Dewangan --- Changes from V1: - Rebase change and populated based on applied patches. .../boot/dts/nvidia/tegra210-p2180-spmic.dtsi | 272 +++++++++++++++++++++ arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts | 2 + arch/arm64/boot/dts/nvidia/tegra210-p2597.dtsi | 150 ++++++++++++ 3 files changed, 424 insertions(+) create mode 100644 arch/arm64/boot/dts/nvidia/tegra210-p2180-spmic.dtsi diff --git a/arch/arm64/boot/dts/nvidia/tegra210-p2180-spmic.dtsi b/arch/arm64/boot/dts/nvidia/tegra210-p2180-spmic.dtsi new file mode 100644 index 0000000..e1f9a17 --- /dev/null +++ b/arch/arm64/boot/dts/nvidia/tegra210-p2180-spmic.dtsi @@ -0,0 +1,272 @@ +/* + * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. + * + * 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; either version 2 of the License, or + * (at your option) any later version. + * + * 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. + */ + +#include +#include + +/ { + i2c@7000d000 { + status = "okay"; + spmic:system-pmic@3c { + compatible = "maxim,max77620"; + reg = <0x3c>; + interrupts = ; + + #interrupt-cells = <2>; + interrupt-controller; + + gpio-controller; + #gpio-cells = <2>; + + pinctrl-names = "default"; + pinctrl-0 = <&spmic_pin_defaults>; + + spmic_pin_defaults: spmic_pin_defaults { + pin_gpio0 { + pins = "gpio0"; + function = "gpio"; + }; + + pin_gpio1 { + pins = "gpio1"; + function = "fps-out"; + drive-push-pull = <1>; + maxim,active-fps-source = ; + maxim,active-fps-power-up-slot = <7>; + maxim,active-fps-power-down-slot = <0>; + }; + + pin_gpio2_3 { + pins = "gpio2", "gpio3"; + function = "fps-out"; + maxim,active-fps-source = ; + }; + + pin_gpio4 { + pins = "gpio4"; + function = "32k-out1"; + }; + + pin_gpio5_6_7 { + pins = "gpio5", "gpio6", "gpio7"; + function = "gpio"; + drive-push-pull = <1>; + }; + }; + + fps { + fps0 { + maxim,shutdown-fps-time-period-us = <5120>; + maxim,fps-event-source = ; + }; + + fps1 { + maxim,shutdown-fps-time-period-us = <5120>; + maxim,fps-event-source = ; + maxim,device-state-on-disabled-event = ; + }; + + fps2 { + maxim,fps-event-source = ; + }; + }; + + regulators { + in-ldo0-1-supply = <&spmic_sd2>; + in-ldo7-8-supply = <&spmic_sd2>; + + spmic_sd0: sd0 { + regulator-name = "vdd_core"; + regulator-min-microvolt = <600000>; + regulator-max-microvolt = <1400000>; + regulator-boot-on; + regulator-always-on; + maxim,active-fps-source = ; + regulator-enable-ramp-delay = <146>; + regulator-ramp-delay = <9000>; + maxim,ramp-rate-setting = <27500>; + }; + + spmic_sd1: sd1 { + regulator-name = "vddio-ddr"; + regulator-always-on; + regulator-boot-on; + maxim,active-fps-source = ; + regulator-enable-ramp-delay = <130>; + regulator-ramp-delay = <9000>; + maxim,ramp-rate-setting = <27500>; + }; + + spmic_sd2: sd2 { + regulator-name = "vdd-pre-reg"; + regulator-min-microvolt = <1350000>; + regulator-max-microvolt = <1350000>; + maxim,active-fps-source = ; + regulator-enable-ramp-delay = <176>; + regulator-ramp-delay = <7800>; + maxim,ramp-rate-setting = <27500>; + }; + + spmic_sd3: sd3 { + regulator-name = "vdd-1v8"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + regulator-boot-on; + maxim,active-fps-source = ; + regulator-enable-ramp-delay = <242>; + regulator-ramp-delay = <7800>; + maxim,ramp-rate-setting = <27500>; + }; + + spmic_ldo0: ldo0 { + regulator-name = "avdd-sys"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-always-on; + regulator-boot-on; + maxim,active-fps-source = ; + regulator-enable-ramp-delay = <26>; + regulator-ramp-delay = <50000>; + maxim,ramp-rate-setting = <100000>; + }; + + spmic_ldo1: ldo1 { + regulator-name = "vdd-pex"; + regulator-min-microvolt = <1050000>; + regulator-max-microvolt = <1050000>; + regulator-always-on; + maxim,active-fps-source = ; + regulator-enable-ramp-delay = <22>; + regulator-ramp-delay = <50000>; + maxim,ramp-rate-setting = <100000>; + }; + + spmic_ldo2: ldo2 { + regulator-name = "vddio-sdmmc1"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + maxim,active-fps-source = ; + regulator-enable-ramp-delay = <62>; + regulator-ramp-delay = <50000>; + maxim,ramp-rate-setting = <100000>; + }; + + spmic_ldo3: ldo3 { + regulator-name = "vdd-cam-hv"; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; + maxim,active-fps-source = ; + regulator-enable-ramp-delay = <50>; + regulator-ramp-delay = <50000>; + maxim,ramp-rate-setting = <100000>; + }; + + spmic_ldo4: ldo4 { + regulator-name = "vdd-rtc"; + regulator-min-microvolt = <850000>; + regulator-max-microvolt = <850000>; + regulator-always-on; + regulator-boot-on; + maxim,active-fps-source = ; + regulator-enable-ramp-delay = <22>; + regulator-ramp-delay = <100000>; + maxim,ramp-rate-setting = <100000>; + }; + + spmic_ldo5: ldo5 { + regulator-name = "avdd-ts-hv"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + maxim,active-fps-source = ; + regulator-enable-ramp-delay = <62>; + regulator-ramp-delay = <50000>; + maxim,ramp-rate-setting = <100000>; + }; + + spmic_ldo6: ldo6 { + regulator-name = "vdd-ts"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + maxim,active-fps-source = ; + maxim,active-fps-power-up-slot = <7>; + maxim,active-fps-power-down-slot = <0>; + regulator-enable-ramp-delay = <36>; + regulator-ramp-delay = <50000>; + maxim,ramp-rate-setting = <100000>; + }; + + spmic_ldo7: ldo7 { + regulator-name = "vdd-gen-pll-edp"; + regulator-min-microvolt = <1050000>; + regulator-max-microvolt = <1050000>; + regulator-always-on; + regulator-boot-on; + maxim,active-fps-source = ; + regulator-enable-ramp-delay = <24>; + regulator-ramp-delay = <50000>; + maxim,ramp-rate-setting = <100000>; + }; + + spmic_ldo8: ldo8 { + regulator-name = "vdd-hdmi-dp"; + regulator-min-microvolt = <1050000>; + regulator-max-microvolt = <1050000>; + regulator-always-on; + maxim,active-fps-source = ; + regulator-enable-ramp-delay = <22>; + regulator-ramp-delay = <50000>; + maxim,ramp-rate-setting = <100000>; + }; + }; + }; + }; + + fixed-regulators { + compatible = "simple-bus"; + device_type = "fixed-regulators"; + #address-cells = <1>; + #size-cells = <0>; + + battery_reg: regulator@0 { + compatible = "regulator-fixed"; + reg = <0>; + regulator-name = "vdd-ac-bat"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + }; + + vdd_3v3: regulator@1 { /* SPMIC GPIO3 FPS controlled */ + compatible = "regulator-fixed"; + reg = <1>; + regulator-name = "vdd-3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-enable-ramp-delay = <160>; + }; + + avdd_io_edp_1v05: regulator@2 { + compatible = "regulator-fixed"; + reg = <2>; + regulator-name = "avdd-io-edp-1v05"; + regulator-min-microvolt = <1050000>; + regulator-max-microvolt = <1050000>; + regulator-boot-on; + gpio = <&spmic 7 0>; + enable-active-high; + regulator-enable-ramp-delay = <240>; + vin-supply = <&spmic_ldo7>; + }; + }; +}; diff --git a/arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts b/arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts index 683b339..e55c97e 100644 --- a/arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts +++ b/arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts @@ -1,9 +1,11 @@ /dts-v1/; #include "tegra210-p2180.dtsi" +#include "tegra210-p2180-spmic.dtsi" #include "tegra210-p2597.dtsi" / { model = "NVIDIA Jetson TX1 Developer Kit"; compatible = "nvidia,p2371-2180", "nvidia,tegra210"; + }; diff --git a/arch/arm64/boot/dts/nvidia/tegra210-p2597.dtsi b/arch/arm64/boot/dts/nvidia/tegra210-p2597.dtsi index a2480c0..f911cc7 100644 --- a/arch/arm64/boot/dts/nvidia/tegra210-p2597.dtsi +++ b/arch/arm64/boot/dts/nvidia/tegra210-p2597.dtsi @@ -1261,6 +1261,26 @@ }; }; + i2c@7000c400 { + status = "okay"; + + gpio_tca9539_74: gpio@74 { + compatible = "ti,tca9539"; + reg = <0x74>; + + gpio-controller; + #gpio-cells = <2>; + }; + + gpio_tca9539_77: gpio@77 { + compatible = "ti,tca9539"; + reg = <0x77>; + + gpio-controller; + #gpio-cells = <2>; + }; + }; + /* MMC/SD */ sdhci@700b0000 { status = "okay"; @@ -1293,4 +1313,134 @@ linux,code = ; }; }; + + fixed-regulators { + vdd_ts_1v8: regulator@201 { + compatible = "regulator-fixed"; + reg = <201>; + regulator-name = "vdd-ts-1v8"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + gpio = <&gpio_tca9539_74 1 0>; + enable-active-high; + }; + + avdd_ts_dis: regulator@202 { + compatible = "regulator-fixed"; + reg = <202>; + regulator-name = "avdd-ts-dis"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&gpio_tca9539_74 2 0>; + enable-active-high; + }; + + vdd_dis_3v3_lcd: regulator@203 { + compatible = "regulator-fixed"; + reg = <203>; + regulator-name = "vdd_dis_3v3_lcd"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + gpio = <&gpio_tca9539_74 3 1>; + enable-active-high; + }; + + mdm_vdd_3v7: regulator@204 { + compatible = "regulator-fixed"; + reg = <204>; + regulator-name = "mdm-vdd-3v7"; + regulator-min-microvol = <3700000>; + regulator-max-microvol = <3700000>; + gpio = <&gpio_tca9539_74 7 1>; + enable-active-high; + }; + + vdd_lcd_1v8_dis: regulator@205 { + compatible = "regulator-fixed"; + reg = <205>; + regulator-name = "vdd-lcd-1v8-dis"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-boot-on; + gpio = <&gpio_tca9539_74 9 1>; + enable-active-high; + }; + + vdd_hdmi_5v0: regulator@206 { + compatible = "regulator-fixed"; + reg = <206>; + regulator-name = "vdd-hdmi-5v0"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio_tca9539_74 12 1>; + enable-active-high; + vin-supply = <&vdd_3v3>; + regulator-enable-ramp-delay = <468>; + }; + + avdd_cam_2v8: regulator@207 { + compatible = "regulator-fixed"; + reg = <207>; + regulator-name = "avdd-cam-2v8"; + regulator-min-microvol = <2800000>; + regulator-max-microvol = <2800000>; + gpio = <&gpio_tca9539_74 13 1>; + enable-active-high; + }; + + dvdd_cam_io_1v8: regulator@208 { + compatible = "regulator-fixed"; + reg = <208>; + regulator-name = "dvdd-dam-io-1v8"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + gpio = <&gpio_tca9539_77 9 1>; + enable-active-high; + }; + + dvdd_cam_io_1v2: regulator@209 { + compatible = "regulator-fixed"; + reg = <209>; + regulator-name = "dvdd-dam-io-1v2"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + gpio = <&gpio_tca9539_77 10 1>; + enable-active-high; + }; + + usb_vbus1: regulator@210 { + compatible = "regulator-fixed"; + reg = <210>; + regulator-name = "usb-vbus1"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio TEGRA_GPIO(CC, 4) 0>; + enable-active-high; + gpio-open-drain; + }; + + usb_vbus2: regulator@211 { + compatible = "regulator-fixed"; + reg = <211>; + regulator-name = "usb-vbus2"; + regulator-min-microvol = <5000000>; + regulator-max-microvol = <5000000>; + gpio = <&gpio TEGRA_GPIO(CC, 5) 0>; + enable-active-high; + gpio-open-drain; + }; + + sd_card_sw_pwr: regulator@212 { + compatible = "regulator-fixed"; + reg = <212>; + regulator-name = "sd-card-sw-pwr"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + enable-active-high; + vin-supply = <&vdd_3v3>; + regulator-enable-ramp-delay = <472>; + gpio = <&gpio TEGRA_GPIO(Z, 3) 0>; + }; + }; };