4 * This file is part of BeRTOS.
6 * Bertos is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 * As a special exception, you may use this file as part of a free software
21 * library without restriction. Specifically, if other files instantiate
22 * templates or use macros or inline functions from this file, or you compile
23 * this file and link it with other files to produce an executable, this
24 * file does not by itself cause the resulting executable to be covered by
25 * the GNU General Public License. This exception does not however
26 * invalidate any other reasons why the executable file might be covered by
27 * the GNU General Public License.
29 * Copyright 2010 Develer S.r.l. (http://www.develer.com/)
33 * \brief LM3S generic hardware macros.
39 #include <cfg/compiler.h>
40 #include <cpu/types.h>
43 * Helper Macros for determining the particular hardware revision.
46 #ifndef CLASS_IS_SANDSTORM
47 #define CLASS_IS_SANDSTORM \
48 (((HWREG(SYSCTL_DID0) & SYSCTL_DID0_VER_M) == SYSCTL_DID0_VER_0) || \
49 ((HWREG(SYSCTL_DID0) & (SYSCTL_DID0_VER_M | SYSCTL_DID0_CLASS_M)) == \
50 (SYSCTL_DID0_VER_1 | SYSCTL_DID0_CLASS_SANDSTORM)))
54 #define CLASS_IS_FURY \
55 ((HWREG(SYSCTL_DID0) & (SYSCTL_DID0_VER_M | SYSCTL_DID0_CLASS_M)) == \
56 (SYSCTL_DID0_VER_1 | SYSCTL_DID0_CLASS_FURY))
59 #ifndef CLASS_IS_DUSTDEVIL
60 #define CLASS_IS_DUSTDEVIL \
61 ((HWREG(SYSCTL_DID0) & (SYSCTL_DID0_VER_M | SYSCTL_DID0_CLASS_M)) == \
62 (SYSCTL_DID0_VER_1 | SYSCTL_DID0_CLASS_DUSTDEVIL))
65 #ifndef CLASS_IS_TEMPEST
66 #define CLASS_IS_TEMPEST \
67 ((HWREG(SYSCTL_DID0) & (SYSCTL_DID0_VER_M | SYSCTL_DID0_CLASS_M)) == \
68 (SYSCTL_DID0_VER_1 | SYSCTL_DID0_CLASS_TEMPEST))
71 #ifndef REVISION_IS_A0
72 #define REVISION_IS_A0 \
73 ((HWREG(SYSCTL_DID0) & (SYSCTL_DID0_MAJ_M | SYSCTL_DID0_MIN_M)) == \
74 (SYSCTL_DID0_MAJ_REVA | SYSCTL_DID0_MIN_0))
77 #ifndef REVISION_IS_A1
78 #define REVISION_IS_A1 \
79 ((HWREG(SYSCTL_DID0) & (SYSCTL_DID0_MAJ_M | SYSCTL_DID0_MIN_M)) == \
80 (SYSCTL_DID0_MAJ_REVA | SYSCTL_DID0_MIN_0))
83 #ifndef REVISION_IS_A2
84 #define REVISION_IS_A2 \
85 ((HWREG(SYSCTL_DID0) & (SYSCTL_DID0_MAJ_M | SYSCTL_DID0_MIN_M)) == \
86 (SYSCTL_DID0_MAJ_REVA | SYSCTL_DID0_MIN_2))
89 #ifndef REVISION_IS_B0
90 #define REVISION_IS_B0 \
91 ((HWREG(SYSCTL_DID0) & (SYSCTL_DID0_MAJ_M | SYSCTL_DID0_MIN_M)) == \
92 (SYSCTL_DID0_MAJ_REVB | SYSCTL_DID0_MIN_0))
95 #ifndef REVISION_IS_B1
96 #define REVISION_IS_B1 \
97 ((HWREG(SYSCTL_DID0) & (SYSCTL_DID0_MAJ_M | SYSCTL_DID0_MIN_M)) == \
98 (SYSCTL_DID0_MAJ_REVB | SYSCTL_DID0_MIN_1))
101 #ifndef REVISION_IS_C0
102 #define REVISION_IS_C0 \
103 ((HWREG(SYSCTL_DID0) & (SYSCTL_DID0_MAJ_M | SYSCTL_DID0_MIN_M)) == \
104 (SYSCTL_DID0_MAJ_REVC | SYSCTL_DID0_MIN_0))
107 #ifndef REVISION_IS_C1
108 #define REVISION_IS_C1 \
109 ((HWREG(SYSCTL_DID0) & (SYSCTL_DID0_MAJ_M | SYSCTL_DID0_MIN_M)) == \
110 (SYSCTL_DID0_MAJ_REVC | SYSCTL_DID0_MIN_1))
113 #ifndef REVISION_IS_C2
114 #define REVISION_IS_C2 \
115 ((HWREG(SYSCTL_DID0) & (SYSCTL_DID0_MAJ_M | SYSCTL_DID0_MIN_M)) == \
116 (SYSCTL_DID0_MAJ_REVC | SYSCTL_DID0_MIN_2))
120 #endif /* LM3S_TYPES_H */