Power Management of iPAQ Sukjae Cho


Published on

  • Be the first to comment

  • Be the first to like this

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Hi. My name is Sukjae Cho and this is my e-mail address in ISI and this is the e-mail account in my university. I worked for two months in ISI as a winter intern. Now, I’ll report briefly what I did during this intern period. I worked for the power management project of iPAQ, which includes reducing power consumption and implementing sleep/wake-up.
  • First I’ll tell you about iPAQ. And I’ll tell you the previous status of power management of linux on ipaq and what I did for the power management of iPAQ. And I’ll say more about the sleep mode of iPAQ which was not supported before. Finally I’ll introduce a very simple tool that I wrote.
  • As many of you have seen, this is iPAQ. iPAQ is a powerful handheld computer rather than a simple PDA. It has a fast CPU, high-resolution display and most important point is that it has large expandability. We can connect PCMCIA card to the iPAQ!!.. The expansion pack is the reason why the iPAQ is so popular.
  • Currently the iPAQ linux has some problems to use as a simple PDA. But there are many projects are going on and I am sure that the iPAQ will be more powerful than any other handheld device as long as the other devices use Windows CE. Because the ARM binaries for other arm platform can be run on ipaq without modification, iPAQ has already lots of application. But it has limited display resolution and input method, so many peoples are working for iPAQ more useful. These are the screen shots of iPAQ.
  • Now I’ll talk about power management of iPAQ First I’ll show how much power is consumed by iPAQ and the previous power management status of linux on iPAQ And I’ll show you what I found to reduce power of iPAQ
  • This is the simplified graph of the power usage of components in iPAQ. Because I can’t pull off the chips from the iPAQ so I just measure the power consumption of each device by turning it off using software method First, note that this(etc) part includes every part that is not shown here, such as CPU, flash memory and many other chips. Each part uses various range of power according to how they are used, so what I represented here is not correct in many cases As you can see, front light consumes much power and usually IrDA, Audio, RS232 is off, so the fraction of the front light is very big. So don’t use front light or lower the brightness if you want use iPAQ for a long time.
  • Now I’ll talk about the previous work in iPAQ power management. These are works that I didn’t do. But I want to speak about this because you may get some hints from these works. SA1100 series CPU has a special coprocessor instruction that can stop clock to arm cpu core. This mode is called idle mode and in this mode, CPU does not execute any instruction until it gets interrupt request. So this mode greatly reduces power consumption of CPU. If you use linux, you don’t need to care about it because it is already well-implemented. But if you want to use other OS and want to port it to Strong Arm, be sure to check this. And another tweak for reducing power consumption of iPAQ is turning off chips that is not in use. iPAQ can turn on and off many other chips by controlling I/O pins, so we can turn off them if we don’t use them. But just turning off them is not enough. We need to maintain al CPU output to that chip low. This was also large source of power consumption. And the screen saver is one method to reduce power consumption. One more major power reduction method is to lower CPU clock. SA1110 clock can be varied from 57.3MHz to 214.8MHz only by setting some registers. But there is no method to change the voltage of CPU in current iPAQ. So actually I expected there would be little benefit from reducing cpu clock because there is no voltage scaling, but clock scaling actually saves much power. I’ll talk about this later. BTW the time to change the clock takes about 150ms and this is too long time to be changed on the fly. So I thought it would not be a good idea to change clock dynamically. But it looks like that there is method to fix this.
  • I measured the power consumption of the iPAQ in various condition. And I’ll show one example of the power consumption. If we think the condition that we are using iPAQ to read some text without front light. In this condition, no other chips are active and only CPU, LCD and memories are running but it consumes 470mW and it can last about 8 hours in this condition. But Windows CE can last almost 2 times more in the same condition. And if you use front light also, it only last 4 hours. And one more big problem in iPAQ linux is that it can go to sleep mode but can’t wake up from it. WinCE uses sleep mode of SA, so it can last a long time if it is in the sleep mode. But in linux there were no support for sleep mode. Before going to next page I should say one thing. I learned the method to measure the power consumption from someone in compaq but I guess there is a problem that the values that I measure is larger than actual value. As a example, the iPAQ specification says iPAQ uses 960mAh battery, but I measured that it can last 8 hours consuming 470mW, that is, it consumed 3760mW. I think one of two is incorrect.
  • Enabling SDRAM auto power down mode of SA1110 saves much power of iPAQ. This is very simple fix but there was no code for this in the current iPAQ linux distribution. In this mode CPU stops clocking to SDRAM when it does not use it. Actually this is the main reason why the linux consumes much more power than Windows CE. And I also trying to find other methods to reduce power consumption. One day I found that LCD is updated about at 60Hz. This rate is too high to LCD and because TFT LCD is not so fast to react at this rate, I think. So there is no problem if we reduce this rate to any lower value. And we can also disable LCD controller when there is no change in screen because the LCD remains still for several seconds without refreshing. But someone said this method may harm the LCD. Anyway both method requires changes in X server and user application because kernel cannot know when the display changes or when the lower refresh rate is enough for current application. So this method can be used at only my kernel and is not yet included in the public source.
  • CPU-scaling on strong arm processor was already done by someone else. And I just tested it on the iPAQ and how it affects the power consumption of iPAQ. If we runs CPU at 57.3 MHz, it saves about 100mW to 200mW of power according to condition. Lowering CPU clock reduces some CPU power. And all other components whose clocks are derived from CPU clock such memory, LCD controller consumes less power when it does not use. As I said, I expected that there would be little benefit from reducing cpu clock because there is no method to change power voltage level. But actually it saves much power. I guess that reason is that reducing CPU clock reduces LCD refresh rate and other periodic actions taking place on iPAQ.
  • Now I’ll show the result of power reduction of iPAQ after some changing. On the condition where the LCD is on and most other chips are off, Previous linux on ipaq consumes 470mW. But after enabling SDRAM power down mode, it consumes 280mW. After reducing the refresh rate it consumes 238mW, and if we change the clock to the lowest level it consumes 172mW. On the while, WinCE on iPAQ consumes about 248mW of power. This value can be comparable to 280mW or 238mW in linux. The power consumption difference between WinCE and linux is not so big in normal status, but we can do more trick to ipaq if we want. if we use linux we can turn off the LCD alone without turning off ipaq itself and change the CPU clock speed to reduce the clock. We can reduce the power consumption of iPAQ at the level of 100mW if we try.
  • Now I’ll talk about the sleep mode of iPAQ Sleep mode may be the part of the power management but I just pull them out of power management part to say in more detail level.
  • First I’ll say about the previous work of sleep mode. There were already some works related to sleep/wake-up on the strong-arm platform. Itsy is the research prototype of handhelds device of compaq. This device uses SA1100 processor and it fully support sleep & wake up. There is another PDA that has linux and support sleep/wakeup. It is called yopy. It uses sa1110 processor and its kernel & bootloader support sleep/wakeup. But the sleep/wakeup code of yopy did not work on iPAQ. I guess that yopy uses cpu that do not have SA1110 sleep bug. I’ll talk it about this later. Some device drivers have suspend/resume code conforming to the power management interface of the 2.4.0 linux kernel. And linux kernel has some APM related frameworks. But the arm linux kernel does not support sleep/wakeup at all and bootloader used by ipaq did not support the sleep/wakeup also. To make ipaq sleep/wakeup, I changed the bootloader and kernel using the Itsy and Yopy’s code as a refrerence. I’ll talk about this in the next page.
  • First I changed bootldr to support sleep/wakeup of linux kernel. Changing the bootloader to support sleep/wakeup may be not so big work. Because there were already working bootloader for other arm boards. The problem was that unstable bootloader can make the iPAQ unusable, so other people did not tried to change the bootloader. Of course people in compaq can do it, but they seem to be busy to do this. So I tried to change the bootloader and managed to modify the bootloader to support sleep/wakeup with the help of Compaq guy. These three tasks are all the work should be added in bootloader. Just check sleep reset, initialize SDRAM and jump to the kernel.
  • After modifying bootloader, I changed the kernel to support sleep/wakeup and tested it. Because there were already sleep&wakeup code for arm linux, it looked like that it would be easy. But there were CPU bugs in entering sleep mode, so I wasted some days to find method to avoid them. Fortunately someone announced the way and I added some more fixes to his work in order to make his code work also in iPAQ These are the works that are done when the kernel enters sleep mode and this is works that are done when wake up. And I fixed suspend/resume code of these device drivers. Some drivers had suspend/resume code before there is sleep/wakeup but some of them did not work correctly, so I fixed these drivers.
  • This is to do list for the power management of iPAQ. We need to test and fix more device drivers’ suspend/resume code. And we can add more method to reduce power consumption of iPAQ. I thought the automatic clock adjustment is not so useful, because I thought it requires some time to change clock and it would not save much power. But I found that we can benefit from clock changing after a experiment, and I got an idea to change the clock without much transition time. If we can do this, we surely beat the WinCE I found some ways to reduce power consumption, but some of them is not actually integrated into the kernel yet. Because it requires user application’s interaction to kernel, I don’t have enough time and experience to handle this. Maybe I can do it after sometime. And I found some points to fix the scaling code and display driver. But I didn’t do it yet. And we need to add some more features to power down mode. Besides simple sleep mode, we can add alarm sleep mode that wakes up iPAQ at user-specified time. We can think about the slow-running mode that cpu clock is low. And we can add the mode that turn offs screen only, that we can hear music or record sound using iPAQ. These are easy to add this feature to linux kernel, but selecting user interface to this kernel feature is more important. Yesterday I thought the delay loop can be calculated for all possible frequencies at boot time and the time cost for changing frequency will be very small.
  • Finally I’ll introduce a simple arm linux module that I wrote. Using this module, you can read and write most special registers in SA1100 on the shell prompt. This module’s code is very simple, but this was very useful to me. I hope you may use this one, too.
  • And thank you, Carl for answering many questions about linux and ipaq. Thank you dong-in for helping me survive in USA. Thank you Brian, for inviting me to ISI And thank you Chris, for helping me office works. And final advertisement…. I am a first year in master course in Real-time operating system lab of seoul national university. Our lab has our own real-time operating system called ARX. And my laboratory are very willing to co-work with ISI if you have any tasks related to real-time operating system.
  • Power Management of iPAQ Sukjae Cho

    1. 1. Power Management of iPAQ Sukjae Cho ( sjcho @east. isi . edu ) ( sjcho @redwood. snu .ac. kr )
    2. 2. Agenda <ul><li>About iPAQ </li></ul><ul><ul><li>What’s iPAQ </li></ul></ul><ul><ul><li>Linux on iPAQ </li></ul></ul><ul><li>Power management of iPAQ </li></ul><ul><li>Sleep mode of iPAQ </li></ul><ul><li>SA-1100 register monitor </li></ul>
    3. 3. What’s iPAQ <ul><li>Powerful handheld computer </li></ul><ul><ul><li>206MHz StrongArm SA-1110 processor </li></ul></ul><ul><ul><li>320x240 resolution color TFT LCD </li></ul></ul><ul><ul><li>Touch screen </li></ul></ul><ul><ul><li>32MB SDRAM / 16MB Flash memory </li></ul></ul><ul><ul><li>USB/RS-232/IrDA connection </li></ul></ul><ul><ul><li>Speaker/Microphone </li></ul></ul><ul><ul><li>Lithium Polymer battery </li></ul></ul><ul><ul><li>PCMCIA card expansion pack & CF card expansion pack </li></ul></ul>
    4. 4. Linux on iPAQ <ul><li>Modification based on arm linux kernel 2.4 </li></ul><ul><li>ARMV binaries can run without modification </li></ul><ul><li>Many projects for iPAQ linux are on the work </li></ul>
    5. 5. Agenda <ul><li>About iPAQ </li></ul><ul><li>Power management of iPAQ </li></ul><ul><ul><li>Power usage of iPAQ components </li></ul></ul><ul><ul><li>Previous work </li></ul></ul><ul><ul><li>Tweaks for reducing power consumption of iPAQ </li></ul></ul><ul><ul><li>Improvements </li></ul></ul><ul><li>Sleep mode of iPAQ </li></ul><ul><li>SA-1100 register monitor </li></ul>
    6. 6. Power Usage of Components in iPAQ <ul><li>* Note </li></ul><ul><ul><li>SDRAM power consumption is guessed by setting it self-refresh mode </li></ul></ul><ul><ul><li>CPU is idle state of most of its time </li></ul></ul><ul><ul><li>Audio, IrDA, RS232 power is measured when each part is idling </li></ul></ul><ul><ul><li>Etc includes CPU, flash memory, touch screen and all other devices </li></ul></ul><ul><ul><li>Frontlight brightness was 16 </li></ul></ul>
    7. 7. Previous Work (1/2) <ul><li>Idle loop </li></ul><ul><ul><li>Idle process uses Strong Arm’s idle mode </li></ul></ul><ul><ul><li>In idle mode, CPU stops its clocking and wait for interrupt </li></ul></ul><ul><li>Turning off sound chip </li></ul><ul><ul><li>Turning off power to sound chip when we don’t need it </li></ul></ul><ul><ul><li>Maintain all CPU’s output to sound chip low </li></ul></ul><ul><ul><ul><li> Prevents the sound chip from draining power from CPU’s output pins </li></ul></ul></ul><ul><li>Screen saver </li></ul><ul><ul><li>Turns off LCD and backlight after some time of no user-input </li></ul></ul><ul><li>Scaling down the CPU clock </li></ul><ul><ul><li>SA1110 core clock can be switched from 57.3MHz to 214.8MHz by software </li></ul></ul><ul><ul><li>No voltage change is supported </li></ul></ul><ul><ul><li>Time to change clock takes about 150ms for calibrating delay loop </li></ul></ul>
    8. 8. Previous Work (2/2) <ul><li>iPAQ consumes 470mW if you turn on LCD (no frontlight) and turn off other unused chips </li></ul><ul><ul><li>iPAQ that runs linux consumes 1.9 times more power than iPAQ that runs Windows CE does in this condition </li></ul></ul><ul><ul><li>iPAQ lasts about 8 hours in this condition </li></ul></ul><ul><ul><li>Actual usable time with front light is about 4 hours </li></ul></ul><ul><li>iPAQ linux can sleep but can’t wake up </li></ul><ul><ul><li>WinCE can last a long time in the sleep mode </li></ul></ul><ul><ul><li>Linux should be turned off when you don’t use it </li></ul></ul>
    9. 9. Tweaks for reducing power consumption of iPAQ (1/2) <ul><li>Enable SDRAM auto power down mode </li></ul><ul><ul><li>SA1110 supports SDRAM auto power down mode </li></ul></ul><ul><ul><li>In SDRAM auto power down mode, CPU disables clock input to memory when the memory is not in use </li></ul></ul><ul><ul><li>Saves about 190mW when the memory activity is low </li></ul></ul><ul><li>Tweak in Display Driver </li></ul><ul><ul><li>Reduce refresh rate of LCD </li></ul></ul><ul><ul><ul><li>Current LCD driver refreshes rate is about 60Hz </li></ul></ul></ul><ul><ul><ul><li>Refresh rate can be adjusted by various LCD timing </li></ul></ul></ul><ul><ul><ul><li>We can reduce SDRAM usage, bus usage and power consumption by lowering refresh rate </li></ul></ul></ul><ul><ul><li>Disabling LCD controller when there is no change in screen </li></ul></ul><ul><ul><li>Both method require changes in X server or user applications </li></ul></ul>
    10. 10. Tweaks for reducing power consumption of iPAQ (2/2) <ul><li>CPU-scaling experiment result </li></ul><ul><ul><li>Saves about 100mW ~ 200mW if CPU runs at 57.3MHz rather than 206MHz </li></ul></ul><ul><ul><li>Lowering CPU clock reduce static power consumption of CPU </li></ul></ul><ul><ul><li>Lowering CPU clock reduce other components whose clocks are derived from CPU clock (memory, LCD controller and etc.) </li></ul></ul>
    11. 11. Improvements <ul><li>When LCD is on, most other chips are off and CPU is idle, </li></ul><ul><ul><li>Linux iPAQ consumes </li></ul></ul><ul><ul><ul><li>470mW with previous linux kernel </li></ul></ul></ul><ul><ul><ul><li>280mW with SDRAM power down mode </li></ul></ul></ul><ul><ul><ul><li>238mW with SDRAM power down mode and 30Hz refresh rate </li></ul></ul></ul><ul><ul><ul><li>172mW with SDRAM power down mode and CPU speed 56MHz </li></ul></ul></ul><ul><ul><li>WinCE iPAQ consumes </li></ul></ul><ul><ul><ul><li>248mW </li></ul></ul></ul><ul><ul><li>* Note </li></ul></ul><ul><ul><li>Consumes 460mW more power if the front light is on </li></ul></ul><ul><ul><li>Linux can consume as low as 98mW if it also turns off LCD </li></ul></ul>
    12. 12. Agenda <ul><li>About iPAQ </li></ul><ul><li>Power management of iPAQ </li></ul><ul><li>Sleep mode of iPAQ </li></ul><ul><ul><li>Previous work </li></ul></ul><ul><ul><li>Works done for sleep/wakeup </li></ul></ul><ul><ul><li>More things to do </li></ul></ul><ul><li>SA-1100 register monitor </li></ul>
    13. 13. Previous Work <ul><li>Itsy </li></ul><ul><ul><li>Research prototype of handhelds device of compaq </li></ul></ul><ul><ul><li>Uses SA1100 processor </li></ul></ul><ul><ul><li>Uses kernel based on linux kernel 2.2 </li></ul></ul><ul><ul><li>Kernel and bootloader support sleep/wakeup </li></ul></ul><ul><li>Yopy </li></ul><ul><ul><li>Multimedia PDA. Commercial product is not released. </li></ul></ul><ul><ul><li>Uses SA1110 processor </li></ul></ul><ul><ul><li>Uses kernel based on linux kernel 2.2 </li></ul></ul><ul><ul><li>Kernel and bootloader support sleep/wakeup </li></ul></ul><ul><li>Arm linux kernel 2.4.0 </li></ul><ul><ul><li>Arm linux kernel did not support sleep/wakeup </li></ul></ul><ul><ul><li>Bootloader did not support sleep/wakeup </li></ul></ul><ul><ul><li>Some device drivers support suspend/resume </li></ul></ul><ul><ul><li>Frameworks for APM </li></ul></ul>
    14. 14. Works Done for Sleep/Wakeup (1/2) <ul><li>Bootloader modification </li></ul><ul><ul><li>Bootloader tests whether the cause of reset is the sleep reset </li></ul></ul><ul><ul><li>Bootloader wakeup SDRAM from self-refresh state to normal state </li></ul></ul><ul><ul><li>Bootloader jumps to linux kernel wakeup entry point which is set by kernel </li></ul></ul>
    15. 15. Works Done for Sleep/Wakeup (2/2) <ul><li>Kernel modification </li></ul><ul><ul><li>Enter sleep mode </li></ul></ul><ul><ul><ul><li>Execute each device driver’s suspend code </li></ul></ul></ul><ul><ul><ul><li>Save/restore the vital registers of SA1110 </li></ul></ul></ul><ul><ul><ul><li>Setup power management unit properly </li></ul></ul></ul><ul><ul><ul><li>Give wake-up information to bootloader before sleep </li></ul></ul></ul><ul><ul><ul><li>Execute work around code to avoid SA1110 sleep bugs </li></ul></ul></ul><ul><ul><ul><li>Enter sleep mode </li></ul></ul></ul><ul><ul><li>Wake up from sleep </li></ul></ul><ul><ul><ul><li>Restore CPU status </li></ul></ul></ul><ul><ul><ul><li>Execute each driver’s resume code </li></ul></ul></ul><ul><ul><li>Device drivers’ support for suspend/resume </li></ul></ul><ul><ul><ul><li>LCD driver </li></ul></ul></ul><ul><ul><ul><li>Touch screen & backlight </li></ul></ul></ul><ul><ul><ul><li>Sound driver </li></ul></ul></ul><ul><ul><ul><li>DMA </li></ul></ul></ul><ul><ul><ul><li>RTC </li></ul></ul></ul>
    16. 16. More Things To Do <ul><li>Test more device drivers’ suspend/resume </li></ul><ul><ul><li>IRDA </li></ul></ul><ul><ul><li>USB </li></ul></ul><ul><ul><li>CF cards </li></ul></ul><ul><ul><li>PCMCIA cards </li></ul></ul><ul><li>Implementing power consumption reduction method </li></ul><ul><ul><li>CPU clock adjustment </li></ul></ul><ul><ul><ul><li>Fix CPU clock scaling code </li></ul></ul></ul><ul><ul><ul><li>Dynamic CPU clock scaling on the load </li></ul></ul></ul><ul><ul><li>Automatic refresh rate adjustment </li></ul></ul><ul><ul><li>Improve display driver and interface </li></ul></ul><ul><li>Implement various power down-mode </li></ul><ul><ul><li>Alarm sleep mode </li></ul></ul><ul><ul><li>Slow-running mode </li></ul></ul><ul><ul><li>Screen off mode </li></ul></ul>
    17. 17. SA-1100 Register Monitor Module <ul><li>Provide simple method to read & write 150 special registers in SA-1100 </li></ul><ul><li>Ex) </li></ul>(none):~# insmod ./regmon.o (none):~# cd /proc/cpu/registers/ (none):/proc/cpu/registers# ls DBAR1 DBTA2 DCSR4 GPDR LCCR0 MDCAS22 PGSR RTSR UDCOMP UTDR DBAR2 DBTA3 DCSR5 GPLR LCCR1 MDCNFG PMCR RTTR UDCSR UTDR DBSA0 DBTA4 DDAR0 GPSR LCCR2 MDREFR POSR SMCNFG UDCWC UTDR ... DBSB5 DCSR1 GPCLKR2 ICLR MDCAS02 OSSR RCSR UDCD0 UTCR3 DBTA0 DCSR2 GPCLKR3 ICMR MDCAS20 OWER RSRR UDCDR UTCR3 DBTA1 DCSR3 GPCR ICPR MDCAS21 PCFR RTAR UDCIMP UTCR4 (none):/proc/cpu/registers# cat PSPR 0x00000011 (none):/proc/cpu/registers# echo 0x12345678 >PSPR (none):/proc/cpu/registers# cat PSPR 0x12345678
    18. 18. Special Thanks to <ul><li>Carl </li></ul><ul><li>Dong-in </li></ul><ul><li>Brian </li></ul><ul><li>Chris </li></ul>
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.