Skip to content

Commit

Permalink
mspm0: Initial support
Browse files Browse the repository at this point in the history
  • Loading branch information
hardesk committed Oct 21, 2024
1 parent f39794b commit b3a943b
Show file tree
Hide file tree
Showing 6 changed files with 399 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/target/adi.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,6 @@ bool adi_configure_ap(adiv5_access_port_s *const ap)
/* This reads the lower half of BASE */
ap->base = adiv5_ap_read(ap, ADIV5_AP_BASE_LOW);
const uint8_t base_flags = (uint8_t)ap->base & (ADIV5_AP_BASE_FORMAT | ADIV5_AP_BASE_PRESENT);
/* Make sure we only pay attention to the base address, not the presence and format bits */
ap->base &= ADIV5_AP_BASE_BASEADDR;
/* Check if this is a 64-bit AP */
if (cfg & ADIV5_AP_CFG_LARGE_ADDRESS) {
/* If this base value is invalid for a LPAE MEM-AP, bomb out here */
Expand All @@ -371,10 +369,18 @@ bool adi_configure_ap(adiv5_access_port_s *const ap)
* Debug Base Address not present in this MEM-AP
* No debug entries... useless AP
* AP0 on STM32MP157C reads 0x00000002
*
* NB: MSPM0 parts erroneously set BASE.P = 0 despite there being
* valid debug components on AP0, so we have to have an exception
* for this part family.
*/
DEBUG_INFO(" -> Not Present\n");
return false;
if (ap->dp->target_designer_code != JEP106_MANUFACTURER_TEXAS || ap->base != 0xf0000002U) {
DEBUG_INFO(" -> Not Present\n");
return false;
}
}
/* Make sure we only pay attention to the base address, not the presence and format bits */
ap->base &= ADIV5_AP_BASE_BASEADDR;
/* Check if the AP is disabled, skipping it if that is the case */
if ((ap->csw & ADIV5_AP_CSW_AP_ENABLED) == 0U) {
DEBUG_INFO(" -> Disabled\n");
Expand Down
1 change: 1 addition & 0 deletions src/target/cortexm.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ bool cortexm_probe(adiv5_access_port_s *ap)
break;
case JEP106_MANUFACTURER_TEXAS:
PROBE(msp432p4_probe);
PROBE(mspm0_probe);
break;
case JEP106_MANUFACTURER_SPECULAR:
PROBE(lpc11xx_probe); /* LPC845 */
Expand Down
1 change: 1 addition & 0 deletions src/target/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ target_ti = declare_dependency(
'lmi.c',
'msp432e4.c',
'msp432p4.c',
'mspm0.c'
),
dependencies: target_cortexm,
)
Expand Down
Loading

0 comments on commit b3a943b

Please sign in to comment.