rtc.c 466 B

1234567891011121314151617181920212223242526
  1. /*
  2. * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <assert.h>
  7. #include <common/debug.h>
  8. #include <mt8173_def.h>
  9. #include <rtc.h>
  10. void rtc_bbpu_power_down(void)
  11. {
  12. uint16_t bbpu;
  13. /* pull PWRBB low */
  14. bbpu = RTC_BBPU_KEY | RTC_BBPU_AUTO | RTC_BBPU_PWREN;
  15. if (Writeif_unlock()) {
  16. RTC_Write(RTC_BBPU, bbpu);
  17. if (!RTC_Write_Trigger())
  18. assert(0);
  19. } else {
  20. assert(0);
  21. }
  22. }