Advertisement
Guest User

Openocd Nrf52 support

a guest
Jun 10th, 2017
1,731
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 4.61 KB | None | 0 0
  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.  
  18. #ifdef HAVE_CONFIG_H
  19. #include "config.h"
  20. #endif
  21. #include "imp.h"
  22.  
  23. extern struct flash_driver aduc702x_flash;
  24. extern struct flash_driver aducm360_flash;
  25. extern struct flash_driver ambiqmicro_flash;
  26. extern struct flash_driver at91sam3_flash;
  27. extern struct flash_driver at91sam4_flash;
  28. extern struct flash_driver at91sam4l_flash;
  29. extern struct flash_driver at91sam7_flash;
  30. extern struct flash_driver at91samd_flash;
  31. extern struct flash_driver ath79_flash;
  32. extern struct flash_driver atsamv_flash;
  33. extern struct flash_driver avr_flash;
  34. extern struct flash_driver cfi_flash;
  35. extern struct flash_driver dsp5680xx_flash;
  36. extern struct flash_driver efm32_flash;
  37. extern struct flash_driver em357_flash;
  38. extern struct flash_driver faux_flash;
  39. extern struct flash_driver fm3_flash;
  40. extern struct flash_driver fm4_flash;
  41. extern struct flash_driver jtagspi_flash;
  42. extern struct flash_driver kinetis_flash;
  43. extern struct flash_driver kinetis_ke_flash;
  44. extern struct flash_driver lpc2000_flash;
  45. extern struct flash_driver lpc288x_flash;
  46. extern struct flash_driver lpc2900_flash;
  47. extern struct flash_driver lpcspifi_flash;
  48. extern struct flash_driver mdr_flash;
  49. extern struct flash_driver numicro_flash;
  50. extern struct flash_driver nrf51_flash;
  51. extern struct flash_driver nrf52_flash;
  52. extern struct flash_driver mrvlqspi_flash;
  53. extern struct flash_driver niietcm4_flash;
  54. extern struct flash_driver nrf51_flash;
  55. extern struct flash_driver numicro_flash;
  56. extern struct flash_driver ocl_flash;
  57. extern struct flash_driver pic32mx_flash;
  58. extern struct flash_driver psoc4_flash;
  59. extern struct flash_driver sim3x_flash;
  60. extern struct flash_driver stellaris_flash;
  61. extern struct flash_driver stm32f1x_flash;
  62. extern struct flash_driver stm32f2x_flash;
  63. extern struct flash_driver stm32lx_flash;
  64. extern struct flash_driver stm32l4x_flash;
  65. extern struct flash_driver stmsmi_flash;
  66. extern struct flash_driver str7x_flash;
  67. extern struct flash_driver str9x_flash;
  68. extern struct flash_driver str9xpec_flash;
  69. extern struct flash_driver tms470_flash;
  70. extern struct flash_driver virtual_flash;
  71. extern struct flash_driver xmc1xxx_flash;
  72. extern struct flash_driver xmc4xxx_flash;
  73.  
  74. /**
  75.  * The list of built-in flash drivers.
  76.  * @todo Make this dynamically extendable with loadable modules.
  77.  */
  78. static struct flash_driver *flash_drivers[] = {
  79.     &aduc702x_flash,
  80.     &aducm360_flash,
  81.     &ambiqmicro_flash,
  82.     &at91sam3_flash,
  83.     &at91sam4_flash,
  84.     &at91sam4l_flash,
  85.     &at91sam7_flash,
  86.     &at91samd_flash,
  87.     &ath79_flash,
  88.     &atsamv_flash,
  89.     &avr_flash,
  90.     &cfi_flash,
  91.     &dsp5680xx_flash,
  92.     &efm32_flash,
  93.     &em357_flash,
  94.     &faux_flash,
  95.     &fm3_flash,
  96.     &fm4_flash,
  97.     &jtagspi_flash,
  98.     &kinetis_flash,
  99.     &kinetis_ke_flash,
  100.     &lpc2000_flash,
  101.     &lpc288x_flash,
  102.     &lpc2900_flash,
  103.     &lpcspifi_flash,
  104.     &mdr_flash,
  105.     &numicro_flash,
  106.     &nrf51_flash,
  107.     &nrf52_flash,
  108.     &mrvlqspi_flash,
  109.     &niietcm4_flash,
  110.     &nrf51_flash,
  111.     &numicro_flash,
  112.     &ocl_flash,
  113.     &pic32mx_flash,
  114.     &psoc4_flash,
  115.     &sim3x_flash,
  116.     &stellaris_flash,
  117.     &stm32f1x_flash,
  118.     &stm32f2x_flash,
  119.     &stm32lx_flash,
  120.     &stm32l4x_flash,
  121.     &stmsmi_flash,
  122.     &str7x_flash,
  123.     &str9x_flash,
  124.     &str9xpec_flash,
  125.     &tms470_flash,
  126.     &virtual_flash,
  127.     &xmc1xxx_flash,
  128.     &xmc4xxx_flash,
  129.     NULL,
  130. };
  131.  
  132. struct flash_driver *flash_driver_find_by_name(const char *name)
  133. {
  134.     for (unsigned i = 0; flash_drivers[i]; i++) {
  135.         if (strcmp(name, flash_drivers[i]->name) == 0)
  136.             return flash_drivers[i];
  137.     }
  138.     return NULL;
  139. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement