.title M9312 'DP/DB' BOOT prom for RP0x/RM0x controller ; This source code is an exact copy of the DEC M9312 23-755A9 boot PROM. ; ; This boot PROM is for the RP11 or RH11 controllers with RP0x/RM0x drives. ; ; Multiple units and/or CSR addresses are supported via different entry points. ; ; Standard devices are 82S131, Am27S13, 74S571 or other compatible bipolar ; PROMs with a 512x4 TriState 16pin DIP architecture. This code resides in ; the low half of the device; the top half is blank and unused. ; ; Alternatively, 82S129 compatible 256x4 TriState 16pin DIP devices can be ; used, as the uppermost address line (hardwired low) is an active low chip ; select (and will be correctly asserted low). rpcsr =176714 ; std RP11-C csrbase .if df altrmcsr rmcsr =176300 ; alt RH11 csrbase [match J.West .bin] .iff rmcsr =176700 ; std RH11 csrbase .endc rpcs =+0 ; control status offset rpwc =+2 ; word count offset rpba =+4 ; bus addr offset rpcs2 =+10 ; control status 2 offset rpas =+16 ; atten summary offset rpof =+32 ; offset register offset diags =165564 ; console diags phase2 entry .asect .=173000 ; -------------------------------------------------- start: .ascii "PD" ; device code (reversed) .word next-. ; offset to next boot header dp0n: sec ; boot std csr, unit zero, no diags dp0d: mov #0,r0 ; boot std csr, unit zero, with diags dpNr: mov #rpcsr,r1 ; boot std csr, unit dpNb: mov pc,r4 ; boot csr , unit bcc diag ; br if diags requested br go ; return to (R4)+2 from diags ; then skip over pseudo reboot vector ; -------------------------------------------------- .word 173000 ; prom start addess @ 24 .word 340 ; and priority level @ 26 ; -------------------------------------------------- go: mov r0,r3 ; copy unit number swab r3 ; into upper byte mov r3,(r1) ; store into controller mov #5,r2 ; READ+GO command code br boot ; continue ; ---------------------------------------- .if df altrmcsr next: .ascii "RD" ; device code (reversed) [match J.West .bin] .iff next: .ascii "BD" ; device code (reversed) .endc .word last-. ; offset to next boot header db0n: sec ; boot std csr, unit zero, no diags db0d: mov #0,r0 ; boot std csr, unit zero, with diags dbNr: mov #rmcsr,r1 ; boot std csr, unit dbNb: mov pc,r4 ; boot csr , unit bcc diag ; br if diags requested ; ---------------------------------------- mov r0,rpcs2(r1) ; set unit number into controller mov #071,r2 ; READ+GO command code mov #021,(r1) ; RIP+GO command mov #014000,rpof(r1) ; set 16b mode, inhibit ECC mode mov rpas(r1),rpas(r1) ; clear attention bits boot: mov #-512.,rpwc(r1) ; set word count mov (r1),r3 ; get unit number bic #377,r3 ; clear command byte bis r2,r3 ; insert read command code mov r3,(r1) ; execute read command 2$: tstb (r1) ; test unit ready bpl 2$ ; br if not yet tst (r1) ; test any error bpl 3$ ; br if not reset ; error, reset the world jmp 2(r4) ; and jump back to restart 3$: bic #377,(r1) ; nop command, clear controller clr pc ; jump to bootstrap start ; ---------------------------------------- diag: jmp @#diags ; jump to console diags ; ---------------------------------------- dp1n: sec ; boot std csr, unit one, no diags dp1d: mov #1,r0 ; boot std csr, unit one, with diags br dpNr ; continue ; -------------------------------------------------- .=start+176 crc16: .word <111612> ; CRC-16 will go here last: ; next boot prom starts here .end