Atom.PutProp[$Simul2Sender, $PKList,
LIST[
$Init,
$StartStop,
$ReceiveAll,
LIST[$Wait, C[1110]], -- for waiting for DBus initialization
-- wish I could wait for $ResetOff instead.
First Initialize MemCtl Chip (copied from /Dragon/Dragon7.0/SSMem/DynMemProg.mesa)
LIST[$IOWrite0, C[1], L[TRUE], L[TRUE], C[0],C[28],C[28],C[28],C[22],C[22]],
LIST[$IOWriteRqst, Q[[0, 0, 0030H, 0400H]], Q[[0, 0, 0E19EH, 72D6H]]],
$WaitMsgSent,
LIST[$Wait, C[9]], -- for snooping
LIST[$SendShOw,R["SO"]],
$WaitMsgReceived, -- for the Echo
$WaitReply,
LIST[$IOWrite1, C[1],C[10],C[0],C[0]],
LIST[$IOWriteRqst, Q[[0, 0, 0030H, 0401H]], Q[[0, 0, ****H, ****H]]],
$WaitMsgSent,
$WaitMsgReceived, -- for the Echo
$WaitReply,
LIST[$IOWrite2, C[1],C[10],C[0]],
LIST[$IOWriteRqst, Q[[0, 0, 0030H, 0402H]], Q[[0, 0, ****H, ****H]]],
$WaitMsgSent,
$WaitMsgReceived, -- for the Echo
$WaitReply,
LIST[$WriteBlockRqst, Q[[0,0,0,0]],Q[[3,3,3,3]],Q[[2,2,2,2]],Q[[1,1,1,1]],Q[[0,0,0,0]]],
$WaitMsgSent,
$WaitMsgReceived, -- for the Echo
$WaitReply,
LIST[$WriteBlockRqst, Q[[0,0,0,0]],Q[[0,0,0,0]],Q[[1,1,1,1]],Q[[2,2,2,2]],Q[[3,3,3,3]]],
$WaitMsgSent,
$WaitMsgReceived, -- for the Echo
$WaitReply,
Then Initialize Memory Locations
LIST[$WriteBlockRqst, -- initialize memory
Q[[ 0, 0, 0000H, 0000H ]], -- address
Q[[ 0001H, 0203H, 0405H, 0607H ]], -- data
Q[[ 0809H, 0A0BH, 0C0DH, 0E0FH ]], -- data
Q[[ 1011H, 1213H, 1415H, 1617H ]], -- data
Q[[ 1819H, 1A1BH, 1C1DH, 1E1FH ]]], -- data
$WaitMsgSent,
$WaitMsgReceived, -- echo of above $WriteBlockRqst
$WaitReply, -- *************************************
LIST[$WaitWriteBlockRplyandCheck,
Q[[ 0, 0, 0000H, 0000H ]]],
LIST[$WriteBlockRqst, -- initialize memory
Q[[ 0, 0, 0000H, 0008H ]], -- address
Q[[ 2021H, 2223H, 2425H, 2627H ]], -- data
Q[[ 2829H, 2A2BH, 2C2DH, 2E2FH ]], -- data
Q[[ 3031H, 3233H, 3435H, 3637H ]], -- data
Q[[ 3839H, 3A3BH, 3C3DH, 3E3FH ]]], -- data
$WaitMsgSent,
$WaitMsgReceived, -- echo of above $WriteBlockRqst
$WaitReply, -- *************************************
LIST[$WaitWriteBlockRplyandCheck,
Q[[ 0, 0, 0000H, 0008H ]]],
Then On to DDC:
Check Whether DDC Rejects Requests In User Mode -- 5-11-88
Actually, the code doesn't do any checking. It just sends out the requests in user mode and notices that replies were received. I have to check the logic analyzer display to verify that the Mode/Fault bit of the reply says error.
LIST[$IOWriteRqstUser, -- framePtrBase ← 0
Q[[ 0, 0, 0020H, 0A80H ]], -- address
Q[[ 0, 0, 0000H, 0000H ]]], -- data
$WaitMsgSent,
$WaitMsgReceived, -- echo of above $IOWriteRqst
$WaitReply, -- *************************************
LIST[$IOReadRqstUser, -- read back framePtrBase
Q[[ 0, 0, 0020H, 0A80H ]]], -- address
$WaitMsgSent,
$WaitMsgReceived, -- echo of above $IOReadRqst
LIST[$WaitIOReadRplyandCheck,
Q[[ 0, 0, 0020H, 0A80H ]],
Q[[ 0, 0, 0080H, 0001H ]]], -- data: FaultCode=1
-- DevID=2
Register Initialization
(For the following commands, devID=0 and mode=kernel always.)
LIST[$IOWriteRqst, -- framePtrBase ← 0
Q[[ 0, 0, 0020H, 0A80H ]], -- address
Q[[ 0, 0, 0000H, 0000H ]]], -- data
$WaitMsgSent,
$WaitMsgReceived, -- echo of above $IOWriteRqst
$WaitReply, -- *************************************
LIST[$WaitIOWRplyandCheck,
Q[[ 0, 0, 0020H, 0A80H ]]],
Q[[ 0, 0, 0000H, 0000H ]]],
LIST[$IOWriteRqst, -- framePtrLimit ← 8H
Q[[ 0, 0, 0020H, 0A81H ]], -- address
Q[[ 0, 0, 0000H, 0008H ]]], -- data
$WaitMsgSent,
$WaitMsgReceived, -- echo of above $IOWriteRqst
$WaitReply, -- *************************************
LIST[$WaitIOWRplytandCheck,
Q[[ 0, 0, 0020H, 0A81H ]]],
Q[[ 0, 0, 0000H, 0000H ]]],
LIST[$IOWriteRqst, -- bitsPerPixel ← 3 (meaning 8 bits/pixel)
Q[[ 0, 0, 0020H, 0A83H ]], -- address
Q[[ 0, 0, 0000H, 0003H ]]], -- data
$WaitMsgSent,
$WaitMsgReceived, -- echo of above $IOWriteRqst
$WaitReply, -- *************************************
LIST[$WaitIOWRplyandCheck,
Q[[ 0, 0, 0020H, 0A83H ]]],
Q[[ 0, 0, 0000H, 0000H ]]],
LIST[$IOWriteRqst, -- intOffset ← 0DH
Q[[ 0, 0, 0020H, 0A88H ]], -- address
Q[[ 0, 0, 0000H, 000DH ]]], -- data
$WaitMsgSent,
$WaitMsgReceived, -- echo of above $IOWriteRqst
$WaitReply, -- *************************************
LIST[$WaitIOWRplyandCheck,
Q[[ 0, 0, 0020H, 0A88H ]]],
Q[[ 0, 0, 0000H, 0000H ]]],
Register Readback -- just to show that IORRqst works
LIST[$IOReadRqst, -- read back framePtrBase
Q[[ 0, 0, 0020H, 0A80H ]]], -- address
$WaitMsgSent,
$WaitMsgReceived, -- echo of above $IOReadRqst
LIST[$WaitIOReadRplyandCheck,
Q[[ 0, 0, 0020H, 0A80H ]],
Q[[ 0, 0, 0000H, 0000H ]]], -- data
LIST[$IOReadRqst, -- read back intOffset
Q[[ 0, 0, 0020H, 0A88H ]]], -- address
$WaitMsgSent,
$WaitMsgReceived, -- echo of above $IOReadRqst
LIST[$WaitIOReadRplyandCheck,
Q[[ 0, 0, 0020H, 0A88H ]],
Q[[ 0, 0, 0000H, 000DH ]]], -- data
Microcode Initialization
World's dumbest microcode -- only generates one interrupt.
00: Jump 01;
01: Jump 02; Take8Cycles;
02: Jump 03; ProgInt;
03: Jump 03;
LIST[$IOWriteRqst, -- vGen[0] ← 07FFC00
Q[[ 0, 0, 0020H, 0A40H ]], -- address
Q[[ 0, 0, 007FH,0FC00H ]]], -- data
$WaitMsgSent,
$WaitMsgReceived, -- echo of above $IOWriteRqst
$WaitReply, -- *************************************
LIST[$WaitIOWRplyandCheck,
Q[[ 0, 0, 0020H, 0A40H ]]],
Q[[ 0, 0, 0000H, 0000H ]]],
LIST[$IOWriteRqst, -- vGen[1] ← 0BFE000
Q[[ 0, 0, 0020H, 0A41H ]], -- address
Q[[ 0, 0, 00BFH,0E000H ]]], -- data
$WaitMsgSent,
$WaitMsgReceived, -- echo of above $IOWriteRqst
$WaitReply, -- *************************************
LIST[$WaitIOWRplyandCheck,
Q[[ 0, 0, 0020H, 0A41H ]]],
Q[[ 0, 0, 0000H, 0000H ]]],
LIST[$IOWriteRqst, -- vGen[2] ← 0FFFC01
Q[[ 0, 0, 0020H, 0A42H ]], -- address
Q[[ 0, 0, 00FFH,0FC01H ]]], -- data
$WaitMsgSent,
$WaitMsgReceived, -- echo of above $IOWriteRqst
$WaitReply, -- *************************************
LIST[$WaitIOWRplyandCheck,
Q[[ 0, 0, 0020H, 0A42H ]]],
Q[[ 0, 0, 0000H, 0000H ]]],
LIST[$IOWriteRqst, -- vGen[3] ← 0FFFC00
Q[[ 0, 0, 0020H, 0A43H ]], -- address
Q[[ 0, 0, 00FFH,0FC00H ]]], -- data
$WaitMsgSent,
$WaitMsgReceived, -- echo of above $IOWriteRqst
$WaitReply, -- *************************************
LIST[$WaitIOWRplyandCheck,
Q[[ 0, 0, 0020H, 0A43H ]]],
Q[[ 0, 0, 0000H, 0000H ]]],
Generate An Interrupt
LIST[$IOReadRqst, -- first clear interrupts
Q[[ 0, 0, 0020H, 0A82H ]]], -- address
$WaitMsgSent,
$WaitMsgReceived, -- echo of above $IOReadRqst
$WaitReply, -- don't check result, which should be X's
LIST[$IOWriteRqst, -- intMask ← 4H; (enable only int 0)
Q[[ 0, 0, 0020H, 0A82H ]], -- address
Q[[ 0, 0, 0000H, 0004H ]]], -- data
$WaitMsgSent,
$WaitMsgReceived, -- echo of above $IOWriteRqst
$WaitReply, -- *************************************
LIST[$WaitIOWRplyandCheck,
Q[[ 0, 0, 0020H, 0A82H ]]],
Q[[ 0, 0, 0000H, 0000H ]]],
LIST[$IOWriteRqst, -- vGenEn ← 1; (start microcode)
Q[[ 0, 0, 0020H, 0A87H ]], -- address
Q[[ 0, 0, 0000H, 0001H ]]], -- data
$WaitMsgSent,
$WaitMsgReceived, -- echo of above $IOWriteRqst
$WaitReply, -- *************************************
LIST[$WaitIOWRplyandCheck,
Q[[ 0, 0, 0020H, 0A87H ]]],
Q[[ 0, 0, 0000H, 0000H ]]],
LIST[$WaitIOWRqstandCheck, -- here's the interrupt.
Q[[ 0, 0, 0010H, 000DH ]], -- address
Q[[ 0, 0, 0400H, 0000H ]]], -- data (2^(31-reason))
LIST[$IOWriteRply,
Q[[ 0, 0, 0010H, 000DH ]],
Q[[ 0, 0, 0400H, 0000H ]]],
$WaitMsgSent,
$WaitMsgReceived, -- echo of above $IOWriteRply
LIST[$IOReadRqst, -- read and clear interrupts
Q[[ 0, 0, 0020H, 0A82H ]]], -- address
$WaitMsgSent,
$WaitMsgReceived, -- echo of above $IOReadRqst
LIST[$WaitIOReadRplyandCheck,
Q[[ 0, 0, 0020H, 0A82H ]],
Q[[ 0, 0, 0000H, 0024H ]]], -- data
Read Block Requests
LIST[$IOWriteRqst, -- rBRqstEn ← 1; (enable RBRqst's)
Q[[ 0, 0, 0020H, 0A86H ]], -- address
Q[[ 0, 0, 0000H, 0001H ]]], -- data
$WaitMsgSent,
$WaitMsgReceived, -- echo of above $IOWriteRqst
$WaitReply, -- *************************************
LIST[$WaitIOWRplyandCheck,
Q[[ 0, 0, 0020H, 0A86H ]]],
Q[[ 0, 0, 0000H, 0000H ]]],
LIST[$WaitReadBlockRqstandCheck, -- a RBRqst occurs.
Q[[ 0, 0, 0000H, 0000H ]]], -- address
Q[[ 0, 0, 0000H, 0000H ]]], -- victim address (invalid)
LIST[$WaitReadBlockRqstandCheck, -- another RBRqst occurs.
Q[[ 0, 0, 0000H, 0008H ]]], -- address
Q[[ 0, 0, 0000H, 0000H ]]], -- victim address (invalid)
-- SIGNAL here
LIST[$WaitReadBlockRplyandCheck, -- a RBRply occurs.
Q[[ 0, 0, 0000H, 0000H ]], -- address (not checked. why?)
Q[[ 0001H, 0203H, 0405H, 0607H ]], -- data
Q[[ 0809H, 0A0BH, 0C0DH, 0E0FH ]], -- data
Q[[ 1011H, 1213H, 1415H, 1617H ]], -- data
Q[[ 1819H, 1A1BH, 1C1DH, 1E1FH ]]], -- data
LIST[$WaitReadBlockRplyandCheck, -- another RBRply occurs.
Q[[ 0, 0, 0000H, 0008H ]], -- address (not checked. why?)
Q[[ 2021H, 2223H, 2425H, 2627H ]], -- data
Q[[ 2829H, 2A2BH, 2C2DH, 2E2FH ]], -- data
Q[[ 3031H, 3233H, 3435H, 3637H ]], -- data
Q[[ 3839H, 3A3BH, 3C3DH, 3E3FH ]]], -- data
Then Just Wait
$Nop,
LIST[$Jump, $Nop]
]];