X-Git-Url: https://git.kernelconcepts.de/?a=blobdiff_plain;f=include%2Fspi_flash.h;h=408a5b401cd91e66e88b84eab5c1dcef97681522;hb=5a1d0ad3ee1ba98ca273c4b35c68618f107ccadd;hp=f79f0eacca03b66d6604e1dfe9e3afd4f38bb250;hpb=b5c068f3f8be5c2f73fc6699885aec0d342099bb;p=karo-tx-uboot.git diff --git a/include/spi_flash.h b/include/spi_flash.h index f79f0eacca..408a5b401c 100644 --- a/include/spi_flash.h +++ b/include/spi_flash.h @@ -19,6 +19,19 @@ #include #include +#ifndef CONFIG_SF_DEFAULT_SPEED +# define CONFIG_SF_DEFAULT_SPEED 1000000 +#endif +#ifndef CONFIG_SF_DEFAULT_MODE +# define CONFIG_SF_DEFAULT_MODE SPI_MODE_3 +#endif +#ifndef CONFIG_SF_DEFAULT_CS +# define CONFIG_SF_DEFAULT_CS 0 +#endif +#ifndef CONFIG_SF_DEFAULT_BUS +# define CONFIG_SF_DEFAULT_BUS 0 +#endif + /* sf param flags */ #define SECT_4K 1 << 1 #define SECT_32K 1 << 2 @@ -52,7 +65,7 @@ enum spi_dual_flash { * @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; @@ -88,11 +101,11 @@ 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; @@ -158,5 +171,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_ */