mirror of
https://github.com/blackmagic-debug/blackmagic.git
synced 2025-10-13 18:37:21 +08:00
rvswd: gate rvswd functionality behind platform define and project option
This commit is contained in:

committed by
Rafael Silva

parent
29aefd2927
commit
83dd2736dc
@@ -149,3 +149,8 @@ option(
|
||||
value: false,
|
||||
description: 'Enable firmware-side protocol acceleration of RISC-V Debug'
|
||||
)
|
||||
option(
|
||||
'rvswd_support',
|
||||
type: 'boolean',
|
||||
value: false
|
||||
)
|
||||
|
@@ -56,7 +56,9 @@ static bool cmd_help(target_s *target, int argc, const char **argv);
|
||||
|
||||
static bool cmd_jtag_scan(target_s *target, int argc, const char **argv);
|
||||
static bool cmd_swd_scan(target_s *target, int argc, const char **argv);
|
||||
#if defined(CONFIG_RVSWD) && defined(PLATFORM_HAS_RVSWD)
|
||||
static bool cmd_rvswd_scan(target_s *target, int argc, const char **argv);
|
||||
#endif
|
||||
static bool cmd_auto_scan(target_s *target, int argc, const char **argv);
|
||||
static bool cmd_frequency(target_s *target, int argc, const char **argv);
|
||||
static bool cmd_targets(target_s *target, int argc, const char **argv);
|
||||
@@ -98,7 +100,9 @@ const command_s cmd_list[] = {
|
||||
{"jtag_scan", cmd_jtag_scan, "Scan JTAG chain for devices"},
|
||||
{"swd_scan", cmd_swd_scan, "Scan SWD interface for devices: [TARGET_ID]"},
|
||||
{"swdp_scan", cmd_swd_scan, "Deprecated: use swd_scan instead"},
|
||||
#if defined(CONFIG_RVSWD) && defined(PLATFORM_HAS_RVSWD)
|
||||
{"rvswd_scan", cmd_rvswd_scan, "Scan RVSWD for devices"},
|
||||
#endif
|
||||
{"auto_scan", cmd_auto_scan, "Automatically scan all chain types for devices"},
|
||||
{"frequency", cmd_frequency, "set minimum high and low times: [FREQ]"},
|
||||
{"targets", cmd_targets, "Display list of available targets"},
|
||||
@@ -324,6 +328,7 @@ bool cmd_swd_scan(target_s *target, int argc, const char **argv)
|
||||
return true;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_RVSWD) && defined(PLATFORM_HAS_RVSWD)
|
||||
bool cmd_rvswd_scan(target_s *target, int argc, const char **argv)
|
||||
{
|
||||
(void)target;
|
||||
@@ -367,6 +372,7 @@ bool cmd_rvswd_scan(target_s *target, int argc, const char **argv)
|
||||
morse(NULL, false);
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool cmd_auto_scan(target_s *target, int argc, const char **argv)
|
||||
{
|
||||
@@ -396,7 +402,7 @@ bool cmd_auto_scan(target_s *target, int argc, const char **argv)
|
||||
#endif
|
||||
if (!scan_result) {
|
||||
gdb_out("SWD scan found no devices.\n");
|
||||
|
||||
#if defined(CONFIG_RVSWD) && defined(PLATFORM_HAS_RVSWD)
|
||||
#if CONFIG_BMDA == 1
|
||||
scan_result = bmda_rvswd_scan();
|
||||
#else
|
||||
@@ -404,6 +410,7 @@ bool cmd_auto_scan(target_s *target, int argc, const char **argv)
|
||||
#endif
|
||||
if (!scan_result)
|
||||
gdb_out("RVSWD scan found no devices.\n");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -30,6 +30,8 @@
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "platform.h"
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#include <basetsd.h>
|
||||
typedef SSIZE_T ssize_t;
|
||||
@@ -45,8 +47,10 @@ typedef struct target_controller target_controller_s;
|
||||
#if CONFIG_BMDA == 1
|
||||
bool bmda_swd_scan(uint32_t targetid);
|
||||
bool bmda_jtag_scan(void);
|
||||
#if defined(CONFIG_RVSWD) && defined(PLATFORM_HAS_RVSWD)
|
||||
bool bmda_rvswd_scan(void);
|
||||
#endif
|
||||
#endif
|
||||
bool adiv5_swd_scan(uint32_t targetid);
|
||||
bool jtag_scan(void);
|
||||
|
||||
|
@@ -79,6 +79,13 @@ if rtt_support
|
||||
endif
|
||||
endif
|
||||
|
||||
# RVSWD support handling
|
||||
rvswd_support = get_option('rvswd_support')
|
||||
if rvswd_support
|
||||
libbmd_core_args += ['-DCONFIG_RVSWD=1']
|
||||
bmd_core_args += ['-DCONFIG_RVSWD=1']
|
||||
endif
|
||||
|
||||
# Advertise QStartNoAckMode
|
||||
advertise_noackmode = get_option('advertise_noackmode')
|
||||
if advertise_noackmode
|
||||
@@ -117,6 +124,7 @@ summary(
|
||||
{
|
||||
'Debug output': debug_output,
|
||||
'RTT support': rtt_support,
|
||||
'RVSWD support': rvswd_support,
|
||||
'Advertise QStartNoAckMode': advertise_noackmode,
|
||||
},
|
||||
bool_yn: true,
|
||||
|
@@ -48,6 +48,7 @@ void platform_buffer_flush(void);
|
||||
do { \
|
||||
} while (0)
|
||||
#define PLATFORM_HAS_POWER_SWITCH
|
||||
#define PLATFORM_HAS_RVSWD
|
||||
|
||||
#define PRODUCT_ID_ANY 0xffffU
|
||||
|
||||
|
Reference in New Issue
Block a user