Blame view

include/tsi108.h 5.69 KB
78aa0c342   roy zang   Tundra tsi108 hea...
1
2
3
4
  /*****************************************************************************
   * (C) Copyright 2003;  Tundra Semiconductor Corp.
   * (C) Copyright 2006;  Freescale Semiconductor Corp.
   *
1a4596601   Wolfgang Denk   Add GPL-2.0+ SPDX...
5
   * SPDX-License-Identifier:	GPL-2.0+
78aa0c342   roy zang   Tundra tsi108 hea...
6
7
8
9
10
11
12
13
14
15
16
17
18
19
   *****************************************************************************/
  
  /*
   * FILENAME: tsi108.h
   *
   * Originator: Alex Bounine
   *
   * DESCRIPTION:
   * Common definitions for the Tundra Tsi108 bridge chip
   *
   */
  
  #ifndef _TSI108_H_
  #define _TSI108_H_
ee311214e   roy zang   Clean up the code...
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
  #define TSI108_HLP_REG_OFFSET	(0x0000)
  #define TSI108_PCI_REG_OFFSET	(0x1000)
  #define TSI108_CLK_REG_OFFSET	(0x2000)
  #define TSI108_PB_REG_OFFSET	(0x3000)
  #define TSI108_SD_REG_OFFSET	(0x4000)
  #define TSI108_MPIC_REG_OFFSET	(0x7400)
  
  #define PB_ID			(0x000)
  #define PB_RSR			(0x004)
  #define PB_BUS_MS_SELECT	(0x008)
  #define PB_ISR			(0x00C)
  #define PB_ARB_CTRL		(0x018)
  #define PB_PVT_CTRL2		(0x034)
  #define PB_SCR			(0x400)
  #define PB_ERRCS		(0x404)
  #define PB_AERR			(0x408)
  #define PB_REG_BAR		(0x410)
  #define PB_OCN_BAR1		(0x414)
  #define PB_OCN_BAR2		(0x418)
  #define PB_SDRAM_BAR1		(0x41C)
  #define PB_SDRAM_BAR2		(0x420)
  #define PB_MCR			(0xC00)
  #define PB_MCMD			(0xC04)
  
  #define HLP_B0_ADDR		(0x000)
  #define HLP_B1_ADDR		(0x010)
  #define HLP_B2_ADDR		(0x020)
  #define HLP_B3_ADDR		(0x030)
  
  #define HLP_B0_MASK		(0x004)
  #define HLP_B1_MASK		(0x014)
  #define HLP_B2_MASK		(0x024)
  #define HLP_B3_MASK		(0x034)
  
  #define HLP_B0_CTRL0		(0x008)
  #define HLP_B1_CTRL0		(0x018)
  #define HLP_B2_CTRL0		(0x028)
  #define HLP_B3_CTRL0		(0x038)
  
  #define HLP_B0_CTRL1		(0x00C)
  #define HLP_B1_CTRL1		(0x01C)
  #define HLP_B2_CTRL1		(0x02C)
  #define HLP_B3_CTRL1		(0x03C)
  
  #define PCI_CSR			(0x004)
  #define PCI_P2O_BAR0		(0x010)
  #define PCI_P2O_BAR0_UPPER	(0x014)
  #define PCI_P2O_BAR2		(0x018)
  #define PCI_P2O_BAR2_UPPER	(0x01C)
  #define PCI_P2O_BAR3		(0x020)
  #define PCI_P2O_BAR3_UPPER	(0x024)
  
  #define PCI_MISC_CSR		(0x040)
  #define PCI_P2O_PAGE_SIZES	(0x04C)
  
  #define PCI_PCIX_STAT		(0x0F4)
  
  #define PCI_IRP_STAT		(0x184)
  
  #define PCI_PFAB_BAR0		(0x204)
  #define PCI_PFAB_BAR0_UPPER	(0x208)
  #define PCI_PFAB_IO		(0x20C)
  #define PCI_PFAB_IO_UPPER	(0x210)
  
  #define PCI_PFAB_MEM32		(0x214)
  #define PCI_PFAB_MEM32_REMAP	(0x218)
  #define PCI_PFAB_MEM32_MASK	(0x21C)
  
  #define CG_PLL0_CTRL0		(0x210)
  #define CG_PLL0_CTRL1		(0x214)
  #define CG_PLL1_CTRL0		(0x220)
  #define CG_PLL1_CTRL1		(0x224)
  #define CG_PWRUP_STATUS		(0x234)
