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 struct SpinorInfo { 27 const char *name; 28 uint8_t id[MTD_FLASH_ID_LEN_MAX]; 29 uint8_t idLen; 30 uint32_t blockSize; 31 uint32_t chipSize; 32 uint32_t addrCycle; 33 uint32_t qeEnable; 34 uint32_t qeSupport; 35 struct MtdSpiConfig eraseCfg; 36 struct MtdSpiConfig writeCfg; 37 struct MtdSpiConfig readCfg; 38 }; 39 40 #ifdef __cplusplus 41 #if __cplusplus 42 } 43 #endif 44 #endif /* __cplusplus */ 45 46 #endif /* MTD_SPI_NOR_H */ 47