Hi,
Sorry to respond to my own question.
I am not a programmer but it looks to me like there is a bug in pxaregs.
The RTAR_RTMV should be a static value but I have found it to increment at a
rate of once per second. When I look at various source listings for
pxaregs.c, that register is shown at a physical address of 0x40900010 but by
the Intel documentation it should be at 0x40900004. The same document shows
the physical address of 0x40900010 really occupied by the RTC Day Counter
Register (RDCR) in which the low bits do reflect the seconds part of the
current time.
>From various listings of pxaregs.c
{ "RTAR", 0x40900010, 0, 0xffffffff, 'x', "RTC Alarm Register (4-30)" },
{ "RTAR_RTMV", 0x40900010, 0, 0xffffffff, 'x', "RTC Target Match Value" },
>From page 958 of (section 21-24) IntelR PXA27x Processor Family Developer's
Manual
Table 21-14. RDCR Bit Definitions (Sheet 1 of 2)
Physical Address
0x4090_0010 RDCR RTC
>From page 953 of (section 21-19) IntelR PXA27x Processor Family Developer's
Manual
It should be:
Table 21-8. RTAR Bit Definitions
Physical Address
0x4090_0004 RTAR RTC
Could a real programmer look at this to see if I am reading it wrong since I
don't have clue where to start to fix this? I would really like to put this
device in standby and get it to wake up again.
Thanks,
Mic
-----Original Message-----
From: Mic Miller [mailto:miclist@...]
Sent: Wednesday, November 26, 2008 12:28 PM
To: 'gumstix-users@...'
Subject: RTC registers and alarms; PXA270
I am trying to put my Verdex XL6P into Standby mode and then exit Standby on
an RTC alarm after a given number of seconds.
After reading a number of posts in the nabble archives and information in
the IntelR PXA27x Processor Family Developer's Manual I have come to the
following procedure for doing that.
1. Read the contents of the RTC Counter Register Count Value, which is
incremented once per second, using
pxaregs RCNR_RCV
2. Add the number of seconds I want it to remain in Standby to the counter
value and write it into RTC Alarm Register Target Match Value, using
pxaregs RTAR_RTMV {counter value + standby seconds}
3. Enable power manager wake up on RTC alarm using
pxaregs PWER_WERTC 1
4. Place into Standby, using
echo;
echo "standby" > /sys/power/state
When I query RTAR_RTMV however, it is incrementing once per second too. I
expected it to be a static value to compare with the RCNR_RCV. When they
match, the alarm should trigger. What am I missing?
Also, when I write 0x00000000 to RTAR_RTMV and then query it immediately it
reads 0x001e0001. It looks like pxaregs isn't writing to the high 16 bits
of the register.
Thanks for any help on this,
Mic
|