Freescale Semiconductor DSP56366 Car Stereo System User Manual


 
DSP56366 Bootstrap Program
DSP56366 24-Bit Digital Signal Processor User Manual, Rev. 4
Freescale Semiconductor A-5
SHILD
; This is the routine which loads a program through the SHI port.
; The SHI operates in the slave
; mode, with the 10-word FIFO enabled, and with the HREQ pin enabled for
; receive operation. The word size for transfer is 24 bits. The SHI
; operates in the SPI or in the I2C mode, according to the bootstrap mode.
;
; The program is downloaded according to the following rules:
; 1) 3 bytes - Define the program length.
; 2) 3 bytes - Define the address to which to start loading the program to.
; 3) 3n bytes (while n is the program length defined by the first 3 bytes)
; The program words will be stored in contiguous PRAM memory locations starting
; at the specified starting address.
; After storing the program words, program execution starts from the same
; address where loading started.
move #$A9,r1 ; prepare SHI control value in r1
; HEN=1, HI2C=0, HM1-HM0=10, HCKFR=0, HFIFO=1, HMST=0,
; HRQE1-HRQE0=01, HIDLE=0, HBIE=0, HTIE=0, HRIE1-HRIE0=00
jclr #MA,omr,SHI_CF ; If MD:MC:MB:MA=01x0, go to SHI clock freeze
jclr #MB,omr,shi_loop ; If MD:MC:MB:MA=0101, select SPI mode
bset #HI2C,r1 ; otherwise select I2C mode.
shi_loop movep r1,x:M_HCSR ; enable SHI
jclr #HRNE,x:M_HCSR,* ; wait for no. of words
movep x:M_HRX,a0
jclr #HRNE,x:M_HCSR,* ; wait for starting address
movep x:M_HRX,r0
move r0,r1
do a0,_LOOP2
jclr #HRNE,x:M_HCSR,* ; wait for HRX not empty
movep x:M_HRX,p:(r0)+ ; store in Program RAM
nop ; req. because of restriction
_LOOP2
bra <FINISH
SHI_CF
bset #HI2C,r1 ; select I2C mode.
bset #HCKFR,r1 ; enable clock freeze in I2C mode.
bset #HFM0,x:M_HCKR ; enable 100ns noise filter
bset #HFM1,x:M_HCKR ; enable 100ns noise filter
jset #MB,omr,shi_loop ; If MD:MC:MB:MA=0110, go to I2C load
bra <RESERVED ; If MD:MC:MB:MA=0100, go to reserved
;========================================================================
; This is the routine that loads from external EPROM.