From owner-freebsd-arm@freebsd.org Mon Jul 29 19:52:24 2019 Return-Path: Delivered-To: freebsd-arm@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B0F4DB3F5D for ; Mon, 29 Jul 2019 19:52:24 +0000 (UTC) (envelope-from filippo@ml.filippo.io) Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) (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 095366A1FC for ; Mon, 29 Jul 2019 19:52:22 +0000 (UTC) (envelope-from filippo@ml.filippo.io) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 0D9484A8 for ; Mon, 29 Jul 2019 15:52:14 -0400 (EDT) Received: from imap1 ([10.202.2.51]) by compute3.internal (MEProxy); Mon, 29 Jul 2019 15:52:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=filippo.io; h= mime-version:message-id:date:from:to:subject:content-type; s= fm1; bh=pudGjTbg1M5n1eJIFRcKUXii8Df/Wm3lbRLsZpkzxSg=; b=j8Ca7cYR AbZ7LWaTYRnjALI/20coVIJ4e20Xpe34XH7z2qjROHoHm2K1qWm+FC4pyV6+5PrU JVLMnvHGObKA5dMyaXYwJWQP/nvbmLfcNYLM+1bV4Tgfm5vt+AiEmQPIqBSsgeeD ek8AhOw0cjrzx9b31l5ocZRTU0WvH7qwkbStlLVhLmD/PJODrZCDT0klIAmIuhfi kx0FCPeGIN9F5iOv5sDp8cFIs3oJHcAyOXeB1H5atTtoAE90msO4Rsk4yZM0QL+k Ao+S680MsFEr9vx3Yha2mGys1KPPsjkcl9nHH2G8o+of5Ezd5ItTRj1j3ozAwio/ 1ZGFnsER64W5hA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=pudGjTbg1M5n1eJIFRcKUXii8Df/W m3lbRLsZpkzxSg=; b=DAPNoM6xwgcN1QaiqUejl8Kl+zOz9ERgD+vRGex8BpJTk MjUwwhwLav/Wnrl07Un7Re4cEkHB5xpwV4PkttOSFnv8JATtMQaS5GjjmRoMgDBH XHlQhKVAQgLTd43PrPPUWtneB1lXS2HQu4aZw+3dojoFDyg2p8UuoJlSQzI7a7S/ yua/9K+/MgvMyNXvudi5v8Ovh2kyuRDYwrJJ7oCcPQTzOEJwLXUD1jQVKCgqyWF/ gTvSdNNuDlXHLICQOn58FEexny/sALWhmxvVpJWN0fM8yK6/y1m5oFnSgpaDdueC rWXUxSToBW8Oj7aLlk56qSGwzsBC8dw+oDnXBe4Hg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrledugddugeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfffhffvufgtsehttdertd erredtnecuhfhrohhmpedfhfhilhhiphhpohcugggrlhhsohhruggrfdcuoehfihhlihhp phhosehmlhdrfhhilhhiphhpohdrihhoqeenucffohhmrghinhepghhithhhuhgsrdgtoh hmpdhkohgsohhlrdhiohenucfrrghrrghmpehmrghilhhfrhhomhepfhhilhhiphhpohes mhhlrdhfihhlihhpphhordhiohenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 12D4CC200A4; Mon, 29 Jul 2019 15:52:14 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.1.6-736-gdfb8e44-fmstable-20190718v2 Mime-Version: 1.0 Message-Id: <5dfec78c-9a41-4e01-8834-ec0178f1ac9d@www.fastmail.com> Date: Mon, 29 Jul 2019 21:49:57 +0200 From: "Filippo Valsorda" To: freebsd-arm@freebsd.org Subject: PWM fan control on Helios4 (Marvell ARMADA 388) Content-Type: text/plain X-Rspamd-Queue-Id: 095366A1FC X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=filippo.io header.s=fm1 header.b=j8Ca7cYR; dkim=pass header.d=messagingengine.com header.s=fm3 header.b=DAPNoM6x; dmarc=pass (policy=none) header.from=ml.filippo.io; spf=pass (mx1.freebsd.org: domain of filippo@ml.filippo.io designates 64.147.123.24 as permitted sender) smtp.mailfrom=filippo@ml.filippo.io X-Spamd-Result: default: False [-6.56 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; R_DKIM_ALLOW(-0.20)[filippo.io:s=fm1,messagingengine.com:s=fm3]; XM_UA_NO_VERSION(0.01)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:64.147.123.24]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arm@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_TRACE(0.00)[filippo.io:+,messagingengine.com:+]; DMARC_POLICY_ALLOW(-0.50)[ml.filippo.io,none]; MX_GOOD(-0.01)[in2-smtp.messagingengine.com,in1-smtp.messagingengine.com,in2-smtp.messagingengine.com,in1-smtp.messagingengine.com,in2-smtp.messagingengine.com,in1-smtp.messagingengine.com]; NEURAL_HAM_SHORT(-0.99)[-0.987,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:64.147.123.0/24, country:US]; IP_SCORE(-3.48)[ip: (-9.77), ipnet: 64.147.123.0/24(-4.88), asn: 11403(-2.70), country: US(-0.05)]; MID_RHS_WWW(0.50)[]; RCVD_IN_DNSWL_LOW(-0.10)[24.123.147.64.list.dnswl.org : 127.0.5.1] X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2019 19:52:24 -0000 I am running FreeBSD 12.0-GENERIC-350203 on the Helios4, a Marvell ARMADA 388 board. The device tree has two PWM GPIO fans https://github.com/Artox/crochet/blob/4d40896f182ad704e23dd55c31290f5859145483/board/Clearfog/files/armada-388-helios4.dts#L133-L141 but it doesn't look like the OS can see them at all, and they spin at full speed. Here's the full sysctl. https://gist.github.com/FiloSottile/5a44f2fd0bacb44b4120b1f5c6828583 Interestingly, the Linux DTS has different pwms parameters, but I couldn't find documentation on what they are. https://github.com/torvalds/linux/blob/2a11c76e5301dddefcb618dac04f74e6314df6bc/arch/arm/boot/dts/armada-388-helios4.dts#L123 The Helios4 PWM circuits seem very well documented, at least. https://wiki.kobol.io/pwm/ I would like to be able to slow the fans down. Runtime changes or adaptive behavior are a plus, but I'd be also happy with setting them at a fixed duty cycle. What docs should I look at? Has anyone tried this? What are my options, short of a hardware controller? Thank you, Filippo (Please keep me CC'd.)