HarvOS MMIO

Memory-mapped I/O

HarvOS uses a compact MMIO region at 0xffff0000. The CPU accesses it through normal load/store instructions; MPU and SoC address decode decide which block responds.

MMIO map

BaseBlockUse
0xffff0000Debug / kernel modelDebug PC, trap cause, entropy, boot status and DMA status.
0xffff0030IMEM loaderControlled code load into IMEM and lock.
0xffff0040HNETPacket-DMA network device for HarvTTP and HarvSQL.
0xffff0080USB hostUSB host controller, DMA and PHY/port control.
0xffff00c0HPS blockMiSTer/HPS-compatible access to two block images.

IMEM loader

OffsetNameDescription
0x00IDIdentification/status read path.
0x04CTRLBits: WRITE, LOCK, CLEAR.
0x08ADDRTarget IMEM address.
0x0cDATA32-bit instruction word.

HNET packet-DMA NIC

RegisterOffsetDescription
CTRL0x04ENABLE, LOOPBACK, CLEAR, PROMISC, SIM_LINK.
STATUS0x08LINK, BUSY, DONE, FAULT, IRQ, RX_OP, TX_READY, RX_VALID, RX_ERROR.
IRQ_EN/IRQ_STAT0x0c/0x10RX_DONE, TX_DONE, FAULT and LINK events.
RX_ADDR/RX_LEN0x14/0x18DMA target for incoming frames.
TX_ADDR/TX_LEN0x20/0x24DMA source for outgoing frames.
MAC_LO/MAC_HI0x28/0x2cVirtual MAC address.
FRAME_LEN0x30Actual RX frame length.

USB host and HPS block bridge

The USB host block exposes registers for DMA address/length, command, port control, frame, actual length, token, PHY, packet, retry and engine status. The HPS block bridge is the current practical way to pass the two USB images into the MiSTer/Verilator environment as block devices.