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: 10658561 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 3171113BF for ; Sun, 28 Oct 2018 12:28:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F7F229603 for ; Sun, 28 Oct 2018 12:28:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 12DBF299CB; Sun, 28 Oct 2018 12:28:02 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 996B829603 for ; Sun, 28 Oct 2018 12:28:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RRc2IeNHnB8HPIBFFv8FzaKXiWBy33ZW3BpTXeuRMhU=; b=MQiI5xmHN4u/VI LuFTiZcc1aUkccmTvbEGGGaFb/GVBpvge+BPqmf+xSv4zuS+GrBUZydn93rerBtPNO7BFmD4oF0lH fKKWTXShkFf5vQy/fr2IVaoktA9fcV9admZ1RdyIrqkZfM07we7edcuKAIcArBRVEyqjexH0EQBpQ eM/+2ejVplDVSekF2888sBoqjNVZPpcWpxOyqpVPazB2LNDkTkIZwvE5sJOR/I4bsJFMQjQH26mR3 GkohMl2h2SxUTk4YXN+v/MbbMcpRqd4RIDRebDUWbBkDh3b5bQY9nxVt1dOkRX6eUAY5Z4KEqA9RN DRXwlkS4+uDq4Zo8kUqQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gGkAd-0003HP-KN; Sun, 28 Oct 2018 12:27:55 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gGk9g-0001ZZ-ER for linux-amlogic@lists.infradead.org; Sun, 28 Oct 2018 12:27:16 +0000 Received: by mail-wr1-x443.google.com with SMTP id y15-v6so5699720wru.9 for ; Sun, 28 Oct 2018 05:26:46 -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=UnDOUuV5t7sXI/5indunSixnQdLBy0baE2sTF4AAbMLead7BdjzSqH5bzhiVPZ+1h9 iAn7y9VdwrRF5ce5Pv0YHb8JzwGKHnifJ8ujO9NR0szXw2gZjQ+TZpLjlN80qZ473qDH LQOc5QxxmgrDmApW4M4ouXcJiRBEMyTSSuusikUsqBgwia81XE87N/syeD2Y7TTl1X9y ghvdbQQXOIQ+zmEj46XRJHRHtp0hmvc9tgVK5W+Zlxe1N1+XiSyjJST2YFA8Hovh9adk CCQTrP/Zp7Xh5odwSa561UYtXW+NVYkgfVKzTEbkgANPFeqHyoxxjo5+Ty70X42elQ3k REYw== X-Gm-Message-State: AGRZ1gIDWMqjTXz1wF1080XvHOxrHCAeCFJO4UU9cG1Ndwyza3TKNKat YhT+c+8wSkMoN9saiAWDqJZMf3Hj 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181028_052656_504002_64C11BEA X-CRM114-Status: GOOD ( 11.32 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: carlo@caione.org, khilman@baylibre.com, Martin Blumenstingl Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.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 {