2012-02-05 06:03:04 -06:00
|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2008 digenius technology GmbH. *
|
|
|
|
* Michael Bruck *
|
|
|
|
* *
|
|
|
|
* Copyright (C) 2008,2009 Oyvind Harboe oyvind.harboe@zylin.com *
|
|
|
|
* *
|
|
|
|
* 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 *
|
2016-05-16 15:41:00 -05:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
2012-02-05 06:03:04 -06:00
|
|
|
***************************************************************************/
|
|
|
|
|
2015-09-21 14:07:46 -05:00
|
|
|
#ifndef OPENOCD_TARGET_ARM11_DBGTAP_H
|
|
|
|
#define OPENOCD_TARGET_ARM11_DBGTAP_H
|
2009-11-06 05:50:26 -06:00
|
|
|
|
2009-12-13 14:52:23 -06:00
|
|
|
#include "arm11.h"
|
2009-11-06 05:50:26 -06:00
|
|
|
|
|
|
|
/* ARM11 internals */
|
|
|
|
|
2009-11-13 10:39:48 -06:00
|
|
|
void arm11_setup_field(struct arm11_common *arm11, int num_bits,
|
2009-11-13 05:28:03 -06:00
|
|
|
void *in_data, void *out_data, struct scan_field *field);
|
2009-11-13 10:39:48 -06:00
|
|
|
void arm11_add_IR(struct arm11_common *arm11,
|
2009-11-06 05:50:26 -06:00
|
|
|
uint8_t instr, tap_state_t state);
|
2009-11-13 10:39:48 -06:00
|
|
|
int arm11_add_debug_SCAN_N(struct arm11_common *arm11,
|
2009-11-06 05:50:26 -06:00
|
|
|
uint8_t chain, tap_state_t state);
|
2009-12-03 00:57:08 -06:00
|
|
|
int arm11_read_DSCR(struct arm11_common *arm11);
|
2009-11-13 10:39:48 -06:00
|
|
|
int arm11_write_DSCR(struct arm11_common *arm11, uint32_t dscr);
|
2009-11-06 05:50:26 -06:00
|
|
|
|
2009-11-13 10:39:48 -06:00
|
|
|
int arm11_run_instr_data_prepare(struct arm11_common *arm11);
|
|
|
|
int arm11_run_instr_data_finish(struct arm11_common *arm11);
|
|
|
|
int arm11_run_instr_no_data1(struct arm11_common *arm11, uint32_t opcode);
|
|
|
|
int arm11_run_instr_data_to_core(struct arm11_common *arm11,
|
2009-11-06 05:50:26 -06:00
|
|
|
uint32_t opcode, uint32_t *data, size_t count);
|
2009-11-13 10:39:48 -06:00
|
|
|
int arm11_run_instr_data_to_core_noack(struct arm11_common *arm11,
|
2009-11-06 05:50:26 -06:00
|
|
|
uint32_t opcode, uint32_t *data, size_t count);
|
2009-11-13 10:39:48 -06:00
|
|
|
int arm11_run_instr_data_to_core1(struct arm11_common *arm11,
|
2009-11-06 05:50:26 -06:00
|
|
|
uint32_t opcode, uint32_t data);
|
2009-11-13 10:39:48 -06:00
|
|
|
int arm11_run_instr_data_from_core(struct arm11_common *arm11,
|
2009-11-06 05:50:26 -06:00
|
|
|
uint32_t opcode, uint32_t *data, size_t count);
|
2009-11-13 10:39:48 -06:00
|
|
|
int arm11_run_instr_data_from_core_via_r0(struct arm11_common *arm11,
|
2009-11-06 05:50:26 -06:00
|
|
|
uint32_t opcode, uint32_t *data);
|
2009-11-13 10:39:48 -06:00
|
|
|
int arm11_run_instr_data_to_core_via_r0(struct arm11_common *arm11,
|
2009-11-06 05:50:26 -06:00
|
|
|
uint32_t opcode, uint32_t data);
|
|
|
|
|
2010-03-01 13:00:59 -06:00
|
|
|
void arm11_add_dr_scan_vc(struct jtag_tap *tap, int num_fields, struct scan_field *fields,
|
2009-11-06 05:50:26 -06:00
|
|
|
tap_state_t state);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Used with arm11_sc7_run to make a list of read/write commands for
|
|
|
|
* scan chain 7
|
|
|
|
*/
|
2012-02-05 06:03:04 -06:00
|
|
|
struct arm11_sc7_action {
|
|
|
|
bool write; /**< Access mode: true for write, false for read. */
|
|
|
|
uint8_t address;/**< Register address mode. Use enum #arm11_sc7 */
|
2009-11-06 05:50:26 -06:00
|
|
|
/**
|
|
|
|
* If write then set this to value to be written. In read mode
|
|
|
|
* this receives the read value when the function returns.
|
|
|
|
*/
|
|
|
|
uint32_t value;
|
2009-11-13 10:39:54 -06:00
|
|
|
};
|
2009-11-06 05:50:26 -06:00
|
|
|
|
2009-11-13 10:39:48 -06:00
|
|
|
int arm11_sc7_run(struct arm11_common *arm11,
|
2009-11-13 10:39:54 -06:00
|
|
|
struct arm11_sc7_action *actions, size_t count);
|
2009-11-06 05:50:26 -06:00
|
|
|
|
|
|
|
/* Mid-level helper functions */
|
2010-07-20 01:42:52 -05:00
|
|
|
int arm11_sc7_clear_vbw(struct arm11_common *arm11);
|
|
|
|
int arm11_sc7_set_vcr(struct arm11_common *arm11, uint32_t value);
|
2009-11-06 05:50:26 -06:00
|
|
|
|
2009-11-13 10:39:48 -06:00
|
|
|
int arm11_read_memory_word(struct arm11_common *arm11,
|
2009-11-06 05:50:26 -06:00
|
|
|
uint32_t address, uint32_t *result);
|
|
|
|
|
2009-12-03 00:57:07 -06:00
|
|
|
int arm11_dpm_init(struct arm11_common *arm11, uint32_t didr);
|
2009-12-04 20:57:31 -06:00
|
|
|
int arm11_bpwp_flush(struct arm11_common *arm11);
|
2009-11-24 02:14:06 -06:00
|
|
|
|
2015-09-21 14:07:46 -05:00
|
|
|
#endif /* OPENOCD_TARGET_ARM11_DBGTAP_H */
|