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., *
|
|
|
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
|
|
|
***************************************************************************/
|
|
|
|
#ifndef CORTEX_A8_H
|
|
|
|
#define CORTEX_A8_H
|
|
|
|
|
|
|
|
#include "register.h"
|
|
|
|
#include "target.h"
|
2009-08-25 01:58:34 -05:00
|
|
|
#include "armv7a.h"
|
|
|
|
#include "arm7_9_common.h"
|
2009-05-04 13:44:12 -05:00
|
|
|
|
|
|
|
extern char* cortex_a8_state_strings[];
|
|
|
|
|
|
|
|
#define CORTEX_A8_COMMON_MAGIC 0x411fc082
|
|
|
|
|
|
|
|
#define CPUID 0x54011D00
|
|
|
|
/* Debug Control Block */
|
2009-08-25 01:58:34 -05:00
|
|
|
#define CPUDBG_DIDR 0x000
|
|
|
|
#define CPUDBG_WFAR 0x018
|
2009-08-26 14:22:28 -05:00
|
|
|
#define CPUDBG_VCR 0x01C
|
2009-08-25 01:58:34 -05:00
|
|
|
#define CPUDBG_DSCCR 0x028
|
|
|
|
#define CPUDBG_DTRRX 0x080
|
|
|
|
#define CPUDBG_ITR 0x084
|
|
|
|
#define CPUDBG_DSCR 0x088
|
|
|
|
#define CPUDBG_DTRTX 0x08c
|
|
|
|
#define CPUDBG_DRCR 0x090
|
|
|
|
#define CPUDBG_BVR_BASE 0x100
|
|
|
|
#define CPUDBG_BCR_BASE 0x140
|
|
|
|
#define CPUDBG_WVR_BASE 0x180
|
2009-05-04 13:44:12 -05:00
|
|
|
|
2009-08-26 14:22:28 -05:00
|
|
|
#define CPUDBG_OSLAR 0x300
|
|
|
|
#define CPUDBG_OSLSR 0x304
|
|
|
|
#define CPUDBG_OSSRR 0x308
|
|
|
|
|
|
|
|
#define CPUDBG_PRCR 0x310
|
|
|
|
#define CPUDBG_PRSR 0x314
|
|
|
|
|
2009-08-25 01:58:34 -05:00
|
|
|
#define CPUDBG_CPUID 0xD00
|
|
|
|
#define CPUDBG_CTYPR 0xD04
|
|
|
|
#define CPUDBG_TTYPR 0xD0C
|
|
|
|
|
|
|
|
#define BRP_NORMAL 0
|
|
|
|
#define BRP_CONTEXT 1
|
|
|
|
|
|
|
|
typedef struct cortex_a8_brp_s
|
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;
|
|
|
|
uint8_t BRPn;
|
|
|
|
} cortex_a8_brp_t;
|
2009-05-04 13:44:12 -05:00
|
|
|
|
2009-08-25 01:58:34 -05:00
|
|
|
typedef struct cortex_a8_wrp_s
|
2009-05-04 13:44:12 -05:00
|
|
|
{
|
|
|
|
int used;
|
2009-08-25 01:58:34 -05:00
|
|
|
int type;
|
|
|
|
uint32_t value;
|
|
|
|
uint32_t control;
|
|
|
|
uint8_t WRPn;
|
|
|
|
} cortex_a8_wrp_t;
|
2009-05-04 13:44:12 -05:00
|
|
|
|
|
|
|
typedef struct cortex_a8_common_s
|
|
|
|
{
|
|
|
|
int common_magic;
|
|
|
|
arm_jtag_t jtag_info;
|
|
|
|
|
2009-08-25 01:58:34 -05:00
|
|
|
/* Core Debug Unit */
|
|
|
|
uint32_t debug_base;
|
|
|
|
uint8_t debug_ap;
|
|
|
|
uint8_t memory_ap;
|
|
|
|
|
2009-05-04 13:44:12 -05:00
|
|
|
/* Context information */
|
2009-08-25 01:58:34 -05:00
|
|
|
uint32_t cpudbg_dscr;
|
2009-06-18 02:09:35 -05:00
|
|
|
uint32_t nvic_dfsr; /* Debug Fault Status Register - shows reason for debug halt */
|
|
|
|
uint32_t nvic_icsr; /* Interrupt Control State Register - shows active and pending IRQ */
|
2009-05-04 13:44:12 -05:00
|
|
|
|
2009-08-25 01:58:34 -05:00
|
|
|
/* Saved cp15 registers */
|
|
|
|
uint32_t cp15_control_reg;
|
|
|
|
uint32_t cp15_aux_control_reg;
|
|
|
|
|
|
|
|
/* Breakpoint register pairs */
|
|
|
|
int brp_num_context;
|
|
|
|
int brp_num;
|
|
|
|
int brp_num_available;
|
|
|
|
// int brp_enabled;
|
|
|
|
cortex_a8_brp_t *brp_list;
|
2009-05-04 13:44:12 -05:00
|
|
|
|
2009-08-25 01:58:34 -05:00
|
|
|
/* Watchpoint register pairs */
|
|
|
|
int wrp_num;
|
|
|
|
int wrp_num_available;
|
|
|
|
cortex_a8_wrp_t *wrp_list;
|
2009-05-04 13:44:12 -05:00
|
|
|
|
|
|
|
/* Interrupts */
|
|
|
|
int intlinesnum;
|
2009-06-18 02:09:35 -05:00
|
|
|
uint32_t *intsetenable;
|
2009-05-04 13:44:12 -05:00
|
|
|
|
2009-08-25 01:58:34 -05:00
|
|
|
/* Use cortex_a8_read_regs_through_mem for fast register reads */
|
|
|
|
int fast_reg_read;
|
|
|
|
|
|
|
|
armv7a_common_t armv7a_common;
|
2009-05-04 13:44:12 -05:00
|
|
|
void *arch_info;
|
|
|
|
} cortex_a8_common_t;
|
|
|
|
|
|
|
|
extern int cortex_a8_init_arch_info(target_t *target, cortex_a8_common_t *cortex_a8, jtag_tap_t *tap);
|
2009-06-18 02:09:35 -05:00
|
|
|
int cortex_a8_read_memory(struct target_s *target, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer);
|
|
|
|
int cortex_a8_write_memory(struct target_s *target, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer);
|
2009-05-04 13:44:12 -05:00
|
|
|
|
|
|
|
#endif /* CORTEX_A8_H */
|