ri_programming_guide 12.4 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 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 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422
============================================================================
RI/RDRAM register read/write operations
============================================================================

To read/write an RI register, use the address described in the
"RI Registers" section below.

To write an RDRAM register, use the following format:

	Addresses between 0x03f?_???? are decoded as follows:
	[31:20] - 0x03f
		  Select RDRAM registers

	[19]    - Enable global write.
		  0 - Write one RDRAM.
		  1 - Write all RDRAMs.

	[18:10]	- RDRAM packets address bits [29:21].

	[9:0]	- RDRAM packet address bits [9:0].

	All other RDRAM packet address bits ([35:30] and [20:10]) are set to
	0 for register writes.  Therefore, to write to RDRAM 0, use the
	addresses 0x03f0_0000 .. 0x03f0_03fc.  To write to RDRAM 1, use the
	addresses 0x03f0_0400 .. 0x03f0_07fc.  To write to both RDRAMs, use
	the addresses 0x03f8_0000 .. 0x03f8_03fc.  Note that these
	addresses will change for RCP 2.

To read an RDRAM register, use the following format:

	Addresses between 0x03f?_???? are decoded as follows:
	[31:20] - 0x03f
		  Select RDRAM registers

	[19]    - set to zero.

	[18:10]	- RDRAM packets address bits [29:21].

	[9:0]	- RDRAM packet address bits [9:0].

	All other RDRAM packet address bits ([35:30] and [20:10]) are set to
	0 for register reads.  Therefore, to read to RDRAM 0, use the
	addresses 0x03f0_0000 .. 0x03f0_03fc.  To read to RDRAM 1, use the
	addresses 0x03f0_0400 .. 0x03f0_07fc.  Also, because reading RDRAM
	registers is not consistent with reading RDRAM memory, you must also
	enable the CPU interface to format the RDRAM data.  Prior to reading
	an RDRAM register, issue the write:

		write 0x0000_2000 @ 0x0430_0000

	After reading the RDRAM registers, clear this mode by issuing the
	write:

		write 0x0000_1000 @ 0x0430_0000

Note that this entire initialization procedure will change for RCP 2 to
support 8 Mbit RDRAMs.


============================================================================
RI Registers
============================================================================

0x0470_0000	mode (read/write)
----------------------------------------------------------------------------
		[1:0]	operating mode
			This controls what smode packets are sent to the
			RDRAM over the BusEnable pin.  The options are:
			00 : Reset - force continuous smode packets.  If
			     this is asserted for 272 BusClk cycles, all
			     RDRAMs will reset.
			01 : Active - Send an smode packet every 4 BusClk
			     cycles.  The forces the RDRAMs to be
			     continuously active.  This mode is for debug
			     only.
			10 : Standby - Send an smode packet before each
			     RDRAM transaction.  This allows the RDRAMS to
			     enter standby mode following each transaction
			     and the reactivated at the start of each
			     transaction. This is the normal operating mode.
			11 : Reserved.

		[2]	stop_t_active
			This enables automatic powerdown of the RAC transmit
			logic while idle.
			0 : Disable transmit powerdown.  For debug only.
			1 : Enable transmit powerdown. Normal operating
			    mode.

		[3]	stop_r_active
			This enables automatic powerdown of the RAC receive
			logic while idle.
			0 : Disable receive powerdown.  For debug only.
			1 : Enable receive powerdown. Normal operating mode.


0x0470_0004	config (read/write)
----------------------------------------------------------------------------
		[5:0]	current control input
			This register drives the CCtlI input of the RAC.
			It supplies the Rambus current drive value in manual
			current control mode.

		[6]	current control enable
			This register drives the CCtlEn input of the RAC.
			It selects the automatic or manual current control.
			0 : Manual CCtl - current control value loaded from
			    current control input.
			1 : Automatic CCtl - current control value loaded
			    from automatic current control logic.


0x0470_0008	current load (write)
----------------------------------------------------------------------------
		[]	Any write causes a pulse on CCtlLd input of the RAC.
			This causes a new current control value to be
			loaded.


0x0470_000c	select (read/write)
----------------------------------------------------------------------------
		[3:0]	receive select
			This drives the RDsel and RCSel inputs of the RAC.
			See the RAC manual for a description.
			The only legal values for this register are:
			000 : Disable receive.
			100 : Enable receive.

		[3:0]	transmit select
			This drives the BDsel, BCSel and BESel inputs of the
			RAC.  See the RAC manual for a description.
			The only legal values for this register are:
			000 : Disable transmit.
			001 : Enable transmit.


