Ensure Cortex-M reset wakes device from sleep (wfi/wfe)
[fw/openocd] / src / target / arm946e.h
1 /***************************************************************************
2  *   Copyright (C) 2005 by Dominic Rath                                    *
3  *   Dominic.Rath@gmx.de                                                   *
4  *                                                                         *
5  *   Copyright (C) 2008 by Spencer Oliver                                  *
6  *   spen@spen-soft.co.uk                                                  *
7  *                                                                         *
8  *   Copyright (C) 2010 by Drasko DRASKOVIC                                *
9  *   drasko.draskovic@gmail.com                                            *
10  *                                                                         *
11  *   This program is free software; you can redistribute it and/or modify  *
12  *   it under the terms of the GNU General Public License as published by  *
13  *   the Free Software Foundation; either version 2 of the License, or     *
14  *   (at your option) any later version.                                   *
15  *                                                                         *
16  *   This program is distributed in the hope that it will be useful,       *
17  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
18  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
19  *   GNU General Public License for more details.                          *
20  *                                                                         *
21  *   You should have received a copy of the GNU General Public License     *
22  *   along with this program; if not, write to the                         *
23  *   Free Software Foundation, Inc.,                                       *
24  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
25  ***************************************************************************/
26
27 #ifndef ARM946E_H
28 #define ARM946E_H
29
30 #include "arm9tdmi.h"
31
32 #define ARM946E_COMMON_MAGIC 0x20f920f9
33
34 struct arm946e_common {
35         struct arm7_9_common arm7_9_common;
36         int common_magic;
37         uint32_t cp15_control_reg;
38         uint32_t cp15_cache_info;
39 };
40
41 static inline struct arm946e_common *target_to_arm946(struct target *target)
42 {
43         return container_of(target->arch_info, struct arm946e_common,
44                         arm7_9_common.arm);
45 }
46
47 int arm946e_init_arch_info(struct target *target,
48                            struct arm946e_common *arm946e, struct jtag_tap *tap);
49 int arm946e_write_cp15(struct target *target, int reg_addr, uint32_t value);
50
51 extern const struct command_registration arm946e_command_handlers[];
52
53 #endif  /* ARM946E_H */