summaryrefslogtreecommitdiff
path: root/src/target/arm_adi_v5.c
diff options
context:
space:
mode:
authorØyvind Harboe <oyvind.harboe@zylin.com>2010-07-19 13:56:59 +0200
committerØyvind Harboe <oyvind.harboe@zylin.com>2010-07-19 22:13:49 +0200
commita7315891eff5ed84dbd88e950321c6ff2a58e867 (patch)
tree98cc1c3304a93f270adf3a7bb37f84977a97d5dd /src/target/arm_adi_v5.c
parent7dcde11b459f60d40db9ca53f038cd200c852064 (diff)
downloadopenocd+libswd-a7315891eff5ed84dbd88e950321c6ff2a58e867.tar.gz
openocd+libswd-a7315891eff5ed84dbd88e950321c6ff2a58e867.tar.bz2
openocd+libswd-a7315891eff5ed84dbd88e950321c6ff2a58e867.tar.xz
openocd+libswd-a7315891eff5ed84dbd88e950321c6ff2a58e867.zip
arm_adi_v5: error propagation of mem_ap_read_atomic_u32 failure
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Diffstat (limited to 'src/target/arm_adi_v5.c')
-rw-r--r--src/target/arm_adi_v5.c44
1 files changed, 33 insertions, 11 deletions
diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c
index 496360f7..194865e4 100644
--- a/src/target/arm_adi_v5.c
+++ b/src/target/arm_adi_v5.c
@@ -1124,7 +1124,9 @@ static int dap_info_command(struct command_context *cmd_ctx,
entry_offset = 0;
do
{
- mem_ap_read_atomic_u32(dap, (dbgbase&0xFFFFF000) | entry_offset, &romentry);
+ retval = mem_ap_read_atomic_u32(dap, (dbgbase&0xFFFFF000) | entry_offset, &romentry);
+ if (retval != ERROR_OK)
+ return retval;
command_print(cmd_ctx, "\tROMTABLE[0x%x] = 0x%" PRIx32 "",entry_offset,romentry);
if (romentry&0x01)
{
@@ -1140,33 +1142,51 @@ static int dap_info_command(struct command_context *cmd_ctx,
/* IDs are in last 4K section */
- mem_ap_read_atomic_u32(dap,
+ retval = mem_ap_read_atomic_u32(dap,
component_base + 0xFE0, &c_pid0);
+ if (retval != ERROR_OK)
+ return retval;
c_pid0 &= 0xff;
- mem_ap_read_atomic_u32(dap,
+ retval = mem_ap_read_atomic_u32(dap,
component_base + 0xFE4, &c_pid1);
+ if (retval != ERROR_OK)
+ return retval;
c_pid1 &= 0xff;
- mem_ap_read_atomic_u32(dap,
+ retval = mem_ap_read_atomic_u32(dap,
component_base + 0xFE8, &c_pid2);
+ if (retval != ERROR_OK)
+ return retval;
c_pid2 &= 0xff;
- mem_ap_read_atomic_u32(dap,
+ retval = mem_ap_read_atomic_u32(dap,
component_base + 0xFEC, &c_pid3);
+ if (retval != ERROR_OK)
+ return retval;
c_pid3 &= 0xff;
- mem_ap_read_atomic_u32(dap,
+ retval = mem_ap_read_atomic_u32(dap,
component_base + 0xFD0, &c_pid4);
+ if (retval != ERROR_OK)
+ return retval;
c_pid4 &= 0xff;
- mem_ap_read_atomic_u32(dap,
+ retval = mem_ap_read_atomic_u32(dap,
component_base + 0xFF0, &c_cid0);
+ if (retval != ERROR_OK)
+ return retval;
c_cid0 &= 0xff;
- mem_ap_read_atomic_u32(dap,
+ retval = mem_ap_read_atomic_u32(dap,
component_base + 0xFF4, &c_cid1);
+ if (retval != ERROR_OK)
+ return retval;
c_cid1 &= 0xff;
- mem_ap_read_atomic_u32(dap,
+ retval = mem_ap_read_atomic_u32(dap,
component_base + 0xFF8, &c_cid2);
+ if (retval != ERROR_OK)
+ return retval;
c_cid2 &= 0xff;
- mem_ap_read_atomic_u32(dap,
+ retval = mem_ap_read_atomic_u32(dap,
component_base + 0xFFC, &c_cid3);
+ if (retval != ERROR_OK)
+ return retval;
c_cid3 &= 0xff;
@@ -1187,9 +1207,11 @@ static int dap_info_command(struct command_context *cmd_ctx,
unsigned minor;
char *major = "Reserved", *subtype = "Reserved";
- mem_ap_read_atomic_u32(dap,
+ retval = mem_ap_read_atomic_u32(dap,
(component_base & 0xfffff000) | 0xfcc,
&devtype);
+ if (retval != ERROR_OK)
+ return retval;
minor = (devtype >> 4) & 0x0f;
switch (devtype & 0x0f) {
case 0: