From owner-freebsd-arm@freebsd.org Tue Oct 25 15:12:21 2016 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E053C21A58 for ; Tue, 25 Oct 2016 15:12:21 +0000 (UTC) (envelope-from jmcneill@invisible.ca) Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [IPv6:2001:4b98:c:538::195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 15D41256 for ; Tue, 25 Oct 2016 15:12:21 +0000 (UTC) (envelope-from jmcneill@invisible.ca) Received: from mfilter47-d.gandi.net (mfilter47-d.gandi.net [217.70.178.178]) by relay3-d.mail.gandi.net (Postfix) with ESMTP id 79492A8125; Tue, 25 Oct 2016 17:12:19 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter47-d.gandi.net Received: from relay3-d.mail.gandi.net ([IPv6:::ffff:217.70.183.195]) by mfilter47-d.gandi.net (mfilter47-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id owkQEWU0t8tv; Tue, 25 Oct 2016 17:12:17 +0200 (CEST) X-Originating-IP: 142.163.95.249 Received: from dis (stjhnbsu1kw-142163095249.dhcp-dynamic.FibreOP.nb.bellaliant.net [142.163.95.249]) (Authenticated sender: jmcneill@invisible.ca) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id E605BA80DB; Tue, 25 Oct 2016 17:12:16 +0200 (CEST) Date: Tue, 25 Oct 2016 12:12:15 -0300 (ADT) From: Jared McNeill To: Milan Obuch cc: freebsd-arm@freebsd.org Subject: Re: aw_thermal breakage on Allwinner H3 SoC In-Reply-To: Message-ID: References: <20161024165820.16e6dd6f@zeta.dino.sk> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-456550499-1477408337=:641" X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Oct 2016 15:12:21 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-456550499-1477408337=:641 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Does this patch help? It uses the same values as the BSP for sun8iw7p1 found here: https://github.com/friendlyarm/h3_lichee/blob/master/linux-3.4/drivers/thermal/sunxi-temperature.c#L1287 With this patch my NanoPi NEO shows around 39C when idle. Cheers, Jared On Tue, 25 Oct 2016, Jared McNeill wrote: > Hi Milan -- > > There appears to be an inconsistency between the temperature conversion > formula in the H3 datasheet and the BSP. I'm looking into it.. > > Cheers, > Jared > > > On Mon, 24 Oct 2016, Milan Obuch wrote: > >> Hi, >> >> today I svnup'ped sources for 12-CURRENT I use to test on Orange Pi One >> to svn revision 307846 and there was no aw_thermal device anymore. >> After some fiddling I found reason is in aw_sid.c, namely in function >> aw_sid_read_tscalib. I managed to get it working, somehow, giving the >> patch in attachment. This way "sun8i-h3-sid" is defined and attaches, >> which in turn makes aw_thermal attached and working, a bit. >> >> Almost identical patch, without the last chunk was necessary in past, >> but now behavior changed a bit - namely, sysctl dev.aw_thermal.0.cpu >> shows 99C right after start, now, running for almost six hours idle, >> 100C. This is surely wrong. SoC is not that hot given I can put my >> finger on it without risk of being immediatelly burned. Before this >> change it showed some 49 degrees right after power on and rises slowly >> up to 60 - 63 degrees. This values were not correct, too, temperature >> is maybe 45 degrees or so according to my finger integrated >> thermometer :) >> >> Did anybody test this on H3 based board? If yes, is there anything >> special to be put into FDT definition file? >> >> Has anybody a clue what's going on? If someone has an idea what to >> check, I am ready to check it, but currently have not much experience >> with sensors in SoC. >> >> Regards, >> Milan >> > _______________________________________________ > freebsd-arm@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-arm > To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org" > > --8323329-456550499-1477408337=:641 Content-Type: TEXT/x-diff; name=aw_thermal.patch Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=aw_thermal.patch ZGlmZiAtLWdpdCBhL3N5cy9hcm0vYWxsd2lubmVyL2F3X3RoZXJtYWwuYyBi L3N5cy9hcm0vYWxsd2lubmVyL2F3X3RoZXJtYWwuYw0KaW5kZXggYjM2ZGUx YS4uODk4NmRjZiAxMDA2NDQNCi0tLSBhL3N5cy9hcm0vYWxsd2lubmVyL2F3 X3RoZXJtYWwuYw0KKysrIGIvc3lzL2FybS9hbGx3aW5uZXIvYXdfdGhlcm1h bC5jDQpAQCAtMTA4LDkgKzEwOCw5IEBAIF9fRkJTRElEKCIkRnJlZUJTRCQi KTsNCiAjZGVmaW5lCUgzX0FEQ19BQ1FVSVJFX1RJTUUJMHgzZg0KICNkZWZp bmUJSDNfRklMVEVSCQkweDYNCiAjZGVmaW5lCUgzX0lOVEMJCQkweDE5MTAw MA0KLSNkZWZpbmUJSDNfVEVNUF9CQVNFCQkyNzk0MDAwDQorI2RlZmluZQlI M19URU1QX0JBU0UJCTE3OTQwMDANCiAjZGVmaW5lCUgzX1RFTVBfTVVMCQkx MDAwDQotI2RlZmluZQlIM19URU1QX0RJVgkJLTE0ODgyDQorI2RlZmluZQlI M19URU1QX0RJVgkJLTgyNTMNCiAjZGVmaW5lCUgzX0NMS19SQVRFCQk0MDAw MDAwDQogDQogI2RlZmluZQlURU1QX0NfVE9fSwkJMjczDQo= --8323329-456550499-1477408337=:641--