From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5A336D18136 for ; Mon, 14 Oct 2024 17:22:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:Message-ID:References:In-Reply-To:Subject:Cc:To:From:Date: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=DMmhl3YWDH8vofB+g5MILdfNPylqUE7QKhzS8Ir96FA=; b=iHoFq//1MSgRgdI8a93dRcfRBf gATrjN0/abFmqBvVR6IuT/XlrxxpnWLXg9h0I4/RoRhwLEl9oA6Eku2Av/DSnBKJReJaEl64Yq3th pJKGwmnq2grVvEhBHgCh8ctIJMJbYjnes4C3uIFL7WKJbc7H2eCJozSac5NPlsEi5VOOxY9IXvxmv vLvwXPGTgxWNhDUDK5Yd4nicmOVqv8tw30Py3I4uQa/Ys1iysjlMzl8WsgFL3WGHatzL915HjEs88 Cy0WuewqOEfIC1ApzQs4gKG8NYTUKYpiDhJiK7cc7pJaBJL9V3KvT3xN8ypnTzEkJWB3Vp99ASiFx LVupM77g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0OmE-000000062L7-2MH4; Mon, 14 Oct 2024 17:22:38 +0000 Received: from mail.manjaro.org ([116.203.91.91]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0Oko-0000000627J-2K52; Mon, 14 Oct 2024 17:21:12 +0000 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=manjaro.org; s=2021; t=1728926467; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DMmhl3YWDH8vofB+g5MILdfNPylqUE7QKhzS8Ir96FA=; b=Dt9B/1inCbY/jL4CbneOqgJgO1lvlKErqgPAv6N8cGE0ie7Vc1ogSnVrlPaoOvT9hV8kHL d7/lm1AYWn0pNbK0RINWwVX/p/IvcsyvqII2P5/DqO1YCHMwH4WNSPmKO8y0547q4lp4GW i+jrLMpsa1LdbEDuF38HVP3jzMTisHYe6wtGmGh+T/BHkHmQiklgdwzIWK97XCi2UrCnEC C92iQ7Qp50f4AOWKywy4Ne2m2F9dSsgW+uwYgE78cgLkIwAcspQ4P9iuEdj/m2al8nIkIx I7FCvPOjIAFgZdF2NjgaUcrwv7ReCbs+4sICvx2JybU5WFt0/nGiyP9phpwOXQ== Date: Mon, 14 Oct 2024 19:21:07 +0200 From: Dragan Simic To: Quentin Schulz Cc: Heiko Stuebner , linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Quentin Schulz , Klaus Goger Subject: Re: [PATCH v2 06/14] arm64: dts: rockchip: Remove #cooling-cells from fan on Theobroma boards In-Reply-To: <64ad124d-ac39-4d44-8117-9467f1e7472e@cherry.de> References: <20241008203940.2573684-1-heiko@sntech.de> <20241008203940.2573684-7-heiko@sntech.de> <3fe3561f1839ed17dfa74ba0a408482d@manjaro.org> <4f8a87da-76b1-4fa6-8755-5dbf10bfd74e@cherry.de> <64ad124d-ac39-4d44-8117-9467f1e7472e@cherry.de> Message-ID: <57031b70ebef4e795c5386021f32fe7d@manjaro.org> X-Sender: dsimic@manjaro.org Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Authentication-Results: ORIGINATING; auth=pass smtp.auth=dsimic@manjaro.org smtp.mailfrom=dsimic@manjaro.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241014_102111_059941_C028C90C X-CRM114-Status: GOOD ( 31.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hello Quentin, On 2024-10-14 18:29, Quentin Schulz wrote: > On 10/14/24 5:49 PM, Dragan Simic wrote: >> On 2024-10-14 17:39, Quentin Schulz wrote: >>> On 10/9/24 9:16 AM, Dragan Simic wrote: >>>> On 2024-10-08 22:39, Heiko Stuebner wrote: >>>>> All Theobroma boards use a ti,amc6821 as fan controller. >>>>> It normally runs in an automatically controlled way and while it >>>>> may be >>>>> possible to use it as part of a dt-based thermal management, this >>>>> is >>>>> not yet specified in the binding, nor implemented in any kernel. >>>>> >>>>> Newer boards already don't contain that #cooling-cells property, >>>>> but >>>>> older ones do. So remove them for now, they can be re-added if >>>>> thermal >>>>> integration gets implemented in the future. >>>>> >>>>> Fixes: c484cf93f61b ("arm64: dts: rockchip: add PX30-µQ7 (Ringneck) >>>>> SoM with Haikou baseboard") >>>>> Fixes: d99a02bcfa81 ("arm64: dts: rockchip: add RK3368-uQ7 (Lion) >>>>> SoM") >>>>> Fixes: 2c66fc34e945 ("arm64: dts: rockchip: add RK3399-Q7 (Puma) >>>>> SoM") >>>>> Cc: Quentin Schulz >>>>> Cc: Klaus Goger >>>>> Signed-off-by: Heiko Stuebner >>>>> Reviewed-by: Quentin Schulz >>>> >>>> Looking good to me, thanks for the patch.  In addition to the >>>> amc6821 >>>> driver currently not supporting full integration into the thermal >>>> framework, the "fan" DT node also isn't referenced in any cooling >>>> map, >>>> so having it define the "cooling-cells" property is of no use. >>>> >>>> By the way, it would be nice to see the amc6821 driver supporting >>>> fan >>>> speed regulation, and test it to check who does a better job when it >>>> comes to cooling and fan speed regulation, the thermal framework or >>>> the chip's built-in logic. :) >>> >>> Wasn't this feature added this summer by Guenter? >>> >>> c.f. https://eur02.safelinks.protection.outlook.com/? >>> url=https%3A%2F%2Fgit.kernel.org%2Fpub%2Fscm%2Flinux%2Fkernel%2Fgit%2Ftorvalds%2Flinux.git%2Fcommit%2Fdrivers%2Fhwmon%2Famc6821.c%3Fid%3Dbecbd16ed2f8f427239ffda66b5d894008bc56af&data=05%7C02%7Cquentin.schulz%40cherry.de%7C6df77e4e73434d36a6fd08dcec67c21c%7C5e0e1b5221b54e7b83bb514ec460677e%7C0%7C0%7C638645177611948235%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=4VaZrAKxDUTdEf7avUM1ewHLl9PIgBple841dE55o4w%3D&reserved=0 >>> >>> Mode 4 is >>> https://eur02.safelinks.protection.outlook.com/? >>> url=https%3A%2F%2Felixir.bootlin.com%2Flinux%2Fv6.11.3%2Fsource%2Fdrivers%2Fhwmon%2Famc6821.c%23L367&data=05%7C02%7Cquentin.schulz%40cherry.de%7C6df77e4e73434d36a6fd08dcec67c21c%7C5e0e1b5221b54e7b83bb514ec460677e%7C0%7C0%7C638645177611979168%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=uNnWR0Oux0BlNhpe20Xj4%2FEtGQJv%2FsU1hapm4fGn7Qk%3D&reserved=0 >>> ([FDRC1:FDRC0] = [01] -> Software-RPM Control Mode (Fan Speed >>> Regulator) according to the datasheet). >> >> Ah, SENSOR_DEVICE_ATTR_RW(fan1_target, fan, IDX_FAN1_TARGET)... >> How did I miss that?  Hmm...  Maybe I was looking at some older >> local branch, which happened not to include that commit. >> >> Anywyay, good to know, thanks. >> >>> In any case, we cannot compare those for our products as we do not >>> have a genuine AMC6821 but a handmade simulation of the IP we run in >>> an MCU. >> >> I seem to remember your MCU that performs a few tasks, back from >> some related discussions.  I wonder what was the reason to implement >> it in software, instead of using actual fan controller chip? > > This predates my joining the company, so... I don't know. > > What I can say is, we have the following emulated in the MCU: > - custom CAN over USB (UCAN; upstreamed already) > - ISL1208 RTC > - AMC6821 FAN controller > - custom PWM controller (upstreaming pending) > - a few bytes of NVRAM (AT24-based; upstreaming pending) > - uncontrollable (from SoC PoV) watchdog, allows another MCU/system to > trigger a full system reset > - possibly, custom HW watchdog controllable over I2C (required to fix > a very odd corner case in HW on PX30 Ringneck) Nice, that's quite a lot of emulated stuff. > Possibly more if we have the need for it and it fits into the MCU flash > :) That's one of the benefits that come with an approach like this. It's like some kind of PaaS (or whatever is the "cool" thing these days) for hardware design. :) > I assume this was born out of necessity to add support for CAN on > RK3399 Puma since there's no CAN controller inside the SoC? Could be, and the additional functionality, also required for the board, was then just "offloaded" to the same MCU. > I also think ISL1208 and AMC6821 aren't that easy to source anymore > (RK3399 Puma has that MCU and its support started in ~2018 I seem to > recall?). Considering the quantities and prices we get for the two > MCUs flavors we have and how space constrained we are on some > products, especially the uQ7 (PX30 Ringneck), it was probably I wise > decision. The second MCU flavor came because STM32 was impossible to > source at reasonable prices during the shortage 2-4 years ago. Makes sense. Instead of two or more separate additional chips, whose availability can change at virtually any point, you now depend on a single additional chip, which is also, presumably, more widely used, so should be easier to source. > This also means we can expand the set of features over time (which we > are for example, with the custom PWM controller, NVRAM and I2C > watchdog) since the MCU can be flashed once in the field too. Yup, just like PaaS, SaaS or whatever. :) > Obviously, you replace component cost and footprint with MCU FW > development, so it's not necessarily cost-efficient but I'm not the > one running the numbers so wouldn't be able to tell you ;) Also good point. Additional standalone chips are sometimes less expensive than the equivalent manpower. :)