openocd: fix SPDX tag format for files .c
[fw/openocd] / src / helper / jep106.c
1 // SPDX-License-Identifier: GPL-2.0-or-later
2
3 /***************************************************************************
4  *   Copyright (C) 2015 Andreas Fritiofson                                 *
5  *   andreas.fritiofson@gmail.com                                          *
6  ***************************************************************************/
7
8 #ifdef HAVE_CONFIG_H
9 #include "config.h"
10 #endif
11
12 #include "jep106.h"
13 #include "log.h"
14
15 static const char * const jep106[][126] = {
16 #include "jep106.inc"
17 };
18
19 const char *jep106_table_manufacturer(unsigned int bank, unsigned int id)
20 {
21         if (id < 1 || id > 126) {
22                 LOG_DEBUG("BUG: Caller passed out-of-range JEP106 ID!");
23                 return "<invalid>";
24         }
25
26         /* index is zero based */
27         id--;
28
29         if (bank >= ARRAY_SIZE(jep106) || jep106[bank][id] == 0)
30                 return "<unknown>";
31
32         return jep106[bank][id];
33 }