I've got a Unleashed to test your code and found it useful after working with it less than 5 minutes.
Some more comments as I finally understand what's going on.
4 comments:
File src/mainboard/sifive/hifive-unleashed/flash.c:
Patch Set #29, 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.
Patch Set #29, Line 42: initialize_spi_flash_mmap(
That should read MSEL and determine the boot mode. User can select between FU540_QSPI0, FU540_QSPI1, FU540_QSPI2 ?
File src/soc/sifive/fu540/spi.c:
That should implement
"const struct spi_ctrlr_buses spi_ctrlr_bus_map" and
"const size_t spi_ctrlr_bus_map_count"
in order to use the generic src/drivers/spi/spi-generic.c and existing SPI drivers.
File src/soc/sifive/fu540/spi_flash.c:
Patch Set #29, Line 52: spi_txrx(spictrl, command_enable);
Should use generic spi_xfer()
To view, visit change 30466. To unsubscribe, or for help writing mail filters, visit settings.