You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

174 lines
5.9 KiB

  1. /***************************************************************************
  2. * Copyright (C) 2009 Zachary T Welch <zw@superlucidity.net> *
  3. * *
  4. * This program is free software; you can redistribute it and/or modify *
  5. * it under the terms of the GNU General Public License as published by *
  6. * the Free Software Foundation; either version 2 of the License, or *
  7. * (at your option) any later version. *
  8. * *
  9. * This program is distributed in the hope that it will be useful, *
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  12. * GNU General Public License for more details. *
  13. * *
  14. * You should have received a copy of the GNU General Public License *
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>. *
  16. ***************************************************************************/
  17. #ifdef HAVE_CONFIG_H
  18. #include "config.h"
  19. #endif
  20. #include "imp.h"
  21. extern const struct flash_driver aduc702x_flash;
  22. extern const struct flash_driver aducm360_flash;
  23. extern const struct flash_driver ambiqmicro_flash;
  24. extern const struct flash_driver at91sam3_flash;
  25. extern const struct flash_driver at91sam4_flash;
  26. extern const struct flash_driver at91sam4l_flash;
  27. extern const struct flash_driver at91sam7_flash;
  28. extern const struct flash_driver at91samd_flash;
  29. extern const struct flash_driver ath79_flash;
  30. extern const struct flash_driver atsame5_flash;
  31. extern const struct flash_driver atsamv_flash;
  32. extern const struct flash_driver avr_flash;
  33. extern const struct flash_driver bluenrgx_flash;
  34. extern const struct flash_driver cc3220sf_flash;
  35. extern const struct flash_driver cc2538_flash;
  36. extern const struct flash_driver cc26xx_flash;
  37. extern const struct flash_driver cfi_flash;
  38. extern const struct flash_driver dsp5680xx_flash;
  39. extern const struct flash_driver efm32_flash;
  40. extern const struct flash_driver em357_flash;
  41. extern const struct flash_driver esirisc_flash;
  42. extern const struct flash_driver faux_flash;
  43. extern const struct flash_driver fm3_flash;
  44. extern const struct flash_driver fm4_flash;
  45. extern const struct flash_driver fespi_flash;
  46. extern const struct flash_driver jtagspi_flash;
  47. extern const struct flash_driver kinetis_flash;
  48. extern const struct flash_driver kinetis_ke_flash;
  49. extern const struct flash_driver lpc2000_flash;
  50. extern const struct flash_driver lpc288x_flash;
  51. extern const struct flash_driver lpc2900_flash;
  52. extern const struct flash_driver lpcspifi_flash;
  53. extern const struct flash_driver max32xxx_flash;
  54. extern const struct flash_driver mdr_flash;
  55. extern const struct flash_driver mrvlqspi_flash;
  56. extern const struct flash_driver msp432_flash;
  57. extern const struct flash_driver niietcm4_flash;
  58. extern const struct flash_driver nrf5_flash;
  59. extern const struct flash_driver nrf51_flash;
  60. extern const struct flash_driver numicro_flash;
  61. extern const struct flash_driver ocl_flash;
  62. extern const struct flash_driver pic32mx_flash;
  63. extern const struct flash_driver psoc4_flash;
  64. extern const struct flash_driver psoc5lp_flash;
  65. extern const struct flash_driver psoc5lp_eeprom_flash;
  66. extern const struct flash_driver psoc5lp_nvl_flash;
  67. extern const struct flash_driver psoc6_flash;
  68. extern const struct flash_driver renesas_rpchf_flash;
  69. extern const struct flash_driver sh_qspi_flash;
  70. extern const struct flash_driver sim3x_flash;
  71. extern const struct flash_driver stellaris_flash;
  72. extern const struct flash_driver stm32f1x_flash;
  73. extern const struct flash_driver stm32f2x_flash;
  74. extern const struct flash_driver stm32lx_flash;
  75. extern const struct flash_driver stm32l4x_flash;
  76. extern const struct flash_driver stm32h7x_flash;
  77. extern const struct flash_driver stmsmi_flash;
  78. extern const struct flash_driver str7x_flash;
  79. extern const struct flash_driver str9x_flash;
  80. extern const struct flash_driver str9xpec_flash;
  81. extern const struct flash_driver swm050_flash;
  82. extern const struct flash_driver tms470_flash;
  83. extern const struct flash_driver virtual_flash;
  84. extern const struct flash_driver w600_flash;
  85. extern const struct flash_driver xcf_flash;
  86. extern const struct flash_driver xmc1xxx_flash;
  87. extern const struct flash_driver xmc4xxx_flash;
  88. /**
  89. * The list of built-in flash drivers.
  90. * @todo Make this dynamically extendable with loadable modules.
  91. */
  92. static const struct flash_driver * const flash_drivers[] = {
  93. &aduc702x_flash,
  94. &aducm360_flash,
  95. &ambiqmicro_flash,
  96. &at91sam3_flash,
  97. &at91sam4_flash,
  98. &at91sam4l_flash,
  99. &at91sam7_flash,
  100. &at91samd_flash,
  101. &ath79_flash,
  102. &atsame5_flash,
  103. &atsamv_flash,
  104. &avr_flash,
  105. &bluenrgx_flash,
  106. &cc3220sf_flash,
  107. &cc2538_flash,
  108. &cc26xx_flash,
  109. &cfi_flash,
  110. &dsp5680xx_flash,
  111. &efm32_flash,
  112. &em357_flash,
  113. &esirisc_flash,
  114. &faux_flash,
  115. &fm3_flash,
  116. &fm4_flash,
  117. &fespi_flash,
  118. &jtagspi_flash,
  119. &kinetis_flash,
  120. &kinetis_ke_flash,
  121. &lpc2000_flash,
  122. &lpc288x_flash,
  123. &lpc2900_flash,
  124. &lpcspifi_flash,
  125. &max32xxx_flash,
  126. &mdr_flash,
  127. &mrvlqspi_flash,
  128. &msp432_flash,
  129. &niietcm4_flash,
  130. &nrf5_flash,
  131. &nrf51_flash,
  132. &numicro_flash,
  133. &ocl_flash,
  134. &pic32mx_flash,
  135. &psoc4_flash,
  136. &psoc5lp_flash,
  137. &psoc5lp_eeprom_flash,
  138. &psoc5lp_nvl_flash,
  139. &psoc6_flash,
  140. &renesas_rpchf_flash,
  141. &sh_qspi_flash,
  142. &sim3x_flash,
  143. &stellaris_flash,
  144. &stm32f1x_flash,
  145. &stm32f2x_flash,
  146. &stm32lx_flash,
  147. &stm32l4x_flash,
  148. &stm32h7x_flash,
  149. &stmsmi_flash,
  150. &str7x_flash,
  151. &str9x_flash,
  152. &str9xpec_flash,
  153. &swm050_flash,
  154. &tms470_flash,
  155. &virtual_flash,
  156. &xcf_flash,
  157. &xmc1xxx_flash,
  158. &xmc4xxx_flash,
  159. &w600_flash,
  160. NULL,
  161. };
  162. const struct flash_driver *flash_driver_find_by_name(const char *name)
  163. {
  164. for (unsigned i = 0; flash_drivers[i]; i++) {
  165. if (strcmp(name, flash_drivers[i]->name) == 0)
  166. return flash_drivers[i];
  167. }
  168. return NULL;
  169. }