add support for Atmel SAMD NOR Flash
[openocd.git] / src / flash / nor / drivers.c
blob39c2f9fcd7ea949062e000e8713b3a82a06e95a7
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, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
18 ***************************************************************************/
20 #ifdef HAVE_CONFIG_H
21 #include "config.h"
22 #endif
23 #include "imp.h"
25 extern struct flash_driver lpc2000_flash;
26 extern struct flash_driver lpc288x_flash;
27 extern struct flash_driver lpc2900_flash;
28 extern struct flash_driver lpcspifi_flash;
29 extern struct flash_driver cfi_flash;
30 extern struct flash_driver at91sam3_flash;
31 extern struct flash_driver at91sam4_flash;
32 extern struct flash_driver at91sam4l_flash;
33 extern struct flash_driver at91samd_flash;
34 extern struct flash_driver at91sam7_flash;
35 extern struct flash_driver str7x_flash;
36 extern struct flash_driver str9x_flash;
37 extern struct flash_driver aduc702x_flash;
38 extern struct flash_driver stellaris_flash;
39 extern struct flash_driver str9xpec_flash;
40 extern struct flash_driver stm32f1x_flash;
41 extern struct flash_driver stm32f2x_flash;
42 extern struct flash_driver stm32lx_flash;
43 extern struct flash_driver tms470_flash;
44 extern struct flash_driver ocl_flash;
45 extern struct flash_driver pic32mx_flash;
46 extern struct flash_driver avr_flash;
47 extern struct flash_driver faux_flash;
48 extern struct flash_driver virtual_flash;
49 extern struct flash_driver stmsmi_flash;
50 extern struct flash_driver em357_flash;
51 extern struct flash_driver dsp5680xx_flash;
52 extern struct flash_driver fm3_flash;
53 extern struct flash_driver kinetis_flash;
54 extern struct flash_driver efm32_flash;
55 extern struct flash_driver mdr_flash;
56 extern struct flash_driver mini51_flash;
57 extern struct flash_driver nuc1x_flash;
59 /**
60 * The list of built-in flash drivers.
61 * @todo Make this dynamically extendable with loadable modules.
63 static struct flash_driver *flash_drivers[] = {
64 &lpc2000_flash,
65 &lpc288x_flash,
66 &lpc2900_flash,
67 &lpcspifi_flash,
68 &cfi_flash,
69 &at91sam7_flash,
70 &at91sam3_flash,
71 &at91sam4_flash,
72 &at91sam4l_flash,
73 &at91samd_flash,
74 &str7x_flash,
75 &str9x_flash,
76 &aduc702x_flash,
77 &stellaris_flash,
78 &str9xpec_flash,
79 &stm32f1x_flash,
80 &stm32f2x_flash,
81 &stm32lx_flash,
82 &tms470_flash,
83 &ocl_flash,
84 &pic32mx_flash,
85 &avr_flash,
86 &faux_flash,
87 &virtual_flash,
88 &stmsmi_flash,
89 &em357_flash,
90 &fm3_flash,
91 &dsp5680xx_flash,
92 &kinetis_flash,
93 &efm32_flash,
94 &mdr_flash,
95 &mini51_flash,
96 &nuc1x_flash,
97 NULL,
100 struct flash_driver *flash_driver_find_by_name(const char *name)
102 for (unsigned i = 0; flash_drivers[i]; i++) {
103 if (strcmp(name, flash_drivers[i]->name) == 0)
104 return flash_drivers[i];
106 return NULL;