sifive: fu540: Enable spi-nor flash support
authorJagan Teki <jagan@amarulasolutions.com>
Wed, 29 Apr 2020 15:33:53 +0000 (21:03 +0530)
committerJagan Teki <jagan@amarulasolutions.com>
Thu, 30 Apr 2020 17:04:20 +0000 (22:34 +0530)
HiFive Unleashed A00 support is25wp256 spi-nor flash,
So enable the same and add test result log for future
reference.

Tested on SiFive FU540 board.

Thanks to Sagar for various use cases and tests.

[QUAD mode in dt with spi-tx-bus-width: <4>]
 pp opcode      = 0x34 [QUAD MODE]
 read opcode  = 0x6c  [QUAD MODE]
 erase opcode = 0x21

SPI-NOR:
1. erase entire flash: Pass
2. write entire flash: Pass
3. read entire flash: Pass
4. cmp 32MiB read back data: Pass
5. MMC: Booted Linux and dtb from mmc

[SPI MODE in dt with spi-tx-bus-width: <1>]
pp opcode     = 0x12 [SPI MODE]
read opcode  = 0xc   [SPI MODE]
erase opcode = 0x21

SPI-NOR:
1. erase entire flash: Pass
2. write entire flash: Pass
3. read entire flash: Pass
4. cmp 32MiB read back data: Pass
5. MMC: Booted Linux and dtb from mmc

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Sagar Kadam <sagar.kadam@sifive.com>
arch/riscv/dts/hifive-unleashed-a00-u-boot.dtsi
board/sifive/fu540/Kconfig

index 8a784b56619464dcb1ade3116e680beace24b08e..2aebfab646659dae54c722dabac5e038ab737e9a 100644 (file)
@@ -5,6 +5,7 @@
 
 / {
        aliases {
+               spi0 = &qspi0;
                spi2 = &qspi2;
        };
 };
index 5ca21474deea9c40d60805a13d0148cfe308e0e1..75661f35f8aae86ce377728e74b05fd96bc9b46c 100644 (file)
@@ -26,6 +26,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
        imply CMD_FS_GENERIC
        imply CMD_NET
        imply CMD_PING
+       imply CMD_SF
        imply CLK_SIFIVE
        imply CLK_SIFIVE_FU540_PRCI
        imply DOS_PARTITION
@@ -40,6 +41,8 @@ config BOARD_SPECIFIC_OPTIONS # dummy
        imply SIFIVE_SERIAL
        imply SPI
        imply SPI_SIFIVE
+       imply SPI_FLASH
+       imply SPI_FLASH_ISSI
        imply MMC
        imply MMC_SPI
        imply MMC_BROKEN_CD