.title M9312 'DM' BOOT prom for RK611 controller ; This source code is an exact copy of the DEC M9312 23-752A9 boot PROM. ; ; This boot PROM is for the RK611 controller with RK06/RK07 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). rkcsr =177440 ; std RK611 csrbase rkcs1 =+0 ; control/status reg1 rkwc =+2 ; word count rkcs2 =+10 ; control/status reg2 rker =+14 ; error reg diags =165564 ; console diags phase2 entry .asect .=173000 ; -------------------------------------------------- start: .ascii "MD" ; device code (reversed) .word last-. ; offset to next boot header dm0n: sec ; boot std csr, unit zero, no diags dm0d: mov #0,r0 ; boot std csr, unit zero, with diags dmNr: mov #rkcsr,r1 ; boot std csr, unit dmNb: 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,rkcs2(r1) ; set unit number mov #0003,(r1) ; command pack+go rk06 type 2$: tstb (r1) ; wait for done bpl 2$ ; loop tst (r1) ; check for error bpl 4$ ; br if no error, rk06 was OK bit #40,rker(r1) ; check if a disk-type error beq 6$ ; br if not, something else reset ; yes, reset controller mov r0,rkcs2(r1) ; set unit number mov #2003,(r1) ; command pack+go rk07 type 3$: tstb (r1) ; wait for done bpl 3$ ; loop tst (r1) ; check for error bmi 6$ ; br if error 4$: mov #-512.,rkwc(r1) ; set wordcount mov (r1),r3 ; get current pack type bic #377,r3 ; zap command portion bis #21,r3 ; read+go command mov r3,(r1) ; execute 5$: tstb (r1) ; wait for done bpl 5$ ; loop tst (r1) ; check for error bpl 7$ ; br if OK 6$: reset ; error; clear controller jmp 2(r4) ; and retry from beginning 7$: clr pc ; jump to bootstrap start ; -------------------------------------------------- dm1n: sec ; boot std csr, unit one, no diags dm1d: mov #1,r0 ; boot std csr, unit one, with diags br dmNr ; merge to main flow ; -------------------------------------------------- diag: jmp @#diags ; jump to console diags ; -------------------------------------------------- .word 0,0,0,0,0,0,0 ; unused .=start+176 crc16: .word <077161> ; CRC-16 will go here last: ; next boot prom starts here .end