From c3d509e6c0ec25c9e1cc766970e446cc9bba2f9b Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Sat, 18 Apr 2020 17:38:17 +0200 Subject: [PATCH] Clean up PLATFORM_HAS_DEBUG Use only for firmware platforms. --- src/platforms/libftdi/platform.h | 2 -- src/platforms/pc-hosted/platform.h | 1 - src/platforms/pc-stlinkv2/platform.h | 2 -- src/target/adiv5.c | 10 +++++----- src/target/efm32.c | 2 +- 5 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/platforms/libftdi/platform.h b/src/platforms/libftdi/platform.h index d174aaf..d4368ba 100644 --- a/src/platforms/libftdi/platform.h +++ b/src/platforms/libftdi/platform.h @@ -36,8 +36,6 @@ #define FT2232_VID 0x0403 #define FT2232_PID 0x6010 -#define PLATFORM_HAS_DEBUG - #define PLATFORM_IDENT() "FTDI/MPSSE" #define SET_RUN_STATE(state) #define SET_IDLE_STATE(state) diff --git a/src/platforms/pc-hosted/platform.h b/src/platforms/pc-hosted/platform.h index 535e9ea..696639b 100644 --- a/src/platforms/pc-hosted/platform.h +++ b/src/platforms/pc-hosted/platform.h @@ -32,7 +32,6 @@ # endif #endif -#define PLATFORM_HAS_DEBUG #define PLATFORM_HAS_POWER_SWITCH #define PLATFORM_MAX_MSG_SIZE (256) #define PLATFORM_IDENT() "PC-HOSTED" diff --git a/src/platforms/pc-stlinkv2/platform.h b/src/platforms/pc-stlinkv2/platform.h index 4535c74..b63b0e1 100644 --- a/src/platforms/pc-stlinkv2/platform.h +++ b/src/platforms/pc-stlinkv2/platform.h @@ -33,8 +33,6 @@ # endif #endif -#define PLATFORM_HAS_DEBUG - #define PLATFORM_IDENT() "StlinkV2/3" #define SET_RUN_STATE(state) void stlink_check_detach(int state); diff --git a/src/target/adiv5.c b/src/target/adiv5.c index edac3c7..973870e 100644 --- a/src/target/adiv5.c +++ b/src/target/adiv5.c @@ -74,7 +74,7 @@ enum cid_class { cidc_unknown = 0x10 }; -#ifdef PLATFORM_HAS_DEBUG +#ifdef ENABLE_DEBUG /* The reserved ones only have an R in them, to save a bit of space. */ static const char * const cidc_debug_strings[] = { @@ -111,7 +111,7 @@ enum arm_arch { aa_end }; -#ifdef PLATFORM_HAS_DEBUG +#ifdef ENABLE_DEBUG #define PIDR_PN_BIT_STRINGS(...) __VA_ARGS__ #else #define PIDR_PN_BIT_STRINGS(...) @@ -155,7 +155,7 @@ static const struct { uint16_t part_number; enum arm_arch arch; enum cid_class cidc; -#ifdef PLATFORM_HAS_DEBUG +#ifdef ENABLE_DEBUG const char *type; const char *full; #endif @@ -277,7 +277,7 @@ static bool adiv5_component_probe(ADIv5_AP_t *ap, uint32_t addr, int recursion, uint64_t pidr = adiv5_ap_read_pidr(ap, addr); uint32_t cidr = adiv5_ap_read_id(ap, addr + CIDR0_OFFSET); bool res = false; -#if defined(ENABLE_DEBUG) && defined(PLATFORM_HAS_DEBUG) +#if defined(ENABLE_DEBUG) char indent[recursion + 1]; for(int i = 0; i < recursion; i++) indent[i] = ' '; @@ -303,7 +303,7 @@ static bool adiv5_component_probe(ADIv5_AP_t *ap, uint32_t addr, int recursion, /* ROM table */ if (cid_class == cidc_romtab) { /* Check SYSMEM bit */ -#if defined(ENABLE_DEBUG) && defined(PLATFORM_HAS_DEBUG) +#if defined(ENABLE_DEBUG) uint32_t memtype = adiv5_mem_read32(ap, addr | ADIV5_ROM_MEMTYPE) & ADIV5_ROM_MEMTYPE_SYSMEM; diff --git a/src/target/efm32.c b/src/target/efm32.c index ba40b43..82125e3 100644 --- a/src/target/efm32.c +++ b/src/target/efm32.c @@ -720,7 +720,7 @@ static int efm32_flash_write(struct target_flash *f, int ret = cortexm_run_stub(t, SRAM_BASE, dest, STUB_BUFFER_BASE, len, device->msc_addr); -#ifdef PLATFORM_HAS_DEBUG +#ifdef ENABLE_DEBUG /* Check the MSC_IF */ uint32_t msc = device->msc_addr; uint32_t msc_if = target_mem_read32(t, EFM32_MSC_IF(msc));