• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 HiSilicon (Shanghai) Technologies CO., LIMITED.
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17  */
18 
19 #ifndef __DDRC_REG_H__
20 #define __DDRC_REG_H__
21 
22 #include "hi_type.h"
23 
24 #ifdef __cplusplus
25 #if __cplusplus
26 extern "C" {
27 #endif
28 #endif /* End of #ifdef __cplusplus */
29 
30 #define MDDRC_BASE_ADDR 0x20115000
31 
32 typedef union {
33     /* Define the struct bits */
34     struct {
35         unsigned int mem_mode : 1;  /* [0] */
36         unsigned int mem_comb : 2;  /* [2..1] */
37         unsigned int reserved : 29; /* [31..3] */
38     } bits;
39 
40     /* Define an unsigned member */
41     unsigned int u32;
42 } u_ddr_mode;
43 
44 typedef union {
45     /* Define the struct bits */
46     struct {
47         unsigned int apg_gt_en : 1;     /* [0] */
48         unsigned int muxcmd_gt_en : 1;  /* [1] */
49         unsigned int detaddr_gt_en : 1; /* [2] */
50         unsigned int reserved : 29;     /* [31..3] */
51     } bits;
52 
53     /* Define an unsigned member */
54     unsigned int u32;
55 } u_clk_cfg;
56 
57 /* Define the union u_awaddr_srvlnc_start */
58 typedef union {
59     /* Define the struct bits */
60     struct {
61         unsigned int awaddr_srvlnc_start : 32; /* [31..0] */
62     } bits;
63 
64     /* Define an unsigned member */
65     unsigned int u32;
66 } u_awaddr_srvlnc_start;
67 
68 /* Define the union u_awaddr_srvlnc_end */
69 typedef union {
70     /* Define the struct bits */
71     struct {
72         unsigned int awaddr_srvlnc_end : 32; /* [31..0] */
73     } bits;
74 
75     /* Define an unsigned member */
76     unsigned int u32;
77 } u_awaddr_srvlnc_end;
78 
79 #define HIFB_RESERVED_RANGE 62
80 typedef struct {
81     u_ddr_mode ddr_mode;
82     u_clk_cfg clk_cfg;
83     unsigned int reserved_1[HIFB_RESERVED_RANGE];
84     u_awaddr_srvlnc_start awaddr_srvlnc_start;
85     u_awaddr_srvlnc_end awaddr_srvlnc_end;
86     unsigned int reserved_2[HIFB_RESERVED_RANGE];
87     unsigned int awaddr_srvlnc_status;
88 } mddrc_regs;
89 
90 #ifdef __cplusplus
91 #if __cplusplus
92 }
93 #endif
94 #endif /* __cplusplus */
95 
96 #endif /* __DDRC_REG_H__ */
97