/*************************************************************************** jtagboot.asm Copyright (c) 1994 Analog Devices Inc. All rights reserved. ***************************************************************************/ /* This file is the boot strap loader that is loaded by the JTAG boot hardware. Gordon A. Sterling (617) 461 - 3076 Systems Software Engineering Analog Devices, Inc. Created on 5/4/94 The loader works by reading in 8-bit values from the boot PROM located at the specified address. The 48-bit words are reconstructed from 6 of the 8-bit bytes. The 8-bit values are assumed to be right justified in the 32-bit data bus. This code is written to reduce memory usage, not for simplicity */ /* This segment represents the PROM containing the boot file. */ .SEGMENT/DM boot_rom; .ENDSEG; .SEGMENT/PM resetvec; /* * Setup registers required for reading/writing boot loader from boot * PROM. */ B3=boot_rom; /* Point to ROM with file to be booted */ L3=0; /* Clear length to avoid circular wrap */ M6=1; /* Required for multifunction shift */ L12=0; /* Clear length to avoid circular wrap */ M13=0; /* Required for pre-modify JUMP at end */ M14=1; /* Required to write PX to memory */ /* * The first word of the boot PROM is the address/length pair for the * boot loader itself. The LS 16-bits indicate the length of the loader * itself, while the upper 32-bits indicate the starting address of the * loader. * * The first LSW of the loader is read into R1 at the end of reading this * the address. This is the first value used in the pipelined loop that * copies the entire loader. */ R1=DM(I3,M6); /* Read length LSW */ CALL get_MSP (DB); R2=FDEP R1 BY 0:8, R1=DM(I3,M6); /* Read length MSW */ R2=R2 OR FDEP R1 BY 8:8, R1=DM(I3,M6); /* Read address LSW */ R4=PASS R3, I12=R3; /* * This loop copies the loader from boot PROM to the specified address. */ LCNTR=R2, DO boot_strap UNTIL LCE; CALL get_MSP (DB); R0=FDEP R1 BY 0:8, R1=DM(I3,M6); R0=R0 OR FDEP R1 BY 8:8, R1=DM(I3,M6); PX1=R0; PX2=R3; boot_strap: PM(I12,M14)=PX; /* * The boot loader has been copied into RAM. This bit of code JUMPs to * the beginning of the loader. */ I12=R4; /* Point to start of loader */ JUMP (M13, I12); /* Begin execution of loader */ get_MSP:R3=FDEP R1 BY 0:8, R1=DM(I3,M6); R3=R3 OR FDEP R1 BY 8:8, R1=DM(I3,M6); RTS (DB); R3=R3 OR FDEP R1 BY 16:8, R1=DM(I3,M6); R3=R3 OR FDEP R1 BY 24:8, R1=DM(I3,M6); .ENDSEG;