[Macchiato] Fan control

Matt Sealey neko at bakuhatsu.net
Fri Apr 6 23:39:38 BST 2018


You understood correctly.

Having software toggle a GPIO fast enough to effect PWM would be highly
processor intensive. that would heat the package meaning running the fan
faster, you’ll make yourself a nice feedback loop!

There is a thermal diode and a way to calibrate and use it since U-Boot
reports it and I can see the temp in sysfs (it reacts to the diode on my
case fan speeding up the case fan and moving more air...).

I’m just not sure you could do a lot with it just being a GPIO, the only
clock-like function for that pin is the MDIO clock for one of the Ethernet
PHYs - if you can prove that same clock is not exported, though, you could
use clock management to do what you want. MDIO clocks aren’t fast though,
so it may be the difference between full off, very slow rpm (if the fan
supports that range of duty cycle) and full on, not a nice
temperature-controlled swing.

Ta,
Matt

On Fri, Apr 6, 2018 at 16:26 Duncan <dguthrie at posteo.net> wrote:

> Hello Matt,
>
> Matt Sealey:
> > According to the schematics it's on CP0_MPP48 which I do not believe
> > is touched by anything in EFI or Linux. There's no I2C to require,
> > just I assume an ability to multiplex something useful on that pin -
> > pinctrl driver remarks that it's got GPIO and I'm fairly sure the 8040
> > doesn't even have any PWM functionality (unless you count the TDM, you
> > could play with the frame sync..)
> >
> >
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/pinctrl/mvebu/pinctrl-armada-cp110.c#n466
> >
>
> So as far as I understand from your reply, the PWM pin is wired up, but
> that the SoC itself doesn't have native PWM functionality built-in?
>
> > But what you've got here is a potential for a GPIO - on or off - or
> > the MDIO clock for 'XG' which probably means losing an ethernet port
> > since you can't clock the PHY and use it for PWM.
> >
> > You could write a driver that took a rapid firing timer event to
> > change the GPIO state, but that'd probably consume enough power and
> > reduce idle state residency enough to only make matters worse.
>
> Let's say I wrote a driver that could interface with this pin, and I was
> able to control fan speed this way (if this is possible). Does the
> Armada 8040 SoC have any infrastructure for detecting its temperature,
> and the temperature of other parts of the board?
>
> My main goal here is to allow me to vary the fan speed of the
> side-blowers in the case I'm using; it seems like a terrible waste of
> power to have them on at full speed, given the board is going to be idle
> quite a lot, and even at high load probably doesn't need the fans at
> full speed.
>
> All the best, and apologies in advance if I misunderstood your reply,
> Duncan
>
> _______________________________________________
> Macchiato mailing list
> Macchiato at lists.einval.com
> https://lists.einval.com/cgi-bin/mailman/listinfo/macchiato
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.einval.com/pipermail/macchiato/attachments/20180406/420ae141/attachment.html>


More information about the Macchiato mailing list