# HG changeset patch # User Paul Boddie # Date 1700226575 -3600 # Node ID 6e1fae3404c55767fd4fe36d15eafb2a19a5a454 # Parent 4421ca7a919465ee325ad96422adb1ace668192c Prevent any wake-up possibility when actually powering down. diff -r 4421ca7a9194 -r 6e1fae3404c5 pkg/devices/lib/rtc/include/rtc-x1600.h --- a/pkg/devices/lib/rtc/include/rtc-x1600.h Fri Nov 17 14:09:08 2023 +0100 +++ b/pkg/devices/lib/rtc/include/rtc-x1600.h Fri Nov 17 14:09:35 2023 +0100 @@ -44,6 +44,7 @@ uint32_t read_checked(unsigned reg); void wait(); void write_enable(); + void _power_down(); public: explicit Rtc_x1600_chip(l4_addr_t addr, Cpm_x1600_chip *cpm = NULL); diff -r 4421ca7a9194 -r 6e1fae3404c5 pkg/devices/lib/rtc/src/x1600.cc --- a/pkg/devices/lib/rtc/src/x1600.cc Fri Nov 17 14:09:08 2023 +0100 +++ b/pkg/devices/lib/rtc/src/x1600.cc Fri Nov 17 14:09:35 2023 +0100 @@ -255,15 +255,7 @@ } void -Rtc_x1600_chip::hibernate() -{ - alarm_enable(); - wakeup_alarm_enable(); - power_down(); -} - -void -Rtc_x1600_chip::power_down() +Rtc_x1600_chip::_power_down() { /* Set CPU frequency to L2 cache frequency before powering down. This is apparently necessary according to the X1600 manual. */ @@ -275,6 +267,21 @@ _regs[Hibernate_control] = _regs[Hibernate_control] | Hibernate_power_down; } +void +Rtc_x1600_chip::hibernate() +{ + alarm_enable(); + wakeup_alarm_enable(); + _power_down(); +} + +void +Rtc_x1600_chip::power_down() +{ + wakeup_alarm_disable(); + _power_down(); +} + // C language interface functions.