1*d2a56bd2STaylor Simpson /*
2*d2a56bd2STaylor Simpson  *  Copyright(c) 2019-2021 Qualcomm Innovation Center, Inc. All Rights Reserved.
3*d2a56bd2STaylor Simpson  *
4*d2a56bd2STaylor Simpson  *  This program is free software; you can redistribute it and/or modify
5*d2a56bd2STaylor Simpson  *  it under the terms of the GNU General Public License as published by
6*d2a56bd2STaylor Simpson  *  the Free Software Foundation; either version 2 of the License, or
7*d2a56bd2STaylor Simpson  *  (at your option) any later version.
8*d2a56bd2STaylor Simpson  *
9*d2a56bd2STaylor Simpson  *  This program is distributed in the hope that it will be useful,
10*d2a56bd2STaylor Simpson  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11*d2a56bd2STaylor Simpson  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12*d2a56bd2STaylor Simpson  *  GNU General Public License for more details.
13*d2a56bd2STaylor Simpson  *
14*d2a56bd2STaylor Simpson  *  You should have received a copy of the GNU General Public License
15*d2a56bd2STaylor Simpson  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
16*d2a56bd2STaylor Simpson  */
17*d2a56bd2STaylor Simpson 
18*d2a56bd2STaylor Simpson #ifndef HEXAGON_TARGET_ELF_H
19*d2a56bd2STaylor Simpson #define HEXAGON_TARGET_ELF_H
20*d2a56bd2STaylor Simpson 
21*d2a56bd2STaylor Simpson static inline const char *cpu_get_model(uint32_t eflags)
22*d2a56bd2STaylor Simpson {
23*d2a56bd2STaylor Simpson     /* For now, treat anything newer than v5 as a v67 */
24*d2a56bd2STaylor Simpson     /* FIXME - Disable instructions that are newer than the specified arch */
25*d2a56bd2STaylor Simpson     if (eflags == 0x04 ||    /* v5  */
26*d2a56bd2STaylor Simpson         eflags == 0x05 ||    /* v55 */
27*d2a56bd2STaylor Simpson         eflags == 0x60 ||    /* v60 */
28*d2a56bd2STaylor Simpson         eflags == 0x61 ||    /* v61 */
29*d2a56bd2STaylor Simpson         eflags == 0x62 ||    /* v62 */
30*d2a56bd2STaylor Simpson         eflags == 0x65 ||    /* v65 */
31*d2a56bd2STaylor Simpson         eflags == 0x66 ||    /* v66 */
32*d2a56bd2STaylor Simpson         eflags == 0x67 ||    /* v67 */
33*d2a56bd2STaylor Simpson         eflags == 0x8067     /* v67t */
34*d2a56bd2STaylor Simpson        ) {
35*d2a56bd2STaylor Simpson         return "v67";
36*d2a56bd2STaylor Simpson     }
37*d2a56bd2STaylor Simpson     return "unknown";
38*d2a56bd2STaylor Simpson }
39*d2a56bd2STaylor Simpson 
40*d2a56bd2STaylor Simpson #endif
41