code wiki / _hdl_build / _gpu_bm_boot_gate.nx
_gpu_bm_boot_gate.nx
buildroot/runtime/_hdl_build/_gpu_bm_boot_gate.nx
about
_gpu_bm_boot_gate.nx -- BARE-METAL SOVEREIGN-GPU rung BM-GPU-3: GPU bring-up over the BAR0 MMIO register file.
A sovereign driver does the nouveau-style nvkm boot sequence against a spec-faithful BAR0 register MODEL:
1. read NV_PMC_BOOT_0 @0x000000 -> chip id; decode chipset+arch family (Blackwell GB20x ~0x1B0). A read of
ALL-1s (0xFFFFFFFF) = the GPU fell off the bus (real nouveau liveness check) -> dead.
2. read NV_PTIMER_TIME_0 @0x009400 twice -> the ns clock must ADVANCE (GPU core clock alive).
3. read VRAM size @0x100000 (PFB) -> 16384 MiB (16 GiB, the 5080; cf. R4b measured ~14.88GiB usable).
4. write NV_PMC_ENABLE @0x000200 (turn engines on) -> read-back latches (engines enabled).
NISHI-ECOSYSTEM-ONLY: our model + our driver; the NV register map is the last-mile hardware spec (open-gpu-
kernel-modules / nouveau). HONEST SCOPE: bring-up LOGIC vs a spec-faithful model; real MMIO = BM-GPU-6 on native Linux.
GREEN iff: BOOT_0 alive + chipset!=0 + arch-family==0x1B0 (Blackwell); PTIMER advances (clock alive);
VRAM==16384MiB; PMC_ENABLE write read-back latches; AND tampers (BOOT_0=0xFFFFFFFF off-bus / stuck PTIMER)
are correctly detected as dead.
Marker -> knowledge/status/gpu_baremetal.log (BMBOOTGATE). license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 18 | func p(s: *u8) -> i64 { var nn: i64=0; while s[nn]!=(0 as u8){nn=nn+1} sys_write(1,s,nn); return 0 } |
| 19 | func fp(fd: i64, s: *u8) -> i64 { var nn: i64=0; while s[nn]!=(0 as u8){nn=nn+1} sys_write(fd,s,nn); return 0 } |
| 20 | func n(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)}; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48;k=1}; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(1,bb,k); return 0 } |
| 21 | func x(v: i64) -> i64 { p("0x" as *u8); let bb:*u8=sys_mmap(20); var k:i64=0; var m:i64=v; if m==0{bb[0]=48;k=1}; while m>0{ let d:i64=m&15; if d<10{bb[k]=(48+d) as u8}else{bb[k]=(87+d) as u8}; m=(m>>4); k=k+1 } var i:i64=0; let o:*u8=sys_mmap(20); while i<k{o[i]=bb[k-1-i];i=i+1} sys_write(1,o,k); return 0 } |
| 22 | func fx(fd: i64, v: i64) -> i64 { let bb:*u8=sys_mmap(20); var k:i64=0; var m:i64=v; if m==0{bb[0]=48;k=1}; while m>0{ let d:i64=m&15; if d<10{bb[k]=(48+d) as u8}else{bb[k]=(87+d) as u8}; m=(m>>4); k=k+1 } let o:*u8=sys_mmap(20); var i:i64=0; while i<k{o[i]=bb[k-1-i];i=i+1} fp(fd,"0x" as *u8); sys_write(fd,o,k); return 0 } |
| 26 | func bar0_read(st: *i64, off: i64) -> i64 called by 1: bring_up |
| 33 | func bar0_write(st: *i64, off: i64, val: i64) -> i64 { if off == 0x000200 { st[3] = val } return 0 } called by 1: bring_up |
| 35 | func make_gpu(st: *i64, alive: i64, stuck: i64) -> i64 called by 1: main |
| 42 | func bring_up(st: *i64, out: *i64) -> i64 |
| 56 | func main() -> i64 |