NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.
DA8xx Secondary Boot Loader Customization for SPI Master Boot
Contents
Introduction[edit]
This page describes the Secondary Boot Loader customization for SPI Master boot. Secondary boot loader can realize:
- Auto boot: you can boot DSP itself just reset. Communication with uC is not needed.
- Normal boot: Use communication with uC and boot DSP. This process needed if you want to flash update function. Every time you specify Normal boot or flash update from uC when booting
- Flash update: Use communication with uC and boot DSP's SBL. Then you can update contents of flash. Detail sequence is described in Boot Sequence of Typcal Customization process needed if you want to flash update function.
Procedure[edit]
Build sbl.out[edit]
- Delete spiflash_wb.c and add your customized spiflash_xx.c. Edit da8xx_spi.h if necessary. Please refer H/W Bring-up to know how to make.
- Add pre-define “FLASH_UPDATE_SPI” to sbl.pjt. If you use auto boot, this is not necessary
- Add pre-define “USE_COMPRESSION” if you use compression
- Build sbl.pjt
Generate factory.bin[edit]
- Generate
sbl.bin
from sbl.out using AISgen tool. [AISgen tool is available at [1] ] - Generate
pa.bin
from following command.. use -z option for enabling compression. Please see appendix B for detail.- $ coff2pfimg.exe -b 0x00010000 -u pa.bin pa.out
- Combine both bin's using
binc.exe
to generatefactory.bin
. Please see appendix C for detail.- $ binc.exe 0=sbl.bin 0x00010000=pa.bin -ofactory.bin
- Program
factory.bin
to SPI flash usingspiwriter.pjt
Appendix A: Boot/update time[edit]
- To Do: Add sample data of boot/flash update time on EVM
Appendix B: coff2pfimg[edit]
coff2pfimg: Convert COFF File to Parallel Flash Boot Image Usage: coff2pfimg [OPTIONS] <infile.out> ... Options: One or more of the following options may be used: -h This help -v Increase verbosity (Use multiple -v for more debug prints) -q Decrease verbosity -z Turn compression ON -m Generate image with structure suitable for holding multiple boot images on the same flash. If more than one .out is specified on the command line, then -m is implicit. -c <filename> Generate C file suitable for linking into another program (Used for generating the "factory" image) -u <filename> Generate the image as a binary file suitable for sending over I2C/SPI for upgrade -l <rfile> Create a "loader" file named <rfile> The loader file has an array of type FLASH_PRINT specifying the RAM print of the input .out file. It also will contain the entry point of the .out. It is intended to be used by the bootloader running from the top 1K of the flash -r <bfile> Create a "burner" file named <bfile> The burner file contains the section data for all sectons in the input .out file and is intended to be used by the program that burns into the flash -n <name> Name of the table to used for the array in the "burner" file. -b <flashbase> Base address of the boot image in flash This will at 0x90000000 plus some multiple of flash block size used for "safe" code The default is 0x90004000 (i.e., 16KB is reserved for "safe" boot and upgrade code) Either the -c or -u or -r option must be specified coff2pfimg.exe reads input COFF file and generates a data file
Appendix C: binc[edit]
binc v0.2 Usage: binc.exe <offset1=file1.bin> <offset2=file2.bin> ..<offsetn=filen.bin> -o<output.bin> Combines different binaries at specified offsets ..
SPI Driver Customization[edit]
Editing da8xx_spi.h, spiflash_xx.c (xx is vender name of flash). Spiflash_wb.c is provided as example of TI EVM[edit]
- Customization of SPI flash driver. These are used both sbl.pjt and spiwrite.pjt
- spiflash_wb.c contains all the flash specific implementaion. Create a new file spiflash_xx.c specific to customer and copy content of spiflash_wb.c.
- Update the various flash commands and flash declarations based on the flash specific data sheet. All SPIFlash commands are implemented as specific functions, So all the below functions needed to be updated as per flash command definition.
- SPIFLASH_ManufacturerID ()
- Function to read Manufactured ID of the flash. Data format is different among venders.
- SPIFLASH_DeviceID()
- Function to read device ID of the flash. Data format is different among venders.
- SPIFLASH_Status ()
- Function to read the SPI flash device status.
- SPIFLASH_Read (void *pDst, void *pSrc, Uint32 nlength)
- Function to read the content of flash from pSrc to pDst of size nLength bytes. By default sequential read of SPI flash is implemented.
- SPIFLASH_BlockErase (Uint32 blk_no)
- Function to erase the content of block number specified by blk_no.
- SPIFLASH_Write (void *pDst, void *pSrc, Uint32 nlength)
- Function to write content to flash from pSrc to pDst of size nLength bytes. Flash programming and erasing are performed at the block level. Each block of flash is programmed in terms of page size.
- SPIFLASH_Unlock()
- Some vender’s have “write protection” at default, in this case, you need to unlock.
- SPIFLASH_ManufacturerID ()