From patchwork Sun Oct 28 12:26:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 10658543 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 BAC7013A4 for ; Sun, 28 Oct 2018 12:26:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA2C729603 for ; Sun, 28 Oct 2018 12:26:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E947299CB; Sun, 28 Oct 2018 12:26:47 +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 4763029603 for ; Sun, 28 Oct 2018 12:26:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727561AbeJ1VLQ (ORCPT ); Sun, 28 Oct 2018 17:11:16 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:37747 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726468AbeJ1VLQ (ORCPT ); Sun, 28 Oct 2018 17:11:16 -0400 Received: by mail-wr1-f68.google.com with SMTP id g9-v6so5717304wrq.4; Sun, 28 Oct 2018 05:26:45 -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=uXY3fKxHcgSJBMEhrCDhaqBYe2wurB6dwFo0adEDsjM=; b=twQtOWha1IAVFKEudizU1vJqtoWgYxZKVutHY98x6lCYguiVObiXbelXSQ4e8mkHm5 WzxmvJNeoqc5SrB3YWNOM1stk3zVO4HUEmkQ+aNs0zeshW2wHeIO3BsI6TruFBWPYt/z PlEPLRa8GpndYR6j8LPGp/oTRzR3HXfOWhjTU2sL4xqNvBXlqjKTEReHHyfHrS9D7uUw ZJ8y0iH3JCkESicAgYP1rEQ7v8Qruwciu6C9TkYxzwBjs/znR6+SuSSoIBG5eWYFia3W nA5Er00qUUxLQ5Oyh1WZFcIyNjA/bkkoTRJDJcNCOy52vM/hAFcUIRvd8XBHefDNCRxh TV4Q== 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=uXY3fKxHcgSJBMEhrCDhaqBYe2wurB6dwFo0adEDsjM=; b=Q9ZqEXF2t7s+gkGBVm+mASJYCUTrCClrr1zWxJ/jcwVNE8zH6s5AKG32/xsnssEkC6 LvRha4WKcwSBGYezXl12msmEhtpPubio3KXIcQamj41tJ4WJBAu8H+32XmS0UtUVmLJc nhvKqKrkJ2s7BKjcYzCApDZsDs7Eb++Q53veVW4o1LXT2lSq2tiWr3NRfUyKZOUH4XiV gZRMHOz4YkKVvXWWnehQ+QZoMgrV6VUT/MdmoGyGlDZReAhvYCEtSnxsc6AnP4set8Im K+OntZhijoAZUgMzg8t4g0dw/jj7lYj3fEa3lJv8rMd97XXLyKr0BtWwFxD/VDTZi3pb jgKw== X-Gm-Message-State: AGRZ1gKDCxAlchBSAGEKBhAhOLQWNLVXv3rdADed4HxzRMA5OS2bfTNX 50UHY3GThzXeLoHKfVzDQWQ= X-Google-Smtp-Source: AJdET5fI5kYWAlqBcpOqPZFE7dEHTMMWSG2zPGzromeDDOAl6tap2MuonbTdVB4k0rHfpFPdLZ0ldA== X-Received: by 2002:a5d:5045:: with SMTP id h5-v6mr11580725wrt.210.1540729604278; Sun, 28 Oct 2018 05:26:44 -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.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Oct 2018 05:26:43 -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 4/7] ARM: dts: meson8b: add the temperature calibration data for the SAR ADC Date: Sun, 28 Oct 2018 13:26:26 +0100 Message-Id: <20181028122629.10144-5-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/meson8b.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm/boot/dts/meson8b.dtsi b/arch/arm/boot/dts/meson8b.dtsi index f92aab0aa247..dd47af174c4d 100644 --- a/arch/arm/boot/dts/meson8b.dtsi +++ b/arch/arm/boot/dts/meson8b.dtsi @@ -283,6 +283,11 @@ compatible = "amlogic,meson8b-efuse"; clocks = <&clkc CLKID_EFUSE>; clock-names = "core"; + + temperature_calib: calib@1f4 { + /* only the upper two bytes are relevant */ + reg = <0x1f4 0x4>; + }; }; ðmac { @@ -354,6 +359,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 {