下面给你画一张**"LS2K1000 完整 SoC 启动 + 系统级架构图"**,按你这段 PMON 代码真实执行路径 + 硬件拓扑一起融合(偏"芯片bringup视角")。
我分两层给你:
- 🔷 Boot启动链路(时间轴)
- 🔷 SoC硬件架构(CPU / DDR / PCIe / SATA / GMAC)
🔥 LS2K1000 SoC 完整启动架构图(系统级)
┌──────────────────────────────────────────────────────────────┐
│ RESET VECTOR │
└──────────────────────────────────────────────────────────────┘
│
▼
┌──────────────────────────────────────────────────────────────┐
│ CPU0 (Boot Core) │
│ _start @ PMON │
│ │
│ - SPI Flash boot │
│ - stack setup │
│ - CSR init │
└──────────────────────────────────────────────────────────────┘
│
┌──────────────────────┼──────────────────────┐
▼ ▼ ▼
┌──────────────┐ ┌────────────────┐ ┌────────────────────┐
│ SPI / BootROM │ │ SMP control │ │ Interrupt / CSR │
│ - fetch PMON │ │ - slave hold │ │ - ebase / tlbvec │
└──────────────┘ └────────────────┘ └────────────────────┘
│
▼
┌──────────────────────────────────────────────────────────────┐
│ EARLY BOARD INIT (PMON STAGE 1) │
│ │
│ locate() │
│ ├─ GPIO reset │
│ ├─ beep │
│ ├─ watchdog disable │
│ └─ APB bridge config │
└──────────────────────────────────────────────────────────────┘
│
▼
════════════════════════ HARDWARE INIT PHASE ═══════════════════
┌──────────────────────────────────────────────────────────────┐
│ DDR SUBSYSTEM │
│ │
│ ddr_entry.S │
│ ├─ MC init (memory controller) │
│ ├─ PHY init │
│ ├─ training │
│ ├─ ZQ calibration │
│ └─ memory map setup │
│ │
│ RESULT: │
│ → DRAM ready (cached + uncached window valid) │
└──────────────────────────────────────────────────────────────┘
│
▼
┌──────────────────────────────────────────────────────────────┐
│ CACHE / SCache LOCK │
│ │
│ - lock 2MB SCache │
│ - copy PMON into cache │
│ - relocate execution │
└──────────────────────────────────────────────────────────────┘
▼
════════════════════════ SYSTEM BUS LAYER ══════════════════════
┌────────────────────────────┐
│ AXI / AHB BUS │
└────────────────────────────┘
│
┌──────────────────────┼────────────────────────┐
▼ ▼ ▼
┌──────────────┐ ┌────────────────────┐ ┌────────────────────┐
│ PCIe RC │ │ SATA Controller │ │ GMAC (Ethernet) │
│ │ │ │ │ │
│ - PHY init │ │ - refclk config │ │ - MAC enable │
│ - LTSSM │ │ - TX tuning │ │ - PHY link detect │
│ - link train │ │ - port enable │ │ - RX/TX queue │
│ - BAR map │ │ │ │ │
└──────┬───────┘ └─────────┬──────────┘ └─────────┬──────────┘
│ │ │
▼ ▼ ▼
PCIe Devices SATA Disk(s) Ethernet PHY/Switch
(NVMe / GPU / NIC)
🔥 PCIe 子系统详细架构(你代码核心)
┌────────────────────────────┐
│ PCIe Root Complex │
│ (LS2K1000 internal) │
└────────────────────────────┘
│
┌─────────────────┼─────────────────┐
▼ ▼ ▼
┌────────────┐ ┌────────────┐ ┌────────────┐
│ PCIe0 RC │ │ PCIe1 RC │ │ PHY Layer │
└────┬───────┘ └────┬───────┘ └────┬───────┘
│ │ │
▼ ▼ ▼
Port0~Port3 Port0~Port1 SerDes lanes
- EP/NVMe - NIC/GPU - equalization
- BAR assign - BAR assign - de-skew
- link training - link training - detect
🔥 DDR 子系统架构(最关键)
┌──────────────────────────────┐
│ DDR Controller (MC2) │
└──────────────┬───────────────┘
│
┌──────────────┼───────────────┐
▼ ▼ ▼
┌──────────┐ ┌────────────┐ ┌────────────┐
│ Command │ │ Address │ │ Data Path │
│ scheduler │ │ mapping │ │ DQ / DQS │
└────┬──────┘ └────┬───────┘ └────┬───────┘
│ │ │
▼ ▼ ▼
┌────────────────────────────┐
│ DDR PHY Layer │
│ │
│ - training engine │
│ - Vref calibration │
│ - read/write leveling │
│ - DQS alignment │
└────────────┬───────────────┘
│
▼
┌──────────────┐
│ DDR3/DDR4 DIMM│
└──────────────┘
🔥 SATA / GMAC 子系统
SATA
┌──────────────┐
│ SATA CTRL │
├──────────────┤
│ - ref clock │
│ - TX tuning │
│ - PHY config │
└──────┬───────┘
▼
SATA Disk / SSD
👉 关键点(对应你代码):
- 0x450 / 0x454 clock config
- TX signal tuning
- internal/external refclk switch
GMAC
┌──────────────┐
│ GMAC0 / GMAC1 │
├──────────────┤
│ - MAC enable │
│ - RX/TX rings │
│ - pinmux │
└──────┬───────┘
▼
Ethernet PHY / Switch
🔥 全局 SoC 数据流(最关键理解图)
DDR (System Memory)
▲
│
┌──────────┴──────────┐
│ │
CPU0 DMA Engines
│ │
▼ ▼
┌──────────┐ ┌──────────────┐
│ PMON │ │ PCIe / SATA │
│ Kernel │ │ GMAC DMA │
└──────────┘ └──────────────┘
🚀 一句话总结这颗 SoC
👉 LS2K1000 的本质架构是:
CPU → DDR bringup → cache relocation → bus enable
→ PCIe/SATA/GMAC init → OS enumeration