OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [or1ksim/] [peripheral/] [mc.h] - Blame information for rev 84

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 19 jeremybenn
/* mc.h -- Simulation of Memory Controller
2
 
3
   Copyright (C) 2001 by Marko Mlinar, markom@opencores.org
4
   Copyright (C) 2008 Embecosm Limited
5
 
6
   Contributor Jeremy Bennett <jeremy.bennett@embecosm.com>
7
 
8
   This file is part of Or1ksim, the OpenRISC 1000 Architectural Simulator.
9
 
10
   This program is free software; you can redistribute it and/or modify it
11
   under the terms of the GNU General Public License as published by the Free
12
   Software Foundation; either version 3 of the License, or (at your option)
13
   any later version.
14
 
15
   This program is distributed in the hope that it will be useful, but WITHOUT
16
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
18
   more details.
19
 
20
   You should have received a copy of the GNU General Public License along
21
   with this program.  If not, see <http://www.gnu.org/licenses/>.  */
22
 
23
/* This program is commented throughout in a fashion suitable for processing
24
   with Doxygen. */
25
 
26
 
27
#ifndef MC__H
28
#define MC__H
29
 
30
/* Package includes */
31
#include "abstract.h"
32
 
33
 
34 82 jeremybenn
/* Constants. Also used by the test harness */
35
#define N_CE        8
36
 
37
#define MC_CSR      0x00
38
#define MC_POC      0x04
39
#define MC_BA_MASK  0x08
40
#define MC_CSC(i)   (0x10 + (i) * 8)
41
#define MC_TMS(i)   (0x14 + (i) * 8)
42
 
43
#define MC_ADDR_SPACE (MC_CSC(N_CE))
44
 
45
/* POC register field definition */
46
#define MC_POC_EN_BW_OFFSET       0
47
#define MC_POC_EN_BW_WIDTH        2
48
#define MC_POC_EN_MEMTYPE_OFFSET  2
49
#define MC_POC_EN_MEMTYPE_WIDTH   2
50
 
51
/* CSC register field definition */
52
#define MC_CSC_EN_OFFSET          0
53
#define MC_CSC_MEMTYPE_OFFSET     1
54
#define MC_CSC_MEMTYPE_WIDTH      2 
55
#define MC_CSC_BW_OFFSET          4
56
#define MC_CSC_BW_WIDTH           2
57
#define MC_CSC_MS_OFFSET          6
58
#define MC_CSC_MS_WIDTH           2
59
#define MC_CSC_WP_OFFSET          8
60
#define MC_CSC_BAS_OFFSET         9
61
#define MC_CSC_KRO_OFFSET        10
62
#define MC_CSC_PEN_OFFSET        11
63
#define MC_CSC_SEL_OFFSET        16
64
#define MC_CSC_SEL_WIDTH          8
65
 
66
#define MC_CSC_MEMTYPE_SDRAM      0
67
#define MC_CSC_MEMTYPE_SSRAM      1
68
#define MC_CSC_MEMTYPE_ASYNC      2
69
#define MC_CSC_MEMTYPE_SYNC       3
70
 
71
#define MC_CSR_VALID            0xFF000703LU
72
#define MC_POC_VALID            0x0000000FLU
73
#define MC_BA_MASK_VALID        0x000003FFLU
74
#define MC_CSC_VALID            0x00FF0FFFLU
75
#define MC_TMS_SDRAM_VALID      0x0FFF83FFLU
76
#define MC_TMS_SSRAM_VALID      0x00000000LU
77
#define MC_TMS_ASYNC_VALID      0x03FFFFFFLU
78
#define MC_TMS_SYNC_VALID       0x01FFFFFFLU
79
#define MC_TMS_VALID            0xFFFFFFFFLU    /* reg test compat. */
80
 
81
/* TMS register field definition SDRAM */
82
#define MC_TMS_SDRAM_TRFC_OFFSET        24
83
#define MC_TMS_SDRAM_TRFC_WIDTH          4
84
#define MC_TMS_SDRAM_TRP_OFFSET         20
85
#define MC_TMS_SDRAM_TRP_WIDTH           4
86
#define MC_TMS_SDRAM_TRCD_OFFSET        17
87
#define MC_TMS_SDRAM_TRCD_WIDTH          4
88
#define MC_TMS_SDRAM_TWR_OFFSET         15
89
#define MC_TMS_SDRAM_TWR_WIDTH           2
90
#define MC_TMS_SDRAM_WBL_OFFSET          9
91
#define MC_TMS_SDRAM_OM_OFFSET           7
92
#define MC_TMS_SDRAM_OM_WIDTH            2
93
#define MC_TMS_SDRAM_CL_OFFSET           4
94
#define MC_TMS_SDRAM_CL_WIDTH            3
95
#define MC_TMS_SDRAM_BT_OFFSET           3
96
#define MC_TMS_SDRAM_BL_OFFSET           0
97
#define MC_TMS_SDRAM_BL_WIDTH            3
98
 
99
/* TMS register field definition ASYNC */
100
#define MC_TMS_ASYNC_TWWD_OFFSET        20
101
#define MC_TMS_ASYNC_TWWD_WIDTH          6
102
#define MC_TMS_ASYNC_TWD_OFFSET         16
103
#define MC_TMS_ASYNC_TWD_WIDTH           4
104
#define MC_TMS_ASYNC_TWPW_OFFSET        12
105
#define MC_TMS_ASYNC_TWPW_WIDTH          4
106
#define MC_TMS_ASYNC_TRDZ_OFFSET         8
107
#define MC_TMS_ASYNC_TRDZ_WIDTH          4
108
#define MC_TMS_ASYNC_TRDV_OFFSET         0
109
#define MC_TMS_ASYNC_TRDV_WIDTH          8
110
 
111
/* TMS register field definition SYNC  */
112
#define MC_TMS_SYNC_TTO_OFFSET          16
113
#define MC_TMS_SYNC_TTO_WIDTH            9
114
#define MC_TMS_SYNC_TWR_OFFSET          12
115
#define MC_TMS_SYNC_TWR_WIDTH            4
116
#define MC_TMS_SYNC_TRDZ_OFFSET          8
117
#define MC_TMS_SYNC_TRDZ_WIDTH           4
118
#define MC_TMS_SYNC_TRDV_OFFSET          0
119
#define MC_TMS_SYNC_TRDV_WIDTH           8
120
 
121
 
122 19 jeremybenn
/* Prototypes for external use */
123
extern void  mc_done ();
124
extern void  reg_mc_sec ();
125
extern void  mc_reg_mem_area (struct dev_memarea *mem,
126
                              unsigned int        cs,
127
                              int                 mc);
128
 
129
#endif /* MC__H */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.