BF592 baud rate setting for boot program


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.

Best regards,


Corrected a few typos.
[edited by: hide310 at 12:36 PM (GMT 0) on 7 Feb 2019]