Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
CTCaer
GitHub Repository: CTCaer/hekate
Path: blob/master/modules/hekate_libsys_lp0/t210.h
1476 views
1
/*
2
* Copyright (c) 2018 naehrwert
3
*
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms and conditions of the GNU General Public License,
6
* version 2, as published by the Free Software Foundation.
7
*
8
* This program is distributed in the hope it will be useful, but WITHOUT
9
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11
* more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
15
*/
16
17
#ifndef _T210_H_
18
#define _T210_H_
19
20
#include "types.h"
21
22
#define HOST1X_BASE 0x50000000
23
#define DISPLAY_A_BASE 0x54200000
24
#define DSI_BASE 0x54300000
25
#define VIC_BASE 0x54340000
26
#define TSEC_BASE 0x54500000
27
#define SOR1_BASE 0x54580000
28
#define TMR_BASE 0x60005000
29
#define CLOCK_BASE 0x60006000
30
#define FLOW_CTLR_BASE 0x60007000
31
#define SYSREG_BASE 0x6000C000
32
#define SB_BASE (SYSREG_BASE + 0x200)
33
#define GPIO_BASE 0x6000D000
34
#define GPIO_1_BASE (GPIO_BASE)
35
#define GPIO_2_BASE (GPIO_BASE + 0x100)
36
#define GPIO_3_BASE (GPIO_BASE + 0x200)
37
#define GPIO_4_BASE (GPIO_BASE + 0x300)
38
#define GPIO_5_BASE (GPIO_BASE + 0x400)
39
#define GPIO_6_BASE (GPIO_BASE + 0x500)
40
#define GPIO_7_BASE (GPIO_BASE + 0x600)
41
#define GPIO_8_BASE (GPIO_BASE + 0x700)
42
#define EXCP_VEC_BASE 0x6000F000
43
#define APB_MISC_BASE 0x70000000
44
#define PINMUX_AUX_BASE 0x70003000
45
#define UART_BASE 0x70006000
46
#define RTC_BASE 0x7000E000
47
#define PMC_BASE 0x7000E400
48
#define SYSCTR0_BASE 0x7000F000
49
#define FUSE_BASE 0x7000F800
50
#define KFUSE_BASE 0x7000FC00
51
#define SE_BASE 0x70012000
52
#define MC_BASE 0x70019000
53
#define EMC_BASE 0x7001B000
54
#define MIPI_CAL_BASE 0x700E3000
55
#define I2S_BASE 0x702D1000
56
57
#define _REG(base, off) *(vu32 *)((base) + (off))
58
59
#define HOST1X(off) _REG(HOST1X_BASE, off)
60
#define DISPLAY_A(off) _REG(DISPLAY_A_BASE, off)
61
#define DSI(off) _REG(DSI_BASE, off)
62
#define VIC(off) _REG(VIC_BASE, off)
63
#define TSEC(off) _REG(TSEC_BASE, off)
64
#define SOR1(off) _REG(SOR1_BASE, off)
65
#define TMR(off) _REG(TMR_BASE, off)
66
#define CLOCK(off) _REG(CLOCK_BASE, off)
67
#define FLOW_CTLR(off) _REG(FLOW_CTLR_BASE, off)
68
#define SYSREG(off) _REG(SYSREG_BASE, off)
69
#define SB(off) _REG(SB_BASE, off)
70
#define GPIO(off) _REG(GPIO_BASE, off)
71
#define GPIO_1(off) _REG(GPIO_1_BASE, off)
72
#define GPIO_2(off) _REG(GPIO_2_BASE, off)
73
#define GPIO_3(off) _REG(GPIO_3_BASE, off)
74
#define GPIO_4(off) _REG(GPIO_4_BASE, off)
75
#define GPIO_5(off) _REG(GPIO_5_BASE, off)
76
#define GPIO_6(off) _REG(GPIO_6_BASE, off)
77
#define GPIO_7(off) _REG(GPIO_7_BASE, off)
78
#define GPIO_8(off) _REG(GPIO_8_BASE, off)
79
#define EXCP_VEC(off) _REG(EXCP_VEC_BASE, off)
80
#define APB_MISC(off) _REG(APB_MISC_BASE, off)
81
#define PINMUX_AUX(off) _REG(PINMUX_AUX_BASE, off)
82
#define RTC(off) _REG(RTC_BASE, off)
83
#define PMC(off) _REG(PMC_BASE, off)
84
#define SYSCTR0(off) _REG(SYSCTR0_BASE, off)
85
#define FUSE(off) _REG(FUSE_BASE, off)
86
#define KFUSE(off) _REG(KFUSE_BASE, off)
87
#define SE(off) _REG(SE_BASE, off)
88
#define MC(off) _REG(MC_BASE, off)
89
#define EMC(off) _REG(EMC_BASE, off)
90
#define MIPI_CAL(off) _REG(MIPI_CAL_BASE, off)
91
#define I2S(off) _REG(I2S_BASE, off)
92
93
/*! Misc registers. */
94
#define APB_MISC_PP_PINMUX_GLOBAL 0x40
95
#define APB_MISC_GP_HIDREV 0x804
96
#define GP_HIDREV_MAJOR_T210 0x1
97
#define GP_HIDREV_MAJOR_T210B01 0x2
98
#define APB_MISC_GP_WIFI_EN_CFGPADCTRL 0xB64
99
#define APB_MISC_GP_WIFI_RST_CFGPADCTRL 0xB68
100
101
/*! System registers. */
102
#define AHB_ARBITRATION_XBAR_CTRL 0xE0
103
#define AHB_AHB_SPARE_REG 0x110
104
105
/*! Secure boot registers. */
106
#define SB_CSR 0x0
107
#define SB_AA64_RESET_LOW 0x30
108
#define SB_AA64_RESET_HIGH 0x34
109
110
/*! SYSCTR0 registers. */
111
#define SYSCTR0_CNTFID0 0x20
112
113
#endif
114
115