Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp331248imp; Thu, 21 Feb 2019 02:18:49 -0800 (PST) X-Google-Smtp-Source: AHgI3IbYhs1C5FGOHJm5U61CtqxDDTN0O7oX3pu+Qv80YbGS+619Ip5TvzM3G10G9jvj3yP5D8WT X-Received: by 2002:a17:902:e60e:: with SMTP id cm14mr3954668plb.192.1550744329240; Thu, 21 Feb 2019 02:18:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550744329; cv=none; d=google.com; s=arc-20160816; b=Ya5PrbSWgXeYdsD5R3xd8qc/6g14h/UmwPLM8DBNvD+MK0o0QPH9KXfwfPbcNZTkSF 6NUeULco3NikhbZh9kqbZiv+JUuJQ5NeUkwa82/qb1PnCi6TXk3xIoK9yW1KVoiBZBMn g64yd/OnxDDxu0PXxkvI1+Fu02ant2XlfmypbEXkLn1lgErpZ2sR3GrRKD8dlAeqiukQ BIqGEIcHdWy2FBknADrhCz56SZTWrmSxHXZtJlwxvbugVemgsoSafwabNnRzNeNV2QZU CHrkQ4BageuOk8iUoLLYNZZqgiiAdO5uZLM4lga4MoYpwvJmIculY2B4sNwf9/gM+vGe SAJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :domainkey-signature:dkim-signature; bh=UGCjEr2HCcLEYecuIMztW0WdRCmKMoBVNfpYUECKC7c=; b=ZgoL/8EcpYVtZ2zV0HfSobw6XcqbCD+zwifFwvU2DumgMiKOF/JdNA2VWz8+ZeVfLi wl2gYdD7VMjiPzrq3Bglf1YiJ5dYz3Y23lZNN//+yeOo0v0PcLhCrGW3SlcbbEoV7Rar AYBTrai+LaLBMOILsksGpAIysB6oHjYmU62GUBnpY35EHXTZPkZ4Y6cK4lMGVVLbqceU 4WmSG42g4mtg5/739rOjEjfCrNSTQiyiC1w9ojMGy0m5d46nuPDRVdFVDaVTiDKVhMG/ /fYRKlwG+upIw/57TNxuAryfWPgreK1POyzcairuPzJA7n8e4YoOJc4pOWmbSvdxZ9Fc kU9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bidouilliste.com header.s=mail header.b=hIgWGRzf; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n7si13064649plk.85.2019.02.21.02.18.33; Thu, 21 Feb 2019 02:18:49 -0800 (PST) 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; dkim=pass header.i=@bidouilliste.com header.s=mail header.b=hIgWGRzf; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727437AbfBUKRA (ORCPT + 99 others); Thu, 21 Feb 2019 05:17:00 -0500 Received: from mail.blih.net ([212.83.177.182]:53717 "EHLO mail.blih.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725943AbfBUKQ7 (ORCPT ); Thu, 21 Feb 2019 05:16:59 -0500 X-Greylist: delayed 398 seconds by postgrey-1.27 at vger.kernel.org; Thu, 21 Feb 2019 05:16:58 EST Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 0b330c4b; Thu, 21 Feb 2019 11:10:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=8yA3uPBAxUDLtORA2o8u5XjRGpQ=; b=hIgWGRzfkrQKS+fhohCpQ2a4K150 FIhalBWBd8DSrWgrZ3edjSTvh2hWv2OB3HKlNZh7Qc/ZJ4RI9IsZ9Vz+FXUdlI6B 7FpCz5d7VzOntoqXOK1sktIr7y2wuann1kUT7694COT8ArZXxP9TYp/Htb4xd3cw nzYcjOVneArKNdc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=n8biuWE4Ic7RwUXC8QdHKN+0r5bqI73iJdDcyTW/YZJMgB4oHpQe7I0a FpnGfhfJR3swnBv4wpQ+OeArTEufFcdPbWNf/DGRTFit6aEVXXqMIV8X8pYJC9yn O2COT811qeUfwr7FdwyCE/M0jUpUQGN7eOmeY2t69AxT+ebsGms= Received: from knuckles.blih.net (ip-9.net-89-3-105.rev.numericable.fr [89.3.105.9]) by mail.blih.net (OpenSMTPD) with ESMTPSA id ed322229 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Thu, 21 Feb 2019 11:10:17 +0100 (CET) Date: Thu, 21 Feb 2019 11:10:17 +0100 From: Emmanuel Vadot To: Chen-Yu Tsai Cc: Maxime Ripard , Philipp Rossak , Rob Herring , Mark Rutland , Jonathan Cameron , Quentin Schulz , Icenowy Zheng , linux-iio@vger.kernel.org, devicetree , linux-sunxi , linux-kernel , linux-arm-kernel Subject: Re: Allwinner SID THS calibration data cell representation? Message-Id: <20190221111017.f3be5d56b419d9b90876b4c2@bidouilliste.com> In-Reply-To: References: <20180830154518.29507-1-embed3d@gmail.com> <20180830154518.29507-28-embed3d@gmail.com> <20180904184623.e4386b8e6b657b1b25e90c09@bidouilliste.com> <55579dd6-625d-e71b-1482-4592dccac665@gmail.com> <20180906115114.inc6dhqhy47obo25@flea> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 19 Feb 2019 15:54:00 +0800 Chen-Yu Tsai wrote: > Sorry for resurrecting an old discussion, but since someone posted patches > for H5 and H6, I thought we should resolve this. I'm working on patches to > fix / replace the big-endian issue. > > On Thu, Sep 6, 2018 at 7:51 PM Maxime Ripard wrote: > > > > On Thu, Sep 06, 2018 at 01:47:47PM +0200, Philipp Rossak wrote: > > > On 04.09.2018 18:46, Emmanuel Vadot wrote: > > > > > + /* Data cells */ > > > > > + thermal_calibration: calib@234 { > > > > > + reg = <0x234 0x8>; > > > > > + }; > > > > You are declaring 8 bytes of calibration data but to my knowledge it's > > > > only 2 bytes per sensor, so 2 bytes for H3. > > > > Am I missing something ? > > > > > > > > Thanks, > > > > > > Emmanuel you are right, it is 2 bytes per Sensor and should be 2 bytes for > > > H3, but the thermal calibration data field is on all chips 64 bit wide - so > > > 8 bytes. So I'm reading here the complete calibration data field. > > > > Having one cell per channel would make more sense I guess. > > Would it? The 2 32-bit words directly map onto the registers 0x74 / 0x78 in > the THS. As far as the SID is concerned, their is just one consumer for this > data, the thermal sensor. How the thermal sensor uses that data is really not > its concern. And the thermal sensor is really just copying the data from the > e-fuses into its registers. Nothing more. If you see this at the controller lever and not at the sensor level it might make sense to use the full 32bits data even some bits are ignored I guess. > Furthermore, with the register access interface, the e-fuses are read/write > 32 bits at a time. Seems to me it would make more sense to enforce a 32-bit > word size, so cells should be multiples of 32 bits. Ok, honestly at this point I don't really care what choice is done as long as the dts is updated, I'll deal with the diff for FreeBSD and ping the others BSD (Net and Open who also have a driver) for this change. > Regards > ChenYu Cheers, -- Emmanuel Vadot