Xiang Wang has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/30466 )
Change subject: soc/sifive/fu540: add code to initialize flash ......................................................................
Patch Set 29:
(4 comments)
https://review.coreboot.org/#/c/30466/29/src/mainboard/sifive/hifive-unleash... File src/mainboard/sifive/hifive-unleashed/flash.c:
https://review.coreboot.org/#/c/30466/29/src/mainboard/sifive/hifive-unleash... PS29, Line 35: .data_proto = SPI_PROTO_Q,
That should read MSEL and determine the boot mode. If running in single bit mode use SPI_PROTO_S.
These codes are for HiFive Unleashed, the hardware link as QPI, and using SPI here only makes the performance worse, no need
https://review.coreboot.org/#/c/30466/29/src/mainboard/sifive/hifive-unleash... PS29, Line 42: initialize_spi_flash_mmap(
That should read MSEL and determine the boot mode. […]
These codes used for HiFive Unleashed. This board doesn't have that much choice.
https://review.coreboot.org/#/c/30466/29/src/soc/sifive/fu540/spi.c File src/soc/sifive/fu540/spi.c:
https://review.coreboot.org/#/c/30466/29/src/soc/sifive/fu540/spi.c@59 PS29, Line 59: }
That should implement […]
This code is too heavy. Here is just mapping flash to memory space
https://review.coreboot.org/#/c/30466/29/src/soc/sifive/fu540/spi_flash.c File src/soc/sifive/fu540/spi_flash.c:
https://review.coreboot.org/#/c/30466/29/src/soc/sifive/fu540/spi_flash.c@52 PS29, Line 52: spi_txrx(spictrl, command_enable);
Should use generic spi_xfer()
spi-generic.c is too heavy. Here is just mapping flash to memory space