25.12.2012 Views

VisualDSP++ 4.5 Loader and Utilities Manual - Analog Devices

VisualDSP++ 4.5 Loader and Utilities Manual - Analog Devices

VisualDSP++ 4.5 Loader and Utilities Manual - Analog Devices

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ADSP-2126x/2136x/2137x Processor Booting<br />

block header. Instead, the 32-bit count <strong>and</strong> address words are used<br />

to hold the instruction that overwrites the RTI inserted into the<br />

IVT. Listing 5-1 illustrates the block header for FINAL_INIT if, for<br />

example, the opcode 0xAABBCCDDEEFF is assumed to be the<br />

user-intended instruction for the IVT.<br />

Listing 5-2. FINAL_INIT Block Header Format<br />

0x00000000 /* FINAL_INIT tag = 0x0 */<br />

0xEEFF0000 /* LSBs of instructions */<br />

0xAABBCCDD /* 4 MSBs of instructions */<br />

Listing 5-3. FINAL_INIT Section<br />

/* ====================== FINAL_INIT ======================== */<br />

/* The FINAL_INIT subroutine in the boot kernel program sets up a<br />

DMA to overwrite itself. The code is the very last piece that<br />

runs in the kernel; it is self-modifying code, It uses a DMA<br />

to overwrite itself, initializing the 256 instructions that<br />

reside in the Interrupt Vector Table. */<br />

/* ---------------------------------------------------------- */<br />

final_init:<br />

/* ----------- Setup for IVT instruction patch ------------- */<br />

I8=0x80030; /* Point to SPI vector to patch from PX */<br />

R9=0xb16b0000; /* Load opcode for “PM(0,I8)=PX” into R9 */<br />

PX=pm(0x80002); /* User instruction destined for 0x80030<br />

is passed in the section-header for<br />

FINAL_INIT. That instr. is initialized upon<br />

completion of this DMA (see comments below)<br />

using the PX register. */<br />

R11=BSET R11 BY 9; /* Set IMDW to 1 for inst. write */<br />

DM(SYSCTL)=R11; /* Set IMDW to 1 for inst. write */<br />

5-30 <strong>VisualDSP++</strong> <strong>4.5</strong> <strong>Loader</strong> <strong>and</strong> <strong>Utilities</strong> <strong>Manual</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!