Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp5210987imd; Tue, 30 Oct 2018 13:47:04 -0700 (PDT) X-Google-Smtp-Source: AJdET5fKrGGkaMj6jEGKq8QOMP7j0azALn5F57xUhSGA54YGQ87+mpRwb6U3S/ec27q4184/70i3 X-Received: by 2002:a63:a612:: with SMTP id t18-v6mr260254pge.338.1540932424011; Tue, 30 Oct 2018 13:47:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540932423; cv=none; d=google.com; s=arc-20160816; b=uKH95zOCNn3jTglfYPkAilY8u0KBStAY5HuvTTCV48LQ8ewI6osegADQJx/e9Mdjhp 1goJr9cB071RItHB5Ts6scR3yWYCA7rEiBhHZRLSe867nj0yF8dAHl7+BiS+EMZZDquQ DwTT7KUcZN1uYxUEqvwsax8xFDGZzOSHEej4lLKLFlKEVnF7BYooMC9Qk1m+ZLOVudEr nJTECYM+HRloqrOGJJMRzyNfnURrfo0/ivpJG4b7404LF8iW7+pqFfJU8KhY3HnTBeed Hn0t9IPPRMXvxHwfK05JFvKeV5+YAvEJsW/TXbEpEXkquUd1PbU1MMEe8IS42mhOlN2g OBFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=9EytBVc0/b96Hu0pFYOWE5cWM4ByObpAYT0thqnQhOE=; b=Ywi9G7YShBTLIjwo7Xox6GJ0DlsxO1vBhUTKQAd9W23HQqBea6H+xYJ9RTk2JHZslQ Q7w7l/h+rtLIcjq/AUlpvq/ACC3/ry8jpmYwx9xT/dgceMO0axXVTMFYcLYAAMXf8bvL /ZfABbwVkIlizU6vlGJGGVC5oXvLNcHrmKqv7tqoC47dj66Vna9O96MatMW/5B3hBnoN B9b34j+KV18K6zFhiKIbYG2kbmmZH6uFhNvTikdZOt/wEAEev/mwx/HtStC+MCbxUQPj NFyJumg9lrUBnrvfx2V9q8yqjBoPip3/TDIax6LcG62MjCYenEKIufOp3Wz70d0lpdLG 02+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gn9si23237835plb.71.2018.10.30.13.46.47; Tue, 30 Oct 2018 13:47:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726925AbeJaFhw (ORCPT + 99 others); Wed, 31 Oct 2018 01:37:52 -0400 Received: from mail-ot1-f65.google.com ([209.85.210.65]:45479 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725812AbeJaFhv (ORCPT ); Wed, 31 Oct 2018 01:37:51 -0400 Received: by mail-ot1-f65.google.com with SMTP id g10so1422185otl.12; Tue, 30 Oct 2018 13:42:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=9EytBVc0/b96Hu0pFYOWE5cWM4ByObpAYT0thqnQhOE=; b=Y/p6WG5hAb6Nnd69N7UyDQBC631wGEOzgeUYUMB6n674ssFdS1Oxa6DW8OQewm+W4X 14comWJPIoWH8Dw0Zv3ziivE5Db0iykwQt3yq8pRO0z+OEjVV1YlsujC/zwU2gM9XYCn oyU5hL+Pi72c+FsbyW75zMAXs7DPGZN0JSoJMES0vnhryplIkRM0qfMElUBhyn3mmGRj UwpG1FRC2zDrrJI4YOI0vp94R9jUXE/cnEWcs9KVCeIIQj3A26Bf+wyEHPOaSQHRwh/e CcxnscsDXeki4khL0S4LNwTbbNMKkpfwToZjDAvQ6oMwkMAqa0iXRXIdQm9+LGZPJ0Ef Sbjw== X-Gm-Message-State: AGRZ1gKscGttQjQXH0jG1KKaVxd9FKFzFvHOYjydEf/l1lzcr+OF6jvl NNIv1+dy3QwoXwCl8dHLNQ== X-Received: by 2002:a9d:3644:: with SMTP id w62mr171298otb.23.1540932168897; Tue, 30 Oct 2018 13:42:48 -0700 (PDT) Received: from localhost (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.gmail.com with ESMTPSA id c202-v6sm1412861oih.26.2018.10.30.13.42.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Oct 2018 13:42:47 -0700 (PDT) Date: Tue, 30 Oct 2018 15:42:47 -0500 From: Rob Herring To: Manish Narani Cc: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, mark.rutland@arm.com, michal.simek@xilinx.com, amit.kucheria@linaro.org, sudeep.holla@arm.com, olof@lixom.net, broonie@kernel.org, arnaud.pouliquen@st.com, eugen.hristev@microchip.com, linus.walleij@linaro.org, vilhelm.gray@gmail.com, geert@linux-m68k.org, freeman.liu@spreadtrum.com, rdunlap@infradead.org, tglx@linutronix.de, baolin.wang@linaro.org, gregkh@linuxfoundation.org, jdelvare@suse.com, linux@roeck-us.net, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org Subject: Re: [PATCH v3 1/3] dt-bindings: iio: adc: Add Xilinx AMS binding documentation Message-ID: <20181030204247.GA22521@bogus> References: <1540815026-1012-1-git-send-email-manish.narani@xilinx.com> <1540815026-1012-2-git-send-email-manish.narani@xilinx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1540815026-1012-2-git-send-email-manish.narani@xilinx.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 29, 2018 at 05:40:24PM +0530, Manish Narani wrote: > Xilinx AMS have several ADC channels that can be used for measurement of > different voltages and temperatures. Document the same in the bindings. > > Signed-off-by: Manish Narani > --- > .../devicetree/bindings/iio/adc/xilinx-ams.txt | 183 +++++++++++++++++++++ > 1 file changed, 183 insertions(+) > create mode 100644 Documentation/devicetree/bindings/iio/adc/xilinx-ams.txt > > diff --git a/Documentation/devicetree/bindings/iio/adc/xilinx-ams.txt b/Documentation/devicetree/bindings/iio/adc/xilinx-ams.txt > new file mode 100644 > index 0000000..1635576 > --- /dev/null > +++ b/Documentation/devicetree/bindings/iio/adc/xilinx-ams.txt > @@ -0,0 +1,183 @@ > +Xilinx AMS controller > +````````````````````` > +The AMS includes an ADC as well as on-chip sensors that can be used to AMS stands for? > +sample external voltages and monitor on-die operating conditions, such as > +temperature and supply voltage levels. > +The AMS has two SYSMON blocks which are PL (Programmable Logic) SYSMON and > +PS (Processing System) SYSMON. > +All designs should have AMS registers, but PS and PL are optional. The > +AMS controller can work with only PS, only PL and both PS and PL > +configurations. Please specify registers according to your design. Devicetree > +should always have AMS module property. Providing PS & PL module is optional. > + > +Required properties: > + - compatible: Should be "xlnx,zynqmp-ams" > + - reg: Should specify AMS register space > + - interrupts: Interrupt number for the AMS control interface > + - interrupt-names: Interrupt name, must be "ams-irq" > + - clocks: Should contain a clock specifier for the device > + - ranges: keep the property empty to map child address space > + (for PS and/or PL) nodes 1:1 onto the parent address > + space > + > + AMS sub-nodes: > + - ams_ps : Used as PS-SYSMON node > + - ams_pl : Used as PL-SYSMON node Don't use '_' in node or property names. > + > + > + > +AMS PS-SYSMON > +````````````` > +PS (Processing System) SYSMON is memory mapped to PS. This block has built-in > +alarm generation logic that is used to interrupt the processor based on > +condition set. > + > +Required properties: > + - compatible: Should be "xlnx,zynqmp-ams-ps" > + - reg: Register space for PS-SYSMON > + > + > + > +AMS PL-SYSMON > +````````````` > +PL-SYSMON is capable of monitoring off chip voltage and temperature. PL-SYSMON > +block has DRP, JTAG and I2C interface to enable monitoring from external master. > +Out of this interface currently only DRP is supported. This block has alarm > +generation logic that is used to interrupt the processor based on condition set. > + > +Required properties: > + - compatible: Should be "xlnx,zynqmp-ams-pl" > + - reg: Register space for PL-SYSMON > + > +PL-SYSMON optional sub-nodes: > + - xlnx,ext-channels: List of external channels that are connected to the > + AMS PL module. > + > + The child nodes of PL-SYSMON represent the external channels which are > + connected to this Module. If the property is not present > + no external channels will be assumed to be connected. > + > + Each child node represents one channel and has the following > + properties: > + > + Required properties: > + * reg: Pair of pins the channel is connected to. > + > + 'reg' value Channel Name Channel Number > + ----------- ------------ -------------- > + 0 VP/VN 30 > + 1 VUSER0 31 > + 2 VUSER1 32 > + 3 VUSER3 33 > + 4 VUSER4 34 > + 5 VAUXP[0]/VAUXN[0] 35 > + 6 VAUXP[1]/VAUXN[1] 36 > + ... > + 20 VAUXP[15]/VAUXN[15] 50 Why this reg to channel mapping? Just use channel numbers for reg. I'm confused by this table and the one below. > + > + Each channel number should only be used at most once. For > + more details on channels, refer to the table given at the end. > + > + Optional properties: > + * xlnx,bipolar: If set the channel is used in bipolar > + mode. > + > + > +Example: > + xilinx_ams: ams@ffa50000 { > + compatible = "xlnx,zynqmp-ams"; > + interrupt-parent = <&gic>; > + interrupts = <0 56 4>; > + interrupt-names = "ams-irq"; > + reg = <0x0 0xffa50000 0x0 0x800>; > + reg-names = "ams-base"; > + #address-cells = <1>; > + #size-cells = <1>; > + #io-channel-cells = <1>; > + ranges = <0 0 0xffa50800 0x400 > + 1 0 0xffa50c00 0x400>; This doesn't work. This is mapping child addresses 0 and 1, but both child nodes are at address 0. I believe you want the length to be 0x800 and drop the 2nd entry. > + > + ams_ps: ams_ps@0,0 { > + compatible = "xlnx,zynqmp-ams-ps"; > + reg = <0 0x400>; > + }; > + > + ams_pl: ams_pl@1,0 { > + compatible = "xlnx,zynqmp-ams-pl"; > + reg = <0 0x400>; And then this should be address 0x400. > + xlnx,ext-channels { > + channel@0 { > + reg = <0>; > + xlnx,bipolar; > + }; > + channel@1 { > + reg = <1>; > + }; > + channel@8 { > + reg = <8>; > + xlnx,bipolar; > + }; > + }; > + }; > + }; > + > + > +AMS Channel Details > +``````````````````` > +Sysmon Block |Channel| Details |Measurement > + |Number | |Type > +--------------------------------------------------------------------------------------------------------- > +AMS CTRL |0 |System PLLs voltage measurement, VCC_PSPLL. |Voltage > + |1 |Battery voltage measurement, VCC_PSBATT. |Voltage > + |2 |PL Internal voltage measurement, VCCINT. |Voltage > + |3 |Block RAM voltage measurement, VCCBRAM. |Voltage > + |4 |PL Aux voltage measurement, VCCAUX. |Voltage > + |5 |Voltage measurement for six DDR I/O PLLs, VCC_PSDDR_PLL. |Voltage > + |6 |VCC_PSINTFP_DDR voltage measurement. |Voltage > +--------------------------------------------------------------------------------------------------------- > +PS Sysmon |7 |LPD temperature measurement. |Temperature > + |8 |FPD temperature measurement (REMOTE). |Temperature > + |9 |VCC PS LPD voltage measurement (supply1). |Voltage > + |10 |VCC PS FPD voltage measurement (supply2). |Voltage > + |11 |PS Aux voltage reference (supply3). |Voltage > + |12 |DDR I/O VCC voltage measurement. |Voltage > + |13 |PS IO Bank 503 voltage measurement (supply5). |Voltage > + |14 |PS IO Bank 500 voltage measurement (supply6). |Voltage > + |15 |VCCO_PSIO1 voltage measurement. |Voltage > + |16 |VCCO_PSIO2 voltage measurement. |Voltage > + |17 |VCC_PS_GTR voltage measurement (VPS_MGTRAVCC). |Voltage > + |18 |VTT_PS_GTR voltage measurement (VPS_MGTRAVTT). |Voltage > + |19 |VCC_PSADC voltage measurement. |Voltage > +--------------------------------------------------------------------------------------------------------- > +PL Sysmon |20 |PL temperature measurement. |Temperature > + |21 |PL Internal voltage measurement, VCCINT. |Voltage > + |22 |PL Auxiliary voltage measurement, VCCAUX. |Voltage > + |23 |ADC Reference P+ voltage measurement. |Voltage > + |24 |ADC Reference N- voltage measurement. |Voltage > + |25 |PL Block RAM voltage measurement, VCCBRAM. |Voltage > + |26 |LPD Internal voltage measurement, VCC_PSINTLP (supply4). |Voltage > + |27 |FPD Internal voltage measurement, VCC_PSINTFP (supply5). |Voltage > + |28 |PS Auxiliary voltage measurement (supply6). |Voltage > + |29 |PL VCCADC voltage measurement (vccams). |Voltage > + |30 |Differential analog input signal voltage measurment. |Voltage > + |31 |VUser0 voltage measurement (supply7). |Voltage > + |32 |VUser1 voltage measurement (supply8). |Voltage > + |33 |VUser2 voltage measurement (supply9). |Voltage > + |34 |VUser3 voltage measurement (supply10). |Voltage > + |35 |Auxiliary ch 0 voltage measurement (VAux0). |Voltage > + |36 |Auxiliary ch 1 voltage measurement (VAux1). |Voltage > + |37 |Auxiliary ch 2 voltage measurement (VAux2). |Voltage > + |38 |Auxiliary ch 3 voltage measurement (VAux3). |Voltage > + |39 |Auxiliary ch 4 voltage measurement (VAux4). |Voltage > + |40 |Auxiliary ch 5 voltage measurement (VAux5). |Voltage > + |41 |Auxiliary ch 6 voltage measurement (VAux6). |Voltage > + |42 |Auxiliary ch 7 voltage measurement (VAux7). |Voltage > + |43 |Auxiliary ch 8 voltage measurement (VAux8). |Voltage > + |44 |Auxiliary ch 9 voltage measurement (VAux9). |Voltage > + |45 |Auxiliary ch 10 voltage measurement (VAux10). |Voltage > + |46 |Auxiliary ch 11 voltage measurement (VAux11). |Voltage > + |47 |Auxiliary ch 12 voltage measurement (VAux12). |Voltage > + |48 |Auxiliary ch 13 voltage measurement (VAux13). |Voltage > + |49 |Auxiliary ch 14 voltage measurement (VAux14). |Voltage > + |50 |Auxiliary ch 15 voltage measurement (VAux15). |Voltage > +--------------------------------------------------------------------------------------------------------- > -- > 2.1.1 >