Open shjdzc12 opened 5 years ago
I can try to answer these two questions
If you check CMakeList.txt in /sw/apps, you can find these commands:
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${SUBDIR}/boot/)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${SUBDIR}/boot/boot_code.sv
COMMAND ${UTILS_DIR}/s19toboot.py ../${NAME}.s19
Where is calls a python script to generate the boot_code.sv from boot_code.s19
If you look at boot_code.c in /sw/apps/boot_code, you can see it calling the SPI interface using:
int check_spi_flash();
spi_setup_master(1);
// sends write enable command spi_setup_cmd_addr(0x06, 8, 0, 0); spi_set_datalen(0); spi_start_transaction(SPI_CMD_WR, SPI_CSN0); while ((spi_get_status() & 0xFFFF) != 1);
// enables QPI // cmd 0x71 write any register spi_setup_cmd_addr(0x71, 8, 0x80000348, 32); spi_set_datalen(0); spi_start_transaction(SPI_CMD_WR, SPI_CSN0); while ((spi_get_status() & 0xFFFF) != 1);
Hope those answer your questions
I have two prolems about boot_code.sv.
The first problem is about the source of the instruction in boot_code.sv. Are these instructions achieved by compiling this file(sw/ref/crt0.boot.S)?
Another problem is about the function of bootload. In datasheet, I see that pulpino includes a boot ROM that contains a boot loader that can load program via SPI from an external flash device. But when I read the code in sw/ref/crt0.boot.S, I can't find any code related to SPI. How can the bootload control the SPI to load program?
Waiting for your answer. Thank you.