0x09 - DeviceManufacturer ====
----
{{#invoke:Register table|head|600px| DeviceManufacturer 0x09}}
{{#invoke:Register table|row|31:24}}
| R-? || R-? || R-? || R-? || R-? || R-? || R-? || R-?
|-
| colspan="8" | ManufactureCode[7:0]
{{#invoke:Register table|row|23:16}}
| R-? || R-? || R-? || R-? || R-? || R-? || R-? || R-?
|-
| colspan="8" | ManufactureCode[15:8]
{{#invoke:Register table|row|15:8}}
| R-? || R-? || R-? || R-? || R-? || R-? || R-? || R-?
|-
| colspan="8" | Manufacture[7:0]
{{#invoke:Register table|row|7:0}}
| R-? || R-? || R-? || R-? || R-? || R-? || R-? || R-?
|-
| colspan="8" | Manufacture[15:8]
{{#invoke:Register table|foot}}
{{#invoke:Register table|definitions
| 31-24,23-16 | ManufactureCode | Manufacture is allowed to put whatever they want here?
| 15-8,7-0 | Manufacture | Code specifying the manufacturing company, see table below.
}}
{|
|-
! Manufacture !! ID Code
|-
| Toshiba || 0x0002
|-
| Fujitsu || 0x0003
|-
| NEC || 0x0005
|-
| Hitachi || 0x0007
|-
| Oki || 0x0009
|-
| LG Semicon || 0x000a
|-
| Samsung || 0x0010
|-
| Hyundai || 0x0013
|}
= RDRAM addressing =
Warning : In this paragraph, we describe RDRAM addressing within the RDRAM protocol. This is not to be confused with RDRAM addresses "as seen" by the CPU or RCP. See [[RDRAM Interface#Memory address|RI memory addressing]] paragraph for details about how the RI converts addresses between the two address spaces.
RDRAM protocol addresses RDRAM memory and registers using a 36bit address and a variety of commands :
* many types of memory read
* many types of memory write
* register read
* register write
* broadcast register write (all connected RDRAM will write the same value to the specified register)
The higher part of the address identify an RDRAM device, the lower part is an offset within the device (in register-space for register commands, and memory space for memory commands).
The procedure of identifying which RDRAM device is addressed by a given command + address is call Id matching.
It works as follow:
Given a 36 bit address Adr[35:0], we compute a "partially bit-swapped" AdrS[35:0] such that bits [28:20] and bits [19:11] are swapped on a bit by bit bases based on the value of SwapField (from AddressSelect register). Bits [35:29] and [10:0] are left untouched. This swapping of bits provides a flexible way of remapping addresses across banks of a given device and across devices to benefit from internal row caching. This can help increase DRAM hit rate in several applications.
The upper 16 bits (or 15bits for 2x{8,9}Mbit devices) of AdrS are then compared to IdField contained in DeviceId register. If both are equal the RDRAM device has a Id Match.
More formally this can be written as follow :
AdrS[35:29] = Adr[35:29]
AdrS[28:20] = ( SwapField[8:0] & Adr[19:11]) | (~SwapField[8:0] & Adr[28:20])
AdrS[19:11] = (~SwapField[8:0] & Adr[19:11]) | ( SwapField[8:0] & Adr[28:20])
AdrS[10:0] = Adr[10:0]
IdMatch = AdrS[35:M] == IdField[35:M]
with M = 21 for 2x{8,9]Mbit modules, M=20 for 1x{8,9}Mbit modules.
Remark : An IdMatch doesn't mean necessarily that the RDRAM device will act on the request, and conversely a non matching RDRAM device can still act on a request. Other factors such as DeviceEnable bit from ModeRegiter, SIn pinout can inhibit a request, and the broadcast register write can force a request even on non matching RDRAM device.
= Current Control calibration =
Any RDRAM device (module and controller) wishing to "talk" on the RDRAM channel must configure its output current IOL controlled by the current control ('''CC''' for short) register.
2 modes are possible to configure the current control register :
# Manual mode. In this mode, the value of the current control register is linearly correlated to IOL, such that IOL @ CC=63 -> 0mA, and IOL @ CC=0 -> Imax (Imax will vary between RDRAM due to process differences). In this mode, fluctuation due to temperature, change over time and are not compensated, so it may require a manual periodic readjustment. Note also that, in this mode, the CC register value read will be inverted.
# Automatic mode. In this mode, small fluctuations are automatically corrected, so no further readjustment should be required. The relation between CC value and IOL is still mostly linear but with a different slope. Note also that, in this mode, the CC register value read will be an internally generated one, not the one used to program the CC register.
The purpose of the CC calibration procedure is to find the CC value in Automatic mode that maximize the signal margin.
One possible approach to do so is described below :
We define the quantity CCi = 63-CC (= CC^63 = CC "inverted") which is more natural to use because IOL is proportional to CCi.
We define a memtest80 function which writes an octbyte with all bits set to '1' (eg. UINT64_C(0xffffffffffffffff)) at the start of the RDRAM device to test, and read back the 6th byte of the previously written octbyte. It then counts how many bits were set. This write / readback is done 10 times, and the cumulated number of '1' bits read is returned. For a non calibrated RDRAM device, the number is less than 80 (eg. the device can't always transfer back '1' because of inadequate VOL). Basically, the returned value gives a score (over 80) of the quality of the RDRAM device transmission with the current CC value.
1. Estimate the value of CCi in manual mode which gives a VOL almost equal to VREF.
This can be done by writing increasing CCi values in manual mode and accumulating the weighted difference CCi * (memtest80 - previous_memtest80) for CCi = 0..N (N being the first value of CCi which allows to read all 80 bits during memtest80; N <= 63).
This weighted sum of CCi*(memtest80-previous_memtest80) for CCi = 0..N, divided by 80 (minus 0.5 to account for accumulation/rounding errors) is an estimate of CCi which gives VOL ~ VREF.
2. Multiply this value by 2.2: doubling the CCi value, with 10 percent margin, should give a reasonable estimate of CCi such that VOL is symmetric to VOH with respect to VREF (eg. it maximizes signal margin).
3. Convert the obtained manual CCi value to auto CCi. Here the procedure is again iterative and tries to find the value CCi to write in Auto mode which minimizes the absolute difference between the CCi value read in auto mode (remember this is an internally generated value different from the CCi value written) and the target manual CCi.
4. Repeat this whole procedure 4 times and average the obtained auto CCi value.
In practice steps 1., 2. and 3. avoid usage of floating points and rescale some values with an appropriate scaling factor (here 80x10) to avoid loss of precision due to integer computations.
= Known RDRAM Console Chip Configurations =
{| class="wikitable"
|+
!N64 Version
!Board revision
!Region
!Number of RDRAM Chips
!Size per Chip(Mbytes)
!Size per Chip(Mbits)
|-
|NUS-001
|(P) - 01
|PAL
|2
|2.25Megabytes
|18Mbit
|-
|NUS-002
|(P) - 02
|PAL
|1
|4.5Megabytes
|36Mbits
|}
= Known RDRAM Expansion Pak Configurations =
{| class="wikitable"
|+
!Expansion Pak Type
!Number of RDRAM Chips
!Size per Chip(Mbytes)
!Size per Chip(Mbits)
|-
|Jumper Pak (Nintendo Official)
|0
|0
|0
|-
|Expansion Pak (Nintendo Official)
|1
|4.5Megabytes
|36Mbits
|}
There are 3rd party Expansion Paks that have 2 chips which are both 2.25Megabytes each. Please provide images and makers here.
= Initialization Sequence =
This Initialization sequence is based on the 6102 CIC boot code
'''[[:File:Cncrntug.pdf|File:Cncrntug.pdf]]'''
RDRAM Initialization procedure as implemented in IPL3:
1. a. Enable RI Auto Current
b. let it settle by waiting using countdown(8800)
c. load RI CC value
2. Enable RI T/R select
3. a. Force RI_MODE reset, disable R/T stop
b. wait using countdown(4)
4. a. Force RI_MODE standby, enable R/T stop
b. wait using countdown(32)
5. a. Set MI INIT mode + length=15 by writing 0x10f to [MI_MODE_REG]
b. Setup all RDRAM delays (AckWin=5,Read=7,Ack=3,Write=1) by writing 0x18082838 to [0xa3f80004] [bcast]
6. a. Setup all RDRAM refresh row to 0 [bcast]
b. Move all RDRAM modules to top of address space deviceid = 0x80000000 [bcast]
7. a. compute rdram reg space size (reg_step) based on RCP version (RCPv1: 128, RCPv2: 256)
b. init top rdram reg pointer (RDRAM_REGS_BASE + 32 * reg_step)
8. First pass which walk through at most 8 RDRAMs and for valid ones:
a. place them at next 2MB boundary (eg. rdram_deviceid = i * 0x08000000)
b. compute optimal (auto) current calibration value for RDRAM module and apply it
c. exit first pass loop if cc value is zero, eg. no RDRAM module is present
d. read device description registers (device_type + manufaturer). These reads must be surrounded by MI_MODE= SET_DRAM_REG and CLR_DRAM_REG because individual rdram registers are accessed.
e. based on device description, setup optimal RAS timing
f. store RDRAM parameters (CC, geometry {eg. col, bank, row fields from device_type}) for second pass
g. update values which tracks how to reorder all 2MB RDRAM modules before the 1MB, how many modules are effectively presents and the 2MB_bitfield (=2^(number of 2MB modules)-1, because all 2MB banks will be placed first)
9. a. Disable all RDRAM modules (rdram_mode = 0xc4000000) [bcast]
b. and move them all back to top of address space (rdram_deviceid = 0x80000000) [bcast]
10. Second pass iterate through all modules discovered during the first pass and:
a. reorder them so that all 2MB modules are placed before 1MB modules
b. write previously computed optimal CC for each module
c. touch RDRAM modules to settle their timing circuits.
1MB modules undergo 4 consecutive reads (ptr+k*0x00080000, k=0..1) x 2
2MB modules undergo 8 consecutive reads (ptr+k*0x00080000, k=0..3) x 2
11. a. setup RI refresh register = 0x63634 | 2MB_bitfield << 19
b. do a dummy read of RI refresh reg
12. Return amount of detected RDRAM.
Trivia: there is very likely a copy-paste error in the original IPL3 code when incrementing t6 in the second pass. It should have been t8 so we can place next 1MB module at next slot. But I guess it went unnoticed because retail models don't use 1MB modules.
= Expansion Pak Detection =
The typical way to detect how much memory is installed is to probe it.
LibUltra provides a function called osGetMemSize() which does this. The function writes different values at addresses in the uncached KSEG1 direct map, starting at 0xa0300000, and then reads the values back. It tries successively higher addresses, jumping by 1 MB each time through the loop. It returns the amount of RAM which it successfully wrote and read back, rounded up to a number of megabytes.
// C-like pseudocode...
u32 osGetMemSize(void) {
// Base address of RAM in kseg1.
uintptr_t base_addr = 0xa0000000;
uintptr_t megabyte = 1024 * 1024;
// Address where we will probe.
uintptr_t cur_addr = kseg1 + 3 * megabyte;
while (true) {
write to addr;
read from addr;
if (value read != value written) {
break;
}
cur_addr += megabyte;
}
return cur_addr - base_addr;
}
During boot, IPL3 will also write the amount of RAM available, in bytes, to a 32-bit value at address 0x80000318 (or 0x800003f0, for CIC 6105). On retail hardware, this should always have the value 0x400000 (no expansion pak) or 0x800000 (expansion pak). When using LibUltra, this variable can be accessed with the name osMemSize, which is defined like this:
extern u32 osMemSize;
LibDragon provides the the amount of memory installed with the get_memory_size() function.
= Drawbacks and Limitations =
==== Opinion ====
{{Blockquote
|text=RDRAM has excellent data transfer speed for the era (bytes per second) but due to the protocol used and serial interface, memory transactions were somewhat slower (how much time it took from starting a read/write operation to finishing it). In practice, you may find that the available memory bandwidth is a limiting factor for the performance of your game.
See: [https://retrocomputing.stackexchange.com/questions/17564/how-fast-was-rambus-compared-to-regular-edo-ram How fast was Rambus compared to regular EDO RAM?]
|author=Vanadium
}}
= Datasheets =
Several manufacturers produced compatible "Base RDRAM" modules such as :
* [https://www.datasheetarchive.com/pdf/download.php?id=ba4c2602c3e903353ab08f0b5ce7b7ba8aff76&type=O&term=GM73V1892AH16L LG GM73V1892AH16L]
* [https://www.datasheetarchive.com/pdf/download.php?id=80d868b3d8d4b492b8255b3cf45587bffb5c32&type=P&term=uPD488170L NEC uPD488170L]
* [https://www.datasheetarchive.com/pdf/download.php?id=98c391ce728eda7ff786fc9edfaa7c8d71859d&type=M&term=MSM5718B70 OKI MSM5718B70]
* [https://www.datasheetarchive.com/pdf/download.php?id=187da05b037831407d99bb6a7a103aa0d6dc80&type=O&term=TC59R1809 Toshiba TC59R1809VK TC59R1809HK (18Mbit chip)]
* [https://datasheet.datasheetarchive.com/originals/scans/Scans-067/DSA2IH00203571.pdf Toshiba TC59R0808HK (8Mbit chip)]
Reference : [https://bitbuilt.net/forums/index.php?threads/n64-expansion-paks-ram-part-numbers.3943/]
[[Category:Motherboard_components]]
= iQue Player =
The iQue Player replaced RDRAM with an off-the-shelf K4D263238E-GC33 16MiB DDR SDRAM differentially clocked at 192MHz for a peak bandwidth of up to 1536MB/s, about 3x that of N64's RDRAM. The bus latency is also much lower as it does not need to implement a packet protocol for transferring control signals, addresses and data over a small number of shared pins in the way RDRAM does; the SDRAM has a 32-bit data bus, a 12-bit address bus for both row and column addresses, and additional lines for other control signals.
However this SDRAM does not have an extra bit per byte as in RDRAM, this had to be emulated. This appears to have been achieved by halving the amount of available RAM to an effective 8MiB while using the remaining 8MiB to (very inefficiently) store coverage bits. The memory controller in the iQue Player SoC probably performs 2x32-bit transfers for each 32-bit word transferred, in which the first transfer contains the data and the second transfer contains coverage bits in the least significant bit of each byte. In the virtual memory map, addresses 0x81xxxxxx can be accessed to bypass the memory controller's translation step to get a raw view of the memory, which looks like:
| 0x0 | 0x4 | 0x8 | 0xC
-----------+-------------------------+---------------------------+-------------------------+---------------------------
0x81000000 | [32 bits at 0x80000000] | [Coverage for 0x80000000] | [32 bits at 0x80000004] | [Coverage for 0x80000004]
0x81000010 | [32 bits at 0x80000008] | [Coverage for 0x80000008] | [32 bits at 0x8000000C] | [Coverage for 0x8000000C]
...
For example writing two words at 0x80000000 to:
| 0x0 | 0x4
-----------+------------+------------
0x80000000 | 0xFF00FF00 | 0x00FF00FF
produces the following when read back at 0x81000000:
| 0x0 | 0x4 | 0x8 | 0xC
-----------+------------+------------+------------+------------
0x81000000 | 0xFF00FF00 | 0x01000100 | 0x00FF00FF | 0x00010001
Writing to 0x80000000 causes changes in both 0x81000000 and 0x81000004. It is also possible to write directly to 0x81000000: writing to data words are mirrored in 0x80000000 without disturbing coverage, while writing coverage leaves the corresponding data unchanged. If only using the CPU this allows all 16MiB of SDRAM to be used, however it is not very practical as it does not behave well with respect to DMA.