Addressing and access rules
Three address views that must never be mixed [spec: docsClean/02]:
DDRC/CFG byte offsets —
DDRC_BASE + off; host 32-bit accesses.Host DPHY word index
i—DPHY_BASE + 4*i; each 32-bit host word carries one 16-bit PHY CSR in its low half.ARC addresses inside the PMU —
0x0000xxxxIMEM,0x8000xxxxDMEM,0x90xxxxxxPHY CSRs / mailbox.
Conversions
ARC CSR address = 0x90000000 | (i << 1)
ARC DMEM address = 0x80000000 + 2 * (i - 0x58000) (0x58000 <= i < 0x60000)
CSR index = base | (rank << 12) | (lane << 8) | offset (OR, never +)
Firmware helpers: PHY_CSR_ARC(), PHY_IDX(), DMEM_ARC() in
src/hal/mmio.h.
Windows
Host index |
ARC |
Use |
|---|---|---|
|
via CSRs |
ACSM SRAM, 4096 halfwords |
|
|
PMU IMEM, 64 KiB |
|
|
message block ( |
|
|
host parameter area (full training: up to |
|
|
cleared by the host up to |
|
|
our DMEM image (.rodata/.data), loaded by our SPL patch [design] |
|
|
transient host scratch (256 bytes) — unused by us |
|
|
DMEM end, initial stack top |
Access widths
On the PMU side, DMEM shared with the host and every 0x90xxxxxx register
are 16-bit: only volatile 16-bit (or 8-bit for byte fields) accesses
[spec: docsClean/12, BR-03]. Our own stack and .bss in DMEM are accessed
with ordinary 32-bit loads/stores by the compiler; whether that is safe in
every DMEM range is checked by experiment [open].
Warning
Never access DPHY/PMU MMIO from Linux (/dev/mem): reported to stall the
SoC until a power cycle [spec: docsClean/14]. Re-verification is scheduled
for the later validation phase.
Host access after a PMU run
What the SPL can reach once the PMU has run and been stalled
(0xd0099 = 1, 0xd0000 = 0) [exp 016, exp 019]:
Target |
Behaviour |
|---|---|
PHY CSRs |
read and write work with |
ACSM SRAM |
read and write work with |
DMEM (message |
reads work, writes are dropped with |
block) |
(a |
docsClean/12 gives the sequence for a DMEM write between two runs: 0xd0099 =
1, 0xd0000 = 0, ``0xc0080 = 7``, write, 0xd0000 = 1, then
0xd0099 = 9, 1, 0 [spec, not yet tried]. The initial load, before the
first start, works with the vendor flow as is.
A second start of the loaded firmware (0xd0000 = 1, 0xd0099 = 9, 1,
0) works without reloading IMEM or DMEM: the firmware runs again from its
entry and the message block keeps what the first run left [exp 016].