summaryrefslogtreecommitdiff
path: root/chip/stm32/clock-l4.h
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2021-11-04 12:11:58 -0600
committerCommit Bot <commit-bot@chromium.org>2021-11-05 04:22:34 +0000
commit252457d4b21f46889eebad61d4c0a65331919cec (patch)
tree01856c4d31d710b20e85a74c8d7b5836e35c3b98 /chip/stm32/clock-l4.h
parent08f5a1e6fc2c9467230444ac9b582dcf4d9f0068 (diff)
downloadchrome-ec-stabilize-14345.B-ish.tar.gz
In the interest of making long-term branch maintenance incur as little technical debt on us as possible, we should not maintain any files on the branch we are not actually using. This has the added effect of making it extremely clear when merging CLs from the main branch when changes have the possibility to affect us. The follow-on CL adds a convenience script to actually pull updates from the main branch and generate a CL for the update. BUG=b:204206272 BRANCH=ish TEST=make BOARD=arcada_ish && make BOARD=drallion_ish Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I17e4694c38219b5a0823e0a3e55a28d1348f4b18 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3262038 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Diffstat (limited to 'chip/stm32/clock-l4.h')
-rw-r--r--chip/stm32/clock-l4.h110
1 files changed, 0 insertions, 110 deletions
diff --git a/chip/stm32/clock-l4.h b/chip/stm32/clock-l4.h
deleted file mode 100644
index d237b84580..0000000000
--- a/chip/stm32/clock-l4.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/* Copyright 2021 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-/* Clocks and power management settings */
-
-#ifndef __CROS_EC_CLOCK_L4_H
-#define __CROS_EC_CLOCK_L4_H
-
-#include "chipset.h"
-#include "clock.h"
-#include "common.h"
-#include "console.h"
-#include "cpu.h"
-#include "hooks.h"
-#include "hwtimer.h"
-#include "registers.h"
-#include "system.h"
-#include "task.h"
-#include "timer.h"
-#include "util.h"
-
-#define STM32L4_RTC_REQ 1000000
-#define STM32L4_LSI_CLOCK 32000
-
-/* Lock and unlock RTC write access */
-static inline void rtc_lock_regs(void)
-{
- STM32_RTC_WPR = 0xff;
-}
-static inline void rtc_unlock_regs(void)
-{
- STM32_RTC_WPR = 0xca;
- STM32_RTC_WPR = 0x53;
-}
-
-struct rtc_time_reg {
- uint32_t rtc_ssr; /* subseconds */
- uint32_t rtc_tr; /* hours, minutes, seconds */
- uint32_t rtc_dr; /* years, months, dates, week days */
-};
-
-/* Save the RTC alarm wake time */
-struct wake_time {
- timestamp_t ts;
- uint32_t rtc_alrmar; /* the value of register STM32_RTC_ALRMAR */
-};
-
-/* Convert between RTC regs in BCD and seconds */
-uint32_t rtc_to_sec(const struct rtc_time_reg *rtc);
-
-/* Convert between seconds and RTC regs */
-void sec_to_rtc(uint32_t sec, struct rtc_time_reg *rtc);
-
-/* Calculate microseconds from rtc sub-second register. */
-uint32_t rtcss_to_us(uint32_t rtcss);
-
-/* Calculate rtc sub-second register value from microseconds. */
-uint32_t us_to_rtcss(uint32_t us);
-
-/* Return sub-10-sec time diff between two rtc readings */
-uint32_t get_rtc_diff(const struct rtc_time_reg *rtc0,
- const struct rtc_time_reg *rtc1);
-
-/* Read RTC values */
-void rtc_read(struct rtc_time_reg *rtc);
-
-/* Set RTC value */
-void rtc_set(uint32_t sec);
-
-/* Set RTC wakeup, save alarm wakeup time when save_alarm != 0 */
-void set_rtc_alarm(uint32_t delay_s, uint32_t delay_us,
- struct rtc_time_reg *rtc, uint8_t save_alarm);
-
-/* Clear RTC wakeup */
-void reset_rtc_alarm(struct rtc_time_reg *rtc);
-
-/*
- * Return the remaining seconds before the RTC alarm goes off.
- * Sub-seconds are ignored. Returns 0 if alarm is not set.
- */
-uint32_t get_rtc_alarm(void);
-
-/* RTC init */
-void rtc_init(void);
-
-/* Init clock blocks and functionality */
-void clock_init(void);
-
-/* Init high speed clock config */
-void config_hispeed_clock(void);
-
-/* Get timer clock frequency (for STM32 only) */
-int clock_get_timer_freq(void);
-
-/*
- * Return 1 if host_wake_time is nonzero and the saved host_wake_time
- * is expired at a given time, ts.
- */
-bool is_host_wake_alarm_expired(timestamp_t ts);
-
-/* Set RTC wakeup based on the value saved in host_wake_time */
-void restore_host_wake_alarm(void);
-
-#ifdef CONFIG_LOW_POWER_IDLE
-void low_power_init(void);
-#endif
-
-#endif /* __CROS_EC_CLOCK_L4_H */