target/hla_target: try to re-examine under reset in hl_assert_reset()
[openocd.git] / src / target / nds32_aice.c
blob8dc4d7795e96a42a75339f6f9cdf54255cd1c3a7
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 /***************************************************************************
4 * Copyright (C) 2013 Andes technology. *
5 * Hsiangkai Wang <hkwang@andestech.com> *
6 ***************************************************************************/
7 #ifdef HAVE_CONFIG_H
8 #include "config.h"
9 #endif
11 #include <helper/log.h>
12 #include "nds32_aice.h"
14 int aice_read_reg_64(struct aice_port_s *aice, uint32_t num, uint64_t *val)
16 if (!aice->port->api->read_reg_64) {
17 LOG_WARNING("Not implemented: %s", __func__);
18 return ERROR_FAIL;
21 return aice->port->api->read_reg_64(aice->coreid, num, val);
24 int aice_write_reg_64(struct aice_port_s *aice, uint32_t num, uint64_t val)
26 if (!aice->port->api->write_reg_64) {
27 LOG_WARNING("Not implemented: %s", __func__);
28 return ERROR_FAIL;
31 return aice->port->api->write_reg_64(aice->coreid, num, val);
34 int aice_read_tlb(struct aice_port_s *aice, target_addr_t virtual_address,
35 target_addr_t *physical_address)
37 if (!aice->port->api->read_tlb) {
38 LOG_WARNING("Not implemented: %s", __func__);
39 return ERROR_FAIL;
42 return aice->port->api->read_tlb(aice->coreid, virtual_address, physical_address);
45 int aice_cache_ctl(struct aice_port_s *aice, uint32_t subtype, uint32_t address)
47 if (!aice->port->api->cache_ctl) {
48 LOG_WARNING("Not implemented: %s", __func__);
49 return ERROR_FAIL;
52 return aice->port->api->cache_ctl(aice->coreid, subtype, address);
55 int aice_set_retry_times(struct aice_port_s *aice, uint32_t a_retry_times)
57 if (!aice->port->api->set_retry_times) {
58 LOG_WARNING("Not implemented: %s", __func__);
59 return ERROR_FAIL;
62 return aice->port->api->set_retry_times(a_retry_times);
65 int aice_program_edm(struct aice_port_s *aice, char *command_sequence)
67 if (!aice->port->api->program_edm) {
68 LOG_WARNING("Not implemented: %s", __func__);
69 return ERROR_FAIL;
72 return aice->port->api->program_edm(aice->coreid, command_sequence);
75 int aice_set_command_mode(struct aice_port_s *aice,
76 enum aice_command_mode command_mode)
78 if (!aice->port->api->set_command_mode) {
79 LOG_WARNING("Not implemented: %s", __func__);
80 return ERROR_FAIL;
83 return aice->port->api->set_command_mode(command_mode);
86 int aice_execute(struct aice_port_s *aice, uint32_t *instructions,
87 uint32_t instruction_num)
89 if (!aice->port->api->execute) {
90 LOG_WARNING("Not implemented: %s", __func__);
91 return ERROR_FAIL;
94 return aice->port->api->execute(aice->coreid, instructions, instruction_num);
97 int aice_set_custom_srst_script(struct aice_port_s *aice, const char *script)
99 if (!aice->port->api->set_custom_srst_script) {
100 LOG_WARNING("Not implemented: %s", __func__);
101 return ERROR_FAIL;
104 return aice->port->api->set_custom_srst_script(script);
107 int aice_set_custom_trst_script(struct aice_port_s *aice, const char *script)
109 if (!aice->port->api->set_custom_trst_script) {
110 LOG_WARNING("Not implemented: %s", __func__);
111 return ERROR_FAIL;
114 return aice->port->api->set_custom_trst_script(script);
117 int aice_set_custom_restart_script(struct aice_port_s *aice, const char *script)
119 if (!aice->port->api->set_custom_restart_script) {
120 LOG_WARNING("Not implemented: %s", __func__);
121 return ERROR_FAIL;
124 return aice->port->api->set_custom_restart_script(script);
127 int aice_set_count_to_check_dbger(struct aice_port_s *aice, uint32_t count_to_check)
129 if (!aice->port->api->set_count_to_check_dbger) {
130 LOG_WARNING("Not implemented: %s", __func__);
131 return ERROR_FAIL;
134 return aice->port->api->set_count_to_check_dbger(count_to_check);
137 int aice_profiling(struct aice_port_s *aice, uint32_t interval, uint32_t iteration,
138 uint32_t reg_no, uint32_t *samples, uint32_t *num_samples)
140 if (!aice->port->api->profiling) {
141 LOG_WARNING("Not implemented: %s", __func__);
142 return ERROR_FAIL;
145 return aice->port->api->profiling(aice->coreid, interval, iteration,
146 reg_no, samples, num_samples);