Initialize_Hard_Soft IDNT ; Title of Initialize Hardware ; and Software SECTION Sect_Initialize_Hard_Soft,4,C ; Declare a noncommon code ; section. Align to Longwords. *************************************************************************** * * * Initialize Hardware and Software Rev. 20-NOV-1992 * *************************************************************************** *************************************************************************** * * * Initialize all of the MVME-214 Memory to all zeros (32k bytes). * * Initialize all of the "2nd" MVME-214 Memory to all zeros (32k bytes). * * Initialize all of the SHORT IO 214 Memory to all zeros (2k bytes). * * Initialize the Ironics I/O registers. * * Slave Ready to HIGH, Data Cable Driver Finished to LOW. * * Initialize the VBD. * * Un-Lock the CSR block load DMA time-out. * * Load the Crate Type. * * Load the Event Number Address. * * Load the Crate ID Address. * * Load the D Control Register, the format for data reads. * * Load the P Control Reg., the format for parameter reads. * * Load the I/O Address high order bits. * * Load the VBD withthe pointer list to the Word Counts. * * Load the Word Counts into their Short IO storage locations. * * Load the VBD with the list of data block Base Addresses. * * Initialize the VBD (continued). * * Reset the VBD (make these parameters active). * * Lock the VBD parameters and load DMA time-out. * * Build words #2, #3, and #4 of the Crate Header and Display * * the Crate ID, the Version Number and the Rivision Numbers. * * Initialize the VBD Buffer Select Counter to VBD Buffer 0. * * Clear any old COMINT Slave Ready requests by pulsing the * * Data Cable Driver signal line high and then low twice. * * Display an Initialization Complete message. * * * *************************************************************************** ************************************************************************* * This sections calls all of the include files. * * * * 68020_EQUATES.INC defines macros to be used to call MVME133ABUG ROM. * ************************************************************************* INCLUDE 68020_EQUATES.INC ; Get the MVME133A BUG ROM Calls. INCLUDE VBD_Version_Number.SRC ; Get the Version Number data. INCLUDE VBD_Revision_Number.SRC ; Get the Revision Number data. ************************************************************************* * This section defines program-specific macros: * * * * WRIO: Write bit(s) to the IRONICS I/O card * * SOFTWAIT: Software delay timer for short waits * * * ************************************************************************* WRIO MACRO ; write byte to I/O port. NOT.B \1 ; complement input. MOVE.B \1,\2 ; and send to port. ENDM SOFTWAIT MACRO ; Software timer loop. LOCAL WAITMORE ; Define a local symbol. MOVE.L \1,D4 ; Load delay time into D4. WAITMORE SUBI.L #1,D4 ; Decrement loop counter. BNE WAITMORE ; Test for end of delay. ENDM ; Called with an argument ; of $1000 and with cashe off causes a delay of about 4 ; mill seconds, with cashe on the delay is 2.4 mill sec. ************************************************************************* * * * Initialize all of the MVME-214 VMX-VME Memory to be all zeros. * * * ************************************************************************* Begin_Initialize_Hard_Soft NOP ; Initialize Hard Soft Entry Point MOVEA.L #TrgBuffer,A0 FOR.L D7 = #TrgBuffer TO #TrgBuffer+$7FFC BY #4 DO.S CLR.L (A0)+ ENDF ; Clear the MVME-214 VMX-VME Memory Module. ************************************************************************* * * * Initialize all of the "2nd" MVME-214 VMX-VME Memory to be all zeros. * * * ************************************************************************* MOVEA.L #Buf2nd214,A0 FOR.L D7 = #Buf2nd214 TO #Buf2nd214+$7FFC BY #4 DO.S CLR.L (A0)+ ENDF ; Clear the "2nd" MVME-214 VMX-VME Memory Module. ************************************************************************* * * * Initialize all of the SHORT-214 Short I/O Memory to be all zeros. * * * ************************************************************************* MOVEA.L #IOMemBase+$FFFF0000,A0 FOR.L D7 = #IOMemBase+$FFFF0000 TO #IOMemBase+$FFFF07FE BY #2 DO.S CLR.W (A0)+ ENDF ; Clear the SHORT-214 Memory Module. ************************************************************************* * * * Initialize the IRONICS card Slave Ready HI and DCDr Finished LOW. * * * ************************************************************************* MOVE.B #Bits1and5Hi,D0 ; Initialize Slave Ready and Start WRIO D0,SlvRdy ; Jet List to $11, bits 1 & 5 Hi. MOVE.B #AllBitsLow,D0 ; initialize DCDr Finished. WRIO D0,DCDrFin ; to 00 LOW. ************************************************************************* * * * Initialize all of the Trouble Warning Bits to indicate no trouble * * and send them out their Ironics Port. * ************************************************************************* CLR.L TWBData ; Initialize the Trouble Warning MOVE.B TWBData,D0 ; Bits to all indicate no trouble WRIO D0,TWBPortAdrs ; and send them out the port. ************************************************************************* * * * Initialize the VBD Control Registers. * * * ************************************************************************* MOVE.W VBDDMATO,VBDCSR0 ; Load the VBD DMA time-out value. MOVE.W CrateType,CrateTypeReg ; Load the VBD Crate Type Register. MOVE.W #EvtNmbAdr,EvtNmbAdrReg ; Load pointer to the Event Number. MOVE.W CrateIDAdrs,CrtIDAdrReg ; Load the pointer to the Crate ID. MOVE.W DCtrlData,DControlReg ; Load data read format ctrl reg. MOVE.W PCtrlData,PControlReg ; Load param read format ctrl reg. MOVE.W IOUPAdrs,IOUPAdrsReg ; Load upper adrs bits for IO reads. ************************************************************************* * * * Load the VBD with the list of the addresses of Word Count storage * * locations in the Short IO Memory module (i.e. the Word Counter * * Pointer List). A null terminates the list. * * * ************************************************************************* MOVE.L #WCPntList,A3 ; Load address of the start of the. ; VBD Word CNT Pointer list into A3. MOVE.W #WCStore1,(A3)+ ; Load the pointer to the Header WC. MOVE.W #WCStore2,(A3)+ ; Load pointer to Current Framework WC. MOVE.W #WCStore3,(A3)+ ; Load pointer to Current Cal Trig WC. MOVE.W #WCStore4,(A3)+ ; Load pointer to Previous Framework WC. MOVE.W #WCStore5,(A3)+ ; Load pointer to Previous Cal Trig WC. MOVE.W #WCStore6,(A3)+ ; Load pointer to EM Jet List Word Cnt. MOVE.W #WCStore7,(A3)+ ; Load pointer to Total Et Jet List WC. MOVE.W #WCStore8,(A3)+ ; Load pointer to CHTCR Jet Masks WC. MOVE.W #WCStore9,(A3)+ ; Load pointer to TRD Hot Tower Data WC. MOVE.W #WCStore10,(A3)+ ; Load pointer to Spec Trig Prog Data WC. MOVE.W #WCStore11,(A3)+ ; Load pointr to Super Tower Jet Patrn WC. MOVE.W #WCStore12,(A3)+ ; Load pointer to Level 1.5 Data WC. MOVE.W #WCStore13,(A3)+ ; Load pointer to Absolute Time Data WC. MOVE.W #WCStore14,(A3)+ ; Load pntr to New L1 & Foreign Scalers WC. MOVE.W #WCStore15,(A3)+ ; Load pointer to Pulser Progrming Data WC. MOVE.W #0000,(A3)+ ; Load a null to terminate ; the WC list. MOVE.W #0000,(A3)+ ; Load a null to terminate ; the WC list. ************************************************************************* * * * Load the Word Counts into their storage locations in the Short IO * * Address space Memory module i.e. the Short 214. The VBD will * * read them from here during the DMA cycles. * * * ************************************************************************* MOVEA.L #$FFFF0000+WCStore1,A3 ; Short IO Adrs for WC storage location 1. MOVE.W WCHeader,(A3) ; Store the Header Word Count in it. MOVEA.L #$FFFF0000+WCStore2,A3 ; Short IO Adrs for WC storage location 2. MOVE.W WCCurFrWk,(A3) ; Store the Current FrmWrk Word Cnt in it. MOVEA.L #$FFFF0000+WCStore3,A3 ; Short IO Adrs for WC storage location 3. MOVE.W WCCurCalT,(A3) ; Store the Current Cal Trg Word Cnt in it. MOVEA.L #$FFFF0000+WCStore4,A3 ; Short IO Adrs for WC storage location 4. MOVE.W WCPrvFrWk,(A3) ; Store the Prev FrameWork Word Count in it. MOVEA.L #$FFFF0000+WCStore5,A3 ; Short IO Adrs for WC storage location 5. MOVE.W WCPrvCalT,(A3) ; Store the Prev Cal Trg Word Count in it. MOVEA.L #$FFFF0000+WCStore6,A3 ; Short IO Adrs for WC storage location 6. MOVE.W WCEMJetL,(A3) ; Store the EM Jet List Word Count in it. MOVEA.L #$FFFF0000+WCStore7,A3 ; Short IO Adrs for WC storage location 7. MOVE.W WCTEtJetL,(A3) ; Store the Tot Et Jet List Word Cnt in it. MOVEA.L #$FFFF0000+WCStore8,A3 ; Short IO Adrs for WC storage location 8. MOVE.W WCJetMask,(A3) ; Store the Jet Mask Word Count in it. MOVEA.L #$FFFF0000+WCStore9,A3 ; Short IO Adrs for WC storage location 9. MOVE.W WCTRDHotT,(A3) ; Store the Hot Tower Table Word Cnt in it. MOVEA.L #$FFFF0000+WCStore10,A3 ;Short IO Adrs for WC storage location 10. MOVE.W WCSpTrPrg,(A3) ;Store Spec Trg Programing Word Cnt in it. MOVEA.L #$FFFF0000+WCStore11,A3 ;Short IO Adrs for WC storage location 11. MOVE.W WCSupTowPtrn,(A3) ;Store Supr Tow Jet Ptrn Word Count in it. MOVEA.L #$FFFF0000+WCStore12,A3 ;Short IO Adrs for WC storage location 12. MOVE.W WCL15Data,(A3) ;Store Level 1.5 data Word Count in it. MOVEA.L #$FFFF0000+WCStore13,A3 ;Short IO Adrs for WC storage location 13. MOVE.W WCAbsoTime,(A3) ;Store the Absolute Time Word Count in it. MOVEA.L #$FFFF0000+WCStore14,A3 ;Short IO Adrs for WC storage location 14. MOVE.W WCL1ForScaler,(A3) ;Store L1&Foreign Scaler Word Count in it. MOVEA.L #$FFFF0000+WCStore15,A3 ;Short IO Adrs for WC storage location 15. MOVE.W WCPulser,(A3) ;Store the Pulser Data Word Count in it. ************************************************************************* * * * Load the VBD with the list of the data block Base Addresses. * * These are the Base Addresses where the VBD will start to read * * during the DMA cycles. * * * ************************************************************************* MOVEA.L #DataPntList,A3 ; Load address of the start of the ; VBD Data Pointer list into A3. MOVE.L BAHeader,(A3)+ ; Load Base Adrs of Crate Header. MOVE.L BACurFrWk,(A3)+ ; Load Base Adrs of Current Framework. MOVE.L BACurCalT,(A3)+ ; Load Base Adrs of Current Cal Trig. MOVE.L BAPrvFrWk,(A3)+ ; Load Base Adrs of Prev Trg Framewrk. MOVE.L BAPrvCalT,(A3)+ ; Load Base Adrs of Prev Calor Trig. MOVE.L BAEMJetL,(A3)+ ; Load Base Adrs of the EM Jet List. MOVE.L BATEtJetL,(A3)+ ; Load Base Adrs of Total Et Jet List. MOVE.L BAJetMask,(A3)+ ; Load Base Adrs of the Jet Mask. MOVE.L BATRDHotT,(A3)+ ; Load Base Adrs of TRD Hot Tower Tbl. MOVE.L BASpTrPrg,(A3)+ ; Load Base Adrs of Spec Trg Progming. MOVE.L BASupTowPtrn,(A3)+ ; Load Base Adrs of Super Tower Ptrn. MOVE.L BAL15Data,(A3)+ ; Load Base Adrs of Level 1.5 data. MOVE.L BAAbsoTime,(A3)+ ; Load Base Adrs of Absolute Time. MOVE.L BAL1ForScaler,(A3)+ ; Load Base Adrs of L1&Foreign Scaler. MOVE.L BAPulser,(A3)+ ; Load Base Adrs of Pulser data. ************************************************************************* * * * Lock the VBD Control Memory. * * * ************************************************************************* MOVE.W VBDReset,VBDCSR0 ; Reset the VBD and its err FIFO. SOFTWAIT #$1000 ; Wait a few mill seconds. MOVE.W VBDToLock,VBDCSR0 ; Load the VBD DMA time-out value ; and lock the VBD Control Memory. ***************************************************************************** * * * Build words #2, #3 and #4 of the Crate Header. * * These Crate Header words are event to event static. Words #1 * * and #5 are built for each event during the transfer to the VBD. * * * * Crate Header Word 1 Sync Word 2 MSByts Evt Num 2 LSByts of F's * * Crate Header Word 2 Controller Word MSByte is the low byte Crate ID * * Crate Header Word 3 Version Number 4-JAN-1990 Document definition * * Crate Header Word 4 Revision Number defined in D0 Note #967 * * Crate Header Word 5 Specific Triggers Fired list 32 bits * * * * Display these words on the 68k console as they are being built. This * * display is part of the initialization message. * * * * Version Number information for making Crate Header Word #3 is obtained * * from the VBD_VERSION_NUMBER.SRC include file which is called above. * * * * Revision Number information for making Crate Header Word #4 is obtained * * from the VBD_REVISION_NUMBER.SRC include file which is called above. * * * ***************************************************************************** CLR.L D0 ; Clear D0 it will receive Crate ID. MOVE.L #DataStack,A5 ; Data Stack for console display. MOVE.L #$FFFF0000,A3 ; Make the 133A version of the Short MOVE.W CrateIDAdrs,A3 ; IO Address for the Crate ID card. MOVE.W (A3),D0 ; Load the Crate ID into Data Reg 0. MOVE.L D0,(A5)+ ; Store Crate ID as read from Shea's ; brd on the data stack for display. ANDI.L #$000000FF,D0 ; Mask off all but Low byte of Crt ID SWAP D0 ; Move the low byte of the Crate ID LSL.L #$8,D0 ; into the top byte of data reg D0. MOVE.L D0,CrtHDWord2 ; Store the Controller word as the ; second word of the Crate Header. MOVE.L D0,(A5)+ ; Store the Controller word on the ; data stack for display. PEA.L DataStack ; Push the pointer for the data stack. PEA.L DispCrate ; Push the Crate ID message format. SYSCALL .WRITDLN ; Call the system to output message. MOVE.L VersNum,CrtHDWord3 ; Store the Version Number in the ; 3rd word of the Crate Header. MOVE.L #DataStack,A5 ; Data Stack for console display. MOVE.L VersNum,(A5)+ ; Store the Version Number on the ; data stack for display. PEA.L DataStack ; Push the pointer for the data stack. PEA.L DisVerNum ; Push Version Number message format. SYSCALL .WRITDLN ; Call the system to output message. CLR.L D0 ; Clear Data Register D0. MOVE.B VMECPURevNum,D0 ; Load the VME CPU Revision Number. LSL.L #$8,D0 ; SHIFT it to the left 8 places MOVE.B COMINTPROMRN,D0 ; Load the COMINT PROM Revision Num. LSL.L #$8,D0 ; SHIFT it to the left 8 places MOVE.B LookUpRevNum,D0 ; Load the Look Up System Rev. Num. LSL.L #$8,D0 ; SHIFT it to the left 8 places MOVE.B HardWRRevNum,D0 ; Load the Trigger Hardware Rev. Num. MOVE.L D0,CrtHDWord4 ; Store the Revision Number in the ; 4th word of the Crate Header. MOVE.L #DataStack,A5 ; Data Stack for console display. MOVE.L D0,(A5)+ ; Store the Crate Header 4th word ; (Rev. Num.) on display data stack. PEA.L DataStack ; Push the pointer for the data stack. PEA.L DisRevNo1 ; Push Revision Number message 1 form. SYSCALL .WRITDLN ; Call the system to output message. MOVE.L #DataStack,A5 ; Data Stack for console display. CLR.L D0 ; Clear data register 0. MOVE.B VMECPURevNum,D0 ; Load VME CPU Program Revision Num. MOVE.L D0,(A5)+ ; Store the VME CPU Program Revision ; Number on the display data stack. CLR.L D0 ; Clear data register 0. MOVE.B COMINTPROMRN,D0 ; Load COMINT PROM Revision Num. MOVE.L D0,(A5)+ ; Store the COMINT PROM Revision ; Number on the display data stack. PEA.L DataStack ; Push the pointer for the data stack. PEA.L DisRevNo2 ; Push Revision Number message 2 form. SYSCALL .WRITDLN ; Call the system to output message. MOVE.L #DataStack,A5 ; Data Stack for console display. CLR.L D0 ; Clear data register 0. MOVE.B LookUpRevNum,D0 ; Load Look Up System Revision Num. MOVE.L D0,(A5)+ ; Store the Look Up System Revision ; Number on the display data stack. CLR.L D0 ; Clear data register 0. MOVE.B HardWRRevNum,D0 ; Load Trigger Hardware Revision Num. MOVE.L D0,(A5)+ ; Store the Trigger Hardware Revision ; Number on the display data stack. PEA.L DataStack ; Push the pointer for the data stack. PEA.L DisRevNo3 ; Push Revision Number message 3 form. SYSCALL .WRITDLN ; Call the system to output message. ************************************************************************* * * * Set the Buffer Select to pick buffer 0. * * * ************************************************************************* CLR.L BufSelect ; Set Buffer Select for VBD buffer 0. ************************************************************************* * * * Clear any old COMINT Slave Ready requests by pulsing the Data Cable * * Driver Finished line high and low and high and low. * * * ************************************************************************* MOVE.B #Bit1High,D0 ; Send a Data Cable Driver WRIO D0,DCDrFin ; Finished signal to COMINT. SOFTWAIT #$1000 ; Wait about 5 mill seconds. MOVE.B #AllBitsLow,D0 ; Drop the Data Cable Driver WRIO D0,DCDrFin ; Finished signal. SOFTWAIT #$1000 ; Wait about 5 mill seconds. MOVE.B #Bit1High,D0 ; Send a Data Cable Driver WRIO D0,DCDrFin ; Finished signal to COMINT. SOFTWAIT #$1000 ; Wait about 5 mill seconds. MOVE.B #AllBitsLow,D0 ; Drop the Data Cable Driver WRIO D0,DCDrFin ; Finished signal. ************************************************************************* * * * Send the Initialization Complete Message to the 68k terminal. * * * ************************************************************************* PEA.L InitCmpt1 ; push message address on stack. SYSCALL .WRITELN ; and send it out. PEA.L InitCmpt2 ; push message address on stack. SYSCALL .WRITELN ; and send it out. RTS ************************************************************************* * Define Constants: * * * * Data used to send messages to the 68k terminal screen. * * * ************************************************************************* ALIGN 4 ; Align to longword address. DataStack DCB.L 8,$00000000 ; data stack for Write Line call DispCrate DC.B 44,'Crate ID = |10,8| Controller Word = |10,8|' DisVerNum DC.B 56,'Version Number of the Trigger Data Block Format = |10,8|' DisRevNo1 DC.B 53,'Revision Number in the Crate Header 4th word = |10,8|' DisRevNo2 DC.B 57,'VME CPU Program Rev = |10,8Z| COMINT PROMs Rev = |10,8Z|' DisRevNo3 DC.B 57,'Look Up Sys Rev = |10,8Z| Trigger Hardware Rev = |10,8Z|' InitCmpt1 DC.B 30,'Finished the initialization of' InitCmpt2 DC.B 36,'the VBD, COMINT, and IRONICS modules' ************************************************************************* * * * Constants Section for Initialize Hardware and Software * * * ************************************************************************* XDEF Begin_Initialize_Hard_Soft ; Symbol exported to ; other modules. XREF TrgBuffer,IOMemBase,Bit1High ; Symbols used in this XREF SlvRdy,AllBitsLow,DCDrFin ; module but defined in XREF Bits1and5Hi ; another program module ; Main_Symbols.Include XREF VBDDMATO,VBDCSR0 XREF VBDReset,VBDToLock XREF CrateType,CrateTypeReg XREF EvtNmbAdr,EvtNmbAdrReg XREF CrateIDAdrs,CrtIDAdrReg,DCtrlData,DControlReg XREF PCtrlData,PControlReg,IOUPAdrs,IOUPAdrsReg XREF WCPntList,WCStore1,WCStore2,WCStore3 XREF WCStore4,WCStore5,WCStore6,WCStore7 XREF WCStore8,WCStore9,WCStore10,WCStore11 XREF WCStore12,WCStore13,WCStore14,WCStore15 XREF WCHeader,WCCurFrWk,WCCurCalT,WCPrvFrWk XREF WCPrvCalT,WCEMJetL,WCTEtJetL,WCJetMask XREF WCTRDHotT,WCSpTrPrg,WCSupTowPtrn XREF WCL15Data,WCAbsoTime,WCL1ForScaler,WCPulser XREF BAHeader,BACurFrWk,BACurCalT,BAPrvFrWk XREF BAPrvCalT,BAEMJetL,BATEtJetL,BAJetMask XREF BATRDHotT,BASpTrPrg,BASupTowPtrn XREF BAL15Data,BAAbsoTime,BAL1ForScaler,BAPulser XREF DataPntList,CrtHDWord2,CrtHDWord3,CrtHDWord4 XREF BufSelect,TWBData,TWBPortAdrs XREF Buf2nd214 END