I need an advice to increase the SPI baud rate at the boot process from an SPI flash.
I have made a custom board with BF592 which boots from a SPI flash connected to SPI0 (BMODE:100). BF592 is fed with a 12.288MHz clock to its CLKIN port but it takes as long as 4.8 sec to read a 37KB program from the SPI flash, so I want to increase the SPI baud rate to accelerate the boot process (speed of x8 or x16 is quite enough).
Reading the hardware reference, I understand SCK frequency of SPI is equal to SCLK divided by 133, resulting from the default SPI_BAUD register value.
On page 16-70 of hardware reference, it says "The BFLAG_FASTREAD flag controls whether standard SPI read (0x3 command) or fast read (0xB) is performed. The three lower bits of the dFlags word are translated by the boot kernel into specific values to the SPI1_BAUD registers."
But there is no mention how to change SPI0_BAUD registers and "The three lower bits" seem to refer to BFLAG_TYPE and BFLAG_HDRINDIRECT which look quite unrelated to baud rate... I think bfrom_SpiBoot() function can be used to change the baud rate for booting but I cannot find any example code how to use it. Please tell me where to look for helpful info or I will be more than happy if you could give me an example code.
Thanks a lot for your answer. I manage to customize my program to boot at its maximum speed. It became almost x100 faster after modifying PLL as well.I really appreciate your support!
For the sake…
Hi,I understand that you want to increase the booting speed. One solution to accelerate the booting process is to add initialization code which changes the processor’s settings to make it run the boot process at the maximum speed. Initcode routines are subroutines that the boot kernel calls during the booting process. The user can customize and speed up the booting mechanisms using this feature. It is used to set up system PLL, bit rates, and other system settings.For more details regarding this, please refer the Application Note EE-308(Estimating and Optimizing Booting Time for Blackfin® Processors) and its associated example. Though this is for ADSP-BF533, you can modify it for BF592 as well.www.analog.com/.../EE_308.Rev1.12.06.pdfRegards,Lalitha S
For the sake of other people interested.Application Note EE-308 included obsolete info. For example, BTET.exe seems included in VisualDSP++ but not in CCES. But the document gives you enough idea how initcode works at booting.Example initcode for BF592 is stored at the following directory: "CrossCore Embedded Studio 2.8.0\Blackfin\ldr\init_code\BF592_init\ezkitBF592_initcode_ROM-V01" and it can be loaded to CCES as a project.After customizing the parameters in ezkitBF592_initcode.h depending on your system and demand, build the project to create .dxe file.Then you can attach this initcode .dxe file at the head of your main program .dxe by adding -init option to the elfloader command to create .ldr file.elfloader -proc ADSP-BF592-A -si-revision 0.2 -b spimaster -f binary -width 8 -o "fastLoad.ldr" -init "initcode.dxe" "main.dxe"Now you are ready to write the .ldr to your flash with cldp program and will be amazed at fast booting!