Skip to content

Commit

Permalink
!temporary_commit! riscv_dtm_wchlink: add dummy WCH jep106 code
Browse files Browse the repository at this point in the history
  • Loading branch information
perigoso committed Feb 23, 2023
1 parent 49700af commit fba1ab9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/platforms/hosted/riscv_dtm_wchlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include "general.h"
#include "bmp_hosted.h"
#include "general.h"
#include "jep106.h"
#include "riscv_debug.h"
#include "target_probe.h"
#include "target.h"
Expand Down Expand Up @@ -64,7 +65,8 @@ uint8_t riscv_dtm_wchlink_handler()
dtm->dmi_write = riscv_dtm_wchlink_dmi_write;

dtm->version = RISCV_DEBUG_0_13;
// dtm->designer_code = 0xaa55; /* WCHLINK deosn't seem to have a jep106 code assigned */
dtm->designer_code =
JEP106_MANUFACTURER_WCH; /* fixme: WCHLINK deosn't seem to have a jep106 code assigned this is a dummy code */

/* Call higher level code to discover the DMI bus */
riscv_dtm_init(dtm);
Expand Down
4 changes: 4 additions & 0 deletions src/target/jep106.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@
#define JEP106_MANUFACTURER_RASPBERRY 0x913U /* Raspberry Pi */
#define JEP106_MANUFACTURER_RENESAS 0x423U /* Renesas */
#define JEP106_MANUFACTURER_ESPRESSIF 0xc12U /* Espressif */

/* Invalid dummy code purely for testing purposes */
#define JEP106_MANUFACTURER_WCH 0xaa55U

/*
* This JEP code should belong to "Chipcon AS", but is used on RISC-V by GigaDevice,
* so in the unlikely event we need to support chips by them, here be dragons.
Expand Down

0 comments on commit fba1ab9

Please sign in to comment.