coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
timer_v2.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef SOC_MEDIATEK_COMMON_TIMER_V2_H
4 #define SOC_MEDIATEK_COMMON_TIMER_V2_H
5 
6 #include <device/mmio.h>
7 #include <soc/timer_common.h>
8 #include <types.h>
9 
10 #define GPT_MHZ 13
11 
12 enum {
13  TIE_0_EN = 1 << 3,
14  COMP_15_EN = 1 << 10,
15  COMP_20_EN = 1 << 11,
16  COMP_25_EN = 1 << 12,
17 
19 
23 };
24 
25 struct mtk_gpt_regs {
26  u32 reserved1[40];
27  u32 gpt6_con;
28  u32 reserved2;
32 };
33 
34 check_member(mtk_gpt_regs, gpt6_con, 0x00A0);
35 check_member(mtk_gpt_regs, gpt6_cnt_l, 0x00A8);
36 check_member(mtk_gpt_regs, gpt6_cnt_h, 0x00B0);
37 
38 DEFINE_BIT(GPT6_CON_EN6, 0)
39 DEFINE_BIT(GPT6_CON_CLR6, 1)
40 DEFINE_BITFIELD(GPT6_CON_MODE6, 6, 5)
41 
42 #define GPT6_CLOCK_REG(x) x->gpt6_con
43 DEFINE_BITFIELD(GPT6_CLK_CLKDIV6, 3, 0)
44 DEFINE_BITFIELD(GPT6_CLK_CLK6, 13, 10)
45 
46 #endif
#define DEFINE_BITFIELD(name, high_bit, low_bit)
Definition: mmio.h:124
#define DEFINE_BIT(name, bit)
Definition: mmio.h:131
uint32_t u32
Definition: stdint.h:51
u32 reserved2[3]
Definition: timer_v1.h:17
u32 reserved1[24]
Definition: timer_v1.h:13
u32 gpt6_cnt_l
Definition: timer_v1.h:16
u32 gpt6_con
Definition: timer_v1.h:14
u32 reserved3
Definition: timer_v2.h:30
u32 gpt6_cnt_h
Definition: timer_v1.h:18
check_member(mtk_gpt_regs, gpt6_con, 0x00A0)
@ COMP_20_MASK
Definition: timer_v2.h:21
@ COMP_25_MASK
Definition: timer_v2.h:22
@ TIE_0_EN
Definition: timer_v2.h:13
@ COMP_15_MASK
Definition: timer_v2.h:20
@ COMP_25_EN
Definition: timer_v2.h:16
@ COMP_15_EN
Definition: timer_v2.h:14
@ COMP_FEATURE_MASK
Definition: timer_v2.h:18
@ COMP_20_EN
Definition: timer_v2.h:15