meson_rtcreg.h revision 1.1.6.2 1 1.1.6.2 christos /* $NetBSD: meson_rtcreg.h,v 1.1.6.2 2019/06/10 22:05:51 christos Exp $ */
2 1.1.6.2 christos
3 1.1.6.2 christos /*-
4 1.1.6.2 christos * Copyright (c) 2015 The NetBSD Foundation, Inc.
5 1.1.6.2 christos * All rights reserved.
6 1.1.6.2 christos *
7 1.1.6.2 christos * Redistribution and use in source and binary forms, with or without
8 1.1.6.2 christos * modification, are permitted provided that the following conditions
9 1.1.6.2 christos * are met:
10 1.1.6.2 christos * 1. Redistributions of source code must retain the above copyright
11 1.1.6.2 christos * notice, this list of conditions and the following disclaimer.
12 1.1.6.2 christos * 2. Redistributions in binary form must reproduce the above copyright
13 1.1.6.2 christos * notice, this list of conditions and the following disclaimer in the
14 1.1.6.2 christos * documentation and/or other materials provided with the distribution.
15 1.1.6.2 christos *
16 1.1.6.2 christos * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 1.1.6.2 christos * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 1.1.6.2 christos * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 1.1.6.2 christos * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 1.1.6.2 christos * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 1.1.6.2 christos * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 1.1.6.2 christos * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 1.1.6.2 christos * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 1.1.6.2 christos * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 1.1.6.2 christos * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 1.1.6.2 christos * SUCH DAMAGE.
27 1.1.6.2 christos */
28 1.1.6.2 christos
29 1.1.6.2 christos #ifndef _MESON_RTCREG_H_
30 1.1.6.2 christos #define _MESON_RTCREG_H_
31 1.1.6.2 christos
32 1.1.6.2 christos #define AO_RTC_REG0 0x00
33 1.1.6.2 christos #define AO_RTC_REG1 0x04
34 1.1.6.2 christos #define AO_RTC_REG2 0x08
35 1.1.6.2 christos #define AO_RTC_REG3 0x0c
36 1.1.6.2 christos #define AO_RTC_REG4 0x10
37 1.1.6.2 christos
38 1.1.6.2 christos #define AO_RTC_REG0_STATIC_REG_LSB __BITS(31,24)
39 1.1.6.2 christos #define AO_RTC_REG0_UNUSED_23 __BIT(23)
40 1.1.6.2 christos #define AO_RTC_REG0_SERIAL_BUSY __BIT(22)
41 1.1.6.2 christos #define AO_RTC_REG0_UNUSED_21 __BIT(21)
42 1.1.6.2 christos #define AO_RTC_REG0_SCLK_STATIC __BIT(20)
43 1.1.6.2 christos #define AO_RTC_REG0_UNUSED_19_18 __BITS(19,18)
44 1.1.6.2 christos #define AO_RTC_REG0_SERIAL_START __BIT(17)
45 1.1.6.2 christos #define AO_RTC_REG0_ONE_SHOT_POLARITY __BIT(16)
46 1.1.6.2 christos #define AO_RTC_REG0_RESERVED_15_11 __BIT(15,11)
47 1.1.6.2 christos #define AO_RTC_REG0_UNUSED_10_8 __BITS(10,8)
48 1.1.6.2 christos #define AO_RTC_REG0_RESERVED_7_6 __BIT(7,6)
49 1.1.6.2 christos #define AO_RTC_REG0_TEST_MODE __BIT(5)
50 1.1.6.2 christos #define AO_RTC_REG0_TEST_CLK __BIT(4)
51 1.1.6.2 christos #define AO_RTC_REG0_TEST_BYPASS __BIT(3)
52 1.1.6.2 christos #define AO_RTC_REG0_SDI __BIT(2)
53 1.1.6.2 christos #define AO_RTC_REG0_SEN __BIT(1)
54 1.1.6.2 christos #define AO_RTC_REG0_SCLK __BIT(0)
55 1.1.6.2 christos
56 1.1.6.2 christos #define AO_RTC_REG1_UNUSED_31_16 __BITS(31,16)
57 1.1.6.2 christos #define AO_RTC_REG1_RESERVED __BITS(15,12)
58 1.1.6.2 christos #define AO_RTC_REG1_UNUSED_11_4 __BITS(11,4)
59 1.1.6.2 christos #define AO_RTC_REG1_GPO_TO_DIG __BIT(3)
60 1.1.6.2 christos #define AO_RTC_REG1_GPI_TO_DIG __BIT(2)
61 1.1.6.2 christos #define AO_RTC_REG1_S_READY __BIT(1)
62 1.1.6.2 christos #define AO_RTC_REG1_SDO __BIT(0)
63 1.1.6.2 christos
64 1.1.6.2 christos #define AO_RTC_REG2_OSC_CLK_COUNT __BITS(31,0)
65 1.1.6.2 christos
66 1.1.6.2 christos #define AO_RTC_REG3_UNUSED_31_30 __BITS(31,30)
67 1.1.6.2 christos #define AO_RTC_REG3_USE_CLK_TB __BIT(29)
68 1.1.6.2 christos #define AO_RTC_REG3_USE_NIKE_D_RTC __BIT(28)
69 1.1.6.2 christos #define AO_RTC_REG3_AUTO_TB_SEL __BITS(27,26)
70 1.1.6.2 christos #define AO_RTC_REG3_FILTER_SEL __BITS(25,23)
71 1.1.6.2 christos #define AO_RTC_REG3_FILTER_TB __BITS(22,21)
72 1.1.6.2 christos #define AO_RTC_REG3_MSR_BUSY __BIT(20)
73 1.1.6.2 christos #define AO_RTC_REG3_UNUSED_19 __BIT(19)
74 1.1.6.2 christos #define AO_RTC_REG3_FAST_CLK_MODE __BIT(18)
75 1.1.6.2 christos #define AO_RTC_REG3_COUNT_ALWAYS __BIT(17)
76 1.1.6.2 christos #define AO_RTC_REG3_MSR_EN __BIT(16)
77 1.1.6.2 christos #define AO_RTC_REG3_MSR_GATE_TIME __BIT(15,0)
78 1.1.6.2 christos
79 1.1.6.2 christos #define AO_RTC_REG4_UNUSED __BITS(31,8)
80 1.1.6.2 christos #define AO_RTC_REG4_STATIC_REG_MSB __BITS(7,0)
81 1.1.6.2 christos
82 1.1.6.2 christos /* Define RTC register address mapping */
83 1.1.6.2 christos #define RTC_COUNTER_ADDR 0
84 1.1.6.2 christos #define RTC_GPO_COUNTER_ADDR 1
85 1.1.6.2 christos #define RTC_SEC_ADJUST_ADDR 2
86 1.1.6.2 christos #define RTC_UNUSED_ADDR 3
87 1.1.6.2 christos #define RTC_REGMEM_ADDR0 4
88 1.1.6.2 christos #define RTC_REGMEM_ADDR1 5
89 1.1.6.2 christos #define RTC_REGMEM_ADDR2 6
90 1.1.6.2 christos #define RTC_REGMEM_ADDR3 7
91 1.1.6.2 christos
92 1.1.6.2 christos #define RTC_COUNTER_VALUE __BITS(31,0)
93 1.1.6.2 christos #define RTC_SEC_ADJUST_PENDING __BIT(25)
94 1.1.6.2 christos #define RTC_SEC_ADJUST_INC __BIT(24)
95 1.1.6.2 christos #define RTC_SEC_ADJUST_VALID __BIT(23)
96 1.1.6.2 christos #define RTC_SEC_ADJUST_MONITOR __BIT(22)
97 1.1.6.2 christos #define RTC_SEC_ADJUST_RESERVED __BIT(21)
98 1.1.6.2 christos #define RTC_SEC_ADJUST_CTRL __BITS(20,19)
99 1.1.6.2 christos #define RTC_SEC_ADJUST_COUNTER __BITS(18,0)
100 1.1.6.2 christos
101 1.1.6.2 christos #endif /* _MESON_RTCREG_H_ */
102