flash_info.h 2.3 KB

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