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