blob: d0ffc86b4fbf5c6fa19a59ab53191ee00e3c4d4f [file] [log] [blame]
Kuldeep Singh5a0f9da2020-12-09 14:02:39 +05301// SPDX-License-Identifier: BSD-3-Clause
2/*
Jiafei Pan44b08dd2021-09-10 19:15:15 +08003 * Copyright 2020-2021 NXP
Kuldeep Singh5a0f9da2020-12-09 14:02:39 +05304 */
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 Guptaffc59cd2021-10-06 14:47:27 +053015/* Start of "if defined(CONFIG_MT25QU512A)" */
Kuldeep Singh5a0f9da2020-12-09 14:02:39 +053016#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 Guptaffc59cd2021-10-06 14:47:27 +053026/* End of "if defined(CONFIG_MT25QU512A)" */
27
28/* Start of "if defined(CONFIG_MX25U25645G)" */
Kuldeep Singh5a0f9da2020-12-09 14:02:39 +053029#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 Guptaffc59cd2021-10-06 14:47:27 +053039/* End of "if defined(CONFIG_MX25U25645G)" */
40
41/* Start of "if defined(CONFIG_MX25U51245G)" */
Kuldeep Singh5a0f9da2020-12-09 14:02:39 +053042#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 Guptaffc59cd2021-10-06 14:47:27 +053052/* End of "if defined(CONFIG_MX25U51245G)" */
53
54/* Start of "if defined(CONFIG_MT35XU512A)" */
Kuldeep Singh5a0f9da2020-12-09 14:02:39 +053055#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 Guptaffc59cd2021-10-06 14:47:27 +053065/* 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 Singh5a0f9da2020-12-09 14:02:39 +053073
Pankaj Guptaffc59cd2021-10-06 14:47:27 +053074/* End of "if defined(CONFIG_MT35XU512A)" */
75
76/* Start of #elif defined(CONFIG_MT35XU02G) */
Jiafei Pan44b08dd2021-09-10 19:15:15 +080077#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 Guptaffc59cd2021-10-06 14:47:27 +053087#endif /* End of #elif defined(CONFIG_MT35XU02G) */
Kuldeep Singh5a0f9da2020-12-09 14:02:39 +053088
Kuldeep Singh5a0f9da2020-12-09 14:02:39 +053089#endif /* FLASH_INFO_H */