X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=include%2Fspi_flash.h;h=2db53c74c88efa794eeacab10220d49d56bd0a31;hb=327def5060d03648801b8c92b3235b0c9426af47;hp=213d6592be90605b08b68d88157e048f7707d418;hpb=2ba863fae628bb5fe2ec4b803f639c1edb55ea33;p=u-boot diff --git a/include/spi_flash.h b/include/spi_flash.h index 213d6592be..2db53c74c8 100644 --- a/include/spi_flash.h +++ b/include/spi_flash.h @@ -36,6 +36,13 @@ enum spi_read_cmds { #define RD_EXTN ARRAY_SLOW | DUAL_OUTPUT_FAST | DUAL_IO_FAST #define RD_FULL RD_EXTN | QUAD_OUTPUT_FAST | QUAD_IO_FAST +/* Dual SPI flash memories */ +enum spi_dual_flash { + SF_SINGLE_FLASH = 0, + SF_DUAL_STACKED_FLASH = 1 << 0, + SF_DUAL_PARALLEL_FLASH = 1 << 1, +}; + /** * struct spi_flash_params - SPI/QSPI flash device params structure * @@ -45,7 +52,7 @@ enum spi_read_cmds { * @sector_size: Sector size of this device * @nr_sectors: No.of sectors on this device * @e_rd_cmd: Enum list for read commands - * @flags: Importent param, for flash specific behaviour + * @flags: Important param, for flash specific behaviour */ struct spi_flash_params { const char *name; @@ -64,6 +71,8 @@ extern const struct spi_flash_params spi_flash_params_table[]; * * @spi: SPI slave * @name: Name of SPI flash + * @dual_flash: Indicates dual flash memories - dual stacked, parallel + * @shift: Flash shift useful in dual parallel * @size: Total flash size * @page_size: Write (page) size * @sector_size: Sector size @@ -79,15 +88,17 @@ extern const struct spi_flash_params spi_flash_params_table[]; * @memory_map: Address of read-only SPI flash access * @read: Flash read ops: Read len bytes at offset into buf * Supported cmds: Fast Array Read - * @write: Flash write ops: Write len bytes from buf into offeset + * @write: Flash write ops: Write len bytes from buf into offset * Supported cmds: Page Program * @erase: Flash erase ops: Erase len bytes from offset * Supported cmds: Sector erase 4K, 32K, 64K - * return 0 - Sucess, 1 - Failure + * return 0 - Success, 1 - Failure */ struct spi_flash { struct spi_slave *spi; const char *name; + u8 dual_flash; + u8 shift; u32 size; u32 page_size; @@ -147,5 +158,6 @@ static inline int spi_flash_erase(struct spi_flash *flash, u32 offset, } void spi_boot(void) __noreturn; +void spi_spl_load_image(uint32_t offs, unsigned int size, void *vdst); #endif /* _SPI_FLASH_H_ */