From patchwork Sat Jan 12 13:06:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 10760975 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 212BA6C2 for ; Sat, 12 Jan 2019 13:07:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 10D63295E7 for ; Sat, 12 Jan 2019 13:07:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0545D295E9; Sat, 12 Jan 2019 13:07:49 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 A9F9D295E7 for ; Sat, 12 Jan 2019 13:07:48 +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=BNr4bYGipGcyhLk5DsTnTCKNvofNKezPmyG+5JCpaU4=; b=kDhCreEIZ5VhCW hywHY2qjM5l/56kV0piOq8KNcOeqKCi2XcFsiWh+JGx0fYvgoX5Tra9kUFG9nZE2m0r/SSj9HgyCz iEuSLeB7teSwPTjhUhJDbW/t33v5DCwvQc7EvCn/08/xBKJgRSPPHyTNcuJhYdCLn7krVJ2UqRHuf obcg78ir+dnZuu6mX+95z+VRdmrxBIucxteuT7LkRW6yfx6FC1fEIjEgNxnbu64vKjV9Yb5cSXtya mfh13kTfNPds5vQt+/lejnv6WvN6S06bKNIp6m0dXB/Max+jyVtfpKf80d8WZj2qP5qFvFeHNQ2Fj W1X31GdcloPabYNH/QLw==; 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 1giJ0r-0000CR-Qp; Sat, 12 Jan 2019 13:07:45 +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 1giJ09-0007qY-LG; Sat, 12 Jan 2019 13:07:08 +0000 Received: by mail-wr1-x443.google.com with SMTP id q18so18002495wrx.9; Sat, 12 Jan 2019 05:06:58 -0800 (PST) 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=X0DVle89JG5JTLCgwoLl7aCIrZA7dPHg3+1ZWFBYSeI=; b=YefjpmFXGcXUkogc+OefuH+HXmnqlj1yS0Jg98dnIjm6HZeihAV0wU/LRU5auR7YTp uqHuAfKmwFV8k2s4nHfxVLDQZLhyJ3bibsKX0D/dYvI3G7p1Xd/wVkF1KteeDQfIhf0V 7kf9tgtmJErVPqPXDX44i8sF8l1ABgpTAMjyV+sBUefv4EnTwFqZVny+7VIY9T2y7/LP QpmzBEM/i9+jeuuZZUZuAdJRY78QzhV4sPEEU2I1+SkwCUOhdjCGRoVov1FdmkQlzu/9 3eH/VrVizwjFG9ky5LJmSzHUaCISaMvuXgZHv2vkvMckUpogIGVMGEfXLwkhkcT+2HrW phMg== 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=X0DVle89JG5JTLCgwoLl7aCIrZA7dPHg3+1ZWFBYSeI=; b=bvpvMZyPJXSEfOIlVDDWBkl1jPD07WBnqQJGAXPSWEF/I86ElwrxJevN9Ga4GPm2Zz Bkp0JbY9DyBj6iMEIFIV8XsT9Gi4E+UH4YZHZ8NIzzGEmuuqchxdjXdf07diYPaMV4d6 ltgDhjONNez4xpZtTRkzgGuAkfZSO7FUbpgfPCvuHAZbxRadzyNVEsI8bVy0KwD8EyRy C/XqOYtJ94Sb0QhdkkX0JcHwJO0YQG6KbiWBvxcsvnOMNKS9jVna+6dKieWanTd8Y3kg 65EUvny257tWl0KXq6MCEI63Xa1B4zGfeAja2mTQnW5bf1ANuGC3ntYwnDSNeFZzbBqW Y2pA== X-Gm-Message-State: AJcUuke7qXQZHRPIFEu64NOFNfsKKGdDmz2mMPQDABSZF318t3/VFFLr mihrp2/d9M04UeZnhPENqHfskKpT X-Google-Smtp-Source: ALg8bN4nX9DZBSCv/ZN9AKhcOB2ftMpdxo/Y0q2bKoG9N0pXPd7GoVbuUos6lvj8h+Ugotf/cQapvA== X-Received: by 2002:adf:9b11:: with SMTP id b17mr17690965wrc.168.1547298416777; Sat, 12 Jan 2019 05:06:56 -0800 (PST) Received: from blackbox.darklights.net (p200300DCD7329F008D685E3E728ED25E.dip0.t-ipconnect.de. [2003:dc:d732:9f00:8d68:5e3e:728e:d25e]) by smtp.googlemail.com with ESMTPSA id o5sm37804630wmg.25.2019.01.12.05.06.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 12 Jan 2019 05:06:56 -0800 (PST) From: Martin Blumenstingl To: linux-amlogic@lists.infradead.org, khilman@baylibre.com Subject: [PATCH 2/6] ARM: dts: meson8: add the temperature calibration data for the SAR ADC Date: Sat, 12 Jan 2019 14:06:45 +0100 Message-Id: <20190112130649.23838-3-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190112130649.23838-1-martin.blumenstingl@googlemail.com> References: <20190112130649.23838-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-20190112_050702_024012_4EA652D1 X-CRM114-Status: GOOD ( 11.63 ) 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: Martin Blumenstingl , linux-arm-kernel@lists.infradead.org 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/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 83ed92dae892..5c6af73e4fc0 100644 --- a/arch/arm/boot/dts/meson8.dtsi +++ b/arch/arm/boot/dts/meson8.dtsi @@ -456,6 +456,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 { @@ -535,6 +540,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 {