1 // SPDX-License-Identifier: BSD-3-Clause 2 /* 3 * Copyright 2020-2021 NXP 4 */ 5 6 /** 7 * @Flash info 8 * 9 */ 10 #ifndef FLASH_INFO_H 11 #define FLASH_INFO_H 12 13 #define SZ_16M_BYTES 0x1000000U 14 15 /* Start of "if defined(CONFIG_MT25QU512A)" */ 16 #if defined(CONFIG_MT25QU512A) 17 #define F_SECTOR_64K 0x10000U 18 #define F_PAGE_256 0x100U 19 #define F_SECTOR_4K 0x1000U 20 #define F_FLASH_SIZE_BYTES 0x4000000U 21 #define F_SECTOR_ERASE_SZ F_SECTOR_64K 22 #ifdef CONFIG_FSPI_4K_ERASE 23 #define F_SECTOR_ERASE_SZ F_SECTOR_4K 24 #endif 25 26 /* End of "if defined(CONFIG_MT25QU512A)" */ 27 28 /* Start of "if defined(CONFIG_MX25U25645G)" */ 29 #elif defined(CONFIG_MX25U25645G) 30 #define F_SECTOR_64K 0x10000U 31 #define F_PAGE_256 0x100U 32 #define F_SECTOR_4K 0x1000U 33 #define F_FLASH_SIZE_BYTES 0x2000000U 34 #define F_SECTOR_ERASE_SZ F_SECTOR_64K 35 #ifdef CONFIG_FSPI_4K_ERASE 36 #define F_SECTOR_ERASE_SZ F_SECTOR_4K 37 #endif 38 39 /* End of "if defined(CONFIG_MX25U25645G)" */ 40 41 /* Start of "if defined(CONFIG_MX25U51245G)" */ 42 #elif defined(CONFIG_MX25U51245G) 43 #define F_SECTOR_64K 0x10000U 44 #define F_PAGE_256 0x100U 45 #define F_SECTOR_4K 0x1000U 46 #define F_FLASH_SIZE_BYTES 0x4000000U 47 #define F_SECTOR_ERASE_SZ F_SECTOR_64K 48 #ifdef CONFIG_FSPI_4K_ERASE 49 #define F_SECTOR_ERASE_SZ F_SECTOR_4K 50 #endif 51 52 /* End of "if defined(CONFIG_MX25U51245G)" */ 53 54 /* Start of "if defined(CONFIG_MT35XU512A)" */ 55 #elif defined(CONFIG_MT35XU512A) 56 #define F_SECTOR_128K 0x20000U 57 #define F_SECTOR_32K 0x8000U 58 #define F_PAGE_256 0x100U 59 #define F_SECTOR_4K 0x1000U 60 #define F_FLASH_SIZE_BYTES 0x4000000U 61 #define F_SECTOR_ERASE_SZ F_SECTOR_128K 62 #ifdef CONFIG_FSPI_4K_ERASE 63 #define F_SECTOR_ERASE_SZ F_SECTOR_4K 64 #endif 65 /* If Warm boot is enabled for the platform, 66 * count of arm instruction N-OP(s) to mark 67 * the completion of write operation to flash; 68 * varies from one flash to other. 69 */ 70 #ifdef NXP_WARM_BOOT 71 #define FLASH_WR_COMP_WAIT_BY_NOP_COUNT 0x20000 72 #endif 73 74 /* End of "if defined(CONFIG_MT35XU512A)" */ 75 76 /* Start of #elif defined(CONFIG_MT35XU02G) */ 77 #elif defined(CONFIG_MT35XU02G) 78 #define F_SECTOR_128K 0x20000U 79 #define F_PAGE_256 0x100U 80 #define F_SECTOR_4K 0x1000U 81 #define F_FLASH_SIZE_BYTES 0x10000000U 82 #define F_SECTOR_ERASE_SZ F_SECTOR_128K 83 #ifdef CONFIG_FSPI_4K_ERASE 84 #define F_SECTOR_ERASE_SZ F_SECTOR_4K 85 #endif 86 87 #endif /* End of #elif defined(CONFIG_MT35XU02G) */ 88 89 #endif /* FLASH_INFO_H */ 90