mirror of
https://github.com/Creased/RCM-Emulator.git
synced 2026-12-06 02:48:11 +01:00
Report the EMC DLL's code from its calibration start value
EMC_DIG_DLL_STATUS.DLL_OUT (10:0) read 0. TRM 18.11.2.219 gives the basis the earlier note said was missing: EMC_DLL_CFG_1's DDLLCAL_CTRL_START_TRIM (10:0, reset 0x20) is the DLL calibration's start value, which the timing table sets per frequency. With no delay line to drift, calibration has nothing to move it by, so DLL_OUT now reports the channel's start trim once the DLL locks. EMC_DLL_CFG_1 reads its reset value until written. Minerva's _digital_dll_prelock() returns the value and nothing reads it further; DRAM training and the 800/1600 MHz switching are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YYewwDPujjo5B2xRyC5Grb
This commit is contained in:
2 files changed
+19
-7
No files matched your search
@@ -204,7 +204,12 @@ frequency-switching module, depend on:
|
||||
400 ps tDQS2DQ. Minerva divides by that count.
|
||||
- **Digital DLL.** `EMC_DIG_DLL_STATUS` reports lock as soon as the DLL is
|
||||
(re)started; `EMC_CFG_DIG_DLL.CFG_DLL_EN` reads back as written, which is
|
||||
what Minerva spins on around each DLL restart.
|
||||
what Minerva spins on around each DLL restart. The DLL's code, `DLL_OUT`
|
||||
(10:0), is where its calibration starts: the channel's
|
||||
`EMC_DLL_CFG_1.DDLLCAL_CTRL_START_TRIM` (10:0, reset 0x20, TRM
|
||||
18.11.2.219), which the timing table programs per frequency. With no
|
||||
delay line to drift, calibration has nothing to move it by. (Minerva's
|
||||
`_digital_dll_prelock()` returns it; nothing reads it further.)
|
||||
- **Clock change.** A new source or divisor in CAR `CLK_SOURCE_EMC` (TRM
|
||||
5.2.73) is the CAR/EMC handshake: the EMC replays the writes queued in its
|
||||
clock-change FIFO (`EMC_CCFIFO_DATA` / `_ADDR`) and raises
|
||||
@@ -215,8 +220,6 @@ frequency-switching module, depend on:
|
||||
DRAM active and the state machines idle.
|
||||
- **Measured clock.** bdk's PTO counter measures the EMC at the modelled
|
||||
clock (the measured 204 MHz figure at the boot clock).
|
||||
- **Not modelled.** The DLL's delay code (`DLL_OUT`) reads 0: the TRM gives
|
||||
no tap delay to derive it from.
|
||||
|
||||
With the stock `bootloader/` folder, hekate's IPL trains 204, 800 and
|
||||
1600 MHz, and Nyx then switches between 800 and 1600 MHz on every GUI loop,
|
||||
|
||||
+13
-4
@@ -3598,8 +3598,10 @@ void fuse_write(EmuState *state, uint64_t addr, uint32_t val) {
|
||||
// oscillator count, and any other mode register what was last written.
|
||||
//
|
||||
// Digital DLL. It locks as soon as it is (re)started: EMC_DIG_DLL_STATUS
|
||||
// reports DLL_LOCK and DLL_PRIV_UPDATED. The DLL code itself (DLL_OUT) is
|
||||
// not modelled and reads 0.
|
||||
// reports DLL_LOCK and DLL_PRIV_UPDATED. Its code, DLL_OUT (10:0), is
|
||||
// where calibration starts, the channel's EMC_DLL_CFG_1
|
||||
// DDLLCAL_CTRL_START_TRIM (10:0, reset 0x20, TRM 18.11.2.219): with no
|
||||
// delay line to drift, calibration has nothing to move it by.
|
||||
//
|
||||
// Clock change. A new source or divisor in CAR CLK_SOURCE_EMC starts the
|
||||
// CAR/EMC clock-change handshake: the EMC replays the writes queued in its
|
||||
@@ -3624,6 +3626,7 @@ static constexpr uint32_t EMC_CCFIFO_ADDR = 0x3E8;
|
||||
static constexpr uint32_t EMC_CCFIFO_DATA = 0x3EC;
|
||||
static constexpr uint32_t EMC_CCFIFO_STATUS = 0x3F0;
|
||||
static constexpr uint32_t EMC_FBIO_CFG7 = 0x584;
|
||||
static constexpr uint32_t EMC_DLL_CFG_1 = 0x5E8;
|
||||
|
||||
static constexpr uint32_t EMC_INT_CLKCHANGE_COMPLETE = 1u << 4;
|
||||
static constexpr uint32_t EMC_INT_MRR_DIVLD = 1u << 5;
|
||||
@@ -3747,8 +3750,14 @@ uint32_t emc_read(EmuState *state, uint64_t addr) {
|
||||
case EMC_CFG_DIG_DLL:
|
||||
// Bits 31, 30, 26, 4 and 1 are write-1 triggers; they read 0.
|
||||
return mmio_regs.get(addr) & ~0xC4000012u;
|
||||
case EMC_DIG_DLL_STATUS:
|
||||
return (1u << 17) | (1u << 15); // DLL_PRIV_UPDATED | DLL_LOCK
|
||||
case EMC_DIG_DLL_STATUS: {
|
||||
// DLL_PRIV_UPDATED | DLL_LOCK, and DLL_OUT at the calibration start.
|
||||
uint32_t cfg1 = mmio_regs.get((ch ? EMC1_BASE : EMC0_BASE) + EMC_DLL_CFG_1,
|
||||
0x20);
|
||||
return (1u << 17) | (1u << 15) | (cfg1 & 0x7FF);
|
||||
}
|
||||
case EMC_DLL_CFG_1:
|
||||
return mmio_regs.get(addr, 0x20);
|
||||
case EMC_CCFIFO_STATUS:
|
||||
return (uint32_t)emc.ccfifo.size();
|
||||
case EMC_FBIO_CFG7:
|
||||
|
||||
Reference in new issue
Block a user