From: Alexandre P. N. <al...@om...> - 2005-12-16 21:08:05
|
Kenneth Appleman escreveu: >Dave - Thanks for your answer. > >The gumstix could definitely be put into a low power mode for most of the >night. It only has "work" to do for approximately one hour. However, it >isn't clear to me how I do that. I see that the PXA-255 chip has several >low power modes -- is there a way to trigger these from an application >running under Linux on the gumstix? What will happen when the device wakes >up? > >If anyone has any knowledge/experience with this, I'd appreciate hearing >about it. > >Ken Appleman >Lighting Research Center > > I won't enter the subject of idle state management, whether internally or external hardware aided, because I have done no tests with this, but I'll tell what I'm doing here. I compiled the kernel with cpufreq option enabled (I can't remember the steps by memory, but I think there are some tips on how to do that on the list or on the wiki), and turned the 'userspace' governor the default one (I guess I even compiled it in, instead of a module). Then, you can put a bootscript or whatever to do the equivalent to this: ## START cd /sys/devices/system/cpu/cpu0/cpufreq/ # this allows cpufreq to slow down the cpu clock cat cpuinfo_min_freq >scaling_min_freq ## END Them, when your program is not doing any task, you can switch the cpu speed to the minimum available by doing: ## START # Note I'm assuming current directory being /sys/devices/system/cpu/cpu0/cpufreq for the examples cat cpuinfo_min_freq > scaling_setspeed ## END And now when you need to do some heavy work, you can set the cpu back to normal speed i.e. by doing: ## START cat scaling_max_freq > scaling_setspeed ## END And that would be it. The expected power consuption for a gumstix in low speed mode without periferal would be about 15 ~ 20ma when idle and about 40ma when doing heavy work (I did these measurements quite a time ago and I'm not sure they're accurate, but should be not too far). I have tried with this for quite some time with no problems reported, but if you do switch the speeds too often or when using the periferals (compact flash, sound, serial, almost anything; see the pxa255 cpu errata docs) too much, them you theoretically could trigger a bug on the pxa cpu which could render some periferals unusable. I do change the speeds when using anything but the serial port, so maybe I never spotted this but your mileage may vary. I would say it worths the try, at least it did for me :-) Alexandre P.S..: Note that you could set scaling_max_freq to the value in cpuinfo_max_freq on the boot, which would allow you to overclock your gumstix to 500mhz (if you are using the 400mhz, not sure if the 200mhz has this "feature"), but of course the risk is all yours if you try (I've been trying for a while for no serious reason and have found it works quite well, though power consuption increases accordingly, as expected). P.S.#2.: The average power consuption may or may not be (one would have to try to check it out) decreased quite a bit if you reduce the kernel timer clock interrupt rate (search for HZ on the mailing list archive, that should give you something), by default it's 100hz I guess, if you're only running an app without real-time needs you could try 10hz. There was also a patch that eliminated the clock timer by scheduling a interrupt wake-up on a by-demand basis, I think it was merged in on 2.6.13 kernel but didn't work for the pxa yet, but I'm not sure. |