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: 631529 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3rP97t3vwmz9t3k for ; Tue, 7 Jun 2016 21:58:34 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161237AbcFGL6I (ORCPT ); Tue, 7 Jun 2016 07:58:08 -0400 Received: from nat-hk.nvidia.com ([203.18.50.4]:59234 "EHLO hkmmgate101.nvidia.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1161257AbcFGL6E (ORCPT ); Tue, 7 Jun 2016 07:58:04 -0400 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: , , , CC: , , , , , , Laxman Dewangan 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 Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org 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>; + }; + }; };