From patchwork Sun Oct 28 12:26:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 10658541 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6856B174F for ; Sun, 28 Oct 2018 12:26:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 58A6029603 for ; Sun, 28 Oct 2018 12:26:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4CBF5299CB; Sun, 28 Oct 2018 12:26:46 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EFDF229603 for ; Sun, 28 Oct 2018 12:26:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726734AbeJ1VLP (ORCPT ); Sun, 28 Oct 2018 17:11:15 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:52615 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726548AbeJ1VLP (ORCPT ); Sun, 28 Oct 2018 17:11:15 -0400 Received: by mail-wm1-f67.google.com with SMTP id 189-v6so5514694wmw.2; Sun, 28 Oct 2018 05:26:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/kpheQ08l69z/l+gyVSibpsB09LEwwgtaVsn4Ql83yQ=; b=rs7H9kK9X9aJSBX6iTuKGv7fNN55WDPLd6UJ70ITLl7eaNclfAeGUnpFJFymJD3NrP XWuyEeti4h/RiQyEPHvOoBgcPIE1iaFVgl6QNOY5zBckL3IMt666OgZEf9NNe5iQWo9p efdXnh8btn+Uya4yAMcCFH0blkrM3PuqXrDoMfGEwE4zwfN8CBY9Uo/N8Sw/mZWgWzi2 rVjVlzSLmWqCUOYtwkVucbeXKnGFqM2Q33rW8P1q0f2GKCqj5s1uVR8DjI96YGnYnJJx Jhbbb1SbUDGsJ/IqelAFi0rsND9JMAr7hhFh0spaCgG6A1FjS3uAs2ti/+/cA3TXdDxB 7a1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/kpheQ08l69z/l+gyVSibpsB09LEwwgtaVsn4Ql83yQ=; b=dZKZS+ZnhamVnUoAethr5n1KcW0k2jjGq7nRdvjSDsKlAqdU59aYLzhDP6jD+2nTP3 heHMR3UdBE0JtSH+j09yPABaKqEnaJE8Zq60Foi4xaMdbXBWh8LEsuCSQu5RUC17+uNe CE4eJ9jqB0b8qUeDLKEBvtpUPuTGVMfzHK7/YI1cf4AU2rJnVfI0PQ4mS7SWp4pf7+Mf uWyb53CyWHGakG4RfcvvewmNE83ujsMWkSchuPUhADGoCbUOvkPvhKsTCM3bMHzIAJWR GYMDvyx7yELD1TgbblPwaOhhM4wlTK+cKB1Z2TtNYHx0G3q0wM2KA3nJAcWQOP1CjT1n 5WkQ== X-Gm-Message-State: AGRZ1gIfsmC2gwp4FnuPvzyqhIiQrCtqzpqyB2CwEa7fvDuhvpISav9L W/XnDjem25m2uw05NEkSLDtjDw87 X-Google-Smtp-Source: AJdET5ehVd0CTxcBKpSaFROpEglnx8ms52Qyz6GSk1ZD4oOkxMdpF1A9SCPLBRoZiVEOe76od3JEdg== X-Received: by 2002:a7b:c096:: with SMTP id r22-v6mr11145615wmh.40.1540729602891; Sun, 28 Oct 2018 05:26:42 -0700 (PDT) Received: from blackbox.darklights.net (p200300DCD7072200691979D1FB980407.dip0.t-ipconnect.de. [2003:dc:d707:2200:6919:79d1:fb98:407]) by smtp.googlemail.com with ESMTPSA id z185-v6sm19334091wmz.47.2018.10.28.05.26.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Oct 2018 05:26:42 -0700 (PDT) From: Martin Blumenstingl To: linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, linux-iio@vger.kernel.org, robh+dt@kernel.org, pmeerw@pmeerw.net, lars@metafoo.de, knaack.h@gmx.de, jic23@kernel.org Cc: khilman@baylibre.com, carlo@caione.org, Martin Blumenstingl Subject: [PATCH 3/7] ARM: dts: meson8: add the temperature calibration data for the SAR ADC Date: Sun, 28 Oct 2018 13:26:25 +0100 Message-Id: <20181028122629.10144-4-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181028122629.10144-1-martin.blumenstingl@googlemail.com> References: <20181028122629.10144-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The SAR ADC can measure the chip temperature of the SoC. This only works if the chip is calibrated and if the calibration data is written to the correct registers. The calibration data is stored in the upper two bytes of eFuse offset 0x1f4. This adds the eFuse cell for the temperature calibration data and passes it to the SAR ADC. We also need to pass the HHI sysctrl node to the SAR ADC because the 4th TSC (temperature sensor calibration coefficient) bit is stored in the HHI region (unlike bits [3:0] which are stored directly inside the SAR ADC's register area). On boards that have the SAR ADC enabled channel 8 can be used to measure the chip temperature. Signed-off-by: Martin Blumenstingl --- arch/arm/boot/dts/meson8.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm/boot/dts/meson8.dtsi b/arch/arm/boot/dts/meson8.dtsi index 3e3d9c54cddc..30d4406f63b3 100644 --- a/arch/arm/boot/dts/meson8.dtsi +++ b/arch/arm/boot/dts/meson8.dtsi @@ -304,6 +304,11 @@ compatible = "amlogic,meson8-efuse"; clocks = <&clkc CLKID_EFUSE>; clock-names = "core"; + + temperature_calib: calib@1f4 { + /* only the upper two bytes are relevant */ + reg = <0x1f4 0x4>; + }; }; ðmac { @@ -364,6 +369,9 @@ clocks = <&clkc CLKID_XTAL>, <&clkc CLKID_SAR_ADC>; clock-names = "clkin", "core"; + amlogic,hhi-sysctrl = <&hhi>; + nvmem-cells = <&temperature_calib>; + nvmem-cell-names = "temperature_calib"; }; &sdio {