mips32: add per-cpu quirks feature
commit3b38226370b21ef1d644cbe303a85c36a58ef365
authorArtur Rojek <contact@artur-rojek.eu>
Sun, 13 Aug 2023 14:47:28 +0000 (13 16:47 +0200)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 26 Aug 2023 11:44:50 +0000 (26 11:44 +0000)
tree24c53283e76864cc0c829a1cb1caf78fbe559544
parent74325dc73d48eb9371fa9ba8d190c46d70abbce3
mips32: add per-cpu quirks feature

Introduce the ability to detect CPUs based on CP0 PRId register and
apply cpu specific quirks, which alter the default ejtag behavior.

First of those is EJTAG_QUIRK_PAD_DRET, which makes sure extra NOPs are
placed after the DRET instruction on exit from debug mode. This fixes
resume behavior on Ingenic JZ4780 SoC.

The proper detection of some (currently unsupported) CPUs becomes quite
complicated, so please consult the following Linux kernel code when
adding new CPUs:
* arch/mips/include/asm/cpu.h
* arch/mips/kernel/cpu-probe.c

Change-Id: I0f413d5096cd43ef346b02cea85024985b7face6
Signed-off-by: Artur Rojek <contact@artur-rojek.eu>
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/7859
Tested-by: jenkins
src/target/Makefile.am
src/target/mips32.c
src/target/mips32.h
src/target/mips_cpu.h [new file with mode: 0644]
src/target/mips_ejtag.c
src/target/mips_m4k.c