Merge commit 'dd3cb193f3a83e99b5a915e9942c295b9d9715d7' into sam-update
This commit is contained in:
commit
4a2a121e89
@ -243,7 +243,8 @@ bool cmd_swdp_scan(void)
|
|||||||
static void display_target(int i, target *t, void *context)
|
static void display_target(int i, target *t, void *context)
|
||||||
{
|
{
|
||||||
(void)context;
|
(void)context;
|
||||||
gdb_outf("%2d %c %s\n", i, target_attached(t)?'*':' ', target_driver_name(t));
|
gdb_outf("%2d %c %s %s\n", i, target_attached(t)?'*':' ',
|
||||||
|
target_driver_name(t), target_core_name(t));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmd_targets(void)
|
bool cmd_targets(void)
|
||||||
|
@ -46,6 +46,7 @@ target *target_attach_n(int n, struct target_controller *);
|
|||||||
void target_detach(target *t);
|
void target_detach(target *t);
|
||||||
bool target_attached(target *t);
|
bool target_attached(target *t);
|
||||||
const char *target_driver_name(target *t);
|
const char *target_driver_name(target *t);
|
||||||
|
const char *target_core_name(target *t);
|
||||||
|
|
||||||
/* Memory access functions */
|
/* Memory access functions */
|
||||||
bool target_mem_map(target *t, char *buf, size_t len);
|
bool target_mem_map(target *t, char *buf, size_t len);
|
||||||
|
@ -5,7 +5,8 @@
|
|||||||
* Written by Gareth McMullin <gareth@blacksphere.co.nz>
|
* Written by Gareth McMullin <gareth@blacksphere.co.nz>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under tSchreibe Objekte: 100% (21/21), 3.20 KiB | 3.20 MiB/s, Fertig.
|
||||||
|
he terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* (at your option) any later version.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
@ -269,6 +270,7 @@ bool cortexm_probe(ADIv5_AP_t *ap, bool forced)
|
|||||||
}
|
}
|
||||||
|
|
||||||
adiv5_ap_ref(ap);
|
adiv5_ap_ref(ap);
|
||||||
|
uint32_t identity = ap->idr & 0xff;
|
||||||
struct cortexm_priv *priv = calloc(1, sizeof(*priv));
|
struct cortexm_priv *priv = calloc(1, sizeof(*priv));
|
||||||
if (!priv) { /* calloc failed: heap exhaustion */
|
if (!priv) { /* calloc failed: heap exhaustion */
|
||||||
DEBUG("calloc: failed in %s\n", __func__);
|
DEBUG("calloc: failed in %s\n", __func__);
|
||||||
@ -284,6 +286,20 @@ bool cortexm_probe(ADIv5_AP_t *ap, bool forced)
|
|||||||
t->mem_write = cortexm_mem_write;
|
t->mem_write = cortexm_mem_write;
|
||||||
|
|
||||||
t->driver = cortexm_driver_str;
|
t->driver = cortexm_driver_str;
|
||||||
|
switch (identity) {
|
||||||
|
case 0x11: /* M3/M4 */
|
||||||
|
t->core = "M3/M4";
|
||||||
|
break;
|
||||||
|
case 0x21: /* M0 */
|
||||||
|
t->core = "M0";
|
||||||
|
break;
|
||||||
|
case 0x31: /* M0+ */
|
||||||
|
t->core = "M0+";
|
||||||
|
break;
|
||||||
|
case 0x01: /* M7 */
|
||||||
|
t->core = "M7";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
t->attach = cortexm_attach;
|
t->attach = cortexm_attach;
|
||||||
t->detach = cortexm_detach;
|
t->detach = cortexm_detach;
|
||||||
|
@ -425,6 +425,11 @@ const char *target_driver_name(target *t)
|
|||||||
return t->driver;
|
return t->driver;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *target_core_name(target *t)
|
||||||
|
{
|
||||||
|
return t->core;
|
||||||
|
}
|
||||||
|
|
||||||
uint32_t target_mem_read32(target *t, uint32_t addr)
|
uint32_t target_mem_read32(target *t, uint32_t addr)
|
||||||
{
|
{
|
||||||
uint32_t ret;
|
uint32_t ret;
|
||||||
|
@ -115,6 +115,7 @@ struct target_s {
|
|||||||
|
|
||||||
/* Other stuff */
|
/* Other stuff */
|
||||||
const char *driver;
|
const char *driver;
|
||||||
|
const char *core;
|
||||||
struct target_command_s *commands;
|
struct target_command_s *commands;
|
||||||
|
|
||||||
struct target_s *next;
|
struct target_s *next;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user