78aa0c342   roy zang   Tundra tsi108 hea...
93
94
  
  #define MPIC_CSR(n) (0x30C + (n * 0x40))
ee311214e   roy zang   Clean up the code...
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
  #define SD_CTRL			(0x000)
  #define SD_STATUS		(0x004)
  #define SD_TIMING		(0x008)
  #define SD_REFRESH		(0x00C)
  #define SD_INT_STATUS		(0x010)
  #define SD_INT_ENABLE		(0x014)
  #define SD_INT_SET		(0x018)
  #define SD_D0_CTRL		(0x020)
  #define SD_D1_CTRL		(0x024)
  #define SD_D0_BAR		(0x028)
  #define SD_D1_BAR		(0x02C)
  #define SD_ECC_CTRL		(0x040)
  #define SD_DLL_STATUS		(0x250)
  
  #define TS_SD_CTRL_ENABLE	(1 << 31)
  
  #define PB_ERRCS_ES		(1 << 1)
  #define PB_ISR_PBS_RD_ERR	(1 << 8)
  #define PCI_IRP_STAT_P_CSR	(1 << 23)
  
  /*
78aa0c342   roy zang   Tundra tsi108 hea...
116
117
   * I2C : Register address offset definitions
   */
ee311214e   roy zang   Clean up the code...
118
119
120
121
  #define I2C_CNTRL1		(0x00000000)
  #define I2C_CNTRL2		(0x00000004)
  #define I2C_RD_DATA		(0x00000008)
  #define I2C_TX_DATA		(0x0000000c)
78aa0c342   roy zang   Tundra tsi108 hea...
122
123
124
  
  /*
   * I2C : Register Bit Masks and Reset Values
ee311214e   roy zang   Clean up the code...
125
   * definitions for every register
78aa0c342   roy zang   Tundra tsi108 hea...
126
127
128
   */
  
  /* I2C_CNTRL1 : Reset Value */
ee311214e   roy zang   Clean up the code...
129
  #define I2C_CNTRL1_RESET_VALUE				(0x0000000a)
78aa0c342   roy zang   Tundra tsi108 hea...
130
131
  
  /* I2C_CNTRL1 : Register Bits Masks Definitions */
ee311214e   roy zang   Clean up the code...
132
133
134
135
  #define I2C_CNTRL1_DEVCODE				(0x0000000f)
  #define I2C_CNTRL1_PAGE					(0x00000700)
  #define I2C_CNTRL1_BYTADDR				(0x00ff0000)
  #define I2C_CNTRL1_I2CWRITE				(0x01000000)
78aa0c342   roy zang   Tundra tsi108 hea...
136
137
  
  /* I2C_CNTRL1 : Read/Write Bit Mask Definition */
ee311214e   roy zang   Clean up the code...
138
  #define I2C_CNTRL1_RWMASK				(0x01ff070f)
78aa0c342   roy zang   Tundra tsi108 hea...
139
140
  
  /* I2C_CNTRL1 : Unused/Reserved bits Definition */
ee311214e   roy zang   Clean up the code...
141
  #define I2C_CNTRL1_RESERVED				(0xfe00f8f0)
78aa0c342   roy zang   Tundra tsi108 hea...
142
143
  
  /* I2C_CNTRL2 : Reset Value */
ee311214e   roy zang   Clean up the code...
144
  #define I2C_CNTRL2_RESET_VALUE				(0x00000000)
78aa0c342   roy zang   Tundra tsi108 hea...
145
146
  
  /* I2C_CNTRL2 : Register Bits Masks Definitions */
ee311214e   roy zang   Clean up the code...
147
148
149
150
151
152
153
154
155
  #define I2C_CNTRL2_SIZE					(0x00000003)
  #define I2C_CNTRL2_LANE					(0x0000000c)
  #define I2C_CNTRL2_MULTIBYTE				(0x00000010)
  #define I2C_CNTRL2_START				(0x00000100)
  #define I2C_CNTRL2_WR_STATUS				(0x00010000)
  #define I2C_CNTRL2_RD_STATUS				(0x00020000)
  #define I2C_CNTRL2_I2C_TO_ERR				(0x04000000)
  #define I2C_CNTRL2_I2C_CFGERR				(0x08000000)
  #define I2C_CNTRL2_I2C_CMPLT				(0x10000000)
