arm_adi_v5: Clean up dap info command

Reduce use of magic numbers and add AXI type MEM-AP detection. Don't try
to call dap_rom_display on a non-existent AP.

AP identification is unique per designer, so make sure the JEDEC code
matches ARM when interpreting the AP type.

Change-Id: I8e86b7de61811382afe99bf15094ab71b43f5fdf
Signed-off-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-on: http://openocd.zylin.com/3150
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de>
This commit is contained in:
Andreas Fritiofson
2015-12-06 13:06:12 +01:00
parent 8a069b7b90
commit c6ce183055
2 changed files with 54 additions and 37 deletions

View File

@@ -122,6 +122,15 @@
#define CSW_SPROT (1UL << 30)
#define CSW_DBGSWENABLE (1UL << 31)
/* Fields of the MEM-AP's IDR register */
#define IDR_REV (0xFUL << 28)
#define IDR_JEP106 (0x7FFUL << 17)
#define IDR_CLASS (0xFUL << 13)
#define IDR_VARIANT (0xFUL << 4)
#define IDR_TYPE (0xFUL << 0)
#define IDR_JEP106_ARM 0x04760000
/**
* This represents an ARM Debug Interface (v5) Access Port (AP).
* Most common is a MEM-AP, for memory access.
@@ -275,6 +284,14 @@ struct dap_ops {
int (*run)(struct adiv5_dap *dap);
};
/*
* Access Port classes
*/
enum ap_class {
AP_CLASS_NONE = 0x00000, /* No class defined */
AP_CLASS_MEM_AP = 0x10000, /* MEM-AP */
};
/*
* Access Port types
*/