Skip to content

Commit

Permalink
riscv32: Implemented probing for the GD32VF1
Browse files Browse the repository at this point in the history
  • Loading branch information
dragonmux authored and esden committed Oct 31, 2023
1 parent 770f0a6 commit 8fd736a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/target/jep106.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@
#define JEP106_MANUFACTURER_RASPBERRY 0x913U /* Raspberry Pi */
#define JEP106_MANUFACTURER_RENESAS 0x423U /* Renesas */
#define JEP106_MANUFACTURER_XILINX 0x309U /* Xilinx */
/*
* This JEP code should belong to "Andes Technology Corporation", but is used on RISC-V by GigaDevice,
* so in the unlikely event we need to support chips by them, here be dragons.
*/
#define JEP106_MANUFACTURER_RV_GIGADEVICE 0x61eU

/*
* This code is not listed in the JEP106 standard, but is used by some stm32f1 clones
Expand Down
13 changes: 13 additions & 0 deletions src/target/riscv32.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
#include "target.h"
#include "target_internal.h"
#include "target_probe.h"
#include "jep106.h"
#include "riscv_debug.h"
#include "gdb_packet.h"

typedef struct riscv32_regs {
uint32_t gprs[32];
Expand Down Expand Up @@ -91,6 +93,17 @@ bool riscv32_probe(target_s *const target)
target->breakwatch_set = riscv32_breakwatch_set;
target->breakwatch_clear = riscv32_breakwatch_clear;

switch (target->designer_code) {
case JEP106_MANUFACTURER_RV_GIGADEVICE:
PROBE(gd32vf1_probe);
break;
}

#if PC_HOSTED == 0
gdb_outf("Please report unknown device with Designer 0x%x\n", target->designer_code);
#else
DEBUG_WARN("Please report unknown device with Designer 0x%x\n", target->designer_code);
#endif
return false;
}

Expand Down

0 comments on commit 8fd736a

Please sign in to comment.