1 /* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * 4 * HDF is dual licensed: you can use it either under the terms of 5 * the GPL, or the BSD license, at your option. 6 * See the LICENSE file in the root of this repository for complete details. 7 */ 8 9 #ifndef MTD_SPI_NOR_H 10 #define MTD_SPI_NOR_H 11 12 #include "mtd_core.h" 13 #include "mtd_spi_common.h" 14 15 #ifdef __cplusplus 16 #if __cplusplus 17 extern "C" { 18 #endif 19 #endif /* __cplusplus */ 20 21 #define MTD_SPI_NOR_CS_MAX 2 22 23 #define MTD_SPI_ADDR_3BYTE 3 24 #define MTD_SPI_ADDR_4BYTE 4 25 26 /** 27 * @Defines the structure used to describe a spi nor flash. 28 * 29 */ 30 struct SpinorInfo { 31 const char *name; 32 uint8_t id[MTD_FLASH_ID_LEN_MAX]; 33 uint8_t idLen; 34 uint32_t blockSize; 35 uint32_t chipSize; 36 uint32_t addrCycle; 37 uint32_t qeEnable; 38 uint32_t qeSupport; 39 struct MtdSpiConfig eraseCfg; 40 struct MtdSpiConfig writeCfg; 41 struct MtdSpiConfig readCfg; 42 }; 43 44 #ifdef __cplusplus 45 #if __cplusplus 46 } 47 #endif 48 #endif /* __cplusplus */ 49 50 #endif /* MTD_SPI_NOR_H */ 51