0x0470_0010	refresh (read/write)
----------------------------------------------------------------------------
		[7:0]	clean refresh delay
			The delay following a clean refresh request.  The
			actual delay is this value + 2.

		[15:8]	dirty refresh delay
			The delay following a dirty refresh request.  The
			actual delay is this value + 2.

		[16]	refresh bank
			The next bank to be refreshed.  This register is
			incremented (inverted) following each refresh.

		[17]	refresh enable
			Enable automatic refresh.  The options are:
			0 - Disable automatic refresh.
			1 - Generate a refresh once each video horizontal
			    retrace.

		[18]	refresh optimize
			Enable refresh timing optimization.  This includes
			selecting clean refresh if the banks to be refreshed
			have not been written and clearing dirty banks.
			Options include:
			0 - Disable refresh optimize.
			1 - Enable refresh optimize.

		[19]	refresh multibank 0/1
			Indicated whether banks 0 and 1 are part of a
			a multibank (16 Mbit) device.  This only effects
			refresh optimization.  This register is only
			available in RCP 2.  Options include:
			0 - Banks 0 and 1 are in separate 8 Mbit devices.
			1 - Banks 0 and 1 are in the same 16 Mbit device.
			
		[20]	refresh multibank 2/3
			Indicated whether banks 2 and 3 are part of a
			a multibank (16 Mbit) device.  This only effects
			refresh optimization.  This register is only
			available in RCP 2.  Options include:
			0 - Banks 0 and 1 are in separate 8 Mbit devices.
			1 - Banks 0 and 1 are in the same 16 Mbit device.

		[21]	refresh multibank 4/5
			Indicated whether banks 4 and 5 are part of a
			a multibank (16 Mbit) device.  This only effects
			refresh optimization.  This register is only available
			in RCP 2.  Options include:
			0 - Banks 0 and 1 are in separate 8 Mbit devices.
			1 - Banks 0 and 1 are in the same 16 Mbit device.

		[22]	refresh multibank 6/7
			Indicated whether banks 6 and 7 are part of a
			a multibank (16 Mbit) device.  This only effects
			refresh optimization.  This register is only
			available in RCP 2.  Options include:
			0 - Banks 0 and 1 are in separate 8 Mbit devices.
			1 - Banks 0 and 1 are in the same 16 Mbit device.


0x0470_0014	latency (read/write)
----------------------------------------------------------------------------
		[3:0]   DMA latency/overlap
			Sets maximum DMA latency.  This is to allow the
			higher bandwidth video modes to operate.  The
			optimal (and default) value is 0xf and should not
			be changed unless required by the video mode.

0x0470_0018	error (read)
----------------------------------------------------------------------------
		[0]     nack error
			This bits is set if the RDRAM did not respond with
			a nack.  Only RDRAM memory R/W operations are
			checked. RDRAM register R/W operations will not
			effect this register.

		[1]     ack error
			This bits is set if the RDRAM did not respond with
			a ack.  Only RDRAM memory R/W operations are
			checked. RDRAM register R/W operations will not
			effect this register.

		[2]	overrange
			This bit is set if a memory access beyond the RDRAM
			memory limit (4 Mbyte for RCP 1, 8 Mbyte for RCP 2)
			is requested.


0x0470_0018	error (write)
----------------------------------------------------------------------------
		[]      any write clears all error bits


0x0470_001c	bank status (read/write)
----------------------------------------------------------------------------
		[7:0]	bank[7:0] dirty bits
			Status of the shadow RDRAM dirty bits.
			This register is only available in RCP 2.

		[7:0]	bank[7:0] valid bits
			Status of the shadow RDRAM valid bits.
			This register is only available in RCP 2.




