Kuldeep Singh | 5a0f9da | 2020-12-09 14:02:39 +0530 | [diff] [blame] | 1 | // SPDX-License-Identifier: BSD-3-Clause |
| 2 | /* |
Jiafei Pan | 44b08dd | 2021-09-10 19:15:15 +0800 | [diff] [blame] | 3 | * Copyright 2020-2021 NXP |
Kuldeep Singh | 5a0f9da | 2020-12-09 14:02:39 +0530 | [diff] [blame] | 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 | |
Pankaj Gupta | ffc59cd | 2021-10-06 14:47:27 +0530 | [diff] [blame] | 15 | /* Start of "if defined(CONFIG_MT25QU512A)" */ |
Kuldeep Singh | 5a0f9da | 2020-12-09 14:02:39 +0530 | [diff] [blame] | 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 | |
Pankaj Gupta | ffc59cd | 2021-10-06 14:47:27 +0530 | [diff] [blame] | 26 | /* End of "if defined(CONFIG_MT25QU512A)" */ |
| 27 | |
| 28 | /* Start of "if defined(CONFIG_MX25U25645G)" */ |
Kuldeep Singh | 5a0f9da | 2020-12-09 14:02:39 +0530 | [diff] [blame] | 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 | |
Pankaj Gupta | ffc59cd | 2021-10-06 14:47:27 +0530 | [diff] [blame] | 39 | /* End of "if defined(CONFIG_MX25U25645G)" */ |
| 40 | |
| 41 | /* Start of "if defined(CONFIG_MX25U51245G)" */ |
Kuldeep Singh | 5a0f9da | 2020-12-09 14:02:39 +0530 | [diff] [blame] | 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 | |
Pankaj Gupta | ffc59cd | 2021-10-06 14:47:27 +0530 | [diff] [blame] | 52 | /* End of "if defined(CONFIG_MX25U51245G)" */ |
| 53 | |
| 54 | /* Start of "if defined(CONFIG_MT35XU512A)" */ |
Kuldeep Singh | 5a0f9da | 2020-12-09 14:02:39 +0530 | [diff] [blame] | 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 |
Pankaj Gupta | ffc59cd | 2021-10-06 14:47:27 +0530 | [diff] [blame] | 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 |
Kuldeep Singh | 5a0f9da | 2020-12-09 14:02:39 +0530 | [diff] [blame] | 73 | |
Pankaj Gupta | ffc59cd | 2021-10-06 14:47:27 +0530 | [diff] [blame] | 74 | /* End of "if defined(CONFIG_MT35XU512A)" */ |
| 75 | |
| 76 | /* Start of #elif defined(CONFIG_MT35XU02G) */ |
Jiafei Pan | 44b08dd | 2021-09-10 19:15:15 +0800 | [diff] [blame] | 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 | |
Pankaj Gupta | ffc59cd | 2021-10-06 14:47:27 +0530 | [diff] [blame] | 87 | #endif /* End of #elif defined(CONFIG_MT35XU02G) */ |
Kuldeep Singh | 5a0f9da | 2020-12-09 14:02:39 +0530 | [diff] [blame] | 88 | |
Kuldeep Singh | 5a0f9da | 2020-12-09 14:02:39 +0530 | [diff] [blame] | 89 | #endif /* FLASH_INFO_H */ |