78aa0c342   roy zang   Tundra tsi108 hea...
156
157
  
  /* I2C_CNTRL2 : Read/Write Bit Mask Definition */
ee311214e   roy zang   Clean up the code...
158
  #define I2C_CNTRL2_RWMASK				(0x0000011f)
78aa0c342   roy zang   Tundra tsi108 hea...
159
160
  
  /* I2C_CNTRL2 : Unused/Reserved bits Definition */
ee311214e   roy zang   Clean up the code...
161
  #define I2C_CNTRL2_RESERVED				(0xe3fcfee0)
78aa0c342   roy zang   Tundra tsi108 hea...
162
163
  
  /* I2C_RD_DATA : Reset Value */
ee311214e   roy zang   Clean up the code...
164
  #define I2C_RD_DATA_RESET_VALUE				(0x00000000)
78aa0c342   roy zang   Tundra tsi108 hea...
165
166
  
  /* I2C_RD_DATA : Register Bits Masks Definitions */
ee311214e   roy zang   Clean up the code...
167
168
169
170
  #define I2C_RD_DATA_RBYTE0				(0x000000ff)
  #define I2C_RD_DATA_RBYTE1				(0x0000ff00)
  #define I2C_RD_DATA_RBYTE2				(0x00ff0000)
  #define I2C_RD_DATA_RBYTE3				(0xff000000)
78aa0c342   roy zang   Tundra tsi108 hea...
171
172
  
  /* I2C_RD_DATA : Read/Write Bit Mask Definition */
ee311214e   roy zang   Clean up the code...
173
  #define I2C_RD_DATA_RWMASK				(0x00000000)
78aa0c342   roy zang   Tundra tsi108 hea...
174
175
  
  /* I2C_RD_DATA : Unused/Reserved bits Definition */
ee311214e   roy zang   Clean up the code...
176
  #define I2C_RD_DATA_RESERVED				(0x00000000)
78aa0c342   roy zang   Tundra tsi108 hea...
177
178
  
  /* I2C_TX_DATA : Reset Value */
ee311214e   roy zang   Clean up the code...
179
  #define I2C_TX_DATA_RESET_VALUE				(0x00000000)
78aa0c342   roy zang   Tundra tsi108 hea...
180
181
  
  /* I2C_TX_DATA : Register Bits Masks Definitions */
ee311214e   roy zang   Clean up the code...
182
183
184
185
  #define I2C_TX_DATA_TBYTE0				(0x000000ff)
  #define I2C_TX_DATA_TBYTE1				(0x0000ff00)
  #define I2C_TX_DATA_TBYTE2				(0x00ff0000)
  #define I2C_TX_DATA_TBYTE3				(0xff000000)
78aa0c342   roy zang   Tundra tsi108 hea...
186
187
  
  /* I2C_TX_DATA : Read/Write Bit Mask Definition */
ee311214e   roy zang   Clean up the code...
188
  #define I2C_TX_DATA_RWMASK				(0xffffffff)
78aa0c342   roy zang   Tundra tsi108 hea...
189
190
  
  /* I2C_TX_DATA : Unused/Reserved bits Definition */
ee311214e   roy zang   Clean up the code...
191
  #define I2C_TX_DATA_RESERVED				(0x00000000)
78aa0c342   roy zang   Tundra tsi108 hea...
192

ee311214e   roy zang   Clean up the code...
193
194
  #define TSI108_I2C_OFFSET	0x7000	/* offset for general use I2C channel */
  #define TSI108_I2C_SDRAM_OFFSET	0x4400	/* offset for SPD I2C channel */
78aa0c342   roy zang   Tundra tsi108 hea...
195

ee311214e   roy zang   Clean up the code...
196
  #define I2C_EEPROM_DEVCODE	0xA	/* standard I2C EEPROM device code */
78aa0c342   roy zang   Tundra tsi108 hea...
197
198
  
  /* I2C status codes */
ee311214e   roy zang   Clean up the code...
199
200
201
202
203
  #define TSI108_I2C_SUCCESS	0
  #define TSI108_I2C_PARAM_ERR	1
  #define TSI108_I2C_TIMEOUT_ERR	2
  #define TSI108_I2C_IF_BUSY	3
  #define TSI108_I2C_IF_ERROR	4
78aa0c342   roy zang   Tundra tsi108 hea...
204
205
  
  #endif		/* _TSI108_H_ */