2009-05-04 13:44:12 -05:00
|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2005 by Dominic Rath *
|
|
|
|
* Dominic.Rath@gmx.de *
|
|
|
|
* *
|
|
|
|
* Copyright (C) 2006 by Magnus Lundin *
|
|
|
|
* lundin@mlu.mine.nu *
|
|
|
|
* *
|
|
|
|
* Copyright (C) 2008 by Spencer Oliver *
|
|
|
|
* spen@spen-soft.co.uk *
|
|
|
|
* *
|
|
|
|
* Copyright (C) 2009 by Dirk Behme *
|
|
|
|
* dirk.behme@gmail.com - copy from cortex_m3 *
|
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU General Public License *
|
|
|
|
* along with this program; if not, write to the *
|
|
|
|
* Free Software Foundation, Inc., *
|
2013-06-02 14:32:36 -05:00
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
|
2009-05-04 13:44:12 -05:00
|
|
|
***************************************************************************/
|
2012-02-05 06:03:04 -06:00
|
|
|
|
2013-08-29 10:53:26 -05:00
|
|
|
#ifndef CORTEX_A_H
|
|
|
|
#define CORTEX_A_H
|
2009-05-04 13:44:12 -05:00
|
|
|
|
2009-12-13 14:52:23 -06:00
|
|
|
#include "armv7a.h"
|
2009-05-04 13:44:12 -05:00
|
|
|
|
2013-08-29 10:53:26 -05:00
|
|
|
#define CORTEX_A_COMMON_MAGIC 0x411fc082
|
2013-08-29 13:02:19 -05:00
|
|
|
#define CORTEX_A15_COMMON_MAGIC 0x413fc0f1
|
|
|
|
|
|
|
|
#define CORTEX_A8_PARTNUM 0xc08
|
|
|
|
#define CORTEX_A9_PARTNUM 0xc09
|
|
|
|
#define CORTEX_A15_PARTNUM 0xc0f
|
|
|
|
#define CORTEX_A_MIDR_PARTNUM_MASK 0x0000fff0
|
|
|
|
#define CORTEX_A_MIDR_PARTNUM_SHIFT 4
|
2009-05-04 13:44:12 -05:00
|
|
|
|
2009-08-25 01:58:34 -05:00
|
|
|
#define CPUDBG_CPUID 0xD00
|
|
|
|
#define CPUDBG_CTYPR 0xD04
|
|
|
|
#define CPUDBG_TTYPR 0xD0C
|
2009-09-13 12:26:07 -05:00
|
|
|
#define CPUDBG_LOCKACCESS 0xFB0
|
|
|
|
#define CPUDBG_LOCKSTATUS 0xFB4
|
2013-08-29 13:02:19 -05:00
|
|
|
#define CPUDBG_OSLAR_LK_MASK (1 << 1)
|
2009-08-25 01:58:34 -05:00
|
|
|
|
|
|
|
#define BRP_NORMAL 0
|
|
|
|
#define BRP_CONTEXT 1
|
|
|
|
|
2013-08-29 10:53:26 -05:00
|
|
|
#define CORTEX_A_PADDRDBG_CPU_SHIFT 13
|
2011-03-21 08:10:57 -05:00
|
|
|
|
2013-08-29 10:53:26 -05:00
|
|
|
struct cortex_a_brp {
|
2009-05-04 13:44:12 -05:00
|
|
|
int used;
|
|
|
|
int type;
|
2009-08-25 01:58:34 -05:00
|
|
|
uint32_t value;
|
|
|
|
uint32_t control;
|
2009-11-24 23:24:44 -06:00
|
|
|
uint8_t BRPn;
|
2009-11-13 11:17:08 -06:00
|
|
|
};
|
2009-05-04 13:44:12 -05:00
|
|
|
|
2013-08-29 10:53:26 -05:00
|
|
|
struct cortex_a_common {
|
2009-05-04 13:44:12 -05:00
|
|
|
int common_magic;
|
2009-11-13 10:41:00 -06:00
|
|
|
struct arm_jtag jtag_info;
|
2009-05-04 13:44:12 -05:00
|
|
|
|
|
|
|
/* Context information */
|
2009-08-25 01:58:34 -05:00
|
|
|
uint32_t cpudbg_dscr;
|
2009-05-04 13:44:12 -05:00
|
|
|
|
2009-08-25 01:58:34 -05:00
|
|
|
/* Saved cp15 registers */
|
|
|
|
uint32_t cp15_control_reg;
|
2011-09-29 10:17:27 -05:00
|
|
|
/* latest cp15 register value written and cpsr processor mode */
|
|
|
|
uint32_t cp15_control_reg_curr;
|
2012-02-05 06:03:04 -06:00
|
|
|
enum arm_mode curr_mode;
|
2011-09-29 10:17:27 -05:00
|
|
|
|
2009-08-25 01:58:34 -05:00
|
|
|
|
|
|
|
/* Breakpoint register pairs */
|
|
|
|
int brp_num_context;
|
|
|
|
int brp_num;
|
|
|
|
int brp_num_available;
|
2013-08-29 10:53:26 -05:00
|
|
|
struct cortex_a_brp *brp_list;
|
2009-05-04 13:44:12 -05:00
|
|
|
|
2013-08-29 10:53:26 -05:00
|
|
|
/* Use cortex_a_read_regs_through_mem for fast register reads */
|
2009-08-25 01:58:34 -05:00
|
|
|
int fast_reg_read;
|
|
|
|
|
2013-08-29 13:02:19 -05:00
|
|
|
uint32_t cpuid;
|
|
|
|
uint32_t ctypr;
|
|
|
|
uint32_t ttypr;
|
|
|
|
uint32_t didr;
|
|
|
|
|
2009-11-13 10:41:29 -06:00
|
|
|
struct armv7a_common armv7a_common;
|
2011-09-29 10:17:27 -05:00
|
|
|
|
2009-11-13 10:42:11 -06:00
|
|
|
};
|
2009-05-04 13:44:12 -05:00
|
|
|
|
2013-08-29 10:53:26 -05:00
|
|
|
static inline struct cortex_a_common *
|
|
|
|
target_to_cortex_a(struct target *target)
|
2009-11-05 23:59:39 -06:00
|
|
|
{
|
2013-08-29 10:53:26 -05:00
|
|
|
return container_of(target->arch_info, struct cortex_a_common, armv7a_common.arm);
|
2009-11-05 23:59:39 -06:00
|
|
|
}
|
|
|
|
|
2013-08-29 10:53:26 -05:00
|
|
|
#endif /* CORTEX_A_H */
|