Connecting to VisionFive’s JTAG port, a short guide

I’m facing the same issue but with JH7110 based VF2, with integration kernel tree.

Solved (partially) on those upstream-based kernels by appending:

	jtag_pins_uboot: jtag-0 {
			rst-pins {
				pinmux = <GPIOMUX(36, GPOUT_HIGH, GPOEN_DISABLE, GPI_SYS_JTAG_RST)>;
				input-enable;
			};
			tdi-pins {
				pinmux = <GPIOMUX(61, GPOUT_HIGH, GPOEN_DISABLE, GPI_SYS_JTAG_TDI)>;
				input-enable;
			};
			tms-pins {
				pinmux = <GPIOMUX(63, GPOUT_HIGH, GPOEN_DISABLE, GPI_SYS_JTAG_TMS)>;
				input-enable;
			};
			tck-pins {
				pinmux = <GPIOMUX(60, GPOUT_HIGH, GPOEN_DISABLE, GPI_SYS_JTAG_TCK)>;
				input-enable;
			};
			tdo-pins {
				pinmux = <GPIOMUX(44, GPOUT_SYS_JTAG_TDO, GPOEN_SYS_JTAG_TDO, GPI_NONE)>;
				input-disable;
				input-schmitt-disable;
				drive-strength = <2>;
				slew-rate = <0>;
			};
		};

into:

&sysgpio {
	...
}

and replacing the conflicting dtm pinmux with above one:

&tdm {
	pinctrl-names = "default";
	pinctrl-0 = <&jtag_pins_uboot>;
	status = "okay";
};

OpenOCD would still be disconnected shortly when configuring related pinmux but it is possible to reconnect.