============================================================================
RI/RAC/RDRAM initialization sequence:
============================================================================

 0) Following RAC reset, the RAC inputs are:
	SynClkIn	- SynClkFd
	TData		- 0x0 (unknown during reset)
	B*Sel		- 0x0
	R*Sel		- 0x0
	Reset		- 0x0
	StopT		- 0x1 (low during reset)
	StopR		- 0x1
	PwrUp		- 0x1
	ExtBE		- 0x0
	PhStall		- 0x0
	CCtlLd		- 0x0
	CCtlEn		- 0x0
	CCtlI		- unknown
	SCANMode	- 0x0
	SCANClk		- 0x0
	SCANEn		- 0x0
	SCANIn		- 0x0
	BISTMode	- 0x0
	IOSTMode	- 0x0
	ByPass		- 0x0
	ByPSel		- 0x1
	tclkASIC	- 0x0
	rclkASIC	- 0x0
	
 1) Enable RAC auto-calibration current control. (See below)
	set CCtlI to 0x00
	set CCtlEn to 1

	write 0x0000_0040 @ 0x0470_0004

    However, because the Auto current control in the RAC of RCP 1 is broken,
    we must instead disable auto-calibration current control. Instead of
    the above do the following:
	set CCtlI to 0x10
	set CCtlEn to 0

	write 0x0000_0010 @ 0x0470_0004

 2) Wait for new current control value.

	delay 4096 RCP clock cycles

 3) Load the current control register.
	set CCtlLd to 1 for one RCP clock

	write 0x0000_0000 @ 0x0470_0008

 4) Set transmit and receive selects
	set R*Sel to 4
	set B*Sel to 1

	write 0x0000_0014 @ 0x0470_000c

 5) Reset all RDRAM devices.
	set BusEnable to 0xff
	set StopT to 0x0
	set StopR to 0x0

	write 0x0000_0000 @ 0x0470_0000

 6) Wait for RDRAM devices to reset

	delay 100 RCP clock cycles

 7) Enable RDRAM access
	set default BusEnable to 0x00 (auto-enable)
	set default StopT to 0x1 (auto-enable)
	set default StopR to 0x1 (auto-enable)

	write 0x0000_000e @ 0x0470_0000

 8) Initialize the Delay register in all RDRAMs.
	set AckWinDelay to 0x28
	set ReadDelay to 0x38
	set AckDelay to 0x18
	set WriteDelay to 0x08

	write 0x0000_010f @ 0x0430_0000
	write 0x1808_2838 @ 0x03f8_0008

 9) Enable RDRAM auto-calibration current control in all RDRAMs.  This
    is optional and my not be implemented.
	global set CE to 0x1, clear all other Mode register bits.

	write 0x8000_0000 @ 0x03f8_000c

10) Initialize the RefRow register in all RDRAMs.
	global set RowField to 0x0
	global set BankField to 0x0

	write 0x0000_0000 @ 0x03f8_0014

11) Move all RDRAMs to the top of the address space
	global set IdField to 0x0001

	write 0x0800_0000 @ 0x03f8_0004

12) Move the first RDRAM to the bottom of the address space.
	set IdField of first RDRAM to 0x0000

	write 0x0000_0000 @ 0x03f0_0404

13) Activate the first RDRAM.
	set CE and DE of the first RDRAM

	write 0x8200_0000 @ 0x03f0_000c

14) Activate the second RDRAM (no effect if second RDRAM is absent.)
	IdField already set to 0x0001
	set CE and DE of the second RDRAM

	write 0x8200_0000 @ 0x03f0_040c

15) Determine the first RDRAM type by reading the DeviceManufacture
    register.

	write 0x0000_2000 @ 0x0430_0000
	read 0x03f0_0024
	write 0x0000_1000 @ 0x0430_0000

16) Use the DeviceManufacture value to select a RasInterval value.
	set the RasInterval register of the first RDRAM

	write 0x101c_0a04 @ 0x03f0_0018 (for Manufacture == NEC)
	-or-
	write 0x????_???? @ 0x03f0_0018 (for Manufacture == non-zero)
	-or-
	not present (for Manufacture == zero) (illegal condition)

17) Determine the second RDRAM type by reading the DeviceManufacture
    register.

	write 0x0000_2000 @ 0x0430_0000
	read 0x03f0_0424
	write 0x0000_1000 @ 0x0430_0000

18) Use the DeviceManufacture value to select a RasInterval value.
	set the RasInterval register of the second RDRAM

	write 0x101c_0a04 @ 0x03f0_0418 (for Manufacture == NEC)
	-or-
	write 0x????_???? @ 0x03f0_0418 (for Manufacture == non-zero)
	-or-
	not present (for Manufacture == zero)

19) Tickle the first RDRAM

	read 0x0000_0000
	read 0x0008_0000
	read 0x0010_0000
	read 0x0018_0000
	read 0x0000_0000
	read 0x0008_0000
	read 0x0010_0000
	read 0x0018_0000

20) Tickle the second RDRAM (if present)

	read 0x0020_0000
	read 0x0028_0000
	read 0x0030_0000
	read 0x0038_0000
	read 0x0020_0000
	read 0x0028_0000
	read 0x0030_0000
	read 0x0038_0000

21) Set refresh interval and enable refresh
	set the dirty refresh interval to 0x38
	set the clean refresh interval to 0x36
	enable refresh
	enable refresh optimization

	write 0x0006_3634 @ 0x0470_0010