OpenWrt One JTAG
Daniel Golle
daniel at makrotopia.org
Thu Feb 27 06:11:23 PST 2025
On Thu, Feb 27, 2025 at 12:07:22PM +0100, Charlemagne Lasse wrote:
> Am Do., 27. Feb. 2025 um 09:41 Uhr schrieb John Crispin <john at phrozen.org>:
> >
> > JTAG has been tested and works fine, I managed to upload a ram uboot and
> > reflash a board. obviously no mikrobus module can be populated. However
> > it is recommended to use mtk_uartboot for worst case scenario recovery
> > as described in the wiki
>
> i am talking about embedded development (like debugging) and not
> recovery for a board when you have no initialization routine at all.
We mostly intended JTAG for low-level firmware development, such as
building a secure-boot enabled bootchain (ie. porting OP-TEE and fTPM)
to work on that SoC.
The JTAG signals of the SoC are shared with any other signals, due to
pincount constraints of the MT7981B SoC we cannot use all features at
the same time.
pin 4 (JTAG_JTDO): device 11004000.serial function uart group uart2_0_tx_rx
pin 5 (JTAG_JTDI): device 11004000.serial function uart group uart2_0_tx_rx
pin 6 (JTAG_JTMS): device 11007000.i2c function i2c group i2c0_0
pin 7 (JTAG_JTCLK): device 11007000.i2c function i2c group i2c0_0
pin 8 (JTAG_JTRST_N): GPIO pinctrl_moore:520 (gpio-watchdog)
This means you cannot use the UART and I2C exposed on the mikrobus socket at
the same time with JTAG, and the watchdog should not be active.
Also note that apart from Linux pinctrl, also ARM TrustedFirmware-A sets
JTAG pins into GPIO state when started for security reasons:
https://github.com/mtk-openwrt/arm-trusted-firmware/blob/mtksoc/plat/mediatek/mt7981/drivers/gpio/mt7981_gpio.c#L393
Using JTAG to debug the Linux kernel is not very practical anyway, imho
there are better ways to do this. However, if you like to use JTAG to
eg. debug U-Boot or OP-TEE you should build TF-A with ENABLE_JTAG=1.
>
> And it is definitely not working because you can't have the SoC
> configured for JTAG on these pins while using it at the same time for
> SPI and UART. And it is also unclear what the md32_ejtag_en does now.
md32_ejtag_en exposes JTAG of the DSP inside the EN8811H 2.5G Ethernet
PHY. It has nothing to do with the JTAG of the SoC.
More information about the openwrt-devel
mailing list