Help - Search - Members - Calendar
Full Version: Sl6000 Wake On Alarm
OESF Forums > Distros, Development, and Model Specific Forums > Distro Support and Discussion > pdaXrom
karlto
Hi all

The SL6000 seems to be the only Zaurus that won't wake on alarm in the latest RC12. I am keen to get your opinions and assistance to find the solution to this.

So far, I have managed to compile a kernel with debug options set in the power management section - this is a sample of the dmesg output:

CODE
tc6393_nand_suspend
queue_event: event=10
suspend:
set_power_state: what=1 state=2
set_power_state: *** go into suspend
pxa_suspend: FCS : CCCR = 241
pxa_suspend: pass_charge_flag = 0
pxa_suspend: check AC-adaptor
pxa_suspend: kick charging
pxa_suspend: ac97&tc6393 down
pxa_suspend: RTAR charge = 401e3317

==== This is where sleep mode is entered ====

If there was a problem with the code after resuming from sleep, we would see messages about going back to sleep/suspend below, but we don't. So, issue must be above in telling processor how to sleep...?

===================================

pxa_suspend: ac97&tc6393 up
ac97_codec: AC97 Audio codec, id: WML18 (Wolfson WM9711/WM9712)
init TC6369 Revision 3
pxa_suspend: back the ALARM Time
sharpsl_wakeup_hook: GPLR0 = 3ef89a
PEDR=00000001
src=800000bf
src_mask=0000009f
PSSR=00000001->00000001
key interrupt on (0001,0000)
FCS : CCCR = 161
send_event: event=3
sleeping to allow SD card to resume...
sleep complete.
w9712_init
wm9712_update_jack_state: HP jack state changed (Jack=0,Mic=0)
tc6393_nand_resume


In theory, hardware wakeups that are correctly set up will resume the kernel power code from sleep at the point noted in the messages above. Things such as unplugging the power etc will also wake it up, so there is some code to send it back to sleep if no need to wake up. albertr's patch (incorporated into RC12) stopped it from going back to sleep if the alarm was set. The SL6000 doesn't actually wake at all though - it's like the hardware wakeup isn't set properly for the alarm. While the corgi (760) has the same processor, there are a number of general purpose registers (GPIO) that are used differently for the tosa, and a lot of tosa-specific code to account for this (e.g. the battery charge indicator appears to be completely opposite). I have the processor specs but not Zaurus specs.

In short, the SL6000 seems to respond to battery/AC/button events when in sleep mode, but not the alarm. This leads me to believe that the alarm isn't quite set correctly (as it is difficult to figure out the correct GPIO settings). Some possibly useful info from registers in the dmesg output above, and I can always modify to get more.

Is it possible to find original/unmodified Sharp code for the SL6000 power routines? Zaurus spec on what/how the GPIO registers are used? Does OZ or anyone else have working suspend/resume on alarm code that we can look at to get the right settings?

BTW, I am working with /arch/arm/mach-pxa/sharpsl_power.c above...

Thanks for any help or suggestions!
trichmon
Let me just say thanks for trying to get this fixed. In my opinion this is the biggest problem with the 6000, and non-sharp roms. I have seen sashz work on this and I think the whole team has worked hard on getting this fixed. And I have tryed OZ as well with the same results. The only other rom for the 6000 that seem to have this working are sharp based(i think). Right now if I am doing something that requires my Z to resume on its own I have to flash back to the original rom.

Im not much of a coder at this point but if I can help in any way please PM. Or ask in this thread.

Todd
DrWowe
I would also like to see this working.

Trichmon: Are you certain there is a configuration (Sharp based) which works? If so, it should be relatively easy to figure out. Sharp's original kernel sources are available somewhere on their Japanese website.

UPDATE:
It is here:
http://developer.ezaurus.com/sl_j/source/source_dl.htm
trichmon
DrWowe: I am sure that the default sharp rom works. Im not sure how they do it but I use the alarm features all time and I has yet to fail me. The fine guylhem rom (which think is based on sharp, but i could be way wrong) has also worked for me.
karlto
Neat - I will have a look at the Sharp kernel source. I can't seem to find any source for the guylhem one though; only compiled images ready to go...

They all seem to be based on the original Sharp one, but I think that possibly one of the changes has broken SL6000 alarms (not the most common Zaurus).

Thanks for your help
DrWowe
guylhem kernel sources:
http://www.externe.net/zaurus/kernel/sources/
karlto
Excellent news!

I found it - a simple line at the top of the file that turned off wakeups for RTC alarms on the tosa only! I have successfully tested it using apmsleep (not exhaustive by any means, but I am pretty sure this is it, as it lines up with the corgi etc code.)

UPDATE
---------
Here it is:

- kernel patch for those who compile and for future use
- standard sl6000 rc12 tools.tar ready to flash for lazy people like me smile.gif
sashz
QUOTE(karlto @ Dec 15 2005, 06:49 PM)
Excellent news!

I found it - a simple line at the top of the file that turned off wakeups for RTC alarms on the tosa only! I have successfully tested it using apmsleep (not exhaustive by any means, but I am pretty sure this is it, as it lines up with the corgi etc code.)

UPDATE
---------
Here it is:

- kernel patch for those who compile and for future use
- standard sl6000 rc12 tools.tar ready to flash for lazy people like me smile.gif
*


nice work! i'll add patch to build system now)
trichmon
karlto: your the man! Works like a charm on my Z. pdaxrom is now my daily rom. Thanks so much.

Todd
trichmon
karlto: so have you tested your new kernel with either of the kopi alarm setups mentioned in these forums?

Todd
karlto
QUOTE(trichmon @ Dec 17 2005, 06:54 PM)
karlto: so have you tested your new kernel with either of the kopi alarm setups mentioned in these forums?

Todd
*


I tried this one:

Alarms With Kdepim/pi For Rc12 Sl-c3100

(which uses apmsleep) and it works, but a bit rough - it seems to wake up one minute before an alarm is due, and with the minute rounding it can be quite early. However it is all scripted so it can be changed, and kopi will still raise an alarm even if it is a few seconds after the due time...

Note - I found that the kdepim attached to the post above didn't play sound properly, as it uses the 'playwave' command, which seems to need more parameters. I just moved it and made /usr/bin/playwave a symlink to /usr/bin/play...

I haven't tried atd, but I am sure it would work on the SL6000 if it does on others. It's all just a matter of using the two hidden files in the home directory made by kopi (that have the next alarm and next suspended alarm date/time in them) and setting the wakeup time.

Karl
karlto
Hi Todd

If you are still interested in the kopi wakeup, I have found a slightly more robust/accurate solution (still requires it to be running though).

Install atd as sashz recommended in the other thread, and copy the attached wrapper script in place of the existing one at /usr/bin/apm (back up the old one...). It still executes the apm suspend, resume and wakeup scripts, only using at instead of apmsleep. It also checks the ~/.kopi_next_alarm and ~/.kopi_suspend_alarm files and sets a wakeup time to the second for these (instead of nearest minute).

The only catch is that the sltime script that executes on suspend and resume fails because it can't access the hardware clock (atd has it open). I can't see any real need to set the clock so often though anyway...

Karl
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.